diff -Nru tickr-0.6.4/aclocal.m4 tickr-0.7.0/aclocal.m4 --- tickr-0.6.4/aclocal.m4 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/aclocal.m4 2020-05-31 19:46:20.000000000 +0000 @@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.15.1 -*- Autoconf -*- + +# Copyright (C) 1996-2017 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -12,40 +11,72 @@ # 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.68],, -[m4_warning([this file was generated for autoconf 2.68. +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'.])]) - -# 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. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- +dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +dnl serial 11 (pkg-config-0.29.1) +dnl +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.1]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) @@ -67,18 +98,19 @@ PKG_CONFIG="" fi fi[]dnl -])# PKG_PROG_PKG_CONFIG +])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 -# -------------------------------------------------------------- +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ @@ -88,8 +120,10 @@ $3])dnl fi]) -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" @@ -101,10 +135,11 @@ else pkg_failed=untried fi[]dnl -])# _PKG_CONFIG +])dnl _PKG_CONFIG -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -112,19 +147,17 @@ else _pkg_short_errors_supported=no fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED +])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 -# -# -# -------------------------------------------------------------- +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl @@ -178,27 +211,107 @@ AC_MSG_RESULT([yes]) $3 fi[]dnl -])# PKG_CHECK_MODULES +])dnl PKG_CHECK_MODULES -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_INSTALLDIR + + +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_NOARCH_INSTALLDIR + + +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR + +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.3], [], +m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -214,24 +327,22 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.3])dnl +[AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # 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/../..'. +# $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 @@ -250,7 +361,7 @@ # # 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 +# 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, @@ -268,30 +379,26 @@ # 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` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 - # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[AC_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 @@ -310,16 +417,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# 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 @@ -329,7 +434,7 @@ # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". +# 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 @@ -342,12 +447,13 @@ AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +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], @@ -355,8 +461,8 @@ # 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'. + # 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 @@ -396,16 +502,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # 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" + # 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 + # 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 @@ -414,8 +520,8 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # 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 @@ -423,7 +529,7 @@ fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # 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} @@ -471,7 +577,7 @@ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES +# 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 @@ -481,9 +587,13 @@ # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) +[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='\' @@ -498,20 +608,18 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # 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 @@ -524,7 +632,7 @@ # 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 + # 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. @@ -536,21 +644,19 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # 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 + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` @@ -568,7 +674,7 @@ # 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 +# 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], @@ -578,18 +684,21 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 16 - # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -602,7 +711,7 @@ # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl +[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 @@ -631,33 +740,42 @@ # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[AC_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], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, +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 +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -666,34 +784,82 @@ [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_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)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_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)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_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 ]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl 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. @@ -715,21 +881,18 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, -# Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # 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 +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -737,16 +900,14 @@ install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST(install_sh)]) +AC_SUBST([install_sh])]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], @@ -762,14 +923,12 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 - # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. @@ -787,7 +946,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# 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 @@ -812,52 +971,14 @@ rm -f confinc confmf ]) -# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 - # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], @@ -865,11 +986,10 @@ $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) - # AM_MISSING_HAS_RUN # ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. +# 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 @@ -882,54 +1002,22 @@ esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + AC_MSG_WARN(['missing' script is too old or missing]) fi ]) -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], @@ -939,7 +1027,7 @@ # -------------------- # 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)]) +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ @@ -953,24 +1041,82 @@ 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) 1999-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2017 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]) -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -981,32 +1127,40 @@ esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - + 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 @@ -1016,46 +1170,118 @@ AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT(yes)]) +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) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 +# 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-2017 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 +# 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 +# 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 +# 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'. +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 - # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. @@ -1069,18 +1295,16 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. +# 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 @@ -1090,76 +1314,114 @@ # 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}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. + +# 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' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - # 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]) + [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 - 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_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 diff -Nru tickr-0.6.4/build-on-win32 tickr-0.7.0/build-on-win32 --- tickr-0.6.4/build-on-win32 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/build-on-win32 2020-05-31 19:46:20.000000000 +0000 @@ -4,30 +4,44 @@ runtime="gtk2-win32-full-runtime" dlls="dlls" +libetm_v="0.5.0" if [ ! -e "$runtime" ]; then - echo "You must copy "$runtime" under tickr-0.6.x/" - exit 1 + echo "You must copy "$runtime" under tickr-0.7.x/" + exit 1 elif [ ! -e "win32_install_stuff/$dlls" ]; then - echo "You must copy "$dlls" under tickr-0.6.x/win32_install_stuff/" - exit 2 + echo "You must copy "$dlls" under tickr-0.7.x/win32_install_stuff/" + exit 2 else - cp win32_install_stuff/Makefile-libetm-win32 src/libetm-0.4.4/Makefile - cp win32_install_stuff/Makefile-tickr-win32 src/tickr/Makefile - cp win32_install_stuff/build-win32-installer src/tickr/ - cp win32_install_stuff/installer.iss ./ - cd src/libetm-0.4.4 - make - cd ../tickr - make - ./build-win32-installer - make clean - cd ../libetm-0.4.4 - make clean - cd ../.. - rm src/libetm-0.4.4/Makefile - rm src/tickr/Makefile - rm src/tickr/build-win32-installer - rm installer.iss - exit 0 + cp src/libetm-"$libetm_v"/Makefile-libetm-win32 src/libetm-"$libetm_v"/Makefile + cp src/tickr/Makefile-tickr-win32 src/tickr/Makefile + cp win32_install_stuff/build-win32-installer src/tickr/ + cp win32_install_stuff/installer.iss ./ + cd src/libetm-"$libetm_v" + make + exit_value1="$?" + cd ../tickr + if [ "$exit_value1" = 0 ]; then + printf "\n=== libetm make: OK ===\n\n" + make + if [ "$?" = 0 ]; then + printf "\n=== tickr make: OK ===\n\n" + build-win32-installer + else + printf "\n=== tickr make: ERROR ===\nPress any key\n\n" + read k + fi + make clean + else + printf "\n=== libetm make: ERROR ===\nPress any key\n\n" + read k + fi + cd ../libetm-"$libetm_v" + make clean + cd ../.. + rm src/libetm-"$libetm_v"/Makefile + rm src/tickr/Makefile + rm src/tickr/build-win32-installer + rm installer.iss + exit 0 fi diff -Nru tickr-0.6.4/ChangeLog tickr-0.7.0/ChangeLog --- tickr-0.6.4/ChangeLog 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/ChangeLog 2020-05-31 19:46:20.000000000 +0000 @@ -1,12 +1,220 @@ +tickr version 0.7.0 +------------------- + +- Fix segfaults and *freeze* with FList's when adding invalid or + unreachable URLs (in tickr_feepicker.c). (May 31 2020) + +- Get correct link offsets with reverse scrolling. (May 31 2020) + +- Fix compiling issues for win32 version. (May 25 2020) + +- Fix incorrect visual display of bidi text with reverse scrolling. + Will need more feedback anyways. (May 25 2020) + +- Fix the flickering-every-500-ms issue on Linux Mint 18 Cinnamon, as + well as the weird on screen square artifact, in tickr_main.c: + update_win_dims_and_loc(), thanks to Trevor Hemsley contribution. + (May 11 2020) + +- Add time of OPML export (as a comment) in tickr_opml.c. (Dec 17 2018) + +- In tickr_feedpicker.c, change + "Enter (rank and) URL:" + to less confusing + "New Feed -> Enter (rank and) URL:". + (Mar 19 2018) + +- Static global var shift_counter now member of TickerEnv struct. + (May 23 2017) + +- Fix no more functionnal check_for_updates() (https ? / website + migration ?) (May 21 2017) + +- Fix get_resource()->link_and_offset big issues. (May 17 2017) + +- Fix segfaults in feed picker win -> add/update with unreachable or + invalid URLs. (Mar 15 2017) + +- Replace __FUNCTION__ with __func__ in all src files, to fix new + -Wpedantic warnings about non-standard predefined identifiers in gcc5. + (Feb 12 2017) + +- Add donate button in about win. (Jan 15 2017) + +- Fix many program startup issues. (Dec 12 2016) + +- get_new_url() renamed manage_list_and_selection(). (Dec 12 2016) + +- Fix UTF-8 encoding related issues. (Dec 11 2016) + +- Remove 'cutline-delimiter' param, not used/needed anymore. + (Nov 29 2016) + +- New params: 'clocksec', 'clock12h' and 'clockdate'. (Nov 25 2016) + +- Now using logging macros from libetm. (Nov 18 2016) + +- New 'connect-timeout' and 'sendrecv-timeout' CLI options are now + settings (saved in config file). Add them in connection settings win. + (Oct 30 2016) + +- Add 'full settings' and 'connection settings' buttons in quick + settings wins, and 'connection settings' button in full settings wins. + (Oct 27 2016) + +- New 'override_redirect' param (*very* experimental). (Oct 26 2016) + +- Remove unusable 'fullscreen' param. (Oct 26 2016) + +- Allow authentication username and proxy username to contain spaces. + (Oct 24 2016) + +- Try to fix flickering on Linux Mint 18 Cinnamon because of calling + update_win_dims_and_loc() every 500 ms. Not working. (Aug 15 2016) + +- New *experimental* 'fullscreen' param. (Apr 5 2016) + +- Add HTTP status code 410: Gone. (Mar 31 2016) + +- info_win_wait() renamed info_win_no_block(), which is less confusing, + plus BLOCK/NO_BLOCK helpers for warning(). (Mar 20 2016) + +- Improved big_error() and warning(). (Mar 19 2016) + +- Fix a few reverse scrolling issues. Still a lot to do. (Feb 25 2016) + +- Reload delay now up to 1440 mn = 24 h. 0 = never force reload. + Actually, in multiple selections mode, all feeds are always reloaded + sequentially, because there is no caching mechanism involved. + (Nov 22 2015) + +- Segfault signal (SIGSEGV) handling. (Sep 24 2015) + +- Change 'sfpickercloseswhenpointerleaves' option name to + 'sfeedpickerautoclose'. (Sep 22 2015) + +- Change 'mousewheelscroll' option name to 'mousewheelaction'. + (Sep 22 2015) + +- Former "Preferences" dialog renamed to "Full Settings", and new easy + setup dialog called "Preferences". Add tooltips. Also a few changes + and fixes. (Sep 22 2015) + +- New 'current feed' button in feed organizer. Also add tooltips. + (Sep 21 2015) + +- Find/use default browser on Linux. (Sep 21 2015) + +- Add default response parameter to question_win() and set default + responses. (Sep 21 2015) + +- HTTPS support with GnuTLS. (Sep 1 2015) + +- load_resource() -> load_resource_from_selection() (first name is + confusing/not descriptive enough). (Aug 24 2015) + +- New 'connect-timeout' and 'sendrecv-timeout' CLI only options, which + override default timeout values, if proxy or slow internet link. + Thanks to G4JC for his patch. (LP: #1475797) (Jul 20 2015) + +- New 'dumperrorcodes' CLI arg. (Mar 20 2015) + +- Now parse port numbers in URLs. (Mar 4 2015) + +- Implement reverse scrolling (ie L to R) option. (Mar 3 2015) + +- New 'dumpconfig' CLI arg. (Nov 20 2014) + +- New libetm l_str_insert_at_b() function. (Nov 12 2014) + +- In tickr_main.c: update_pixmap_from_opened_stream(), add + if (resrc->fp != NULL) + before + fseek(resrc->fp, 0, SEEK_SET); + to fix segfault when trying to open an invalid resource or a + non-existing file from CLI. (Nov 8 2014) + +- Improved libetm error hanling and new tickr_error.c/h modules. + (Nov 6 2014) + +- In check_main_win_always_on_top(), change: + gtk_window_set_keep_above(GTK_WINDOW(env->win), BOOLEAN); + to: + gtk_window_set_keep_above(GTK_WINDOW(env->win), BOOLEAN); + gdk_window_set_keep_above(GDK_WINDOW(env->win->window), BOOLEAN); + to (try to) fix always-on-top issues on some DE, like: + https://aur.archlinux.org/packages/tickr/ + Need feedback to know if this actually makes a difference. + (Oct 30 2014) + +- Quick hack to fix remaining 1 pixel wide line when enabling then + disabling left clock, because then vbox_clock/drwa_clock min size is + still 1x1 (not 0x0) and is the first widget packed in main_hbox. + So, when no clock is set, we make sure the 'empty clock widget' is + always on the right side, ie we do: + gtk_box_reorder_child(GTK_BOX(main_hbox), vbox_clock, 1) + (Oct 30 2014) + +- When adding a feed to the feed list, new option to force an + invalid/unreachable one to be kept anyways. (Oct 22 2014) + +- Add IS_FLIST() test in tickr_feedpicker.c: + add_feed_to_flnode_and_list_store() to fix f_list_search() invalid + node error, when trying to add one feed to an *empty* list. + (LP: #1272129) (Oct 22 2014) + +- New free_all() function to release all allocated memory before + exiting. (Oct 21 2014) + +- Fix maximizing feed organizer window doesn't expend scrolled window: + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), sc_win, + TRUE, TRUE, 0); + (Oct 18 2014) + +- Improved long strings formatting in info_win() with + insert_newlines_if_too_long(). (Oct 17 2014) + +- Change g_remove() to g_unlink() because we deal only with files. + Also add a silly hack to prevent issues with win32 appdata dir user + permissions unholy mess. (Oct 17 2014) + +- 'disable screen limits' option now applies to x position too. + (Sep 22 2014) + +- Add 'marked items' stuff in UI and params. (Sep 17 2014) + +- Change function names in menu_item array from function_name2 to + function_name0 because function_name0 are always called before + function_name so using 2 is just confusing. (Sep 11 2014) + +- A few changes in tickr_feedpicker.c (line 393). (May 15 2014) + +- Fix 'disablepopups' option not effective on 'no-ui' option and allow + 'no-ui' option to be effective if 1st *or* *2nd* arg. (May 2 2014) + +- Fix a few build/compile issues on win32. (Apr 30 2014) + +- Stream sockets API moved to libetm. (Nov 10 2013) + +- New libetm 'zboolean' type. (Nov 8 2013) + +- Not-working-as-expected and never-used win_with_spinner() stuff now + commented out. (Oct 14 2013) + +- Feed title / item title / item description pages removed (commented + out) from quick setup. (Oct 5 2013) + +- "Open Feed" in menu changed to "Feed Organizer" in tickr_main.c and + "Feed Picker" window title changed to "Feed Organizer" in + tickr_feedpicker.c. (Oct 5 2013) + + tickr version 0.6.4 ------------------- - In pref windows, some setting changes (like 'read n items per feed') - need the stream to be reloaded, so now we use: - current_feed(); - instead of: - update_pixmap_from_opened_stream(); - (May 23 2013) + need the stream to be reloaded, so now we use current_feed() instead + of update_pixmap_from_opened_stream(). (May 23 2013) - Fix 'quick feed picker (selected feeds) closes when pointer leaves win area' and implement it as a setting. (May 22 2013) @@ -245,7 +453,7 @@ - Use table in resource properties window. (May 2O 2012) -- Fix a bug in f_list_load_from_file() in tickr_list.c which uncorrectly +- Fix a bug in f_list_load_from_file() in tickr_list.c which incorrectly retrieves any feed title string containing TITLE_TAG_CHAR when TITLE_TAG_CHAR has not been removed from string first, for instance: 'NYT > World' -> ' World'. (May 2O 2012) diff -Nru tickr-0.6.4/compile tickr-0.7.0/compile --- tickr-0.6.4/compile 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/compile 2020-05-31 19:46:20.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh -# Wrapper for compilers which do not understand `-c -o'. +# Wrapper for compilers which do not understand '-c -o'. -scriptversion=2009-10-06.20; # UTC +scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software -# Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -29,21 +28,224 @@ # bugs to or send patches to # . +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + 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 +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'. +right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF @@ -53,11 +255,13 @@ echo "compile $scriptversion" exit $? ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; esac ofile= cfile= -eat= for arg do @@ -66,8 +270,8 @@ 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. + # 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) @@ -94,10 +298,10 @@ done if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a + # 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 + # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi @@ -106,7 +310,7 @@ 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 +# 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 diff -Nru tickr-0.6.4/config.h.in tickr-0.7.0/config.h.in --- tickr-0.6.4/config.h.in 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/config.h.in 2020-05-31 19:46:20.000000000 +0000 @@ -65,9 +65,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - /* Name of package */ #undef PACKAGE diff -Nru tickr-0.6.4/configure tickr-0.7.0/configure --- tickr-0.6.4/configure 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/configure 2020-05-31 19:46:20.000000000 +0000 @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for tickr 0.6.4. +# Generated by GNU Autoconf 2.69 for tickr 0.7.0. # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -136,6 +134,31 @@ # 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 @@ -169,7 +192,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +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'\" && @@ -214,21 +238,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + 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 : @@ -331,6 +359,14 @@ } # 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 @@ -452,6 +488,10 @@ 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). @@ -486,16 +526,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # 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 -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -507,28 +547,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +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'" @@ -560,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='tickr' PACKAGE_TARNAME='tickr' -PACKAGE_VERSION='0.6.4' -PACKAGE_STRING='tickr 0.6.4' +PACKAGE_VERSION='0.7.0' +PACKAGE_STRING='tickr 0.7.0' PACKAGE_BUGREPORT='manutm007@gmail.com' PACKAGE_URL='' @@ -605,6 +625,10 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS +FRIBIDI_LIBS +FRIBIDI_CFLAGS +GNUTLS_LIBS +GNUTLS_CFLAGS XML2_LIBS XML2_CFLAGS GTK2_LIBS @@ -635,6 +659,10 @@ LDFLAGS CFLAGS CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__untar am__tar AMTAR @@ -677,6 +705,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -699,6 +728,7 @@ ac_subst_files='' ac_user_opts=' enable_option_checking +enable_silent_rules enable_dependency_tracking with_x ' @@ -718,7 +748,11 @@ GTK2_CFLAGS GTK2_LIBS XML2_CFLAGS -XML2_LIBS' +XML2_LIBS +GNUTLS_CFLAGS +GNUTLS_LIBS +FRIBIDI_CFLAGS +FRIBIDI_LIBS' # Initialize some variables set by options. @@ -757,6 +791,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1009,6 +1044,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1146,7 +1190,7 @@ 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 + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1174,8 +1218,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1261,7 +1303,7 @@ # 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 tickr 0.6.4 to adapt to many kinds of systems. +\`configure' configures tickr 0.7.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1301,6 +1343,7 @@ --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] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1331,7 +1374,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tickr 0.6.4:";; + short | recursive ) echo "Configuration of tickr 0.7.0:";; esac cat <<\_ACEOF @@ -1339,8 +1382,12 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1366,6 +1413,13 @@ GTK2_LIBS linker flags for GTK2, overriding pkg-config XML2_CFLAGS C compiler flags for XML2, overriding pkg-config XML2_LIBS linker flags for XML2, overriding pkg-config + GNUTLS_CFLAGS + C compiler flags for GNUTLS, overriding pkg-config + GNUTLS_LIBS linker flags for GNUTLS, overriding pkg-config + FRIBIDI_CFLAGS + C compiler flags for FRIBIDI, overriding pkg-config + FRIBIDI_LIBS + linker flags for FRIBIDI, 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. @@ -1433,10 +1487,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tickr configure 0.6.4 -generated by GNU Autoconf 2.68 +tickr configure 0.7.0 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +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 @@ -1549,7 +1603,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1856,8 +1910,8 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tickr $as_me 0.6.4, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by tickr $as_me 0.7.0, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2204,7 +2258,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version='1.11' +am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2272,7 +2326,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if 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. @@ -2330,9 +2384,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2343,32 +2394,40 @@ esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi + 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 @@ -2380,6 +2439,16 @@ 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. @@ -2390,8 +2459,8 @@ 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` +# 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 @@ -2402,15 +2471,15 @@ esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +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;} + { $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 +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -2419,10 +2488,10 @@ esac fi -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# 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. +# 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. @@ -2441,7 +2510,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -2481,7 +2550,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -2532,7 +2601,7 @@ test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + 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) '* | \ @@ -2561,12 +2630,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -2585,7 +2648,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -2649,6 +2712,45 @@ 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." @@ -2671,7 +2773,7 @@ # Define the identity of the package. PACKAGE='tickr' - VERSION='0.6.4' + VERSION='0.7.0' cat >>confdefs.h <<_ACEOF @@ -2699,12 +2801,22 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -2712,6 +2824,49 @@ +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + ac_config_headers="$ac_config_headers config.h" @@ -2738,7 +2893,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -2778,7 +2933,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -2831,7 +2986,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -2872,7 +3027,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -2930,7 +3085,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -2974,7 +3129,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -3420,8 +3575,7 @@ /* end confdefs.h. */ #include #include -#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); @@ -3505,6 +3659,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -3524,7 +3737,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# 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 @@ -3580,8 +3793,8 @@ # 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'. + # 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 @@ -3616,16 +3829,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # 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" + # 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 + # 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 @@ -3634,8 +3847,8 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # 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 @@ -3643,7 +3856,7 @@ fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # 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} @@ -3698,131 +3911,6 @@ -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 - 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. @@ -3841,7 +3929,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -3881,7 +3969,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -4268,7 +4356,7 @@ for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + 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 @@ -4334,7 +4422,7 @@ for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + 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 @@ -4724,7 +4812,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -4767,7 +4855,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if 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 @@ -5000,7 +5088,189 @@ fi -ac_config_files="$ac_config_files Makefile src/Makefile src/tickr/Makefile src/libetm-0.4.4/Makefile" +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNUTLS" >&5 +$as_echo_n "checking for GNUTLS... " >&6; } + +if test -n "$GNUTLS_CFLAGS"; then + pkg_cv_GNUTLS_CFLAGS="$GNUTLS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gnutls") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GNUTLS_LIBS"; then + pkg_cv_GNUTLS_LIBS="$GNUTLS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gnutls") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls" 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 + GNUTLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls" 2>&1` + else + GNUTLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GNUTLS_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (gnutls) were not met: + +$GNUTLS_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 GNUTLS_CFLAGS +and GNUTLS_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 GNUTLS_CFLAGS +and GNUTLS_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 + GNUTLS_CFLAGS=$pkg_cv_GNUTLS_CFLAGS + GNUTLS_LIBS=$pkg_cv_GNUTLS_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 FRIBIDI" >&5 +$as_echo_n "checking for FRIBIDI... " >&6; } + +if test -n "$FRIBIDI_CFLAGS"; then + pkg_cv_FRIBIDI_CFLAGS="$FRIBIDI_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fribidi\""; } >&5 + ($PKG_CONFIG --exists --print-errors "fribidi") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FRIBIDI_CFLAGS=`$PKG_CONFIG --cflags "fribidi" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$FRIBIDI_LIBS"; then + pkg_cv_FRIBIDI_LIBS="$FRIBIDI_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fribidi\""; } >&5 + ($PKG_CONFIG --exists --print-errors "fribidi") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FRIBIDI_LIBS=`$PKG_CONFIG --libs "fribidi" 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 + FRIBIDI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fribidi" 2>&1` + else + FRIBIDI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fribidi" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$FRIBIDI_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (fribidi) were not met: + +$FRIBIDI_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 FRIBIDI_CFLAGS +and FRIBIDI_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 FRIBIDI_CFLAGS +and FRIBIDI_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 + FRIBIDI_CFLAGS=$pkg_cv_FRIBIDI_CFLAGS + FRIBIDI_LIBS=$pkg_cv_FRIBIDI_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + +ac_config_files="$ac_config_files Makefile src/Makefile src/tickr/Makefile src/libetm-0.5.0/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -5111,6 +5381,14 @@ 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='#' @@ -5425,16 +5703,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # 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 -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -5494,28 +5772,16 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# 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'" @@ -5536,8 +5802,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tickr $as_me 0.6.4, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by tickr $as_me 0.7.0, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5602,11 +5868,11 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tickr config.status 0.6.4 -configured by $0, generated by GNU Autoconf 2.68, +tickr config.status 0.7.0 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +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." @@ -5697,7 +5963,7 @@ _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 + 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' @@ -5736,7 +6002,7 @@ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/tickr/Makefile") CONFIG_FILES="$CONFIG_FILES src/tickr/Makefile" ;; - "src/libetm-0.4.4/Makefile") CONFIG_FILES="$CONFIG_FILES src/libetm-0.4.4/Makefile" ;; + "src/libetm-0.5.0/Makefile") CONFIG_FILES="$CONFIG_FILES src/libetm-0.5.0/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac @@ -6333,7 +6599,7 @@ case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # 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 @@ -6346,7 +6612,7 @@ # 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 + # 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. @@ -6380,21 +6646,19 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # 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 + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || diff -Nru tickr-0.6.4/configure.ac tickr-0.7.0/configure.ac --- tickr-0.6.4/configure.ac 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/configure.ac 2020-05-31 19:46:20.000000000 +0000 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.67]) -AC_INIT([tickr], [0.6.4], [manutm007@gmail.com]) +AC_INIT([tickr], [0.7.0], [manutm007@gmail.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADERS([config.h]) @@ -30,9 +30,11 @@ PKG_CHECK_MODULES(GTK2, gtk+-2.0, ,) PKG_CHECK_MODULES(XML2, libxml-2.0, ,) +PKG_CHECK_MODULES(GNUTLS, gnutls, ,) +PKG_CHECK_MODULES(FRIBIDI, fribidi, ,) AC_CONFIG_FILES([Makefile src/Makefile src/tickr/Makefile - src/libetm-0.4.4/Makefile]) + src/libetm-0.5.0/Makefile]) AC_OUTPUT diff -Nru tickr-0.6.4/debian/changelog tickr-0.7.0/debian/changelog --- tickr-0.6.4/debian/changelog 2018-04-03 12:47:15.000000000 +0000 +++ tickr-0.7.0/debian/changelog 2020-06-13 14:44:10.000000000 +0000 @@ -1,16 +1,224 @@ -tickr (0.6.4-1build1) bionic; urgency=high +tickr (0.7.0-3) unstable; urgency=low - * No change rebuild to pick up -fPIE compiler default + * Fix linking issues in tickr-0.7.0/src/tickr/Makefile.am: + tickr_LDADD = ../libetm-0.5.0/libetm.a $(GTK2_LIBS) $(XML2_LIBS)\ + $(GNUTLS_LIBS) $(FRIBIDI_LIBS) -lm + + -- Emmanuel Thomas-Maurin Sat, 13 Jun 2020 16:44:10 +0200 + + +tickr (0.7.0-2) unstable; urgency=low + + * Add missing + 'libetm_a_LDFLAGS = -lm' + in tickr-0.7.0/src/libetm-0.5.0/Makefile.am. + + -- Emmanuel Thomas-Maurin Thu, 11 Jun 2020 11:56:06 +0200 + + +tickr (0.7.0-1) unstable; urgency=low + + * Fix segfaults and *freeze* with FList's when adding invalid or + unreachable URLs (in tickr_feepicker.c). + + * Get correct link offsets with reverse scrolling. + + * Fix compiling issues for win32 version. + + * Fix incorrect visual display of bidi text with reverse scrolling. + Will need more feedback anyways. + + * Fix the flickering-every-500-ms issue on Linux Mint 18 Cinnamon, as + well as the weird on screen square artifact, in tickr_main.c: + update_win_dims_and_loc(), thanks to Trevor Hemsley contribution. + + * Add time of OPML export (as a comment) in tickr_opml.c. + + * In tickr_feedpicker.c, change + "Enter (rank and) URL:" + to less confusing + "New Feed -> Enter (rank and) URL:". + + * Static global var shift_counter now member of TickerEnv struct. + + * Fix no more functionnal check_for_updates() (https ? / website + migration ?) + + * Fix get_resource()->link_and_offset big issues. + + * Fix segfaults in feed picker win -> add/update with unreachable or + invalid URLs. + + * Replace __FUNCTION__ with __func__ in all src files, to fix new + -Wpedantic warnings about non-standard predefined identifiers in gcc5. + + * Add donate button in about win. + + * Fix many program startup issues + + * get_new_url() renamed manage_list_and_selection(). + + * Fix UTF-8 encoding related issues. + + * Remove 'cutline-delimiter' param, not used/needed anymore. + + * New params: 'clocksec', 'clock12h' and 'clockdate'. + + * Now using logging macros from libetm. + + * New 'connect-timeout' and 'sendrecv-timeout' CLI options are now + settings (saved in config file). Add them in connection settings + win. + + * Add 'full settings' and 'connection settings' buttons in quick + settings win, and 'connection settings' button in full settings + win. + + * New 'override_redirect' param (*very* experimental). + + * Remove unusable 'fullscreen' param. + + * Allow authentication username and proxy username to contain spaces. + + * Try to fix flickering on Linux Mint 18 Cinnamon because of calling + update_win_dims_and_loc() every 500 ms. Not working. + + * New *experimental* 'fullscreen' param. + + * Add HTTP status code 410: Gone. + + * info_win_wait() renamed info_win_no_block(), which is less + confusing, plus BLOCK/NO_BLOCK helpers for warning(). + + * Improved big_error() and warning(). + + * Fix a few reverse scrolling issues. Still a lot to do. + + * Reload delay now up to 1440 mn = 24 h. 0 = never force reload. + Actually, in multiple selections mode, all feeds are always reloaded + sequentially, because there is no caching mechanism involved. + + * Segfault signal (SIGSEGV) handling. + + * Change 'sfpickercloseswhenpointerleaves' option name to + 'sfeedpickerautoclose'. + + * Change 'mousewheelscroll' option name to 'mousewheelaction'. + + * Former "Preferences" dialog renamed to "Full Settings", and new easy + setup dialog called "Preferences". Add tooltips. Also a few changes + and fixes. + + * New 'current feed' button in feed organizer. Also add tooltips. + + * Find/use default browser on Linux. + + * Add default response parameter to question_win() and set default + responses. + + * HTTPS support with GnuTLS. + + * load_resource() -> load_resource_from_selection() (first name is + confusing/not descriptive enough). + + * New 'connect-timeout' and 'sendrecv-timeout' CLI only options, which + override default timeout values, if proxy or slow internet link. + Thanks to G4JC for his patch. (LP: #1475797) + + * New '-dumperrorcodes' CLI arg. + + * Now parse port numbers in URLs. + + * Implement reverse scrolling (ie L to R) option. + + * New '-dumpconfig' CLI arg. + + * New libetm l_str_insert_at_b() function. + + * In tickr_main.c: update_pixmap_from_opened_stream(), add + if (resrc->fp != NULL) + before + fseek(resrc->fp, 0, SEEK_SET); + to fix segfault when trying to open an invalid resource or a + non-existing file from CLI. + + * Improved libetm error handling and new tickr_error.c/h modules. + + * In check_main_win_always_on_top(), change: + gtk_window_set_keep_above(GTK_WINDOW(env->win), BOOLEAN); + to: + gtk_window_set_keep_above(GTK_WINDOW(env->win), BOOLEAN); + gdk_window_set_keep_above(GDK_WINDOW(env->win->window), BOOLEAN); + to (try to) fix always-on-top issues on some DE, like: + https://aur.archlinux.org/packages/tickr/ + Need feedback to know if this actually makes a difference. + + * Quick hack to fix remaining 1 pixel wide line when enabling then + disabling left clock, because then vbox_clock/drwa_clock min size is + still 1x1 (not 0x0) and is the first widget packed in main_hbox. + So, when no clock is set, we make sure the 'empty clock widget' is + always on the right side, ie we do: + gtk_box_reorder_child(GTK_BOX(main_hbox), vbox_clock, 1) + + * When adding a feed to the feed list, new option to force an + invalid/unreachable one to be kept anyways. + + * Add IS_FLIST() test in tickr_feedpicker.c: + add_feed_to_flnode_and_list_store() to fix f_list_search() invalid + node error, when trying to add one feed to an *empty* list. + (LP: #1272129) + + * New free_all() function to release all allocated memory before + exiting. + + * Fix maximizing feed organizer window doesn't expend scrolled window: + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), sc_win, + TRUE, TRUE, 0); + + * Improved long strings formatting in info_win() with + insert_newlines_if_too_long(). + + * Change g_remove() to g_unlink() because we deal only with files. + Also add a silly hack to prevent issues with win32 appdata dir user + permissions unholy mess. + + * 'disable screen limits' option now applies to x position too. + + * Add 'marked items' stuff in UI and params. + + * Change function names in menu_item array from function_name2 to + function_name0 because function_name0 are always called before + function_name so using 2 is just confusing. + + * A few changes in tickr_feedpicker.c (line 393). + + * Fix 'disablepopups' option not effective on 'no-ui' option and allow + 'no-ui' option to be effective if 1st *or* *2nd* arg. + + * Fix a few build/compile issues on win32. + + * Stream sockets API moved to libetm. + + * New libetm 'zboolean' type. + + * Not-working-as-expected and never-used win_with_spinner() stuff now + commented out. + + * Feed title / item title / item description pages removed (commented + out) from quick setup. + + * "Open Feed" in menu changed to "Feed Organizer" in tickr_main.c and + "Feed Picker" window title changed to "Feed Organizer" in + tickr_feedpicker.c. + + -- Emmanuel Thomas-Maurin Sun, 31 May 2020 21:32:22 +0200 - -- Balint Reczey Tue, 03 Apr 2018 12:47:15 +0000 tickr (0.6.4-1) unstable; urgency=low * In pref windows, some setting changes (like 'read n items per feed') - need the stream to be reloaded, so now we use: - current_feed(); - instead of: - update_pixmap_from_opened_stream(); + need the stream to be reloaded, so now we use current_feed() instead + of update_pixmap_from_opened_stream(). * Fix 'quick feed picker (selected feeds) closes when pointer leaves win area' and implement it as a setting. @@ -134,7 +342,7 @@ -- Emmanuel Thomas-Maurin Mon, 04 Feb 2013 17:12:37 +0100 -tickr (0.6.2-1) experimental; urgency=low +tickr (0.6.2-1) unstable; urgency=low * Non standard feed rank support in OPML file. @@ -240,7 +448,7 @@ * Use table in resource properties window. * Fix a bug in f_list_load_from_file() in tickr_list.c which - uncorrectly retrieves any feed title string containing TITLE_TAG_CHAR + incorrectly retrieves any feed title string containing TITLE_TAG_CHAR when TITLE_TAG_CHAR has not been removed from string first, for instance: 'NYT > World' -> ' World'. diff -Nru tickr-0.6.4/debian/compat tickr-0.7.0/debian/compat --- tickr-0.6.4/debian/compat 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/debian/compat 2020-06-13 14:44:10.000000000 +0000 @@ -1 +1 @@ -9 +12 diff -Nru tickr-0.6.4/debian/control tickr-0.7.0/debian/control --- tickr-0.6.4/debian/control 2018-04-03 12:47:15.000000000 +0000 +++ tickr-0.7.0/debian/control 2020-06-13 14:44:10.000000000 +0000 @@ -1,11 +1,10 @@ Source: tickr Section: net Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Emmanuel Thomas-Maurin -Build-Depends: debhelper (>= 9), autotools-dev, libgtk2.0-dev, libxml2-dev -Standards-Version: 3.9.4 -Homepage: http://www.newsrssticker.com +Maintainer: Emmanuel Thomas-Maurin +Build-Depends: debhelper (>= 9), libgtk2.0-dev, libxml2-dev, libgnutls28-dev, libfribidi-dev +Standards-Version: 4.5.0 +Homepage: https://www.open-tickr.net Package: tickr Architecture: any diff -Nru tickr-0.6.4/debian/copyright tickr-0.7.0/debian/copyright --- tickr-0.6.4/debian/copyright 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/debian/copyright 2020-06-13 14:44:10.000000000 +0000 @@ -1,10 +1,10 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: tickr Upstream-Contact: Emmanuel Thomas-Maurin -Source: http://www.newsrssticker.com/unstable-debian/ +Source: https://www.open-tickr.net/unstable-debian/ Files: * -Copyright: 2009-2013 Emmanuel Thomas-Maurin +Copyright: 2009-2020 Emmanuel Thomas-Maurin License: GPL-3+ 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 diff -Nru tickr-0.6.4/debian/menu tickr-0.7.0/debian/menu --- tickr-0.6.4/debian/menu 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/debian/menu 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -?package(tickr):\ - needs="X11"\ - section="Applications/Network/Web News"\ - title="Tickr - RSS Feed Reader"\ - command="/usr/bin/tickr"\ - longtitle="GTK-based highly graphically-customizable RSS Ticker"\ - hints="RSS tickers, RSS readers"\ - icon="/usr/share/tickr/pixmaps/tickr-icon.xpm" diff -Nru tickr-0.6.4/debian/patches/fix_tickr_compile.diff tickr-0.7.0/debian/patches/fix_tickr_compile.diff --- tickr-0.6.4/debian/patches/fix_tickr_compile.diff 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/debian/patches/fix_tickr_compile.diff 2020-06-13 14:44:10.000000000 +0000 @@ -0,0 +1,72 @@ +diff -ur tickr_0.7.0.orig/ChangeLog tickr-0.7.0/ChangeLog +--- tickr_0.7.0.orig/ChangeLog 2020-05-31 21:46:20.000000000 +0200 ++++ tickr-0.7.0/ChangeLog 2020-06-13 16:52:53.230778029 +0200 +@@ -1,6 +1,14 @@ + tickr version 0.7.0 + ------------------- + ++- Fix linking issues in tickr-0.7.0/src/tickr/Makefile.am: ++ tickr_LDADD = ../libetm-0.5.0/libetm.a $(GTK2_LIBS) $(XML2_LIBS)\ ++ $(GNUTLS_LIBS) $(FRIBIDI_LIBS) -lm (Jun 13 2020) ++ ++- Add missing ++ 'libetm_a_LDFLAGS = -lm' ++ in tickr-0.7.0/src/libetm-0.5.0/Makefile.am. (Jun 11 2020) ++ + - Fix segfaults and *freeze* with FList's when adding invalid or + unreachable URLs (in tickr_feepicker.c). (May 31 2020) + +diff -ur tickr_0.7.0.orig/src/libetm-0.5.0/Makefile.am tickr-0.7.0/src/libetm-0.5.0/Makefile.am +--- tickr_0.7.0.orig/src/libetm-0.5.0/Makefile.am 2020-05-31 21:46:20.000000000 +0200 ++++ tickr-0.7.0/src/libetm-0.5.0/Makefile.am 2020-06-13 16:34:32.177349660 +0200 +@@ -2,4 +2,5 @@ + libetm_a_SOURCES = str_mem.c tcp_socket.c error.c misc.c #dllist.c + libetm_a_CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ + -ffast-math -pedantic -Wno-variadic-macros -fmax-errors=5 ++#libetm_a_LDADD = -lm + libsdir = .. +diff -ur tickr_0.7.0.orig/src/libetm-0.5.0/Makefile.in tickr-0.7.0/src/libetm-0.5.0/Makefile.in +--- tickr_0.7.0.orig/src/libetm-0.5.0/Makefile.in 2020-05-31 21:46:20.000000000 +0200 ++++ tickr-0.7.0/src/libetm-0.5.0/Makefile.in 2020-06-13 16:54:03.002100267 +0200 +@@ -304,6 +304,7 @@ + libetm_a_CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ + -ffast-math -pedantic -Wno-variadic-macros -fmax-errors=5 + ++#libetm_a_LDADD = -lm + libsdir = .. + all: all-am + +diff -ur tickr_0.7.0.orig/src/tickr/Makefile.am tickr-0.7.0/src/tickr/Makefile.am +--- tickr_0.7.0.orig/src/tickr/Makefile.am 2020-05-31 21:46:20.000000000 +0200 ++++ tickr-0.7.0/src/tickr/Makefile.am 2020-06-13 16:37:32.831634097 +0200 +@@ -32,9 +32,11 @@ + -ffast-math -pedantic -Wno-variadic-macros -fmax-errors=5 $(GTK2_CFLAGS)\ + $(XML2_CFLAGS) $(GNUTLS_CFLAGS) $(FRIBIDI_CFLAGS) + +-tickr_LDFLAGS = -Wl,-z,defs -Wl,--as-needed ../libetm-0.5.0/libetm.a ++tickr_LDFLAGS = -Wl,-z,defs -Wl,--as-needed ++#../libetm-0.5.0/libetm.a + +-tickr_LDADD = ../libetm-0.5.0/libetm.a $(GTK2_LIBS) $(XML2_LIBS) $(GNUTLS_LIBS) $(FRIBIDI_LIBS) ++tickr_LDADD = ../libetm-0.5.0/libetm.a $(GTK2_LIBS) $(XML2_LIBS) $(GNUTLS_LIBS)\ ++ $(FRIBIDI_LIBS) -lm + + tickr_DATA = ../../images/tickr-icon.png ../../images/tickr-logo.png\ + ../../images/tickr-rss-icon.png ../../images/tickr-icon.xpm +diff -ur tickr_0.7.0.orig/src/tickr/Makefile.in tickr-0.7.0/src/tickr/Makefile.in +--- tickr_0.7.0.orig/src/tickr/Makefile.in 2020-05-31 21:46:20.000000000 +0200 ++++ tickr-0.7.0/src/tickr/Makefile.in 2020-06-13 16:54:03.054099762 +0200 +@@ -334,8 +334,11 @@ + -ffast-math -pedantic -Wno-variadic-macros -fmax-errors=5 $(GTK2_CFLAGS)\ + $(XML2_CFLAGS) $(GNUTLS_CFLAGS) $(FRIBIDI_CFLAGS) + +-tickr_LDFLAGS = -Wl,-z,defs -Wl,--as-needed ../libetm-0.5.0/libetm.a +-tickr_LDADD = ../libetm-0.5.0/libetm.a $(GTK2_LIBS) $(XML2_LIBS) $(GNUTLS_LIBS) $(FRIBIDI_LIBS) ++tickr_LDFLAGS = -Wl,-z,defs -Wl,--as-needed ++#../libetm-0.5.0/libetm.a ++tickr_LDADD = ../libetm-0.5.0/libetm.a $(GTK2_LIBS) $(XML2_LIBS) $(GNUTLS_LIBS)\ ++ $(FRIBIDI_LIBS) -lm ++ + tickr_DATA = ../../images/tickr-icon.png ../../images/tickr-logo.png\ + ../../images/tickr-rss-icon.png ../../images/tickr-icon.xpm + diff -Nru tickr-0.6.4/debian/patches/series tickr-0.7.0/debian/patches/series --- tickr-0.6.4/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/debian/patches/series 2020-06-13 14:44:10.000000000 +0000 @@ -0,0 +1 @@ +fix_tickr_compile.diff diff -Nru tickr-0.6.4/debian/rules tickr-0.7.0/debian/rules --- tickr-0.6.4/debian/rules 2013-05-25 09:22:01.000000000 +0000 +++ tickr-0.7.0/debian/rules 2020-06-13 14:44:10.000000000 +0000 @@ -1,4 +1,3 @@ #!/usr/bin/make -f - %: dh $@ diff -Nru tickr-0.6.4/debian/watch tickr-0.7.0/debian/watch --- tickr-0.6.4/debian/watch 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/debian/watch 2020-06-13 14:44:10.000000000 +0000 @@ -1,4 +1,14 @@ version=3 -http://www.newsrssticker.com/list_all_downloadables.php .*/tickr-(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) #http://www.newsrssticker.com/src/tickr-(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) + +#http://www.newsrssticker.com/list_all_downloadables.php .*/tickr-(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) # Bart Martens Mon, 28 Jan 2013 17:42:12 +0000 + +#http://www.open-tickr.net/list_all_downloadables.php .*/tickr-(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) +# Emmanuel Thomas-Maurin Thu, 02 Apr 2015 02:19:09 +0200 + +#opts=pgpsigurlmangle=s/$/.asc/ http://www.open-tickr.net/list_all_downloadables.php .*/tickr-(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) +# Emmanuel Thomas-Maurin Thu, 02 Apr 2015 02:19:09 +0200 + +https://www.open-tickr.net/list_all_downloadables.php .*/tickr-(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) +# Emmanuel Thomas-Maurin Fri, 29 May 2020 11:34:35 +0200 diff -Nru tickr-0.6.4/depcomp tickr-0.7.0/depcomp --- tickr-0.6.4/depcomp 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/depcomp 2020-05-31 19:46:20.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2009-04-28.21; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. +# Copyright (C) 1999-2017 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 @@ -28,9 +27,9 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -40,11 +39,11 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. + tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . @@ -57,6 +56,66 @@ ;; esac +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -69,6 +128,9 @@ rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -80,18 +142,32 @@ fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # 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 + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc fi case "$depmode" in @@ -114,8 +190,7 @@ done "$@" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -123,13 +198,17 @@ ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -137,31 +216,31 @@ fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then 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. + # 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. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory +## 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. +## 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 '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -179,8 +258,7 @@ "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -188,43 +266,41 @@ 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 + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + 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 ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" + 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" + make_dummy_depfile fi rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # 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$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u @@ -237,9 +313,7 @@ "$@" -M fi stat=$? - - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi @@ -248,44 +322,100 @@ do test -f "$tmpdepfile" && break done - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -297,8 +427,8 @@ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -309,9 +439,8 @@ # '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$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d @@ -322,8 +451,7 @@ "$@" +Maked fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi @@ -333,77 +461,107 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" else - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - 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 + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; #nosideeffect) # This comment above is used by automake to tell side-effect @@ -422,7 +580,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -442,18 +600,18 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # 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. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -503,12 +661,15 @@ touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; @@ -525,7 +686,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -544,10 +705,10 @@ 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" + "$@" -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" @@ -579,23 +740,23 @@ shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; + set fnord "$@" + shift + shift + ;; *) - set fnord "$@" "$arg" - shift - shift - ;; + set fnord "$@" "$arg" + shift + shift + ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -625,6 +786,6 @@ # 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-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru tickr-0.6.4/doc/HOWTO_log_to_output_and_file tickr-0.7.0/doc/HOWTO_log_to_output_and_file --- tickr-0.6.4/doc/HOWTO_log_to_output_and_file 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/doc/HOWTO_log_to_output_and_file 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,2 @@ +tickr 2>&1 | tee tickr.log + diff -Nru tickr-0.6.4/glib-2.26.0-win32-patch/README_glib_patch tickr-0.7.0/glib-2.26.0-win32-patch/README_glib_patch --- tickr-0.6.4/glib-2.26.0-win32-patch/README_glib_patch 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/glib-2.26.0-win32-patch/README_glib_patch 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,28 @@ +Hacking glib-win32 +------------------ + +Replace GetSystemTimeAsFileTime() -> resolution = 15 ms +with timeGetTime() and some extra stuff in gmain.c +(also in gmain.h and gthread.c). + +The patch is also in bugzilla at: + +where you may check for updates. + +Building glib from src +---------------------- + +Download glib-2.26.0 src from gtk.org. + +Apply patch. + +./configure --prefix=/usr/local/glib --with-threads=win32 + +Add "-lwinmm" to G_LIBS_EXTRA in config.status. +Replace "windres" with "windres --use-temp-file" in config.status. + +make +make install + +Compile test.c and run it in /usr/local/glib/bin. +g_timeout_add_full() -> higher resolution ? diff -Nru tickr-0.6.4/glib-2.26.0-win32-patch/README-glib-patch.txt tickr-0.7.0/glib-2.26.0-win32-patch/README-glib-patch.txt --- tickr-0.6.4/glib-2.26.0-win32-patch/README-glib-patch.txt 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/glib-2.26.0-win32-patch/README-glib-patch.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -hacking glib-win32 ------------------- - -replace GetSystemTimeAsFileTime() -> resolution = 15 ms -with timeGetTime() and some extra stuff in gmain.c -(also in gmain.h and gthread.c) - -the patch is also in bugzilla at: - -where yo may check for updates - -building glib from src ----------------------- - -download glib-2.26.0 src from gtk.org - -apply patch - -./configure --prefix=/usr/local/glib --with-threads=win32 - -add "-lwinmm" to G_LIBS_EXTRA in config.status -replace "windres" with "windres --use-temp-file" in config.status - -make -make install - -compile test.c and run it in /usr/local/glib/bin -g_timeout_add_full() -> higher resolution? Binary files /tmp/tmpFJOvAH/g2KkzwRAQH/tickr-0.6.4/images/website_logo/NRT-logo.png and /tmp/tmpFJOvAH/w47WCtdPdi/tickr-0.7.0/images/website_logo/NRT-logo.png differ diff -Nru tickr-0.6.4/INSTALL tickr-0.7.0/INSTALL --- tickr-0.6.4/INSTALL 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/INSTALL 2020-05-31 19:46:20.000000000 +0000 @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software +Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -12,97 +12,96 @@ 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 + Briefly, the shell command './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 +'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 + 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 +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'). +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. + 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 +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 +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 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. + 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 + 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. + 2. Type 'make' to compile the package. - 3. Optionally, type `make check' to run any self-tests that come with + 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 + 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 + user, and only the 'make install' phase executed with root privileges. - 5. Optionally, type `make installcheck' to repeat any self-tests, but + 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 + 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 + 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 + 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 + 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. + 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' +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: + 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 @@ -113,21 +112,21 @@ 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 +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. +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 + 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 +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 +"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" \ @@ -136,100 +135,104 @@ 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. +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 + 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 +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 +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 +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 +'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 +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 +'${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. +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'. +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 + 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 + 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. +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 +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 +overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. +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 + 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 +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" @@ -237,26 +240,26 @@ ./configure CC="cc -nodtk" - On Solaris, don't put `/usr/ucb' early in your `PATH'. This + 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'. +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: + 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 + 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 +_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: +'--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 @@ -265,101 +268,101 @@ 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 + 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 +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'. +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. + 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 +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: +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 +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: +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash -`configure' Invocation +'configure' Invocation ====================== - `configure' recognizes the following options to control how it + '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' +'-h' + Print a summary of all of the options to 'configure', and exit. -`--help=short' -`--help=recursive' +'--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' + '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' +'--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 + traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' +'--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 + suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). -`--srcdir=DIR' +'--srcdir=DIR' Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. + '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. +'--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' +'--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. - +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff -Nru tickr-0.6.4/install-sh tickr-0.7.0/install-sh --- tickr-0.6.4/install-sh 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/install-sh 2020-05-31 19:46:20.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,25 +35,21 @@ # 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 +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# 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 +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ 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. @@ -97,7 +82,7 @@ dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,42 +122,57 @@ -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -186,6 +186,10 @@ 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 @@ -194,13 +198,26 @@ echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -211,16 +228,16 @@ *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -228,9 +245,9 @@ for src do - # Protect names starting with `-'. + # Protect names problematic for 'test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,51 +269,20 @@ echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - # 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' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi @@ -307,74 +293,81 @@ 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;; + # 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. + ;; + *) + # $RANDOM is not portable (e.g. dash); use it when possible to + # lower collision chance + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # As "mkdir -p" follows symlinks and we work in /tmp possibly; so + # create the $tmpdir first (and fail if unsuccessful) to make sure + # that nobody tries to guess the $tmpdir name. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -384,53 +377,51 @@ # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test -z "$d" && continue + 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/ + 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 + # 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 @@ -465,15 +456,12 @@ # 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 && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -486,24 +474,24 @@ # 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 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" + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 diff -Nru tickr-0.6.4/Makefile.in tickr-0.7.0/Makefile.in --- tickr-0.6.4/Makefile.in 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/Makefile.in 2020-05-31 19:46:20.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2017 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. @@ -15,6 +14,61 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -32,37 +86,78 @@ PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ - TODO compile depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = 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 dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_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=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ + COPYING ChangeLog INSTALL NEWS README TODO compile depcomp \ + install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -72,6 +167,7 @@ && 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,'; \ @@ -99,12 +195,14 @@ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -122,6 +220,10 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ @@ -190,6 +292,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -218,7 +321,6 @@ 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*) \ @@ -239,8 +341,8 @@ $(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 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -254,22 +356,25 @@ -rm -f config.h stamp-h1 # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# 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//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + 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; \ @@ -284,57 +389,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -350,12 +410,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -367,15 +422,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +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 @@ -384,9 +435,31 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) @@ -422,13 +495,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -456,41 +526,43 @@ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) + $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__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 @@ -498,11 +570,9 @@ distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -510,22 +580,23 @@ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -548,7 +619,7 @@ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(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' @@ -682,13 +753,12 @@ uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ - ctags-recursive install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) all install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-generic \ - ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + 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-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ @@ -698,8 +768,10 @@ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru tickr-0.6.4/missing tickr-0.7.0/missing --- tickr-0.6.4/missing 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/missing 2020-05-31 19:46:20.000000000 +0000 @@ -1,11 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2009-04-28.21; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,69 +25,40 @@ # 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" + 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 +case $1 in -msg="missing on your system" + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; -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 - ;; + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -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. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -100,272 +70,141 @@ ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; - - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; +# Run the given program, remember its exit status. +"$@"; st=$? - *) - 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 - ;; +# If it succeeded, we are done. +test $st -eq 0 && exit 0 - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi -exit 0 +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -Nru tickr-0.6.4/README tickr-0.7.0/README --- tickr-0.6.4/README 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/README 2020-05-31 19:46:20.000000000 +0000 @@ -3,7 +3,7 @@ on Linux -------- -Required packages are GTK+ and Libxml2 (development ones.) Then do: +Required packages are GTK+2, Libxml2 and GNUTls (development ones.) Then do: ./configure make @@ -28,7 +28,7 @@ this script.) You must also download gtk2-win32-runtime-bin.tar.gz (from -www.newsrssticker.com), the GTK stack runtime which includes a patched +www.open-tickr.net), the GTK stack runtime which includes a patched version of glib. (Of course, you may too get glib-2.26.0 sources, apply the patch, compile it yourself then add it to the GTK runtime stack you will have to build. Visit www.gtk.org for more info.) diff -Nru tickr-0.6.4/README_GTK3 tickr-0.7.0/README_GTK3 --- tickr-0.6.4/README_GTK3 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/README_GTK3 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,4 @@ +From glib-2.34.3/glib/gmain.c in new GTK3-win32 (http://www.gtk.org/download/win32.php) + + Apps that need higher precision in timeouts and clock reads can call + timeBeginPeriod() to increase it as much as they want diff -Nru tickr-0.6.4/src/libetm-0.4.4/COPYING tickr-0.7.0/src/libetm-0.4.4/COPYING --- tickr-0.6.4/src/libetm-0.4.4/COPYING 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/COPYING 1970-01-01 00:00:00.000000000 +0000 @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If 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 convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff -Nru tickr-0.6.4/src/libetm-0.4.4/error.c tickr-0.7.0/src/libetm-0.4.4/error.c --- tickr-0.6.4/src/libetm-0.4.4/error.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/error.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/* - * libetm-0.4 / error.c - Copyright (C) Emmanuel Thomas-Maurin 2008-2012 - * - * - * - Error handling - - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include -#include -#include "libetm.h" - -/* - * Critical error handler for libetm that will call big_error() function - * defined in app, so that appropiate behaviour can be choosen. - */ -int big_error_in_lib(lib_error_code error_code, const char *str) -{ - /* Only call big_error() in app */ - big_error(error_code, 4, LIBETM_NAME "-" LIBETM_VERSION_NUM ": ", str, ": ", get_lib_error_str(error_code)); - return error_code; -} - -const char *get_lib_error_str(lib_error_code error_code) -{ - /* - * *** Make sure this array matches the lib errors enum *** - */ - static char *lib_error_str[] = { - "OK", - "Out of memory", - "Zero requested size", - /*"Negative requested size",*/ - "Null destination string", - "Source string = destination string", - "Strings overlap", - "Attempting to free a null pointer", -#ifdef WIN32_V - "Can't find Win32 Registry Key", - "Can't create Win32 Registry Key", - "Can't save Win32 Registry Key", - "Win32 Registry Key error (undetermined)", -#endif - "OK" - }; - - if (error_code <= LIBETM_LASTERRORCODE) - return (const char *)lib_error_str[error_code]; - else - return ""; -} diff -Nru tickr-0.6.4/src/libetm-0.4.4/error.h tickr-0.7.0/src/libetm-0.4.4/error.h --- tickr-0.6.4/src/libetm-0.4.4/error.h 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/error.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/* - * libetm-0.4 / error.h - Copyright (C) Emmanuel Thomas-Maurin 2008-2012 - * . - */ - -#ifndef INC_LIBETM_ERROR_H -#define INC_LIBETM_ERROR_H - -typedef enum { - LIBETM_OK, - OUT_OF_MEMORY, - ZERO_RQ_SIZE, - /*NEG_RQ_SIZE,*/ - NULL_DEST, - SRC_EQ_DEST, - STR_OVERLAP, - NULL_POINTER_FREE, - RNDSTR_UNKNOWN_MODE, -#ifdef WIN32_V - WIN32REGKEY_NOT_FOUND, - WIN32REGKEY_CREATE_ERROR, - WIN32REGKEY_SAVE_ERROR, - WIN32REGKEY_OTHER_ERROR, -#endif - LIBETM_LASTERRORCODE -} lib_error_code; - -/* - * App defined critical error handler prototype. - * Error code from app should enum above LIB_LASTERRORCODE. - */ -int big_error(int, int, ...); - -/* - * This will call big_error() function defined in app. - */ -int big_error_in_lib(lib_error_code, const char *); - -/* - * If error code > LIBETM_LASTERRORCODE, returns "". - */ -const char *get_lib_error_str(lib_error_code); -#endif /* INC_LIBETM_ERROR_H */ diff -Nru tickr-0.6.4/src/libetm-0.4.4/error_handler_example.c tickr-0.7.0/src/libetm-0.4.4/error_handler_example.c --- tickr-0.6.4/src/libetm-0.4.4/error_handler_example.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/error_handler_example.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * This func's prototype is in libetm / error.h. - * This func is not defined in libetm but in app and it handles errors - * from libetm and app. - * - * Max number of strings = N_STR_MAX, max string length = STR_MAXLEN. - * Outstanding stuff (strings and chars) will be ignored. - */ -int big_error(int big_error_code, int n_str, ...) -{ -#define N_STR_MAX 8 -#define STR_MAXLEN 128 - - char error_str[32 + 32 + (N_STR_MAX * STR_MAXLEN) + 32 + 1]; - va_list str; - int i; - - error_str[0] = '\0'; - str_n_cpy(error_str, "CRITICAL ERROR: ", 32); - if (big_error_code > LIBETM_LASTERRORCODE) - str_n_cat(error_str, APP_NAME ": ", 32); - n_str = MIN(n_str, N_STR_MAX); - va_start(str, n_str); - for (i = 0; i < n_str ; i++) - str_n_cat(error_str, va_arg(str, char *), STR_MAXLEN); - va_end(str); - str_n_cat(error_str, " - Will quit now", 32); - - fprintf(STD_ERR, "%s\n", error_str); - fflush(NULL); - exit(big_error_code); -} diff -Nru tickr-0.6.4/src/libetm-0.4.4/libetm.h tickr-0.7.0/src/libetm-0.4.4/libetm.h --- tickr-0.6.4/src/libetm-0.4.4/libetm.h 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/libetm.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -/* - * libetm-0.4 / libetm.h - Copyright (C) Emmanuel Thomas-Maurin 2008-2012 - * - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef INC_LIBETM_H -#define INC_LIBETM_H - -#define LIBETM_NAME "Libetm" -#define LIBETM_VERSION_NUM "0.4.4" - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#ifndef _ISOC99_SOURCE -#define _ISOC99_SOURCE -#endif - -/*#define LIBETM_EXPERIMENTAL_STUFF*/ - -#ifndef FALSE -# ifndef TRUE -# define FALSE (0) -# define TRUE (!FALSE) -# endif -#endif - -/* Would it be better like that? -#undef FALSE -#undef TRUE -typedef enum { - FALSE = (0), TRUE = (!FALSE) -} boolean;*/ - -#define YES (1) -#define NO (0) - -#ifndef MAX -# define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif - -#ifndef MIN -# define MIN(x,y) ((x) < (y) ? (x) : (y)) -#endif - -#ifndef ABS -# define ABS(x) ((x) > 0 ? (x) : -(x)) -#endif - -/* Do more testing for the 2 following ones */ -#ifndef SIGN -# define SIGN(x) ((x) != 0 ? ((x) > 0 ? 1 : -1) : 0) -#endif - -/* Only if f > 0 */ -#ifndef APPROX -# define APPROX(f) (ABS(((f) - (int)(f)) > 0.5) ? (int)(f) + SIGN((f)) : (int)(f)) -#endif - -#include "str_mem.h" -#include "misc.h" -#include "error.h" -#include "win32_specific.h" -#endif /* INC_LIBETM_H */ diff -Nru tickr-0.6.4/src/libetm-0.4.4/Makefile.am tickr-0.7.0/src/libetm-0.4.4/Makefile.am --- tickr-0.6.4/src/libetm-0.4.4/Makefile.am 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -libs_LIBRARIES = libetm.a -libetm_a_SOURCES = str_mem.c error.c misc.c #win32_specific.c -libetm_a_CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow\ - -Wpointer-arith -ffast-math -pedantic -libsdir = .. diff -Nru tickr-0.6.4/src/libetm-0.4.4/Makefile.in tickr-0.7.0/src/libetm-0.4.4/Makefile.in --- tickr-0.6.4/src/libetm-0.4.4/Makefile.in 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,537 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -subdir = src/libetm-0.4.4 -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - COPYING TODO -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -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)$(libsdir)" -LIBRARIES = $(libs_LIBRARIES) -AR = ar -ARFLAGS = cru -libetm_a_AR = $(AR) $(ARFLAGS) -libetm_a_LIBADD = -am_libetm_a_OBJECTS = libetm_a-str_mem.$(OBJEXT) \ - libetm_a-error.$(OBJEXT) libetm_a-misc.$(OBJEXT) -libetm_a_OBJECTS = $(am_libetm_a_OBJECTS) -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libetm_a_SOURCES) -DIST_SOURCES = $(libetm_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -GTK2_CFLAGS = @GTK2_CFLAGS@ -GTK2_LIBS = @GTK2_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMKMF = @XMKMF@ -XML2_CFLAGS = @XML2_CFLAGS@ -XML2_LIBS = @XML2_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -libs_LIBRARIES = libetm.a -libetm_a_SOURCES = str_mem.c error.c misc.c #win32_specific.c -libetm_a_CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow\ - -Wpointer-arith -ffast-math -pedantic - -libsdir = .. -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libetm-0.4.4/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/libetm-0.4.4/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-libsLIBRARIES: $(libs_LIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libsdir)" || $(MKDIR_P) "$(DESTDIR)$(libsdir)" - @list='$(libs_LIBRARIES)'; test -n "$(libsdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libsdir)'"; \ - $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libsdir)" || exit $$?; } - @$(POST_INSTALL) - @list='$(libs_LIBRARIES)'; test -n "$(libsdir)" || list=; \ - for p in $$list; do \ - if test -f $$p; then \ - $(am__strip_dir) \ - echo " ( cd '$(DESTDIR)$(libsdir)' && $(RANLIB) $$f )"; \ - ( cd "$(DESTDIR)$(libsdir)" && $(RANLIB) $$f ) || exit $$?; \ - else :; fi; \ - done - -uninstall-libsLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(libs_LIBRARIES)'; test -n "$(libsdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(libsdir)'; $(am__uninstall_files_from_dir) - -clean-libsLIBRARIES: - -test -z "$(libs_LIBRARIES)" || rm -f $(libs_LIBRARIES) -libetm.a: $(libetm_a_OBJECTS) $(libetm_a_DEPENDENCIES) $(EXTRA_libetm_a_DEPENDENCIES) - -rm -f libetm.a - $(libetm_a_AR) libetm.a $(libetm_a_OBJECTS) $(libetm_a_LIBADD) - $(RANLIB) libetm.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libetm_a-error.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libetm_a-misc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libetm_a-str_mem.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -libetm_a-str_mem.o: str_mem.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-str_mem.o -MD -MP -MF $(DEPDIR)/libetm_a-str_mem.Tpo -c -o libetm_a-str_mem.o `test -f 'str_mem.c' || echo '$(srcdir)/'`str_mem.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libetm_a-str_mem.Tpo $(DEPDIR)/libetm_a-str_mem.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_mem.c' object='libetm_a-str_mem.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-str_mem.o `test -f 'str_mem.c' || echo '$(srcdir)/'`str_mem.c - -libetm_a-str_mem.obj: str_mem.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-str_mem.obj -MD -MP -MF $(DEPDIR)/libetm_a-str_mem.Tpo -c -o libetm_a-str_mem.obj `if test -f 'str_mem.c'; then $(CYGPATH_W) 'str_mem.c'; else $(CYGPATH_W) '$(srcdir)/str_mem.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libetm_a-str_mem.Tpo $(DEPDIR)/libetm_a-str_mem.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_mem.c' object='libetm_a-str_mem.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-str_mem.obj `if test -f 'str_mem.c'; then $(CYGPATH_W) 'str_mem.c'; else $(CYGPATH_W) '$(srcdir)/str_mem.c'; fi` - -libetm_a-error.o: error.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-error.o -MD -MP -MF $(DEPDIR)/libetm_a-error.Tpo -c -o libetm_a-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libetm_a-error.Tpo $(DEPDIR)/libetm_a-error.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='error.c' object='libetm_a-error.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c - -libetm_a-error.obj: error.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-error.obj -MD -MP -MF $(DEPDIR)/libetm_a-error.Tpo -c -o libetm_a-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libetm_a-error.Tpo $(DEPDIR)/libetm_a-error.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='error.c' object='libetm_a-error.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi` - -libetm_a-misc.o: misc.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-misc.o -MD -MP -MF $(DEPDIR)/libetm_a-misc.Tpo -c -o libetm_a-misc.o `test -f 'misc.c' || echo '$(srcdir)/'`misc.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libetm_a-misc.Tpo $(DEPDIR)/libetm_a-misc.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='misc.c' object='libetm_a-misc.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-misc.o `test -f 'misc.c' || echo '$(srcdir)/'`misc.c - -libetm_a-misc.obj: misc.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-misc.obj -MD -MP -MF $(DEPDIR)/libetm_a-misc.Tpo -c -o libetm_a-misc.obj `if test -f 'misc.c'; then $(CYGPATH_W) 'misc.c'; else $(CYGPATH_W) '$(srcdir)/misc.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libetm_a-misc.Tpo $(DEPDIR)/libetm_a-misc.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='misc.c' object='libetm_a-misc.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-misc.obj `if test -f 'misc.c'; then $(CYGPATH_W) 'misc.c'; else $(CYGPATH_W) '$(srcdir)/misc.c'; fi` - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @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) -installdirs: - for dir in "$(DESTDIR)$(libsdir)"; 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-libsLIBRARIES 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-libsLIBRARIES - -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 - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-libsLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libsLIBRARIES ctags distclean distclean-compile \ - distclean-generic 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-libsLIBRARIES 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 pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-libsLIBRARIES - - -# 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: diff -Nru tickr-0.6.4/src/libetm-0.4.4/Makefile-libetm-linux tickr-0.7.0/src/libetm-0.4.4/Makefile-libetm-linux --- tickr-0.6.4/src/libetm-0.4.4/Makefile-libetm-linux 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/Makefile-libetm-linux 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -# Makefile for libetm-0.4.4 - Linux version - -src = str_mem.c error.c misc.c win32_specific.c -obj = $(src:.c=.o) -headers = libetm.h $(src:.c=.h) - -CC = gcc - -CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ - -ffast-math -pedantic - -all: libetm.a - -$(obj): $(src) $(headers) Makefile - $(CC) $(CFLAGS) -c $(src) - -libetm.a: $(obj) - ar -r libetm.a $(obj) - -.PHONY: install -install: - mkdir -p /usr/local/include/libetm - cp $(headers) /usr/local/include/libetm/ - cp libetm.a /usr/local/lib/ - -.PHONY: uninstall -uninstall: - rm /usr/local/include/libetm/$(headers) - rm /usr/local/lib/libetm.a - -.PHONY: clean -clean: - rm $(obj) libetm.a diff -Nru tickr-0.6.4/src/libetm-0.4.4/Makefile-libetm-win32 tickr-0.7.0/src/libetm-0.4.4/Makefile-libetm-win32 --- tickr-0.6.4/src/libetm-0.4.4/Makefile-libetm-win32 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/Makefile-libetm-win32 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -# Makefile for libetm-0.4.4 - win32 version - -src = str_mem.c error.c misc.c win32_specific.c -obj = $(src:.c=.o) -headers = libetm.h $(src:.c=.h) - -CC = gcc - -CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ - -ffast-math -pedantic -DWIN32_V - -all: libetm.a - -$(obj): $(src) $(headers) Makefile - $(CC) $(CFLAGS) -c $(src) - -libetm.a: $(obj) - ar -r libetm.a $(obj) - -.PHONY: install -install: - mkdir -p /usr/local/include/libetm - cp $(headers) /usr/local/include/libetm/ - cp libetm.a /usr/local/lib/ - -.PHONY: clean -clean: - rm $(obj) libetm.a diff -Nru tickr-0.6.4/src/libetm-0.4.4/misc.c tickr-0.7.0/src/libetm-0.4.4/misc.c --- tickr-0.6.4/src/libetm-0.4.4/misc.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/misc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/* - * libetm-0.4 / misc.c - Copyright (C) Emmanuel Thomas-Maurin 2008-2012 - * - * - * - Misc functions - - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include -#include -#include "libetm.h" - -/* get_libetm_version( O ) = version num - * 1 = copyright - * 2 = license 1/3 - * 3 = license 2/3 - * 4 = license 3/3 - * 5 = compiled date - * > 5 = NULL - */ -const char *get_libetm_version(unsigned int i) -{ - static const char *libv[] = { - LIBETM_NAME " version " LIBETM_VERSION_NUM, - "Copyright (C) Emmanuel Thomas-Maurin 2008-2012 ", - LIBETM_NAME " is free software: you can redistribute it and/or modify\n" - "it under the terms of the GNU General Public License as published by\n" - "the Free Software Foundation, either version 3 of the License, or\n" - "(at your option) any later version.", - LIBETM_NAME " is distributed in the hope that it will be useful,\n" - "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - "GNU General Public License for more details.", - "You should have received a copy of the GNU General Public License\n" - "along with this program. If not, see ", - "Compiled on " __DATE__ " - " __TIME__ - }; - if (i < sizeof(libv) / sizeof(libv[0])) - return (const char *)libv[i]; - else - return NULL; -} - -int question(const char *str) -{ - int i, c; - - while (1) { - printf("%s [y/n] ? ", str); - i = fgetc(stdin); - c = tolower(i); - while (i != '\n' && i != EOF) - (i = fgetc(stdin)); - if (c == 'y') - return TRUE; - else if (c == 'n') - return FALSE; - } -} diff -Nru tickr-0.6.4/src/libetm-0.4.4/misc.h tickr-0.7.0/src/libetm-0.4.4/misc.h --- tickr-0.6.4/src/libetm-0.4.4/misc.h 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/misc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* - * libetm-0.4 / misc.h - Copyright (C) Emmanuel Thomas-Maurin 2008-2012 - * - * - * - Misc functions - - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef INC_LIBETM_MISC_H -#define INC_LIBETM_MISC_H - -/* get_libetm_version( O ) = version num - * 1 = copyright - * 2 = license 1/3 - * 3 = license 2/3 - * 4 = license 3/3 - * 5 = compiled date - * > 5 = NULL - */ -const char *get_libetm_version(unsigned int); -int question(const char *); -#endif /* INC_LIBETM_MISC_H */ diff -Nru tickr-0.6.4/src/libetm-0.4.4/README tickr-0.7.0/src/libetm-0.4.4/README --- tickr-0.6.4/src/libetm-0.4.4/README 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/README 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -This is only a tiny lib with a few functions I use a lot. diff -Nru tickr-0.6.4/src/libetm-0.4.4/str_mem.c tickr-0.7.0/src/libetm-0.4.4/str_mem.c --- tickr-0.6.4/src/libetm-0.4.4/str_mem.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/str_mem.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,416 +0,0 @@ -/* - * libetm-0.4 / str_mem.c - Copyright (C) Emmanuel Thomas-Maurin 2008-2012 - * - * - * - A few strings and memory management functions - - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include -#include -#include -#include -#include -#include "libetm.h" - -/* - * Copy n bytes max from src to dest then add '\0' at end of dest. - */ -char *str_n_cpy(char *dest, const char *src, size_t length) -{ - char *dest_bak = dest; - - if (dest == NULL) - big_error_in_lib(NULL_DEST, "str_n_cpy()"); - - while (length-- > 0 && *src != '\0') - *dest++ = *src++; - - *dest = '\0'; - - return dest_bak; -} - -/* - * Concanate n bytes max of src to dest then add '\0' at end of dest. - * Strings may not be identical and should not overlap. - */ -char *str_n_cat(char *dest, const char *src, size_t length) -{ - char *dest_bak = dest; - - if (dest == NULL) - big_error_in_lib(NULL_DEST, "str_n_cat()"); - else if (src == dest) - big_error_in_lib(SRC_EQ_DEST, "str_n_cat()"); - - while (*dest++ != '\0'); - - str_n_cpy(dest - 1, src, length); - - return dest_bak; -} - -/* - * Create new_l_str (allocate memory) and copy str (can be NULL) to new_l_str. - */ -char *l_str_new(const char *str) -{ - char *new_l_str; - size_t str_len; - - if (str == NULL) - str_len = 0; - else - str_len = strlen(str); - - new_l_str = malloc2(sizeof(char) * (str_len + 1)); - - return str_n_cpy(new_l_str, str, str_len); -} - -/* - * Append l_str_src (can be NULL) to l_str_dest (re-allocate memory as necessary). - * l_str_dest must have been created by l_str_new - strings may overlap. - */ -char *l_str_cat(char *l_str_dest, const char *l_str_src) -{ - char *new_l_str, *l_str_src2; - size_t src_len, dest_len; - - if (l_str_dest == NULL) - big_error_in_lib(NULL_DEST, "l_str_cat()"); - else if (l_str_src == NULL) - return l_str_dest; - - l_str_src2 = l_str_new(l_str_src); - src_len = strlen(l_str_src); - if (src_len == 0) - return l_str_dest; - dest_len = strlen(l_str_dest); - - new_l_str = realloc2(l_str_dest, sizeof(char) * (dest_len + src_len + 1)); - new_l_str = str_n_cat(new_l_str, l_str_src2, src_len); - l_str_free(l_str_src2); - - return new_l_str; -} - -/* - * Free string created by l_str_new() or l_str_cat(). - */ -void l_str_free(char *l_str) -{ - if (l_str != NULL) - free(l_str); - else - big_error_in_lib(NULL_POINTER_FREE, "l_str_free()"); - /* CODE WITH NO EFFECT - l_str = NULL;*/ -} - -/* - * Wrappers for malloc(), realloc(), calloc() and free() which check returned value. - */ -void *malloc2(size_t size) -{ - void *free_block = NULL; - - if (size == 0) - big_error_in_lib(ZERO_RQ_SIZE, "malloc2()"); - /*else if (size < 0) - big_error_in_lib(NEG_RQ_SIZE, "malloc2()");*/ - else if ((free_block = malloc(size)) == NULL) - big_error_in_lib(OUT_OF_MEMORY, "malloc2()"); - - return free_block; -} - -void *realloc2(void *free_block, size_t size) -{ - void *tmp = free_block; - - if (size == 0) - big_error_in_lib(ZERO_RQ_SIZE, "realloc2()"); - /*else if (size < 0) - big_error_in_lib(NEG_RQ_SIZE, "realloc2()");*/ - else if ((free_block = realloc(free_block, size)) == NULL) { - free2(tmp); - big_error_in_lib(OUT_OF_MEMORY, "realloc2()"); - } - - return free_block; -} - -void *calloc2(size_t n_elements, size_t element_size) -{ - void *free_block = NULL; - size_t size = n_elements * element_size; - - if (size == 0) - big_error_in_lib(ZERO_RQ_SIZE, "calloc2()"); - /*else if (size < 0) - big_error_in_lib(NEG_RQ_SIZE, "calloc2()");*/ - else if ((free_block = malloc2(size)) != NULL) - memset(free_block, 0, size); - - return free_block; -} - -void free2(void *free_block) -{ - if (free_block != NULL) - free(free_block); - else - big_error_in_lib(NULL_POINTER_FREE, "free2()"); - - /* CODE WITH NO EFFECT - free_block = NULL;*/ -} - -/* - * Return size in readable format (KiB, MiB, GiB, TiB). - * *** Allow up to 16 simultaneous calls *** - * Convention: we assume 2.5 MiB = 2 MiB + [0.5 x 1024 = 512] KiB, not 500 KiB. - * Otherwise, there is no way to express a value in the range 1000 - 1023, - * so x.y MiB = x MiB + 0.y MiB, that is: not y x 100 KiB but y x 102.4 KiB - * (isn't this a bit confusing?) - */ -const char *readable_size(double size_bytes) -{ - /* We use an array of 16 strings to store the returned string in order - * to allow 16 simultaneous calls (should be enough in most cases?) - * Otherwise, sth like: - * printf("size1 = %s / size2 = %s\n", readable_size(size1), readable_size(size2)) - * would produce unpredictable / false results (like readable sizes are - * equal whereas sizes are different). - */ - static char lib_static_str[16][128]; - unsigned long size_KiB, size_MiB, size_GiB, size_TiB; - static int count = -1; - - count++; - count &= 15; - - size_KiB = (unsigned long)(size_bytes / 1024); - size_MiB = size_KiB / 1024; - size_GiB = size_MiB / 1024; - size_TiB = size_GiB / 1024; - - if (size_TiB >= 1) - snprintf(lib_static_str[count], 128, "%ld.%ld TiB", - size_TiB, ((size_GiB - size_TiB * 1024) * 10) / 1024); - else if (size_GiB >= 1) - snprintf(lib_static_str[count], 128, "%ld.%ld GiB", - size_GiB, ((size_MiB - size_GiB * 1024) * 10) / 1024); - else if (size_MiB >= 1) - snprintf(lib_static_str[count], 128, "%ld.%ld MiB", - size_MiB, ((size_KiB - size_MiB * 1024) * 10) / 1024); - else if (size_KiB >= 1) - snprintf(lib_static_str[count], 128, "%ld.%ld KiB", - size_KiB, (unsigned long)((size_bytes - size_KiB * 1024) * 10) / 1024); - else - snprintf(lib_static_str[count], 128, "%.0f bytes", size_bytes); - - return (const char *)lib_static_str[count]; -} - -/* - * itoa() is not ansi c so this one could be useful. - * *** Allow up to 16 simultaneous calls *** - */ -const char *itoa2(long int n) -{ - /* Array of 16 strings (like for readable_size() - see above) */ - static char lib_static_str[16][128]; - static int count = -1; - - count++; - count &= 15; - snprintf(lib_static_str[count], 128, "%ld", n); - return (const char *)lib_static_str[count]; -} - -/* - * Modify string in place. - */ -char *remove_char_from_str(char *str, char c) -{ - int i, len = strlen(str); - - for (i = 0; i < len && str[i] != '\0';) { - if (str[i] == c) - str_n_cpy(str + i, (const char *)(str + i + 1), len - i); - else - i++; - } - return str; -} - -/* - * Modify string in place. - */ -char *remove_trailing_whitespaces_from_str(char *str) -{ - int i = strlen(str) - 1; - - while (isspace((int)str[i]) && i >= 0) - i--; - str[i + 1] = '\0'; - return str; -} - -/* - * Check that str contains only digits (at least one) and whitespaces - * (may start and/or end with whitespaces), meaning numerical value is - * integer >= 0. - */ -int str_is_num(const char *str2) -{ - char *str, *s; - int i, len; - - if (*str2 == '\0') - return FALSE; - s = str = l_str_new(str2); - len = strlen(str); - i = 0; - while (i < len) - if (isspace((int)*s)) { - i++; - s++; - } else - break; - if (i == len) { - l_str_free(str); - return FALSE; - } - while (i < len) - if (isdigit((int)*s)) { - i++; - s++; - } else - break; - if (i == len) { - l_str_free(str); - return TRUE; - } - while (i < len) - if (isspace((int)*s)) { - i++; - s++; - } else - break; - l_str_free(str); - if (i == len) - return TRUE; - else - return FALSE; -} - -/* - * Check that str contains only whitespaces or is empty. - */ -int str_is_blank(const char *str) -{ - int i = 0, len = strlen(str); - - if (*str == '\0') - return TRUE; - while (i < len) - if (isspace((int)*str)) { - i++; - str++; - } else - break; - if (i == len) - return TRUE; - else - return FALSE; -} - -/* - * Generate a random string up to 1023 chars long. - * mode = a -> alpha / d -> digits / b -> both - */ -const char *rnd_str(char mode, int length) -{ - static char str[1024]; - char str_a[65] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkl"; - char str_d[17] = "1234567890123456"; - char str_b[65] = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ00"; - int i = 0; - - if (length > 1023) - length = 1023; - srand(time(0)); - if (mode == 'a') { - while (i < length) - str[i++] = str_a[rand() & 63]; - } else if (mode == 'd') { - while (i < length) - str[i++] = str_d[rand() & 15]; - } else if (mode == 'b') { - while (i < length) - str[i++] = str_b[rand() & 63]; - } else - big_error_in_lib(RNDSTR_UNKNOWN_MODE, "rnd_str()"); - str[i] = '\0'; - return str; -} - -#ifdef LIBETM_EXPERIMENTAL_STUFF -/* - * Very basic xor sym encryption for small strings (up to 511 chars). - * *** Key must be ascii / if 2 chars match (in str and key) the string is cut off *** - * *** Allow up to 16 simultaneous calls *** - * Works with ascii strings, probably not otherwise so don't try with - * exotic things... - */ -const char *str_crypt(const char *str, const char *key) -{ - /* Array of 16 strings (like for readable_size() - see above) */ - static char str2[16][512]; - static int count = -1; - int i, j; - - count++; - count &= 15; - for (i = 0, j = 0; i < 511 && str[i] != '\0'; i++) { - if (key[j] == '\0') - j = 0; - str2[count][i] = str[i] ^ key[j++]; - } - str2[count][i] = '\0'; - return (const char *)str2[count]; -} - -/* - * Very basic crypto hash. - */ -unsigned long str_crypto_hash(const char *str, const char* salt) -{ - char *str2; - unsigned long hash = 0; - int i = 0; - - str2 = (char *)str_crypt(str, salt); - while (str2[i] != '\0') { - hash += str2[i] * 1024 + (str2[i] + 128) * (32 + i) + str2[i] - 1; - i ++; - } - return hash; -} -#endif diff -Nru tickr-0.6.4/src/libetm-0.4.4/str_mem.h tickr-0.7.0/src/libetm-0.4.4/str_mem.h --- tickr-0.6.4/src/libetm-0.4.4/str_mem.h 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/str_mem.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -/* - * libetm-0.4 / str_mem.h - Copyright (C) Emmanuel Thomas-Maurin 2008-2012 - * - * - * - A few strings and memory management functions - - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef INC_LIBETM_STR_MEM_H -#define INC_LIBETM_STR_MEM_H - -/* - * Copy n bytes max from src to dest then add '\0' at end of dest. - */ -char *str_n_cpy(char *, const char *, size_t); - -/* - * Concanate n bytes max of src to dest then add '\0' at end of dest. - * Strings may not be identical and should not overlap. - */ -char *str_n_cat(char *, const char *, size_t); - -/* - * Create new_l_str (allocate memory) and copy str (can be NULL) to new_l_str. - */ -char *l_str_new(const char *str); - -/* - * Append l_str_src (can be NULL) to l_str_dest (re-allocate memory as necessary). - * l_str_dest must have been created by l_str_new - strings may overlap. - */ -char *l_str_cat(char *, const char *); - -/* - * Free string created by l_str_new() or l_str_cat(). - */ -void l_str_free(char *); - -/* - * Wrappers for malloc(), realloc(), calloc() and free() which check returned value. - */ -void *malloc2(size_t); -void *realloc2(void *, size_t); -void *calloc2(size_t, size_t); -void free2(void *); - -/* - * Return size in readable format (KiB, MiB, GiB, TiB). - * *** Allow up to 16 simultaneous calls *** - * Convention: we assume 2.5 MiB = 2 MiB + [0.5 x 1024 = 512] KiB, not 500 KiB. - * Otherwise, there is no way to express a value in the range 1000 - 1023, - * so x.y MiB = x MiB + 0.y MiB, that is: not y x 100 KiB but y x 102.4 KiB - * (isn't this a bit confusing?) - */ -const char *readable_size(double); - -/* - * itoa() is not ansi c so this one could be useful. - * *** Allow up to 16 simultaneous calls *** - */ -const char *itoa2(long int); - -/* - * Modify string in place. - */ -char *remove_char_from_str(char *, char); - -/* - * Modify string in place. - */ -char *remove_trailing_whitespaces_from_str(char *); - -/* - * Check that str contains only digits (at least one) and whitespaces - * (may start and/or end with whitespaces), meaning numerical value is - * integer >= 0. - */ -int str_is_num(const char *); - -/* - * Check that str contains only whitespaces or is empty. - */ -int str_is_blank(const char *); - -/* - * Generate a random string up to 1023 chars long. - * mode = a -> alpha / d -> digits / b -> both - */ -const char *rnd_str(char, int); - -#ifdef LIBETM_EXPERIMENTAL_STUFF -/* - * Very basic xor sym encryption for small strings (up to 511 chars). - * *** Key must be ascii / if 2 chars match (in str and key) the string is cut off *** - * *** Allow up to 16 simultaneous calls *** - * Works with ascii strings, probably not otherwise so don't try with - * exotic things... - */ -const char *str_crypt(const char *, const char *); - -/* - * Very basic crypto hash. - */ -unsigned long str_crypto_hash(const char *, const char*); -#endif -#endif /* INC_LIBETM_STR_MEM_H */ diff -Nru tickr-0.6.4/src/libetm-0.4.4/TODO tickr-0.7.0/src/libetm-0.4.4/TODO --- tickr-0.6.4/src/libetm-0.4.4/TODO 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/TODO 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -- change func names ? - -- add doubly-linked list api ? - -- add stream sockets api ? diff -Nru tickr-0.6.4/src/libetm-0.4.4/win32_specific.c tickr-0.7.0/src/libetm-0.4.4/win32_specific.c --- tickr-0.6.4/src/libetm-0.4.4/win32_specific.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/win32_specific.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,213 +0,0 @@ -/* - * libetm-0.4 / win32_specific.c - Copyright (C) Emmanuel Thomas-Maurin 2008-2012 - * - * - * - Win32 specific functions - - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifdef WIN32_V - -#include -#include -#include -#include -#include -#include -#include -#include "libetm.h" - -#define APP_WIN32REG_KEYPATH "app_win32_registry_keypath" /* Or whatever */ - -/* Return NULL if error */ -const char *get_appdata_dir() -{ - static TCHAR appdata_dir[MAX_PATH + 1]; - static int i = 0; - - if (i == 0) { - i++; - if (SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, appdata_dir) != S_OK) - i++; - } - if (i == 1) - return (const char *)appdata_dir; - else - return NULL; -} - -/* Return NULL if error */ -const char *get_appdata_dir_w() -{ - static WCHAR appdata_dir[MAX_PATH + 1]; - static int i = 0; - - if (i == 0) { - i++; - if (SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, 0, appdata_dir) != S_OK) - i++; - } - if (i == 1) - return (const char *)appdata_dir; - else - return NULL; -} - -/* Return NULL if error */ -const char *get_progfiles_dir() -{ - static TCHAR progfiles_dir[MAX_PATH + 1]; - static int i = 0; - - if (i == 0) { - i++; - if (SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, 0, progfiles_dir) != S_OK) - i++; - } - if (i == 1) - return (const char *)progfiles_dir; - else - return NULL; -} - -/* key_value must be able to store 255 chars */ -int get_key_value_from_win32registry(const char *key_name, char *key_value) -{ - char app_win32regkey_full[128]; - HKEY hkey; - DWORD type = REG_SZ, buf_size = 256; - LONG result; - - str_n_cpy(app_win32regkey_full, APP_WIN32REG_KEYPATH, 64); - str_n_cat(app_win32regkey_full, key_name, 63); - - if ((result = RegOpenKeyEx(HKEY_CURRENT_USER, app_win32regkey_full, - 0L, KEY_QUERY_VALUE, &hkey)) == ERROR_SUCCESS) { - if (RegQueryValueEx(hkey, NULL, NULL, &type, (unsigned char*)key_value, - &buf_size) == ERROR_SUCCESS) { - RegCloseKey(hkey); - return LIBETM_OK; - } else { - RegCloseKey(hkey); - return WIN32REGKEY_NOT_FOUND; - } - } else { - if (result == ERROR_FILE_NOT_FOUND) - return WIN32REGKEY_NOT_FOUND; - else - return WIN32REGKEY_OTHER_ERROR; - } -} - -int save_key_value_into_win32registry(const char *key_name, const char *key_value) -{ - char app_win32regkey_full[128]; - HKEY hkey; - DWORD disp = 0; - - str_n_cpy(app_win32regkey_full, APP_WIN32REG_KEYPATH, 64); - str_n_cat(app_win32regkey_full, key_name, 63); - - if (RegCreateKeyEx(HKEY_CURRENT_USER, app_win32regkey_full, 0L, - NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hkey, &disp) - == ERROR_SUCCESS) { - if (RegSetValueEx(hkey, NULL, 0L, REG_SZ, (unsigned char *)TEXT(key_value), - 256) == ERROR_SUCCESS) { - RegCloseKey(hkey); - return LIBETM_OK; - } else { - RegCloseKey(hkey); - return WIN32REGKEY_SAVE_ERROR; - } - } else - return WIN32REGKEY_CREATE_ERROR; -} - -/* Return NULL if error */ -const char *get_default_browser_from_win32registry() -{ - static char browser_cmd[512]; - HKEY hkey; - DWORD type = REG_SZ, buf_size = 512; - LONG result; - - if ((result = RegOpenKeyEx(HKEY_CLASSES_ROOT, "http\\shell\\open\\command", - 0L, KEY_QUERY_VALUE, &hkey)) == ERROR_SUCCESS) { - if (RegQueryValueEx(hkey, NULL, NULL, &type, (unsigned char*)browser_cmd, - &buf_size) == ERROR_SUCCESS) { - RegCloseKey(hkey); - return (const char *)browser_cmd; - } else { - RegCloseKey(hkey); - return NULL; - } - } else - return NULL; -} - -/* Return -1 if error */ -int get_win32_taskbar_height() -{ - HWND hwnd; - RECT r; - LPRECT lpRect = &r; - - if ((hwnd = FindWindow("Shell_traywnd", "")) != NULL) { - if (GetWindowRect(hwnd, lpRect)) - return (int) (lpRect->bottom - lpRect->top); - } - return -1; -} - -/* Find up to 15 mac addresses for this computer - * Return NULL if error */ -/*const char **find_mac_addresses() -{ - IP_ADAPTER_INFO *adapter_info; - ULONG buf_len = sizeof(adapter_info); - PIP_ADAPTER_INFO p_adapter_info; - static char macaddr[16][256], tmp[3]; - static char *p_macaddr[16]; - unsigned int i, j = 0; - - adapter_info = (IP_ADAPTER_INFO *)malloc2(sizeof(IP_ADAPTER_INFO)); - buf_len = sizeof(IP_ADAPTER_INFO); - // initial call is supposed to fail - if (GetAdaptersInfo(adapter_info, &buf_len) != ERROR_SUCCESS) { - free2(adapter_info); - adapter_info = (IP_ADAPTER_INFO *)malloc2(buf_len); - } - // 2nd call - if (GetAdaptersInfo(adapter_info, &buf_len) != ERROR_SUCCESS) { - free2(adapter_info); - return NULL; - } else { - p_adapter_info = (PIP_ADAPTER_INFO)adapter_info; - while (p_adapter_info && j < 15) { - macaddr[j][0] = '\0'; - for (i = 0; i < 127 && i < p_adapter_info->AddressLength; i++) { - snprintf(tmp, 3, "%02X", p_adapter_info->Address[i]); - str_n_cat(macaddr[j], tmp, 2); - } - p_macaddr[j] = macaddr[j]; - j++; - p_adapter_info = p_adapter_info->Next; - } - free2(adapter_info); - p_macaddr[j] = NULL; - } - return (const char **)p_macaddr; -}*/ -#endif diff -Nru tickr-0.6.4/src/libetm-0.4.4/win32_specific.h tickr-0.7.0/src/libetm-0.4.4/win32_specific.h --- tickr-0.6.4/src/libetm-0.4.4/win32_specific.h 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.4.4/win32_specific.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* - * libetm-0.4 / win32_specific.h - Copyright (C) Emmanuel Thomas-Maurin 2008-2012 - * - * - * - Win32 specific functions - - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef INC_LIBETM_WIN32_SPECIFIC_H -#define INC_LIBETM_WIN32_SPECIFIC_H - -#ifdef G_OS_WIN32 -# ifndef WIN32_V -# define WIN32_V -# endif -#endif - -#ifdef WIN32_V -/* Return NULL if error */ -const char *get_appdata_dir(); -const char *get_appdata_dir_w(); -const char *get_progfiles_dir(); -/* key_value must be able to store 255 chars */ -int get_key_value_from_win32registry(const char *, char *); -int save_key_value_into_win32registry(const char *, const char *); -/* Return NULL if error */ -const char *get_default_browser_from_win32registry(); -/* Return -1 if error */ -int get_win32_taskbar_height(); -/* Find up to 15 mac addresses for this computer - * Return NULL if error */ -/*const char **find_mac_addresses();*/ -#endif -#endif /* INC_LIBETM_WIN32_SPECIFIC_H */ diff -Nru tickr-0.6.4/src/libetm-0.5.0/ChangeLog tickr-0.7.0/src/libetm-0.5.0/ChangeLog --- tickr-0.6.4/src/libetm-0.5.0/ChangeLog 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/ChangeLog 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,27 @@ +libetm version 0.5.0 +-------------------- + +- readable_size() can handle huge sizes now. (Dec 2 2016) + +- New INFO_OUT(...), INFO_ERR(...), VERBOSE_INFO_OUT(...), + VERBOSE_INFO_ERR(...), DEBUG_INFO(...) variadic macros, some of which + depends on definition of VERBOSE_OUTPUT and DEBUG_OUTPUT. + (Nov 17 2016) + +- New remove_surrounding_whitespaces_from_str() function. (Oct 24 2016) + +- New big_error() and warning() prototypes: (int, const char *format, ...) + (Mar 19 2016) + +- New socket connect/send-recv timeout values setter/getter functions. + (Jul 20 2015) + +- New l_str_insert_at_b() function. (Nov 12 2014) + +- Improved error hanling. (Nov 6 2014) + +- Add remove_leading/trailing_whitespaces_from_str(). (May 31 2014) + +- Stream sockets API moved from tickr -> tcp_socket.c/h. (Nov 12 2013) + +- New 'zboolean' type. (Nov 8 2013) diff -Nru tickr-0.6.4/src/libetm-0.5.0/COPYING tickr-0.7.0/src/libetm-0.5.0/COPYING --- tickr-0.6.4/src/libetm-0.5.0/COPYING 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/COPYING 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If 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 convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff -Nru tickr-0.6.4/src/libetm-0.5.0/error.c tickr-0.7.0/src/libetm-0.5.0/error.c --- tickr-0.6.4/src/libetm-0.5.0/error.c 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/error.c 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,86 @@ +/* + * libetm / error.c - Copyright (C) Emmanuel Thomas-Maurin 2008-2020 + * + * + * - Error handling - + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include "libetm.h" + +/* + * Generic find error string from error code in an ErrSt array function. + * Need to pass array's number of elements, as arrays are always passed + * as pointer: ErrSt array, n_el, error_code. + */ +const char *error_str_from_error_code(const ErrSt e_a[], int n_el, int e_c) +{ + static const char *unknown = "(Unregistered error code)"; + int i; + + for (i = 0; i < n_el; i++) + if (e_a[i].code == e_c) + return e_a[i].str; + return unknown; +} + +/* + * Return error string from error code which apply to libetm only. + */ +const char *libetm_error_str(libetm_error_code e_c) +{ + if (e_c >= LIBETM_OK && e_c <= LIBETM_LASTERRORCODE) + return error_str_from_error_code(lib_error, + sizeof(lib_error) / sizeof(lib_error[0]), e_c); + else + return ""; +} + +/* + * Critical error handler for libetm that will call big_error() function + * defined in app, so that appropiate behaviour can be choosen. + */ +int big_error_in_lib(libetm_error_code e_c, const char *str) +{ + /* Only call big_error() in app */ + big_error(e_c, "%s-%s: %s(): %s", + LIBETM_NAME, LIBETM_VERSION_NUM, str, libetm_error_str(e_c)); + return e_c; +} + +/* + * Warning handler for libetm that will call warning() function + * defined in app, so that appropiate behaviour can be choosen. + */ +void warning_in_lib(int wait, libetm_error_code e_c, const char *str) +{ + /* Only call warning() in app */ + warning(wait, "%s-%s: %s(): %s", + LIBETM_NAME, LIBETM_VERSION_NUM, str, libetm_error_str(e_c)); +} + +/* + * Dump libetm error codes and strings. + */ +void dump_libetm_error_codes() +{ + int i; + + fprintf(STD_OUT, "%s-%s error codes and strings:\n", LIBETM_NAME, LIBETM_VERSION_NUM); + for (i = 0; i < (int)(sizeof(lib_error) / sizeof(lib_error[0])); i++) + fprintf(STD_OUT, "%d %s\n", i, libetm_error_str(i)); +} diff -Nru tickr-0.6.4/src/libetm-0.5.0/error.h tickr-0.7.0/src/libetm-0.5.0/error.h --- tickr-0.6.4/src/libetm-0.5.0/error.h 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/error.h 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,151 @@ +/* + * libetm / error.h - Copyright (C) Emmanuel Thomas-Maurin 2008-2020 + * . + */ + +#ifndef INC_LIBETM_ERROR_H +#define INC_LIBETM_ERROR_H + +typedef struct { + const int code; + const char *str; +} ErrSt; + +/* All libetm error values */ + +/* Exactly matching this enum and ErrSt array below doesn't matter anymore. */ +typedef enum { + LIBETM_OK, + + /* str_mem.c */ + OUT_OF_MEMORY, + ZERO_RQ_SIZE, + NEG_RQ_SIZE, + NULL_DEST, + SRC_EQ_DEST, + STR_OVERLAP, + NULL_POINTER_FREE, + RNDSTR_UNKNOWN_MODE, + + /* tcp_socket.c */ + TCP_SOCK_ERROR, + TCP_SOCK_CANT_CONNECT, + TCP_SOCK_SHOULD_BE_CLOSED, + SELECT_ERROR, + SELECT_TIMED_OUT, + SELECT_TRUE, + SELECT_FALSE, + TCP_SEND_ERROR, + TCP_RECV_ERROR, + + CONNECTION_CLOSED_BY_SERVER, + + /* win32_specific.c */ +#ifdef WIN32_V + WIN32_ERROR, + WIN32REGKEY_NOT_FOUND, + WIN32REGKEY_CREATE_ERROR, + WIN32REGKEY_SAVE_ERROR, + WIN32REGKEY_OTHER_ERROR, +#endif + + /* Used by applications to enum error codes above this one. */ + LIBETM_LASTERRORCODE +} libetm_error_code; + +/* Exactly matching this ErrSt array and enum above doesn't matter anymore. */ +static const ErrSt lib_error[] = { + {LIBETM_OK, "OK"}, + + /* str_mem.c */ + {OUT_OF_MEMORY, "Out of memory"}, + {ZERO_RQ_SIZE, "Zero requested size"}, + {NEG_RQ_SIZE, "Negative requested size"}, + {NULL_DEST, "Null destination string"}, + {SRC_EQ_DEST, "Source string = destination string"}, + {STR_OVERLAP, "Strings overlap"}, + {NULL_POINTER_FREE, "Attempting to free a null pointer"}, + {RNDSTR_UNKNOWN_MODE, "Generate random string: Unknown mode"}, + + /* tcp_socket.c */ + {TCP_SOCK_ERROR, "TCP socket error"}, + {TCP_SOCK_CANT_CONNECT, "TCP socket error: Can't connect"}, + {TCP_SOCK_SHOULD_BE_CLOSED, "TCP socket error: Should be closed"}, + {SELECT_ERROR, "Select error"}, + {SELECT_TIMED_OUT, "Select error: Timed out"}, + {SELECT_TRUE, "(Not an error) select TRUE"}, + {SELECT_FALSE, "(Not an error) select FALSE"}, + {TCP_SEND_ERROR, "TCP send error"}, + {TCP_RECV_ERROR, "TCP recv error"}, + {CONNECTION_CLOSED_BY_SERVER, "Connection closed by server"}, + + /* win32_specific.c */ +#ifdef WIN32_V + {WIN32_ERROR, "Win32 error"}, + {WIN32REGKEY_NOT_FOUND, "Can't find win32 registry key"}, + {WIN32REGKEY_CREATE_ERROR, "Can't create win32 registry key"}, + {WIN32REGKEY_SAVE_ERROR, "Can't save win32 registry key"}, + {WIN32REGKEY_OTHER_ERROR, "Win32 registry key error (undetermined)"}, +#endif + + /* Used by applications to enum error codes above this one. */ + {LIBETM_LASTERRORCODE, "Libetm last enumerated error code"} +}; + +/* + * Generic find error string from error code in an ErrSt array function. + * Need to pass array's number of elements, as arrays are always passed + * as pointer: ErrSt array, n_el, error_code. + */ +const char *error_str_from_error_code(const ErrSt [], int, int); + +/* + * Return error string from error code which apply to libetm only. + */ +const char *libetm_error_str(libetm_error_code); + +/* + * In-application-defined CRITICAL ERROR handler prototype. + * Error code from application should enum above LIB_LASTERRORCODE. + * (See error_handler_example.c.) + */ +int big_error(int, const char *, ...); + +/* + * In-application-defined WARNING handler prototype. + * Error code from application should enum above LIB_LASTERRORCODE. + * (See error_handler_example.c.) + */ +void warning(int, const char *, ...); + +/* + * This will call big_error() function defined in application. + */ +int big_error_in_lib(libetm_error_code, const char *); + +/* + * This will call warning() function defined in application. + */ +/* Unused/useless so far... */ +void warning_in_lib(int, libetm_error_code, const char *); + +/* + * Dump libetm error codes and strings. + */ +void dump_libetm_error_codes(); +#endif /* INC_LIBETM_ERROR_H */ diff -Nru tickr-0.6.4/src/libetm-0.5.0/error_handler_example.c tickr-0.7.0/src/libetm-0.5.0/error_handler_example.c --- tickr-0.6.4/src/libetm-0.5.0/error_handler_example.c 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/error_handler_example.c 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * This func's prototype is in libetm/error.h. + * This func is not defined in libetm but in application and it handles + * CRITICAL ERRORS from both libetm and application. + */ + +#define ERROR_WARNING_STR_MAXLEN (8 * 1024 - 1) +#define OUCH_STR "\nOuch !! Something went wrong ...\n\n" + +int big_error(int big_error_code, const char *format, ...) +{ + char error_str[ERROR_WARNING_STR_MAXLEN + 1] = ""; + va_list a_list; + + str_n_cpy(error_str, OUCH_STR, 100); + str_n_cat(error_str, "CRITICAL ERROR in ", 100); + if (big_error_code > LIBETM_LASTERRORCODE) + str_n_cat(error_str, APP_NAME ": ", 100); + va_start(a_list, format); + vsnprintf(error_str + strlen(error_str), + ERROR_WARNING_STR_MAXLEN + 1 - strlen(error_str), format, a_list); + va_end(a_list); + snprintf(error_str + strlen(error_str), + ERROR_WARNING_STR_MAXLEN + 1 - strlen(error_str), " - Will quit now"); + + fprintf(STD_ERR, "%s\n", (char *)error_str + strlen(OUCH_STR)); + fflush(NULL); + info_win(APP_NAME " - Critical error", error_str, INFO_ERROR, FALSE); + free_all(); + exit(big_error_code); +} + +/* + * This func's prototype is in libetm/error.h. + * This func is not defined in libetm but in application and it handles + * WARNINGS from both libetm and application. + * + * Will popup and wait for INFO_WIN_WAIT_TIMEOUT ms if no_block == TRUE, then close + * otherwise, will block until an appropriate keyboard/mouse action happens. + * + * You can use BLOCK/NO_BLOCK helpers. + */ + +/* Helpers for warning() */ +#define NO_BLOCK TRUE +#define BLOCK !NO_BLOCK + +void warning(int no_block, const char *format, ...) +{ + char warning_str[ERROR_WARNING_STR_MAXLEN + 1] = ""; + va_list a_list; + + va_start(a_list, format); + vsnprintf(warning_str + strlen(warning_str), + ERROR_WARNING_STR_MAXLEN + 1 - strlen(warning_str), format, a_list); + va_end(a_list); + + fprintf(STD_ERR, "%s\n", warning_str); + fflush(STD_ERR); + if (no_block) + info_win_no_block(warning_str, INFO_WIN_WAIT_TIMEOUT); + else + info_win("", warning_str, INFO_WARNING, FALSE); +} diff -Nru tickr-0.6.4/src/libetm-0.5.0/libetm.h tickr-0.7.0/src/libetm-0.5.0/libetm.h --- tickr-0.6.4/src/libetm-0.5.0/libetm.h 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/libetm.h 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,124 @@ +/* + * libetm / libetm.h - Copyright (C) Emmanuel Thomas-Maurin 2008-2020 + * + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef INC_LIBETM_H +#define INC_LIBETM_H + +#define LIBETM_NAME "Libetm" +#define LIBETM_VERSION_NUM "0.5.0" + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#ifndef _ISOC99_SOURCE +#define _ISOC99_SOURCE +#endif + +#define VERBOSE_OUTPUT +/*#define LIBETM_EXPERIMENTAL_STUFF*/ + +/* stdout and stderr on Linux / text files on win32 (see win32_specific.c) */ +#ifndef WIN32_V +# define STD_OUT stdout +# define STD_ERR stderr +#else +# define STD_OUT std_out +# define STD_ERR std_err +#endif + +#define INFO_OUT(...) \ +{\ + fprintf(STD_OUT, __VA_ARGS__);\ + fflush(STD_OUT);\ +} +#define INFO_ERR(...) \ +{\ + fprintf(STD_ERR, __VA_ARGS__);\ + fflush(STD_ERR);\ +} + +/* + * Following macros depends on definition of VERBOSE_OUTPUT and DEBUG_OUTPUT + * + * === NOTE: As VERBOSE_OUTPUT is actually defined here, to skip, well, verbose + * output in application compiled against libetm, you must always *undefine* + * VERBOSE_OUTPUT in code of application === + */ +#ifdef VERBOSE_OUTPUT +# define VERBOSE_INFO_OUT(...) INFO_OUT(__VA_ARGS__) +# define VERBOSE_INFO_ERR(...) INFO_ERR(__VA_ARGS__) +#else +# define VERBOSE_INFO_OUT(...) {} +# define VERBOSE_INFO_ERR(...) {} +#endif + +#ifdef DEBUG_OUTPUT +# define DEBUG_INFO(...) \ +{\ + fprintf(STD_OUT, "[%s: %d] %s(): ", __FILE__, __LINE__, __func__);\ + INFO_OUT(__VA_ARGS__)\ +} +#else +# define DEBUG_INFO(...) {} +#endif + +/* === TODO: Should we use mutex locks instead ? ===*/ +#define N_SIMULTANEOUS_CALLS 64 +#define N_SIMULTANEOUS_CALLS_MASK 63 + +/* Should zboolean type be sig_atomic_t ???? */ +#undef TRUE +#undef FALSE +typedef enum { + FALSE = (0), TRUE = (!FALSE) +} zboolean; /* Couldn't find anything better at the moment */ + +#define YES (1) +#define NO (0) + +#include "str_mem.h" +#include "tcp_socket.h" +#include "error.h" +#include "misc.h" +/*#include "dllist.h"*/ +#ifdef WIN32_V +#include "win32_specific.h" +#endif + +#ifndef MAX +# define MAX(x,y) ((x) > (y) ? (x) : (y)) +#endif + +#ifndef MIN +# define MIN(x,y) ((x) < (y) ? (x) : (y)) +#endif + +#ifndef ABS +# define ABS(x) ((x) > 0 ? (x) : -(x)) +#endif + +/* Do more testing for the 2 following ones */ +#ifndef SIGN +# define SIGN(x) ((x) != 0 ? ((x) > 0 ? 1 : -1) : 0) +#endif + +/* Only if f > 0 */ +#ifndef APPROX +# define APPROX(f) (ABS(((f) - (int)(f)) > 0.5) ? (int)(f) + SIGN((f)) : (int)(f)) +#endif +#endif /* INC_LIBETM_H */ diff -Nru tickr-0.6.4/src/libetm-0.5.0/Makefile.am tickr-0.7.0/src/libetm-0.5.0/Makefile.am --- tickr-0.6.4/src/libetm-0.5.0/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/Makefile.am 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,5 @@ +libs_LIBRARIES = libetm.a +libetm_a_SOURCES = str_mem.c tcp_socket.c error.c misc.c #dllist.c +libetm_a_CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ + -ffast-math -pedantic -Wno-variadic-macros -fmax-errors=5 +libsdir = .. diff -Nru tickr-0.6.4/src/libetm-0.5.0/Makefile.in tickr-0.7.0/src/libetm-0.5.0/Makefile.in --- tickr-0.6.4/src/libetm-0.5.0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/Makefile.in 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,667 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = src/libetm-0.5.0 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__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)$(libsdir)" +LIBRARIES = $(libs_LIBRARIES) +AR = ar +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 = +libetm_a_AR = $(AR) $(ARFLAGS) +libetm_a_LIBADD = +am_libetm_a_OBJECTS = libetm_a-str_mem.$(OBJEXT) \ + libetm_a-tcp_socket.$(OBJEXT) libetm_a-error.$(OBJEXT) \ + libetm_a-misc.$(OBJEXT) +libetm_a_OBJECTS = $(am_libetm_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) +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) +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 = $(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 = $(libetm_a_SOURCES) +DIST_SOURCES = $(libetm_a_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp COPYING \ + ChangeLog README TODO +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTK2_CFLAGS = @GTK2_CFLAGS@ +GTK2_LIBS = @GTK2_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +XML2_CFLAGS = @XML2_CFLAGS@ +XML2_LIBS = @XML2_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +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@ +libs_LIBRARIES = libetm.a +libetm_a_SOURCES = str_mem.c tcp_socket.c error.c misc.c #dllist.c +libetm_a_CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ + -ffast-math -pedantic -Wno-variadic-macros -fmax-errors=5 + +libsdir = .. +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libetm-0.5.0/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/libetm-0.5.0/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libsLIBRARIES: $(libs_LIBRARIES) + @$(NORMAL_INSTALL) + @list='$(libs_LIBRARIES)'; test -n "$(libsdir)" || 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)$(libsdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libsdir)" || exit 1; \ + echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libsdir)'"; \ + $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libsdir)" || exit $$?; } + @$(POST_INSTALL) + @list='$(libs_LIBRARIES)'; test -n "$(libsdir)" || list=; \ + for p in $$list; do \ + if test -f $$p; then \ + $(am__strip_dir) \ + echo " ( cd '$(DESTDIR)$(libsdir)' && $(RANLIB) $$f )"; \ + ( cd "$(DESTDIR)$(libsdir)" && $(RANLIB) $$f ) || exit $$?; \ + else :; fi; \ + done + +uninstall-libsLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(libs_LIBRARIES)'; test -n "$(libsdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libsdir)'; $(am__uninstall_files_from_dir) + +clean-libsLIBRARIES: + -test -z "$(libs_LIBRARIES)" || rm -f $(libs_LIBRARIES) + +libetm.a: $(libetm_a_OBJECTS) $(libetm_a_DEPENDENCIES) $(EXTRA_libetm_a_DEPENDENCIES) + $(AM_V_at)-rm -f libetm.a + $(AM_V_AR)$(libetm_a_AR) libetm.a $(libetm_a_OBJECTS) $(libetm_a_LIBADD) + $(AM_V_at)$(RANLIB) libetm.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libetm_a-error.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libetm_a-misc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libetm_a-str_mem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libetm_a-tcp_socket.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 -o $@ $< + +.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 -o $@ `$(CYGPATH_W) '$<'` + +libetm_a-str_mem.o: str_mem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-str_mem.o -MD -MP -MF $(DEPDIR)/libetm_a-str_mem.Tpo -c -o libetm_a-str_mem.o `test -f 'str_mem.c' || echo '$(srcdir)/'`str_mem.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libetm_a-str_mem.Tpo $(DEPDIR)/libetm_a-str_mem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='str_mem.c' object='libetm_a-str_mem.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-str_mem.o `test -f 'str_mem.c' || echo '$(srcdir)/'`str_mem.c + +libetm_a-str_mem.obj: str_mem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-str_mem.obj -MD -MP -MF $(DEPDIR)/libetm_a-str_mem.Tpo -c -o libetm_a-str_mem.obj `if test -f 'str_mem.c'; then $(CYGPATH_W) 'str_mem.c'; else $(CYGPATH_W) '$(srcdir)/str_mem.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libetm_a-str_mem.Tpo $(DEPDIR)/libetm_a-str_mem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='str_mem.c' object='libetm_a-str_mem.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-str_mem.obj `if test -f 'str_mem.c'; then $(CYGPATH_W) 'str_mem.c'; else $(CYGPATH_W) '$(srcdir)/str_mem.c'; fi` + +libetm_a-tcp_socket.o: tcp_socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-tcp_socket.o -MD -MP -MF $(DEPDIR)/libetm_a-tcp_socket.Tpo -c -o libetm_a-tcp_socket.o `test -f 'tcp_socket.c' || echo '$(srcdir)/'`tcp_socket.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libetm_a-tcp_socket.Tpo $(DEPDIR)/libetm_a-tcp_socket.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tcp_socket.c' object='libetm_a-tcp_socket.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-tcp_socket.o `test -f 'tcp_socket.c' || echo '$(srcdir)/'`tcp_socket.c + +libetm_a-tcp_socket.obj: tcp_socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-tcp_socket.obj -MD -MP -MF $(DEPDIR)/libetm_a-tcp_socket.Tpo -c -o libetm_a-tcp_socket.obj `if test -f 'tcp_socket.c'; then $(CYGPATH_W) 'tcp_socket.c'; else $(CYGPATH_W) '$(srcdir)/tcp_socket.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libetm_a-tcp_socket.Tpo $(DEPDIR)/libetm_a-tcp_socket.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tcp_socket.c' object='libetm_a-tcp_socket.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-tcp_socket.obj `if test -f 'tcp_socket.c'; then $(CYGPATH_W) 'tcp_socket.c'; else $(CYGPATH_W) '$(srcdir)/tcp_socket.c'; fi` + +libetm_a-error.o: error.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-error.o -MD -MP -MF $(DEPDIR)/libetm_a-error.Tpo -c -o libetm_a-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libetm_a-error.Tpo $(DEPDIR)/libetm_a-error.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error.c' object='libetm_a-error.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c + +libetm_a-error.obj: error.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-error.obj -MD -MP -MF $(DEPDIR)/libetm_a-error.Tpo -c -o libetm_a-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libetm_a-error.Tpo $(DEPDIR)/libetm_a-error.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error.c' object='libetm_a-error.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi` + +libetm_a-misc.o: misc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-misc.o -MD -MP -MF $(DEPDIR)/libetm_a-misc.Tpo -c -o libetm_a-misc.o `test -f 'misc.c' || echo '$(srcdir)/'`misc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libetm_a-misc.Tpo $(DEPDIR)/libetm_a-misc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='misc.c' object='libetm_a-misc.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-misc.o `test -f 'misc.c' || echo '$(srcdir)/'`misc.c + +libetm_a-misc.obj: misc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -MT libetm_a-misc.obj -MD -MP -MF $(DEPDIR)/libetm_a-misc.Tpo -c -o libetm_a-misc.obj `if test -f 'misc.c'; then $(CYGPATH_W) 'misc.c'; else $(CYGPATH_W) '$(srcdir)/misc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libetm_a-misc.Tpo $(DEPDIR)/libetm_a-misc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='misc.c' object='libetm_a-misc.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libetm_a_CFLAGS) $(CFLAGS) -c -o libetm_a-misc.obj `if test -f 'misc.c'; then $(CYGPATH_W) 'misc.c'; else $(CYGPATH_W) '$(srcdir)/misc.c'; fi` + +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) +installdirs: + for dir in "$(DESTDIR)$(libsdir)"; 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-libsLIBRARIES 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-libsLIBRARIES + +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 + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libsLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libsLIBRARIES cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic 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-libsLIBRARIES 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 pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-libsLIBRARIES + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru tickr-0.6.4/src/libetm-0.5.0/Makefile-libetm-linux tickr-0.7.0/src/libetm-0.5.0/Makefile-libetm-linux --- tickr-0.6.4/src/libetm-0.5.0/Makefile-libetm-linux 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/Makefile-libetm-linux 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,39 @@ +# Makefile for libetm - Linux version + +src = str_mem.c tcp_socket.c error.c misc.c #dllist.c +obj = $(src:.c=.o) +headers = libetm.h $(src:.c=.h) + +INC_DIR = /usr/include/libetm +LIB_DIR = /usr/lib/libetm + +CC = gcc + +CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ + -ffast-math -pedantic -Wno-variadic-macros + +all: libetm.a + +$(obj): $(src) $(headers) Makefile + $(CC) $(CFLAGS) -c $(src) + +libetm.a: $(obj) + ar -rs libetm.a $(obj) + +.PHONY: install +install: + mkdir -p $(INC_DIR) + cp $(headers) $(INC_DIR)/ + chmod -R a+r $(INC_DIR) + mkdir -p $(LIB_DIR) + cp libetm.a $(LIB_DIR)/ + chmod -R a+r $(LIB_DIR) + +.PHONY: uninstall +uninstall: + rm -r $(INC_DIR) + rm -r $(LIB_DIR) + +.PHONY: clean +clean: + rm $(obj) libetm.a diff -Nru tickr-0.6.4/src/libetm-0.5.0/Makefile-libetm-win32 tickr-0.7.0/src/libetm-0.5.0/Makefile-libetm-win32 --- tickr-0.6.4/src/libetm-0.5.0/Makefile-libetm-win32 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/Makefile-libetm-win32 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,33 @@ +# Makefile for libetm - win32 version + +src = str_mem.c tcp_socket.c error.c misc.c win32_specific.c #dllist.c +obj = $(src:.c=.o) +headers = libetm.h $(src:.c=.h) + +CC = gcc + +CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ + -ffast-math -pedantic -Wno-variadic-macros -DWIN32_V + +all: libetm.a + +$(obj): $(src) $(headers) Makefile + $(CC) $(CFLAGS) -c $(src) + +libetm.a: $(obj) + ar -rs libetm.a $(obj) + +.PHONY: install +install: + mkdir -p /usr/include/libetm + cp $(headers) /usr/include/libetm/ + cp libetm.a /usr/lib/ + +.PHONY: uninstall +uninstall: + rm /usr/include/libetm/$(headers) + rm /usr/lib/libetm.a + +.PHONY: clean +clean: + rm $(obj) libetm.a diff -Nru tickr-0.6.4/src/libetm-0.5.0/misc.c tickr-0.7.0/src/libetm-0.5.0/misc.c --- tickr-0.6.4/src/libetm-0.5.0/misc.c 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/misc.c 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,86 @@ +/* + * libetm / misc.c - Copyright (C) Emmanuel Thomas-Maurin 2008-2020 + * + * + * - Misc functions - + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include "libetm.h" + +/* + * get_libetm_info( O ) = version num + * 1 = copyright + * 2 = license 1/3 + * 3 = license 2/3 + * 4 = license 3/3 + * 5 = compiled date + * > 5 = NULL + */ +const char *get_libetm_info(unsigned int i) +{ + static const char *libv[] = { + LIBETM_NAME " version " LIBETM_VERSION_NUM, + "Copyright (C) Emmanuel Thomas-Maurin 2008-2020 ", + LIBETM_NAME " is free software: you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation, either version 3 of the License, or\n" + "(at your option) any later version.", + LIBETM_NAME " is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.", + "You should have received a copy of the GNU General Public License\n" + /* Fix non-reproducible builds */ + "along with this program. If not, see "/*, + "Compiled on " __DATE__ " - " __TIME__*/ + }; + if (i < sizeof(libv) / sizeof(libv[0])) + return (const char *)libv[i]; + else + return NULL; +} + +/* + * Dump libetm info. + */ +void dump_libetm_info() +{ + int i = 0; + + while (get_libetm_info(i) != NULL) + fprintf(STD_OUT, "%s\n\n", get_libetm_info(i++)); + +} + +/* In CLI mode */ +zboolean question(const char *str) +{ + int i, c; + + while (1) { + fprintf(STD_OUT, "%s [Y/N] ? ", str); + i = fgetc(stdin); + c = tolower(i); + while (i != '\n' && i != EOF) + (i = fgetc(stdin)); + if (c == 'y') + return TRUE; + else if (c == 'n') + return FALSE; + } +} diff -Nru tickr-0.6.4/src/libetm-0.5.0/misc.h tickr-0.7.0/src/libetm-0.5.0/misc.h --- tickr-0.6.4/src/libetm-0.5.0/misc.h 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/misc.h 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * libetm / misc.h - Copyright (C) Emmanuel Thomas-Maurin 2008-2020 + * + * + * - Misc functions - + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef INC_LIBETM_MISC_H +#define INC_LIBETM_MISC_H + +/* + * get_libetm_info( O ) = version num + * 1 = copyright + * 2 = license 1/3 + * 3 = license 2/3 + * 4 = license 3/3 + * 5 = compiled date + * > 5 = NULL + */ +const char *get_libetm_info(unsigned int); + + +/* + * Dump libetm info. + */ +void dump_libetm_info(); + +/* In CLI mode */ +zboolean question(const char *); +#endif /* INC_LIBETM_MISC_H */ diff -Nru tickr-0.6.4/src/libetm-0.5.0/README tickr-0.7.0/src/libetm-0.5.0/README --- tickr-0.6.4/src/libetm-0.5.0/README 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/README 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,3 @@ +This is only a tiny lib with a few functions I use a lot. + +To compile for win32, you must use the -DWIN32_V flag. diff -Nru tickr-0.6.4/src/libetm-0.5.0/str_mem.c tickr-0.7.0/src/libetm-0.5.0/str_mem.c --- tickr-0.6.4/src/libetm-0.5.0/str_mem.c 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/str_mem.c 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,516 @@ +/* + * libetm / str_mem.c - Copyright (C) Emmanuel Thomas-Maurin 2008-2020 + * + * + * - A few strings and memory management functions - + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include "libetm.h" + +/* + * Copy n bytes max from src to dest then add '\0' at end of dest. + */ +char *str_n_cpy(char *dest, const char *src, size_t length) +{ + char *dest_bak = dest; + + if (dest == NULL) + big_error_in_lib(NULL_DEST, __func__); + + while (length-- > 0 && *src != '\0') + *dest++ = *src++; + + *dest = '\0'; + + return dest_bak; +} + +/* + * Concanate n bytes max of src to dest then add '\0' at end of dest. + * Strings may not be identical and should not overlap. + */ +char *str_n_cat(char *dest, const char *src, size_t length) +{ + char *dest_bak = dest; + + if (dest == NULL) + big_error_in_lib(NULL_DEST, __func__); + else if (src == dest) + big_error_in_lib(SRC_EQ_DEST, __func__); + + while (*dest++ != '\0'); + dest--; + + while (length-- > 0 && *src != '\0') + *dest++ = *src++; + + *dest = '\0'; + + return dest_bak; +} + +/* + * Create new_str (allocate memory) and copy str (can be NULL) to new_str. + */ +char *l_str_new(const char *str) +{ + char *new_str; + size_t str_len; + + if (str == NULL) + str_len = 0; + else + str_len = strlen(str); + + new_str = malloc2(sizeof(char) * (str_len + 1)); + if (new_str == NULL) + big_error_in_lib(OUT_OF_MEMORY, __func__); + + return str_n_cpy(new_str, str, str_len); +} + +/* + * Append src (can be NULL) to dest (re-allocate memory as necessary). + * dest must have been created by l_str_new()/malloc() - strings may overlap. + * Note: faster than l_str_insert_at_b(). + */ +char *l_str_cat(char *dest, const char *src) +{ + char *new_str, *src2; + size_t src_len, dest_len; + + if (dest == NULL) + big_error_in_lib(NULL_DEST, __func__); + else if (src == NULL) + return dest; + + src_len = strlen(src); + if (src_len == 0) + return dest; + dest_len = strlen(dest); + + src2 = l_str_new(src); + new_str = realloc(dest, sizeof(char) * (dest_len + src_len + 1)); + if (new_str == NULL) + big_error_in_lib(OUT_OF_MEMORY, __func__); + + str_n_cpy(new_str + dest_len, src2, src_len); + l_str_free(src2); + + return new_str; +} + +/* + * Insert src (can be NULL) at the beginning of dest (re-allocate memory as necessary). + * dest must have been created by l_str_new()/malloc() - strings may overlap. + * Note: slower than l_str_cat(). + */ +char *l_str_insert_at_b(char *dest, const char *src) +{ + char *new_str; + size_t src_len, dest_len; + + if (dest == NULL) + big_error_in_lib(NULL_DEST, __func__); + else if (src == NULL) + return dest; + + src_len = strlen(src); + if (src_len == 0) + return dest; + dest_len = strlen(dest); + + new_str = malloc(sizeof(char) * (src_len + dest_len + 1)); + if (new_str == NULL) + big_error_in_lib(OUT_OF_MEMORY, __func__); + + str_n_cpy(new_str, src, src_len); + str_n_cpy(new_str + src_len, dest, dest_len); + l_str_free(dest); + + return new_str; +} + +/* + * Free string created by l_str_new(), l_str_cat() or l_str_insert_at_b(). + * Also set ptr to NULL. + */ +void l_str_free(char *str) +{ + if (str == NULL) + big_error_in_lib(NULL_POINTER_FREE, __func__); + + free(str); + str = NULL; +} + +/* + * Wrappers for malloc(), realloc(), calloc() and free() which check returned value. + */ +void *malloc2(size_t size) +{ + void *mem_block = NULL; + + if (size == 0) + big_error_in_lib(ZERO_RQ_SIZE, __func__); + else if ((mem_block = malloc(size)) == NULL) + big_error_in_lib(OUT_OF_MEMORY, __func__); + + return mem_block; +} + +void *realloc2(void *mem_block, size_t size) +{ + void *mem_block2 = mem_block; + + if (size == 0) + big_error_in_lib(ZERO_RQ_SIZE, __func__); + else if ((mem_block2 = realloc(mem_block, size)) == NULL) + big_error_in_lib(OUT_OF_MEMORY, __func__); + + return mem_block2; +} + +void *calloc2(size_t n_elements, size_t element_size) +{ + void *mem_block = NULL; + size_t size = n_elements * element_size; + + if (size == 0) + big_error_in_lib(ZERO_RQ_SIZE, __func__); + else if ((mem_block = malloc(size)) == NULL) + big_error_in_lib(OUT_OF_MEMORY, __func__); + else + memset(mem_block, 0, size); + + return mem_block; +} + +/* Also set ptr to NULL. */ +void free2(void *mem_block) +{ + if (mem_block == NULL) + big_error_in_lib(NULL_POINTER_FREE, __func__); + + free(mem_block); + mem_block = NULL; +} + +/* + * Return size in readable format (KiB, MiB, GiB, TiB, ...) + * *** Allow up to N_SIMULTANEOUS_CALLS simultaneous calls *** + * Convention: we assume 2.5 MiB = 2 MiB + [0.5 x 1024 = 512] KiB, not 500 KiB. + * Otherwise, there is no way to express a value in the range 1000 - 1023, + * so x.y MiB = x MiB + 0.y MiB, that is: not y x 100 KiB but y x 102.4 KiB. + */ +const char *readable_size(double size_bytes) +{ + /* + * We use an array of N_SIMULTANEOUS_CALLS strings to store the returned string + * in order to allow N_SIMULTANEOUS_CALLS simultaneous calls. + * === TODO: Should we use mutex locks instead ? === + * Otherwise, sth like: + * printf("size1 = %s / size2 = %s\n", readable_size(size1), readable_size(size2)) + * would produce unpredictable / false results (like readable sizes are + * equal whereas sizes are different). + */ + static char lib_static_str[N_SIMULTANEOUS_CALLS][128]; + double size_KiB, size_MiB, size_GiB, size_TiB, size_PiB, size_EiB, size_ZiB, size_YiB; + double remainder_bytes, remainder_KiB, remainder_MiB, remainder_GiB, remainder_TiB, + remainder_PiB, remainder_EiB, remainder_ZiB; + static int count = -1; + + count++; + count &= N_SIMULTANEOUS_CALLS_MASK; + + if (size_bytes < 0.0f) + return "[Negative size error] bytes"; + + size_bytes = floor(size_bytes); /* OK ? */ + + size_KiB = floor(size_bytes / 1024); + remainder_bytes = size_bytes - size_KiB * 1024; + + size_MiB = floor(size_KiB / 1024); + remainder_KiB = size_KiB - size_MiB * 1024; + + size_GiB = floor(size_MiB / 1024); + remainder_MiB = size_MiB - size_GiB * 1024; + + size_TiB = floor(size_GiB / 1024); + remainder_GiB = size_GiB - size_TiB * 1024; + + size_PiB = floor(size_TiB / 1024); + remainder_TiB = size_TiB - size_PiB * 1024; + + size_EiB = floor(size_PiB / 1024); + remainder_PiB = size_PiB - size_EiB * 1024; + + size_ZiB = floor(size_EiB / 1024); + remainder_EiB = size_EiB - size_ZiB * 1024; + + size_YiB = floor(size_ZiB / 1024); + remainder_ZiB = size_ZiB - size_YiB * 1024; + + if (size_YiB >= 1) + snprintf(lib_static_str[count], 128, "%.0f.%.0f YiB", + size_YiB, floor(remainder_ZiB / 102.4)); + else if (size_ZiB >= 1) + snprintf(lib_static_str[count], 128, "%.0f.%.0f ZiB", + size_ZiB, floor(remainder_EiB / 102.4)); + else if (size_EiB >= 1) + snprintf(lib_static_str[count], 128, "%.0f.%.0f EiB", + size_EiB, floor(remainder_PiB / 102.4)); + else if (size_PiB >= 1) + snprintf(lib_static_str[count], 128, "%.0f.%.0f PiB", + size_PiB, floor(remainder_TiB / 102.4)); + else if (size_TiB >= 1) + snprintf(lib_static_str[count], 128, "%.0f.%.0f TiB", + size_TiB, floor(remainder_GiB / 102.4)); + else if (size_GiB >= 1) + snprintf(lib_static_str[count], 128, "%.0f.%.0f GiB", + size_GiB, floor(remainder_MiB / 102.4)); + else if (size_MiB >= 1) + snprintf(lib_static_str[count], 128, "%.0f.%.0f MiB", + size_MiB, floor(remainder_KiB / 102.4)); + else if (size_KiB >= 1) + snprintf(lib_static_str[count], 128, "%.0f.%.0f KiB", + size_KiB, floor(remainder_bytes / 102.4)); + else + snprintf(lib_static_str[count], 128, "%.0f bytes", size_bytes); + + return (const char *)lib_static_str[count]; +} + +/* + * itoa() is not ANSI C so this one could be useful. + * *** Allow up to N_SIMULTANEOUS_CALLS simultaneous calls *** + */ +const char *itoa2(long int n) +{ + /* Array of N_SIMULTANEOUS_CALLS strings (like for readable_size() - see above) */ + static char lib_static_str[N_SIMULTANEOUS_CALLS][128]; + static int count = -1; + + count++; + count &= N_SIMULTANEOUS_CALLS_MASK; + + snprintf(lib_static_str[count], 128, "%ld", n); + return (const char *)lib_static_str[count]; +} + +/* + * Modify string in place. + */ +char *remove_char_from_str(char *str, char c) +{ + int i, len = strlen(str); + + for (i = 0; i < len && str[i] != '\0';) { + if (str[i] == c) + str_n_cpy(str + i, (const char *)(str + i + 1), len - i); + else + i++; + } + return str; +} + +/* + * Modify string in place. + */ +char *remove_leading_whitespaces_from_str(char *str) +{ + int i, len = strlen(str); + + for (i = 0; i < len;) + if (isspace((int)str[i])) + i++; + else + break; + if (i > 0 && i <= len) + str_n_cpy(str, (const char *)(str + i), len - i); + return str; +} + +/* + * Modify string in place. + */ +char *remove_trailing_whitespaces_from_str(char *str) +{ + int i = strlen(str) - 1; + + while (isspace((int)str[i]) && i >= 0) + i--; + str[i + 1] = '\0'; + return str; +} + +/* + * Modify string in place. + */ +char *remove_surrounding_whitespaces_from_str(char *str) +{ + return remove_trailing_whitespaces_from_str(remove_leading_whitespaces_from_str(str)); +} + +/* + * Check that str contains only digits (at least one) and whitespaces + * (may start and/or end with whitespaces), meaning numerical value is + * integer >= 0. + */ +zboolean str_is_num(const char *str2) +{ + char *str, *s; + int i, len; + + if (*str2 == '\0') + return FALSE; + s = str = l_str_new(str2); + len = strlen(str); + i = 0; + while (i < len) + if (isspace((int)*s)) { + i++; + s++; + } else + break; + if (i == len) { + l_str_free(str); + return FALSE; + } + while (i < len) + if (isdigit((int)*s)) { + i++; + s++; + } else + break; + if (i == len) { + l_str_free(str); + return TRUE; + } + while (i < len) + if (isspace((int)*s)) { + i++; + s++; + } else + break; + l_str_free(str); + if (i == len) + return TRUE; + else + return FALSE; +} + +/* + * Check that str contains only whitespaces or is empty. + */ +zboolean str_is_blank(const char *str) +{ + int i = 0, len = strlen(str); + + if (*str == '\0') + return TRUE; + while (i < len) + if (isspace((int)*str)) { + i++; + str++; + } else + break; + if (i == len) + return TRUE; + else + return FALSE; +} + +/* + * Generate a random string up to 1023 chars long. + * mode = a -> alpha / d -> digits / b -> both + */ +const char *rnd_str(char mode, int length) +{ + static char str[1024]; + char str_a[65] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkl"; + char str_d[17] = "1234567890123456"; + char str_b[65] = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ00"; + int i = 0; + + if (length > 1023) + length = 1023; + srand(time(0)); + if (mode == 'a') { + while (i < length) + str[i++] = str_a[rand() & 63]; + } else if (mode == 'd') { + while (i < length) + str[i++] = str_d[rand() & 15]; + } else if (mode == 'b') { + while (i < length) + str[i++] = str_b[rand() & 63]; + } else + big_error_in_lib(RNDSTR_UNKNOWN_MODE, __func__); + str[i] = '\0'; + return str; +} + +#ifdef LIBETM_EXPERIMENTAL_STUFF +/* + * Very basic xor sym encryption for small strings (up to 511 chars). + * *** Key must be ascii / if 2 chars match (in str and key) the string is cut off *** + * *** Allow up to N_SIMULTANEOUS_CALLS simultaneous calls *** + * Works with ascii strings, probably not otherwise so don't try with + * exotic things... + */ +const char *str_crypt(const char *str, const char *key) +{ + /* Array of N_SIMULTANEOUS_CALLS strings (like for readable_size() - see above) */ + static char str2[N_SIMULTANEOUS_CALLS][512]; + static int count = -1; + int i, j; + + count++; + count &= N_SIMULTANEOUS_CALLS_MASK; + for (i = 0, j = 0; i < 511 && str[i] != '\0'; i++) { + if (key[j] == '\0') + j = 0; + str2[count][i] = str[i] ^ key[j++]; + } + str2[count][i] = '\0'; + return (const char *)str2[count]; +} + +/* + * Very basic crypto hash. + */ +unsigned long str_crypto_hash(const char *str, const char* salt) +{ + char *str2; + unsigned long hash = 0; + int i = 0; + + str2 = (char *)str_crypt(str, salt); + while (str2[i] != '\0') { + hash += str2[i] * 1024 + (str2[i] + 128) * (32 + i) + str2[i] - 1; + i ++; + } + return hash; +} +#endif diff -Nru tickr-0.6.4/src/libetm-0.5.0/str_mem.h tickr-0.7.0/src/libetm-0.5.0/str_mem.h --- tickr-0.6.4/src/libetm-0.5.0/str_mem.h 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/str_mem.h 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,137 @@ +/* + * libetm / str_mem.h - Copyright (C) Emmanuel Thomas-Maurin 2008-2020 + * + * + * - A few strings and memory management functions - + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef INC_LIBETM_STR_MEM_H +#define INC_LIBETM_STR_MEM_H + +/* + * Copy n bytes max from src to dest then add '\0' at end of dest. + */ +char *str_n_cpy(char *, const char *, size_t); + +/* + * Concanate n bytes max of src to dest then add '\0' at end of dest. + * Strings may not be identical and should not overlap. + */ +char *str_n_cat(char *, const char *, size_t); + +/* + * Create new_str (allocate memory) and copy str (can be NULL) to new_str. + */ +char *l_str_new(const char *str); + +/* + * Append src (can be NULL) to dest (re-allocate memory as necessary). + * dest must have been created by l_str_new()/malloc() - strings may overlap. + * Note: faster than l_str_insert_at_b(). + */ +char *l_str_cat(char *, const char *); + +/* + * Insert src (can be NULL) at the beginning of dest (re-allocate memory as necessary). + * dest must have been created by l_str_new()/malloc() - strings may overlap. + * Note: slower than l_str_cat(). + */ +char *l_str_insert_at_b(char *, const char *); + +/* + * Free string created by l_str_new(), l_str_cat() or l_str_insert_at_b(). + * Also set ptr to NULL. + */ +void l_str_free(char *); + +/* + * Wrappers for malloc(), realloc(), calloc() and free() which check returned value. + */ +void *malloc2(size_t); +void *realloc2(void *, size_t); +void *calloc2(size_t, size_t); +/* Also set ptr to NULL. */ +void free2(void *); + +/* + * Return size in readable format (KiB, MiB, GiB, TiB, ...) + * *** Allow up to 16 simultaneous calls *** + * Convention: we assume 2.5 MiB = 2 MiB + [0.5 x 1024 = 512] KiB, not 500 KiB. + * Otherwise, there is no way to express a value in the range 1000 - 1023, + * so x.y MiB = x MiB + 0.y MiB, that is: not y x 100 KiB but y x 102.4 KiB. + */ +const char *readable_size(double); + +/* + * itoa() is not ANSI C so this one could be useful. + * *** Allow up to 16 simultaneous calls *** + */ +const char *itoa2(long int); + +/* + * Modify string in place. + */ +char *remove_char_from_str(char *, char); + +/* + * Modify string in place. + */ +char *remove_leading_whitespaces_from_str(char *); + +/* + * Modify string in place. + */ +char *remove_trailing_whitespaces_from_str(char *); + +/* + * Modify string in place. + */ +char *remove_surrounding_whitespaces_from_str(char *); + +/* + * Check that str contains only digits (at least one) and whitespaces + * (may start and/or end with whitespaces), meaning numerical value is + * integer >= 0. + */ +zboolean str_is_num(const char *); + +/* + * Check that str contains only whitespaces or is empty. + */ +zboolean str_is_blank(const char *); + +/* + * Generate a random string up to 1023 chars long. + * mode = a -> alpha / d -> digits / b -> both + */ +const char *rnd_str(char, int); + +#ifdef LIBETM_EXPERIMENTAL_STUFF +/* + * Very basic xor sym encryption for small strings (up to 511 chars). + * *** Key must be ascii / if 2 chars match (in str and key) the string is cut off *** + * *** Allow up to 16 simultaneous calls *** + * Works with ascii strings, probably not otherwise so don't try with + * exotic things... + */ +const char *str_crypt(const char *, const char *); + +/* + * Very basic crypto hash. + */ +unsigned long str_crypto_hash(const char *, const char*); +#endif +#endif /* INC_LIBETM_STR_MEM_H */ diff -Nru tickr-0.6.4/src/libetm-0.5.0/tcp_socket.c tickr-0.7.0/src/libetm-0.5.0/tcp_socket.c --- tickr-0.6.4/src/libetm-0.5.0/tcp_socket.c 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/tcp_socket.c 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,388 @@ +/* + * libetm / tcp_socket.c - Copyright (C) Emmanuel Thomas-Maurin 2008-2020 + * + * + * - A few TCP (stream) sockets functions - + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#ifndef WIN32_V +# include +# include +# include +#else +# define _WIN32_WINNT 0x0501 /* Win version = XP (5.1) or higher */ +# include +#endif +#include "libetm.h" + +#define FPRINTF2(stream, ...) \ +{\ + fprintf(stream, ## __VA_ARGS__);\ + fflush(stream);\ +} + +static int send_recv_timeout_sec = SEND_RECV_TIMEOUT_SEC; +static int send_recv_timeout_usec = SEND_RECV_TIMEOUT_USEC; +static int connect_timeout_sec = CONNECT_TIMEOUT_SEC; +static int connect_timeout_usec = CONNECT_TIMEOUT_USEC; + +static zboolean use_proxy = FALSE; + +void set_send_recv_timeout_sec(int timeout) +{ + send_recv_timeout_sec = timeout; +} + +int get_send_recv_timeout_sec() +{ + return send_recv_timeout_sec; +} + +void set_send_recv_timeout_usec(int timeout) +{ + send_recv_timeout_usec = timeout; +} + +int get_send_recv_timeout_usec() +{ + return send_recv_timeout_usec; +} + +void set_connect_timeout_sec(int timeout) +{ + connect_timeout_sec = timeout; +} + +int get_connect_timeout_sec() +{ + return connect_timeout_sec; +} + +void set_connect_timeout_usec(int timeout) +{ + connect_timeout_usec = timeout; +} + +int get_connect_timeout_usec() +{ + return connect_timeout_usec; +} + +void libetm_socket_set_use_proxy(zboolean use_proxy2) +{ + use_proxy = use_proxy2; +} + +zboolean libetm_socket_get_use_proxy() +{ + return use_proxy; +} + +/* + * Can use IPv4 or IPv6 + */ +#ifndef WIN32_V +static void *get_in_addr(struct sockaddr *s_a) +{ + if (s_a->sa_family == AF_INET) + return &(((struct sockaddr_in *)s_a)->sin_addr); + else + return &(((struct sockaddr_in6 *)s_a)->sin6_addr); +} +#endif + +/* + * Open stream socket in non-blocking mode and connect to host. + * Return socket fd (> 0) / TCP_SOCK_CREATE_ERROR (-1 on Linux) if error. + */ +sockt tcp_connect_to_host(const char *host, const char *portnum_str) +{ + sockt sock; +#ifndef WIN32_V + char ipa_str[INET6_ADDRSTRLEN + 1]; +#else +/*#define WIN32_INET6_ADDRSTRLEN 46 + char ipa_str[WIN32_INET6_ADDRSTRLEN + 1];*/ + u_long i_mode = 1; /* != 0 to enable non-blocking mode */ +#endif + struct addrinfo hints, *server_info, *ptr; + fd_set read_set, write_set; + struct timeval timeout; + int s_opt_value; + socklen_t s_opt_len = sizeof(sockt); + int i; + + /* addrinfo stuff */ + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + + /*VERBOSE_INFO_OUT("Resolving host: %s ... ", host)*/ + if ((i = getaddrinfo(host, portnum_str, &hints, &server_info)) != 0) { + if (libetm_socket_get_use_proxy()) { +#ifndef WIN32_V + warning(FALSE, "getaddrinfo() error: %s: %s", host, gai_strerror(i)); +#else + warning(FALSE, "getaddrinfo() error: %s: %s", host, sock_error_message()); +#endif + } else { +#ifndef WIN32_V + INFO_ERR("getaddrinfo() error: %s: %s\n", host, gai_strerror(i)) +#else + INFO_ERR("getaddrinfo() error: %s: %s\n", host, sock_error_message()) +#endif + } + return -1; + } + /*VERBOSE_INFO_OUT("Done\n")*/ + /* We get a list */ + for (ptr = server_info; ptr != NULL; ptr = ptr->ai_next) { + /* Create socket */ + if ((sock = socket(ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol)) == TCP_SOCK_CREATE_ERROR) { + INFO_ERR("Error: %s\n", sock_error_message()) + continue; + } + /* Set socket in non-blocking mode */ +#ifndef WIN32_V + if ((i = fcntl(sock, F_GETFL, 0)) == TCP_SOCK_FUNC_ERROR) { + INFO_ERR("fcntl() error: %s\n", sock_error_message()) + CLOSE_SOCK(sock); + break; + } else if (fcntl(sock, F_SETFL, i | O_NONBLOCK) == TCP_SOCK_FUNC_ERROR) { + INFO_ERR("fcntl() error: %s\n", sock_error_message()) + CLOSE_SOCK(sock); + break; + } +#else + if (ioctlsocket(sock, FIONBIO, &i_mode) == TCP_SOCK_FUNC_ERROR) { + INFO_ERR("ioctlsocket() error %s\n", sock_error_message()) + CLOSE_SOCK(sock); + break; + } +#endif + /* Get IP addr from server_info */ +#ifndef WIN32_V + inet_ntop(ptr->ai_family, get_in_addr((struct sockaddr *)ptr->ai_addr), ipa_str, INET6_ADDRSTRLEN); + VERBOSE_INFO_OUT("Connecting to %s (%s) on port %s ... ", ipa_str, host, portnum_str); +#else + /*if (is_vista_or_higher()) { + // Available only on Vista and above + InetNtop(ptr->ai_family, get_in_addr((struct sockaddr *)ptr->ai_addr), ipa_str, WIN32_INET6_ADDRSTRLEN); + VERBOSE_INFO_OUT"Connecting to %s (%s) on port %s ... ", ipa_str, host, portnum_str) + } else*/ + VERBOSE_INFO_OUT("Connecting to %s on port %s ... ", host, portnum_str); +#endif + /* Connect */ + if ((i = connect(sock, ptr->ai_addr, ptr->ai_addrlen)) == TCP_SOCK_FUNC_ERROR && +#ifndef WIN32_V + errno == EINPROGRESS) { +#else + WSAGetLastError() == WSAEWOULDBLOCK) { +#endif + /* As socket is in non-blocking mode, we must use select() */ + FD_ZERO(&read_set); + FD_ZERO(&write_set); + FD_SET(sock, &read_set); + FD_SET(sock, &write_set); + timeout.tv_sec = get_connect_timeout_sec(); + timeout.tv_usec = get_connect_timeout_usec(); + if ((i = select(sock + 1, &read_set, &write_set, NULL, &timeout)) == TCP_SOCK_FUNC_ERROR) { + INFO_ERR("select() error: %s\n", sock_error_message()) + } else if (i == 0){ + INFO_ERR("Timed out\n") + } else if (FD_ISSET(sock, &read_set) || FD_ISSET(sock, &write_set)) { + if (getsockopt(sock, SOL_SOCKET, SO_ERROR, + (void *)(&s_opt_value), &s_opt_len) == TCP_SOCK_FUNC_ERROR) { + INFO_ERR("getsockopt() error: %s\n", sock_error_message()) + } else if (s_opt_value == 0) { + VERBOSE_INFO_OUT("OK\n") + freeaddrinfo(server_info); + return sock; + } +#ifndef WIN32_V + INFO_ERR("getsockopt(): %s\n", strerror(s_opt_value)) +#else + INFO_ERR("getsockopt(): %s\n", win32_error_msg(s_opt_value)) +#endif + CLOSE_SOCK(sock); + break; + } + CLOSE_SOCK(sock); + break; + } else if (i == 0) { + VERBOSE_INFO_OUT("OK\n") + freeaddrinfo(server_info); + return sock; + } else { + INFO_ERR("connect() error: %s\n", sock_error_message()) + CLOSE_SOCK(sock); + } + } + freeaddrinfo(server_info); + return -1; +} + +int writable_data_is_available_on_tcp_socket(sockt sock) +{ + fd_set write_set; + struct timeval timeout; + int i; + + FD_ZERO(&write_set); + FD_SET(sock, &write_set); + timeout.tv_sec = get_send_recv_timeout_sec(); + timeout.tv_usec = get_send_recv_timeout_usec(); + if ((i = select(sock + 1, NULL, &write_set, NULL, &timeout)) == TCP_SOCK_FUNC_ERROR) { + INFO_ERR("select() error: %s\n", sock_error_message()) + return SELECT_ERROR; + } else if (i == 0) { + return SELECT_TIMED_OUT; + } else { + if (FD_ISSET(sock, &write_set)) + return SELECT_TRUE; + else + return SELECT_FALSE; + } +} + +int readable_data_is_available_on_tcp_socket(sockt sock) +{ + fd_set read_set; + struct timeval timeout; + int i; + + FD_ZERO(&read_set); + FD_SET(sock, &read_set); + timeout.tv_sec = get_send_recv_timeout_sec(); + timeout.tv_usec = get_send_recv_timeout_usec(); + if ((i = select(sock + 1, &read_set, NULL, NULL, &timeout)) == TCP_SOCK_FUNC_ERROR) { + INFO_ERR("select() error: %s\n", sock_error_message()) + return SELECT_ERROR; + } else if (i == 0) { + return SELECT_TIMED_OUT; + } else { + if (FD_ISSET(sock, &read_set)) + return SELECT_TRUE; + else + return SELECT_FALSE; + } +} + +/* + * Return n bytes sent or TCP_SOCK_FUNC_ERROR (-1 on Linux) if error (connection + * closed by server or ?) + */ +int tcp_send_full(sockt sock, const char *str) +{ + int len = strlen(str), i, j = 0; + + while (writable_data_is_available_on_tcp_socket(sock) == SELECT_TRUE) { + if ((i = send(sock, str + j, len, 0)) != TCP_SOCK_FUNC_ERROR) { + if (i > 0) { + j += i; + len -= i; + if (len == 0) + break; + } else { + /* Something to do ? */ + } + } else { + j = i; /* TCP_SOCK_FUNC_ERROR */ +#ifndef WIN32_V + if (errno == EPIPE) { +#else + if ((i = WSAGetLastError()) == WSAECONNRESET || i == WSAECONNABORTED ||\ + i == WSAESHUTDOWN) { +#endif + VERBOSE_INFO_ERR("Connection closed by server\n") + } else { + INFO_ERR("send() error: %s\n", sock_error_message()) + } + break; + } + } + return j; +} + +/* + * Return response = tcp_recv_full(socket, &bytes_received, &status) or NULL if error. + * -> status = TCP_SOCK_OK, CONNECTION_CLOSED_BY_SERVER, TCP_SOCK_FUNC_ERROR or TCP_SOCK_SHOULD_BE_CLOSED. + * -> allocate memory for response (must be freed afterwards with free2() if != NULL). + */ +char *tcp_recv_full(sockt sock, int *bytes_received, int *status) +{ + char *response, *full_response; + int i; + + *bytes_received = 0; + response = malloc2(RECV_CHUNK_LEN + 1); + response[0] = '\0'; + full_response = l_str_new(response); + while (readable_data_is_available_on_tcp_socket(sock) == SELECT_TRUE) { + if ((i = recv(sock, response, RECV_CHUNK_LEN, 0)) != TCP_SOCK_FUNC_ERROR) { + if (i > 0) { + response[MIN(i, RECV_CHUNK_LEN)] = '\0'; + full_response = l_str_cat(full_response, response); + *bytes_received += i; + *status = TCP_SOCK_OK; + } else if (i == 0) { + VERBOSE_INFO_ERR("Connection closed by server\n") + *status = CONNECTION_CLOSED_BY_SERVER; + break; + } + } else { + l_str_free(full_response); + full_response = NULL; + *status = TCP_SOCK_FUNC_ERROR; +#ifndef WIN32_V + INFO_ERR("recv() error: %s\n", sock_error_message()) +#else + if ((i = WSAGetLastError()) == WSAECONNRESET || i == WSAECONNABORTED ||\ + i == WSAESHUTDOWN) { + VERBOSE_INFO_ERR("Connection closed by server\n") + *status = TCP_SOCK_SHOULD_BE_CLOSED; + } else { + INFO_ERR("recv() error: %s\n", win32_error_msg(i)) + } +#endif + break; + } + } + free2(response); + return full_response; +} + +const char *sock_error_message() +{ + static char str[N_SIMULTANEOUS_CALLS][1024]; + static int count = -1; + + count++; + count &= N_SIMULTANEOUS_CALLS_MASK; + +#ifndef WIN32_V + str_n_cpy(str[count], strerror(errno), 1023); +#else + str_n_cpy(str[count], win32_error_msg(WSAGetLastError()), 1023); +#endif + return (const char *)str[count]; +} diff -Nru tickr-0.6.4/src/libetm-0.5.0/tcp_socket.h tickr-0.7.0/src/libetm-0.5.0/tcp_socket.h --- tickr-0.6.4/src/libetm-0.5.0/tcp_socket.h 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/tcp_socket.h 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * libetm / tcp_socket.h - Copyright (C) Emmanuel Thomas-Maurin 2008-2020 + * + * + * - A few TCP (stream) sockets functions - + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef INC_LIBETM_TCP_SOCKET_H +#define INC_LIBETM_TCP_SOCKET_H + +#define TCP_SOCK_OK LIBETM_OK + +/* Timeout default values */ +#define CONNECT_TIMEOUT_SEC 5 +#define CONNECT_TIMEOUT_USEC 0 + +#define SEND_RECV_TIMEOUT_SEC 1 +#define SEND_RECV_TIMEOUT_USEC 0 + +#define RECV_CHUNK_LEN (16 * 1024 - 1) + +#ifndef WIN32_V +typedef int sockt; +# define TCP_SOCK_CREATE_ERROR -1 /* socket() */ +# define TCP_SOCK_FUNC_ERROR -1 /* setsockopt(), bind(), listen(), select(), connect(), + * send(), recv(), fnctl(), ioctlsocket() */ +# define CLOSE_SOCK(s) close(s) +#else +# include /* Dirty fix. */ +typedef SOCKET sockt; +# define TCP_SOCK_CREATE_ERROR INVALID_SOCKET +# define TCP_SOCK_FUNC_ERROR SOCKET_ERROR +# define CLOSE_SOCK(s) closesocket(s) +#endif + +void set_send_recv_timeout_sec(int); + +int get_send_recv_timeout_sec(); + +void set_send_recv_timeout_usec(int); + +int get_send_recv_timeout_usec(); + +void set_connect_timeout_sec(int); + +int get_connect_timeout_sec(); + +void set_connect_timeout_usec(int); + +int get_connect_timeout_usec(); + +/* Default is not using proxy, otherwise must be set. */ +void libetm_socket_set_use_proxy(zboolean); + +zboolean libetm_socket_get_use_proxy(); + +/* + * Open stream socket in non-blocking mode and connect to host. + * Return socket fd (> 0) / TCP_SOCK_CREATE_ERROR (-1 on Linux) if error. + */ +sockt tcp_connect_to_host(const char *, const char *); + +int writable_data_is_available_on_tcp_socket(sockt); + +int readable_data_is_available_on_tcp_socket(sockt); + +/* + * Return n bytes sent or TCP_SOCK_FUNC_ERROR (-1 on Linux) if error (connection + * closed by server or ?) + */ +int tcp_send_full(sockt, const char *); + +/* + * Return response = tcp_recv_full(socket, &bytes_received, &status) or NULL if error. + * -> status = TCP_SOCK_OK, CONNECTION_CLOSED_BY_SERVER, TCP_SOCK_FUNC_ERROR or TCP_SOCK_SHOULD_BE_CLOSED. + * -> allocate memory for response (must be freed afterwards with free2() if != NULL). + */ +char *tcp_recv_full(sockt, int *, int *); + +const char *sock_error_message(); +#endif /* INC_LIBETM_TCP_SOCKET_H */ diff -Nru tickr-0.6.4/src/libetm-0.5.0/TODO tickr-0.7.0/src/libetm-0.5.0/TODO --- tickr-0.6.4/src/libetm-0.5.0/TODO 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/TODO 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,11 @@ +TODO: + +- More testing. + +(Not sure yet about that:) + +- Add HTTP API (-> html_entities.h, http.h, http.c). + +- Add doubly-linked list API (-> dl_list.h, dl_list.c / FList -> DLList ?) + +- Change func names ? diff -Nru tickr-0.6.4/src/libetm-0.5.0/win32_specific.c tickr-0.7.0/src/libetm-0.5.0/win32_specific.c --- tickr-0.6.4/src/libetm-0.5.0/win32_specific.c 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/win32_specific.c 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,274 @@ +/* + * libetm / win32_specific.c - Copyright (C) Emmanuel Thomas-Maurin 2008-2020 + * + * + * - Win32 specific functions - + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifdef WIN32_V + +#include +#include +#include +#include +#include +#include +#include +#include "libetm.h" + +#define APP_WIN32REG_KEYPATH "app_win32_registry_keypath" /* Or whatever */ + +FILE *std_out, *std_err; + +/* + * On Linux, STD_OUT = stdout and STD_ERR = stderr / on win32, we must + * first create specific text files then pass them to this function. + */ +void libetm_init_win32_stdout_stderr(FILE *std_out2, FILE *std_err2) +{ + std_out = std_out2; + std_err = std_err2; +} + +void libetm_init_win32_sockets() +{ + WSADATA wsadata; + int i; + + if ((i = WSAStartup(MAKEWORD(2, 2), &wsadata)) != 0) + big_error/*_in_lib*/(WIN32_ERROR, "WSAStartup() error ", itoa2(i)); + else if (LOBYTE(wsadata.wVersion) != 2 || HIBYTE(wsadata.wVersion) != 2) { + WSACleanup(); + big_error/*_in_lib*/(WIN32_ERROR, "Couldn't find a usable version of Winsock.dll"); + } +} + +void libetm_cleanup_win32_sockets() +{ + WSACleanup(); +} + +/* Return NULL if error */ +const char *get_appdata_dir() +{ + static TCHAR appdata_dir[MAX_PATH + 1]; + static int i = 0; + + if (i == 0) { + i++; + if (SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, appdata_dir) != S_OK) + i++; + } + if (i == 1) + return (const char *)appdata_dir; + else + return NULL; +} + +/* Return NULL if error */ +const char *get_appdata_dir_w() +{ + static WCHAR appdata_dir[MAX_PATH + 1]; + static int i = 0; + + if (i == 0) { + i++; + if (SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, 0, appdata_dir) != S_OK) + i++; + } + if (i == 1) + return (const char *)appdata_dir; + else + return NULL; +} + +/* Return NULL if error */ +const char *get_progfiles_dir() +{ + static TCHAR progfiles_dir[MAX_PATH + 1]; + static int i = 0; + + if (i == 0) { + i++; + if (SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, 0, progfiles_dir) != S_OK) + i++; + } + if (i == 1) + return (const char *)progfiles_dir; + else + return NULL; +} + +/* key_value must be able to store 255 chars */ +int get_key_value_from_win32registry(const char *key_name, char *key_value) +{ + char app_win32regkey_full[128]; + HKEY hkey; + DWORD type = REG_SZ, buf_size = 256; + LONG result; + + str_n_cpy(app_win32regkey_full, APP_WIN32REG_KEYPATH, 64); + str_n_cat(app_win32regkey_full, key_name, 63); + + if ((result = RegOpenKeyEx(HKEY_CURRENT_USER, app_win32regkey_full, + 0L, KEY_QUERY_VALUE, &hkey)) == ERROR_SUCCESS) { + if (RegQueryValueEx(hkey, NULL, NULL, &type, (unsigned char*)key_value, + &buf_size) == ERROR_SUCCESS) { + RegCloseKey(hkey); + return LIBETM_OK; + } else { + RegCloseKey(hkey); + return WIN32REGKEY_NOT_FOUND; + } + } else { + if (result == ERROR_FILE_NOT_FOUND) + return WIN32REGKEY_NOT_FOUND; + else + return WIN32REGKEY_OTHER_ERROR; + } +} + +int save_key_value_into_win32registry(const char *key_name, const char *key_value) +{ + char app_win32regkey_full[128]; + HKEY hkey; + DWORD disp = 0; + + str_n_cpy(app_win32regkey_full, APP_WIN32REG_KEYPATH, 64); + str_n_cat(app_win32regkey_full, key_name, 63); + + if (RegCreateKeyEx(HKEY_CURRENT_USER, app_win32regkey_full, 0L, + NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hkey, &disp) + == ERROR_SUCCESS) { + if (RegSetValueEx(hkey, NULL, 0L, REG_SZ, (unsigned char *)TEXT(key_value), + 256) == ERROR_SUCCESS) { + RegCloseKey(hkey); + return LIBETM_OK; + } else { + RegCloseKey(hkey); + return WIN32REGKEY_SAVE_ERROR; + } + } else + return WIN32REGKEY_CREATE_ERROR; +} + +/* Return NULL if error */ +const char *get_default_browser_from_win32registry() +{ + static char browser_cmd[512]; + HKEY hkey; + DWORD type = REG_SZ, buf_size = 512; + LONG result; + + if ((result = RegOpenKeyEx(HKEY_CLASSES_ROOT, "http\\shell\\open\\command", + 0L, KEY_QUERY_VALUE, &hkey)) == ERROR_SUCCESS) { + if (RegQueryValueEx(hkey, NULL, NULL, &type, (unsigned char*)browser_cmd, + &buf_size) == ERROR_SUCCESS) { + RegCloseKey(hkey); + return (const char *)browser_cmd; + } else { + RegCloseKey(hkey); + return NULL; + } + } else + return NULL; +} + +/* Return -1 if error */ +int get_win32_taskbar_height() +{ + HWND hwnd; + RECT r; + LPRECT lpRect = &r; + + if ((hwnd = FindWindow("Shell_traywnd", "")) != NULL) { + if (GetWindowRect(hwnd, lpRect)) + return (int) (lpRect->bottom - lpRect->top); + } + return -1; +} + +/* Unused so commented out */ +/*zboolean is_vista_or_higher() +{ + OSVERSIONINFO os_v_info; + + memset(&os_v_info, 0, sizeof(OSVERSIONINFO)); + os_v_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&os_v_info); + return (os_v_info.dwMajorVersion >= 6 ? TRUE : FALSE); // Vista = 6.0 +}*/ + +/* Unused so commented out */ +/* + * Find up to 15 mac addresses for this computer + * Return NULL if error + */ +/*const char **find_mac_addresses() +{ + IP_ADAPTER_INFO *adapter_info; + ULONG buf_len = sizeof(adapter_info); + PIP_ADAPTER_INFO p_adapter_info; + static char macaddr[16][256], tmp[3]; + static char *p_macaddr[16]; + unsigned int i, j = 0; + + adapter_info = (IP_ADAPTER_INFO *)malloc2(sizeof(IP_ADAPTER_INFO)); + buf_len = sizeof(IP_ADAPTER_INFO); + // initial call is supposed to fail + if (GetAdaptersInfo(adapter_info, &buf_len) != ERROR_SUCCESS) { + free2(adapter_info); + adapter_info = (IP_ADAPTER_INFO *)malloc2(buf_len); + } + // 2nd call + if (GetAdaptersInfo(adapter_info, &buf_len) != ERROR_SUCCESS) { + free2(adapter_info); + return NULL; + } else { + p_adapter_info = (PIP_ADAPTER_INFO)adapter_info; + while (p_adapter_info && j < 15) { + macaddr[j][0] = '\0'; + for (i = 0; i < 127 && i < p_adapter_info->AddressLength; i++) { + snprintf(tmp, 3, "%02X", p_adapter_info->Address[i]); + str_n_cat(macaddr[j], tmp, 2); + } + p_macaddr[j] = macaddr[j]; + j++; + p_adapter_info = p_adapter_info->Next; + } + free2(adapter_info); + p_macaddr[j] = NULL; + } + return (const char **)p_macaddr; +}*/ + +const char *win32_error_msg(int i) +{ + static char str[N_SIMULTANEOUS_CALLS][1024]; + LPVOID msg_buf; + static int count = -1; + + count++; + count &= N_SIMULTANEOUS_CALLS_MASK; + + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, (DWORD)i, MAKELANGID(LANG_NEUTRAL, + SUBLANG_DEFAULT), (LPTSTR)&msg_buf, 0, NULL); + str_n_cpy(str[count], (const char *)msg_buf, 1023); + LocalFree(msg_buf); + return (const char *)str[count]; +} +#endif diff -Nru tickr-0.6.4/src/libetm-0.5.0/win32_specific.h tickr-0.7.0/src/libetm-0.5.0/win32_specific.h --- tickr-0.6.4/src/libetm-0.5.0/win32_specific.h 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/libetm-0.5.0/win32_specific.h 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * libetm / win32_specific.h - Copyright (C) Emmanuel Thomas-Maurin 2008-2020 + * + * + * - Win32 specific functions - + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef INC_LIBETM_WIN32_SPECIFIC_H +#define INC_LIBETM_WIN32_SPECIFIC_H + +#ifdef WIN32_V +extern FILE *std_out, *std_err; + +/* + * On Linux, STD_OUT = stdout and STD_ERR = stderr / on win32, we must + * first create specific text files then pass them to this function. + */ +void libetm_init_win32_stdout_stderr(FILE *, FILE *); + +void libetm_init_win32_sockets(); + +void libetm_cleanup_win32_sockets(); + +/* Return NULL if error */ +const char *get_appdata_dir(); + +const char *get_appdata_dir_w(); + +const char *get_progfiles_dir(); + +/* key_value must be able to store 255 chars */ +int get_key_value_from_win32registry(const char *, char *); + +int save_key_value_into_win32registry(const char *, const char *); + +/* Return NULL if error */ +const char *get_default_browser_from_win32registry(); + +/* Return -1 if error */ +int get_win32_taskbar_height(); + +/* Unused so commented out */ +/*zboolean is_vista_or_higher();*/ + +/* Unused so commented out */ +/* + * Find up to 15 mac addresses for this computer + * Return NULL if error + */ +/*const char **find_mac_addresses();*/ + +const char *win32_error_msg(int); +#endif +#endif /* INC_LIBETM_WIN32_SPECIFIC_H */ diff -Nru tickr-0.6.4/src/Makefile.am tickr-0.7.0/src/Makefile.am --- tickr-0.6.4/src/Makefile.am 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/Makefile.am 2020-05-31 19:46:20.000000000 +0000 @@ -1 +1 @@ -SUBDIRS = libetm-0.4.4 tickr +SUBDIRS = libetm-0.5.0 tickr diff -Nru tickr-0.6.4/src/Makefile.in tickr-0.7.0/src/Makefile.in --- tickr-0.6.4/src/Makefile.in 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/Makefile.in 2020-05-31 19:46:20.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2017 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. @@ -15,6 +14,61 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -32,32 +86,71 @@ PRE_UNINSTALL = : POST_UNINSTALL = : subdir = src -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_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=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -86,6 +179,7 @@ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -103,6 +197,10 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ @@ -171,6 +269,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -179,7 +278,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = libetm-0.4.4 tickr +SUBDIRS = libetm-0.5.0 tickr all: all-recursive .SUFFIXES: @@ -195,7 +294,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -215,22 +313,25 @@ $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# 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//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + 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; \ @@ -245,57 +346,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -311,12 +367,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -328,15 +379,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +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 @@ -345,6 +392,21 @@ 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 @@ -381,13 +443,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -508,21 +567,21 @@ uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-generic 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 pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic ctags \ - ctags-recursive distclean distclean-generic 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 pdf pdf-am ps ps-am tags \ - tags-recursive uninstall uninstall-am +.PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru tickr-0.6.4/src/tickr/Makefile.am tickr-0.7.0/src/tickr/Makefile.am --- tickr-0.6.4/src/tickr/Makefile.am 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/Makefile.am 2020-05-31 19:46:20.000000000 +0000 @@ -21,18 +21,20 @@ tickr_helptext.c\ tickr_opml.c\ tickr_http.c\ - tickr_socket.c\ tickr_connectwin.c\ tickr_quickfeedpicker.c\ tickr_quicksetup.c\ - tickr_check4updates.c + tickr_check4updates.c\ + tickr_error.c\ + tickr_tls.c -tickr_CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith -ffast-math\ - -pedantic $(GTK2_CFLAGS) $(XML2_CFLAGS) +tickr_CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ + -ffast-math -pedantic -Wno-variadic-macros -fmax-errors=5 $(GTK2_CFLAGS)\ + $(XML2_CFLAGS) $(GNUTLS_CFLAGS) $(FRIBIDI_CFLAGS) -tickr_LDFLAGS = -Wl,-z,defs -Wl,--as-needed ../libetm-0.4.4/libetm.a +tickr_LDFLAGS = -Wl,-z,defs -Wl,--as-needed ../libetm-0.5.0/libetm.a -tickr_LDADD = ../libetm-0.4.4/libetm.a $(GTK2_LIBS) $(XML2_LIBS) +tickr_LDADD = ../libetm-0.5.0/libetm.a $(GTK2_LIBS) $(XML2_LIBS) $(GNUTLS_LIBS) $(FRIBIDI_LIBS) tickr_DATA = ../../images/tickr-icon.png ../../images/tickr-logo.png\ ../../images/tickr-rss-icon.png ../../images/tickr-icon.xpm diff -Nru tickr-0.6.4/src/tickr/Makefile.in tickr-0.7.0/src/tickr/Makefile.in --- tickr-0.6.4/src/tickr/Makefile.in 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/Makefile.in 2020-05-31 19:46:20.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2017 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. @@ -17,6 +16,61 @@ VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -35,11 +89,11 @@ POST_UNINSTALL = : bin_PROGRAMS = tickr$(EXEEXT) subdir = src/tickr -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -53,27 +107,57 @@ tickr-tickr_feedpicker.$(OBJEXT) tickr-tickr_prefwin.$(OBJEXT) \ tickr-tickr_otherwins.$(OBJEXT) tickr-tickr_misc.$(OBJEXT) \ tickr-tickr_helptext.$(OBJEXT) tickr-tickr_opml.$(OBJEXT) \ - tickr-tickr_http.$(OBJEXT) tickr-tickr_socket.$(OBJEXT) \ - tickr-tickr_connectwin.$(OBJEXT) \ + tickr-tickr_http.$(OBJEXT) tickr-tickr_connectwin.$(OBJEXT) \ tickr-tickr_quickfeedpicker.$(OBJEXT) \ tickr-tickr_quicksetup.$(OBJEXT) \ - tickr-tickr_check4updates.$(OBJEXT) + tickr-tickr_check4updates.$(OBJEXT) \ + tickr-tickr_error.$(OBJEXT) tickr-tickr_tls.$(OBJEXT) tickr_OBJECTS = $(am_tickr_OBJECTS) am__DEPENDENCIES_1 = -tickr_DEPENDENCIES = ../libetm-0.4.4/libetm.a $(am__DEPENDENCIES_1) \ +tickr_DEPENDENCIES = ../libetm-0.5.0/libetm.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) tickr_LINK = $(CCLD) $(tickr_CFLAGS) $(CFLAGS) $(tickr_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 +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) +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 = $(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 = $(tickr_SOURCES) DIST_SOURCES = $(tickr_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/||"`;; \ @@ -102,11 +186,30 @@ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(tickr_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -124,6 +227,10 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ @@ -192,6 +299,7 @@ prefix = /usr program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -215,17 +323,19 @@ tickr_helptext.c\ tickr_opml.c\ tickr_http.c\ - tickr_socket.c\ tickr_connectwin.c\ tickr_quickfeedpicker.c\ tickr_quicksetup.c\ - tickr_check4updates.c - -tickr_CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith -ffast-math\ - -pedantic $(GTK2_CFLAGS) $(XML2_CFLAGS) + tickr_check4updates.c\ + tickr_error.c\ + tickr_tls.c + +tickr_CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ + -ffast-math -pedantic -Wno-variadic-macros -fmax-errors=5 $(GTK2_CFLAGS)\ + $(XML2_CFLAGS) $(GNUTLS_CFLAGS) $(FRIBIDI_CFLAGS) -tickr_LDFLAGS = -Wl,-z,defs -Wl,--as-needed ../libetm-0.4.4/libetm.a -tickr_LDADD = ../libetm-0.4.4/libetm.a $(GTK2_LIBS) $(XML2_LIBS) +tickr_LDFLAGS = -Wl,-z,defs -Wl,--as-needed ../libetm-0.5.0/libetm.a +tickr_LDADD = ../libetm-0.5.0/libetm.a $(GTK2_LIBS) $(XML2_LIBS) $(GNUTLS_LIBS) $(FRIBIDI_LIBS) tickr_DATA = ../../images/tickr-icon.png ../../images/tickr-logo.png\ ../../images/tickr-rss-icon.png ../../images/tickr-icon.xpm @@ -245,7 +355,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tickr/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/tickr/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -265,14 +374,18 @@ $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @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; \ - then echo "$$p"; echo "$$p"; else :; fi; \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + 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 } \ @@ -293,16 +406,18 @@ @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)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + tickr$(EXEEXT): $(tickr_OBJECTS) $(tickr_DEPENDENCIES) $(EXTRA_tickr_DEPENDENCIES) @rm -f tickr$(EXEEXT) - $(tickr_LINK) $(tickr_OBJECTS) $(tickr_LDADD) $(LIBS) + $(AM_V_CCLD)$(tickr_LINK) $(tickr_OBJECTS) $(tickr_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -313,6 +428,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_check4updates.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_clock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_connectwin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_feedparser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_feedpicker.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_helptext.Po@am__quote@ @@ -328,291 +444,308 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_quicksetup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_render.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_resource.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_socket.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickr-tickr_tls.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@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@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@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@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` tickr-tickr_main.o: tickr_main.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_main.o -MD -MP -MF $(DEPDIR)/tickr-tickr_main.Tpo -c -o tickr-tickr_main.o `test -f 'tickr_main.c' || echo '$(srcdir)/'`tickr_main.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_main.Tpo $(DEPDIR)/tickr-tickr_main.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_main.c' object='tickr-tickr_main.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_main.o -MD -MP -MF $(DEPDIR)/tickr-tickr_main.Tpo -c -o tickr-tickr_main.o `test -f 'tickr_main.c' || echo '$(srcdir)/'`tickr_main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_main.Tpo $(DEPDIR)/tickr-tickr_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_main.c' object='tickr-tickr_main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_main.o `test -f 'tickr_main.c' || echo '$(srcdir)/'`tickr_main.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_main.o `test -f 'tickr_main.c' || echo '$(srcdir)/'`tickr_main.c tickr-tickr_main.obj: tickr_main.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_main.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_main.Tpo -c -o tickr-tickr_main.obj `if test -f 'tickr_main.c'; then $(CYGPATH_W) 'tickr_main.c'; else $(CYGPATH_W) '$(srcdir)/tickr_main.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_main.Tpo $(DEPDIR)/tickr-tickr_main.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_main.c' object='tickr-tickr_main.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_main.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_main.Tpo -c -o tickr-tickr_main.obj `if test -f 'tickr_main.c'; then $(CYGPATH_W) 'tickr_main.c'; else $(CYGPATH_W) '$(srcdir)/tickr_main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_main.Tpo $(DEPDIR)/tickr-tickr_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_main.c' object='tickr-tickr_main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_main.obj `if test -f 'tickr_main.c'; then $(CYGPATH_W) 'tickr_main.c'; else $(CYGPATH_W) '$(srcdir)/tickr_main.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_main.obj `if test -f 'tickr_main.c'; then $(CYGPATH_W) 'tickr_main.c'; else $(CYGPATH_W) '$(srcdir)/tickr_main.c'; fi` tickr-tickr_resource.o: tickr_resource.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_resource.o -MD -MP -MF $(DEPDIR)/tickr-tickr_resource.Tpo -c -o tickr-tickr_resource.o `test -f 'tickr_resource.c' || echo '$(srcdir)/'`tickr_resource.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_resource.Tpo $(DEPDIR)/tickr-tickr_resource.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_resource.c' object='tickr-tickr_resource.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_resource.o -MD -MP -MF $(DEPDIR)/tickr-tickr_resource.Tpo -c -o tickr-tickr_resource.o `test -f 'tickr_resource.c' || echo '$(srcdir)/'`tickr_resource.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_resource.Tpo $(DEPDIR)/tickr-tickr_resource.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_resource.c' object='tickr-tickr_resource.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_resource.o `test -f 'tickr_resource.c' || echo '$(srcdir)/'`tickr_resource.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_resource.o `test -f 'tickr_resource.c' || echo '$(srcdir)/'`tickr_resource.c tickr-tickr_resource.obj: tickr_resource.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_resource.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_resource.Tpo -c -o tickr-tickr_resource.obj `if test -f 'tickr_resource.c'; then $(CYGPATH_W) 'tickr_resource.c'; else $(CYGPATH_W) '$(srcdir)/tickr_resource.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_resource.Tpo $(DEPDIR)/tickr-tickr_resource.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_resource.c' object='tickr-tickr_resource.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_resource.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_resource.Tpo -c -o tickr-tickr_resource.obj `if test -f 'tickr_resource.c'; then $(CYGPATH_W) 'tickr_resource.c'; else $(CYGPATH_W) '$(srcdir)/tickr_resource.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_resource.Tpo $(DEPDIR)/tickr-tickr_resource.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_resource.c' object='tickr-tickr_resource.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_resource.obj `if test -f 'tickr_resource.c'; then $(CYGPATH_W) 'tickr_resource.c'; else $(CYGPATH_W) '$(srcdir)/tickr_resource.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_resource.obj `if test -f 'tickr_resource.c'; then $(CYGPATH_W) 'tickr_resource.c'; else $(CYGPATH_W) '$(srcdir)/tickr_resource.c'; fi` tickr-tickr_render.o: tickr_render.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_render.o -MD -MP -MF $(DEPDIR)/tickr-tickr_render.Tpo -c -o tickr-tickr_render.o `test -f 'tickr_render.c' || echo '$(srcdir)/'`tickr_render.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_render.Tpo $(DEPDIR)/tickr-tickr_render.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_render.c' object='tickr-tickr_render.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_render.o -MD -MP -MF $(DEPDIR)/tickr-tickr_render.Tpo -c -o tickr-tickr_render.o `test -f 'tickr_render.c' || echo '$(srcdir)/'`tickr_render.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_render.Tpo $(DEPDIR)/tickr-tickr_render.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_render.c' object='tickr-tickr_render.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_render.o `test -f 'tickr_render.c' || echo '$(srcdir)/'`tickr_render.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_render.o `test -f 'tickr_render.c' || echo '$(srcdir)/'`tickr_render.c tickr-tickr_render.obj: tickr_render.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_render.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_render.Tpo -c -o tickr-tickr_render.obj `if test -f 'tickr_render.c'; then $(CYGPATH_W) 'tickr_render.c'; else $(CYGPATH_W) '$(srcdir)/tickr_render.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_render.Tpo $(DEPDIR)/tickr-tickr_render.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_render.c' object='tickr-tickr_render.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_render.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_render.Tpo -c -o tickr-tickr_render.obj `if test -f 'tickr_render.c'; then $(CYGPATH_W) 'tickr_render.c'; else $(CYGPATH_W) '$(srcdir)/tickr_render.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_render.Tpo $(DEPDIR)/tickr-tickr_render.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_render.c' object='tickr-tickr_render.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_render.obj `if test -f 'tickr_render.c'; then $(CYGPATH_W) 'tickr_render.c'; else $(CYGPATH_W) '$(srcdir)/tickr_render.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_render.obj `if test -f 'tickr_render.c'; then $(CYGPATH_W) 'tickr_render.c'; else $(CYGPATH_W) '$(srcdir)/tickr_render.c'; fi` tickr-tickr_params.o: tickr_params.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_params.o -MD -MP -MF $(DEPDIR)/tickr-tickr_params.Tpo -c -o tickr-tickr_params.o `test -f 'tickr_params.c' || echo '$(srcdir)/'`tickr_params.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_params.Tpo $(DEPDIR)/tickr-tickr_params.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_params.c' object='tickr-tickr_params.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_params.o -MD -MP -MF $(DEPDIR)/tickr-tickr_params.Tpo -c -o tickr-tickr_params.o `test -f 'tickr_params.c' || echo '$(srcdir)/'`tickr_params.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_params.Tpo $(DEPDIR)/tickr-tickr_params.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_params.c' object='tickr-tickr_params.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_params.o `test -f 'tickr_params.c' || echo '$(srcdir)/'`tickr_params.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_params.o `test -f 'tickr_params.c' || echo '$(srcdir)/'`tickr_params.c tickr-tickr_params.obj: tickr_params.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_params.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_params.Tpo -c -o tickr-tickr_params.obj `if test -f 'tickr_params.c'; then $(CYGPATH_W) 'tickr_params.c'; else $(CYGPATH_W) '$(srcdir)/tickr_params.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_params.Tpo $(DEPDIR)/tickr-tickr_params.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_params.c' object='tickr-tickr_params.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_params.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_params.Tpo -c -o tickr-tickr_params.obj `if test -f 'tickr_params.c'; then $(CYGPATH_W) 'tickr_params.c'; else $(CYGPATH_W) '$(srcdir)/tickr_params.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_params.Tpo $(DEPDIR)/tickr-tickr_params.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_params.c' object='tickr-tickr_params.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_params.obj `if test -f 'tickr_params.c'; then $(CYGPATH_W) 'tickr_params.c'; else $(CYGPATH_W) '$(srcdir)/tickr_params.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_params.obj `if test -f 'tickr_params.c'; then $(CYGPATH_W) 'tickr_params.c'; else $(CYGPATH_W) '$(srcdir)/tickr_params.c'; fi` tickr-tickr_clock.o: tickr_clock.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_clock.o -MD -MP -MF $(DEPDIR)/tickr-tickr_clock.Tpo -c -o tickr-tickr_clock.o `test -f 'tickr_clock.c' || echo '$(srcdir)/'`tickr_clock.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_clock.Tpo $(DEPDIR)/tickr-tickr_clock.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_clock.c' object='tickr-tickr_clock.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_clock.o -MD -MP -MF $(DEPDIR)/tickr-tickr_clock.Tpo -c -o tickr-tickr_clock.o `test -f 'tickr_clock.c' || echo '$(srcdir)/'`tickr_clock.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_clock.Tpo $(DEPDIR)/tickr-tickr_clock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_clock.c' object='tickr-tickr_clock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_clock.o `test -f 'tickr_clock.c' || echo '$(srcdir)/'`tickr_clock.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_clock.o `test -f 'tickr_clock.c' || echo '$(srcdir)/'`tickr_clock.c tickr-tickr_clock.obj: tickr_clock.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_clock.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_clock.Tpo -c -o tickr-tickr_clock.obj `if test -f 'tickr_clock.c'; then $(CYGPATH_W) 'tickr_clock.c'; else $(CYGPATH_W) '$(srcdir)/tickr_clock.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_clock.Tpo $(DEPDIR)/tickr-tickr_clock.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_clock.c' object='tickr-tickr_clock.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_clock.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_clock.Tpo -c -o tickr-tickr_clock.obj `if test -f 'tickr_clock.c'; then $(CYGPATH_W) 'tickr_clock.c'; else $(CYGPATH_W) '$(srcdir)/tickr_clock.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_clock.Tpo $(DEPDIR)/tickr-tickr_clock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_clock.c' object='tickr-tickr_clock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_clock.obj `if test -f 'tickr_clock.c'; then $(CYGPATH_W) 'tickr_clock.c'; else $(CYGPATH_W) '$(srcdir)/tickr_clock.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_clock.obj `if test -f 'tickr_clock.c'; then $(CYGPATH_W) 'tickr_clock.c'; else $(CYGPATH_W) '$(srcdir)/tickr_clock.c'; fi` tickr-tickr_feedparser.o: tickr_feedparser.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_feedparser.o -MD -MP -MF $(DEPDIR)/tickr-tickr_feedparser.Tpo -c -o tickr-tickr_feedparser.o `test -f 'tickr_feedparser.c' || echo '$(srcdir)/'`tickr_feedparser.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_feedparser.Tpo $(DEPDIR)/tickr-tickr_feedparser.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_feedparser.c' object='tickr-tickr_feedparser.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_feedparser.o -MD -MP -MF $(DEPDIR)/tickr-tickr_feedparser.Tpo -c -o tickr-tickr_feedparser.o `test -f 'tickr_feedparser.c' || echo '$(srcdir)/'`tickr_feedparser.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_feedparser.Tpo $(DEPDIR)/tickr-tickr_feedparser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_feedparser.c' object='tickr-tickr_feedparser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_feedparser.o `test -f 'tickr_feedparser.c' || echo '$(srcdir)/'`tickr_feedparser.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_feedparser.o `test -f 'tickr_feedparser.c' || echo '$(srcdir)/'`tickr_feedparser.c tickr-tickr_feedparser.obj: tickr_feedparser.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_feedparser.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_feedparser.Tpo -c -o tickr-tickr_feedparser.obj `if test -f 'tickr_feedparser.c'; then $(CYGPATH_W) 'tickr_feedparser.c'; else $(CYGPATH_W) '$(srcdir)/tickr_feedparser.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_feedparser.Tpo $(DEPDIR)/tickr-tickr_feedparser.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_feedparser.c' object='tickr-tickr_feedparser.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_feedparser.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_feedparser.Tpo -c -o tickr-tickr_feedparser.obj `if test -f 'tickr_feedparser.c'; then $(CYGPATH_W) 'tickr_feedparser.c'; else $(CYGPATH_W) '$(srcdir)/tickr_feedparser.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_feedparser.Tpo $(DEPDIR)/tickr-tickr_feedparser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_feedparser.c' object='tickr-tickr_feedparser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_feedparser.obj `if test -f 'tickr_feedparser.c'; then $(CYGPATH_W) 'tickr_feedparser.c'; else $(CYGPATH_W) '$(srcdir)/tickr_feedparser.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_feedparser.obj `if test -f 'tickr_feedparser.c'; then $(CYGPATH_W) 'tickr_feedparser.c'; else $(CYGPATH_W) '$(srcdir)/tickr_feedparser.c'; fi` tickr-tickr_list.o: tickr_list.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_list.o -MD -MP -MF $(DEPDIR)/tickr-tickr_list.Tpo -c -o tickr-tickr_list.o `test -f 'tickr_list.c' || echo '$(srcdir)/'`tickr_list.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_list.Tpo $(DEPDIR)/tickr-tickr_list.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_list.c' object='tickr-tickr_list.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_list.o -MD -MP -MF $(DEPDIR)/tickr-tickr_list.Tpo -c -o tickr-tickr_list.o `test -f 'tickr_list.c' || echo '$(srcdir)/'`tickr_list.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_list.Tpo $(DEPDIR)/tickr-tickr_list.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_list.c' object='tickr-tickr_list.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_list.o `test -f 'tickr_list.c' || echo '$(srcdir)/'`tickr_list.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_list.o `test -f 'tickr_list.c' || echo '$(srcdir)/'`tickr_list.c tickr-tickr_list.obj: tickr_list.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_list.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_list.Tpo -c -o tickr-tickr_list.obj `if test -f 'tickr_list.c'; then $(CYGPATH_W) 'tickr_list.c'; else $(CYGPATH_W) '$(srcdir)/tickr_list.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_list.Tpo $(DEPDIR)/tickr-tickr_list.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_list.c' object='tickr-tickr_list.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_list.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_list.Tpo -c -o tickr-tickr_list.obj `if test -f 'tickr_list.c'; then $(CYGPATH_W) 'tickr_list.c'; else $(CYGPATH_W) '$(srcdir)/tickr_list.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_list.Tpo $(DEPDIR)/tickr-tickr_list.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_list.c' object='tickr-tickr_list.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_list.obj `if test -f 'tickr_list.c'; then $(CYGPATH_W) 'tickr_list.c'; else $(CYGPATH_W) '$(srcdir)/tickr_list.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_list.obj `if test -f 'tickr_list.c'; then $(CYGPATH_W) 'tickr_list.c'; else $(CYGPATH_W) '$(srcdir)/tickr_list.c'; fi` tickr-tickr_feedpicker.o: tickr_feedpicker.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_feedpicker.o -MD -MP -MF $(DEPDIR)/tickr-tickr_feedpicker.Tpo -c -o tickr-tickr_feedpicker.o `test -f 'tickr_feedpicker.c' || echo '$(srcdir)/'`tickr_feedpicker.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_feedpicker.Tpo $(DEPDIR)/tickr-tickr_feedpicker.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_feedpicker.c' object='tickr-tickr_feedpicker.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_feedpicker.o -MD -MP -MF $(DEPDIR)/tickr-tickr_feedpicker.Tpo -c -o tickr-tickr_feedpicker.o `test -f 'tickr_feedpicker.c' || echo '$(srcdir)/'`tickr_feedpicker.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_feedpicker.Tpo $(DEPDIR)/tickr-tickr_feedpicker.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_feedpicker.c' object='tickr-tickr_feedpicker.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_feedpicker.o `test -f 'tickr_feedpicker.c' || echo '$(srcdir)/'`tickr_feedpicker.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_feedpicker.o `test -f 'tickr_feedpicker.c' || echo '$(srcdir)/'`tickr_feedpicker.c tickr-tickr_feedpicker.obj: tickr_feedpicker.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_feedpicker.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_feedpicker.Tpo -c -o tickr-tickr_feedpicker.obj `if test -f 'tickr_feedpicker.c'; then $(CYGPATH_W) 'tickr_feedpicker.c'; else $(CYGPATH_W) '$(srcdir)/tickr_feedpicker.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_feedpicker.Tpo $(DEPDIR)/tickr-tickr_feedpicker.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_feedpicker.c' object='tickr-tickr_feedpicker.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_feedpicker.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_feedpicker.Tpo -c -o tickr-tickr_feedpicker.obj `if test -f 'tickr_feedpicker.c'; then $(CYGPATH_W) 'tickr_feedpicker.c'; else $(CYGPATH_W) '$(srcdir)/tickr_feedpicker.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_feedpicker.Tpo $(DEPDIR)/tickr-tickr_feedpicker.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_feedpicker.c' object='tickr-tickr_feedpicker.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_feedpicker.obj `if test -f 'tickr_feedpicker.c'; then $(CYGPATH_W) 'tickr_feedpicker.c'; else $(CYGPATH_W) '$(srcdir)/tickr_feedpicker.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_feedpicker.obj `if test -f 'tickr_feedpicker.c'; then $(CYGPATH_W) 'tickr_feedpicker.c'; else $(CYGPATH_W) '$(srcdir)/tickr_feedpicker.c'; fi` tickr-tickr_prefwin.o: tickr_prefwin.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_prefwin.o -MD -MP -MF $(DEPDIR)/tickr-tickr_prefwin.Tpo -c -o tickr-tickr_prefwin.o `test -f 'tickr_prefwin.c' || echo '$(srcdir)/'`tickr_prefwin.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_prefwin.Tpo $(DEPDIR)/tickr-tickr_prefwin.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_prefwin.c' object='tickr-tickr_prefwin.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_prefwin.o -MD -MP -MF $(DEPDIR)/tickr-tickr_prefwin.Tpo -c -o tickr-tickr_prefwin.o `test -f 'tickr_prefwin.c' || echo '$(srcdir)/'`tickr_prefwin.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_prefwin.Tpo $(DEPDIR)/tickr-tickr_prefwin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_prefwin.c' object='tickr-tickr_prefwin.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_prefwin.o `test -f 'tickr_prefwin.c' || echo '$(srcdir)/'`tickr_prefwin.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_prefwin.o `test -f 'tickr_prefwin.c' || echo '$(srcdir)/'`tickr_prefwin.c tickr-tickr_prefwin.obj: tickr_prefwin.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_prefwin.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_prefwin.Tpo -c -o tickr-tickr_prefwin.obj `if test -f 'tickr_prefwin.c'; then $(CYGPATH_W) 'tickr_prefwin.c'; else $(CYGPATH_W) '$(srcdir)/tickr_prefwin.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_prefwin.Tpo $(DEPDIR)/tickr-tickr_prefwin.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_prefwin.c' object='tickr-tickr_prefwin.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_prefwin.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_prefwin.Tpo -c -o tickr-tickr_prefwin.obj `if test -f 'tickr_prefwin.c'; then $(CYGPATH_W) 'tickr_prefwin.c'; else $(CYGPATH_W) '$(srcdir)/tickr_prefwin.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_prefwin.Tpo $(DEPDIR)/tickr-tickr_prefwin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_prefwin.c' object='tickr-tickr_prefwin.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_prefwin.obj `if test -f 'tickr_prefwin.c'; then $(CYGPATH_W) 'tickr_prefwin.c'; else $(CYGPATH_W) '$(srcdir)/tickr_prefwin.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_prefwin.obj `if test -f 'tickr_prefwin.c'; then $(CYGPATH_W) 'tickr_prefwin.c'; else $(CYGPATH_W) '$(srcdir)/tickr_prefwin.c'; fi` tickr-tickr_otherwins.o: tickr_otherwins.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_otherwins.o -MD -MP -MF $(DEPDIR)/tickr-tickr_otherwins.Tpo -c -o tickr-tickr_otherwins.o `test -f 'tickr_otherwins.c' || echo '$(srcdir)/'`tickr_otherwins.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_otherwins.Tpo $(DEPDIR)/tickr-tickr_otherwins.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_otherwins.c' object='tickr-tickr_otherwins.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_otherwins.o -MD -MP -MF $(DEPDIR)/tickr-tickr_otherwins.Tpo -c -o tickr-tickr_otherwins.o `test -f 'tickr_otherwins.c' || echo '$(srcdir)/'`tickr_otherwins.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_otherwins.Tpo $(DEPDIR)/tickr-tickr_otherwins.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_otherwins.c' object='tickr-tickr_otherwins.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_otherwins.o `test -f 'tickr_otherwins.c' || echo '$(srcdir)/'`tickr_otherwins.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_otherwins.o `test -f 'tickr_otherwins.c' || echo '$(srcdir)/'`tickr_otherwins.c tickr-tickr_otherwins.obj: tickr_otherwins.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_otherwins.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_otherwins.Tpo -c -o tickr-tickr_otherwins.obj `if test -f 'tickr_otherwins.c'; then $(CYGPATH_W) 'tickr_otherwins.c'; else $(CYGPATH_W) '$(srcdir)/tickr_otherwins.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_otherwins.Tpo $(DEPDIR)/tickr-tickr_otherwins.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_otherwins.c' object='tickr-tickr_otherwins.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_otherwins.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_otherwins.Tpo -c -o tickr-tickr_otherwins.obj `if test -f 'tickr_otherwins.c'; then $(CYGPATH_W) 'tickr_otherwins.c'; else $(CYGPATH_W) '$(srcdir)/tickr_otherwins.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_otherwins.Tpo $(DEPDIR)/tickr-tickr_otherwins.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_otherwins.c' object='tickr-tickr_otherwins.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_otherwins.obj `if test -f 'tickr_otherwins.c'; then $(CYGPATH_W) 'tickr_otherwins.c'; else $(CYGPATH_W) '$(srcdir)/tickr_otherwins.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_otherwins.obj `if test -f 'tickr_otherwins.c'; then $(CYGPATH_W) 'tickr_otherwins.c'; else $(CYGPATH_W) '$(srcdir)/tickr_otherwins.c'; fi` tickr-tickr_misc.o: tickr_misc.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_misc.o -MD -MP -MF $(DEPDIR)/tickr-tickr_misc.Tpo -c -o tickr-tickr_misc.o `test -f 'tickr_misc.c' || echo '$(srcdir)/'`tickr_misc.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_misc.Tpo $(DEPDIR)/tickr-tickr_misc.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_misc.c' object='tickr-tickr_misc.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_misc.o -MD -MP -MF $(DEPDIR)/tickr-tickr_misc.Tpo -c -o tickr-tickr_misc.o `test -f 'tickr_misc.c' || echo '$(srcdir)/'`tickr_misc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_misc.Tpo $(DEPDIR)/tickr-tickr_misc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_misc.c' object='tickr-tickr_misc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_misc.o `test -f 'tickr_misc.c' || echo '$(srcdir)/'`tickr_misc.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_misc.o `test -f 'tickr_misc.c' || echo '$(srcdir)/'`tickr_misc.c tickr-tickr_misc.obj: tickr_misc.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_misc.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_misc.Tpo -c -o tickr-tickr_misc.obj `if test -f 'tickr_misc.c'; then $(CYGPATH_W) 'tickr_misc.c'; else $(CYGPATH_W) '$(srcdir)/tickr_misc.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_misc.Tpo $(DEPDIR)/tickr-tickr_misc.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_misc.c' object='tickr-tickr_misc.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_misc.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_misc.Tpo -c -o tickr-tickr_misc.obj `if test -f 'tickr_misc.c'; then $(CYGPATH_W) 'tickr_misc.c'; else $(CYGPATH_W) '$(srcdir)/tickr_misc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_misc.Tpo $(DEPDIR)/tickr-tickr_misc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_misc.c' object='tickr-tickr_misc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_misc.obj `if test -f 'tickr_misc.c'; then $(CYGPATH_W) 'tickr_misc.c'; else $(CYGPATH_W) '$(srcdir)/tickr_misc.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_misc.obj `if test -f 'tickr_misc.c'; then $(CYGPATH_W) 'tickr_misc.c'; else $(CYGPATH_W) '$(srcdir)/tickr_misc.c'; fi` tickr-tickr_helptext.o: tickr_helptext.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_helptext.o -MD -MP -MF $(DEPDIR)/tickr-tickr_helptext.Tpo -c -o tickr-tickr_helptext.o `test -f 'tickr_helptext.c' || echo '$(srcdir)/'`tickr_helptext.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_helptext.Tpo $(DEPDIR)/tickr-tickr_helptext.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_helptext.c' object='tickr-tickr_helptext.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_helptext.o -MD -MP -MF $(DEPDIR)/tickr-tickr_helptext.Tpo -c -o tickr-tickr_helptext.o `test -f 'tickr_helptext.c' || echo '$(srcdir)/'`tickr_helptext.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_helptext.Tpo $(DEPDIR)/tickr-tickr_helptext.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_helptext.c' object='tickr-tickr_helptext.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_helptext.o `test -f 'tickr_helptext.c' || echo '$(srcdir)/'`tickr_helptext.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_helptext.o `test -f 'tickr_helptext.c' || echo '$(srcdir)/'`tickr_helptext.c tickr-tickr_helptext.obj: tickr_helptext.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_helptext.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_helptext.Tpo -c -o tickr-tickr_helptext.obj `if test -f 'tickr_helptext.c'; then $(CYGPATH_W) 'tickr_helptext.c'; else $(CYGPATH_W) '$(srcdir)/tickr_helptext.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_helptext.Tpo $(DEPDIR)/tickr-tickr_helptext.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_helptext.c' object='tickr-tickr_helptext.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_helptext.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_helptext.Tpo -c -o tickr-tickr_helptext.obj `if test -f 'tickr_helptext.c'; then $(CYGPATH_W) 'tickr_helptext.c'; else $(CYGPATH_W) '$(srcdir)/tickr_helptext.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_helptext.Tpo $(DEPDIR)/tickr-tickr_helptext.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_helptext.c' object='tickr-tickr_helptext.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_helptext.obj `if test -f 'tickr_helptext.c'; then $(CYGPATH_W) 'tickr_helptext.c'; else $(CYGPATH_W) '$(srcdir)/tickr_helptext.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_helptext.obj `if test -f 'tickr_helptext.c'; then $(CYGPATH_W) 'tickr_helptext.c'; else $(CYGPATH_W) '$(srcdir)/tickr_helptext.c'; fi` tickr-tickr_opml.o: tickr_opml.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_opml.o -MD -MP -MF $(DEPDIR)/tickr-tickr_opml.Tpo -c -o tickr-tickr_opml.o `test -f 'tickr_opml.c' || echo '$(srcdir)/'`tickr_opml.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_opml.Tpo $(DEPDIR)/tickr-tickr_opml.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_opml.c' object='tickr-tickr_opml.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_opml.o -MD -MP -MF $(DEPDIR)/tickr-tickr_opml.Tpo -c -o tickr-tickr_opml.o `test -f 'tickr_opml.c' || echo '$(srcdir)/'`tickr_opml.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_opml.Tpo $(DEPDIR)/tickr-tickr_opml.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_opml.c' object='tickr-tickr_opml.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_opml.o `test -f 'tickr_opml.c' || echo '$(srcdir)/'`tickr_opml.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_opml.o `test -f 'tickr_opml.c' || echo '$(srcdir)/'`tickr_opml.c tickr-tickr_opml.obj: tickr_opml.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_opml.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_opml.Tpo -c -o tickr-tickr_opml.obj `if test -f 'tickr_opml.c'; then $(CYGPATH_W) 'tickr_opml.c'; else $(CYGPATH_W) '$(srcdir)/tickr_opml.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_opml.Tpo $(DEPDIR)/tickr-tickr_opml.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_opml.c' object='tickr-tickr_opml.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_opml.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_opml.Tpo -c -o tickr-tickr_opml.obj `if test -f 'tickr_opml.c'; then $(CYGPATH_W) 'tickr_opml.c'; else $(CYGPATH_W) '$(srcdir)/tickr_opml.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_opml.Tpo $(DEPDIR)/tickr-tickr_opml.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_opml.c' object='tickr-tickr_opml.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_opml.obj `if test -f 'tickr_opml.c'; then $(CYGPATH_W) 'tickr_opml.c'; else $(CYGPATH_W) '$(srcdir)/tickr_opml.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_opml.obj `if test -f 'tickr_opml.c'; then $(CYGPATH_W) 'tickr_opml.c'; else $(CYGPATH_W) '$(srcdir)/tickr_opml.c'; fi` tickr-tickr_http.o: tickr_http.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_http.o -MD -MP -MF $(DEPDIR)/tickr-tickr_http.Tpo -c -o tickr-tickr_http.o `test -f 'tickr_http.c' || echo '$(srcdir)/'`tickr_http.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_http.Tpo $(DEPDIR)/tickr-tickr_http.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_http.c' object='tickr-tickr_http.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_http.o -MD -MP -MF $(DEPDIR)/tickr-tickr_http.Tpo -c -o tickr-tickr_http.o `test -f 'tickr_http.c' || echo '$(srcdir)/'`tickr_http.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_http.Tpo $(DEPDIR)/tickr-tickr_http.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_http.c' object='tickr-tickr_http.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_http.o `test -f 'tickr_http.c' || echo '$(srcdir)/'`tickr_http.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_http.o `test -f 'tickr_http.c' || echo '$(srcdir)/'`tickr_http.c tickr-tickr_http.obj: tickr_http.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_http.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_http.Tpo -c -o tickr-tickr_http.obj `if test -f 'tickr_http.c'; then $(CYGPATH_W) 'tickr_http.c'; else $(CYGPATH_W) '$(srcdir)/tickr_http.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_http.Tpo $(DEPDIR)/tickr-tickr_http.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_http.c' object='tickr-tickr_http.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_http.obj `if test -f 'tickr_http.c'; then $(CYGPATH_W) 'tickr_http.c'; else $(CYGPATH_W) '$(srcdir)/tickr_http.c'; fi` - -tickr-tickr_socket.o: tickr_socket.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_socket.o -MD -MP -MF $(DEPDIR)/tickr-tickr_socket.Tpo -c -o tickr-tickr_socket.o `test -f 'tickr_socket.c' || echo '$(srcdir)/'`tickr_socket.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_socket.Tpo $(DEPDIR)/tickr-tickr_socket.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_socket.c' object='tickr-tickr_socket.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_http.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_http.Tpo -c -o tickr-tickr_http.obj `if test -f 'tickr_http.c'; then $(CYGPATH_W) 'tickr_http.c'; else $(CYGPATH_W) '$(srcdir)/tickr_http.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_http.Tpo $(DEPDIR)/tickr-tickr_http.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_http.c' object='tickr-tickr_http.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_socket.o `test -f 'tickr_socket.c' || echo '$(srcdir)/'`tickr_socket.c - -tickr-tickr_socket.obj: tickr_socket.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_socket.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_socket.Tpo -c -o tickr-tickr_socket.obj `if test -f 'tickr_socket.c'; then $(CYGPATH_W) 'tickr_socket.c'; else $(CYGPATH_W) '$(srcdir)/tickr_socket.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_socket.Tpo $(DEPDIR)/tickr-tickr_socket.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_socket.c' object='tickr-tickr_socket.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_socket.obj `if test -f 'tickr_socket.c'; then $(CYGPATH_W) 'tickr_socket.c'; else $(CYGPATH_W) '$(srcdir)/tickr_socket.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_http.obj `if test -f 'tickr_http.c'; then $(CYGPATH_W) 'tickr_http.c'; else $(CYGPATH_W) '$(srcdir)/tickr_http.c'; fi` tickr-tickr_connectwin.o: tickr_connectwin.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_connectwin.o -MD -MP -MF $(DEPDIR)/tickr-tickr_connectwin.Tpo -c -o tickr-tickr_connectwin.o `test -f 'tickr_connectwin.c' || echo '$(srcdir)/'`tickr_connectwin.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_connectwin.Tpo $(DEPDIR)/tickr-tickr_connectwin.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_connectwin.c' object='tickr-tickr_connectwin.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_connectwin.o -MD -MP -MF $(DEPDIR)/tickr-tickr_connectwin.Tpo -c -o tickr-tickr_connectwin.o `test -f 'tickr_connectwin.c' || echo '$(srcdir)/'`tickr_connectwin.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_connectwin.Tpo $(DEPDIR)/tickr-tickr_connectwin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_connectwin.c' object='tickr-tickr_connectwin.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_connectwin.o `test -f 'tickr_connectwin.c' || echo '$(srcdir)/'`tickr_connectwin.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_connectwin.o `test -f 'tickr_connectwin.c' || echo '$(srcdir)/'`tickr_connectwin.c tickr-tickr_connectwin.obj: tickr_connectwin.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_connectwin.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_connectwin.Tpo -c -o tickr-tickr_connectwin.obj `if test -f 'tickr_connectwin.c'; then $(CYGPATH_W) 'tickr_connectwin.c'; else $(CYGPATH_W) '$(srcdir)/tickr_connectwin.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_connectwin.Tpo $(DEPDIR)/tickr-tickr_connectwin.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_connectwin.c' object='tickr-tickr_connectwin.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_connectwin.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_connectwin.Tpo -c -o tickr-tickr_connectwin.obj `if test -f 'tickr_connectwin.c'; then $(CYGPATH_W) 'tickr_connectwin.c'; else $(CYGPATH_W) '$(srcdir)/tickr_connectwin.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_connectwin.Tpo $(DEPDIR)/tickr-tickr_connectwin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_connectwin.c' object='tickr-tickr_connectwin.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_connectwin.obj `if test -f 'tickr_connectwin.c'; then $(CYGPATH_W) 'tickr_connectwin.c'; else $(CYGPATH_W) '$(srcdir)/tickr_connectwin.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_connectwin.obj `if test -f 'tickr_connectwin.c'; then $(CYGPATH_W) 'tickr_connectwin.c'; else $(CYGPATH_W) '$(srcdir)/tickr_connectwin.c'; fi` tickr-tickr_quickfeedpicker.o: tickr_quickfeedpicker.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_quickfeedpicker.o -MD -MP -MF $(DEPDIR)/tickr-tickr_quickfeedpicker.Tpo -c -o tickr-tickr_quickfeedpicker.o `test -f 'tickr_quickfeedpicker.c' || echo '$(srcdir)/'`tickr_quickfeedpicker.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_quickfeedpicker.Tpo $(DEPDIR)/tickr-tickr_quickfeedpicker.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_quickfeedpicker.c' object='tickr-tickr_quickfeedpicker.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_quickfeedpicker.o -MD -MP -MF $(DEPDIR)/tickr-tickr_quickfeedpicker.Tpo -c -o tickr-tickr_quickfeedpicker.o `test -f 'tickr_quickfeedpicker.c' || echo '$(srcdir)/'`tickr_quickfeedpicker.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_quickfeedpicker.Tpo $(DEPDIR)/tickr-tickr_quickfeedpicker.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_quickfeedpicker.c' object='tickr-tickr_quickfeedpicker.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_quickfeedpicker.o `test -f 'tickr_quickfeedpicker.c' || echo '$(srcdir)/'`tickr_quickfeedpicker.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_quickfeedpicker.o `test -f 'tickr_quickfeedpicker.c' || echo '$(srcdir)/'`tickr_quickfeedpicker.c tickr-tickr_quickfeedpicker.obj: tickr_quickfeedpicker.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_quickfeedpicker.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_quickfeedpicker.Tpo -c -o tickr-tickr_quickfeedpicker.obj `if test -f 'tickr_quickfeedpicker.c'; then $(CYGPATH_W) 'tickr_quickfeedpicker.c'; else $(CYGPATH_W) '$(srcdir)/tickr_quickfeedpicker.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_quickfeedpicker.Tpo $(DEPDIR)/tickr-tickr_quickfeedpicker.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_quickfeedpicker.c' object='tickr-tickr_quickfeedpicker.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_quickfeedpicker.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_quickfeedpicker.Tpo -c -o tickr-tickr_quickfeedpicker.obj `if test -f 'tickr_quickfeedpicker.c'; then $(CYGPATH_W) 'tickr_quickfeedpicker.c'; else $(CYGPATH_W) '$(srcdir)/tickr_quickfeedpicker.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_quickfeedpicker.Tpo $(DEPDIR)/tickr-tickr_quickfeedpicker.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_quickfeedpicker.c' object='tickr-tickr_quickfeedpicker.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_quickfeedpicker.obj `if test -f 'tickr_quickfeedpicker.c'; then $(CYGPATH_W) 'tickr_quickfeedpicker.c'; else $(CYGPATH_W) '$(srcdir)/tickr_quickfeedpicker.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_quickfeedpicker.obj `if test -f 'tickr_quickfeedpicker.c'; then $(CYGPATH_W) 'tickr_quickfeedpicker.c'; else $(CYGPATH_W) '$(srcdir)/tickr_quickfeedpicker.c'; fi` tickr-tickr_quicksetup.o: tickr_quicksetup.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_quicksetup.o -MD -MP -MF $(DEPDIR)/tickr-tickr_quicksetup.Tpo -c -o tickr-tickr_quicksetup.o `test -f 'tickr_quicksetup.c' || echo '$(srcdir)/'`tickr_quicksetup.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_quicksetup.Tpo $(DEPDIR)/tickr-tickr_quicksetup.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_quicksetup.c' object='tickr-tickr_quicksetup.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_quicksetup.o -MD -MP -MF $(DEPDIR)/tickr-tickr_quicksetup.Tpo -c -o tickr-tickr_quicksetup.o `test -f 'tickr_quicksetup.c' || echo '$(srcdir)/'`tickr_quicksetup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_quicksetup.Tpo $(DEPDIR)/tickr-tickr_quicksetup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_quicksetup.c' object='tickr-tickr_quicksetup.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_quicksetup.o `test -f 'tickr_quicksetup.c' || echo '$(srcdir)/'`tickr_quicksetup.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_quicksetup.o `test -f 'tickr_quicksetup.c' || echo '$(srcdir)/'`tickr_quicksetup.c tickr-tickr_quicksetup.obj: tickr_quicksetup.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_quicksetup.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_quicksetup.Tpo -c -o tickr-tickr_quicksetup.obj `if test -f 'tickr_quicksetup.c'; then $(CYGPATH_W) 'tickr_quicksetup.c'; else $(CYGPATH_W) '$(srcdir)/tickr_quicksetup.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_quicksetup.Tpo $(DEPDIR)/tickr-tickr_quicksetup.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_quicksetup.c' object='tickr-tickr_quicksetup.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_quicksetup.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_quicksetup.Tpo -c -o tickr-tickr_quicksetup.obj `if test -f 'tickr_quicksetup.c'; then $(CYGPATH_W) 'tickr_quicksetup.c'; else $(CYGPATH_W) '$(srcdir)/tickr_quicksetup.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_quicksetup.Tpo $(DEPDIR)/tickr-tickr_quicksetup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_quicksetup.c' object='tickr-tickr_quicksetup.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_quicksetup.obj `if test -f 'tickr_quicksetup.c'; then $(CYGPATH_W) 'tickr_quicksetup.c'; else $(CYGPATH_W) '$(srcdir)/tickr_quicksetup.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_quicksetup.obj `if test -f 'tickr_quicksetup.c'; then $(CYGPATH_W) 'tickr_quicksetup.c'; else $(CYGPATH_W) '$(srcdir)/tickr_quicksetup.c'; fi` tickr-tickr_check4updates.o: tickr_check4updates.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_check4updates.o -MD -MP -MF $(DEPDIR)/tickr-tickr_check4updates.Tpo -c -o tickr-tickr_check4updates.o `test -f 'tickr_check4updates.c' || echo '$(srcdir)/'`tickr_check4updates.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_check4updates.Tpo $(DEPDIR)/tickr-tickr_check4updates.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_check4updates.c' object='tickr-tickr_check4updates.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_check4updates.o -MD -MP -MF $(DEPDIR)/tickr-tickr_check4updates.Tpo -c -o tickr-tickr_check4updates.o `test -f 'tickr_check4updates.c' || echo '$(srcdir)/'`tickr_check4updates.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_check4updates.Tpo $(DEPDIR)/tickr-tickr_check4updates.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_check4updates.c' object='tickr-tickr_check4updates.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_check4updates.o `test -f 'tickr_check4updates.c' || echo '$(srcdir)/'`tickr_check4updates.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_check4updates.o `test -f 'tickr_check4updates.c' || echo '$(srcdir)/'`tickr_check4updates.c tickr-tickr_check4updates.obj: tickr_check4updates.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_check4updates.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_check4updates.Tpo -c -o tickr-tickr_check4updates.obj `if test -f 'tickr_check4updates.c'; then $(CYGPATH_W) 'tickr_check4updates.c'; else $(CYGPATH_W) '$(srcdir)/tickr_check4updates.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tickr-tickr_check4updates.Tpo $(DEPDIR)/tickr-tickr_check4updates.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tickr_check4updates.c' object='tickr-tickr_check4updates.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_check4updates.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_check4updates.Tpo -c -o tickr-tickr_check4updates.obj `if test -f 'tickr_check4updates.c'; then $(CYGPATH_W) 'tickr_check4updates.c'; else $(CYGPATH_W) '$(srcdir)/tickr_check4updates.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_check4updates.Tpo $(DEPDIR)/tickr-tickr_check4updates.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_check4updates.c' object='tickr-tickr_check4updates.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_check4updates.obj `if test -f 'tickr_check4updates.c'; then $(CYGPATH_W) 'tickr_check4updates.c'; else $(CYGPATH_W) '$(srcdir)/tickr_check4updates.c'; fi` + +tickr-tickr_error.o: tickr_error.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_error.o -MD -MP -MF $(DEPDIR)/tickr-tickr_error.Tpo -c -o tickr-tickr_error.o `test -f 'tickr_error.c' || echo '$(srcdir)/'`tickr_error.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_error.Tpo $(DEPDIR)/tickr-tickr_error.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_error.c' object='tickr-tickr_error.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_error.o `test -f 'tickr_error.c' || echo '$(srcdir)/'`tickr_error.c + +tickr-tickr_error.obj: tickr_error.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_error.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_error.Tpo -c -o tickr-tickr_error.obj `if test -f 'tickr_error.c'; then $(CYGPATH_W) 'tickr_error.c'; else $(CYGPATH_W) '$(srcdir)/tickr_error.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_error.Tpo $(DEPDIR)/tickr-tickr_error.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_error.c' object='tickr-tickr_error.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_check4updates.obj `if test -f 'tickr_check4updates.c'; then $(CYGPATH_W) 'tickr_check4updates.c'; else $(CYGPATH_W) '$(srcdir)/tickr_check4updates.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_error.obj `if test -f 'tickr_error.c'; then $(CYGPATH_W) 'tickr_error.c'; else $(CYGPATH_W) '$(srcdir)/tickr_error.c'; fi` + +tickr-tickr_tls.o: tickr_tls.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_tls.o -MD -MP -MF $(DEPDIR)/tickr-tickr_tls.Tpo -c -o tickr-tickr_tls.o `test -f 'tickr_tls.c' || echo '$(srcdir)/'`tickr_tls.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_tls.Tpo $(DEPDIR)/tickr-tickr_tls.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_tls.c' object='tickr-tickr_tls.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_tls.o `test -f 'tickr_tls.c' || echo '$(srcdir)/'`tickr_tls.c + +tickr-tickr_tls.obj: tickr_tls.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -MT tickr-tickr_tls.obj -MD -MP -MF $(DEPDIR)/tickr-tickr_tls.Tpo -c -o tickr-tickr_tls.obj `if test -f 'tickr_tls.c'; then $(CYGPATH_W) 'tickr_tls.c'; else $(CYGPATH_W) '$(srcdir)/tickr_tls.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tickr-tickr_tls.Tpo $(DEPDIR)/tickr-tickr_tls.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tickr_tls.c' object='tickr-tickr_tls.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(tickr_CFLAGS) $(CFLAGS) -c -o tickr-tickr_tls.obj `if test -f 'tickr_tls.c'; then $(CYGPATH_W) 'tickr_tls.c'; else $(CYGPATH_W) '$(srcdir)/tickr_tls.c'; fi` install-tickrDATA: $(tickr_DATA) @$(NORMAL_INSTALL) - test -z "$(tickrdir)" || $(MKDIR_P) "$(DESTDIR)$(tickrdir)" @list='$(tickr_DATA)'; test -n "$(tickrdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(tickrdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(tickrdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -628,26 +761,15 @@ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(tickrdir)'; $(am__uninstall_files_from_dir) -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -659,15 +781,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +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 @@ -676,6 +794,21 @@ 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 @@ -818,19 +951,21 @@ .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - install-tickrDATA installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-tickrDATA +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-binPROGRAMS install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip install-tickrDATA installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-tickrDATA + +.PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru tickr-0.6.4/src/tickr/Makefile-tickr-linux tickr-0.7.0/src/tickr/Makefile-tickr-linux --- tickr-0.6.4/src/tickr/Makefile-tickr-linux 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/Makefile-tickr-linux 2020-05-31 19:46:20.000000000 +0000 @@ -1,23 +1,27 @@ # Makefile for TICKR - GTK-based Feed Reader - Linux version +# TODO: This rarely-used makefile has not been tested for ages, still working ? -src = tickr_main.c tickr_resource.c tickr_render.c tickr_params.c\ +src = tickr_main.c tickr_resource.c tickr_render.c tickr_params.c\ tickr_clock.c tickr_feedparser.c tickr_list.c tickr_feedpicker.c\ tickr_prefwin.c tickr_otherwins.c tickr_misc.c tickr_helptext.c\ - tickr_opml.c tickr_http.c tickr_socket.c tickr_connectwin.c\ - tickr_quickfeedpicker.c tickr_quicksetup.c tickr_check4updates.c + tickr_opml.c tickr_http.c tickr_connectwin.c tickr_quickfeedpicker.c\ + tickr_quicksetup.c tickr_check4updates.c tickr_error.c tickr_tls.c -obj = $(src:.c=.o) +obj = $(src:.c=.o) -CC = gcc +CC = gcc CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ - -ffast-math -pedantic `pkg-config --cflags gtk+-2.0`\ - xml2-config --cflags` -I/usr/local/include + -ffast-math -pedantic -Wno-variadic-macros\ + `pkg-config --cflags gtk+-2.0`\ + xml2-config --cflags` -I/usr/local/include\ + `pkg-config --cflags gnutls` + +LIBS = ../libetm-0.5.0/libetm.a `pkg-config --libs gtk+-2.0`\ + `xml2-config --libs`\ + `pkg-config --libs gnutls` -LIBS = ../libetm-0.4.4/libetm.a `pkg-config --libs gtk+-2.0`\ - `xml2-config --libs` - -all: tickr +all: tickr $(obj): $(src) news.h Makefile $(CC) $(CFLAGS) -c $(src) diff -Nru tickr-0.6.4/src/tickr/Makefile-tickr-win32 tickr-0.7.0/src/tickr/Makefile-tickr-win32 --- tickr-0.6.4/src/tickr/Makefile-tickr-win32 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/Makefile-tickr-win32 2020-05-31 19:46:20.000000000 +0000 @@ -1,24 +1,30 @@ # Makefile for TICKR - GTK-based Feed Reader - win32 version -src = tickr_main.c tickr_resource.c tickr_render.c tickr_params.c\ +src = tickr_main.c tickr_resource.c tickr_render.c tickr_params.c\ tickr_clock.c tickr_feedparser.c tickr_list.c tickr_feedpicker.c\ tickr_prefwin.c tickr_otherwins.c tickr_misc.c tickr_helptext.c\ - tickr_opml.c tickr_http.c tickr_socket.c tickr_connectwin.c\ - tickr_quickfeedpicker.c tickr_quicksetup.c tickr_check4updates.c + tickr_opml.c tickr_http.c tickr_connectwin.c tickr_quickfeedpicker.c\ + tickr_quicksetup.c tickr_check4updates.c tickr_error.c tickr_tls.c -obj = $(src:.c=.o) +obj = $(src:.c=.o) -CC = gcc +CC = gcc CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ - -ffast-math -pedantic `pkg-config --cflags gtk+-2.0`\ - -I/usr/local/include/libxml2 -DWIN32_V + -ffast-math -pedantic -Wno-variadic-macros\ + `pkg-config --cflags gtk+-2.0`\ + -I/home/manutm/src/libxml2-2.7.8-win32/include\ + -I/home/manutm/src/gnutls-win32/include\ + -I/home/manutm/src/fribidi-win32/include\ + -DWIN32_V + +LIBS = -mwindows -lwinmm ../libetm-0.5.0/libetm.a\ + -lws2_32 `pkg-config --libs gtk+-2.0`\ + ../../win32_install_stuff/dlls/libxml2.dll.a\ + ../../win32_install_stuff/dlls/libgnutls-win32/libgnutls.dll.a\ + ../../win32_install_stuff/dlls/libfribidi-win32/libfribidi.dll.a -LIBS = --mms-bitfields -mwindows -lwinmm -lrpcrt4 -liphlpapi -lws2_32\ - ../libetm-0.4.4/libetm.a `pkg-config --libs gtk+-2.0`\ - -static ../../win32_install_stuff/dlls/libxml2.dll.a - -all: tickr +all: tickr $(obj): $(src) tickr.h Makefile $(CC) $(CFLAGS) -c $(src) @@ -29,3 +35,5 @@ .PHONY: clean clean: rm -f $(obj) tickr.exe + +#LIBS = --mms-bitfields -mwindows -lwinmm ../libetm-0.5.0/libetm.a\ diff -Nru tickr-0.6.4/src/tickr/tickr_check4updates.c tickr-0.7.0/src/tickr/tickr_check4updates.c --- tickr-0.6.4/src/tickr/tickr_check4updates.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_check4updates.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -31,7 +31,7 @@ NULL); close_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL_CLOSE); - close_but = close_but; /* To get rid of one annoying compiler warning */ + close_but = close_but; set_tickr_icon_to_dialog(GTK_WINDOW(dialog)); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); @@ -45,9 +45,6 @@ gtk_container_set_border_width(GTK_CONTAINER(table), 15); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table); - /* Also send to stdout */ - fprintf(STD_OUT, "%s version %s is available for download from: <%s>\n", APP_NAME, - version_num, DOWNLOAD_URL); snprintf(str1, 256, "%s version %s is available for download from:", APP_NAME, version_num); snprintf(str2, 256, "%s", DOWNLOAD_URL, DOWNLOAD_URL); @@ -71,28 +68,33 @@ { sockt sock; char *response, *new_url; - int /*status,*/ recv_status; - char lsvn[32], tmp[32], *p = tmp; + int recv_status; + char last_stable_version[32], installed_version[32], *p; + int id_str_len, resp_len; int info = OK + 1; - fprintf(STD_OUT, "Checking for updates:\n"); + INFO_OUT("Checking for updates:\n") + if (connect_with_url(&sock, CHECK4UPDATES_URL) == OK) { - /* TODO: check this (when http 'connection closed by server' is returned): - if ((status = get_http_response(sock, "GET", "", CHECK4UPDATES_URL, &new_url,\ - &response, &recv_status)) == SEND_ERROR || status == RECV_ERROR) { - if (recv_status == CONNECTION_CLOSED_BY_SERVER || recv_status == SOCK_SHOULD_BE_CLOSED) { - CLOSE_SOCK(sock); - if (connect_with_url(&sock, CHECK4UPDATES_URL) == OK) - status = get_http_response(sock, "GET", "", CHECK4UPDATES_URL, &new_url,\ - &response, &recv_status); - } - } - if (status == OK) {*/ if (get_http_response(sock, "GET", "", CHECK4UPDATES_URL, &new_url, &response, &recv_status) == OK) { - remove_chunk_info(&response); - if (strncmp(response, CHECK4UPDATES_ID_STR, strlen(CHECK4UPDATES_ID_STR)) == 0) { - str_n_cpy(lsvn, response + strlen(CHECK4UPDATES_ID_STR), 31); - str_n_cpy(p, APP_VERSION_NUMBER, 31); + id_str_len = strlen(CHECK4UPDATES_ID_STR); + resp_len = strlen(response); + p = response; + last_stable_version[0] = '\0'; + + while (p < response + resp_len - id_str_len) { + if (strncmp(p, CHECK4UPDATES_ID_STR, id_str_len) == 0) { + str_n_cpy(last_stable_version, p + id_str_len, 31); + remove_trailing_whitespaces_from_str(last_stable_version); + break; + } else + p++; + } + + if (last_stable_version[0] != '\0') { + p = installed_version; + str_n_cpy(p, APP_V_NUM, 31); + while (*p != '\0') { p++; if (*p == '~') { @@ -102,14 +104,16 @@ break; } } - if (strcmp(lsvn, tmp) > 0) - new_version_available_win(lsvn); - else { - /* also send to stdout */ - fprintf(STD_OUT, APP_NAME " is up to date :)\n"); + + if (strcmp(last_stable_version, installed_version) > 0) { + new_version_available_win(last_stable_version); + INFO_OUT("%s version %s is available for download from: <%s>\n", + APP_NAME, last_stable_version, DOWNLOAD_URL) + } else { info_win("Check for Updates", "\n " APP_NAME " is up to date :) \n", INFO, FALSE); + INFO_OUT(APP_NAME " is up to date :)\n") } info = OK; } @@ -118,5 +122,5 @@ CLOSE_SOCK(sock); } if (info != OK) - warning(FALSE, 1, "Couldn't retrieve requested information from website"); + warning(BLOCK, "Couldn't retrieve requested information from website"); } diff -Nru tickr-0.6.4/src/tickr/tickr_clock.c tickr-0.7.0/src/tickr/tickr_clock.c --- tickr-0.6.4/src/tickr/tickr_clock.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_clock.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -18,8 +18,19 @@ #include "tickr.h" -#define CLOCK_DELIMITER "|" /* TODO: make as setting */ -#define TIME_STR CLOCK_DELIMITER "%c%c:%c%c:%c%c" /* At right = "|00:00:00"*/ +#define CLOCK_DELIMITER_STR " | " /* TODO: Should be a user-defined setting */ +#ifndef G_OS_WIN32 +# define NO_PADDING "-" /* Don't pad a numeric result string. The %- flag is a Glibc extension, + * not ISO C, so expect a compile-time warning. */ +#else +# define NO_PADDING "#" /* (win32) Remove leading zeros (if any) */ +#endif +#define DATE_STR "%a %b %" NO_PADDING "d " + +/* + * R -> " | 00:00:00 AM" + * L -> "00:00:00 AM | " + */ void display_time(const Params *prm) { @@ -31,193 +42,309 @@ cairo_t *cr; cairo_pattern_t *cr_p; float shadow_k; - char tmp[64]; time_t time2; - gint h_diff; + char *format; + char time_str[64]; + char tmp[64]; + int height_diff; - if (prm->clock == 'l' || prm->clock == 'r') { - if ((p_layout = pango_layout_new(gtk_widget_get_pango_context(env->win))) == NULL) - return; - pango_layout_set_attributes(p_layout, NULL); - pango_layout_set_single_paragraph_mode(p_layout, TRUE); - f_des = pango_font_description_from_string((const char *)prm->clock_font_n_s); - pango_layout_set_font_description(p_layout, f_des); - pango_font_description_free(f_des); + if (env->suspend_rq || (prm->clock != 'l' && prm->clock != 'r')) + return; + else if ((p_layout = pango_layout_new(gtk_widget_get_pango_context(env->win))) == NULL) { + INFO_ERR("%s(): Can't create pango layout\n", __func__) + return; + } + pango_layout_set_attributes(p_layout, NULL); + pango_layout_set_single_paragraph_mode(p_layout, TRUE); + f_des = pango_font_description_from_string((const char *)prm->clock_font_name_size); + pango_layout_set_font_description(p_layout, f_des); + pango_font_description_free(f_des); + + /*if (prm->clock_date == 'y') { + if (prm->clock_sec == 'y') { + if (prm->clock_12h == 'y') + format = DATE_STR "%-I:%M:%S %p"; + else + format = DATE_STR "%-H:%M:%S"; + } else { + if (prm->clock_12h == 'y') + format = DATE_STR "%-I:%M %p"; + else + format = DATE_STR "%-H:%M"; + } + } else { + if (prm->clock_sec == 'y') { + if (prm->clock_12h == 'y') + format = "%-I:%M:%S %p"; + else + format = "%-H:%M:%S"; + } else { + if (prm->clock_12h == 'y') + format = "%-I:%M %p"; + else + format = "%-H:%M"; + } + }*/ - time2 = time(NULL); - if (prm->clock == 'l') { - str_n_cpy(tmp, ctime(&time2) + 11, 8); - str_n_cat(tmp, CLOCK_DELIMITER, strlen(CLOCK_DELIMITER)); - } else if (prm->clock == 'r') { - str_n_cpy(tmp, CLOCK_DELIMITER, strlen(CLOCK_DELIMITER)); - str_n_cat(tmp, ctime(&time2) + 11, 8); - } - - pango_layout_set_text(p_layout, tmp, -1); - pango_layout_context_changed(p_layout); - pango_layout_get_pixel_size2(p_layout, &layout_width, &layout_height); - - env->drwa_clock_width = get_clock_width(prm); /* v_diff */ - /* - * For some fonts like 'impact bold' which give strange things - * v_diff = drwa_clock_width - layout_width; - */ - gtk_widget_set_size_request(env->drwa_clock, env->drwa_clock_width, env->drwa_height); - h_diff = (env->drwa_height - (gint)layout_height) / 2; - /* - * Create cairo image surface onto which layout will be rendered - */ - surf_clock = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, - env->drwa_clock_width, env->drwa_height); - cr = cairo_create(surf_clock); - /* - * Render layout - */ - /* Draw background */ - if (get_params()->set_clock_gradient_bg == 'y') { + if (prm->clock_date == 'y') { + if (prm->clock_sec == 'y') { + if (prm->clock_12h == 'y') + format = DATE_STR "%" NO_PADDING "I:%M:%S %p"; + else + format = DATE_STR "%" NO_PADDING "H:%M:%S"; + } else { + if (prm->clock_12h == 'y') + format = DATE_STR "%" NO_PADDING "I:%M %p"; + else + format = DATE_STR "%" NO_PADDING "H:%M"; + } + } else { + if (prm->clock_sec == 'y') { + if (prm->clock_12h == 'y') + format = "%" NO_PADDING "I:%M:%S %p"; + else + format = "%" NO_PADDING "H:%M:%S"; + } else { + if (prm->clock_12h == 'y') + format = "%" NO_PADDING "I:%M %p"; + else + format = "%" NO_PADDING "H:%M"; + } + } + + time2 = time(NULL); + strftime(tmp, 64, format, localtime(&time2)); + + if (prm->clock == 'l') + snprintf(time_str, 64, "%s%s", tmp, CLOCK_DELIMITER_STR); + else if (prm->clock == 'r') + snprintf(time_str, 64, "%s%s", CLOCK_DELIMITER_STR, tmp); + pango_layout_set_text(p_layout, time_str, -1); + pango_layout_context_changed(p_layout); + pango_layout_get_pixel_size(p_layout, &layout_width, &layout_height); + + env->drwa_clock_width = get_clock_width(prm); /* width_diff */ + /* + * For some fonts like 'impact bold' which give strange things + * width_diff = drwa_clock_width - layout_width. + */ + gtk_widget_set_size_request(env->drwa_clock, env->drwa_clock_width, env->drwa_height); + height_diff = (env->drwa_height - layout_height) / 2; + /* + * Create cairo image surface onto which layout will be rendered + */ + surf_clock = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, + env->drwa_clock_width, env->drwa_height); + cr = cairo_create(surf_clock); + /* + * Render layout + */ + /* Draw background */ + if (get_params()->set_clock_gradient_bg == 'y') { + cr_p = cairo_pattern_create_linear(0.0, 0.0, 0.0, (float)env->drwa_height); + if (cairo_pattern_status(cr_p) == CAIRO_STATUS_SUCCESS) { + if (cairo_pattern_get_type(cr_p) == CAIRO_PATTERN_TYPE_LINEAR) { + cairo_pattern_add_color_stop_rgba(cr_p, 0.0, + (float)prm->clock_bg_color.red / G_MAXUINT16, + (float)prm->clock_bg_color.green / G_MAXUINT16, + (float)prm->clock_bg_color.blue / G_MAXUINT16, + (float)prm->clock_bg_color_alpha / G_MAXUINT16); + cairo_pattern_add_color_stop_rgba(cr_p, 1.0, + (float)prm->clock_bg_color2.red / (G_MAXUINT16), + (float)prm->clock_bg_color2.green / (G_MAXUINT16), + (float)prm->clock_bg_color2.blue / (G_MAXUINT16), + (float)prm->clock_bg_color_alpha / G_MAXUINT16); + cairo_set_source(cr, cr_p); + cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); + cairo_paint(cr); + } else + INFO_ERR("%s(): cairo pattern type != linear (gradient)\n", + __func__) + } else + INFO_ERR("%s(): cairo_pattern_create_linear() error\n", + __func__) + cairo_pattern_destroy(cr_p); + } else { + cairo_set_source_rgba(cr, + (float)prm->clock_bg_color.red / G_MAXUINT16, + (float)prm->clock_bg_color.green / G_MAXUINT16, + (float)prm->clock_bg_color.blue / G_MAXUINT16, + (float)prm->clock_bg_color_alpha / G_MAXUINT16); + cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); + cairo_paint(cr); + } + /* Draw foreground */ + if (prm->shadow == 'y') { + /* Draw shadow */ + if (prm->shadow_fx < 0) + shadow_k = 1.0; + else if (prm->shadow_fx > 10) + shadow_k = 0.0; + else + shadow_k = 1.0 - (float)prm->shadow_fx / 10.0; + if (get_params()->set_gradient_bg == 'y') { cr_p = cairo_pattern_create_linear(0.0, 0.0, 0.0, (float)env->drwa_height); if (cairo_pattern_status(cr_p) == CAIRO_STATUS_SUCCESS) { if (cairo_pattern_get_type(cr_p) == CAIRO_PATTERN_TYPE_LINEAR) { cairo_pattern_add_color_stop_rgba(cr_p, 0.0, - (float)prm->clock_bg_color.red / G_MAXUINT16, - (float)prm->clock_bg_color.green / G_MAXUINT16, - (float)prm->clock_bg_color.blue / G_MAXUINT16, + (float)prm->clock_bg_color.red * shadow_k / G_MAXUINT16, + (float)prm->clock_bg_color.green * shadow_k / G_MAXUINT16, + (float)prm->clock_bg_color.blue * shadow_k / G_MAXUINT16, (float)prm->clock_bg_color_alpha / G_MAXUINT16); cairo_pattern_add_color_stop_rgba(cr_p, 1.0, - (float)prm->clock_bg_color2.red / (G_MAXUINT16), - (float)prm->clock_bg_color2.green / (G_MAXUINT16), - (float)prm->clock_bg_color2.blue / (G_MAXUINT16), + (float)prm->clock_bg_color2.red * shadow_k / (G_MAXUINT16), + (float)prm->clock_bg_color2.green * shadow_k / (G_MAXUINT16), + (float)prm->clock_bg_color2.blue * shadow_k / (G_MAXUINT16), (float)prm->clock_bg_color_alpha / G_MAXUINT16); cairo_set_source(cr, cr_p); - cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); - cairo_paint(cr); + pango_cairo_update_layout(cr, p_layout); + cairo_move_to(cr, prm->shadow_offset_x, prm->shadow_offset_y); + cairo_set_operator(cr, CAIRO_OPERATOR_OVER); + pango_cairo_show_layout(cr, p_layout); } else - fprintf(STD_ERR, "display_time(): " - "cairo pattern type != linear (gradient)\n"); + INFO_ERR("%s(): cairo pattern type != linear (gradient)\n", + __func__) } else - fprintf(STD_ERR, "display_time(): " - "cairo_pattern_create_linear() error\n"); + INFO_ERR("%s(): cairo_pattern_create_linear() error\n", + __func__) cairo_pattern_destroy(cr_p); } else { cairo_set_source_rgba(cr, - (float)prm->clock_bg_color.red / G_MAXUINT16, - (float)prm->clock_bg_color.green / G_MAXUINT16, - (float)prm->clock_bg_color.blue / G_MAXUINT16, + (float)prm->clock_bg_color.red * shadow_k / G_MAXUINT16, + (float)prm->clock_bg_color.green * shadow_k / G_MAXUINT16, + (float)prm->clock_bg_color.blue * shadow_k / G_MAXUINT16, (float)prm->clock_bg_color_alpha / G_MAXUINT16); - cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); - cairo_paint(cr); - } - /* Draw foreground */ - if (prm->shadow == 'y') { - /* Draw shadow */ - if (prm->shadow_fx < 0) - shadow_k = 1.0; - else if (prm->shadow_fx > 10) - shadow_k = 0.0; - else - shadow_k = 1.0 - (float)prm->shadow_fx / 10.0; - if (get_params()->set_gradient_bg == 'y') { - cr_p = cairo_pattern_create_linear(0.0, 0.0, 0.0, (float)env->drwa_height); - if (cairo_pattern_status(cr_p) == CAIRO_STATUS_SUCCESS) { - if (cairo_pattern_get_type(cr_p) == CAIRO_PATTERN_TYPE_LINEAR) { - cairo_pattern_add_color_stop_rgba(cr_p, 0.0, - (float)prm->clock_bg_color.red * shadow_k / G_MAXUINT16, - (float)prm->clock_bg_color.green * shadow_k / G_MAXUINT16, - (float)prm->clock_bg_color.blue * shadow_k / G_MAXUINT16, - (float)prm->clock_bg_color_alpha / G_MAXUINT16); - cairo_pattern_add_color_stop_rgba(cr_p, 1.0, - (float)prm->clock_bg_color2.red * shadow_k / (G_MAXUINT16), - (float)prm->clock_bg_color2.green * shadow_k / (G_MAXUINT16), - (float)prm->clock_bg_color2.blue * shadow_k / (G_MAXUINT16), - (float)prm->clock_bg_color_alpha / G_MAXUINT16); - cairo_set_source(cr, cr_p); - pango_cairo_update_layout(cr, p_layout); - cairo_move_to(cr, prm->shadow_offset_x, prm->shadow_offset_y); - cairo_set_operator(cr, CAIRO_OPERATOR_OVER); - pango_cairo_show_layout(cr, p_layout); - } else - fprintf(STD_ERR, "display_time(): " - "cairo pattern type != linear (gradient)\n"); - } else - fprintf(STD_ERR, "display_time(): " - "cairo_pattern_create_linear() error\n"); - cairo_pattern_destroy(cr_p); - } else { - cairo_set_source_rgba(cr, - (float)prm->clock_bg_color.red * shadow_k / G_MAXUINT16, - (float)prm->clock_bg_color.green * shadow_k / G_MAXUINT16, - (float)prm->clock_bg_color.blue * shadow_k / G_MAXUINT16, - (float)prm->clock_bg_color_alpha / G_MAXUINT16); - pango_cairo_update_layout(cr, p_layout); - cairo_move_to(cr, prm->shadow_offset_x, prm->shadow_offset_y); - cairo_set_operator(cr, CAIRO_OPERATOR_OVER); - pango_cairo_show_layout(cr, p_layout); - } + pango_cairo_update_layout(cr, p_layout); + cairo_move_to(cr, prm->shadow_offset_x, prm->shadow_offset_y); + cairo_set_operator(cr, CAIRO_OPERATOR_OVER); + pango_cairo_show_layout(cr, p_layout); } - /* Draw text */ - cairo_set_source_rgba(cr, - (float)prm->clock_fg_color.red / G_MAXUINT16, - (float)prm->clock_fg_color.green / G_MAXUINT16, - (float)prm->clock_fg_color.blue / G_MAXUINT16, - (float)prm->clock_fg_color_alpha / G_MAXUINT16); - pango_cairo_update_layout(cr, p_layout); - cairo_move_to(cr, 0, 0); - cairo_set_operator(cr, CAIRO_OPERATOR_OVER); - pango_cairo_show_layout(cr, p_layout); - /* Drawing done */ - if (p_layout != NULL) - g_object_unref(p_layout); - cairo_destroy(cr); - /* Draw onto clock area - * (we now use cairo instead of deprecated gdk_draw_sth) - */ - cr = gdk_cairo_create(GDK_DRAWABLE((env->drwa_clock)->window)); - cairo_set_source_surface(cr, surf_clock, 0, h_diff); - cairo_rectangle(cr, 0, 0, env->drwa_clock_width, env->drwa_height); - cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); - cairo_fill(cr); - cairo_destroy(cr); - cairo_surface_destroy(surf_clock); } + /* Draw text */ + cairo_set_source_rgba(cr, + (float)prm->clock_fg_color.red / G_MAXUINT16, + (float)prm->clock_fg_color.green / G_MAXUINT16, + (float)prm->clock_fg_color.blue / G_MAXUINT16, + (float)prm->clock_fg_color_alpha / G_MAXUINT16); + pango_cairo_update_layout(cr, p_layout); + cairo_move_to(cr, 0, 0); + cairo_set_operator(cr, CAIRO_OPERATOR_OVER); + pango_cairo_show_layout(cr, p_layout); + /* Drawing done */ + if (p_layout != NULL) + g_object_unref(p_layout); + cairo_destroy(cr); + /* + * Draw onto clock area + * (We now use cairo instead of deprecated gdk_draw_sth. + * Should we use gdk_window_begin/end_paint_rect() stuff here too ? + * Not really as this is only called every 500 ms.) + */ + cr = gdk_cairo_create(GDK_DRAWABLE((env->drwa_clock)->window)); + cairo_set_source_surface(cr, surf_clock, 0, height_diff); + cairo_rectangle(cr, 0, 0, env->drwa_clock_width, env->drwa_height); + cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); + cairo_fill(cr); + cairo_destroy(cr); + cairo_surface_destroy(surf_clock); } /* Actually clock max width */ -gint get_clock_width(const Params *prm) +int get_clock_width(const Params *prm) { - static char clock_font_n_s_bak[FONT_MAXLEN + 1] = ""; - static gint width = 0; + static char clock_font_name_size_bak[FONT_MAXLEN + 1] = ""; + static char clock_sec_bak, clock_12h_bak, clock_date_bak; + static int date_width_bak = 0; + int date_width; + static int width = 0; PangoLayout *p_layout; PangoFontDescription *f_des; - int layout_width, layout_height, layout_max_width = 0; + int layout_width, layout_height, layout_max_width; + char *time_str; + time_t time2; + struct tm *local_time; + zboolean hour_is_double_digit; char tmp[64]; int i; if (prm->clock == 'l' || prm->clock == 'r') { - if (strcmp(prm->clock_font_n_s, clock_font_n_s_bak) != 0 || width == 0) { - str_n_cpy(clock_font_n_s_bak, prm->clock_font_n_s, FONT_MAXLEN); + p_layout = pango_layout_new(gtk_widget_get_pango_context(get_ticker_env()->win)); + pango_layout_set_attributes(p_layout, NULL); + pango_layout_set_single_paragraph_mode(p_layout, TRUE); + f_des = pango_font_description_from_string((const char *)prm->clock_font_name_size); + pango_layout_set_font_description(p_layout, f_des); + pango_font_description_free(f_des); - p_layout = pango_layout_new(gtk_widget_get_pango_context(get_ticker_env()->win)); - pango_layout_set_attributes(p_layout, NULL); - pango_layout_set_single_paragraph_mode(p_layout, TRUE); - f_des = pango_font_description_from_string((const char *)prm->clock_font_n_s); - pango_layout_set_font_description(p_layout, f_des); - pango_font_description_free(f_des); + time2 = time(NULL); + local_time = localtime(&time2); + + if (prm->clock_date == 'y') { + strftime(tmp, 64, DATE_STR, local_time); + pango_layout_set_text(p_layout, tmp, -1); + pango_layout_context_changed(p_layout); + pango_layout_get_pixel_size(p_layout, &layout_width, &layout_height); + date_width = layout_width; + } else + date_width = 0; + + if ( prm->clock_sec != clock_sec_bak || + prm->clock_12h != clock_12h_bak || + prm->clock_date != clock_date_bak || + strcmp(prm->clock_font_name_size, clock_font_name_size_bak) != 0 || + date_width != date_width_bak || + width == 0) { + clock_sec_bak = prm->clock_sec; + clock_12h_bak = prm->clock_12h; + clock_date_bak = prm->clock_date; + str_n_cpy(clock_font_name_size_bak, prm->clock_font_name_size, FONT_MAXLEN); + date_width_bak = date_width; + + if (prm->clock_sec == 'y') { + if (prm->clock_12h == 'y') + time_str = "%c%c:%c%c:%c%c AM" CLOCK_DELIMITER_STR; /* Ordering doesn't change witdh */ + else + time_str = "%c%c:%c%c:%c%c" CLOCK_DELIMITER_STR; + } else { + if (prm->clock_12h == 'y') + time_str = "%c%c:%c%c AM" CLOCK_DELIMITER_STR; + else + time_str = "%c%c:%c%c" CLOCK_DELIMITER_STR; + } + /* + * Hack to adjust clock width because hours are not padded: + * we test current hour. + */ + strftime(tmp, 64, prm->clock_12h == 'y' ? "%I" : "%H", local_time); + if (atoi(tmp) > 9) + hour_is_double_digit = TRUE; + else + hour_is_double_digit = FALSE; + + layout_max_width = 0; for (i = '0'; i <= '9'; i++) { - snprintf(tmp, /*time_str_len*/strlen(TIME_STR) + 1, TIME_STR, i, i, i, i, i, i); - pango_layout_set_text(p_layout, tmp, -1); + if (prm->clock_sec == 'y') + snprintf(tmp, 64, time_str, i, i, i, i, i, i); + else + snprintf(tmp, 64, time_str, i, i, i, i); + + time_str = tmp; + /* Hack to adjust width */ + if (!hour_is_double_digit) + time_str++; + + pango_layout_set_text(p_layout, time_str, -1); pango_layout_context_changed(p_layout); - pango_layout_get_pixel_size2(p_layout, &layout_width, &layout_height); + pango_layout_get_pixel_size(p_layout, &layout_width, &layout_height); if (layout_width > layout_max_width) layout_max_width = layout_width; } + width = date_width + layout_max_width; if (p_layout != NULL) g_object_unref(p_layout); - width = (gint)layout_max_width; } } else - /* TODO: check that - something BUGGY here ???? */ - width = 0; /* Return 0 although if clock = none, actual widget width = 1 */ + width = 0; /* Return 0 although if clock = none, actual widget width = 1. */ return width; } diff -Nru tickr-0.6.4/src/tickr/tickr_connectwin.c tickr-0.7.0/src/tickr/tickr_connectwin.c --- tickr-0.6.4/src/tickr/tickr_connectwin.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_connectwin.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -23,11 +23,13 @@ static GtkWidget *dialog, *entry_user, *entry_psw, *check_but1; static GtkWidget *entry_host, *entry_port, *entry_proxy_user, *entry_proxy_psw; -static GtkWidget *check_but2, *check_but3, *label[9]; +static GtkWidget *spinbut_connect_timeout, *spinbut_send_recv_timeout; +static GtkObject *adj_connect_timeout, *adj_send_recv_timeout; +static GtkWidget *check_but2, *check_but3, *label[16]; void init_authentication() { - static Authentication auth0; + static Authentication auth0; auth = &auth0; auth->use_authentication = FALSE; @@ -38,7 +40,7 @@ void init_proxy() { - static Proxy proxy0; + static Proxy proxy0; proxy = &proxy0; proxy->use_proxy = FALSE; @@ -50,7 +52,7 @@ proxy->auth_str[0] = '\0'; } -static gint enter_key_pressed_in_entry(GtkWidget *widget) +static int enter_key_pressed_in_entry(GtkWidget *widget) { widget = widget; gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); @@ -82,14 +84,14 @@ gtk_widget_set_sensitive(entry_proxy_psw, state); } -static gint check_but1_toggled(GtkWidget *check_button) +static int check_but1_toggled(GtkWidget *check_button) { auth->use_authentication = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_button)); set_entries_sensitive1(auth->use_authentication); return TRUE; } -static gint check_but2_toggled(GtkWidget *check_button) +static int check_but2_toggled(GtkWidget *check_button) { proxy->use_proxy = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_button)); set_entries_sensitive2(proxy->use_proxy); @@ -97,7 +99,7 @@ return TRUE; } -static gint check_but3_toggled(GtkWidget *check_button) +static int check_but3_toggled(GtkWidget *check_button) { proxy->use_proxy_authentication = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_button)); set_entries_sensitive3(proxy->use_proxy && proxy->use_proxy_authentication); @@ -106,7 +108,7 @@ void compute_auth_and_proxy_str() { - char *tmp1, *tmp2; + char *tmp1, *tmp2; if (auth->user[0] != '\0' && auth->psw[0] != '\0') { tmp1 = l_str_new(auth->user); @@ -143,15 +145,17 @@ } /* Must be initialized with init_authentication() and init_proxy() */ -gint connection_settings(connection_settings_page page) +int connection_settings(connection_settings_page page) { - GtkWidget *notebook, *table1, *table2, *hbox; + TickerEnv *env = get_ticker_env(); + Params *prm = get_params(); + GtkWidget *notebook, *table1, *table2, *table3, *hbox; int response = GTK_RESPONSE_CANCEL_CLOSE; - gtk_window_set_keep_above(GTK_WINDOW(get_ticker_env()->win), FALSE); + gtk_window_set_keep_above(GTK_WINDOW(env->win), FALSE); dialog = gtk_dialog_new_with_buttons( - "Connection Settings", GTK_WINDOW(get_ticker_env()->win), + "Connection Settings", GTK_WINDOW(env->win), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL_CLOSE, GTK_STOCK_OK, GTK_RESPONSE_OK, @@ -163,19 +167,19 @@ /* * Fill structs from params */ - auth->use_authentication = (get_params()->use_authentication == 'y') ? TRUE : FALSE; - str_n_cpy(proxy->user, get_params()->user, USER_MAXLEN); - proxy->use_proxy = (get_params()->use_proxy == 'y') ? TRUE : FALSE; - str_n_cpy(proxy->host, get_params()->proxy_host, PROXY_HOST_MAXLEN); - str_n_cpy(proxy->port, get_params()->proxy_port, PROXY_PORT_MAXLEN); - proxy->use_proxy_authentication = (get_params()->use_proxy_authentication == 'y') ? TRUE : FALSE; - str_n_cpy(proxy->user, get_params()->proxy_user, PROXY_USER_MAXLEN); + auth->use_authentication = (prm->use_authentication == 'y') ? TRUE : FALSE; + str_n_cpy(proxy->user, prm->user, USER_MAXLEN); + proxy->use_proxy = (prm->use_proxy == 'y') ? TRUE : FALSE; + str_n_cpy(proxy->host, prm->proxy_host, PROXY_HOST_MAXLEN); + str_n_cpy(proxy->port, prm->proxy_port, PROXY_PORT_MAXLEN); + proxy->use_proxy_authentication = (prm->use_proxy_authentication == 'y') ? TRUE : FALSE; + str_n_cpy(proxy->user, prm->proxy_user, PROXY_USER_MAXLEN); notebook = gtk_notebook_new(); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), notebook); label[0]= gtk_label_new("Configure HTTP Basic Authentication"); - table1 = gtk_table_new(6, 2, TRUE); + table1 = gtk_table_new(4/*6*/, 2, TRUE); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table1, label[0]); gtk_table_set_row_spacings(GTK_TABLE(table1), 5); @@ -205,6 +209,7 @@ gtk_entry_set_text(GTK_ENTRY(entry_psw), auth->psw); gtk_table_attach_defaults(GTK_TABLE(table1), entry_psw, 1, 2, 2, 3); gtk_entry_set_visibility(GTK_ENTRY(entry_psw), FALSE); + label[3] = gtk_label_new("Configure HTTP Proxy Server"); table2 = gtk_table_new(6, 2, TRUE); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table2, label[3]); @@ -264,6 +269,38 @@ label[8] = gtk_label_new(" "); gtk_box_pack_start(GTK_BOX(hbox), label[8], FALSE, FALSE, 0); + label[9] = gtk_label_new("Override Default Timeouts"); + table3 = gtk_table_new(4/*6*/, 2, TRUE); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table3, label[9]); + + gtk_table_set_row_spacings(GTK_TABLE(table3), 5); + gtk_table_set_col_spacings(GTK_TABLE(table3), 5); + gtk_container_set_border_width(GTK_CONTAINER(table3), 10); + + label[10] = gtk_label_new("Connect Timeout (default = 5 s):"); + gtk_label_set_use_markup(GTK_LABEL(label[10]), TRUE); + gtk_misc_set_alignment(GTK_MISC(label[10]), 0, 0.5); + gtk_table_attach_defaults(GTK_TABLE(table3), label[10], 0, 1, 0, 1); + adj_connect_timeout = gtk_adjustment_new(prm->connect_timeout, 1, 60, 1, 5, 0); + spinbut_connect_timeout = gtk_spin_button_new(GTK_ADJUSTMENT(adj_connect_timeout), 0.0, 0); + gtk_table_attach_defaults(GTK_TABLE(table3), spinbut_connect_timeout, 1, 2, 0, 1); + + label[11] = gtk_label_new("Send/Recv Timeout (default = 1 s):"); + gtk_label_set_use_markup(GTK_LABEL(label[11]), TRUE); + gtk_misc_set_alignment(GTK_MISC(label[11]), 0, 0.5); + gtk_table_attach_defaults(GTK_TABLE(table3), label[11], 0, 1, 1, 2); + adj_send_recv_timeout = gtk_adjustment_new(prm->send_recv_timeout, 1, 60, 1, 5, 0); + spinbut_send_recv_timeout = gtk_spin_button_new(GTK_ADJUSTMENT(adj_send_recv_timeout), 0.0, 0); + gtk_table_attach_defaults(GTK_TABLE(table3), spinbut_send_recv_timeout, 1, 2, 1, 2); + + label[12] = gtk_label_new("Warning: " + /*label[12] = gtk_label_new("Warning: "*/ + "Change these settings *only* if you know what you're doing,\n" + "as high values might make the application almost unresponsive."); + gtk_label_set_use_markup(GTK_LABEL(label[12]), TRUE); + gtk_misc_set_alignment(GTK_MISC(label[12]), 0, 0.5); + gtk_table_attach_defaults(GTK_TABLE(table3), label[12], 0, 2, 2, 3); + set_entries_sensitive1(auth->use_authentication); set_entries_sensitive2(proxy->use_proxy); set_entries_sensitive3(proxy->use_proxy && proxy->use_proxy_authentication); @@ -277,17 +314,24 @@ g_signal_connect(G_OBJECT(entry_port), "activate", G_CALLBACK(enter_key_pressed_in_entry), NULL); g_signal_connect(G_OBJECT(entry_proxy_user), "activate", G_CALLBACK(enter_key_pressed_in_entry), NULL); g_signal_connect(G_OBJECT(entry_proxy_psw), "activate", G_CALLBACK(enter_key_pressed_in_entry), NULL); + g_signal_connect(G_OBJECT(spinbut_connect_timeout), "activate", G_CALLBACK(enter_key_pressed_in_entry), NULL); + g_signal_connect(G_OBJECT(spinbut_send_recv_timeout), "activate", G_CALLBACK(enter_key_pressed_in_entry), NULL); + + gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), (int)page); gtk_widget_show_all(dialog); - gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), (gint)page); - get_ticker_env()->suspend_rq = TRUE; + gtk_window_set_focus(GTK_WINDOW(dialog), NULL); + + env->suspend_rq = TRUE; + if ((response = gtk_dialog_run(GTK_DIALOG(dialog))) == GTK_RESPONSE_OK) { /* * Configure authentication */ auth->use_authentication = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_but1)); str_n_cpy(auth->user, (char *)gtk_entry_get_text(GTK_ENTRY(entry_user)), USER_MAXLEN); - remove_char_from_str(auth->user, ' '); + /* TODO: How to allow username string to contain inside spaces ? */ + remove_surrounding_whitespaces_from_str(auth->user); str_n_cpy(auth->psw, (char *)gtk_entry_get_text(GTK_ENTRY(entry_psw)), PSW_MAXLEN); remove_char_from_str(auth->psw, ' '); /* @@ -303,7 +347,8 @@ */ proxy->use_proxy_authentication = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_but3)); str_n_cpy(proxy->user, (char *)gtk_entry_get_text(GTK_ENTRY(entry_proxy_user)), PROXY_USER_MAXLEN); - remove_char_from_str(proxy->user, ' '); + /* TODO: How to allow username string to contain inside spaces ? */ + remove_surrounding_whitespaces_from_str(proxy->user); str_n_cpy(proxy->psw, (char *)gtk_entry_get_text(GTK_ENTRY(entry_proxy_psw)), PROXY_PSW_MAXLEN); remove_char_from_str(proxy->psw, ' '); /* @@ -311,31 +356,44 @@ */ compute_auth_and_proxy_str(); /* - * Save structs as params, then to file + * Save struct members as params + */ + prm->use_authentication = auth->use_authentication ? 'y' : 'n'; + str_n_cpy(prm->user, auth->user, USER_MAXLEN); + prm->use_proxy = proxy->use_proxy ? 'y' : 'n'; + str_n_cpy(prm->proxy_host, proxy->host, PROXY_HOST_MAXLEN); + str_n_cpy(prm->proxy_port, proxy->port, PROXY_PORT_MAXLEN); + prm->use_proxy_authentication = proxy->use_proxy_authentication ? 'y' : 'n'; + str_n_cpy(prm->proxy_user, proxy->user, PROXY_USER_MAXLEN); + /* + * Get socket timeouts + */ + prm->connect_timeout = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_connect_timeout)); + prm->send_recv_timeout = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_send_recv_timeout)); + /* + * Set timeouts + */ + set_connect_timeout_sec(prm->connect_timeout); + set_send_recv_timeout_sec(prm->send_recv_timeout); + /* + * Then save everything to file */ - get_params()->use_authentication = auth->use_authentication ? 'y' : 'n'; - str_n_cpy(get_params()->user, auth->user, USER_MAXLEN); - get_params()->use_proxy = proxy->use_proxy ? 'y' : 'n'; - str_n_cpy(get_params()->proxy_host, proxy->host, PROXY_HOST_MAXLEN); - str_n_cpy(get_params()->proxy_port, proxy->port, PROXY_PORT_MAXLEN); - get_params()->use_proxy_authentication = proxy->use_proxy_authentication ? 'y' : 'n'; - str_n_cpy(get_params()->proxy_user, proxy->user, PROXY_USER_MAXLEN); - save_to_config_file(get_params()); + save_to_config_file(prm); } gtk_widget_destroy(dialog); check_main_win_always_on_top(); - get_ticker_env()->suspend_rq = FALSE; + env->suspend_rq = FALSE; return response; } -gboolean get_use_authentication() +void set_use_authentication(zboolean value) { - return auth->use_authentication; + auth->use_authentication = value; } -void set_use_authentication(gboolean value) +zboolean get_use_authentication() { - auth->use_authentication = value; + return auth->use_authentication; } char *get_http_auth_user() @@ -353,14 +411,15 @@ return (char *)auth->auth_str; } -gboolean get_use_proxy() +void set_use_proxy(zboolean value) { - return proxy->use_proxy; + libetm_socket_set_use_proxy(value); + proxy->use_proxy = libetm_socket_get_use_proxy(); } -void set_use_proxy(gboolean value) +zboolean get_use_proxy() { - proxy->use_proxy = value; + return proxy->use_proxy; } char *get_proxy_host() @@ -378,14 +437,14 @@ return (char *)proxy->proxy_str; } -gboolean get_use_proxy_auth() +void set_use_proxy_auth(zboolean value) { - return proxy->use_proxy_authentication; + proxy->use_proxy_authentication = value; } -void set_use_proxy_auth(gboolean value) +zboolean get_use_proxy_auth() { - proxy->use_proxy_authentication = value; + return proxy->use_proxy_authentication; } char *get_proxy_auth_user() diff -Nru tickr-0.6.4/src/tickr/tickr_error.c tickr-0.7.0/src/tickr/tickr_error.c --- tickr-0.6.4/src/tickr/tickr_error.c 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_error.c 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,112 @@ +/* + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 + * + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "tickr.h" +#include "tickr_error.h" + +const char *tickr_error_str(tickr_error_code e_c) +{ + return error_str_from_error_code(e_a, sizeof(e_a) / sizeof(e_a[0]), e_c); +} + +const char *global_error_str(int error_code) +{ + if (error_code >= LIBETM_OK && error_code <= LIBETM_LASTERRORCODE) + return libetm_error_str((libetm_error_code)error_code); + else + return tickr_error_str((tickr_error_code)error_code); +} + +/* + * This func's prototype is in libetm/error.h. + * This func is not defined in libetm but in application and it handles + * CRITICAL ERRORS from both libetm and application. + */ + +#define ERROR_WARNING_STR_MAXLEN (8 * 1024 - 1) +#define OUCH_STR "\nOuch !! Something went wrong ...\n\n" + +int big_error(int big_error_code, const char *format, ...) +{ + char error_str[ERROR_WARNING_STR_MAXLEN + 1] = ""; + va_list a_list; + + if (get_ticker_env() != NULL) + get_ticker_env()->suspend_rq = TRUE; + + str_n_cpy(error_str, OUCH_STR, 100); + str_n_cat(error_str, "CRITICAL ERROR in ", 100); + if (big_error_code > LIBETM_LASTERRORCODE) + str_n_cat(error_str, APP_NAME ": ", 100); + va_start(a_list, format); + vsnprintf(error_str + strlen(error_str), + ERROR_WARNING_STR_MAXLEN + 1 - strlen(error_str), format, a_list); + va_end(a_list); + snprintf(error_str + strlen(error_str), + ERROR_WARNING_STR_MAXLEN + 1 - strlen(error_str), " - Will quit now"); + + if (STD_ERR != NULL) + INFO_ERR("%s\n", (char *)error_str + strlen(OUCH_STR)) + /* We want this win to always popup */ + if (get_params() != NULL && get_ticker_env() != NULL) { + get_params()->disable_popups = 'n'; + info_win(APP_NAME " - Critical error", error_str, INFO_ERROR, FALSE); + } else + minimalistic_info_win(APP_NAME " - Critical error", error_str); + free_all(); + exit(big_error_code); +} + +/* + * This func's prototype is in libetm/error.h. + * This func is not defined in libetm but in application and it handles + * WARNINGS from both libetm and application. + * + * Will popup and wait for INFO_WIN_WAIT_TIMEOUT ms if no_block == TRUE, then close + * otherwise, will block until an appropriate keyboard/mouse action happens. + * + * You can use BLOCK/NO_BLOCK helpers. + */ +void warning(int no_block, const char *format, ...) +{ + char warning_str[ERROR_WARNING_STR_MAXLEN + 1] = ""; + va_list a_list; + + va_start(a_list, format); + vsnprintf(warning_str + strlen(warning_str), + ERROR_WARNING_STR_MAXLEN + 1 - strlen(warning_str), format, a_list); + va_end(a_list); + + INFO_ERR("%s\n", warning_str) + if (no_block) + info_win_no_block(warning_str, INFO_WIN_WAIT_TIMEOUT); + else + info_win("", warning_str, INFO_WARNING, FALSE); +} + +void dump_error_codes() +{ + int i, j; + + dump_libetm_error_codes(); + fprintf(STD_OUT, "\n%s-%s error codes and strings:\n", APP_NAME, APP_V_NUM); + for (i = 0; i < (int)(sizeof(e_a) / sizeof(e_a[0])); i++) { + j = i + LIBETM_LASTERRORCODE + 1; + fprintf(STD_OUT, "%d %s\n", j , tickr_error_str(j)); + } +} diff -Nru tickr-0.6.4/src/tickr/tickr_error.h tickr-0.7.0/src/tickr/tickr_error.h --- tickr-0.6.4/src/tickr/tickr_error.h 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_error.h 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,212 @@ +/* + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 + * + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef INC_TICKR_ERROR_H +#define INC_TICKR_ERROR_H + +/* Helpers for warning() */ +#define NO_BLOCK TRUE /* Show for INFO_WIN_WAIT_TIMEOUT ms */ +#define BLOCK !NO_BLOCK /* Wait for user action */ + +/* Error codes */ + +/* Exactly matching this enum and ErrSt array below doesn't matter anymore. */ +typedef enum { + OK = LIBETM_LASTERRORCODE + 1, + + NO_RESOURCE_SPECIFIED, + RESOURCE_NOT_FOUND, + RESOURCE_INVALID, + RESOURCE_ENCODING_ERROR, + + OPTION_TOO_MANY, + OPTION_INVALID, + OPTION_UNKNOWN, + OPTION_VALUE_INVALID, + + FEED_FORMAT_ERROR, + FEED_UNPARSABLE, + FEED_EMPTY, + FEED_NO_ITEM_OR_ENTRY_ELEMENT, + + SELECTION_ERROR, + SELECTION_EMPTY, + + RENDER_ERROR, + RENDER_NO_RESOURCE, + RENDER_CAIRO_IMAGE_SURFACE_TOO_WIDE, + RENDER_CREATE_CAIRO_IMAGE_SURFACE_ERROR, + RENDER_FILL_IN_STR_ARRAY_ERROR, + RENDER_PROCESS_STR_ARRAY_ERROR, + RENDER_PANGO_LAYOUT_WIDTH_OVERFLOW, + + READ_FROM_STREAM_ERROR, + WRITE_TO_STREAM_ERROR, + + NOT_UTF8_ENCODED, + + SHIFT2LEFT_NULL_CAIRO_IMAGE_SURFACE, + + FLIST_ERROR, + LOAD_URL_LIST_ERROR, + LOAD_URL_LIST_EMPTY_LIST, + LOAD_URL_LIST_NO_LIST, + SAVE_URL_LIST_ERROR, + + CREATE_FILE_ERROR, + OPEN_FILE_ERROR, + + XML_UNPARSABLE, + XML_EMPTY, + + OPML_ERROR, + + CONNECT_TOO_MANY_ERRORS, + + TLS_ERROR, + TLS_SEND_ERROR, + TLS_RECV_ERROR, + + HTTP_ERROR, + HTTP_UNSUPPORTED_SCHEME, + HTTP_NO_AUTH_CREDENTIALS, + HTTP_NO_PROXY_AUTH_CREDENTIALS, + HTTP_INVALID_PORT_NUM, + HTTP_NO_STATUS_CODE, + HTTP_TOO_MANY_REDIRECTS, + + /* http status codes */ + HTTP_CONTINUE, + HTTP_SWITCH_PROTO, + HTTP_MOVED, /* All moved status codes but permamently */ + HTTP_MOVED_PERMANENTLY, + HTTP_USE_PROXY, + HTTP_UNAUTHORIZED, + HTTP_BAD_REQUEST, + HTTP_FORBIDDEN, + HTTP_NOT_FOUND, + HTTP_PROXY_AUTH_REQUIRED, + HTTP_GONE, + HTTP_INT_SERVER_ERROR, + + NO_BROWSER_SET_ERROR, + + SEGFAULT, + +#ifdef G_OS_WIN32 + WIN32V_ERROR, +#endif + + TICKR_LASTERRORCODE +} tickr_error_code; + +/* Exactly matching this ErrSt array and enum above doesn't matter anymore. */ +static const ErrSt e_a[] = { + {OK, "OK"}, + + {NO_RESOURCE_SPECIFIED, "No resource specified"}, + {RESOURCE_NOT_FOUND, "Resource not found"}, + {RESOURCE_INVALID, "Invalid resource"}, + {RESOURCE_ENCODING_ERROR, "Resource is *not* UTF-8 encoded"}, + + {OPTION_TOO_MANY, "Too many options"}, + {OPTION_INVALID, "Invalid option"}, + {OPTION_UNKNOWN, "Unknow option"}, + {OPTION_VALUE_INVALID, "Invalid option value"}, + + {FEED_FORMAT_ERROR, "Feed format error (RSS 1.0/2.0 or ATOM expected)"}, + {FEED_UNPARSABLE, "Feed is unparsable"}, + {FEED_EMPTY, "Feed is empty"}, + {FEED_NO_ITEM_OR_ENTRY_ELEMENT, "No item or entry element"}, + + {SELECTION_ERROR, "Feed selection error (no more info)"}, + {SELECTION_EMPTY, "Feed selection is empty"}, + + {RENDER_ERROR, "Render error (no more info)"}, + {RENDER_NO_RESOURCE, "Render: No resource"}, + {RENDER_CAIRO_IMAGE_SURFACE_TOO_WIDE, "Cairo image surface is too wide (> 32 K - 1 pixels)"}, + {RENDER_CREATE_CAIRO_IMAGE_SURFACE_ERROR, "Can't create cairo image surface"}, + {RENDER_FILL_IN_STR_ARRAY_ERROR, "Error while filling in RenderString array - Check out log for more info"}, + {RENDER_PROCESS_STR_ARRAY_ERROR, "Error while processing RenderString array - Check out log for more info"}, + {RENDER_PANGO_LAYOUT_WIDTH_OVERFLOW, "Overflow - Pango can't compute layout width of text with theses font name and size.\n" + "Please either decrease text length or font size."}, + + {READ_FROM_STREAM_ERROR, "Error while reading from stream"}, + {WRITE_TO_STREAM_ERROR, "Error while writing to stream"}, + + {NOT_UTF8_ENCODED, "String is *not* UTF-8 encoded"}, + + {SHIFT2LEFT_NULL_CAIRO_IMAGE_SURFACE, "Null cairo image surface"}, + + {FLIST_ERROR, "FList error (no more info)"}, + {LOAD_URL_LIST_ERROR, "Can't load URL list"}, + {LOAD_URL_LIST_EMPTY_LIST, "URL list is empty"}, + {LOAD_URL_LIST_NO_LIST, "URL list doesn't exist"}, + {SAVE_URL_LIST_ERROR, "Can't save URL list"}, + + {CREATE_FILE_ERROR, "Can't create file"}, + {OPEN_FILE_ERROR, "Can't open file"}, + + {XML_UNPARSABLE, "XML file is unparsable"}, + {XML_EMPTY, "XML file is empty"}, + + {OPML_ERROR, "OPML error (no more info)"}, + + {CONNECT_TOO_MANY_ERRORS, "Too many connection attempts"}, + + {TLS_ERROR, "TLS error (no more info)"}, + {TLS_SEND_ERROR, "TLS send error"}, + {TLS_RECV_ERROR, "TLS recv error"}, + + {HTTP_ERROR, "HTTP error (no more info)"}, + {HTTP_UNSUPPORTED_SCHEME, "Unsupported scheme in URL"}, + {HTTP_NO_AUTH_CREDENTIALS, "No authentication credentials"}, + {HTTP_NO_PROXY_AUTH_CREDENTIALS, "No proxy authentication credentials"}, + {HTTP_INVALID_PORT_NUM, "Invalid port number in URL"}, + {HTTP_NO_STATUS_CODE, "No HTTP status code returned"}, + {HTTP_TOO_MANY_REDIRECTS, "Too many HTTP redirects"}, + + /* http status codes */ + {HTTP_CONTINUE, "Continue"}, + {HTTP_SWITCH_PROTO, "Switch protocol"}, + {HTTP_MOVED, "Moved (not permanently)"}, + {HTTP_MOVED_PERMANENTLY, "Moved permanently"}, + {HTTP_USE_PROXY, "Must be accessed through proxy"}, + {HTTP_UNAUTHORIZED, "HTTP authentication required"}, + {HTTP_BAD_REQUEST, "Bad request"}, + {HTTP_FORBIDDEN, "Forbidden"}, + {HTTP_NOT_FOUND, "Not found"}, + {HTTP_PROXY_AUTH_REQUIRED, "Proxy authentication required"}, + {HTTP_GONE, "Gone"}, + {HTTP_INT_SERVER_ERROR, "Internal server error"}, + + {NO_BROWSER_SET_ERROR, "No Browser is set"}, + + {SEGFAULT, "Segfault (this is a *bug*)"}, + +#ifdef G_OS_WIN32 + {WIN32V_ERROR, "Win32 version error (no more info)"}, +#endif + + {TICKR_LASTERRORCODE, "Tickr last enumerated error code"} +}; + +const char *tickr_error_str(tickr_error_code); +const char *global_error_str(int); +void dump_error_codes(); +#endif /* INC_TICKR_ERROR_H */ diff -Nru tickr-0.6.4/src/tickr/tickr_feedparser.c tickr-0.7.0/src/tickr/tickr_feedparser.c --- tickr-0.6.4/src/tickr/tickr_feedparser.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_feedparser.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -18,20 +18,28 @@ #include "tickr.h" +/* + * Here, 'RSS' is sometimes used as a synonym of 'feed' and sometimes + * used by opposition to 'Atom' (this can be confusing). + */ + static int depth; static xmlNode *item_or_entry_element; static int n; static int counter; /* - * Here, 'rss' is sometimes used as a synonym of 'feed' and sometimes - * used by opposition to 'atom' (this can be confusing). + * In the algorithm, we now use strings instead of streams, so that we can + * use l_str_insert_at_b() in case of reverse scrolling. These strings, + * as well as other variables, are set global in this src file because + * of recursivity. */ +static char *xml_str, *xml_str_extra; /* - * Look for url and, if valid, parse it then dump result into + * Look for URL and, if valid, parse it then dump result into * /TICKR_DIR_NAME/XML_DUMP and -/XML_DUMP_EXTRA. - * If url isn't valid, only set error code and return. + * If URL isn't valid, only set error code and return. */ int get_feed(Resource *resrc, const Params *prm) { @@ -40,113 +48,126 @@ char feed_ttl[32]; char file_name[FILE_NAME_MAXLEN + 1]; char url[FILE_NAME_MAXLEN + 1]; - int suspend_rq_bak, exit_status, i; + int suspend_rq_bak, error_code, i; + char *visual_str; suspend_rq_bak = get_ticker_env()->suspend_rq; get_ticker_env()->suspend_rq = TRUE; resrc->rss_ttl = prm->rss_refresh; - /* 'xml dump' stuff */ + /* 'xml dump' stuff, will open stream later. */ str_n_cpy(resrc->xml_dump, get_datafile_full_name_from_name(XML_DUMP), FILE_NAME_MAXLEN); if (resrc->fp != NULL) fclose(resrc->fp); - resrc->fp = open_new_datafile_with_name(XML_DUMP, "wb"); - /* 'xml dump extra' stuff */ + /* 'xml dump extra' stuff, will open stream later. */ str_n_cpy(resrc->xml_dump_extra, get_datafile_full_name_from_name(XML_DUMP_EXTRA), FILE_NAME_MAXLEN); if (resrc->fp_extra != NULL) fclose(resrc->fp_extra); - resrc->fp_extra = open_new_datafile_with_name(XML_DUMP_EXTRA, "wb"); str_n_cpy(file_name, get_datafile_full_name_from_name(RESOURCE_DUMP), FILE_NAME_MAXLEN); - /* We replace resrc->id with modified url, file_name = downloaded resource */ - if ((exit_status = fetch_resource((const char *)resrc->id, (const char *)file_name, url)) == OK) { -#ifdef VERBOSE_OUTPUT - fprintf(STD_OUT, "Resource fetched: %s\n", (const char *)resrc->id); - fflush(STD_OUT); -#endif - } else if (exit_status == FEED_FORMAT_ERROR) { - warning(get_ticker_env()->selection_mode == MULTIPLE, 2, "Feed format error in: ", resrc->id); - return FEED_FORMAT_ERROR; - } else if (exit_status == CONNECT_TOO_MANY_ERRORS) { - return CONNECT_TOO_MANY_ERRORS; + /* We replace resrc->id with modified URL, file_name = downloaded resource. */ + if ((error_code = fetch_resource((const char *)resrc->id, (const char *)file_name, url)) == OK) { + VERBOSE_INFO_OUT("Resource fetched: %s\n", (const char *)resrc->id); + } else if (error_code == FEED_FORMAT_ERROR || error_code == RESOURCE_ENCODING_ERROR) { + warning(M_S_MOD, "%s: %s", global_error_str(error_code), resrc->id); + return error_code; + } else if (error_code == CONNECT_TOO_MANY_ERRORS) { + return error_code; } else { - warning(get_ticker_env()->selection_mode == MULTIPLE, 2, "Can't fetch resource: ", resrc->id); - return FEED_DOWNLOAD_ERROR; + warning(M_S_MOD, "Can't fetch resource: %s", resrc->id); + return error_code; } - /* We use file_name instead of resrc->id */ + /* We use file_name instead of resrc->id. */ if ((i = get_feed_info((int *)&resrc->format, file_name, feed_title, feed_link, feed_ttl)) != OK) { - if (i == FEED_UNPARSABLE) - warning(get_ticker_env()->selection_mode == MULTIPLE, - 2, "Feed is unparsable: ", resrc->id); - else if (i == FEED_EMPTY) - warning(get_ticker_env()->selection_mode == MULTIPLE, - 2, "Feed is empty: ", resrc->id); + if (i == FEED_UNPARSABLE || i == FEED_EMPTY) + warning(M_S_MOD, "%s: %s", global_error_str(i), resrc->id); else if (i == RSS_FORMAT_UNDETERMINED) - warning(get_ticker_env()->selection_mode == MULTIPLE, - 2, "Undetermined feed format: ", resrc->id); + warning(M_S_MOD, "Undetermined feed format: %s", resrc->id); else - warning(get_ticker_env()->selection_mode == MULTIPLE, - 2, "get_feed_info() undetermined error: ", resrc->id); + warning(M_S_MOD, "get_feed_info() error %d: %s: %s", i, global_error_str(i), resrc->id); return i; } else if (resrc->format == RSS_FORMAT_UNDETERMINED) { - warning(get_ticker_env()->selection_mode == MULTIPLE, - 2, "Undetermined feed format: ", resrc->id); + warning(M_S_MOD, "Undetermined feed format: %s", resrc->id); return RSS_FORMAT_UNDETERMINED; } + + /* We now use global strings instead of streams. */ + xml_str = l_str_new(NULL); + xml_str_extra = l_str_new(NULL); + str_n_cpy(resrc->feed_title, feed_title, FEED_TITLE_MAXLEN); if (prm->feed_title == 'y') { - /* We remove any LINK_TAG_CHAR from str because it will be used in "link tag" */ + /* We remove any LINK_TAG_CHAR from str because it will be used in "link tag". */ remove_char_from_str((char *)feed_title, LINK_TAG_CHAR); - fprintf(resrc->fp, "%s%s", feed_title, prm->feed_title_delimiter); + if (STANDARD_SCROLLING) { + xml_str = l_str_cat(xml_str, (const char *)feed_title); + xml_str = l_str_cat(xml_str, prm->feed_title_delimiter); + } else { + visual_str = log2vis_utf8((const char *)feed_title); + xml_str = l_str_insert_at_b(xml_str, (const char *)visual_str); + xml_str = l_str_insert_at_b(xml_str, prm->feed_title_delimiter); + l_str_free(visual_str); + } } if (feed_ttl[0] != '\0') resrc->rss_ttl = atoi(feed_ttl); - /* Link offset stuff reset */ + + /* Link and offset stuff reset */ for (i = 0; i < NFEEDLINKANDOFFSETMAX; i++) { resrc->link_and_offset[i].offset_in_surface = 0; (resrc->link_and_offset[i].url)[0] = '\0'; } - /* We use file_name instead of resrc->id */ - if ((exit_status = parse_xml_file(resrc->format, resrc->fp, resrc->fp_extra, - file_name, resrc->link_and_offset, prm)) == FEED_NO_ITEM_OR_ENTRY_ELEMENT) - warning(get_ticker_env()->selection_mode == MULTIPLE, 2, - "No 'item' or 'entry' element found in: ", resrc->id); - if (exit_status != OK) - return exit_status; + + /* We use file_name instead of resrc->id. */ + if ((error_code = parse_xml_file(resrc->format, file_name, + resrc->link_and_offset, prm)) == FEED_NO_ITEM_OR_ENTRY_ELEMENT) + warning(M_S_MOD, "No 'item' or 'entry' element found in: %s", resrc->id); + if (error_code != OK) { + l_str_free(xml_str); + l_str_free(xml_str_extra); + return error_code; + } + + resrc->fp = open_new_datafile_with_name(XML_DUMP, "wb"); + fprintf(resrc->fp, "%s", xml_str); + l_str_free(xml_str); + /* We close then reopen stream in read-only mode. */ fclose(resrc->fp); resrc->fp = open_new_datafile_with_name(XML_DUMP, "rb"); + + resrc->fp_extra = open_new_datafile_with_name(XML_DUMP_EXTRA, "wb"); + fprintf(resrc->fp_extra, "%s", xml_str_extra); + l_str_free(xml_str_extra); + /* We close then reopen stream in read-only mode. */ fclose(resrc->fp_extra); resrc->fp_extra = open_new_datafile_with_name(XML_DUMP_EXTRA, "rb"); + get_ticker_env()->suspend_rq = suspend_rq_bak; return OK; } /* - * Must be utf-8 encoded + * Must be UTF-8 encoded. */ -int parse_xml_file(int format, FILE *fp, FILE *fp_extra, const char* file_name,\ - FeedLinkAndOffset *link_and_offset, const Params *prm) +int parse_xml_file(int format, const char* file_name, FeedLinkAndOffset *link_and_offset, + const Params *prm) { xmlDoc *doc; xmlNode *root_element; -#ifdef VERBOSE_OUTPUT - fprintf(STD_OUT, "Parsing XML file ... "); - fflush(STD_OUT); -#endif + VERBOSE_INFO_OUT("Parsing XML file ... "); + if ((doc = xmlParseFile(file_name)) == NULL) { - warning(get_ticker_env()->selection_mode == MULTIPLE, 2, - "XML parser error: ", xmlGetLastError()->message); + warning(M_S_MOD, "XML parser error: %s", xmlGetLastError()->message); return FEED_UNPARSABLE; } if ((root_element = xmlDocGetRootElement(doc)) == NULL) { xmlFreeDoc(doc); - warning(get_ticker_env()->selection_mode == MULTIPLE, 2, - "Empty XML document: ", file_name); + warning(M_S_MOD, "Empty XML document: '%s'", file_name); return FEED_EMPTY; } @@ -166,17 +187,14 @@ return FEED_FORMAT_ERROR; } if (item_or_entry_element != NULL) - get_feed_selected_elements2(format, item_or_entry_element, doc, - fp, fp_extra, link_and_offset, prm); + get_feed_selected_elements2(format, item_or_entry_element, doc, link_and_offset, prm); else { xmlFreeDoc(doc); return FEED_NO_ITEM_OR_ENTRY_ELEMENT; } + xmlFreeDoc(doc); -#ifdef VERBOSE_OUTPUT - fprintf(STD_OUT, "Done\n"); - fflush(STD_OUT); -#endif + VERBOSE_INFO_OUT("Done\n"); return OK; } @@ -187,7 +205,7 @@ for (cur_node = some_element; cur_node != NULL; cur_node = cur_node->next) { if (item_or_entry_element != NULL) return; - /* NEW: RSS 2.0: we don't want extra namespaces */ + /* RSS 2.0: We don't want extra namespaces. */ if (cur_node->ns != NULL) continue; if (xmlStrcmp(cur_node->name, (const xmlChar *)"rss") == 0 && depth == 0) @@ -243,17 +261,22 @@ } /* - * For every link found, we insert in text LINK_TAG_CHAR + "00n" - * with n = link rank and we fill link_and_offset with url. - * This is used later in render_stream_to_surface(). + * For every link found, we insert LINK_TAG_CHAR + "00n" inside text with + * n = link rank and we fill link_and_offset->url with URL. This is used + * later in render_stream_to_surface(). + * + * With reverse scrolling, we need to use Unicode control characters for + * bidi text so that tags and delimiters are correctly placed. */ void get_feed_selected_elements2(int feed_format, xmlNode *some_element, xmlDoc *doc, - FILE *fp, FILE *fp_extra, FeedLinkAndOffset *link_and_offset, const Params *prm) + FeedLinkAndOffset *link_and_offset, const Params *prm) { xmlNode *cur_node, *cur_node_bak; xmlChar *str; xmlChar item_or_entry[16]; xmlChar description_or_summary[16]; + char tmp_5[5]; /* 1 (ascii char) + 3 ("000" -> "999") + 1 (NULL terminator) */ + char *visual_str; if (feed_format == RSS_2_0 || feed_format == RSS_1_0) { str_n_cpy((char *)item_or_entry, "item", 15); @@ -262,42 +285,77 @@ str_n_cpy((char *)item_or_entry, "entry", 15); str_n_cpy((char *)description_or_summary, "summary", 15); } else { - fprintf(STD_ERR, "get_feed_selected_elements2(): Undefined feed format\n"); - fflush(STD_ERR); + INFO_ERR("%s(): Undefined feed format\n", __func__) return; } for (cur_node = some_element; cur_node != NULL; cur_node = cur_node->next) { - /* NEW: RSS 2.0: we don't want extra namespaces */ + /* RSS 2.0: We don't want extra namespaces. */ if (feed_format == RSS_2_0 && cur_node->ns != NULL) continue; if (xmlStrcmp(cur_node->name, (const xmlChar *)item_or_entry) == 0) { cur_node_bak = cur_node; cur_node = cur_node->children; for (; cur_node != NULL; cur_node = cur_node->next) { - /* NEW: RSS 2.0: we don't want extra namespaces */ + /* RSS 2.0: We don't want extra namespaces. */ if (feed_format == RSS_2_0 && cur_node->ns != NULL) continue; if (xmlStrcmp(cur_node->name, (const xmlChar *)"title") == 0) { - /* xmlNodeListGetString(doc, node, 1) = node->content */ if ((str = xmlNodeListGetString(doc, cur_node->children, 1)) != NULL) { - /* We remove any LINK_TAG_CHAR from str because it will be used in "link tag" */ + /* We remove any LINK_TAG_CHAR from str because it will be used in "link tag". */ remove_char_from_str((char *)str, LINK_TAG_CHAR); remove_char_from_str((char *)str, ITEM_TITLE_TAG_CHAR); - if (prm->item_title == 'y') - fprintf(fp, "%s%s", str, prm->item_title_delimiter); - else if (prm->item_description == 'y') - fprintf(fp_extra, "%c%03d%s\n", ITEM_TITLE_TAG_CHAR, n, str); + if (prm->item_title == 'y') { + if (STANDARD_SCROLLING) { + xml_str = l_str_cat(xml_str, (const char *)str); + xml_str = l_str_cat(xml_str, prm->item_title_delimiter); + } else { + visual_str = log2vis_utf8((const char *)str); + xml_str = l_str_insert_at_b(xml_str, (const char *)visual_str); + xml_str = l_str_insert_at_b(xml_str, prm->item_title_delimiter); + l_str_free(visual_str); + + } + } else if (prm->item_description == 'y') { + snprintf(tmp_5, 5, "%c%03d", ITEM_TITLE_TAG_CHAR, n); + if (STANDARD_SCROLLING) { + xml_str_extra = l_str_cat(xml_str_extra, tmp_5); + xml_str_extra = l_str_cat(xml_str_extra, (const char *)str); + xml_str_extra = l_str_cat(xml_str_extra, "\n"); + } else { + xml_str_extra = l_str_insert_at_b(xml_str_extra, "\n"); + xml_str_extra = l_str_insert_at_b(xml_str_extra, (const char *)str); + xml_str_extra = l_str_insert_at_b(xml_str_extra, tmp_5); + } + } xmlFree(str); } } else if (xmlStrcmp(cur_node->name, (const xmlChar *)description_or_summary) == 0) { if ((str = xmlNodeListGetString(doc, cur_node->children, 1)) != NULL) { - /* We remove any LINK_TAG_CHAR from str because it will be used in "link tag" */ + /* We remove any LINK_TAG_CHAR from str because it will be used in "link tag". */ remove_char_from_str((char *)str, LINK_TAG_CHAR); remove_char_from_str((char *)str, ITEM_DES_TAG_CHAR); - if (prm->item_description == 'y') - fprintf(fp, "%s%s", str, prm->item_description_delimiter); - else if (prm->item_title == 'y') - fprintf(fp_extra, "%c%03d%s\n", ITEM_DES_TAG_CHAR, n, str); + if (prm->item_description == 'y') { + if (STANDARD_SCROLLING) { + xml_str = l_str_cat(xml_str, (const char *)str); + xml_str = l_str_cat(xml_str, prm->item_description_delimiter); + } else { + visual_str = log2vis_utf8((const char *)str); + xml_str = l_str_insert_at_b(xml_str, (const char *)visual_str); + xml_str = l_str_insert_at_b(xml_str, prm->item_description_delimiter); + l_str_free(visual_str); + } + } else if (prm->item_title == 'y') { + snprintf(tmp_5, 5, "%c%03d", ITEM_DES_TAG_CHAR, n); + if (STANDARD_SCROLLING) { + xml_str_extra = l_str_cat(xml_str_extra, tmp_5); + xml_str_extra = l_str_cat(xml_str_extra, (const char *)str); + xml_str_extra = l_str_cat(xml_str_extra, "\n"); + } else { + xml_str_extra = l_str_insert_at_b(xml_str_extra, "\n"); + xml_str_extra = l_str_insert_at_b(xml_str_extra, (const char *)str); + xml_str_extra = l_str_insert_at_b(xml_str_extra, tmp_5); + } + } xmlFree(str); } } @@ -305,7 +363,7 @@ cur_node = cur_node_bak; cur_node = cur_node->children; for (; cur_node != NULL; cur_node = cur_node->next) { - /* NEW: RSS 2.0: we don't want extra namespaces */ + /* RSS 2.0: We don't want extra namespaces. */ if (feed_format == RSS_2_0 && cur_node->ns != NULL) continue; if (xmlStrcmp(cur_node->name, (const xmlChar *)"link") == 0) { @@ -315,7 +373,11 @@ if (n < NFEEDLINKANDOFFSETMAX + 1) { str_n_cpy((link_and_offset + n)->url, (const char *)str, FILE_NAME_MAXLEN); - fprintf(fp, "%c%03d", LINK_TAG_CHAR, n++); + snprintf(tmp_5, 5, "%c%03d", LINK_TAG_CHAR, n++); + if (STANDARD_SCROLLING) + xml_str = l_str_cat(xml_str, tmp_5); + else + xml_str = l_str_insert_at_b(xml_str, tmp_5); } xmlFree(str); } @@ -329,6 +391,7 @@ } } +/* Any useful ? Text is already supposed to be UTF-8 encoded. */ static const char *try_str_to_utf8(const char *str) { static char str2[1024]; @@ -390,7 +453,7 @@ xmlFreeDoc(doc); if (!g_utf8_validate(feed_title, -1, NULL)) str_n_cpy(feed_title, try_str_to_utf8(feed_title), 255); - /* We remove any LINK_TAG_CHAR from str because it will be used in "link tag" */ + /* We remove any LINK_TAG_CHAR from str because it will be used in "link tag". */ remove_char_from_str(feed_title, LINK_TAG_CHAR); return OK; } @@ -398,7 +461,7 @@ } /* - * string must be empty (string[0] = '\0' + * string must be empty (string[0] = '\0') as function is recursive. */ void get_xml_first_element(xmlNode *some_element, xmlDoc *doc, char *name, char *string, int length) { @@ -419,3 +482,48 @@ get_xml_first_element(cur_node->children, doc, name, string, length); } } + +/* + * Reorder a UTF-8 string from logical to visual. + * Original (logical) string is not modified. + * Returned (visual) string must be freed (l_str_free) afterwards. + */ +char *log2vis_utf8(const char *str) +{ + char *utf8_str; + char *utf8_str_2; + FriBidiChar *unicode_str; /* (uint32_t *) */ + FriBidiChar *unicode_str_2; + FriBidiParType *pbase_dir; /* (uint32_t *) */ + FriBidiLevel *embedding_levels; /* (signed char) */ + size_t mem_size; + int utf8_str_len; + char *visual_str; + + utf8_str = l_str_new(str); + utf8_str_2 = l_str_new(str); + mem_size = (strlen(str) + 1) * 4; /* Not sure what size should be */ + unicode_str = (FriBidiChar *)malloc2(mem_size); + unicode_str_2 = (FriBidiChar *)malloc2(mem_size); + pbase_dir = (FriBidiChar *)malloc2(mem_size / 2 ); /* Same here */ + embedding_levels = (signed char *)malloc2(mem_size / 2); /* And here */ + + utf8_str_len = fribidi_charset_to_unicode(FRIBIDI_CHAR_SET_UTF8, utf8_str, strlen(utf8_str), unicode_str); + + if (fribidi_log2vis(unicode_str, utf8_str_len, pbase_dir, unicode_str_2, NULL, NULL, embedding_levels) == 0) { + INFO_ERR("%s(): fribidi_log2vis() returned 0\n", __func__) + l_str_free(utf8_str_2); + visual_str = l_str_new("Invalid_string"); + } else { + fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, unicode_str_2, utf8_str_len, utf8_str_2); + visual_str = utf8_str_2; + } + + l_str_free(utf8_str); + free2(unicode_str); + free2(unicode_str_2); + free2(pbase_dir); + free2(embedding_levels); + + return visual_str; +} diff -Nru tickr-0.6.4/src/tickr/tickr_feedpicker.c tickr-0.7.0/src/tickr/tickr_feedpicker.c --- tickr-0.6.4/src/tickr/tickr_feedpicker.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_feedpicker.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -21,25 +21,19 @@ #define URL_ENTRY_LENGTH 100 #define RANK_ENTRY_LENGTH FLIST_RANK_STR_LEN -/* Predefined GTK_RESPONSE_ are < 0, those ones are app level defined and >= 0. */ -enum { - GTK_RESPONSE_SELECT_ALL, GTK_RESPONSE_UNSELECT_ALL, GTK_RESPONSE_CLEAR_RANKING, GTK_RESPONSE_TOP, - GTK_RESPONSE_HOME, GTK_RESPONSE_REMOVE, GTK_RESPONSE_ADD, GTK_RESPONSE_SINGLE, GTK_RESPONSE_SELECTION -}; - enum {COLUMN_INT, COLUMN_BOOLEAN_CHECKED, COLUMN_STRING_RANK, COLUMN_STRING_TITLE, COLUMN_STRING_URL, N_COLUMNS}; static GtkWidget *dialog, *url_entry, *rank_entry; static FList *flist; static int f_index; /* Starting at 0 (row starts at 1) */ -static gchar home_feed[FILE_NAME_MAXLEN + 1]; +static char home_feed[FILE_NAME_MAXLEN + 1]; -/* Tree selection callback - update f_index and copy selected url to url_entry (override) */ -static gint tree_selection_changed(GtkTreeSelection *selection) +/* Tree selection callback - update f_index and copy selected URL to url_entry (override) */ +static int tree_selection_changed(GtkTreeSelection *selection) { GtkTreeModel *tree_model = NULL; GtkTreeIter iter; - gchar *url_str, *rank_str; + char *url_str, *rank_str; if (gtk_tree_selection_get_selected(selection, &tree_model, &iter)) { gtk_tree_model_get(tree_model, &iter, @@ -60,11 +54,11 @@ } /* Catch double-click on tree view */ -static gint double_click_on_tree_view(GtkTreeView *tree_view, GtkTreePath *tree_path) +static int double_click_on_tree_view(GtkTreeView *tree_view, GtkTreePath *tree_path) { GtkTreeModel *tree_model = NULL; GtkTreeIter iter; - gchar *url_str, *rank_str; + char *url_str, *rank_str; tree_model = gtk_tree_view_get_model(tree_view); if (gtk_tree_model_get_iter(tree_model, &iter, tree_path)) { @@ -86,14 +80,14 @@ return TRUE; } -static gint enter_key_pressed_in_entry(GtkWidget *widget) +static int enter_key_pressed_in_entry(GtkWidget *widget) { widget = widget; - gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_ADD); + gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_ADD_UPD); return TRUE; } -static gint clear_entry(GtkWidget *widget) +static int clear_entry(GtkWidget *widget) { widget = widget; gtk_entry_set_text(GTK_ENTRY(url_entry), ""); @@ -103,7 +97,7 @@ return TRUE; } -static gint checkbox_toggled(GtkCellRendererToggle *renderer, gchar *path_str, gpointer tree_view) +static int checkbox_toggled(GtkCellRendererToggle *renderer, char *path_str, gpointer tree_view) { GtkTreeModel *tree_model; GtkTreeIter iter; @@ -233,6 +227,7 @@ } } +/* Use url_entry and rank_entry (global vars in this src file) */ static int add_feed_to_flnode_and_list_store(Resource *resrc, GtkListStore *list_store) { FList *flist2; @@ -242,50 +237,54 @@ char rss_feed_ttl[32]; char rank[FLIST_RANK_STR_LEN + 1]; int unused; + char resrc_id_bak[FILE_NAME_MAXLEN + 1]; + str_n_cpy(resrc_id_bak, resrc->id, FILE_NAME_MAXLEN); str_n_cpy(resrc->id, (char *)gtk_entry_get_text(GTK_ENTRY(url_entry)), FILE_NAME_MAXLEN); - if (get_params()->enable_feed_ordering != 'y') - if ((flist2 = f_list_nth(flist, f_list_search(flist, resrc->id) + 1)) != NULL) - str_n_cpy(rank, flist2->rank, FLIST_RANK_STR_LEN); - else - str_n_cpy(rank, BLANK_STR_16, FLIST_RANK_STR_LEN); - else - str_n_cpy(rank, (char *)gtk_entry_get_text(GTK_ENTRY(rank_entry)), FLIST_RANK_STR_LEN); if ((rss_status = get_feed(resrc, get_params())) == OK) { + if (get_params()->enable_feed_ordering != 'y') { + if (IS_FLIST(flist) && (flist2 = f_list_nth(flist, f_list_search(flist, resrc->id) + 1)) != NULL) + str_n_cpy(rank, flist2->rank, FLIST_RANK_STR_LEN); + else + str_n_cpy(rank, BLANK_STR_16, FLIST_RANK_STR_LEN); + } else + str_n_cpy(rank, (char *)gtk_entry_get_text(GTK_ENTRY(rank_entry)), FLIST_RANK_STR_LEN); + /* Fix LP bug #1272129 */ if (IS_FLIST(flist)) flist = f_list_last(flist); + /* If valid, added URL is set selected */ if (get_feed_info(&unused, resrc->id, rss_feed_title, rss_feed_link, rss_feed_ttl) == OK) - /* Added url is set unselected. Is that OK ? */ - flist = f_list_add_at_end(flist, resrc->id, rss_feed_title, FALSE, rank); + flist = f_list_add_at_end(flist, resrc->id, rss_feed_title, rss_status == OK ? TRUE : FALSE, rank); else - flist = f_list_add_at_end(flist, resrc->id, "", FALSE, rank); + flist = f_list_add_at_end(flist, resrc->id, "", rss_status == OK ? TRUE : FALSE, rank); flist = f_list_sort(flist); fill_list_store_from_flnode(list_store); - } /*else { - // Should something be done here ? - if (question_win("URL is unreachable. Keep it anyways ?") == YES) { - } - }*/ + } else { + /* === TODO: Find out how to handle an invalid or unreachable URL === */ + warning(BLOCK, "URL is invalid or unreachable (or whatever)"); + return RESOURCE_INVALID; + } return rss_status; } /* - * Open a dialog with a list of urls to choose from and an url entry. + * Open a dialog with a list of URLs to choose from and an URL entry. * - * Entry format in url list file: - * ['*' (selected) or '-' (unselected) + "000" (3 chars rank) + url [+ '>' + title] + '\n'] + * Entry format in URL list file: + * ['*' (selected) or '-' (unselected) + "000" (3 chars rank) + URL [+ '>' + title] + '\n'] * * Entry max length = FILE_NAME_MAXLEN * See also: (UN)SELECTED_URL_CHAR/STR and TITLE_TAG_CHAR/STR in tickr.h * FLIST_RANK_FORMAT and FLIST_RANK_STR_LEN in tickr_list.h */ -void get_new_url(Resource *resrc) +void manage_list_and_selection(Resource *resrc) { TickerEnv *env; GtkWidget *sc_win, *hbox; - GtkWidget *cancel_but, *selectall_but, *unselectall_but; - GtkWidget *clear_ranking_but, *top_but, *home_but, *remove_but; - GtkWidget *add_but, *single_but, *selection_but, *clear_but; + GtkWidget *cancel_but, *selectall_but, *unselectall_but, *clear_ranking_but; + GtkWidget *top_but, *current_but, *home_but, *remove_but, *add_but; + GtkWidget *single_but, *selection_but, *clear_but; + GtkWidget *tmp_label; GtkTreeView *tree_view = NULL; GtkListStore *list_store = NULL; GtkTreeModel *tree_model = NULL; @@ -294,16 +293,17 @@ GtkTreeViewColumn *column1 = NULL, *column2 = NULL, *column3 = NULL, *column4 = NULL; GtkTreeSelection *selection = NULL; FList *flist_bak = NULL, *flist2 = NULL; - Resource resrc_bak; - gint response; - gint cursor_position; + char resrc_id_bak[FILE_NAME_MAXLEN + 1]; + int response; + int cursor_position; + char *tooltip_text; env = get_ticker_env(); env->suspend_rq = TRUE; gtk_window_set_keep_above(GTK_WINDOW(env->win), FALSE); dialog = gtk_dialog_new_with_buttons( - "Feed Picker (RSS/Atom)", GTK_WINDOW(env->win), + "Feed Organizer (RSS/Atom)", GTK_WINDOW(env->win), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, NULL); @@ -313,18 +313,32 @@ if (get_params()->enable_feed_ordering == 'y') clear_ranking_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Clear Rank", GTK_RESPONSE_CLEAR_RANKING); top_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Top", GTK_RESPONSE_TOP); + current_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Current", GTK_RESPONSE_CURRENT); home_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_HOME, GTK_RESPONSE_HOME); remove_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_REMOVE, GTK_RESPONSE_REMOVE); - add_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Add/Upd", GTK_RESPONSE_ADD); + add_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Add/Upd", GTK_RESPONSE_ADD_UPD); single_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "OK (Single)", GTK_RESPONSE_SINGLE); selection_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "OK (Selec)", GTK_RESPONSE_SELECTION); clear_but = gtk_button_new_with_label("Clear"); + /* Tooltips */ + tooltip_text = l_str_new("Will try to connect and add or update URL and title"); + gtk_widget_set_tooltip_text(add_but, tooltip_text); + l_str_free(tooltip_text); + tooltip_text = l_str_new("'Single selection' mode - Will read only the highlighted URL"); + gtk_widget_set_tooltip_text(single_but, tooltip_text); + l_str_free(tooltip_text); + tooltip_text = l_str_new("'Multiple selection' mode - Will read sequentially all selected URLs, " + "starting from highlighted one - more exactly URL in entry (if any) / first one otherwise"); + gtk_widget_set_tooltip_text(selection_but, tooltip_text); + l_str_free(tooltip_text); + cancel_but = cancel_but; /* To get rid of some annoying compiler warnings */ selectall_but = selectall_but; unselectall_but = unselectall_but; clear_ranking_but = clear_ranking_but; top_but = top_but; + current_but = current_but; home_but = home_but; remove_but = remove_but; add_but = add_but; @@ -341,7 +355,7 @@ gtk_container_set_border_width(GTK_CONTAINER(sc_win), 5); /* Whole window must be visible on netbooks as well */ gtk_widget_set_size_request(sc_win, 1000, 450); - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), sc_win, TRUE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), sc_win, TRUE, TRUE, 0); str_n_cpy(home_feed, get_params()->homefeed, FILE_NAME_MAXLEN); list_store = gtk_list_store_new(N_COLUMNS, G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); @@ -367,7 +381,7 @@ if (get_params()->enable_feed_ordering == 'y') { renderer2 = gtk_cell_renderer_text_new(); #ifndef G_OS_WIN32 - /* Doesn't compile on win32 because of older GTK version. */ + /* Doesn't compile on win32 because of older GTK version */ gtk_cell_renderer_set_alignment(renderer2, 1.0, 0.5); #endif column2 = gtk_tree_view_column_new_with_attributes(NULL/*"Rank"*/, renderer2, @@ -389,16 +403,17 @@ selection = gtk_tree_view_get_selection(tree_view); gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); - - g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(tree_selection_changed), NULL); + g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(tree_selection_changed), selection); g_signal_connect(G_OBJECT(tree_view), "row_activated", G_CALLBACK(double_click_on_tree_view), NULL); g_signal_connect(G_OBJECT(renderer1), "toggled", G_CALLBACK(checkbox_toggled), tree_view); hbox = gtk_hbox_new(FALSE, 0); if (get_params()->enable_feed_ordering != 'y') - gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new("Enter new URL:"), FALSE, FALSE, 0); + tmp_label = gtk_label_new("New Feed -> Enter URL:"); /* or , , ... */ else - gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new("Enter rank and new URL:"), FALSE, FALSE, 0); + tmp_label = gtk_label_new("New Feed -> Enter rank and URL:"); + gtk_label_set_use_markup(GTK_LABEL(tmp_label), TRUE); + gtk_box_pack_start(GTK_BOX(hbox), tmp_label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(" "), TRUE, FALSE, 0); if (get_params()->enable_feed_ordering == 'y') { rank_entry = gtk_entry_new(); @@ -411,7 +426,7 @@ if (get_params()->enable_feed_ordering != 'y') gtk_entry_set_width_chars(GTK_ENTRY(url_entry), URL_ENTRY_LENGTH); else - gtk_entry_set_width_chars(GTK_ENTRY(url_entry), URL_ENTRY_LENGTH - 10); /* about... */ + gtk_entry_set_width_chars(GTK_ENTRY(url_entry), URL_ENTRY_LENGTH - 10); /* about ... */ gtk_box_pack_start(GTK_BOX(hbox), url_entry, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), clear_but, FALSE, FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox), 5); @@ -427,27 +442,40 @@ gtk_widget_show_all(dialog); /* Backup last valid opened resource (if any) */ - str_n_cpy(resrc_bak.id, resrc->id, FILE_NAME_MAXLEN); - /* Is it better like that ? */ - if (IS_FLIST(flist) && resrc->id[0] != '\0') + str_n_cpy(resrc_id_bak, resrc->id, FILE_NAME_MAXLEN); + if (IS_FLIST(flist) && resrc->id[0] != '\0') { if ((f_index = f_list_search(flist, resrc->id)) > -1) highlight_and_go_to_row(tree_view, selection, f_index + 1); + /* + * Try original URL in case of HTTP redirects + * TODO: Find best practice - should new URL replace original URL ? + */ + else if ((f_index = f_list_search(flist, resrc->orig_url)) > -1) + highlight_and_go_to_row(tree_view, selection, f_index + 1); + } gtk_widget_grab_focus(GTK_WIDGET(tree_view)); while ((response = gtk_dialog_run(GTK_DIALOG(dialog))) != GTK_RESPONSE_CANCEL_CLOSE) { if (response == GTK_RESPONSE_SELECT_ALL) { - if (question_win("Select all URLs ?") == YES) + if (question_win("Select all URLs ?", NO) == YES) select_all(tree_view); } else if (response == GTK_RESPONSE_UNSELECT_ALL) { - if (question_win("Unselect all URLs ?") == YES) + if (question_win("Unselect all URLs ?", NO) == YES) unselect_all(tree_view); } else if (response == GTK_RESPONSE_CLEAR_RANKING) { - if (question_win("Clear all URLs ranking ?") == YES) + if (question_win("Clear all URLs ranking ?", NO) == YES) clear_ranking(tree_view); } else if (response == GTK_RESPONSE_TOP) { highlight_and_go_to_row(tree_view, selection, 1); + } else if (response == GTK_RESPONSE_CURRENT) { + gtk_entry_set_text(GTK_ENTRY(url_entry), (const char *)resrc->id); + if (IS_FLIST(flist)) { + if ((f_index = f_list_search(flist, + gtk_entry_get_text(GTK_ENTRY(url_entry)))) > -1) + highlight_and_go_to_row(tree_view, selection, f_index + 1); + } } else if (response == GTK_RESPONSE_HOME) { - gtk_entry_set_text(GTK_ENTRY(url_entry), (const gchar *)home_feed); + gtk_entry_set_text(GTK_ENTRY(url_entry), (const char *)home_feed); if (IS_FLIST(flist)) { if ((f_index = f_list_search(flist, gtk_entry_get_text(GTK_ENTRY(url_entry)))) > -1) @@ -456,7 +484,7 @@ } else if (response == GTK_RESPONSE_REMOVE) { if (IS_FLIST(flist) && f_index > -1) { if (gtk_tree_selection_get_selected(selection, &tree_model, &iter) && - question_win("Remove selected URL from list ?") == YES) { + question_win("Remove highlighted URL from list ?", NO) == YES) { gtk_list_store_remove(list_store, &iter); flist = f_list_remove(flist); if (f_list_count(flist) > 0) @@ -467,18 +495,18 @@ gtk_entry_set_text(GTK_ENTRY(url_entry), ""); } } else - warning(FALSE, 1, "You must select an URL first"); - } else if (response == GTK_RESPONSE_ADD) { /* Actually add/update */ + warning(BLOCK, "You must select an URL first"); + } else if (response == GTK_RESPONSE_ADD_UPD) { if (get_params()->enable_feed_ordering == 'y') { - if (!(str_is_num(gtk_entry_get_text(GTK_ENTRY(rank_entry))) &&\ - atoi(gtk_entry_get_text(GTK_ENTRY(rank_entry))) >= 0) &&\ + if (!(str_is_num(gtk_entry_get_text(GTK_ENTRY(rank_entry))) && + atoi(gtk_entry_get_text(GTK_ENTRY(rank_entry))) >= 0) && !str_is_blank(gtk_entry_get_text(GTK_ENTRY(rank_entry)))) { - warning(FALSE, 1, "You must enter a numerical (>= 0 integer) value"); + warning(BLOCK, "You must enter a numerical (>= 0 integer) value"); gtk_widget_grab_focus(GTK_WIDGET(rank_entry)); continue; } } - if (gtk_entry_get_text(GTK_ENTRY(url_entry))[0] != '\0') { + if (gtk_entry_get_text(GTK_ENTRY(url_entry))[0] != '\0') { // FIXME: Some issues here cursor_position = gtk_editable_get_position(GTK_EDITABLE(url_entry)); str_n_cpy(resrc->id, gtk_entry_get_text(GTK_ENTRY(url_entry)), FILE_NAME_MAXLEN); if (add_feed_to_flnode_and_list_store(resrc, list_store) == OK) { @@ -486,16 +514,18 @@ gtk_entry_get_text(GTK_ENTRY(url_entry)))) > -1) highlight_and_go_to_row(tree_view, selection, f_index + 1); /* Backup last valid opened resource (if any) */ - str_n_cpy(resrc_bak.id, resrc->id, FILE_NAME_MAXLEN); + str_n_cpy(resrc_id_bak, resrc->id, FILE_NAME_MAXLEN); } else { + /* === TODO: Find out how to handle an invalid or unreachable URL === */ /* Restore last valid opened resource (if any) */ - str_n_cpy(resrc->id, resrc_bak.id, FILE_NAME_MAXLEN); + /*str_n_cpy(resrc->id, resrc_id_bak, FILE_NAME_MAXLEN); gtk_widget_grab_focus(GTK_WIDGET(url_entry)); gtk_editable_set_position(GTK_EDITABLE(url_entry), cursor_position); - continue; + continue;*/ + break; } } else { - warning(FALSE, 1, "You must enter an URL first"); + warning(BLOCK, "You must enter an URL first"); gtk_widget_grab_focus(GTK_WIDGET(url_entry)); continue; } @@ -507,11 +537,14 @@ env->selection_mode = SINGLE; env->reload_rq = TRUE; break; - } else + } else { + /* === TODO: Find out how to handle an invalid or unreachable URL === */ /* Restore last valid opened resource (if any) */ - str_n_cpy(resrc->id, resrc_bak.id, FILE_NAME_MAXLEN); + /*str_n_cpy(resrc->id, resrc_id_bak, FILE_NAME_MAXLEN);*/ + break; + } } else - warning(FALSE, 1, "You must enter or select an URL first"); + warning(BLOCK, "You must enter or select an URL first"); } else if (response == GTK_RESPONSE_SELECTION) { if (IS_FLIST(flist)) { for (flist2 = f_list_first(flist); IS_FLIST(flist2); flist2 = flist2->next) @@ -524,9 +557,9 @@ break; } } - warning(FALSE, 1, "Selection is empty"); + warning(BLOCK, "Selection is empty"); } else - warning(FALSE, 1, "URL list is empty"); + warning(BLOCK, "URL list is empty"); } gtk_widget_grab_focus(GTK_WIDGET(tree_view)); } @@ -540,8 +573,8 @@ build_feed_selection_from_feed_list(); if (IS_FLIST(get_feed_selection()) && response == GTK_RESPONSE_SELECTION) { /* - * NEW: Multiple selection mode: start reading selection with highlighted feed - * - more exactly url in entry (if any) / first one otherwise. + * Multiple selection mode: start reading selection with highlighted feed + * - more exactly URL in entry (if any) / first one otherwise */ if ((f_index = f_list_search(get_feed_selection(), gtk_entry_get_text(GTK_ENTRY(url_entry)))) > -1) set_feed_selection(f_list_nth(get_feed_selection(), f_index + 1)); @@ -551,12 +584,13 @@ if (IS_FLIST(flist_bak)) f_list_free_all(flist_bak); } else { - info_win("", "Invalid new feed list", INFO_ERROR, TRUE); - fprintf(STD_ERR, "Invalid new feed list\n"); + /*info_win("", "Invalid new feed list", INFO_ERROR, TRUE); + fprintf(STD_ERR, "Invalid new feed list\n");*/ + warning(BLOCK, "Invalid new feed list"), flist = flist_bak; } } else { - /* If cancelled, we only restore feed list. */ + /* If cancelled, we only restore feed list */ if (IS_FLIST(flist)) f_list_free_all(flist); flist = flist_bak; diff -Nru tickr-0.6.4/src/tickr/tickr.h tickr-0.7.0/src/tickr/tickr.h --- tickr-0.6.4/src/tickr/tickr.h 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr.h 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -21,34 +21,39 @@ #define APP_NAME "Tickr" #define APP_CMD "tickr" -#define APP_VERSION_NUMBER "0.6.4" -#define WEBSITE_URL "http://www.newsrssticker.com" -#define SUPPORT_URL WEBSITE_URL "/help.php" +#define APP_V_NUM "0.7.0" +#define COPYRIGHT_STR "Copyright (C) 2009-2020 Emmanuel Thomas-Maurin" +#define WEBSITE_URL "https://www.open-tickr.net" #define DOWNLOAD_URL WEBSITE_URL "/download.php" -#define SUPPORT_EMAIL_ADDR "manu@newsrssticker.com" +#define SUPPORT_URL WEBSITE_URL "/help.php" +#define DONATE_WITH_PAYPAL_URL WEBSITE_URL "/go_to_paypal.php" +#define SUPPORT_EMAIL_ADDR "manutm007@gmail.com" #define CHECK4UPDATES_URL WEBSITE_URL "/app_version_visible.php" -#define CHECK4UPDATES_ID_STR "LSVN=" /* Stands for 'Last Stable Version Number = ' */ +#define CHECK4UPDATES_ID_STR "LSVN=" /* Stands for 'Last Stable Version Number = ' */ + +/*#define ABOUT_WIN_QUOTE \ + "We've been told that a million monkeys banging on a\n"\ + "million keyboards will eventually reproduce the entire\n"\ + "works of W. Shakespeare. Now, thanks to the Internet,\n"\ + "we know this is *not* true."*/ #define _GNU_SOURCE #define _ISOC99_SOURCE -#define VERBOSE_OUTPUT +#undef VERBOSE_OUTPUT /* Always defined in libetm, so always first undefine ... */ +#define VERBOSE_OUTPUT /* Then define again */ /*#define DEBUG_OUTPUT*/ -/* For info_win_wait(..., timeout) */ -/*#define INFO_WIN_WAIT_POS GTK_WIN_POS_CENTER*/ /* Same as for info_win() */ +/* For info_win_no_block(..., timeout) */ #define INFO_WIN_WAIT_POS GTK_WIN_POS_CENTER_ON_PARENT -/*#define INFO_WIN_WAIT_POS GTK_WIN_POS_NONE*/ -#define INFO_WIN_WAIT_TIMEOUT 2000 /* in ms */ +#define INFO_WIN_WAIT_TIMEOUT 2000 /* in ms */ + +/* M_S_MOD -> true in multiple selection mode / false otherwise */ +#define M_S_MOD (get_ticker_env()->selection_mode == MULTIPLE) #define CONNECT_FAIL_MAX 5 #define CONNECT_FAIL_TIMEOUT 1 -/* To avoid confusion, we must make sure this value doesn't conflict with - * any other user-defined GTK_RESPONSE_STH (at the moment, only one enum - * in tickr_feedpicker.c.) */ -#define GTK_RESPONSE_CANCEL_CLOSE 100 /* All predefined GTK_RESPONSE_ are < 0 */ - #include #include #include @@ -58,44 +63,52 @@ #include #include #include -#include +#ifndef G_OS_WIN32 +#include +#endif +#include /* Moved here because we need G_OS_WIN32 check early */ #include #ifndef G_OS_WIN32 -# include -# include -# include -# include -# include -# include +# include +# include #else -/* Win version = XP or higher */ -# define WINVER 0x0501 -# define _WIN32_WINNT 0x0501 -# include -# include -# include -# include -# include -# include +# include <../glib-2.0/glib/gstdio.h> #endif #ifndef G_OS_WIN32 -# include +# include +# include +# include +# include +# include +# include #else -# include <../glib-2.0/glib/gstdio.h> +# define WINVER 0x0501 /* Win version = XP (5.1) or higher */ +# define _WIN32_WINNT 0x0501 +# include +# include +# include +# include +# include +# include #endif #include #include -#include "../libetm-0.4.4/libetm.h" -#include "tickr_socket.h" +#include +#include +#include "../libetm-0.5.0/libetm.h" #include "tickr_list.h" +#include "tickr_error.h" +#include "tickr_tls.h" -#define RESOURCE_NONE_QUIT FALSE /* To quit or not if no resource is specified */ -#define OPTION_ERROR_QUIT FALSE /* To quit or not if unknown or invalid option(s) */ +#define RESOURCE_ERROR_SSM_QUIT FALSE /* To quit or not if not found or invalid resource - only in single selection mode */ +#define OPTION_ERROR_QUIT FALSE /* To quit or not if unknown or invalid option(s) */ #define DRWA_WIDTH_MIN 100 #define DRWA_HEIGHT_MIN 10 #define TAB_SIZE 8 #define FILE_NAME_MAXLEN (2 * 1024 - 1) /* Apply to both FULL FILE NAMES and ***URLs*** */ +#define URL_SCHEME_MAXLEN 15 +#define PORT_STR_MAXLEN 15 #define FONT_NAME_MAXLEN 64 #define FONT_SIZE_MAXLEN 3 #define FONT_MAXLEN FONT_NAME_MAXLEN + 1 + FONT_SIZE_MAXLEN @@ -103,21 +116,32 @@ #define OPTION_NAME_MAXLEN 31 #define OPTION_VALUE_MAXLEN MAX(MAX(FILE_NAME_MAXLEN, FONT_MAXLEN), DELIMITER_MAXLEN) #define OPTION_MAXLEN OPTION_NAME_MAXLEN + OPTION_VALUE_MAXLEN + 4 /* -name="value" */ -#define N_OPTION_MAX 128 /* Max number of options */ -#define N_URL_MAX 1024 /* Max number of url's */ -#define NFEEDLINKANDOFFSETMAX 256 /* Max number of "open-able" links per feed */ +#define N_OPTION_MAX 128 /* Max number of options */ +#define N_URL_MAX 1024 /* Max number of URLs */ +#define NFEEDLINKANDOFFSETMAX 999 /* Max number of "open-able" links per feed (3 digits: 001 -> 999) */ #define LINK_TAG_CHAR ((char)(1)) /* char (ascii 01) used internally for item links, removed from feed text */ #define ITEM_TITLE_TAG_CHAR ((char)(2)) /* char (ascii 02) used internally for item titles, --- */ #define ITEM_DES_TAG_CHAR ((char)(3)) /* char (ascii 03) used internally for item descriptions, --- */ +/*#define ENCODING_STR_MAX_LEN 64*/ +/* + * Used in tickr_main.c, tickr_render.c and tickr_feedparser.c + * Confusingly, L to R scrolling (ie reverse) is for languages written/read from R to L + */ +#define REVERSE_SCROLLING (get_params()->reverse_sc == 'y') /* = L to R scrolling for R to L languages*/ +#define STANDARD_SCROLLING (!REVERSE_SCROLLING) /* = R to L scrolling for L to R languages*/ +#define N_RENDER_STR_MAX 256 /* Max number of strings from a stream that can be rendered to cairo surfaces */ #define TMPSTR_SIZE (2 * 1024 - 1) /* Used for most tmp strings - must be large enough */ +#define FGETS_STR_MAXLEN (8 * 1024 * 1024) /* 8 MiB for every fgets() line */ + #ifndef G_OS_WIN32 -# define SEPARATOR_CHAR '/' +# define SEPARATOR_CHAR '/' #else -# define SEPARATOR_CHAR '\\' +# define SEPARATOR_CHAR '\\' #endif + #define FEED_TITLE_MAXLEN 60 -/* 7-bit ascii - of course, the following ones must match */ +/* 7-bit ascii - STH_CHAR and STH_STR ***must*** match */ #define TITLE_TAG_CHAR '>' #define TITLE_TAG_STR ">" #define SELECTED_URL_CHAR '*' @@ -125,18 +149,11 @@ #define UNSELECTED_URL_CHAR '-' #define UNSELECTED_URL_STR "-" -/* Make sure this stuff is robust enough */ -#define XPIXMAP_MAXWIDTH (32 * 1024 - 1) /* 32 K - 1 = max supported width for xpixmaps - * (not 64 k - 1 as sometimes uncorrectly mentioned.) - */ -#define LINE_MAXLEN 128 /* Max length of a single line (see tickr_render.c) */ -#define WORD_MAXLEN 32 /* Max length of a word that won't get cut off */ -#if (LINE_MAXLEN <= WORD_MAXLEN) -# error "LINE_MAXLEN must be > WORD_MAXLEN" -#endif +#define XPIXMAP_MAXWIDTH (32 * 1024 - 1) /* 32 K - 1 = max supported width for X pixmaps + * (not 64 K - 1 as sometimes incorrectly stated) */ #define FONT_MAXSIZE 200 -#define ARBITRARY_TASKBAR_HEIGHT 25 +#define ARBITRARY_TASKBAR_HEIGHT 25 /* Could/should be get from window manager ? */ /* * File names, paths and dirs stuff @@ -146,37 +163,37 @@ * /usr/share/APP_CMD/pixmpas/ * /home//.APP_CMD/ * - * Win32 version: C:\Program files\APP_NAME\ (also location for pixmaps) + * Win32 version: C:\Program Files\APP_NAME\ (also location for pixmaps) * C:\...\Application Data\APP_NAME\ */ #ifndef G_OS_WIN32 -# define TICKR_DIR_NAME "." APP_CMD +# define TICKR_DIR_NAME "." APP_CMD #else -# define TICKR_DIR_NAME APP_NAME +# define TICKR_DIR_NAME APP_NAME #endif #define CONFIG_FILE APP_CMD "-conf" #define URL_LIST_FILE APP_CMD "-url-list" #define RESOURCE_DUMP APP_CMD "-resrc-dump.xml" #define XML_DUMP APP_CMD "-xml-dump" #define XML_DUMP_EXTRA APP_CMD "-xml-dump-extra" -#define TMP1 "tmp1" -#define TMP2 "tmp2" -#ifndef G_OS_WIN32 -# define STD_OUT stdout -# define STD_ERR stderr -#else -# define STD_OUT stdout_fp -# define STDOUT_FILENAME1 "stdout1.txt" -# define STDOUT_FILENAME2 "stdout2.txt" -# define STD_ERR stderr_fp -# define STDERR_FILENAME1 "stderr1.txt" -# define STDERR_FILENAME2 "stderr2.txt" +#define TMP_FILE "tmp" +/*#define MARKED_ITEMS_FILE APP_CMD "-marked-items"*/ +/* + * STD_OUT = stdout on Linux / text file on win32 + * STD_ERR = stderr on Linux / text file on win32 + * (defined in libetm/misc.h) + */ +#ifdef G_OS_WIN32 +# define STDOUT_FILENAME1 "stdout1.txt" +# define STDOUT_FILENAME2 "stdout2.txt" +# define STDERR_FILENAME1 "stderr1.txt" +# define STDERR_FILENAME2 "stderr2.txt" #endif #ifndef G_OS_WIN32 -# define INSTALL_PATH "/usr/share/" APP_CMD -# define IMAGES_PATH INSTALL_PATH "/pixmaps" +# define INSTALL_PATH "/usr/share/" APP_CMD +# define IMAGES_PATH INSTALL_PATH "/pixmaps" #else -# define IMAGES_PATH APP_NAME /* Actually not a path but a dir name */ +# define IMAGES_PATH APP_NAME /* Actually not a path but a dir name */ #endif #define TICKR_ICON APP_CMD "-icon.png" #define TICKR_LOGO APP_CMD "-logo.png" @@ -186,72 +203,80 @@ #define DELAY 8 #define SHIFTSIZE 1 #ifndef G_OS_WIN32 -# define FONTNAME "Sans" +# define FONTNAME "Sans" /* Ubuntu */ #else -# define FONTNAME "Arial Unicode MS" +# define FONTNAME "Arial Unicode MS" #endif -#define FONTSIZE "14" +#define FONTSIZE "12" /* 14 */ #define FGCOLOR "#ffffffff" +/*#define HIGHLIGHTFGCOLOR "#ff0000ff" / Red ???? */ #define BGCOLOR "#40404080" #define SETGRADIENTBG 'y' #define BGCOLOR2 "#20202080" #define DISABLESCREENLIMITS 'n' #define WIN_X 0 #define WIN_Y 0 -/*#define WIN_W 1024 Unused, we use get_ticker_env()->screen_w instead */ -#define WIN_H 0 /* If = 0, determined by font size */ -#define WIN_MAX_Y 5000 -#define WIN_MAX_W 10000 +/*#define WIN_W 1024*/ /* Unused, we use get_ticker_env()->screen_w instead */ +#define WIN_H 0 /* If = 0, determined by font size */ +/* These arbitrary values are supposed to be big enough */ +#define WIN_MAX_X 15000 +#define WIN_MAX_Y 10000 +#define WIN_MAX_W 15000 #define WINDEC 'n' #define ALWAYSONTOP 'n' #ifndef G_OS_WIN32 -# define WINTRANSPARENCY 1.0 +# define WINTRANSPARENCY 1.0 #else -# define WINTRANSPARENCY 0.8 +# define WINTRANSPARENCY 0.8 #endif #define ICONINTASKBAR 'y' #define WINSTICKY 'n' +#define OVERRIDE_REDIRECT 'n' #define SHADOW 'y' #define SHADOWOFFSET_X 4 #define SHADOWOFFSET_Y 2 #define SHADOWFX 2 #define LINEDELIMITER " " -#define CUTLINEDELIMITER "..." LINEDELIMITER #define SPECIALCHARS 'n' #define NEWPG '`' #define TABCH '~' #define RSSREFRESH 15 +#define REVERSESCROLLING 'n' #define FEEDTITLE 'n' #define FEEDTITLEDELIMITER " " #define ITEMTITLE 'y' #define ITEMTITLEDELIMITER " | " #define ITEMDESCRIPTION 'n' -#define ITEMDESCRIPTIONDELIMITER " *** " +#define ITEMDESCRIPTIONDELIMITER " *** " #define NITEMSPERFEED 5 +/*#define MARKITEMACTION 'c'*/ #define STRIPHTMLTAGS 'y' #define UPPERCASETEXT 'n' -#define HOMEFEED "http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml" +#define HOMEFEED "http://rss.cnn.com/rss/edition.rss" #ifndef G_OS_WIN32 -# define OPENLINKCMD "firefox" /* Firefox on Linux */ +# define OPENLINKCMD "x-www-browser"/*"sensible-browser"*/ /* Get default browser on Linux */ #else -# define OPENLINKCMD "" +# define OPENLINKCMD "" #endif #define OPENLINKARGS "" #define CLOCK 'n' +#define CLOCKSEC 'n' +#define CLOCK12H 'y' +#define CLOCKDATE 'n' #define CFONTNAME FONTNAME -#define CFONTSIZE "12" +#define CFONTSIZE FONTSIZE #define CFGCOLOR FGCOLOR #define CBGCOLOR BGCOLOR -#define SETCLOCKGRADIENTBG 'y' +#define SETCLOCKGRADIENTBG SETGRADIENTBG #define CBGCOLOR2 BGCOLOR2 #define DISABLEPOPUPS 'n' #define PAUSEONMOUSEOVER 'y' #define DISABLELEFTCLICK 'n' -#define MOUSEWHEELSCROLL 'f' +#define MOUSEWHEELACTION 'f' #ifndef G_OS_WIN32 -# define SFPICKERCLOSESWHENPOINTERLEAVES 'y' +# define SFEEDPICKERAUTOCLOSE 'y' #else -# define SFPICKERCLOSESWHENPOINTERLEAVES 'n' +# define SFEEDPICKERAUTOCLOSE 'n' #endif #define ENABLEFEEDORDERING 'n' #define USEAUTHENTICATION 'n' @@ -261,11 +286,8 @@ #define PROXYPORT "8080" #define USEPROXYAUTHENTICATION 'n' #define PROXYUSER "" - -/* Global pseudo stdout and stderr on win32 */ -#ifdef G_OS_WIN32 -extern FILE *stdout_fp, *stderr_fp; -#endif +#define CONNECT_TIMEOUT 5 +#define SENDRECV_TIMEOUT 1 /* typedef enum's */ typedef enum { @@ -276,13 +298,13 @@ typedef enum { RESRC_TYPE_UNDETERMINED, RESRC_UNSPECIFIED, - RESRC_URL, /* Will be fetched and xml-parsed */ - RESRC_FILE /* Will be processed as non-xml text file */ + RESRC_URL, /* Will be fetched and 'xml-parsed' */ + RESRC_FILE /* Will be processed as non-xml text file */ } _resrc_type; typedef enum { RSS_FORMAT_UNDETERMINED, - RSS_1_0, /* Should use RDF or RSS_RDF instead ? */ + RSS_1_0, /* Should use RDF or RSS_RDF instead ? */ RSS_2_0, RSS_ATOM } _rss_format; @@ -299,11 +321,6 @@ } info_type; typedef enum { - WIN_WITH_SPINNER_OPEN, - WIN_WITH_SPINNER_CLOSE -} win_with_spinner_mode; - -typedef enum { WIN_WITH_PROGRESS_BAR_OPEN, WIN_WITH_PROGRESS_BAR_PULSE, WIN_WITH_PROGRESS_BAR_CLOSE @@ -314,50 +331,78 @@ PROXY_PAGE } connection_settings_page; +/* Predefined GTK_RESPONSE_ are < 0, those ones are app level defined and >= 0 (>= 100 actually) */ +typedef enum { + GTK_RESPONSE_CANCEL_CLOSE = 100, + + /* tickr_feedpicker.c */ + GTK_RESPONSE_SELECT_ALL, GTK_RESPONSE_UNSELECT_ALL, GTK_RESPONSE_CLEAR_RANKING, GTK_RESPONSE_TOP, + GTK_RESPONSE_CURRENT, GTK_RESPONSE_HOME, GTK_RESPONSE_REMOVE, GTK_RESPONSE_ADD_UPD, GTK_RESPONSE_SINGLE, + GTK_RESPONSE_SELECTION, + + /* tickr_prefwin.c */ + GTK_RESPONSE_RESET, GTK_RESPONSE_FULL_SETTINGS, GTK_RESPONSE_CONN_SETTINGS +} gtk_custom_response; + +typedef enum { + /* tickr_main.c and tickr_prefwin.c */ + DO_NEXT_NOTHING, + DO_NEXT_REOPEN, + DO_NEXT_OPEN_FULL_SETTINGS, + DO_NEXT_OPEN_CONN_SETTINGS +} next_action; + /* typedef struct's */ -/* Usefull graphical (and other) ticker 'environment' values */ +/* Useful graphical (and other) ticker 'environment' values */ typedef struct { GdkScreen *screen; /* GDK screen for win */ GdkVisual *visual; - gint screen_w, screen_h; /* Screen width & height */ - gint depth; /* Screen depth */ + int screen_w, screen_h; /* Screen width & height */ + int depth; /* Screen depth */ GtkWidget *win; /* Top level window */ - GtkWidget *drw_a, *drwa_clock; /* Drawing areas (main / clock) */ - gint drwa_width, drwa_height; /* Main drawing area dimensions */ - gint drwa_clock_width; /* Clock drawing area width */ + GtkWidget *drw_a, *drwa_clock; /* Drawing areas (main/clock) */ + int drwa_width, drwa_height; /* Main drawing area dimensions */ + int drwa_clock_width; /* Clock drawing area width */ cairo_surface_t *c_surf; /* Cairo image surface onto which text is rendered */ - gint surf_width, surf_height; /* Cairo image surface dimensions */ + int surf_width, surf_height; /* Cairo image surface dimensions */ + int shift_counter; char active_link[FILE_NAME_MAXLEN + 1]; int mouse_x_in_drwa; /* These flags are checked (mainly) by shift2left_callback() */ - gboolean suspend_rq; /* Request for doing nothing */ - gboolean compute_rq; /* Request for (re)computing everything (surface and win) */ - gboolean reload_rq; /* Request for (re)loading resource */ - _selection_mode selection_mode; /* default = MULTIPLE, set to SINGLE internally if selection - * is unavalaible/empty or after picking a single feed */ - gboolean stream_fully_read; /* Set/checked only in render_stream_to_surface() and - * shift2left_callback() */ + zboolean suspend_rq; /* Request for doing nothing */ + zboolean compute_rq; /* Request for (re)computing everything (surface and win) */ + zboolean reload_rq; /* Request for (re)loading resource */ + _selection_mode selection_mode; /* default = MULTIPLE, set to SINGLE internally if resource + * is a command line argument or if selection is unavailable/empty + * or after explicitely picking a single feed */ + zboolean feed_fully_rendered; /* Used when a stream is rendered to several cairo surfaces, + * set/checked only in render_stream_to_surface(), stream_to_htext() + * and shift2left_callback() */ + zboolean https_support; } TickerEnv; typedef struct { char url[FILE_NAME_MAXLEN + 1]; - gint offset_in_surface; + int offset_in_surface; +/* TODO: check/complete this + char item_title[FILE_NAME_MAXLEN + 1]; + char GUUI[FILE_NAME_MAXLEN + 1];*/ } FeedLinkAndOffset; typedef struct { - _resrc_type type; /* Text file or url */ - _rss_format format; /* RSS 1.0, RSS 2.0, or Atom */ - char id[FILE_NAME_MAXLEN + 1]; /* Local = file name or remote = feed url */ - /* Apply only to url/rss */ - _rss_format rss_format; + _resrc_type type; /* URL (including local URL) or text file */ + char id[FILE_NAME_MAXLEN + 1]; /* URL (including local URL) or full path/file name */ + char orig_url[FILE_NAME_MAXLEN + 1]; /* In case of HTTP redirects */ + /* Apply only to URL/RSS */ + _rss_format format; /* RSS 1.0, RSS 2.0, or Atom */ char feed_title[FEED_TITLE_MAXLEN + 1]; - char resrc_dump[FILE_NAME_MAXLEN + 1]; /* Downloaded file/resource */ - char xml_dump[FILE_NAME_MAXLEN + 1]; - FILE *fp; /* File to be read (from xmldump) after some processing */ + char resrc_dump[FILE_NAME_MAXLEN + 1]; /* Downloaded resource (= text file) */ + char xml_dump[FILE_NAME_MAXLEN + 1]; /* Output of XML/RSS processing of downloaded resource */ + FILE *fp; /* Stream to be read (xml_dump = file name) */ FeedLinkAndOffset link_and_offset[NFEEDLINKANDOFFSETMAX]; char xml_dump_extra[FILE_NAME_MAXLEN + 1]; - FILE *fp_extra; /* File with extra info: item titles (or des) generated - * when ticker displays only des (or titles) */ + FILE *fp_extra; /* Stream with extra info: item titles (/ descriptions) generated + * when ticker displays only descriptions (/ titles) */ int rss_ttl; } Resource; @@ -365,23 +410,23 @@ #define PSW_MAXLEN 63 #define AUTH_STR_MAXLEN 127 -/* TODO: Do we need both these auth/proxy structs and auth/proxy params? redundant - check this out */ +/* TODO: Do we need both these auth/proxy structs and auth/proxy params ? redundant - check this out */ typedef struct { - gboolean use_authentication; + zboolean use_authentication; char user[USER_MAXLEN + 1]; char psw[PSW_MAXLEN + 1]; char auth_str[AUTH_STR_MAXLEN + 1]; } Authentication; #define PROXY_HOST_MAXLEN 127 -#define PROXY_PORT_MAXLEN 15 +#define PROXY_PORT_MAXLEN PORT_STR_MAXLEN #define PROXY_USER_MAXLEN 63 #define PROXY_PSW_MAXLEN 63 #define PROXY_AUTH_STR_MAXLEN 127 #define PROXY_STR_MAXLEN 255 typedef struct { - gboolean use_proxy; + zboolean use_proxy; char host[PROXY_HOST_MAXLEN + 1]; char port[PROXY_PORT_MAXLEN + 1]; char proxy_str[PROXY_STR_MAXLEN + 1]; @@ -394,48 +439,58 @@ typedef struct { int delay; int shift_size; - char font_n_s[FONT_MAXLEN + 1]; + char font_name_size[FONT_MAXLEN + 1]; GdkColor fg_color; guint16 fg_color_alpha; + /*GdkColor highlight_fg_color; + guint16 highlight_fg_color_alpha;*/ GdkColor bg_color; guint16 bg_color_alpha; char set_gradient_bg; GdkColor bg_color2; guint16 bg_color2_alpha; char disable_screen_limits; - gint win_x; - gint win_y; - gint win_w; - gint win_h; + int win_x; + int win_y; + int win_w; + int win_h; char windec; char always_on_top; - gdouble win_transparency; /* 0.1 -> 1.0 */ + double win_transparency; /* 0.1 -> 1.0 */ char icon_in_taskbar; char win_sticky; + char override_redirect; char shadow; int shadow_offset_x; int shadow_offset_y; int shadow_fx; char line_delimiter[DELIMITER_MAXLEN + 1]; - char cutline_delimiter[DELIMITER_MAXLEN + 1]; char special_chars; char new_page_char; char tab_char; int rss_refresh; + char reverse_sc; /* Reverse scrolling (= L to R) */ char feed_title; char feed_title_delimiter[DELIMITER_MAXLEN + 1]; char item_title; char item_title_delimiter[DELIMITER_MAXLEN + 1]; char item_description; char item_description_delimiter[DELIMITER_MAXLEN + 1]; + /* POSSIBLE NEW FEATURE + char feed_delimiter[DELIMITER_MAXLEN + 1];*/ + /* (until here) */ int n_items_per_feed; + /*char mark_item_action; / (h) hide / c (color = highlight) / n (none) */ char strip_html_tags; char upper_case_text; char homefeed[FILE_NAME_MAXLEN + 1]; char open_link_cmd[FILE_NAME_MAXLEN + 1]; char open_link_args[FILE_NAME_MAXLEN + 1]; char clock; - char clock_font_n_s[FONT_MAXLEN + 1]; + char clock_sec; + char clock_12h; + char clock_date; + char clock_font_name_size[FONT_MAXLEN + 1]; GdkColor clock_fg_color; guint16 clock_fg_color_alpha; GdkColor clock_bg_color; @@ -446,10 +501,11 @@ char disable_popups; char pause_on_mouseover; char disable_leftclick; - char mouse_wheel_scroll; /* Apply to s (speed) / f (feed) / n (none) */ - char sfpicker_closes_when_pointer_leaves; + char mouse_wheel_action; /* Acts on s (speed) / f (feed) / n (none) */ + char sfeedpicker_autoclose; char enable_feed_ordering; -/* TODO: Do we need both these auth/proxy structs and auth/proxy params? redundant - check this out */ + /*char alt_encoding[ENCODING_STR_MAX_LEN + 1];*/ +/* TODO: Do we need both these auth/proxy structs and auth/proxy params ? redundant - check this out */ char use_authentication; char user[USER_MAXLEN + 1]; char use_proxy; @@ -457,84 +513,11 @@ char proxy_port[PROXY_PORT_MAXLEN + 1]; char use_proxy_authentication; char proxy_user[PROXY_USER_MAXLEN + 1]; + int connect_timeout; + int send_recv_timeout; } Params; -/* Error codes */ -typedef enum { - OK = SOCKET_LASTERRORCODE + 1, - - RESOURCE_ERROR, - RESOURCE_UNSPECIFIED, - RESOURCE_NOT_FOUND, - RESOURCE_INVALID, - RESOURCE_FORMAT_ERROR, - RESOURCE_NONE, - - OPTION_ERROR, - OPTION_TOO_MANY, - OPTION_INVALID, - OPTION_UNKNOWN, - OPTION_VALUE_INVALID, - - SELECTION_ERROR, - SELECTION_EMPTY, - - FEED_ERROR, - FEED_EMPTY, - FEED_UNPARSABLE, - FEED_NO_ITEM_OR_ENTRY_ELEMENT, - FEED_DOWNLOAD_ERROR, - FEED_FORMAT_ERROR, - - RENDER_ERROR, - RENDER_NO_RESOURCE, - RENDER_NULL_ENDINGSTR, - RENDER_GETLINE_ERROR, - RENDER_LINE_TOO_LONG, - RENDER_CAIRO_IMAGE_SURFACE_TOO_WIDE, - RENDER_CREATE_CAIRO_IMAGE_SURFACE_ERROR, - RENDER_OTHER_ERROR, - - SHIFT2LEFT_NULL_CAIRO_IMAGE_SURFACE, - - FLIST_ERROR, - LOAD_URL_LIST_ERROR, - LOAD_URL_LIST_EMPTY_LIST, - SAVE_URL_LIST_ERROR, - - CREATE_FILE_ERROR, - OPEN_FILE_ERROR, - - XML_ERROR, - XML_UNPARSABLE, - XML_EMPTY, - - OPML_ERROR, - - CONNECT_TOO_MANY_ERRORS, - - HTTP_ERROR, - HTTP_UNSUPPORTED_SCHEME, - HTTP_NO_AUTH_CREDENTIALS, - HTTP_NO_PROXY_AUTH_CREDENTIALS, - - /* http status codes */ - HTTP_CONTINUE, - HTTP_SWITCH_PROTO, - HTTP_MOVED, - HTTP_USE_PROXY, - HTTP_UNAUTHORIZED, - HTTP_BAD_REQUEST, - HTTP_FORBIDDEN, - HTTP_NOT_FOUND, - HTTP_PROXY_AUTH_REQUIRED, - HTTP_INT_SERVER_ERROR, - HTTP_NO_STATUS_CODE, - HTTP_TOO_MANY_REDIRECTS, - - WIN32V_ERROR -} tickr_error_code; - +/* Headers files for most source files are below */ /* tickr_main.c */ TickerEnv *get_ticker_env(); Resource *get_resource(); @@ -544,21 +527,25 @@ void set_feed_selection(FList *); Params *get_params(); int get_instance_id(); -void check_main_win_always_on_top(); char *get_feed_extra_info(int); -/*gboolean params_have_been_changed(Params *, int);*/ -gboolean win_params_have_been_changed(Params *, int); -void update_pixmap_from_opened_stream(); +int easily_link_with_browser(); +void check_main_win_always_on_top(); +zboolean win_params_have_been_changed(Params *, int); +void free_all(); +void quit_with_cli_info(tickr_error_code); /* tickr_resource.c */ int build_feed_selection_from_feed_list(); void current_feed(); void first_feed(); void last_feed(); -gboolean previous_feed(); -gboolean next_feed(); -int load_resource(Resource *, FList *); +zboolean previous_feed(); +zboolean next_feed(); +int load_resource_from_selection(Resource *, FList *); int format_resource(Resource *, const char *); +char *format_resource_str(char *); +char *convert_str_to_utf8(const char *, const char *); +int get_stream_contents(FILE *, char **, zboolean); void set_tickr_icon_to_dialog(GtkWindow *); FILE *open_new_datafile_with_name(const char *, const char *); char *get_datafile_full_name_from_name(const char *); @@ -568,16 +555,18 @@ #ifdef G_OS_WIN32 const char *get_appdata_dir_utf8(); #endif +const char *get_sample_url_list_full_name(); /* tickr_render.c */ +void init_render_string_array(); +void free_all_render_strings_in_array(); +/*RenderStringArray *get_render_str_array();*/ +int get_links_extra_offset(); cairo_surface_t *render_stream_to_surface(FILE *, FeedLinkAndOffset *, const Params *, int *); -char *stream_to_htext(FILE *, char *, PangoLayout *, const Params *, int *); -char *void_stream_to_htext(char *, PangoLayout *); -int get_fsize_from_layout_height(gint, const char *); -gint get_layout_height_from_fnamesize(const char *); -gint get_layout_width(PangoLayout *, const char *); -gint get_layout_height(PangoLayout *, const char *); -void pango_layout_get_pixel_size2(PangoLayout *, int *, int *); +int get_font_size_from_layout_height(int, const char *); +int get_layout_height_from_font_name_size(const char *); +char spinning_shape(); +void show_str_beginning_and_end(char *); /* tickr_params.c */ void set_default_options(Params *); @@ -587,51 +576,62 @@ void save_to_config_file(const Params *); int get_gdk_color_from_hexstr(const char *, GdkColor *, guint16 *); const char *get_hexstr_from_gdk_color(const GdkColor *, const guint16 *); +void adjust_font_size_to_rq_height(char *, int); +int get_font_size_from_font_name_size(const char *); void split_font(const char *, char *, char *); void compact_font(char *, const char *, const char *); /* tickr_clock.c */ void display_time(const Params *); -gint get_clock_width(const Params *); +int get_clock_width(const Params *); /* tickr_feedparser.c */ int get_feed(Resource *, const Params *); -int parse_xml_file(int, FILE *, FILE *, const char *, FeedLinkAndOffset *link_and_offset,\ +int parse_xml_file(int, const char *, FeedLinkAndOffset *link_and_offset, const Params *); void get_rss20_selected_elements1(xmlNode *, xmlDoc *); void get_rss10_selected_elements1(xmlNode *, xmlDoc *); void get_atom_selected_elements1(xmlNode *, xmlDoc *); -void get_feed_selected_elements2(int, xmlNode *, xmlDoc *, FILE *, FILE *,\ +void get_feed_selected_elements2(int, xmlNode *, xmlDoc *, FeedLinkAndOffset *link_and_offset, const Params *prm); int get_feed_info(int *, const char *, char *, char *, char *); void get_xml_first_element(xmlNode *, xmlDoc *, char *, char *, int); +char *log2vis_utf8(const char *); /* tickr_feedpicker.c */ void highlight_and_go_to_row(GtkTreeView *, GtkTreeSelection *, int); -void get_new_url(Resource *); +void manage_list_and_selection(Resource *); /* tickr_prefwin.c */ -int modify_params(Params *); +next_action easily_modify_params(Params *); +next_action modify_params(Params *); /* tickr_otherwins.c */ -gint esc_key_pressed(GtkWidget *, GdkEventKey *); +int esc_key_pressed(GtkWidget *, GdkEventKey *); void force_quit_dialog(GtkWidget *); -void open_new_txt_file(Resource *resrc); +void open_txt_file(Resource *resrc); +void show_resource_info(Resource *resrc); void help_win(); void about_win(); -void info_win(const char *, const char *, info_type, gboolean); -void info_win_wait(const char *, int); -int question_win(const char *); -int question_win_at(const char *, int); -void win_with_spinner(win_with_spinner_mode, const char *); +void info_win(const char *, const char *, info_type, zboolean); +void minimalistic_info_win(const char *, const char *); +void info_win_no_block(const char *, int); +int question_win(const char *, int); +int question_win_at(const char *, int, int); +/*void win_with_spinner(win_with_spinner_mode, const char *);*/ void win_with_progress_bar(win_with_progress_bar_mode, const char *); +#ifndef G_OS_WIN32 +void nanosleep2(long); +#endif /* tickr_misc.c */ void import_params(); void export_params(); +void open_url_in_browser(char *); void online_help(); -void warning(gboolean, int, ...); +void go_to_paypal(); void dump_font_list(); +void dump_config(); /* tickr_hlptxt.c */ const char **get_help_str0(); @@ -640,51 +640,44 @@ const char *get_license_str2(); /* tickr_ompl.c */ -void import_opml_file(); -char *pick_opml_file(); -int parse_opml_xml_file(const char *); -void get_opml_selected_element(xmlNode *, const char *, const char *); +int import_opml_file(); void export_opml_file(); -char *create_opml_str_from_feed_list_node(FList *); -int save_str_as_opml_file(const char *); /* tickr_http.c */ void remove_chunk_info(char **); int connect_with_url(sockt *, char *); int fetch_resource(const char *, const char *, char *); -const char *build_http_request(const char *, const char *, const char *,\ +const char *build_http_request(const char *, const char *, const char *, const char *); -int get_http_response(sockt, const char *, const char *, const char *,\ +int get_http_response(sockt, const char *, const char *, const char *, char **, char **, int *); int get_http_status_code(const char *); const char *get_http_header_value(const char *, const char *); int go_after_next_cr_lf(const char *); int go_after_next_empty_line(const char *); int get_http_chunk_size(const char *); -const char *get_scheme_from_url(const char*); -const char *get_host_from_url(const char*); -const char *get_path_from_url(const char*); - -/* tickr_socket.c */ -/* Proto moved into tickr_socket.h */ +const char *get_scheme_from_url(const char *); +const char *get_host_and_port_from_url(const char *, char *); +zboolean port_num_is_valid(const char *); +const char *get_path_from_url(const char *); /* tickr_connectwin.c */ void init_authentication(); void init_proxy(); void compute_auth_and_proxy_str(); -gint connection_settings(connection_settings_page); -gboolean get_use_authentication(); -void set_use_authentication(gboolean); +int connection_settings(connection_settings_page); +void set_use_authentication(zboolean); +zboolean get_use_authentication(); char *get_http_auth_user(); char *get_http_auth_psw(); char *get_http_auth_str(); -gboolean get_use_proxy(); -void set_use_proxy(gboolean); +void set_use_proxy(zboolean); +zboolean get_use_proxy(); char *get_proxy_host(); char *get_proxy_port(); char *get_proxy_str(); -gboolean get_use_proxy_auth(); -void set_use_proxy_auth(gboolean); +void set_use_proxy_auth(zboolean); +zboolean get_use_proxy_auth(); char *get_proxy_auth_user(); char *get_proxy_auth_psw(); char *get_proxy_auth_str(); diff -Nru tickr-0.6.4/src/tickr/tickr_helptext.c tickr-0.7.0/src/tickr/tickr_helptext.c --- tickr-0.6.4/src/tickr/tickr_helptext.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_helptext.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -19,79 +19,84 @@ #include "tickr.h" static const char *help_str0[] = { -"USER INTERFACE MAIN FEATURES:\n\n", + "USER INTERFACE MAIN FEATURES:\n\n", -"- To open the main menu, right-click inside ticker area.\n\n", + "- To open the main menu, right-click inside " APP_NAME " area.\n\n", -"- You can import feed subscriptions with 'File > Import Feed List (OPML)',\n", -"for instance your Google Reader subscriptions.\n\n", + "- You can import feed subscriptions with 'File > Import Feed List (OPML)',\n", + " for instance your Google Reader subscriptions.\n\n", -"- To open a link in your browser, left-click on text.\n\n", + "- To open a link in your browser, left-click on text.\n\n", -"- Use mouse wheel to either adjust the ticker scrolling speed or open the\n", -"'Selected Feed Picker' window to quickly move between selected feeds (if set,\n", -"Ctrl + mouse wheel scrolling applies to other value.)\n", -"This behaviour is set in the 'Preferences' window as 'Mouse wheel scrolling\n", -"applies to'.\n\n", + "- Use mouse wheel to either adjust " APP_NAME " scrolling speed or open the\n", + " 'Selected Feed Picker' window to quickly move between selected feeds (use\n", + " + mouse wheel for alternative action.) This behaviour is set in\n", + " the 'Preferences' window as 'Mouse Wheel acts on'.\n\n", -"- Basically, you will use 'File > Open RSS Feed' to choose a feed from a\n", -"list, subscribe to a new one, manage your feed list, and 'Edit > Preferences'\n", -"to tweak the ticker appearance as well as other settings.\n\n", + "- Basically, you will use 'File > Feed Organizer (RSS|Atom)' to manage your\n", + " feed list, select feeds, subscribe to new ones, and 'Edit > Preferences'\n", + " to tweak " APP_NAME " appearance as well as other settings.\n\n", -"- 'Window - always on top' -> check this if you want the ticker to always\n", -"stay above your browser (and any other windows.)\n\n", + "- 'Window - always on top' -> check this if you want " APP_NAME " to always stay\n", + " above your browser (and any other windows.)\n\n", -"- 'Window - decorated' -> if you want a 'draggable' ticker.\n\n", + "- 'Window - decorated' -> if you want " APP_NAME " to be'draggable'.\n\n", -"There is a sample list of already subscribed feeds that you can use.\n\n", + "If you don't import any feed list, there is a sample one that you can use.\n\n", -"***ONLY*** in case you're using the ticker inside a ***decorated*** window,\n", -"you can use these keyboard shortcuts:\n\n", + "ONLY in case you're using " APP_NAME " inside a ***decorated*** window, you can\n", + "use these keyboard shortcuts:\n\n", -"- R to open the 'RSS Feed Picker' window (to choose a feed or to\n", -"subscribe to a new one.)\n\n", + "- R to open the 'Feed Organizer (RSS|Atom)' window.\n\n", -"- T to open a text file.\n\n", + "- T to open a text file.\n\n", -"- I to import (and merge) an URL list from an OPML file.\n\n", + "- I to import (and merge) an URL list from an OPML file.\n\n", -"- E to export the URL list to an OPML file.\n\n", + "- E to export the URL list to an OPML file.\n\n", -"- P to open the 'Resource Properties' window.\n\n", + "- P to open the 'Resource Properties' window.\n\n", -"- Q to quit.\n\n", + "- Q to quit.\n\n", -"- S to open the 'Preferences' (Settings) window.\n\n", + "- S to open the 'Preferences' window.\n\n", -"- B to open the link displayed inside the ticker (in the middle.)\n\n", + "- B to open the link displayed inside " APP_NAME " (middle area.)\n\n", -"- J to play the feed / K to pause / L to reload.\n\n", + "- J to play / K to pause / L to reload (current feed).\n\n", -"- U (speed Up) / D (speed Down) to adjust tscrolling speed on\n", -"the fly.\n\n", + "- U (speed Up) / D (speed Down) to adjust scrolling speed on\n", + " the fly.\n\n", -"- F1 to open the 'Quick Help' window.\n\n", + "- F1 to open the 'Quick Help' window.\n\n", -"- H to launch the 'Online Help' (this very page.)\n\n", + "- H to launch the 'Online Help' (this very page.)\n\n", -"- A to open the 'About' window and the License window.\n\n\n", + "- A to open the 'About' window.\n\n\n", -"COMMAND LINE REFERENCE:\n\n", + "COMMAND LINE REFERENCE ('tickr -help' output):\n\n", -NULL}; + NULL +}; static const char *help_str1[] = { - APP_NAME "-" APP_VERSION_NUMBER " - GTK-based highly graphically-customizable Feed Ticker\n", - "Copyright (C) 2009-2013 Emmanuel Thomas-Maurin \n\n", + APP_NAME "-" APP_V_NUM " - GTK-based highly graphically-customizable Feed Ticker\n", + COPYRIGHT_STR " <" SUPPORT_EMAIL_ADDR ">\n\n", APP_NAME " is a GTK-based RSS/Atom Reader that displays feeds as a smooth\n" "scrolling line on your Desktop, as known from TV stations. Open feed\n" "links in your favourite Browser. Graphics are highly customizable.\n\n" "Usage:\n", - " " APP_CMD " [-help/-version/-license/-instance-id=n/-no-ui/-dumpfontlist]\n", - " [options (-name[=value])...] [resource (file name or URL)]\n\n", + " " APP_CMD " [-help, -h, -? / -version, - v / -license, -l]\n", + " [-dumpconfig / -dumpfontlist / -dumperrorcodes]\n", + " [-instance-id=n / -no-ui]\n", + " [options (-name[=value])...]\n", + " [resource (URL or file name)]\n\n", " help Get this help page\n\n", " version Print out version number\n\n", " license Print out license\n\n", + " dumpconfig Send content of config file to stdout\n\n", + " dumpfontlist Send list of available fonts to stdout\n\n", + " dumperrorcodes Send error codes and strings to stdout\n\n", " instance-id=n n = 1 to 99 - Use this when launching\n", " several instances simultaneously, each\n", " instance using its own config and dump\n", @@ -99,19 +104,23 @@ " be the 1st argument)\n\n", " no-ui Disable opening of UI elements which can\n", " modify settings and/or URL list/\n", - " selection\n\n", - " dumpfontlist Send list of available fonts to stdout\n\n", + " selection (to be effective, no-ui must\n", + " be the 1st or 2nd argument)\n\n", "Options:\n", - " delay=n Delay in milliseconds\n\n", - " shiftsize=n Shift size in pixels\n\n", + " delay=n Delay in milliseconds\n", + " (-> speed = K / delay)\n\n", + " shiftsize=n Shift size in pixels\n", + " (-> speed = K x shift size)\n\n", " fgcolor=#rrggbbaa Foreground 32-bit hexa color\n\n", + /*" highlightfgcolor=#rrggbbaa Marked items foreground 32-bit hexa\n", + " color\n\n",*/ " bgcolor=#rrggbbaa Background 32-bit hexa color\n\n", " setgradientbg=[y/n] Set gradient background\n\n", " bgcolor2=#rrggbbaa Background 32-bit hexa color2\n\n", " fontname='str' Font name\n\n", - " fontsize=n Font size (can't be > 200)\n\n", /* check this is up to date */ - " disablescreenlimits=[y/n] Allow win_y and win_w to be greater than\n" - " screen dimensions\n\n", + " fontsize=n Font size (can't be > 200)\n\n", /* Check this is up to date */ + " disablescreenlimits=[y/n] Allow win_x, win_y and win_w to be\n" + " greater than screen dimensions\n\n", " win_x=n Window position - x\n\n", " win_y=n Window position - y\n\n", " win_w=n Window width\n\n", @@ -122,19 +131,29 @@ " (0 = none -> 10 = full)\n\n", " iconintaskbar=[y/n] Icon in taskbar\n\n", " winsticky=[y/n] Visible on all user desktops\n\n", + " overrideredirect=[y/n] Set top window override_redirect flag,\n", + " ie bypass window manager (experimental)\n\n", " shadow=[y/n] Apply shadow to text\n\n", " shadowoffset_x=n Shadow x offset in pixels\n\n", " shadowoffset_y=n Shadow y offset in pixels\n\n", " shadowfx=n Shadow effect (0 = none -> 10 = full)\n\n", " linedelimiter='str' String to be appended at end of line\n\n", - " cutlinedelimiter='str' String to be appended after a cut line\n\n", " specialchars=[y/n] Enable or disable special characters.\n", " This is only useful when resource is a\n", " file, not an URL\n\n", " newpgchar=c 'New page' special character\n\n", " tabchar=c 'Tab' (8 spaces) special character\n\n", - " rssrefresh=n Refresh rate in minutes (if no TTL\n", - " inside feed / always applies for files)\n\n", + " rssrefresh=n Refresh rate in minutes = delay before\n", + " reloading resource (URL or text file.)\n", + " 0 = never force reload. Otherwise, apply\n", + " only if no TTL inside feed or if\n", + " resource is text file.\n", + " (Actually, in multiple selections mode,\n", + " all feeds are always reloaded\n", + " sequentially, because there is no\n", + " caching involved)\n\n", + " revsc=[y/n] Reverse scrolling (= L to R), for\n", + " languages written/read from R to L\n\n", " feedtitle=[y/n] Show or hide feed title\n\n", " feedtitledelimiter='str' String to be appended after feed title\n\n", " itemtitle=[y/n] Show or hide item title\n\n", @@ -142,7 +161,8 @@ " itemdescription=[y/n] Show or hide item description\n\n", " itemdescriptiondelimiter='str' String to be appended after item\n", " description\n\n", - " nitemsperfeed=n Read N items max per feed\n\n", + " nitemsperfeed=n Read N items max per feed (0 = no limit)\n\n", + /*" markitemaction=[h/c/n] Mark item action: hide / color / none\n\n",*/ " rmtags=[y/n] Strip html tags\n\n", " uppercasetext=[y/n] Set all text to upper case\n\n", " homefeed='str' Set URL as 'homefeed' = homepage\n", @@ -154,23 +174,25 @@ " invoke your favourite browser\n\n", " openlinkargs='str' 'Open in Browser' optional arguments\n\n", " clock=[l/r/n] Clock location: left / right / none\n\n", + " clocksec=[y/n] Show seconds\n\n", + " clock12h=[y/n] 12h time format\n\n", + " clockdate=[y/n] Show date\n\n", " clockfontname='str' Clock font name\n\n", - " clockfontsize=n Clock font size (can't be > ticker\n", + " clockfontsize=n Clock font size (can't be > " APP_NAME "\n", " height)\n\n", " clockfgcolor=#rrggbbaa Clock foreground 32-bit hexa color\n\n", " clockbgcolor=#rrggbbaa Clock background 32-bit hexa color\n\n", " setclockgradientbg=[y/n] Set clock gradient background\n\n", " clockbgcolor2=#rrggbbaa Clock background 32-bit hexa color2\n\n", " disablepopups=[y/n] Disable error/warning popup windows\n\n", - " pauseonmouseover=[y/n] Pause ticker on mouseover\n\n", + " pauseonmouseover=[y/n] Pause " APP_NAME " on mouseover\n\n", " disableleftclick=[y/n] Disable left-click\n\n", - " mousewheelscroll=[s/f/n] Mouse wheel scrolling applies to:\n", - " (ticker-)speed / feed(-in-list) / none\n", - " (if set, Ctrl + mouse wheel scrolling\n", - " applies to other value)\n\n", - " sfpickercloseswhenpointerleaves=[y/n]\n", - " Selected feed picker closes when pointer\n", - " leaves\n\n", + " mousewheelaction=[s/f/n] Mouse wheel acts on:\n", + " (" APP_NAME "-)speed / feed(-in-list) / none\n", + " (use + mouse wheel for\n", + " alternative action)\n\n", + " sfeedpickerautoclose=[y/n] Selected feed picker window closes when\n", + " pointer leaves area \n\n", " enablefeedordering=[y/n] Enable feed re-ordering (by user)\n\n", " useauth=[y/n] Use HTTP basic authentication\n\n", " user='str' User\n\n", @@ -181,18 +203,28 @@ " useproxyauth=[y/n] Use proxy authentication\n\n", " proxyuser='str' Proxy user\n\n", " proxypsw='str' Proxy password (never saved)\n\n", + " connect-timeout=n n = 1 to 60 (seconds) - Override default\n", + " connect timeout value (= 5 seconds),\n", /* Check this is up to date */ + " useful if proxy or slow internet link\n\n", + " sendrecv-timeout=n Same as above for send/recv timeout\n", + " (default value = 1 second)\n\n", /* Check this is up to date */ "Mouse usage:\n" - " To open the main menu, right-click inside ticker area.\n\n", + " To open the main menu, right-click inside " APP_NAME " area.\n\n", " You can import feed subscriptions from another feed reader with\n", " 'File > Import Feed List (OPML)'.\n\n", " To open a link in your browser, left-click on text.\n\n", - " Use mouse wheel to either adjust ticker scrolling speed or open the\n", + " Use mouse wheel to either adjust " APP_NAME " scrolling speed or open the\n", " 'Selected Feed Picker' window to quickly move between selected feeds\n", - " (and use Ctrl + mouse wheel for the other option.)\n\n", - "The default browser is Firefox on Linux. You may change this setting to your\n", - "favourite one in the Preferences window.\n\n", + " (use + mouse wheel for alternative action.)\n\n", + "Local resources:\n", + " file:///path/file_name is considered an URL and will be XML-parsed, ie\n", + " a RSS or Atom format is expected.\n\n", + " /path/file_name will be processed as a non-XML text file, ie the file\n", + " will be read 'as is'.\n\n", + "You can set your favourite browser in the Full Settings window. Otherwise, the\n", + "system default one will be looked for.\n\n", APP_NAME " parses command line arguments and looks for option(s) then for one\n", - "resource, the rest of the line is ignored. It reads too configuration file\n", + "resource, the rest of the line is ignored. It also reads configuration file\n", #ifndef G_OS_WIN32 "'" APP_CMD "-conf' located in /home//" TICKR_DIR_NAME "/ if it exists (or\n", "'" APP_CMD "-conf' if an instance id has been set to n.)\n\n", @@ -202,23 +234,25 @@ #endif "Command line options override configuration file ones which override default\n", "ones.\n\n", - "Compiled with GTK+ and Libxml2 on " __DATE__ " - " __TIME__ "\n", - "\nVisit " WEBSITE_URL " for more info.\n", - NULL}; + "Compiled with GTK+2, Libxml2, GnuTLS and Libfribidi.\n\n",/*" on " __DATE__ " - " __TIME__ "\n\n",*/ /* Fix non-reproducible builds */ + "Visit " WEBSITE_URL " for more info.\n", + NULL +}; static const char *license_str1[] = { - APP_NAME " version " APP_VERSION_NUMBER " - Copyright (C) Emmanuel Thomas-Maurin 2009-2013\n\n", + APP_NAME " version " APP_V_NUM " - " COPYRIGHT_STR "\n\n", APP_NAME " is free software: you can redistribute it and/or modify\n", "it under the terms of the GNU General Public License as published by\n", "the Free Software Foundation, either version 3 of the License, or\n", "(at your option) any later version.\n\n", APP_NAME " is distributed in the hope that it will be useful,\n", "but WITHOUT ANY WARRANTY; without even the implied warranty of\n", - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n", + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n", "GNU General Public License for more details.\n\n", "You should have received a copy of the GNU General Public License\n", - "along with this program. If not, see ", - NULL}; + "along with this program. If not, see ", + NULL +}; static const char *license_str2 = "http://www.gnu.org/licenses/\n"; diff -Nru tickr-0.6.4/src/tickr/tickr_html_entities.h tickr-0.7.0/src/tickr/tickr_html_entities.h --- tickr-0.6.4/src/tickr/tickr_html_entities.h 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_html_entities.h 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify diff -Nru tickr-0.6.4/src/tickr/tickr_http.c tickr-0.7.0/src/tickr/tickr_http.c --- tickr-0.6.4/src/tickr/tickr_http.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_http.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -19,17 +19,13 @@ #include "tickr.h" /* Are these values OK ? */ -#define HTTP_REQUEST_MAXLEN (8 * 1024 - 1) +#define HTTP_REQUEST_MAXLEN (8 * 1024 - 1) #define HTTP_HEADER_FIELD_MAXLEN (2 * 1024 - 1) #define MAX_HTTP_REDIRECT 8 #define DEFAULT_HTTP_PORT_STR "80" #define DEFAULT_HTTPS_PORT_STR "443" -#define PORT_STR_MAXLEN PROXY_PORT_MAXLEN #define TAB '\x09' -/* S_MOD -> true in multiple selection mode / false otherwise */ -#define S_MOD (get_ticker_env()->selection_mode == MULTIPLE) - void remove_chunk_info(char **response) { char *response2; @@ -48,15 +44,15 @@ *response = response2; } -/* 'Quickly check feed format' (xml/rss2.0/rss1.0/atom), get shift to begining - * and cut off trailing part. */ +/* + * 'Quickly check' feed format (xml/rss2.0/rss1.0/atom), get shift to begining + * and cut off trailing part. + * Return OK or, if error, RESOURCE_ENCODING_ERROR or FEED_FORMAT_ERROR. + */ static int format_quick_check(char *response, int *shift) { - int i; + int i; - /* This may return false positives so disabled - if (strcmp(get_http_header_value("Content-Type", response), "text/xml") != 0) - return FEED_FORMAT_ERROR;*/ i = 0; while (strncmp(response + i, "https_support) { + if (port_num[0] == '\0') + str_n_cpy(port_num, DEFAULT_HTTPS_PORT_STR, PORT_STR_MAXLEN); + else if (strcmp(port_num, DEFAULT_HTTPS_PORT_STR) != 0) + INFO_OUT("Will use non-standard HTTPS port %s for this connection\n", port_num) + } else { + warning(M_S_MOD, "%s:\nNo HTTPS support (GnuTLS required version is %s", + " but installed version is %s)", url, REQUIRED_GNUTLS_V_NUM_STR, + gnutls_check_version(NULL)); + return HTTP_UNSUPPORTED_SCHEME; + } + } else if (strcmp(scheme, "file") == 0) { + /* Do nothing here */ + } else if (scheme[0] == '\0') { + warning(M_S_MOD, "No scheme found in URL: %s", url); return HTTP_UNSUPPORTED_SCHEME; } else { - warning(S_MOD, 2, "Unsupported or unknown scheme in URL: ", - get_scheme_from_url(url)); + warning(M_S_MOD, "Unsupported or unknown scheme in URL: %s", scheme); return HTTP_UNSUPPORTED_SCHEME; } } else { @@ -135,45 +149,47 @@ str_n_cpy(host, get_proxy_host(), FILE_NAME_MAXLEN); str_n_cpy(port_num, get_proxy_port(), PORT_STR_MAXLEN); } - if ((*sock = connect_to_host(host, port_num)) != SOCK_CREATE_ERROR) { + if ((*sock = tcp_connect_to_host(host, port_num)) != TCP_SOCK_CREATE_ERROR) { connect_fail_count = 0; return OK; } else { if (get_use_proxy()) { - warning(FALSE, 4, "Can't connect to proxy: ", - get_proxy_host(),":", get_proxy_port()); + warning(BLOCK, "Can't connect to proxy: %s:%s", + get_proxy_host(), get_proxy_port()); current_feed(); connection_settings(PROXY_PAGE); - } else if (get_ticker_env()->selection_mode == SINGLE) - warning(FALSE, 2, "Can't connect to host: ", host); - else { - fprintf(STD_ERR, "Can't connect to host: %s\n", host); - fflush(STD_ERR); - } + } else + warning(M_S_MOD, "Can't connect to host: %s", host); if (++connect_fail_count >= CONNECT_FAIL_MAX) { connect_fail_count = 0; return CONNECT_TOO_MANY_ERRORS; } else - return SOCK_CANT_CONNECT; + return TCP_SOCK_CANT_CONNECT; } } -/* *********************************** - * TODO: BETTER DOCUMENT THIS FUNC - * ***********************************/ -/* We replace resrc->id with modified url and file_name = downloaded resource. - * Max length of file_name, url, and new_url = FILE_NAME_MAXLEN. */ +/* + * Here, resrc_id will be replaced by modified URL and remote resource + * will be downloaded and saved under file_name. + * Max length of resrc_id, file_name, and url = FILE_NAME_MAXLEN. + */ int fetch_resource(const char *resrc_id, const char *file_name, char *url) { - sockt sock; - int status, recv_status; - char *response; - char *new_url; - char header_field[HTTP_HEADER_FIELD_MAXLEN + 1]; - FILE *fp; - int content_length; - GError *error = NULL; - int i, j; + sockt sock; + int status, recv_status; + zboolean http_moved_permamently; + char *response; + char *new_url; + char header_field[HTTP_HEADER_FIELD_MAXLEN + 1]; + FILE *fp; + int content_length; + char orig_scheme[URL_SCHEME_MAXLEN + 1]; + char orig_host[FILE_NAME_MAXLEN + 1]; + char orig_port[PORT_STR_MAXLEN + 1]; + char new_port[PORT_STR_MAXLEN + 1]; + GError *error = NULL; + char *tmp = NULL; + int i, j; if (strncmp(resrc_id, "file://", strlen("file://")) == 0) { /* 'file' scheme */ @@ -183,78 +199,89 @@ else if (url[0] == '/') i = 0; else - return RESOURCE_ERROR; + return RESOURCE_INVALID; if (g_file_get_contents(url + i, &response, NULL, &error)) { + tmp = l_str_new(response); + g_free(response); + response = tmp; + tmp = NULL; if ((j = format_quick_check(response, &i)) == OK) { if (g_file_set_contents(file_name, response + i, -1, &error)) { - g_free(response); + free2(response); /* l_str_free() and free2() do the same things */ return OK; } else { - g_free(response); + free2(response); if (error != NULL) { - warning(FALSE, 1, error->message); + warning(BLOCK, error->message); /* TODO: Should be more informative */ g_error_free(error); } else - warning(FALSE, 2, "Can't create file: ", file_name); + warning(BLOCK, "Can't create file: '%s'", file_name); return CREATE_FILE_ERROR; } } else { - g_free(response); + free2(response); return j; } } else { if (error != NULL) { - warning(S_MOD, 1, error->message); + warning(M_S_MOD, error->message); /* TODO: Should be more informative */ g_error_free(error); } else - warning(S_MOD, 2, "Can't open file: ", url + i); + warning(M_S_MOD, "Can't open file: '%s'", url + i); return OPEN_FILE_ERROR; } } else - /* 'http' scheme ('https' not supported so far) */ + /* 'http' or 'https' scheme */ str_n_cpy(url, resrc_id, FILE_NAME_MAXLEN); if ((i = connect_with_url(&sock, url)) == OK) { if ((status = get_http_response(sock, "GET", "", url, &new_url, - &response, &recv_status)) == SEND_ERROR || status == RECV_ERROR) { - if (recv_status == CONNECTION_CLOSED_BY_SERVER || recv_status == SOCK_SHOULD_BE_CLOSED) + &response, &recv_status)) == TCP_SEND_ERROR || status == TCP_RECV_ERROR || + status == TLS_ERROR || status == TLS_SEND_ERROR || status == TLS_RECV_ERROR) { + if (recv_status == CONNECTION_CLOSED_BY_SERVER || recv_status == TCP_SOCK_SHOULD_BE_CLOSED) CLOSE_SOCK(sock); return i; } } else return i; - while (TRUE) { - /* Status checked here are those returned by get_http_response() - * so we must make sure they all match. */ + + /* Keeping a copy of original URL in case of HTTP redirects. */ + str_n_cpy(get_resource()->orig_url, url, FILE_NAME_MAXLEN); /* TODO: Is this OK here */ + + while (1) { + /* + * Status checked here are those returned by get_http_response() + * so we must make sure to catch all them. + * Beside HTTP status, they may also be error codes. + */ if (status == HTTP_CONTINUE) { free2(response); status = get_http_response(sock, "GET", "", url, &new_url, &response, &recv_status); continue; } else if (status == HTTP_SWITCH_PROTO) { - if (strcmp(get_http_header_value("Upgrade", response), "HTTP") == 0) - warning(S_MOD, 2, url, ":\nSwitching to HTTP protocol requested for this connection" - " - Request currently not supported"); - else if (strcmp(get_http_header_value("Upgrade", response), "HTTPS") == 0) - warning(S_MOD, 2, url, ":\nSwitching to HTTPS protocol requested for this connection" - " - Request currently not supported"); + warning(M_S_MOD, "%s:\nRequest to switch protocol for this connection - Not supported", url); + DEBUG_INFO("'Upgrade' header field in HTTP response: %s\n", + get_http_header_value("Upgrade", response)) + free2(response); + CLOSE_SOCK(sock); return status; } else if (status == OK) { - if (strcmp(get_http_header_value("Transfer-Encoding", response), "chunked") == 0) { + if (strcmp(get_http_header_value("Transfer-Encoding", response), "chunked") == 0) /* Chunked transfer encoding */ remove_chunk_info(&response); - } else if ((content_length = atoi(get_http_header_value("Content-Length", response))) > 0) { - /* 'Content-Length' = length of entity body is mandatory - * but if 'Transfer-Encoding: chunked'. */ + else if ((content_length = atoi(get_http_header_value("Content-Length", response))) > 0) { + /* + * 'Content-Length' = length of entity body is mandatory + * but if 'Transfer-Encoding: chunked'. + */ /* Do nothing */ - } else { -#ifdef VERBOSE_OUTPUT /* Only if verbose because notification only, nothing done. */ - fprintf(STD_ERR, "No 'Transfer-Encoding' nor 'Content-Length' " - "header field in HTTP response\n"); - fflush(STD_ERR); -#endif - } - /* Quickly 'check format' (xml and rss2.0/atom stuff), - * shift to beginnig and cut off trailing part. */ + } else + VERBOSE_INFO_ERR("No 'Transfer-Encoding' nor 'Content-Length' " + "header field in HTTP response\n") + /* + * Quickly 'check format' (xml and rss/atom stuff), + * shift to beginnig and cut off trailing part. + */ if ((j = format_quick_check(response, &i)) != OK) { free2(response); return j; @@ -267,43 +294,61 @@ CLOSE_SOCK(sock); return OK; } else { - warning(FALSE, 2, "Can't create file: ", file_name); + warning(BLOCK, "Can't create file: '%s'", file_name); fclose(fp); free2(response); CLOSE_SOCK(sock); return CREATE_FILE_ERROR; } - } else if (status == HTTP_MOVED) { + } else if (status == HTTP_MOVED || status == HTTP_MOVED_PERMANENTLY) { + if (status == HTTP_MOVED_PERMANENTLY) + http_moved_permamently = TRUE; + else + http_moved_permamently = FALSE; + str_n_cpy(get_resource()->orig_url, url, FILE_NAME_MAXLEN); + str_n_cpy(orig_scheme, get_scheme_from_url(url), URL_SCHEME_MAXLEN); + str_n_cpy(orig_host, get_host_and_port_from_url(url, orig_port), FILE_NAME_MAXLEN); i = 0; do { - str_n_cpy(url, new_url, FILE_NAME_MAXLEN); - if (strcmp(get_http_header_value("Connection", response), "close") == 0 ||\ - strcmp(get_scheme_from_url(url), "https") == 0) { - free2(response); + /* + * We test if URL scheme is present, to know whether new_url contains a full URL or a PATH. + * POSSIBLE FIXME: Could new_url contain host/path ? + */ + if (*get_scheme_from_url(new_url) != '\0') /* Scheme -> full URL */ + str_n_cpy(url, new_url, FILE_NAME_MAXLEN); + else /* No scheme -> path */ + snprintf(url, FILE_NAME_MAXLEN + 1, "%s://%s%s", + get_scheme_from_url(url), + get_host_and_port_from_url(url, NULL), + new_url); + free2(response); + /* No need to disconnect/reconnect if same scheme, host and port num. */ + if (strcmp(get_scheme_from_url(url), orig_scheme) != 0 || + strcmp(get_host_and_port_from_url(url, new_port), orig_host) != 0 || + strcmp(new_port, orig_port) != 0) { CLOSE_SOCK(sock); - if (strcmp(get_scheme_from_url(url), "https") == 0) { - warning(S_MOD, 2, resrc_id, ":\nHTTPS protocol requested for this connection" - " (following HTTP moved) - Not currently supported"); - return HTTP_ERROR; /* ???? */ - } if ((j = connect_with_url(&sock, url)) != OK) return j; - } else - free2(response); - } while ((status = get_http_response(sock, "GET", "", url, - &new_url, &response, &recv_status)) == HTTP_MOVED &&\ - ++i < MAX_HTTP_REDIRECT); - if (status != HTTP_MOVED && i <= MAX_HTTP_REDIRECT) + } + } while (((status = get_http_response(sock, "GET", "", url, + &new_url, &response, &recv_status)) == HTTP_MOVED || + status == HTTP_MOVED_PERMANENTLY) && ++i < MAX_HTTP_REDIRECT); + if (status != HTTP_MOVED && status != HTTP_MOVED_PERMANENTLY && i <= MAX_HTTP_REDIRECT) { + VERBOSE_INFO_OUT("Original URL: %s\nNew URL after HTTP redirect(s): %s\n", + get_resource()->orig_url, url) + DEBUG_INFO("status = %s\n", global_error_str(status)) + if (http_moved_permamently) + str_n_cpy((char *)resrc_id, url, FILE_NAME_MAXLEN); continue; - else { - warning(S_MOD, 2, resrc_id, ":\nToo many HTTP redirects"); + } else { + warning(M_S_MOD, "%s:\nToo many HTTP redirects", resrc_id); free2(response); CLOSE_SOCK(sock); return HTTP_TOO_MANY_REDIRECTS; } } else if (status == HTTP_USE_PROXY) { - warning(FALSE, 4, "Resource: ", url, "\nmust be accessed through proxy.\nProxy host: ", - new_url); + warning(BLOCK, "Resource: %s", "\nmust be accessed through proxy.\nProxy host: %s", + url, new_url); str_n_cpy(get_proxy_host(), new_url, PROXY_HOST_MAXLEN); free2(response); CLOSE_SOCK(sock); @@ -322,7 +367,7 @@ get_proxy_auth_str()); if ((status = get_http_response(sock, "GET", header_field, url, &new_url, &response, &recv_status)) == HTTP_PROXY_AUTH_REQUIRED) { - warning(FALSE, 2, "Proxy authentication failed for: ", get_proxy_host()); + warning(BLOCK, "Proxy authentication failed for: %s", get_proxy_host()); free2(response); CLOSE_SOCK(sock); if (connection_settings(PROXY_PAGE) == GTK_RESPONSE_OK) { @@ -335,9 +380,8 @@ } continue; } else { - warning(FALSE, 2, "Proxy authentication required for: ", get_proxy_host()); - if (connection_settings(PROXY_PAGE) == GTK_RESPONSE_OK &&\ - get_use_proxy_auth()) { + warning(BLOCK, "Proxy authentication required for: %s", get_proxy_host()); + if (connection_settings(PROXY_PAGE) == GTK_RESPONSE_OK && get_use_proxy_auth()) { if ((i = connect_with_url(&sock, url)) != OK) return i; snprintf(header_field, HTTP_HEADER_FIELD_MAXLEN + 1, @@ -350,7 +394,7 @@ return HTTP_NO_PROXY_AUTH_CREDENTIALS; } } else if (status == HTTP_UNAUTHORIZED) { - /* http authentication - only basic so far */ + /* HTTP authentication - only basic so far */ free2(response); CLOSE_SOCK(sock); if (get_use_authentication()) { @@ -361,7 +405,7 @@ get_http_auth_str()); if ((status = get_http_response(sock, "GET", header_field, url, &new_url, &response, &recv_status)) == HTTP_UNAUTHORIZED) { - warning(FALSE, 2, "HTTP authentication failed for: ", url); + warning(BLOCK, "HTTP authentication failed for: %s", url); free2(response); CLOSE_SOCK(sock); if (connection_settings(AUTH_PAGE) == GTK_RESPONSE_OK) { @@ -374,9 +418,8 @@ } continue; } else { - warning(FALSE, 2, "HTTP authentication required for: ", url); - if (connection_settings(AUTH_PAGE) == GTK_RESPONSE_OK &&\ - get_use_authentication()) { + warning(BLOCK, "HTTP authentication required for: %s", url); + if (connection_settings(AUTH_PAGE) == GTK_RESPONSE_OK && get_use_authentication()) { if ((i = connect_with_url(&sock, url)) != OK) return i; snprintf(header_field, HTTP_HEADER_FIELD_MAXLEN + 1, @@ -388,34 +431,22 @@ } else return HTTP_NO_AUTH_CREDENTIALS; } - } else if (status == HTTP_BAD_REQUEST) { - warning(S_MOD, 2, url, ":\nBad Request"); - free2(response); - CLOSE_SOCK(sock); - return status; - } else if (status == HTTP_FORBIDDEN) { - warning(S_MOD, 2, url, ":\nForbidden"); - free2(response); - CLOSE_SOCK(sock); - return status; - } else if (status == HTTP_NOT_FOUND) { - warning(S_MOD, 2, url, ":\nNot found"); - free2(response); - CLOSE_SOCK(sock); - return status; - } else if (status == HTTP_INT_SERVER_ERROR) { - warning(S_MOD, 2, url, ":\nInternal server error"); - free2(response); - CLOSE_SOCK(sock); - return status; - } else if (status == HTTP_NO_STATUS_CODE) { - warning(S_MOD, 2, url, ":\nNo HTTP status code returned"); + } else if ( status == HTTP_BAD_REQUEST || + status == HTTP_FORBIDDEN || + status == HTTP_NOT_FOUND || + status == HTTP_GONE || + status == HTTP_INT_SERVER_ERROR || + status == HTTP_NO_STATUS_CODE) { + warning(M_S_MOD, "%s:\n%s", url, global_error_str(status)); free2(response); CLOSE_SOCK(sock); return status; } else { - warning(S_MOD, 3, url, ":\nHTTP response status code: ", - itoa2(status - 1000)); + if (status > 10000) + warning(M_S_MOD, "%s:\nResponse HTTP status code = %d", + url, status - 10000); + else + DEBUG_INFO("%s\n", global_error_str(status)) if (response != NULL) free2(response); CLOSE_SOCK(sock); @@ -424,16 +455,18 @@ } } -/* 'rq_str' may contain header fields(s) separated and ended by "\r\n" */ -const char *build_http_request(const char *method, const char *path,\ - const char *host, const char* rq_str) +/* 'rq_str' may contain header fields(s) separated and ended by "\r\n". */ +const char *build_http_request(const char *method, const char *path, + const char *host, const char* rq_str) { - static char str[HTTP_REQUEST_MAXLEN + 1]; + static char str[HTTP_REQUEST_MAXLEN + 1]; snprintf(str, HTTP_REQUEST_MAXLEN, "%s %s HTTP/1.1\r\n" /* Start line with method and path */ "Host: %s\r\n" /* Mandatory host header field */ - "User-Agent: " APP_NAME "-" APP_VERSION_NUMBER "\r\n" + "User-Agent: " APP_NAME "-" APP_V_NUM "\r\n" + /* Seems totally useless - + * "Accept-Charset: utf-8\r\n"*/ "%s\r\n", /* optional extra header field(s) */ method, path, host, rq_str); return (const char *)str; @@ -442,46 +475,69 @@ /* * 'rq_str' may contain header field(s) separated and ended by "\r\n". * Must 'free2' response afterwards. + * + * If returned value > 10000, it's an unprocessed HTTP status code + 10000. */ int get_http_response(sockt sock, const char *rq_method, const char *rq_str, const char *rq_url, char **new_rq_url, char **response, int *recv_status) { - char *str; - static char location[FILE_NAME_MAXLEN + 1]; - int bytes_sent, bytes_received, status_code; + char *str; + static char location[FILE_NAME_MAXLEN + 1]; + int bytes_sent, bytes_received, status_code; + gnutls_session_t *s; + gnutls_certificate_credentials_t *c; location[0] = '\0'; *new_rq_url = (char *)location; *response = NULL; str = (char *)build_http_request( rq_method, - (get_use_proxy() ? rq_url : get_path_from_url(rq_url)), /* Path or full (absolute) url if using proxy */ + (get_use_proxy() ? rq_url : get_path_from_url(rq_url)), /* Path or full (absolute) URL if using proxy */ /* is that correct when using proxy? */ - get_host_from_url(rq_url), + get_host_and_port_from_url(rq_url, NULL), rq_str); - if ((bytes_sent = send_full(sock, (const char *)str)) >= 0) { - if ((*response = recv_full(sock, &bytes_received, recv_status)) != NULL) { + if (strcmp(get_scheme_from_url(rq_url), "http") == 0) + bytes_sent = tcp_send_full(sock, (const char *)str); + else { /* https */ + s = get_tls_session(); + c = get_tls_cred(); + if (tls_connect(s, c, (const sockt *)&sock, (const char *)rq_url, get_host_and_port_from_url(rq_url, NULL)) == OK) { + /*char *info; + info = gnutls_session_get_desc(*s); + DEBUG_INFO("tls_connect() = OK - TLS session info:\n%s\n", info) + gnutls_free(info);*/ + } else + return TLS_ERROR; + bytes_sent = tcp_tls_send_full(sock, *get_tls_session(), (const char *)str); + } + if (bytes_sent >= 0) { + if (strcmp(get_scheme_from_url(rq_url), "http") == 0) + *response = tcp_recv_full(sock, &bytes_received, recv_status); + else { /* https */ + *response = tcp_tls_recv_full(sock, *get_tls_session(), &bytes_received, recv_status); + tls_disconnect(get_tls_session(), get_tls_cred(), (const char *)rq_url); + } + if (*response != NULL) { if ((status_code = get_http_status_code(*response)) == 100) return HTTP_CONTINUE; else if (status_code == 101) return HTTP_SWITCH_PROTO; else if (status_code == 200) return OK; - else if ( /* 'Multiple choices' */ - status_code == 300 ||\ - /* 'Moved permanently' */ - status_code == 301 ||\ - /* 'Found' */ - status_code == 302 ||\ - /* 'See other' */ - status_code == 303 ||\ - /* 'Not modified' */ - status_code == 304 ||\ - /* 'Moved temporarily' */ - status_code == 307) { + else if ( status_code == 300 || /* 'Multiple choices' */ + status_code == 302 || /* 'Found' */ + status_code == 303 || /* 'See other' */ + status_code == 304 || /* 'Not modified' */ + status_code == 307 /* 'Moved temporarily' */ + ) { + str_n_cpy(location, get_http_header_value("Location", *response), + FILE_NAME_MAXLEN); + return HTTP_MOVED; /* Must use the new URL in 'Location' */ + } else if (status_code == 301) { /* 'Moved permanently' */ str_n_cpy(location, get_http_header_value("Location", *response), FILE_NAME_MAXLEN); - return HTTP_MOVED; /* Must use the new url in 'Location' */ + return HTTP_MOVED_PERMANENTLY; /* Must use the new URL in 'Location' + * and set resrc->id to new value */ } else if (status_code == 305) return HTTP_USE_PROXY; else if (status_code == 400) @@ -494,19 +550,28 @@ return HTTP_NOT_FOUND; else if (status_code == 407) return HTTP_PROXY_AUTH_REQUIRED; + else if (status_code == 410) + return HTTP_GONE; else if (status_code == 500) return HTTP_INT_SERVER_ERROR; else if (status_code == -1) return HTTP_NO_STATUS_CODE; else - return status_code + 1000; - } else - return RECV_ERROR; + return status_code + 10000; + } else { + if (strcmp(get_scheme_from_url(rq_url), "http") == 0) + return TCP_RECV_ERROR; + else /* https */ + return TLS_RECV_ERROR; + } } else - return SEND_ERROR; + if (strcmp(get_scheme_from_url(rq_url), "http") == 0) + return TCP_SEND_ERROR; + else /* https */ + return TLS_SEND_ERROR; } -/* Return -1 if error */ +/* Return -1 if error. */ int get_http_status_code(const char *response) { char status_code[4]; @@ -527,7 +592,7 @@ return atoi(status_code); } -/* Get header_value as string (empty one if header name not found) */ +/* Get header_value as string (empty one if header name not found). */ const char *get_http_header_value(const char *header_name, const char *response) { static char header_value[1024]; @@ -543,7 +608,7 @@ } else i++; while (response[i] == ' ' || response[i] == TAB) { - if (response[i] == '\n' || response[i] == '\r' ||\ + if (response[i] == '\n' || response[i] == '\r' || response[i] == '\0') { header_value[0] = '\0'; return (const char *)header_value; @@ -552,7 +617,7 @@ } str_n_cpy(header_value, response + i, 1023); i = 0; - while (header_value[i] != '\0' && header_value[i] != ' ' &&\ + while (header_value[i] != '\0' && header_value[i] != ' ' && header_value[i] != TAB && header_value[i] != '\n' && header_value[i] != '\r' && i < 1023) i++; @@ -562,7 +627,7 @@ return (const char *)header_value; } -/* Return 0 if none found */ +/* Return 0 if none found. */ int go_after_next_cr_lf(const char *response) { int i = 0; @@ -575,7 +640,7 @@ return 0; } -/* Return 0 if none found */ +/* Return 0 if none found. */ int go_after_next_empty_line(const char *response) { int i = 0; @@ -588,79 +653,108 @@ return 0; } -/* 'response' must point to chunk size hexa str or preceeding space(s). - * Return -1 if invalid chunk size format (ie not an hexa str). */ +/* + * 'response' must point to chunk size hexa str or preceeding space(s). + * Return -1 if invalid chunk size format (ie not an hexa str). + */ int get_http_chunk_size(const char *response) { char size_str[32], *tailptr; int size, i = 0; - while (response[i] == ' ' || response[i] == TAB ||\ + while (response[i] == ' ' || response[i] == TAB || response[i] == '\n' || response[i] == '\r') i++; str_n_cpy(size_str, response + i, 31); i = 0; - while (size_str[i] != ' ' && size_str[i] != TAB &&\ - size_str[i] != '\n' && size_str[i] != '\r' &&\ - size_str[i] != ';' && size_str[i] != '\0' &&\ + while (size_str[i] != ' ' && size_str[i] != TAB && + size_str[i] != '\n' && size_str[i] != '\r' && + size_str[i] != ';' && size_str[i] != '\0' && i < 31) i++; size_str[i] = '\0'; size = (int)strtoul(size_str, &tailptr, 16); if (tailptr == size_str) { - fprintf(STD_ERR, "Invalid hexadecimal value in HTTP chunk size: %s\n", - size_str); - fflush(STD_ERR); + INFO_ERR("Invalid hexadecimal value in HTTP chunk size: %s\n", + size_str) return -1; } else return size; } /* - * 'http://www.sth1.org/sth2/sth2.xml' -> 'http' - * (expect one scheme in url, return empty str if none). + * 'http://www.sth1.org/sth2/sth3.xml' -> 'http' + * (expect one scheme in URL, return empty str if none). */ -const char *get_scheme_from_url(const char* url) +const char *get_scheme_from_url(const char *url) { - static char str[16]; + static char str[URL_SCHEME_MAXLEN + 1]; int i = 0; while (strncmp(url + i, "://", 3) != 0 && url[i] != '\0') i++; if (url[i] != '\0') - str_n_cpy(str, url, MIN(i, 15)); + str_n_cpy(str, url, MIN(i, URL_SCHEME_MAXLEN)); else str[0] = '\0'; return (const char *)str; } /* - * 'http://www.sth1.org/sth2/sth2.xml' -> 'www.sth1.org' - * (expect one scheme in url, return empty str if none). + * 'http://www.sth1.org/sth2/sth3.xml' -> 'www.sth1.org', '' + * 'http://www.sth1.org:80/sth2/sth3.xml' -> 'www.sth1.org', '80' + * (expect one scheme in URL, return empty str if none). + * port_num may be NULL. If port_num != NULL, MAKE SURE that it can handle + * PORT_STR_MAXLEN chars. */ -const char *get_host_from_url(const char* url) +const char *get_host_and_port_from_url(const char *url, char *port_num) { static char str[FILE_NAME_MAXLEN + 1]; - int i = 0; + int i = 0, j = 0; while (strncmp(url + i, "://", 3) != 0 && url[i] != '\0') i++; if (url[i] != '\0') { str_n_cpy(str, url + i + 3, FILE_NAME_MAXLEN); i = 0; - while (str[i] != '\0' && str[i] != '/' && i < FILE_NAME_MAXLEN) - i++; + while (str[i] != '\0' && str[i] != '/' && i < FILE_NAME_MAXLEN) { + if (str[i] == ':') { + j = i; + break; + } else + i++; + } str[i] = '\0'; + if (port_num != NULL) { + port_num[0] = '\0'; + if (j != 0) { + j++; + if (url[j] != '\0') { + while (str[j] != '\0' && str[j] != '/' && j < FILE_NAME_MAXLEN) + j++; + str[j] = '\0'; + str_n_cpy(port_num, str + i + 1, PORT_STR_MAXLEN); + } + } + } } else str[0] = '\0'; return (const char *)str; } +zboolean port_num_is_valid(const char *port_num) +{ + if (str_is_num(port_num) && atoi(port_num) > 0 && atoi(port_num) < 65536) + return TRUE; + else + return FALSE; +} + /* - * 'http://www.sth1.org/sth2/sth2.xml' -> '/sth2/sth2.xml' - * (expect one scheme in url, return empty str if none). + * 'http://www.sth1.org/sth2/sth3.xml' -> '/sth2/sth3.xml' + * (expect one scheme in URL, return empty str if none). */ -const char *get_path_from_url(const char* url) +const char *get_path_from_url(const char *url) { static char str[FILE_NAME_MAXLEN + 1]; int i = 0; diff -Nru tickr-0.6.4/src/tickr/tickr_list.c tickr-0.7.0/src/tickr/tickr_list.c --- tickr-0.6.4/src/tickr/tickr_list.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_list.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -19,7 +19,19 @@ #include "tickr.h" #include "tickr_list.h" -FList *f_list_new(const char *url, const char *title, gboolean selected, const char *rank) +/* (In tickr_list.h) +typedef struct FeedListNode { + char *url; + char *title; + zboolean selected; + char rank[FLIST_RANK_STR_LEN + 1]; + struct FeedListNode *prev; + struct FeedListNode *next; + char sig[FLIST_SIG_LEN + 1]; +} FList; +*/ + +FList *f_list_new(const char *url, const char *title, zboolean selected, const char *rank) { FList *node = malloc2(sizeof(FList)); /*int url_len, title_len;*/ @@ -64,7 +76,7 @@ */ void f_list_free(FList *node) { - CHECK_IS_FLIST(node, "f_list_free()") + CHECK_IS_FLIST(node, __func__) memset(node->sig, 0, FLIST_SIG_LEN); free2(node->url); @@ -77,9 +89,9 @@ */ void f_list_free_all(FList *some_node) { - FList *node; + FList *node; - CHECK_IS_FLIST(some_node, "f_list_free_all()") + CHECK_IS_FLIST(some_node, __func__) for (node = f_list_first(some_node); IS_FLIST(node); node = node->next) f_list_free(node); @@ -87,7 +99,7 @@ FList *f_list_first(FList *node) { - CHECK_IS_FLIST(node, "f_list_first()") + CHECK_IS_FLIST(node, __func__) while (IS_FLIST(node->prev)) node = node->prev; @@ -96,7 +108,7 @@ FList *f_list_last(FList *node) { - CHECK_IS_FLIST(node, "f_list_last()") + CHECK_IS_FLIST(node, __func__) while (IS_FLIST(node->next)) node = node->next; @@ -108,7 +120,7 @@ */ FList *f_list_prev(FList *node) { - CHECK_IS_FLIST(node, "f_list_prev()") + CHECK_IS_FLIST(node, __func__) if (IS_FLIST(node->prev)) return node->prev; @@ -121,7 +133,7 @@ */ FList *f_list_next(FList *node) { - CHECK_IS_FLIST(node, "f_list_next()") + CHECK_IS_FLIST(node, __func__) if (IS_FLIST(node->next)) return node->next; @@ -137,12 +149,12 @@ FList *node; int count, i = 1; - CHECK_IS_FLIST(some_node, "f_list_nth()") + CHECK_IS_FLIST(some_node, __func__) node = f_list_first(some_node); count = f_list_count(node); if (n > count) { - fprintf(STD_ERR, "f_list_nth(): %d is out of range\n", n); + INFO_ERR("%s(): %d is out of range\n", __func__, n) return NULL; } else { while (IS_FLIST(node->next) && i++ < n) @@ -183,7 +195,7 @@ for (node = f_list_first(some_node); IS_FLIST(node); node = node->next) counter++; /*else - fprintf(STD_ERR, "f_list_count(): List is empty\n");*/ + INFO_ERR("%s(): List is empty\n", __func__)*/ return counter; } @@ -191,10 +203,10 @@ * Create and add node at start of list. * 'some_node' may be any node in the list or NULL -> when creating list. */ -FList *f_list_add_at_start(FList *some_node, const char *url, const char *title, gboolean selected,\ - const char *rank) +FList *f_list_add_at_start(FList *some_node, const char *url, const char *title, zboolean selected, + const char *rank) { - FList *instance; + FList *instance; instance = f_list_new(url, title, selected, rank); /* ->prev = ->next = NULL */ if (IS_FLIST(some_node)) { @@ -209,10 +221,10 @@ * Create and add node at end of list. * 'some_node' may be any node in the list or NULL -> when creating list. */ -FList *f_list_add_at_end(FList *some_node, const char *url, const char *title, gboolean selected,\ - const char *rank) +FList *f_list_add_at_end(FList *some_node, const char *url, const char *title, zboolean selected, + const char *rank) { - FList *instance; + FList *instance; instance = f_list_new(url, title, selected, rank); /* ->prev = ->next = NULL */ if (IS_FLIST(some_node)) { @@ -226,12 +238,12 @@ /* * Create and insert node before 'some_node'. */ -FList *f_list_insert_before(FList *some_node, const char *url, const char *title, gboolean selected,\ - const char *rank) +FList *f_list_insert_before(FList *some_node, const char *url, const char *title, zboolean selected, + const char *rank) { - FList *instance; + FList *instance; - CHECK_IS_FLIST(some_node, "f_list_insert_before()") + CHECK_IS_FLIST(some_node, __func__) instance = f_list_new(url, title, selected, rank); /* ->prev = ->next = NULL */ if (IS_FLIST(some_node->prev)) { @@ -246,12 +258,12 @@ /* * Create and insert node after 'some_node'. */ -FList *f_list_insert_after(FList *some_node, const char *url, const char *title, gboolean selected,\ - const char *rank) +FList *f_list_insert_after(FList *some_node, const char *url, const char *title, zboolean selected, + const char *rank) { - FList *instance; + FList *instance; - CHECK_IS_FLIST(some_node, "f_list_insert_after()") + CHECK_IS_FLIST(some_node, __func__) instance = f_list_new(url, title, selected, rank); /* ->prev = ->next = NULL */ instance->prev = some_node; @@ -269,9 +281,9 @@ */ FList *f_list_remove(FList *node) { - FList *prev = NULL, *next = NULL, *node2 = NULL; + FList *prev = NULL, *next = NULL, *node2 = NULL; - CHECK_IS_FLIST(node, "f_list_remove()") + CHECK_IS_FLIST(node, __func__) if (IS_FLIST(node->prev)) { prev = node->prev; @@ -292,10 +304,10 @@ void f_list_swap(FList *node1, FList *node2) { - FList tmp; + FList tmp; - CHECK_IS_FLIST(node1, "f_list_swap()"); - CHECK_IS_FLIST(node2, "f_list_swap()"); + CHECK_IS_FLIST(node1, __func__); + CHECK_IS_FLIST(node2, __func__); (&tmp)->prev = node1->prev; (&tmp)->next = node1->next; @@ -316,7 +328,7 @@ FList *node1, *node2, *node_i[N_FLIST_MAX], *tmp; int list_len, min, i, j; - CHECK_IS_FLIST(some_node, "f_list_sort()") + CHECK_IS_FLIST(some_node, __func__) node1 = f_list_first(some_node); for (i = 0; i < N_FLIST_MAX; i++) { @@ -406,7 +418,7 @@ FList *node; int i = 0; - CHECK_IS_FLIST(some_node, "f_list_search()") + CHECK_IS_FLIST(some_node, __func__) for (node = f_list_first(some_node); IS_FLIST(node); node = node->next) { if (strcmp(str, node->url) == 0) @@ -421,46 +433,35 @@ * Use provided file_name if not NULL / default file name (URL_LIST_FILE) otherwise. * Create new f_list. * - * Entry format in url list file: - * ['*' (selected) or '-' (unselected) + "000" (3 chars rank) + url [+ '>' + title] + '\n'] + * Entry format in URL list file: + * ['*' (selected) or '-' (unselected) + "000" (3 chars rank) + URL [+ '>' + title] + '\n'] * * Entry max length = FILE_NAME_MAXLEN * See also: (UN)SELECTED_URL_CHAR/STR and TITLE_TAG_CHAR/STR in tickr.h * FLIST_RANK_FORMAT and FLIST_RANK_STR_LEN in tickr_list.h * - * Return OK (and first node of list) or LOAD_URL_LIST_ERROR. + * Return OK (and first node of list) or error code (LOAD_URL_LIST_NO_LIST, LOAD_URL_LIST_EMPTY_LIST, + * LOAD_URL_LIST_ERROR.) */ int f_list_load_from_file(FList **new_node, const char *file_name) { - char *listfname, listfname1[TMPSTR_SIZE + 1], listfname2[TMPSTR_SIZE + 1]; + char *list_file_name, default_list_file_name[FILE_NAME_MAXLEN + 1]; FILE *fp; char *tmp, tmp2[FLIST_RANK_STR_LEN + 1]; FList *node; size_t tmp_size = FILE_NAME_MAXLEN + 1; - gboolean selected, title_found; + zboolean selected, title_found; int title_shift, i; if (file_name == NULL) { - str_n_cpy(listfname1, get_datafile_full_name_from_name(URL_LIST_FILE), TMPSTR_SIZE); -#ifndef G_OS_WIN32 - snprintf(listfname2, TMPSTR_SIZE + 1, "%s%c%s", INSTALL_PATH, SEPARATOR_CHAR, URL_LIST_FILE); -#else - snprintf(listfname2, TMPSTR_SIZE + 1, "%s%c%s%c%s", - get_progfiles_dir(), SEPARATOR_CHAR, TICKR_DIR_NAME, SEPARATOR_CHAR, URL_LIST_FILE); -#endif - listfname = listfname1; - if ((fp = g_fopen(listfname, "rb")) == NULL) { - if (question_win("No URL list has been saved yet. Import one (OPML format required) ?") == YES) - import_opml_file(); - else if (question_win("No URL list has been saved yet. Use sample one ?") == YES) - listfname = listfname2; - else - return LOAD_URL_LIST_ERROR; - } + str_n_cpy(default_list_file_name, get_datafile_full_name_from_name(URL_LIST_FILE), FILE_NAME_MAXLEN); + list_file_name = default_list_file_name; + if ((fp = g_fopen(list_file_name, "rb")) == NULL) + return LOAD_URL_LIST_NO_LIST; } else - listfname = (char *)file_name; + list_file_name = (char *)file_name; node = NULL; - if ((fp = g_fopen(listfname, "rb")) != NULL) { + if ((fp = g_fopen(list_file_name, "rb")) != NULL) { tmp = malloc2(tmp_size * sizeof(char)); #ifndef G_OS_WIN32 while (getline(&tmp, &tmp_size, fp) != EOF) { @@ -495,11 +496,11 @@ *new_node = f_list_first(node); return OK; } else { - warning(FALSE, 3, "URL list '", listfname, "' is empty"); + warning(BLOCK, "URL list '%s' is empty", list_file_name); return LOAD_URL_LIST_EMPTY_LIST; } } else { - warning(FALSE, 4, "Can't load URL list ", listfname, ": ", strerror(errno)); + warning(BLOCK, "Can't load URL list '%s': %s", list_file_name, strerror(errno)); return LOAD_URL_LIST_ERROR; } } @@ -507,8 +508,8 @@ /* * Use provided file_name if not NULL / default file name (URL_LIST_FILE) otherwise. * - * Entry format in url list file: - * ['*' (selected) or '-' (unselected) + "000" (3 chars rank) + url [+ '>' + title] + '\n'] + * Entry format in URL list file: + * ['*' (selected) or '-' (unselected) + "000" (3 chars rank) + URL [+ '>' + title] + '\n'] * * Entry max length = FILE_NAME_MAXLEN * See also: (UN)SELECTED_URL_CHAR/STR and TITLE_TAG_CHAR/STR in tickr.h @@ -518,14 +519,14 @@ */ int f_list_save_to_file(FList *node, const char *file_name) { - char *listfname; + char *list_file_name; FILE *fp; if (file_name == NULL) - listfname = l_str_new(get_datafile_full_name_from_name(URL_LIST_FILE)); + list_file_name = l_str_new(get_datafile_full_name_from_name(URL_LIST_FILE)); else - listfname = l_str_new(file_name); - if ((fp = g_fopen(listfname, "wb")) != NULL) { + list_file_name = l_str_new(file_name); + if ((fp = g_fopen(list_file_name, "wb")) != NULL) { if (IS_FLIST(node)) { for(node = f_list_first(node); IS_FLIST(node); node = node->next) { /* TODO: We should use: "%c" + FLIST_RANK_FORMAT + "%s%s%s\n" */ @@ -538,20 +539,20 @@ } } fclose(fp); - l_str_free(listfname); + l_str_free(list_file_name); return OK; } else { - warning(FALSE, 4, "Can't save URL list ", listfname, ": ", strerror(errno)); - l_str_free(listfname); + warning(BLOCK, "Can't save URL list '%s': %s", list_file_name, strerror(errno)); + l_str_free(list_file_name); return SAVE_URL_LIST_ERROR; } } FList *f_list_clone(FList *some_node) { - FList *new = NULL, *node; + FList *new = NULL, *node; - CHECK_IS_FLIST(some_node, "f_list_clone()") + CHECK_IS_FLIST(some_node, __func__) for (node = f_list_first(some_node); IS_FLIST(node); node = node->next) new = f_list_add_at_end(new, node->url, node->title, node->selected, node->rank); diff -Nru tickr-0.6.4/src/tickr/tickr_list.h tickr-0.7.0/src/tickr/tickr_list.h --- tickr-0.6.4/src/tickr/tickr_list.h 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_list.h 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -21,10 +21,10 @@ #define FLIST_URL_MAXLEN FILE_NAME_MAXLEN #define FLIST_TITLE_MAXLEN FEED_TITLE_MAXLEN -#define N_FLIST_MAX (32 * 1024) /* To prevent infinite loops - adjust as necessary */ -#define FLIST_SIG "fl_node" /* Make sure FLIST_SIG_LEN = strlen(FLIST_SIG) */ +#define N_FLIST_MAX (32 * 1024) /* To prevent infinite loops - adjust as necessary */ +#define FLIST_SIG "fl_node" /* Make sure FLIST_SIG_LEN = strlen(FLIST_SIG) */ #define FLIST_SIG_LEN 7 -#define FLIST_RANK_FORMAT "%3d" /* Make sure format and length match */ +#define FLIST_RANK_FORMAT "%3d" /* Make sure format and length match */ #define FLIST_RANK_STR_LEN 3 #define BLANK_STR_16 " " /* Make sure FLIST_RANK_STR_LEN < (BLANK_STR_)16 */ @@ -35,39 +35,38 @@ (node != NULL && strcmp(node->sig, FLIST_SIG) == 0) #define CHECK_IS_FLIST(node, func)\ - if (!IS_FLIST(node)) {\ - big_error(FLIST_ERROR, 2, func, ": Invalid node in list");\ - } + if (!IS_FLIST(node))\ + big_error(FLIST_ERROR, "%s(): Invalid node in list", func); typedef struct FeedListNode { char *url; char *title; - gboolean selected; + zboolean selected; char rank[FLIST_RANK_STR_LEN + 1]; struct FeedListNode *prev; struct FeedListNode *next; char sig[FLIST_SIG_LEN + 1]; } FList; -FList *f_list_new(const char *, const char *, gboolean, const char *); -void f_list_free(FList *); -void f_list_free_all(FList *); -FList *f_list_first(FList *); -FList *f_list_last(FList *); -FList *f_list_prev(FList *); -FList *f_list_next(FList *); -FList *f_list_nth(FList *, int); -int f_list_index(FList *); -int f_list_count(FList *); -FList *f_list_add_at_start(FList *, const char *, const char *, gboolean, const char *); -FList *f_list_add_at_end(FList *, const char *, const char *, gboolean, const char *); -FList *f_list_insert_before(FList *, const char *, const char *, gboolean, const char *); -FList *f_list_insert_after(FList *, const char *, const char *, gboolean, const char *); -FList *f_list_remove(FList *); -void f_list_swap(FList *, FList *); -FList *f_list_sort(FList *); -int f_list_search(FList *, const char *); -int f_list_load_from_file(FList **, const char *); -int f_list_save_to_file(FList *, const char *); -FList *f_list_clone(FList *); +FList *f_list_new(const char *, const char *, zboolean, const char *); +void f_list_free(FList *); +void f_list_free_all(FList *); +FList *f_list_first(FList *); +FList *f_list_last(FList *); +FList *f_list_prev(FList *); +FList *f_list_next(FList *); +FList *f_list_nth(FList *, int); +int f_list_index(FList *); +int f_list_count(FList *); +FList *f_list_add_at_start(FList *, const char *, const char *, zboolean, const char *); +FList *f_list_add_at_end(FList *, const char *, const char *, zboolean, const char *); +FList *f_list_insert_before(FList *, const char *, const char *, zboolean, const char *); +FList *f_list_insert_after(FList *, const char *, const char *, zboolean, const char *); +FList *f_list_remove(FList *); +void f_list_swap(FList *, FList *); +FList *f_list_sort(FList *); +int f_list_search(FList *, const char *); +int f_list_load_from_file(FList **, const char *); +int f_list_save_to_file(FList *, const char *); +FList *f_list_clone(FList *); #endif /* INC_TICKR_LIST_H */ diff -Nru tickr-0.6.4/src/tickr/tickr_main.c tickr-0.7.0/src/tickr/tickr_main.c --- tickr-0.6.4/src/tickr/tickr_main.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_main.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -18,46 +18,22 @@ #include "tickr.h" -#define START_PAUSE_TICKER_WHILE_OPENING\ - int suspend_rq_bak = env->suspend_rq;\ - env->suspend_rq = TRUE; - -#define END_PAUSE_TICKER_WHILE_OPENING\ - env->suspend_rq = suspend_rq_bak; - -/* Sometimes, we need to temporarily re-enable popups, just to get error messages. */ -#define START_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING\ - int suspend_rq_bak;\ - char disable_popups_bak;\ - suspend_rq_bak = env->suspend_rq;\ - env->suspend_rq = TRUE;\ - disable_popups_bak = get_params()->disable_popups;\ - get_params()->disable_popups = 'n'; - -#define END_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING\ - get_params()->disable_popups = disable_popups_bak;\ - env->suspend_rq = suspend_rq_bak; - -#define IF_UI_ALLOWED if (!no_ui) - -#ifdef G_OS_WIN32 -FILE *stdout_fp, *stderr_fp; -#endif - -static TickerEnv *env; -static Resource *resrc; -static FList *feed_list; -static FList *feed_selection; -static Params *prm; +/* + * Static global structs and variables for this module, with related setter/getter + * functions for all other modules. + */ +static TickerEnv *env = NULL; +static Resource *resrc = NULL; +static FList *feed_list = NULL, *feed_selection = NULL; +static Params *prm = NULL; static int instance_id = 0; -static gboolean no_ui = FALSE; -static int shift_counter = 0; -static GtkWidget *popup_menu; +static zboolean no_ui = FALSE; +static int speed_up_flag = FALSE; +static int slow_down_flag = FALSE; + +static GtkWidget *main_hbox, *vbox_ticker, *vbox_clock, *popup_menu; static GtkAccelGroup *popup_menu_accel_group; static int popup_menu_accel_group_attached; -static GtkWidget *main_hbox, *vbox_ticker, *vbox_clock; -static int speed_up_flag = FALSE; -static int speed_down_flag = FALSE; TickerEnv *get_ticker_env() { @@ -99,102 +75,144 @@ return instance_id; } -/* Prototypes for a few static funcs */ -static void show_resource_info(); -static gint shift2left_callback(); -static void check_time_load_resource(check_time_mode); +/* Prototypes for static funcs */ +static void modify_params0(); +static void connection_settings0(); +static int shift2left_callback(); +static void check_time_load_resource_from_selection(check_time_mode); -void check_main_win_always_on_top() -{ - if (prm->always_on_top == 'y') - gtk_window_set_keep_above(GTK_WINDOW(env->win), TRUE); - else - gtk_window_set_keep_above(GTK_WINDOW(env->win), FALSE); -} +#define START_PAUSE_TICKER_WHILE_OPENING\ + int suspend_rq_bak = env->suspend_rq;\ + env->suspend_rq = TRUE; + +#define END_PAUSE_TICKER_WHILE_OPENING\ + env->suspend_rq = suspend_rq_bak; + +/* Sometimes, we need to temporarily re-enable popups, just to get error messages. */ +#define START_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING\ + int suspend_rq_bak;\ + char disable_popups_bak;\ + suspend_rq_bak = env->suspend_rq;\ + env->suspend_rq = TRUE;\ + disable_popups_bak = get_params()->disable_popups;\ + get_params()->disable_popups = 'n'; + +#define END_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING\ + get_params()->disable_popups = disable_popups_bak;\ + env->suspend_rq = suspend_rq_bak; /* - * funct_name2(***NO args***) only used to call funct_name(***args***) + * funct_name0(***NO args***) is only used to call funct_name(***args***) from popup menus. */ -static void get_new_url2() +static void manage_list_and_selection0() { START_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING - IF_UI_ALLOWED - get_new_url(resrc); + if (!no_ui) + manage_list_and_selection(resrc); END_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING } -static void open_new_txt_file2() +static void open_txt_file0() { START_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING - IF_UI_ALLOWED - open_new_txt_file(resrc); + if (!no_ui) + open_txt_file(resrc); END_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING } -static void import_opml_file2() +static void import_opml_file0() { START_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING - IF_UI_ALLOWED - import_opml_file(); + if (!no_ui) + if (import_opml_file() == OK) + manage_list_and_selection(resrc); END_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING } -static void export_opml_file2() +static void export_opml_file0() { START_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING - IF_UI_ALLOWED + if (!no_ui) export_opml_file(); END_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING } -static void show_resource_info2() +static void show_resource_info0() { START_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING - show_resource_info(); + show_resource_info(get_resource()); END_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING } -void modify_params2() +static void easily_modify_params0() { + next_action i; + START_PAUSE_TICKER_WHILE_OPENING - IF_UI_ALLOWED - if (modify_params(prm) == 1) /* 1 means we want to immediately reopen the dialog */ - modify_params2(prm); + if (!no_ui) { + if ((i = easily_modify_params(prm)) == DO_NEXT_REOPEN) { + END_PAUSE_TICKER_WHILE_OPENING + easily_modify_params0(prm); + } else if (i == DO_NEXT_OPEN_FULL_SETTINGS) { + END_PAUSE_TICKER_WHILE_OPENING + modify_params0(); + } else if (i == DO_NEXT_OPEN_CONN_SETTINGS) { + END_PAUSE_TICKER_WHILE_OPENING + connection_settings0(); + } + } END_PAUSE_TICKER_WHILE_OPENING } -static void connection_settings2() +static void modify_params0() { + next_action i; + START_PAUSE_TICKER_WHILE_OPENING - IF_UI_ALLOWED + if (!no_ui) { + if ((i = modify_params(prm)) == DO_NEXT_REOPEN) { + END_PAUSE_TICKER_WHILE_OPENING + modify_params0(prm); + } else if (i == DO_NEXT_OPEN_CONN_SETTINGS) { + END_PAUSE_TICKER_WHILE_OPENING + connection_settings0(); + } + } + END_PAUSE_TICKER_WHILE_OPENING +} + +static void connection_settings0() +{ + START_PAUSE_TICKER_WHILE_OPENING + if (!no_ui) if (connection_settings(AUTH_PAGE) == GTK_RESPONSE_OK) current_feed(); END_PAUSE_TICKER_WHILE_OPENING } -static void import_params2() +static void import_params0() { START_PAUSE_TICKER_WHILE_OPENING - IF_UI_ALLOWED + if (!no_ui) import_params(); END_PAUSE_TICKER_WHILE_OPENING } -static void export_params2() +static void export_params0() { START_PAUSE_TICKER_WHILE_OPENING - IF_UI_ALLOWED + if (!no_ui) export_params(); END_PAUSE_TICKER_WHILE_OPENING } static void pause_on_mouseover_enabled_warning_once() { - static int first_run = -1; + static int first_run = -1; if (prm->pause_on_mouseover == 'y') { if (first_run == -1) - warning(FALSE, 1, + warning(BLOCK, "Setting 'Pause ticker on mouse-over' is enabled. When so, playing/pausing\n" "is always controlled by mouse pointer motions as well."); first_run++; @@ -221,36 +239,36 @@ env->suspend_rq = FALSE; } -static void first_feed2() +static void first_feed0() { if (env->selection_mode == MULTIPLE) first_feed(); else - info_win_wait("Single selection mode", INFO_WIN_WAIT_TIMEOUT); + info_win_no_block("Single selection mode", INFO_WIN_WAIT_TIMEOUT); } -static void previous_feed2() +static void previous_feed0() { if (env->selection_mode == MULTIPLE) previous_feed(); else - info_win_wait("Single selection mode", INFO_WIN_WAIT_TIMEOUT); + info_win_no_block("Single selection mode", INFO_WIN_WAIT_TIMEOUT); } -static void next_feed2() +static void next_feed0() { if (env->selection_mode == MULTIPLE) next_feed(); else - info_win_wait("Single selection mode", INFO_WIN_WAIT_TIMEOUT); + info_win_no_block("Single selection mode", INFO_WIN_WAIT_TIMEOUT); } -static void last_feed2() +static void last_feed0() { if (env->selection_mode == MULTIPLE) last_feed(); else - info_win_wait("Single selection mode", INFO_WIN_WAIT_TIMEOUT); + info_win_no_block("Single selection mode", INFO_WIN_WAIT_TIMEOUT); } void toggle_speed_up_flag() @@ -258,152 +276,50 @@ speed_up_flag = TRUE; } -void toggle_speed_down_flag() +void toggle_slow_down_flag() { - speed_down_flag = TRUE; + slow_down_flag = TRUE; } -static void help_win2() +static void help_win0() { START_PAUSE_TICKER_WHILE_OPENING help_win(); END_PAUSE_TICKER_WHILE_OPENING } -static void online_help2() +static void online_help0() { START_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING online_help(); END_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING } -static void check_for_updates2() +static void check_for_updates0() { START_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING check_for_updates(); END_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING } -static void about_win2() +static void about_win0() { START_PAUSE_TICKER_WHILE_OPENING about_win(); END_PAUSE_TICKER_WHILE_OPENING } -static void show_resource_info() -{ - GtkWidget *dialog, *table, *label[7], *close_but; - char tmp1[256], *tmp2, *tmp3; - int i, j; - - if (resrc->type != RESRC_URL && resrc->type != RESRC_FILE) { - info_win("Resource Properties", "\nNo information available\n", INFO_ERROR, FALSE); - return; - } - - gtk_window_set_keep_above(GTK_WINDOW(get_ticker_env()->win), FALSE); - - dialog = gtk_dialog_new_with_buttons( - "Resource Properties", GTK_WINDOW(get_ticker_env()->win), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - NULL); - - close_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL_CLOSE); - close_but = close_but; /* To get rid of one stupid compiler warning */ - - set_tickr_icon_to_dialog(GTK_WINDOW(dialog)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); - gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); - - g_signal_connect(G_OBJECT(dialog), "key-press-event", G_CALLBACK(esc_key_pressed), NULL); - g_signal_connect(G_OBJECT(dialog), "delete_event", G_CALLBACK(force_quit_dialog), NULL); - - table = gtk_table_new(3, 3, FALSE); - gtk_table_set_row_spacings(GTK_TABLE(table), 5); - gtk_container_set_border_width(GTK_CONTAINER(table), 15); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table); - - label[0] = gtk_label_new(" "); - if (resrc->type == RESRC_URL) { - label[1] = gtk_label_new("Resource type:"); - snprintf(tmp1, 256, "%s Feed", resrc->format == RSS_2_0 ? "RSS 2.0" : \ - (resrc->format == RSS_ATOM ? "Atom" : "RSS 1.0")); - label[2] = gtk_label_new(tmp1); - - label[3] = gtk_label_new("Feed title:"); - label[4] = gtk_label_new(resrc->feed_title); - - label[5] = gtk_label_new("Feed URL:"); - tmp2 = l_str_new("id[i] != '\0' && j < (FILE_NAME_MAXLEN * 2) - 4; i++, j++) - if (resrc->id[i] != '&') - tmp3[j] = resrc->id[i]; - else { - str_n_cpy(tmp3 + j, "&", 5); - j += 4; - } - tmp3[j] = '\0'; - tmp2 = l_str_cat(tmp2, tmp3); - tmp2 = l_str_cat(tmp2, "\">"); - tmp2 = l_str_cat(tmp2, tmp3); - tmp2 = l_str_cat(tmp2, ""); - label[6] = gtk_label_new(tmp2); - l_str_free(tmp2); - free2(tmp3); - gtk_label_set_use_markup(GTK_LABEL(label[6]), TRUE); - - for (i = 0; i < 7; i++) - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); -#ifdef VERBOSE_OUTPUT - fprintf(STD_OUT, "Resource properties:\n" - " Resource type: %s\n Feed title: %s\n Feed URL: %s\n", - tmp1, resrc->feed_title, resrc->id); -#endif - } else if (resrc->type == RESRC_FILE) { - label[1] = gtk_label_new("Resource type: "); - label[2] = gtk_label_new("File"); - - label[3] = gtk_label_new("File name: "); - label[4] = gtk_label_new(resrc->id); - gtk_label_set_selectable(GTK_LABEL(label[4]), TRUE); - - for (i = 0; i < 5; i++) - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); -#ifdef VERBOSE_OUTPUT - fprintf(STD_OUT, "Resource Properties:\n" - " Resource type: File\n File name: %s\n", resrc->id); -#endif - } - - gtk_table_attach_defaults(GTK_TABLE(table), label[0], 1, 2, 0, 1); - - gtk_table_attach_defaults(GTK_TABLE(table), label[1], 0, 1, 0, 1); - gtk_table_attach_defaults(GTK_TABLE(table), label[2], 2, 3, 0, 1); - - gtk_table_attach_defaults(GTK_TABLE(table), label[3], 0, 1, 1, 2); - gtk_table_attach_defaults(GTK_TABLE(table), label[4], 2, 3, 1, 2); - - if (resrc->type == RESRC_URL) { - gtk_table_attach_defaults(GTK_TABLE(table), label[5], 0, 1, 2, 3); - gtk_table_attach_defaults(GTK_TABLE(table), label[6], 2, 3, 2, 3); - } - - gtk_widget_show_all(dialog); - while (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_CANCEL_CLOSE); - - gtk_widget_destroy(dialog); - check_main_win_always_on_top(); -} - -#ifdef G_OS_WIN32 +/* Find default browser if none is set. */ static int easily_link_with_browser2() { - char *browser_cmd_p, browser_cmd[512], tmp[1024]; + char browser_cmd[512], tmp[1024]; + int error_code = NO_BROWSER_SET_ERROR; + +#ifndef G_OS_WIN32 + str_n_cpy(browser_cmd, OPENLINKCMD, 511); +#else + char *browser_cmd_p; unsigned int i, count, start = 0, end = 0; - int exit_status = NO; if ((browser_cmd_p = (char *)get_default_browser_from_win32registry()) != NULL) { /* Find 1st string in browser_cmd */ @@ -418,83 +334,107 @@ } } str_n_cpy(browser_cmd, tmp + start, MIN((end - start + 1), 511)); - snprintf(tmp, 1024, - "\nThis is the Shell command that opens your default Browser:\n\n%s\n\n" - "Do you want to use it (recommended) ?\n", browser_cmd); - if (question_win(tmp) == YES) { - exit_status = YES; - str_n_cpy(prm->open_link_cmd, browser_cmd, FILE_NAME_MAXLEN); - str_n_cpy(prm->open_link_args, "", FILE_NAME_MAXLEN); - if (question_win("Save this parameter ?") == YES) - save_to_config_file(prm); - } else - info_win("", "\nCancelled.\n" - "You may too set this parameter manually in the Preferences window.\n", - INFO, FALSE); - } else + } else { info_win("", "\nCan't find Browser shell command." - "You will have to set this parameter manually in the Preferences window.\n", + "You will have to set this parameter manually in the Full Settings window.\n", INFO_ERROR, FALSE); - return exit_status; + return error_code; + } +#endif + snprintf(tmp, 1024, + "\nThis is the Shell command that opens your default Browser:\n\n%s\n\n" + "Do you want to use it ?\n", browser_cmd); + if (question_win(tmp, YES) == YES) { + str_n_cpy(prm->open_link_cmd, browser_cmd, FILE_NAME_MAXLEN); + str_n_cpy(prm->open_link_args, "", FILE_NAME_MAXLEN); + save_to_config_file(prm); + error_code = OK; + } else + info_win("", "\nCancelled.\n" + "You may set this parameter manually in the Full Settings window.\n", + INFO, FALSE); + return error_code; } -static void easily_link_with_browser() +int easily_link_with_browser() { + int error_code; + gtk_window_set_keep_above(GTK_WINDOW(env->win), FALSE); - easily_link_with_browser2(); + error_code = easily_link_with_browser2(); check_main_win_always_on_top(); + return error_code; } -#endif -/* If link found, copy it into env->active_link and return rank (starting at 1), - * otherwise, return -1 (with link = "") */ +/* + * If link found, copy it into env->active_link and return rank (starting at 1), + * otherwise, return -1 (with env->active_link = ""). + */ static int get_visible_link_and_rank(int position_x_in_drwa) { - int i, location_on_surface; + int location_on_surface, n_links, i; + zboolean link_found = FALSE; + env->active_link[0] = '\0'; if (position_x_in_drwa > -1) { - location_on_surface = shift_counter * prm->shift_size + position_x_in_drwa; - for (i = 0; i < NFEEDLINKANDOFFSETMAX; i++) { - if (resrc->link_and_offset[i].offset_in_surface > location_on_surface) { - str_n_cpy(env->active_link, resrc->link_and_offset[i].url, FILE_NAME_MAXLEN); - return i; + for (n_links = NFEEDLINKANDOFFSETMAX - 1; n_links >= 0; n_links--) + if (resrc->link_and_offset[n_links].offset_in_surface > 0) + break; + if (STANDARD_SCROLLING) { + location_on_surface = (env->shift_counter * prm->shift_size) + position_x_in_drwa + + get_links_extra_offset(); + for (i = 0; i <= n_links; i++) { /* First link rank = 1 */ + if (resrc->link_and_offset[i].offset_in_surface > location_on_surface) { + link_found = TRUE; + break; + } } + } else { + location_on_surface = env->surf_width - env->drwa_width - + (env->shift_counter * prm->shift_size) + position_x_in_drwa + + get_links_extra_offset(); + for (i = n_links; i >= 0; i--) { + if (resrc->link_and_offset[i].offset_in_surface < location_on_surface && + resrc->link_and_offset[i - 1].offset_in_surface > location_on_surface) { + link_found = TRUE; + break; + } + } + } + if (link_found && i > 0 && i <= n_links) { + str_n_cpy(env->active_link, resrc->link_and_offset[i].url, FILE_NAME_MAXLEN); + DEBUG_INFO("Link found (rank = %d)\n", i); + /*show_str_beginning_and_end(env->active_link);*/ + return i; } + DEBUG_INFO("No link found\n"); } - env->active_link[0] = '\0'; return -1; } static void open_link() { - char tmp1[FILE_NAME_MAXLEN + 1], tmp2[FILE_NAME_MAXLEN + 1]; - char *argv[32]; /* Up to 32 - 3 (prog name, url, NULL) args */ - GPid pid; - GError *error = NULL; - int i, j; + char tmp1[FILE_NAME_MAXLEN + 1], tmp2[FILE_NAME_MAXLEN + 1]; + char *argv[32]; /* Up to 32 - 3 (prog name, URL, NULL) args */ + GPid pid; + GError *error = NULL; + int i, j; if (prm->open_link_cmd[0] == '\0') { -#ifndef G_OS_WIN32 - /* TODO: should look for default browser */ - warning(FALSE, 2, "Can't launch Browser: no command is defined.\n", - "Please set the 'Open in Browser' option in the Preferences window."); - return; -#else easily_link_with_browser(); if (prm->open_link_cmd[0] == '\0') { - warning(FALSE, 2, "Can't launch Browser: no command is defined.\n", - "Please set the 'Open in Browser' option in the Preferences window."); + warning(BLOCK, "Can't launch Browser: no command is defined.\n", + "Please set the 'Open in Browser' option in the Full Settings window."); return; } -#endif } if (env->active_link[0] == '\0') { - warning(FALSE, 1, "No link found"); + warning(BLOCK, "No link found"); return; } - fprintf(STD_OUT, "Spawning: %s %s %s\n", prm->open_link_cmd, prm->open_link_args, env->active_link); + INFO_OUT("Spawning: %s %s %s\n", prm->open_link_cmd, prm->open_link_args, env->active_link) str_n_cpy(tmp1, prm->open_link_cmd, FILE_NAME_MAXLEN); str_n_cpy(tmp2, prm->open_link_args, FILE_NAME_MAXLEN); argv[0] = tmp1; @@ -509,28 +449,39 @@ argv[j] = env->active_link; argv[j + 1] = NULL; if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &pid, &error)) { - warning(FALSE, 3, APP_NAME": Can't create process ", argv[0], " - ", error->message); + warning(BLOCK, "%s: Can't create process %s - %s", APP_NAME, argv[0], error->message); #ifndef G_OS_WIN32 - info_win("", "Please check the 'Open in Browser' option in the Preferences window.", + info_win("", "Please check the 'Open in Browser' option in the Full Settings window.", INFO_WARNING, FALSE); #else - if (easily_link_with_browser2() == YES) + if (easily_link_with_browser2() == OK) open_link(); #endif } else g_spawn_close_pid(pid); } -static void open_link2() +static void open_link0() { get_visible_link_and_rank(env->drwa_width / 2); open_link(); } -/* Continuously get mouse x position inside drawing area. +/*static void mark_item() +{ +} + +static void mark_item0() +{ + mark_item(); +}*/ + +/* + * Continuously get mouse x position inside drawing area. * Do nothing if outside, so must be used only by mouse-over-drawing-area / - * click-on-drawing-area funcs. */ -static gint track_mouse_position_x(GtkWidget *widget, GdkEventMotion *event) + * click-on-drawing-area funcs. + */ +static int track_mouse_position_x(GtkWidget *widget, GdkEventMotion *event) { widget = widget; if (event->type == GDK_MOTION_NOTIFY) /* Means mouse has moved inside widget */ @@ -538,12 +489,11 @@ return FALSE; } -static gint left_click_on_drawing_area(GtkWidget *widget, GdkEventButton *event_but) +static int left_click_on_drawing_area(GtkWidget *widget, GdkEventButton *event_but) { widget = widget; if (prm->disable_leftclick != 'y' && event_but->type == GDK_BUTTON_PRESS &&\ event_but->button == 1) { /* 1 = mouse left button */ - /* NEW */ if (event_but->state & GDK_CONTROL_MASK) { /* Do nothing so far */ return FALSE; @@ -559,20 +509,20 @@ return FALSE; } -static gint right_click_on_drawing_area(GtkWidget *widget, GdkEventButton *event_but) +static int right_click_on_drawing_area(GtkWidget *widget, GdkEventButton *event_but) { widget = widget; if (event_but->type == GDK_BUTTON_PRESS && event_but->button == 3) { /* 3 = mouse right button */ - /* NEW */ if (event_but->state & GDK_CONTROL_MASK) { - quick_feed_picker(); /* NEW - OK ? */ + quick_feed_picker(); return TRUE; } else if (event_but->state & GDK_MOD1_MASK) { /* = alt */ /* Do nothing so far */ return FALSE; } else { /* Popup main menu */ - gtk_menu_popup(GTK_MENU(popup_menu), NULL, NULL, NULL, NULL, event_but->button, event_but->time); + gtk_menu_popup(GTK_MENU(popup_menu), NULL, NULL, NULL, NULL, + event_but->button, event_but->time); return TRUE; } } else @@ -594,7 +544,7 @@ str_n_cpy(tmp1[i], resrc->id, 256); else str_n_cpy(tmp1[i], "No resource", 256); - snprintf(tmp2[i], 64, " | %s-%s", APP_NAME, APP_VERSION_NUMBER); + snprintf(tmp2[i], 64, " | %s-%s", APP_NAME, APP_V_NUM); return (const char *)str_n_cat(tmp1[i], tmp2[i], 63); } @@ -602,14 +552,13 @@ { FILE *fp; char *str1, tmp[4]; - size_t str1_size = 8 * 1024; + size_t str1_size = FGETS_STR_MAXLEN; static char *str2 = NULL; int tag_found = FALSE; if (str2 != NULL) l_str_free(str2); str2 = l_str_new(""); - str2[0] = '\0'; if (rank == -1) return str2; if ((fp = g_fopen(resrc->xml_dump_extra, "rb")) != NULL) { @@ -638,13 +587,13 @@ static const char *get_ticker_tooltip_text(int rank) { - static char *tooltip_text = NULL; + static char *tooltip_text = NULL; if (tooltip_text != NULL) { l_str_free(tooltip_text); tooltip_text = NULL; } - if ((prm->item_title == 'y' && prm->item_description == 'n') ||\ + if ((prm->item_title == 'y' && prm->item_description == 'n') || (prm->item_title == 'n' && prm->item_description == 'y')) { tooltip_text = l_str_new(get_feed_extra_info(rank)); if (tooltip_text[0] != '\0') @@ -656,7 +605,7 @@ } /* Pause ticker when mouse pointer is over (opened) popup menu. */ -static gint mouse_over_opened_popup_menu(GtkWidget *widget, GdkEvent *event) +static int mouse_over_opened_popup_menu(GtkWidget *widget, GdkEvent *event) { widget = widget; if (prm->pause_on_mouseover == 'y') { @@ -669,9 +618,9 @@ } /* Pause ticker on mouseover. */ -static gint mouse_over_drawing_area(GtkWidget *widget, GdkEvent *event) +static int mouse_over_drawing_area(GtkWidget *widget, GdkEvent *event) { - int rank; + int rank; widget = widget; if (event->type == GDK_ENTER_NOTIFY || event->type == GDK_LEAVE_NOTIFY) { @@ -682,7 +631,7 @@ env->suspend_rq = FALSE; } if (event->type == GDK_ENTER_NOTIFY) { - while (gdk_events_pending()) /* So that "motion-notify-event" is processed now */ + while (gdk_events_pending()) /* So that "motion-notify-event" is processed now. */ gtk_main_iteration(); rank = get_visible_link_and_rank(env->mouse_x_in_drwa); gtk_widget_set_tooltip_text(widget, get_ticker_tooltip_text(rank)); @@ -693,39 +642,39 @@ return FALSE; } -static gint mouse_wheel_scroll_on_drawing_area(GtkWidget *widget, GdkEvent *event) +static int mouse_wheel_action_on_drawing_area(GtkWidget *widget, GdkEvent *event) { - char mouse_wheel_scroll; + char mouse_wheel_action; widget = widget; if (event->type == GDK_SCROLL) { - mouse_wheel_scroll = prm->mouse_wheel_scroll; + mouse_wheel_action = prm->mouse_wheel_action; if (event->scroll.state & GDK_CONTROL_MASK) { - /* If ctrl pressed, invert mouse_wheel_scroll values */ - if (mouse_wheel_scroll == 's') - mouse_wheel_scroll = 'f'; - else if (mouse_wheel_scroll == 'f') - mouse_wheel_scroll = 's'; + /* If pressed, invert mouse_wheel_action */ + if (mouse_wheel_action == 's') + mouse_wheel_action = 'f'; + else if (mouse_wheel_action == 'f') + mouse_wheel_action = 's'; } - if (mouse_wheel_scroll == 's') { + if (mouse_wheel_action == 's') { if (event->scroll.direction == GDK_SCROLL_UP) toggle_speed_up_flag(); else if (event->scroll.direction == GDK_SCROLL_DOWN) - toggle_speed_down_flag(); + toggle_slow_down_flag(); env->suspend_rq = FALSE; return TRUE; - } else if (mouse_wheel_scroll == 'f') { + } else if (mouse_wheel_action == 'f') { if (env->selection_mode == MULTIPLE) { /* Seems buggy if (event->scroll.direction == GDK_SCROLL_UP) - next_feed2(); + next_feed0(); else if (event->scroll.direction == GDK_SCROLL_DOWN) - previous_feed2();*/ + previous_feed0();*/ quick_feed_picker(); env->suspend_rq = FALSE; } else - warning(FALSE, 2, "Single selection mode\n", - "(You have set 'Mouse wheel scrolling applies to: Feed')"); + warning(BLOCK, "Single selection mode\n", + "(You have set 'Mouse Wheel acts on: Feed')"); return TRUE; } } @@ -736,102 +685,108 @@ * Popup menu stuff */ static GtkItemFactoryEntry popup_menu_item[] = { - {"/_File", NULL, NULL, 0, "", NULL}, + {"/_File", NULL, NULL, 0, "", NULL}, + + {"/File/Feed Organizer (_RSS|Atom)", "R", manage_list_and_selection0, 0, "", + (gconstpointer)RSS_ICON}, - {"/File/Open Feed (_RSS|Atom)", "R", get_new_url2, 0, "", - (gconstpointer)RSS_ICON}, + {"/File/Open _Text File", "T", open_txt_file0, 0, "", + (gconstpointer)GTK_STOCK_OPEN}, - {"/File/Open _Text File", "T", open_new_txt_file2, 0, "", - (gconstpointer)GTK_STOCK_OPEN}, + {"/File/sep", NULL, NULL, 0, "", NULL}, - {"/File/sep", NULL, NULL, 0, "", NULL}, + {"/File/_Import Feed List (OPML)", "I", import_opml_file0, 0, NULL, NULL}, - {"/File/_Import Feed List (OPML)", "I", import_opml_file2, 0, NULL, NULL}, + {"/File/_Export Feed List (OPML)", "E", export_opml_file0, 0, NULL, NULL}, - {"/File/_Export Feed List (OPML)", "E", export_opml_file2, 0, NULL, NULL}, + {"/File/sep", NULL, NULL, 0, "", NULL}, - {"/File/sep", NULL, NULL, 0, "", NULL}, + {"/File/Resource _Properties", "P", show_resource_info0, 0, "", + (gconstpointer)GTK_STOCK_PROPERTIES}, - {"/File/Resource _Properties", "P", show_resource_info2, 0, "", - (gconstpointer)GTK_STOCK_PROPERTIES}, + {"/File/sep", NULL, NULL, 0, "", NULL}, - {"/File/sep", NULL, NULL, 0, "", NULL}, + {"/File/_Quit", "Q", gtk_main_quit, 0, "", + (gconstpointer)GTK_STOCK_QUIT}, - {"/File/_Quit", "Q", gtk_main_quit, 0, "", - (gconstpointer)GTK_STOCK_QUIT}, + {"/_Edit", NULL, NULL, 0, "", NULL}, - {"/_Edit", NULL, NULL, 0, "", NULL}, + {"/Edit/Preference_s", "S", easily_modify_params0, 0, "", + (gconstpointer)GTK_STOCK_PREFERENCES}, - {"/Edit/Preference_s", "S", modify_params2, 0, "", - (gconstpointer)GTK_STOCK_PREFERENCES}, + {"/Edit/Full Settings", "", modify_params0, 0, "", + (gconstpointer)GTK_STOCK_PREFERENCES}, - {"/Edit/Connection Settings", "", connection_settings2, 0, "", - (gconstpointer)GTK_STOCK_CONNECT}, + {"/Edit/Connection Settings", "", connection_settings0, 0, "", + (gconstpointer)GTK_STOCK_CONNECT}, - {"/Edit/sep", NULL, NULL, 0, "", NULL}, + {"/Edit/sep", NULL, NULL, 0, "", NULL}, - {"/Edit/Import Preferences", "", import_params2, 0, NULL, NULL}, + {"/Edit/Import Settings", "", import_params0, 0, NULL, NULL}, - {"/Edit/Export Preferences", "", export_params2, 0, NULL, NULL}, + {"/Edit/Export Settings", "", export_params0, 0, NULL, NULL}, - {"/_Control", NULL, NULL, 0, "", NULL}, + {"/_Control", NULL, NULL, 0, "", NULL}, - {"/Control/Open Link in _Browser", "B", open_link2, 0, "", - (gconstpointer)GTK_STOCK_JUMP_TO/*GTK_STOCK_REDO*/}, + {"/Control/Open Link in _Browser", "B", open_link0, 0, "", + (gconstpointer)GTK_STOCK_JUMP_TO/*GTK_STOCK_REDO*/}, - {"/Control/sep", NULL, NULL, 0, "", NULL}, + /*{"/Control/_Mark Item", "M", mark_item0, 0, "", + (gconstpointer)GTK_STOCK_OK},*/ - {"/Control/Play", "J", ticker_play, 0, "", - (gconstpointer)GTK_STOCK_MEDIA_PLAY}, + {"/Control/sep", NULL, NULL, 0, "", NULL}, - {"/Control/Pause", "K", ticker_pause, 0, "", - (gconstpointer)GTK_STOCK_MEDIA_PAUSE}, + {"/Control/Play", "J", ticker_play, 0, "", + (gconstpointer)GTK_STOCK_MEDIA_PLAY}, - {"/Control/Reload", "L", ticker_reload, 0, "", - (gconstpointer)GTK_STOCK_REFRESH}, + {"/Control/Pause", "K", ticker_pause, 0, "", + (gconstpointer)GTK_STOCK_MEDIA_PAUSE}, - {"/Control/sep", NULL, NULL, 0, "", NULL}, + {"/Control/Reload", "L", ticker_reload, 0, "", + (gconstpointer)GTK_STOCK_REFRESH}, - {"/Control/First Feed", "", first_feed2, 0, "", - (gconstpointer)GTK_STOCK_GOTO_FIRST}, + {"/Control/sep", NULL, NULL, 0, "", NULL}, - {"/Control/Previous Feed", "", previous_feed2, 0, "", - (gconstpointer)GTK_STOCK_GO_BACK}, + {"/Control/First Feed", "", first_feed0, 0, "", + (gconstpointer)GTK_STOCK_GOTO_FIRST}, - {"/Control/Next Feed", "", next_feed2, 0, "", - (gconstpointer)GTK_STOCK_GO_FORWARD}, + {"/Control/Previous Feed", "", previous_feed0, 0, "", + (gconstpointer)GTK_STOCK_GO_BACK}, - {"/Control/Last Feed", "", last_feed2, 0, "", - (gconstpointer)GTK_STOCK_GOTO_LAST}, + {"/Control/Next Feed", "", next_feed0, 0, "", + (gconstpointer)GTK_STOCK_GO_FORWARD}, - {"/Control/sep", NULL, NULL, 0, "", NULL}, + {"/Control/Last Feed", "", last_feed0, 0, "", + (gconstpointer)GTK_STOCK_GOTO_LAST}, - {"/Control/Speed Up", "U", toggle_speed_up_flag, 0, "", - (gconstpointer)GTK_STOCK_GO_UP}, + {"/Control/sep", NULL, NULL, 0, "", NULL}, - {"/Control/Speed Down", "D", toggle_speed_down_flag, 0, "", - (gconstpointer)GTK_STOCK_GO_DOWN}, + {"/Control/Speed Up", "U", toggle_speed_up_flag, 0, "", + (gconstpointer)GTK_STOCK_GO_UP}, - {"/_Help", NULL, NULL, 0, "", NULL}, + {"/Control/Speed Down", "D", toggle_slow_down_flag, 0, "", + (gconstpointer)GTK_STOCK_GO_DOWN}, - {"/Help/Quick Help", "F1", help_win2, 0, "", - (gconstpointer)GTK_STOCK_HELP}, + {"/_Help", NULL, NULL, 0, "", NULL}, - {"/Help/Online Help", "H", online_help2, 0, NULL, NULL}, + {"/Help/Quick Help", "F1", help_win0, 0, "", + (gconstpointer)GTK_STOCK_HELP}, - {"/Help/Check for Updates", "", check_for_updates2, 0, NULL, NULL}, + {"/Help/Online Help", "H", online_help0, 0, NULL, NULL}, - {"/Help/sep", NULL, NULL, 0, "", NULL}, + {"/Help/Check for Updates", "", check_for_updates0, 0, NULL, NULL}, - {"/Help/_About", "A", about_win2, 0, "", - (gconstpointer)GTK_STOCK_ABOUT}, + {"/Help/sep", NULL, NULL, 0, "", NULL}, + + {"/Help/_About", "A", about_win0, 0, "", + (gconstpointer)GTK_STOCK_ABOUT}, }; -static gint n_popup_menu_items = sizeof(popup_menu_item) / sizeof(popup_menu_item[0]); +static int n_popup_menu_items = sizeof(popup_menu_item) / sizeof(popup_menu_item[0]); static GtkWidget *get_popup_menu_menu(GtkWidget *win) { - GtkItemFactory *item_factory; + GtkItemFactory *item_factory; win = win; popup_menu_accel_group = gtk_accel_group_new(); @@ -840,51 +795,59 @@ return gtk_item_factory_get_widget(item_factory, "
"); } -static gint update_win_dims_and_loc() +void check_main_win_always_on_top() +{ + zboolean z = prm->always_on_top == 'y' ? TRUE : FALSE; + + gtk_window_set_keep_above(GTK_WINDOW(env->win), z); + if (GDK_IS_WINDOW(env->win->window)) + /* Does this make a difference, at all ? */ + gdk_window_set_keep_above(GDK_WINDOW(env->win->window), z); +} + +static int update_win_dims_and_loc() { /* Dimensions */ - gtk_widget_set_size_request(env->drw_a, env->drwa_width, env->drwa_height); - gtk_widget_set_size_request(env->drwa_clock, env->drwa_clock_width, env->drwa_height); + /* Smallest width set to 1 as 0 will result in some weird on screen square artifact */ + gtk_widget_set_size_request(env->drw_a, MAX(env->drwa_width, 1), env->drwa_height); + gtk_widget_set_size_request(env->drwa_clock, MAX(env->drwa_clock_width, 1), env->drwa_height); gtk_widget_set_size_request(env->win, 1, 1); gtk_window_resize(GTK_WINDOW(env->win), env->drwa_width + env->drwa_clock_width, env->drwa_height); - gtk_window_unmaximize(GTK_WINDOW(env->win)); + /* Disabled to fix the flickering-every-500-ms issue on Linux Mint 18 Cinnamon + gtk_window_unmaximize(GTK_WINDOW(env->win));*/ + + /* + * === NEW & experimental - Set override_redirect flag, ie bypass window manager === + * Where should this go ? + */ + if (GDK_IS_WINDOW(env->win->window)) + gdk_window_set_override_redirect(GDK_WINDOW(env->win->window), + prm->override_redirect == 'y' ? TRUE : FALSE); + /*gdk_window_set_type_hint(GDK_WINDOW(env->win->window), + prm->override_redirect == 'y' ? + GDK_WINDOW_TYPE_HINT_DOCK : GDK_WINDOW_TYPE_HINT_NORMAL);*/ /* Location */ gtk_window_move(GTK_WINDOW(env->win), prm->win_x, prm->win_y); return TRUE; } -/* Not used anymore -gboolean params_have_been_changed(Params *new_prm, int n_required_runs) -{ - static Params prm_bak; - static int initial_runs = 0; - - if (initial_runs++ < n_required_runs) { - // 'fake params changes' are required at program startup - memcpy((void *)&prm_bak, (const void *)new_prm, sizeof(Params)); - return TRUE; - } else if (memcmp((const void *)new_prm, (const void *)&prm_bak, sizeof(Params)) != 0) { - memcpy((void *)&prm_bak, (const void *)new_prm, sizeof(Params)); - return TRUE; - } else - return FALSE; -}*/ - -gboolean win_params_have_been_changed(Params *new_prm, int n_required_runs) +/* Check if win needs to be re-computed because of changed params. */ +zboolean win_params_have_been_changed(Params *new_prm, int n_required_runs) { static Params prm_bak0; Params *prm_bak = &prm_bak0; static int initial_runs = 0; - gboolean changes = FALSE; + zboolean changes = FALSE; - if (initial_runs++ < n_required_runs) { - /* 'fake params changes' are required at program startup */ + if (initial_runs < n_required_runs) { + /* 'Fake' params changes are required at program startup */ memcpy((void *)prm_bak, (const void *)new_prm, sizeof(Params)); + initial_runs++; return TRUE; - } else if (strcmp(new_prm->font_n_s, prm_bak->font_n_s) != 0) + } else if (strcmp(new_prm->font_name_size, prm_bak->font_name_size) != 0) changes = TRUE; else if (new_prm->win_x != prm_bak->win_x) changes = TRUE; @@ -898,15 +861,25 @@ changes = TRUE; else if (new_prm->always_on_top != prm_bak->always_on_top) changes = TRUE; + else if (new_prm->win_transparency != prm_bak->win_transparency) + changes = TRUE; else if (new_prm->icon_in_taskbar != prm_bak->icon_in_taskbar) changes = TRUE; else if (new_prm->win_sticky != prm_bak->win_sticky) changes = TRUE; + else if (new_prm->override_redirect != prm_bak->override_redirect) + changes = TRUE; else if (new_prm->clock != prm_bak->clock) changes = TRUE; - else if (strcmp(new_prm->clock_font_n_s, prm_bak->clock_font_n_s) != 0) + else if (new_prm->clock_sec != prm_bak->clock_sec) changes = TRUE; - /* TODO: some other params need to be ckecked too */ + else if (new_prm->clock_12h != prm_bak->clock_12h) + changes = TRUE; + else if (new_prm->clock_date != prm_bak->clock_date) + changes = TRUE; + else if (strcmp(new_prm->clock_font_name_size, prm_bak->clock_font_name_size) != 0) + changes = TRUE; + /* Need to ckeck other params ? */ if (changes == TRUE) { memcpy((void *)prm_bak, (const void *)new_prm, sizeof(Params)); return TRUE; @@ -919,51 +892,56 @@ */ static int compute_surface_and_win() { - char fname[FONT_NAME_MAXLEN + 1], fsize[FONT_SIZE_MAXLEN + 1]; - char cfname[FONT_NAME_MAXLEN + 1], cfsize[FONT_SIZE_MAXLEN + 1]; - gint height1, height2; - int size, render_exit_status, max_width, i; - - /* - * Compute font size from requested height if > 0 - */ - split_font(prm->font_n_s, fname, fsize); - if (prm->win_h > 0) - snprintf(fsize, FONT_SIZE_MAXLEN + 1, "%3d", - get_fsize_from_layout_height((gint)prm->win_h, fname)); - /* In all cases, font size can't be > FONT_MAXSIZE */ - if (atoi(fsize) > FONT_MAXSIZE) - snprintf(fsize, FONT_SIZE_MAXLEN + 1, "%3d", FONT_MAXSIZE); - compact_font(prm->font_n_s, fname, fsize); - /* - * Compute clock font size - * clock height = ticker height unless clock font size is set - * in which case clock height is always <= ticker height - */ - split_font(prm->clock_font_n_s, cfname, cfsize); - if (strcmp(fname, cfname) == 0) { - if (atoi(cfsize) > atoi(fsize)) - str_n_cpy(cfsize, fsize, FONT_SIZE_MAXLEN); - } else { - height1 = get_layout_height_from_fnamesize(prm->clock_font_n_s); - height2 = get_layout_height_from_fnamesize(prm->font_n_s); - if (height1 > height2) { - size = get_fsize_from_layout_height(height2, cfname); - snprintf(cfsize, FONT_SIZE_MAXLEN + 1, "%3d", size); - } - } - compact_font(prm->clock_font_n_s, cfname, cfsize); - /* - * Compute ticker width - */ - max_width = prm->disable_screen_limits == 'y' ? WIN_MAX_W : env->screen_w; - if (prm->win_w >= DRWA_WIDTH_MIN && prm->win_w <= max_width) - env->drwa_width = prm->win_w; - else if (prm->win_w < DRWA_WIDTH_MIN) - env->drwa_width = DRWA_WIDTH_MIN; - else if (prm->win_w > max_width) - env->drwa_width = max_width; - env->drwa_width -= (env->drwa_clock_width = get_clock_width(prm)); + char font_name[FONT_NAME_MAXLEN + 1], font_size[FONT_SIZE_MAXLEN + 1]; + char c_font_name[FONT_NAME_MAXLEN + 1], c_font_size[FONT_SIZE_MAXLEN + 1]; + int height1, height2; + int size, render_error_code, max_width, i; + zboolean new_win_params; + + /* + * The following code needs to be run: + * - twice at program startup (ie once after gtk_widget_show_all() has been called) + * - whenever some window params have been changed + * - not everytime a new feed is loaded + */ + new_win_params = win_params_have_been_changed(prm, 2); + if (new_win_params) { + /* + * Compute font size from requested height if > 0 + */ + adjust_font_size_to_rq_height(prm->font_name_size, prm->win_h); + /* + * Compute clock font size + * clock height = ticker height unless clock font size is set + * in which case clock height is always <= ticker height + */ + split_font(prm->clock_font_name_size, c_font_name, c_font_size); + if (strcmp(font_name, c_font_name) == 0) { + if (atoi(c_font_size) > atoi(font_size)) + str_n_cpy(c_font_size, font_size, FONT_SIZE_MAXLEN); + } else { + height1 = get_layout_height_from_font_name_size(prm->clock_font_name_size); + height2 = get_layout_height_from_font_name_size(prm->font_name_size); + if (height1 > height2) { + size = get_font_size_from_layout_height(height2, c_font_name); + snprintf(c_font_size, FONT_SIZE_MAXLEN + 1, "%3d", size); + } + } + compact_font(prm->clock_font_name_size, c_font_name, c_font_size); + /* + * Compute ticker width + */ + max_width = prm->disable_screen_limits == 'y' ? WIN_MAX_W : env->screen_w; + if (prm->win_w >= DRWA_WIDTH_MIN && prm->win_w <= max_width) + env->drwa_width = prm->win_w; + else if (prm->win_w < DRWA_WIDTH_MIN) + env->drwa_width = DRWA_WIDTH_MIN; + else if (prm->win_w > max_width) + env->drwa_width = max_width; + env->drwa_clock_width = get_clock_width(prm); /* = 0 if no clock, although actual widget width = 1. + * See quick hack below. */ + env->drwa_width -= env->drwa_clock_width; + } /* * Reset link_and_offset stuff */ @@ -982,51 +960,32 @@ /* * Create cairo image surface of rendered text (one long single line) */ - env->c_surf = render_stream_to_surface(resrc->fp, resrc->link_and_offset, prm, &render_exit_status); - if (render_exit_status != OK && render_exit_status != RENDER_NO_RESOURCE) { - switch(render_exit_status) { - case RENDER_NULL_ENDINGSTR: - warning(FALSE, 1, "render_stream_to_surface(): ending string = NULL"); - break; - case RENDER_GETLINE_ERROR: - warning(FALSE, 1, "render_stream_to_surface(): getline() error"); - break; - case RENDER_LINE_TOO_LONG: - warning(FALSE, 1, "render_stream_to_surface(): line too long\n"); - break; - case RENDER_CAIRO_IMAGE_SURFACE_TOO_WIDE: - big_error(RENDER_CAIRO_IMAGE_SURFACE_TOO_WIDE, 1, "render_stream_to_surface(): " - "cairo image surface too wide (> 32 K pixels)"); - break; - case RENDER_CREATE_CAIRO_IMAGE_SURFACE_ERROR: - big_error(RENDER_CREATE_CAIRO_IMAGE_SURFACE_ERROR, 1, "render_stream_to_surface(): " - "can't create cairo image surface"); - break; - default: - warning(FALSE, 2, "render_stream_to_surface(): unknown error ", - itoa2(render_exit_status)); - break; - } - } - if (env->c_surf == NULL) - big_error(render_exit_status, 1, - "render_stream_to_surface(): cairo image surface = NULL"); - env->surf_width = cairo_image_surface_get_width(env->c_surf); - env->surf_height = cairo_image_surface_get_height(env->c_surf); - env->drwa_height = (MIN(env->surf_height, env->screen_h)); - /* Win title */ + env->c_surf = render_stream_to_surface(resrc->fp, resrc->link_and_offset, prm, &render_error_code); + if (env->c_surf != NULL) { + env->surf_width = cairo_image_surface_get_width(env->c_surf); + env->surf_height = cairo_image_surface_get_height(env->c_surf); + env->drwa_height = (MIN(env->surf_height, env->screen_h)); + } else + big_error(render_error_code, "render_stream_to_surface(): %s", + global_error_str(render_error_code)); + /* + * Win stuff + */ + /* Title */ gtk_window_set_title(GTK_WINDOW(env->win), get_win_title_text()); - /* Whole window transparency */ - gtk_window_set_opacity(GTK_WINDOW(env->win), prm->win_transparency); - /* Following code needs to be run - * - twice at program startup (ie once after gtk_widget_show_all() has been called) - * - whenever some window params have been changed - * - not everytime a new feed is loaded. */ - if (win_params_have_been_changed(prm, 2)) { + /* + * The following code needs to be run: + * - twice at program startup (ie once after gtk_widget_show_all() has been called) + * - whenever some window params have been changed + * - not everytime a new feed is loaded + */ + if (new_win_params) { gtk_window_set_keep_above(GTK_WINDOW(env->win), FALSE); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(env->win), FALSE); gtk_window_unstick(GTK_WINDOW(env->win)); - /* Win decoration */ + /* Transparency */ + gtk_window_set_opacity(GTK_WINDOW(env->win), prm->win_transparency); + /* Decoration */ if (prm->windec == 'y') { gtk_window_set_decorated(GTK_WINDOW(env->win), TRUE); if (!popup_menu_accel_group_attached) { @@ -1045,40 +1004,62 @@ gtk_box_reorder_child(GTK_BOX(main_hbox), vbox_clock, 0); else if (prm->clock == 'r') gtk_box_reorder_child(GTK_BOX(main_hbox), vbox_clock, 1); + else + /* + * Quick hack to fix 'remaining 1 pixel wide line when enabling then disabling + * left clock' bug, because then vbox_clock/drwa_clock min size is still 1x1 (not 0x0) + * and is the first widget packed in main_hbox. + * So, when no clock is set, we make sure the 'empty clock widget' is always on + * the right side. + */ + gtk_box_reorder_child(GTK_BOX(main_hbox), vbox_clock, 1); /* Move win */ - gtk_window_move(GTK_WINDOW(env->win), prm->win_x, prm->win_y); - /* Window icon in taskbar? */ - if (prm->icon_in_taskbar == 'y') - gtk_window_set_skip_taskbar_hint(GTK_WINDOW(env->win), FALSE); - else if (prm->icon_in_taskbar == 'n') - gtk_window_set_skip_taskbar_hint(GTK_WINDOW(env->win), TRUE); - /* Window on all desktops? */ + /*gtk_window_move(GTK_WINDOW(env->win), prm->win_x, prm->win_y);*/ + /* Icon in taskbar ? */ + gtk_window_set_skip_taskbar_hint(GTK_WINDOW(env->win), + (prm->icon_in_taskbar == 'y') ? FALSE : TRUE); + /* On all desktops ? */ if (prm->win_sticky == 'y') gtk_window_stick(GTK_WINDOW(env->win)); else if (prm->win_sticky == 'n') gtk_window_unstick(GTK_WINDOW(env->win)); check_main_win_always_on_top(); gtk_window_present(GTK_WINDOW(env->win)); + /* + * === NEW & experimental - Set override_redirect flag, ie bypass window manager === + * Where should this go ? + */ + if (GDK_IS_WINDOW(env->win->window)) + gdk_window_set_override_redirect(GDK_WINDOW(env->win->window), + prm->override_redirect == 'y' ? TRUE : FALSE); + /*gdk_window_set_type_hint(GDK_WINDOW(env->win->window), + prm->override_redirect == 'y' ? + GDK_WINDOW_TYPE_HINT_DOCK : GDK_WINDOW_TYPE_HINT_NORMAL);*/ + /* Move win */ + gtk_window_move(GTK_WINDOW(env->win), prm->win_x, prm->win_y); } while (gtk_events_pending()) gtk_main_iteration(); - return render_exit_status; + return render_error_code; } /* * Timeout handler to render one part of cairo image surface onto drawing - * area - image is shifted to left by pixels + * area - image is shifted to left by pixels. * * Handler 'listens' to flags: suspend_rq, reload_rq, compute_rq and - * stream_fully_read + * feed_fully_rendered. * * Notes: * - reload_rq may be a misleading name as, in multiple selection mode, - * we will load next stream, not reload the same one - * - stream_fully_read is only relevant in multiple selection mode because - * there is no need to reload each time in single selection mode + * we will load next stream, not reload the same one. + * + * - feed_fully_rendered is (or should be) only relevant in multiple selection + * mode because there is no need to reload each time in single selection mode. + * + * - If reverse scrolling param set, actually shift to right. */ -static gint shift2left_callback() +static int shift2left_callback() { cairo_t *cr; GdkRectangle r; @@ -1087,30 +1068,32 @@ if (env->suspend_rq) return TRUE; /* Does nothing - just return */ - /* Can't remember where this magical -8 little adjustment comes from... */ - else if ((shift_counter * prm->shift_size < env->surf_width - env->drwa_width - 8) &&\ + else if ((env->shift_counter * prm->shift_size < env->surf_width - env->drwa_width) && !env->reload_rq && !env->compute_rq) { env->suspend_rq = TRUE; /* * Draw onto ticker area - * (we now use cairo instead of deprecated gdk_draw_ stuff) + * (We now use cairo instead of deprecated gdk_draw_ stuff.) */ /* Checking first can't hurt */ if (env->c_surf == NULL) - big_error(SHIFT2LEFT_NULL_CAIRO_IMAGE_SURFACE, 1, - "shift2left_callback(): cairo image surface = NULL"); + big_error(SHIFT2LEFT_NULL_CAIRO_IMAGE_SURFACE, + "%s(): cairo image surface = NULL", __func__); /* Double buffering disabled for drawing area so we need this */ - gdk_window_get_geometry(env->drw_a->window, &(r.x), &(r.y), NULL, NULL, NULL); - if (prm->clock == 'l') /* We must do that but not quite sure why */ - r.x -= env->drwa_clock_width; + r.x = 0; + r.y = 0; r.width = env->drwa_width; r.height = env->drwa_height; gdk_window_begin_paint_rect(env->drw_a->window, &r); /* Cairo stuff */ cr = gdk_cairo_create(GDK_DRAWABLE(env->drw_a->window)); - /* dest_x - src_x, dest_y - src_y */ - cairo_set_source_surface(cr, env->c_surf, - (shift_counter++ * prm->shift_size), 0); - /* dest_x, dest_y */ + /* cairo_set_source_(): dest_x - src_x, dest_y - src_y */ + if (STANDARD_SCROLLING) + cairo_set_source_surface(cr, env->c_surf, - (env->shift_counter++ * prm->shift_size), 0); + else + cairo_set_source_surface(cr, env->c_surf, - env->surf_width + env->drwa_width + + (env->shift_counter++ * prm->shift_size), 0); + /* cairo_rectangle(): dest_x, dest_y, src_w, src_h */ cairo_rectangle(cr, 0, 0, env->drwa_width, env->drwa_height); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_fill(cr); @@ -1119,17 +1102,17 @@ gdk_window_end_paint(env->drw_a->window); env->suspend_rq = FALSE; /* - * Speeding up/down on the fly + * Speeding up / slowing down on the fly */ - if (speed_up_flag == TRUE || speed_down_flag == TRUE) { + if (speed_up_flag == TRUE || slow_down_flag == TRUE) { if (speed_up_flag == TRUE) { speed_up_flag = FALSE; if (prm->delay > 1) prm->delay--; else return TRUE; - } else if (speed_down_flag == TRUE) { - speed_down_flag = FALSE; + } else if (slow_down_flag == TRUE) { + slow_down_flag = FALSE; if (prm->delay < 50) prm->delay++; else @@ -1142,7 +1125,7 @@ } else { /* * When cairo_image surface scrolling completed or if request to - * reload or recompute everything, will create new surface or next one. + * reload or recompute everything, will create new surface or use next one. */ env->suspend_rq = TRUE; if (env->c_surf != NULL) { @@ -1150,46 +1133,55 @@ env->c_surf = NULL; } i = OK; - if (env->stream_fully_read || env->reload_rq) { - if (env->selection_mode == SINGLE && env->reload_rq) - load_resource(resrc, NULL); - else { - while ((i = load_resource(resrc, feed_selection)) != OK) { - if (i == CONNECT_TOO_MANY_ERRORS && env->selection_mode == MULTIPLE) { - if (get_params()->disable_popups == 'n') { - snprintf(tmp, 256, + if (env->feed_fully_rendered || env->reload_rq) { + if (env->selection_mode == SINGLE) { + if ((i = load_resource_from_selection(resrc, NULL)) != OK) { + if (RESOURCE_ERROR_SSM_QUIT) { + warning(BLOCK, "load_resource_from_selection() error: %s\n\n", + "Will quit now (program was compiled with RESOURCE_ERROR_SSM_QUIT " + "set to TRUE)", global_error_str(i)); + quit_with_cli_info(i); + } + /* + * Nothing more to do here as render_stream_to_surface() will handle + * rescr->fp = NULL. + */ + } + } else while ((i = load_resource_from_selection(resrc, feed_selection)) != OK) { + if (env->selection_mode == MULTIPLE && i == CONNECT_TOO_MANY_ERRORS) { + if (get_params()->disable_popups == 'n') { + snprintf(tmp, 256, "\nFailed to connect %d times in a row.\n\n" "Please check your internet connection and/or " "your connection settings.\n\n" "Switch to single selection mode ?\n", CONNECT_FAIL_MAX); - if (question_win(tmp) == YES) { - env->selection_mode = SINGLE; - break; - } - } else { - fprintf(STD_ERR, + if (question_win(tmp, -1) == YES) { + env->selection_mode = SINGLE; + break; + } + } else { + fprintf(STD_ERR, "Failed to connect %d times in a row\n" "Please check your internet connection and/or " "your connection settings\n", CONNECT_FAIL_MAX); - if (gtk_events_pending()) { - if (gtk_main_iteration_do(FALSE)) - break; - } else + if (gtk_events_pending()) { + if (gtk_main_iteration_do(FALSE)) + break; + } else #ifndef G_OS_WIN32 - sleep(CONNECT_FAIL_TIMEOUT); + sleep(CONNECT_FAIL_TIMEOUT); #else - Sleep(CONNECT_FAIL_TIMEOUT * 1000); + Sleep(CONNECT_FAIL_TIMEOUT * 1000); #endif - } } } } - check_time_load_resource(TIME_RESET); + check_time_load_resource_from_selection(TIME_RESET); } compute_surface_and_win(); - shift_counter = prm->shift_size; /* To avoid displaying twice the same thing */ + env->shift_counter = prm->shift_size; /* To avoid displaying twice the same thing */ g_timeout_add_full(G_PRIORITY_DEFAULT, prm->delay, shift2left_callback, NULL, NULL); env->reload_rq = FALSE; env->compute_rq = FALSE; @@ -1198,13 +1190,13 @@ } } -static gint display_time2() +static int display_time0() { display_time(prm); return TRUE; } -static gint get_win_position() /* Only if win is 'draggable' */ +static int get_win_position() /* Only if win is 'draggable' */ { if (prm->windec == 'y') gtk_window_get_position(GTK_WINDOW(env->win), &prm->win_x, &prm->win_y); @@ -1212,45 +1204,37 @@ } /* - * Reload stuff every rss_ttl * 60> seconds + * Called every second. Reload stuff every rss_ttl * 60> seconds + * but if prm->rss_refresh is set to 0. */ -static void check_time_load_resource(check_time_mode mode) +static void check_time_load_resource_from_selection(check_time_mode mode) { - static unsigned long elapsed_time_in_sec; + static unsigned long elapsed_time_in_sec; - if (mode == TIME_RESET) + if (mode == TIME_RESET) { elapsed_time_in_sec = 0; - else if (mode == TIME_CHECK) { if (resrc->type == RESRC_FILE) resrc->rss_ttl = prm->rss_refresh; - if ((++elapsed_time_in_sec) / 60 >= (unsigned long)resrc->rss_ttl) { + } else if (mode == TIME_CHECK) { + if (prm->rss_refresh == 0) { + elapsed_time_in_sec = 0; + return; + } else if ((++elapsed_time_in_sec) / 60 >= (unsigned long)resrc->rss_ttl) { elapsed_time_in_sec = 0; env->reload_rq = TRUE; } } } -static gint check_time_load_resource2() +static int check_time_load_resource_from_selection0() { - check_time_load_resource(TIME_CHECK); + check_time_load_resource_from_selection(TIME_CHECK); return TRUE; } -static void quit_with_cli_info(tickr_error_code error_code) -{ - if (resrc->fp != NULL) - fclose(resrc->fp); - xmlCleanupParser(); - free2(env); - free2(resrc); - free2(prm); - fprintf(STD_ERR, "Try '" APP_CMD " --help' for more information\n"); - exit(error_code); -} - static void print_help() { - int i; + int i; for (i = 0; get_help_str1()[i] != NULL; i++) fprintf(STD_OUT, "%s", get_help_str1()[i]); @@ -1259,73 +1243,88 @@ static void print_version() { - fprintf(STD_OUT, APP_NAME " version " APP_VERSION_NUMBER "\n"); + fprintf(STD_OUT, APP_NAME " version " APP_V_NUM "\n"); } static void print_license() { - int i; + int i; for (i = 0; get_license_str1()[i] != NULL; i++) fprintf(STD_OUT, "%s", get_license_str1()[i]); fprintf(STD_OUT, "%s\n", get_license_str2()); } -/* Reset display params as soon as scrolling has started. */ -static gint update_everything() +/* + * Show up if no config file found + */ +static void welcome_at_first_run() { - if (shift_counter > 4) { - update_pixmap_from_opened_stream(); - return FALSE; - } else - return TRUE; + if (!g_file_test(get_datafile_full_name_from_name(CONFIG_FILE), G_FILE_TEST_EXISTS) && !no_ui) { + /* Useless and boring so disabled - + quick_setup(prm);*/ + info_win("Welcome !", + " === Welcome to " APP_NAME " v" APP_V_NUM " ! ===\n\n" + "- To open the main menu, right-click inside " APP_NAME " area.\n\n" + "- To open a link in your browser, left-click on text.\n\n" + "- You can import feed subscriptions with 'File > Import Feed List (OPML)',\n" + " for instance your Google Reader subscriptions.\n\n" + "- Basically, you will use 'File > Feed Organizer (RSS|Atom)' to manage your\n" + " feed list, select feeds, subscribe to new ones, and 'Edit > Preferences'\n" + " to tweak " APP_NAME " appearance as well as other settings.", + INFO, FALSE); + save_to_config_file(prm); /* Save config to file so that this win will not appear again */ + } } -/* Reset opened stream to begining and recompute pixmap, in order to - * update all display params. - * (Hmmm... we should find a more informative name.) +/* + * Recompute pixmap (from strings array, from opened stream), in order to + * update all display params as soon as scrolling has started. */ -void update_pixmap_from_opened_stream() +static void update_pixmap_from_opened_stream() { - gboolean suspend_rq_bak = env->suspend_rq; + zboolean suspend_rq_bak = env->suspend_rq; env->suspend_rq = TRUE; - fseek(resrc->fp, 0, SEEK_SET); - env->stream_fully_read = FALSE; - env->compute_rq = TRUE; + + env->feed_fully_rendered = TRUE; + compute_surface_and_win(); + env->shift_counter = 0; + env->suspend_rq = suspend_rq_bak; } +static int do_at_startup() +{ + if (env->shift_counter > 4) { /* Hmmm */ + env->suspend_rq = TRUE; + update_pixmap_from_opened_stream(); + env->shift_counter = 0; + env->suspend_rq = FALSE; + return FALSE; + } else + return TRUE; +} + #ifdef G_OS_WIN32 /* This is meant to be used with the new GTK/GLib-win32 runtime. */ static int init_win32_mmtimer() { TIMECAPS tc; - MMRESULT mmr; unsigned int highest_res; - mmr = timeGetDevCaps(&tc, sizeof(TIMECAPS)); + timeGetDevCaps(&tc, sizeof(TIMECAPS)); highest_res = tc.wPeriodMin; if (timeBeginPeriod(highest_res) == TIMERR_NOERROR) return 0; else { - fprintf(STD_ERR, "init_win32_mmtimer() error"); + INFO_ERR("init_win32_mmtimer() error") return -1; } } -static void create_win32_logfiles() -{ - time_t time2 = time(NULL); - - STD_OUT = open_new_datafile_with_name(STDOUT_FILENAME1, "wb"); - STD_ERR = open_new_datafile_with_name(STDERR_FILENAME1, "wb"); - fprintf(STD_OUT, "%s", ctime(&time2)); - fprintf(STD_ERR, "%s", ctime(&time2)); -} - /* Swap win32 log files every hour to prevent generating huge ones. */ -static gint swap_win32_logfiles() +static int swap_win32_logfiles() { static unsigned long elapsed_time_in_sec = 0; static int counter = 0; @@ -1340,12 +1339,12 @@ env->suspend_rq = TRUE; if (STD_OUT != NULL) { if (fclose(STD_OUT) != 0) - big_error(WIN32V_ERROR, 2, "Can't close STD_OUT: ", strerror(errno)); + big_error(WIN32V_ERROR, "Can't close STD_OUT: %s", strerror(errno)); STD_OUT = NULL; } if (STD_ERR != NULL) { if (fclose(STD_ERR) != 0) - big_error(WIN32V_ERROR, 2, "Can't close STD_ERR: ", strerror(errno)); + big_error(WIN32V_ERROR, "Can't close STD_ERR: %s", strerror(errno)); STD_ERR = NULL; } if (counter == 0) { @@ -1364,22 +1363,26 @@ #endif /* TODO: is this still needed ? */ -/* Question at program start-up about new feed list format conversion: +/* + * Question at program start-up about new feed list format conversion: * if version >= 0.6.2 and feed list exists and feed list backup doesn't - * exist, create backup and convert to new format. */ + * exist, create backup and convert to new format. + */ #define URL_LIST_BAK_FILE URL_LIST_FILE "-bak" + static void test_convert_local_feed_list() { FILE *fp1, *fp2; char *str; - size_t str_size = 8 * 1024; + size_t str_size = FGETS_STR_MAXLEN; - if (strncmp(APP_VERSION_NUMBER, "0.6.2", 5) >= 0) + if (strncmp(APP_V_NUM, "0.6.2", 5) >= 0) if (g_file_test(get_datafile_full_name_from_name(URL_LIST_FILE), G_FILE_TEST_EXISTS) &&\ !g_file_test(get_datafile_full_name_from_name(URL_LIST_BAK_FILE), G_FILE_TEST_EXISTS)) - if (question_win(APP_NAME " version 0.6.2 or later uses a new feed list format internally.\n" + /* Now done automatically */ + /*if (question_win(APP_NAME " version 0.6.2 or later uses a new feed list format internally.\n" "Do you wish your local feed list to be checked and eventually converted ?\n" - "(Doing this ONCE is strongly RECOMMENDED.)") == YES) { + "(Doing this once is recommended.)", YES) == YES)*/ { fp1 = open_new_datafile_with_name(URL_LIST_FILE, "rb"); fp2 = open_new_datafile_with_name(URL_LIST_BAK_FILE, "wb"); str = malloc2(str_size * sizeof(char)); @@ -1408,26 +1411,90 @@ } } -int main(int argc, char *argv[]) +void free_all() +{ + if (get_ticker_env() != NULL) { + if (GTK_IS_WIDGET(env->win)) + gtk_widget_destroy(env->win); + if (GTK_IS_WIDGET(popup_menu)) + gtk_widget_destroy(popup_menu); + } +#ifdef G_OS_WIN32 + libetm_cleanup_win32_sockets(); +#endif + xmlCleanupParser(); + gnutls_global_deinit(); + if (get_resource() != NULL) { + if (get_resource()->fp != NULL) + fclose(get_resource()->fp); + if (get_resource()->fp_extra != NULL) + fclose(get_resource()->fp_extra); + } + free_all_render_strings_in_array(); + if (IS_FLIST(get_feed_list())) + f_list_free_all(get_feed_list()); + if (IS_FLIST(get_feed_selection())) + f_list_free_all(get_feed_selection()); + if (get_ticker_env() != NULL) + free2(get_ticker_env()); + if (get_resource() != NULL) + free2(get_resource()); + if (get_params() != NULL) + free2(get_params()); +} + +void quit_with_cli_info(tickr_error_code error_code) { - GdkPixbuf *pixb = NULL; - GtkIconFactory *icon_factory = NULL; - GError *error = NULL; + free_all(); + fprintf(STD_ERR, "Try '" APP_CMD " --help' for more info\n"); + exit(error_code); +} + #ifndef G_OS_WIN32 - GdkColormap *colormap = NULL; +void segfault_sig_handler(int sig_num, siginfo_t *sig_info, void *context) +{ + sig_info = sig_info; + context = context; + if (sig_num == SIGSEGV) + big_error(SEGFAULT, global_error_str(SEGFAULT)); +} #endif - int n_options, n_resources, i, j; -#ifdef G_OS_WIN32 - WSADATA wsadata; + +int main(int argc, char *argv[]) +{ + GdkPixbuf *pixb = NULL; + GtkIconFactory *icon_factory = NULL; + GError *error = NULL; +#ifndef G_OS_WIN32 + GdkColormap *colormap = NULL; + struct sigaction action; +#else + time_t time2; #endif + int n_options, n_resources, i, j; - gtk_init(&argc, &argv); LIBXML_TEST_VERSION #ifndef LIBXML_TREE_ENABLED -# error "Libxml2: tree support not compiled in" +# error "Libxml2: tree support not compiled in" #endif - xmlInitParser(); +#if GNUTLS_VERSION_NUMBER < REQUIRED_GNUTLS_V_NUM +# error "GnuTLS version 3.1.9 is required to compile" +#endif + gtk_init(&argc, &argv); +#ifndef G_OS_WIN32 + /* + * segfault handling + */ + memset(&action, 0, sizeof(action)); + action.sa_sigaction = &segfault_sig_handler; + action.sa_flags = SA_SIGINFO; + if (sigaction(SIGSEGV, &action, NULL) != 0) + INFO_ERR("sigaction() error: %s\n", strerror(errno)) +#endif + /* + * Init env, rescr, prm + */ env = malloc2(sizeof(TickerEnv)); resrc = malloc2(sizeof(Resource)); prm = malloc2(sizeof(Params)); @@ -1436,70 +1503,114 @@ env->screen = NULL; env->visual = NULL; env->screen_w = env->screen_h = env->depth = 0; - env->drwa_width = env->drwa_height = env->surf_width = env->surf_height = 0; + env->drwa_width = env->drwa_clock_width = env->drwa_height = 0; + env->surf_width = env->surf_height = 0; + env->shift_counter = 0; env->active_link[0] = '\0'; env->mouse_x_in_drwa = -1; - env->suspend_rq = env->compute_rq = env->reload_rq = env->stream_fully_read = FALSE; - /* env->selection_mode: default = MULTIPLE, set to SINGLE internally if - * selection is unavalaible/empty or after picking a single feed. */ + env->suspend_rq = env->compute_rq = env->reload_rq = FALSE; + env->feed_fully_rendered = TRUE; + /* + * env->selection_mode: default = MULTIPLE, set to SINGLE internally if + * selection is unavalaible/empty or after picking a single resource. + */ env->selection_mode = MULTIPLE; /* - * Toplevel window + * Top level window */ env->win = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_title(GTK_WINDOW(env->win), APP_NAME "-" APP_VERSION_NUMBER); + gtk_window_set_title(GTK_WINDOW(env->win), APP_NAME "-" APP_V_NUM); gtk_container_set_border_width(GTK_CONTAINER(env->win), 0); g_signal_connect(G_OBJECT(env->win), "delete_event", G_CALLBACK(gtk_main_quit), NULL); g_signal_connect(G_OBJECT(env->win), "destroy", G_CALLBACK(gtk_widget_destroy), &(env->win)); #ifdef G_OS_WIN32 - if ((i = WSAStartup(MAKEWORD(2, 2), &wsadata)) != 0) - big_error(WIN32V_ERROR, 2, "WSAStartup() error ", itoa2(i)); - else if (LOBYTE(wsadata.wVersion) != 2 || HIBYTE(wsadata.wVersion) != 2) { - WSACleanup(); - big_error(WIN32V_ERROR, 1, "Couldn't find a usable version of Winsock.dll"); - } else if (get_progfiles_dir() == NULL) - big_error(WIN32V_ERROR, 1, "Can't find Program Files directory"); + if (get_progfiles_dir() == NULL) + big_error(WIN32V_ERROR, "Can't find Program Files directory"); else if (get_appdata_dir() == NULL) - big_error(WIN32V_ERROR, 1, "Can't find Application Data directory"); + big_error(WIN32V_ERROR, "Can't find Application Data directory"); else if (init_win32_mmtimer() != 0) if (question_win("Can't initialize win32 multimedia timer. " - "Scrolling may be very slow. Continue ?") == NO) + "Scrolling may be very slow. Continue ?", -1) == NO) { + free_all(); exit(WIN32V_ERROR); + } #endif /* * Create dir in user home dir if it doesn't exist. */ g_mkdir(get_datadir_full_path(), S_IRWXU); #ifdef G_OS_WIN32 - create_win32_logfiles(); + /* + * Create win32 logfiles. + */ + libetm_init_win32_stdout_stderr( + open_new_datafile_with_name(STDOUT_FILENAME1, "wb"), + open_new_datafile_with_name(STDERR_FILENAME1, "wb")); + /* Now, STD_OUT/ERR are initialized. */ + time2 = time(NULL); + fprintf(STD_OUT, "%s", ctime(&time2)); + fprintf(STD_ERR, "%s", ctime(&time2)); + + libetm_init_win32_sockets(STD_OUT, STD_ERR); #endif + xmlInitParser(); + /* + * Test HTTPS support + */ + env->https_support = FALSE; + if ((i = gnutls_global_init()) != GNUTLS_E_SUCCESS) + INFO_ERR("GnuTLS error: %s\n", gnutls_strerror(i)) + else if (gnutls_check_version(REQUIRED_GNUTLS_V_NUM_STR) == NULL) + INFO_OUT("Can't enable HTTPS support (GnuTLS required version is %s " + "but installed version is %s)\n" , REQUIRED_GNUTLS_V_NUM_STR, + gnutls_check_version(NULL)) + else + env->https_support = TRUE; + + init_render_string_array(); /* - * Get help, show license, set instance id, run with no-ui, or check available system fonts. + * Show help, version, license, dump misc info, set instance id, or run with no-ui. */ - if (argc >= 2 && (strcmp(argv[1], "-help") == 0 || strcmp(argv[1], "--help") == 0 ||\ + if (argc >= 2 && (strcmp(argv[1], "-help") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "-?") == 0)) { print_help(); + free_all(); return 0; - } else if (argc >= 2 && (strcmp(argv[1], "-version") == 0 || strcmp(argv[1], "--version") == 0 ||\ + } else if (argc >= 2 && (strcmp(argv[1], "-version") == 0 || strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-v") == 0)) { print_version(); + free_all(); return 0; - } else if (argc >= 2 && (strcmp(argv[1], "-license") == 0 || strcmp(argv[1], "--license") == 0 ||\ + } else if (argc >= 2 && (strcmp(argv[1], "-license") == 0 || strcmp(argv[1], "--license") == 0 || strcmp(argv[1], "-l") == 0)) { print_license(); + free_all(); return 0; - } else if (argc >= 2 && strncmp(argv[1], "-instance-id=", strlen("-instance-id=")) == 0) { + } else if (argc >= 2 && (strcmp(argv[1], "-dumpfontlist") == 0 || strcmp(argv[1], "--dumpfontlist") == 0)) { + dump_font_list(); + free_all(); + return 0; + } else if (argc >= 2 && (strcmp(argv[1], "-dumpconfig") == 0 || strcmp(argv[1], "--dumpconfig") == 0)) { + dump_config(); + free_all(); + return 0; + } else if (argc >= 2 && (strcmp(argv[1], "-dumperrorcodes") == 0 || strcmp(argv[1], "--dumperrorcodes") == 0)) { + dump_error_codes(); + free_all(); + return 0; + } + /* instance-id must be the 1st arg to be effective */ + if (argc >= 2 && strncmp(argv[1], "-instance-id=", strlen("-instance-id=")) == 0) { if ((instance_id = atoi(argv[1] + strlen("-instance-id="))) < 1 || instance_id > 99) { - fprintf(STD_ERR, "Instance ID invalid value: %d\n", instance_id); + INFO_ERR("Instance ID invalid value: %d\n", instance_id) instance_id = 0; } - } else if (argc >= 2 && strncmp(argv[1], "-no-ui", strlen("-no-ui")) == 0) - no_ui = TRUE; - else if (argc >= 2 && (strcmp(argv[1], "-dumpfontlist") == 0 || strcmp(argv[1], "--dumpfontlist") == 0)) { - dump_font_list(); - return 0; } + /* no-ui must be the 1st or 2nd arg to be effective */ + if ((argc >= 2 && strncmp(argv[1], "-no-ui", strlen("-no-ui")) == 0) || + (argc >= 3 && strncmp(argv[2], "-no-ui", strlen("-no-ui")) == 0)) + no_ui = TRUE; set_tickr_icon_to_dialog(GTK_WINDOW(env->win)); /* * Create rss icon @@ -1511,13 +1622,14 @@ if (pixb != NULL) g_object_unref(pixb); /* - * Get some system graphical params + * Get some system graphical info */ env->screen = gtk_widget_get_screen(env->win); #ifndef G_OS_WIN32 if ((colormap = gdk_screen_get_rgba_colormap(env->screen)) != NULL) { #ifdef VERBOSE_OUTPUT - fprintf(STD_OUT, "Composited GDK screen found\n"); + if (gdk_screen_is_composited(env->screen)) + INFO_OUT("Composited GDK screen\n") #endif } else colormap = gdk_screen_get_rgb_colormap(env->screen); @@ -1530,16 +1642,16 @@ env->screen_w = gdk_screen_get_width(gtk_window_get_screen(GTK_WINDOW(env->win))); env->screen_h = gdk_screen_get_height(gtk_window_get_screen(GTK_WINDOW(env->win))); #ifdef VERBOSE_OUTPUT - fprintf(STD_OUT, "GDK visual: screen width = %d, screen height = %d, depth = %d\n", - env->screen_w, env->screen_h, env->depth); - if (no_ui) - warning(FALSE, 2, APP_NAME " will run with the 'no-ui' option.\n", - "Opening of UI elements which can modify settings and/or \n" - "URL list/selection is disabled."); + INFO_OUT("GDK visual: screen width = %d, screen height = %d, depth = %d\n", + env->screen_w, env->screen_h, env->depth) +#ifndef G_OS_WIN32 + INFO_OUT("Window manager: %s\n", gdk_x11_screen_get_window_manager_name(env->screen)) +#endif #endif resrc->type = RESRC_UNSPECIFIED; resrc->format = RSS_FORMAT_UNDETERMINED; resrc->id[0] = '\0'; + resrc->orig_url[0] = '\0'; resrc->xml_dump[0] = '\0'; resrc->fp = NULL; resrc->fp_extra = NULL; @@ -1552,15 +1664,15 @@ /* * Options and resource stuff */ - set_default_options(prm); /* init all params */ + set_default_options(prm); /* Init all params */ if (g_file_test(get_datafile_full_name_from_name(CONFIG_FILE), G_FILE_TEST_EXISTS)) get_config_file_options(prm); else - quick_setup(prm); + welcome_at_first_run(); n_options = 0; n_resources = 0; if (argc > 1) { - /* Parse args: first -options... then resource - the rest is ignored. */ + /* Parse args: first -options, then resource - the rest is ignored. */ for (i = 1; i < argc; i++) if (argv[i][0] == '-') n_options ++; @@ -1569,61 +1681,100 @@ if (i < argc) n_resources++; if (n_resources == 0) { - fprintf(STD_ERR, "No resource specified\n"); - if (RESOURCE_NONE_QUIT) - quit_with_cli_info(RESOURCE_NONE); + INFO_OUT("%s\n", global_error_str(NO_RESOURCE_SPECIFIED)) + if (RESOURCE_ERROR_SSM_QUIT) { + INFO_ERR("Exiting (program was compiled with " + "RESOURCE_ERROR_SSM_QUIT set to TRUE)\n") + quit_with_cli_info(NO_RESOURCE_SPECIFIED); + } } else { env->selection_mode = SINGLE; - /* will open text file or get rss feed */ + /* Will get rss feed or open text file */ str_n_cpy(resrc->id, argv[n_options + 1], FILE_NAME_MAXLEN); } if (n_options > 0) - if (parse_options_array(prm, n_options, (const char **)(argv + 1)) != OK) - if (OPTION_ERROR_QUIT) - quit_with_cli_info(OPTION_ERROR); + if ((i = parse_options_array(prm, n_options, (const char **)(argv + 1)) != OK)) + if (OPTION_ERROR_QUIT) { + INFO_ERR("Exiting (program was compiled with " + "OPTION_ERROR_QUIT set to TRUE)\n") + quit_with_cli_info(i); + } } else { - fprintf(STD_ERR, "No resource specified\n"); - if (RESOURCE_NONE_QUIT) - quit_with_cli_info(RESOURCE_NONE); + INFO_OUT("%s\n", global_error_str(NO_RESOURCE_SPECIFIED)) + if (RESOURCE_ERROR_SSM_QUIT) { + INFO_ERR("Exiting (program was compiled with " + "RESOURCE_ERROR_SSM_QUIT set to TRUE)\n") + quit_with_cli_info(NO_RESOURCE_SPECIFIED); + } } + /* Apply connection settings */ compute_auth_and_proxy_str(); + set_connect_timeout_sec(prm->connect_timeout); + set_send_recv_timeout_sec(prm->send_recv_timeout); + +#ifdef VERBOSE_OUTPUT + /* Here so to be able to check the disablepopups option */ + if (no_ui) + warning(BLOCK, "%s will run with the 'no-ui' option.\n" + "Opening of UI elements which can modify settings and/or \n" + "URL list/selection is disabled.", APP_NAME); +#endif /* * Feed list stuff */ test_convert_local_feed_list(); + /* It's getting horribly messy from here ... */ if ((i = f_list_load_from_file(&feed_list, NULL)) == OK) { feed_list = f_list_sort(feed_list); feed_list = f_list_first(feed_list); f_list_save_to_file(feed_list, NULL); + } else if (i == LOAD_URL_LIST_NO_LIST) { + if (question_win("No URL list has been saved yet. Import one (OPML format required) ?", -1) == YES) { + if ((i = import_opml_file()) == OK) + manage_list_and_selection(resrc); + } else if (question_win("No URL list has been saved yet. Use sample one ?", -1) == YES) { + if ((i = f_list_load_from_file(&feed_list, get_sample_url_list_full_name())) == OK) { + feed_list = f_list_sort(feed_list); + feed_list = f_list_first(feed_list); + f_list_save_to_file(feed_list, NULL); + manage_list_and_selection(resrc); + } + } } j = build_feed_selection_from_feed_list(); if (n_resources == 0 && env->selection_mode == MULTIPLE && i == OK && j == OK) - fprintf(STD_OUT, "Will use feed selection\n"); + INFO_OUT("Will use feed selection\n") else { if (env->selection_mode == MULTIPLE && (i != OK || j != OK)) { if (j == SELECTION_EMPTY) - warning(TRUE, 1, "No feed selected - " + warning(NO_BLOCK, "No feed selected - " "Switching to single selection mode"); else if (j == SELECTION_ERROR) - warning(TRUE, 1, "No feed selection available - " + warning(NO_BLOCK, "No feed selection available - " "Switching to single selection mode"); } env->selection_mode = SINGLE; if (n_resources == 0) { if (prm->homefeed[0] != '\0') { str_n_cpy(resrc->id, prm->homefeed, FILE_NAME_MAXLEN); - fprintf(STD_OUT, "Will use default resource (Homefeed): %s\n", resrc->id); + INFO_OUT("Will use default resource (Homefeed): %s\n", resrc->id) } else { - fprintf(STD_ERR, "No default resource available\n"); - if (RESOURCE_NONE_QUIT) - quit_with_cli_info(RESOURCE_NONE); + INFO_ERR("No default resource available\n") + if (RESOURCE_ERROR_SSM_QUIT) { + INFO_ERR("Exiting (program was compiled with " + "RESOURCE_ERROR_SSM_QUIT set to TRUE)\n") + quit_with_cli_info(NO_RESOURCE_SPECIFIED); + } } } } - first_feed(); - if (load_resource(resrc, feed_selection) != OK) - if (RESOURCE_NONE_QUIT) - quit_with_cli_info(RESOURCE_NONE); + if ((i = load_resource_from_selection(resrc, feed_selection)) != OK) + if (RESOURCE_ERROR_SSM_QUIT) { + INFO_ERR("Exiting (program was compiled with " + "RESOURCE_ERROR_SSM_QUIT set to TRUE)\n") + quit_with_cli_info(i); + } + /* ... to here */ resrc->rss_ttl = prm->rss_refresh; first_feed(); /* @@ -1637,12 +1788,13 @@ * Create 2 drawing areas */ env->drw_a = gtk_drawing_area_new(); - /* We disable double buffering for drawing area and will use + /* + * We disable double buffering for drawing area and will use * gdk_window_begin_paint_rect() and gdk_window_end_paint(). */ gtk_widget_set_double_buffered(env->drw_a, FALSE); env->drwa_clock = gtk_drawing_area_new(); - gtk_widget_add_events(env->drw_a, GDK_ALL_EVENTS_MASK); /* change mask? */ + gtk_widget_add_events(env->drw_a, GDK_ALL_EVENTS_MASK); /* Change mask ? */ g_signal_connect(G_OBJECT(env->drw_a), "button-press-event", G_CALLBACK(left_click_on_drawing_area), NULL); g_signal_connect(G_OBJECT(env->drw_a), "button-press-event", G_CALLBACK(right_click_on_drawing_area), NULL); @@ -1650,14 +1802,14 @@ g_signal_connect(G_OBJECT(env->drw_a), "leave-notify-event", G_CALLBACK(mouse_over_drawing_area), NULL); g_signal_connect(G_OBJECT(popup_menu), "expose-event", G_CALLBACK(mouse_over_opened_popup_menu), NULL); g_signal_connect(G_OBJECT(popup_menu), "leave-notify-event", G_CALLBACK(mouse_over_opened_popup_menu), NULL); - g_signal_connect(G_OBJECT(env->drw_a), "scroll-event", G_CALLBACK(mouse_wheel_scroll_on_drawing_area), NULL); + g_signal_connect(G_OBJECT(env->drw_a), "scroll-event", G_CALLBACK(mouse_wheel_action_on_drawing_area), NULL); g_signal_connect(G_OBJECT(env->drw_a), "motion-notify-event", G_CALLBACK(track_mouse_position_x), NULL); vbox_ticker = gtk_vbox_new(FALSE, 0); /* vbox_ticker is only used to have a v-centered ticker */ - gtk_box_pack_start(GTK_BOX(vbox_ticker), GTK_WIDGET(env->drw_a), TRUE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox_ticker), GTK_WIDGET(env->drw_a), FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(main_hbox), vbox_ticker, FALSE, FALSE, 0); vbox_clock = gtk_vbox_new(FALSE, 0); /* vbox_clock is only used to have a v-centered clock */ - gtk_box_pack_start(GTK_BOX(vbox_clock), GTK_WIDGET(env->drwa_clock), TRUE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox_clock), GTK_WIDGET(env->drwa_clock), TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(main_hbox), vbox_clock, FALSE, FALSE, 0); /* * Create cairo image surface from text file or rss feed and compute stuff to draw window. @@ -1666,28 +1818,33 @@ /* === Timeout callbacks === */ /* - * Refresh the image every milliseconds + * Refresh the image every milliseconds. */ g_timeout_add_full(G_PRIORITY_DEFAULT, prm->delay, shift2left_callback, NULL, NULL); /* - * Display clock every 0.5 seconds + * Display clock every 0.5 seconds. */ - g_timeout_add_full(G_PRIORITY_DEFAULT, 500, display_time2, NULL, NULL); + g_timeout_add_full(G_PRIORITY_DEFAULT, 500, display_time0, NULL, NULL); /* - * Get current win position (if 'dragged') every 0.5 seconds + * Get current win position (if 'dragged') every 0.5 seconds. */ g_timeout_add_full(G_PRIORITY_DEFAULT, 500, get_win_position, NULL, NULL); /* - * Check every sec until elapsed time in mn > rss_ttl> mn then reload rss feed (or text file) + * Check every sec until elapsed time in mn > rss_ttl> mn then reload rss feed (or text file). + */ + check_time_load_resource_from_selection(TIME_RESET); + g_timeout_add_full(G_PRIORITY_DEFAULT, 1000, check_time_load_resource_from_selection0, NULL, NULL); + /* + * Regularly update Tickr window dims and location */ - check_time_load_resource(TIME_RESET); - g_timeout_add_full(G_PRIORITY_DEFAULT, 1000, check_time_load_resource2, NULL, NULL); - g_timeout_add_full(G_PRIORITY_DEFAULT, 500, update_win_dims_and_loc, NULL, NULL); - g_timeout_add_full(G_PRIORITY_DEFAULT, 100, update_everything, NULL, NULL); /* - * Check every sec until elapsed time >= 1 hour then swap win32 log files to prevent generating huge ones + * Called at program startup only + */ + g_timeout_add_full(G_PRIORITY_DEFAULT, 100, do_at_startup, NULL, NULL); + /* + * Check every sec until elapsed time >= 1 hour then swap win32 log files to prevent generating huge ones. */ #ifdef G_OS_WIN32 g_timeout_add_full(G_PRIORITY_DEFAULT, 1000, swap_win32_logfiles, NULL, NULL); @@ -1698,23 +1855,13 @@ env->reload_rq = TRUE; gtk_widget_show_all(env->win); - /* NEW - to get rid of starting 'ghost' square win - but is it effective ? */ + /* To get rid of starting 'ghost' square win - but is it effective ? */ gtk_widget_set_size_request(env->win, 1, 1); gtk_window_resize(GTK_WINDOW(env->win), 1, 1); gtk_main(); /* * Cleanup stuff */ - if (resrc->fp != NULL) - fclose(resrc->fp); - if (resrc->fp_extra != NULL) - fclose(resrc->fp_extra); - xmlCleanupParser(); -#ifdef G_OS_WIN32 - WSACleanup(); -#endif - free2(env); - free2(resrc); - free2(prm); + free_all(); return 0; } diff -Nru tickr-0.6.4/src/tickr/tickr_misc.c tickr-0.7.0/src/tickr/tickr_misc.c --- tickr-0.6.4/src/tickr/tickr_misc.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_misc.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -28,7 +28,7 @@ gtk_window_set_keep_above(GTK_WINDOW(get_ticker_env()->win), FALSE); - dialog = gtk_file_chooser_dialog_new("Import Preferences", GTK_WINDOW(get_ticker_env()->win), + dialog = gtk_file_chooser_dialog_new("Import Settings", GTK_WINDOW(get_ticker_env()->win), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL_CLOSE, GTK_STOCK_OK, GTK_RESPONSE_OK, @@ -46,9 +46,9 @@ if ((file_name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog))) != NULL) { if ((fp1 = g_fopen(file_name, "rb")) != NULL) { snprintf(tmp, TMPSTR_SIZE + 1, - "Preferences are about to be imported from file: %s. " + "Settings are about to be imported from file: %s. " "Continue ?", file_name); - if (question_win(tmp) == YES) { + if (question_win(tmp, -1) == YES) { if ((fp2 = g_fopen(get_datafile_full_name_from_name(CONFIG_FILE), "wb")) != NULL) { while ((c = fgetc(fp1)) != (int)EOF) @@ -60,12 +60,12 @@ /* ???? modify_params2();*/ } else - warning(FALSE, 4, "Can't save Preferences to file ", - file_name, ": ", strerror(errno)); + warning(BLOCK, "Can't save Settings to file '%s': %s", + file_name, strerror(errno)); } fclose(fp1); } else - warning(FALSE, 4, "Can't open ", file_name, ": ", strerror(errno)); + warning(BLOCK, "Can't open '%s': %s", file_name, strerror(errno)); g_free(file_name); } } @@ -78,22 +78,22 @@ GtkWidget *dialog; FILE *fp1, *fp2; char *file_name = NULL; - int exit_status = !OK; + int error_code = !OK; char tmp[TMPSTR_SIZE + 1]; int c; if ((fp1 = g_fopen(get_datafile_full_name_from_name(CONFIG_FILE), "rb")) == NULL) { save_to_config_file(get_params()); if ((fp1 = g_fopen(get_datafile_full_name_from_name(CONFIG_FILE), "rb")) == NULL) { - warning(FALSE, 4, "Can't open file ", get_datafile_full_name_from_name(CONFIG_FILE) - , ": ", strerror(errno)); + warning(BLOCK, "Can't open file '%s': %s", + get_datafile_full_name_from_name(CONFIG_FILE), strerror(errno)); return; } } gtk_window_set_keep_above(GTK_WINDOW(get_ticker_env()->win), FALSE); - dialog = gtk_file_chooser_dialog_new("Export Preferences", GTK_WINDOW(get_ticker_env()->win), + dialog = gtk_file_chooser_dialog_new("Export Settings", GTK_WINDOW(get_ticker_env()->win), GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL_CLOSE, GTK_STOCK_OK, GTK_RESPONSE_OK, @@ -117,17 +117,17 @@ while ((c = fgetc(fp1)) != (int)EOF) fputc((int)c, fp2); fclose(fp2); - exit_status = OK; + error_code = OK; } else - warning(FALSE, 4, "Can't save Preferences to file ", - file_name, ": ", strerror(errno)); + warning(BLOCK, "Can't save Settings to file '%s': %s", + file_name, strerror(errno)); } } fclose(fp1); gtk_widget_destroy(dialog); - if (exit_status == OK) { + if (error_code == OK) { snprintf(tmp, TMPSTR_SIZE + 1, - "\nPreferences have been exported to file: %s\n", file_name); + "\nSettings have been exported to file: %s\n", file_name); info_win("", tmp, INFO, FALSE); } if (file_name != NULL) @@ -135,144 +135,51 @@ check_main_win_always_on_top(); } -#ifndef G_OS_WIN32 -void online_help() +/* Doesn't use get_params()->open_link_args (which is done in open_link()) */ +void open_url_in_browser(char *url) { - char tmp1[FILE_NAME_MAXLEN + 1]; - char *help_url = SUPPORT_URL; - char *argv[3]; - GPid pid; - GError *error = NULL; + char tmp1[FILE_NAME_MAXLEN + 1]; + char *argv[3]; + GPid pid; + GError *error = NULL; if (get_params()->open_link_cmd[0] == '\0') { - /* TODO: should look for default browser */ - warning(FALSE, 2, "Can't launch Browser: no command is defined.\n", - "Please set the 'Open in Browser' option in the Preferences window."); - return; + easily_link_with_browser(); + if (get_params()->open_link_cmd[0] == '\0') { + warning(BLOCK, "Can't launch Browser: no command is defined.\n", + "Please set the 'Open in Browser' option in the Full Settings window."); + return; + } } - fprintf(STD_OUT, "Spawning: %s %s\n", get_params()->open_link_cmd, help_url); + /* Launch browser */ + INFO_OUT("Spawning: %s %s\n", get_params()->open_link_cmd, url) str_n_cpy(tmp1, get_params()->open_link_cmd, FILE_NAME_MAXLEN); argv[0] = tmp1; - argv[1] = help_url; + argv[1] = url; argv[2] = NULL; if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &pid, &error)) { - warning(FALSE, 4, APP_NAME ": Can't create process ", argv[0], " - ", error->message); - info_win("", "Please check the 'Open in Browser' option in the Preferences window.", + warning(BLOCK, "%s: Can't create process %s - %s", APP_NAME, argv[0], error->message); + info_win("", "Please check the 'Open in Browser' option in the Full Settings window.", INFO_WARNING, FALSE); } else g_spawn_close_pid(pid); } -#else + void online_help() { - char *browser_cmd_p, browser_cmd[512], tmp[1024]; - unsigned int i, count, start = 0, end = 0; - char link[] = SUPPORT_URL; - char *argv[3]; - GPid pid; - GError *error = NULL; - - if ((browser_cmd_p = (char *)get_default_browser_from_win32registry()) != NULL) { - /* Find 1st str in browser_cmd */ - str_n_cpy(tmp, browser_cmd_p, 511); - for (i = 0, count = 0; i < strlen(tmp); i++) { - if (tmp[i] == '"') { - count++; - if (count == 1) - start = i + 1; - else if (count == 2) - end = i - 1; - } - } - str_n_cpy(browser_cmd, tmp + start, MIN((end - start + 1), 511)); - /* Launch browser */ - fprintf(STD_OUT, "Spawning: %s %s\n", browser_cmd, link); - argv[0] = browser_cmd; - argv[1] = link; - argv[2] = NULL; - if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, - NULL, NULL, &pid, &error)) - warning(FALSE, 4, APP_NAME ": Can't create process ", argv[0], - " - ", error->message); - else - g_spawn_close_pid(pid); - } + open_url_in_browser(SUPPORT_URL); } -#endif - -/* - * This func's prototype is in libetm / error.h. - * This func is not defined in libetm but in app and it handles errors - * from libetm and app. - * - * Max number of strings = N_STR_MAX, max string length = STR_MAXLEN. - * Outstanding stuff (strings and chars) will be ignored. - */ -#define N_STR_MAX 8 -#define STR_MAXLEN FILE_NAME_MAXLEN -int big_error(int big_error_code, int n_str, ...) +void go_to_paypal() { - char error_str[64 + 32 + (N_STR_MAX * STR_MAXLEN) + 32 + 1]; - va_list str; - int i; - - get_ticker_env()->suspend_rq = TRUE; - - error_str[0] = '\0'; - str_n_cpy(error_str, "\nOuch !! Something went wrong...\n\nCritical error in ", 64); - if (big_error_code > LIBETM_LASTERRORCODE) - str_n_cat(error_str, APP_NAME ": ", 32); - n_str = MIN(n_str, N_STR_MAX); - va_start(str, n_str); - for (i = 0; i < n_str ; i++) - str_n_cat(error_str, va_arg(str, char *), STR_MAXLEN); - va_end(str); - str_n_cat(error_str, " - Will quit now", 32); - - if (STD_ERR != NULL) { - fprintf(STD_ERR, "%s\n", error_str); - fflush(NULL); - } - /* We want this win to always popup */ - get_params()->disable_popups = 'n'; - info_win(APP_NAME " - Critical error", error_str, INFO_ERROR, FALSE); - if (get_resource()->fp != NULL) - fclose(get_resource()->fp); - free2(get_ticker_env()); - free2(get_resource()); - free2(get_params()); - exit(big_error_code); + open_url_in_browser(DONATE_WITH_PAYPAL_URL); } -/* Will popup and wait for INFO_WIN_WAIT_TIMEOUT ms if wait == TRUE, then close - * otherwise, will block until an appropriate keyboard/mouse action happens. */ -void warning(gboolean wait, int n_str, ...) -{ - char warning_str[N_STR_MAX * STR_MAXLEN + 1]; - va_list str; - int i; - - warning_str[0] = '\0'; - n_str = MIN(n_str, N_STR_MAX); - va_start(str, n_str); - for (i = 0; i < n_str ; i++) - str_n_cat(warning_str, va_arg(str, char *), STR_MAXLEN); - va_end(str); - - fprintf(STD_ERR, "%s\n", warning_str); - fflush(STD_ERR); - if (!wait) - info_win("", warning_str, INFO_WARNING, FALSE); - else - info_win_wait(warning_str, INFO_WIN_WAIT_TIMEOUT); -} +#define NFAMMAX (2 * 1024) +#define NFACEMAX 64 void dump_font_list() { -#define NFAMMAX 1024 -#define NFACEMAX 16 - PangoFontFamily **font_fam; PangoFontFamily *font_fam2[NFAMMAX]; PangoFontFace **font_face; @@ -325,3 +232,20 @@ else fprintf(STD_OUT, "(%d available fonts)\n", k); } + +void dump_config() +{ + char *tmp; + GError *error = NULL; + + fprintf(STD_OUT, APP_NAME " config (from file):\n"); + if (g_file_get_contents(get_datafile_full_name_from_name(CONFIG_FILE), &tmp, NULL, &error)) { + fprintf(STD_OUT, "%s", tmp); + g_free(tmp); + } else if (error != NULL) { + fprintf(STD_ERR, "%s\n", error->message); + g_error_free(error); + } else + fprintf(STD_ERR, "Can't open file '%s': %s\n", + get_datafile_full_name_from_name(CONFIG_FILE), strerror(errno)); +} diff -Nru tickr-0.6.4/src/tickr/tickr_opml.c tickr-0.7.0/src/tickr/tickr_opml.c --- tickr-0.6.4/src/tickr/tickr_opml.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_opml.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -23,12 +23,19 @@ static char *opml_str_global; static char tmp_url[FILE_NAME_MAXLEN + 1], tmp_str[256]; +/* Prototypes for static functions */ +static char *pick_opml_file(); +static int parse_opml_file(const char *); +static void get_opml_selected_element(xmlNode *, const char *, const char *); +static char *create_opml_str_from_feed_list_node(FList *); +static int save_str_as_opml_file(const char *); + /* * Importing */ static int *get_feed_counter() { - static int feed_counter; + static int feed_counter; return &feed_counter; } @@ -43,7 +50,7 @@ *get_feed_counter() += 1; } -void import_opml_file() +int import_opml_file() { char *opml_file_name, *url_list_file_name; FList *node; @@ -55,27 +62,24 @@ if ((fp = g_fopen(url_list_file_name, "rb")) != NULL) { fclose(fp); if (question_win("Imported URLs will be merged with currently saved ones. " - "Continue ?") == NO) { + "Continue ?", -1) == NO) { l_str_free(url_list_file_name); - return; + return status; } } else if ((fp = g_fopen(url_list_file_name, "wb")) != NULL) fclose(fp); else { - warning(FALSE, 4, "Can't create URL list ", url_list_file_name, ": ", strerror(errno)); - return; + warning(BLOCK, "Can't create URL list '%s': %s", url_list_file_name, strerror(errno)); + return status; } win_with_progress_bar(WIN_WITH_PROGRESS_BAR_OPEN, - " Importing (and updating) data from OPML file, please wait... "); -#ifdef VERBOSE_OUTPUT - fprintf(STD_OUT, - "Importing (and updating) data from OPML file (%s), please wait...\n", opml_file_name); - fflush(STD_OUT); -#endif + " Importing (and updating) data from OPML file, please wait ... "); + VERBOSE_INFO_OUT( + "Importing (and updating) data from OPML file (%s), please wait ...\n", opml_file_name); zero_feed_counter(); get_ticker_env()->selection_mode = MULTIPLE; opml_str_global = l_str_new(NULL); - if (parse_opml_xml_file(opml_file_name) == OK) + if (parse_opml_file(opml_file_name) == OK) if ((fp = g_fopen(url_list_file_name, "ab")) != NULL) { fprintf(fp, "\n%s\n", opml_str_global); fclose(fp); @@ -96,12 +100,12 @@ snprintf(tmp_str, 256, "\nFeed list (%d URLs) has been imported\n", *get_feed_counter()); info_win("", tmp_str, INFO, FALSE); - get_new_url(get_resource()); } } + return status; } -char *pick_opml_file() +static char *pick_opml_file() { GtkWidget *dialog; GtkFileFilter *filter; @@ -141,25 +145,22 @@ return file_name2; } -int parse_opml_xml_file(const char *file_name) +static int parse_opml_file(const char *file_name) { xmlDoc *doc = NULL; xmlNode *cur_node = NULL, *cur_node_start = NULL; int body_element = NO, outline_element = NO; -#ifdef VERBOSE_OUTPUT - fprintf(STD_OUT, "Parsing OPML file ...\n"); - fflush(STD_OUT); -#endif + VERBOSE_INFO_OUT("Parsing OPML file ...\n"); if ((doc = xmlParseFile(file_name)) == NULL) { - warning(FALSE, 2, "Can't parse XML file: ", xmlGetLastError()->message); + warning(BLOCK, "Can't parse XML file: %s", xmlGetLastError()->message); return XML_UNPARSABLE; } else if ((cur_node = xmlDocGetRootElement(doc)) == NULL) { - warning(FALSE, 2, "Empty XML document: ", file_name); + warning(BLOCK, "Empty XML document: '%s'", file_name); xmlFreeDoc(doc); return XML_EMPTY; } else if (xmlStrcmp(cur_node->name, (const xmlChar *)"opml") != 0) { - warning(FALSE, 2, "Not an OPML document: ", file_name); + warning(BLOCK, "Not an OPML document: '%s'", file_name); xmlFreeDoc(doc); return OPML_ERROR; } @@ -180,14 +181,11 @@ } if (body_element == YES && outline_element == YES) { get_opml_selected_element(cur_node_start, "outline", "type"); -#ifdef VERBOSE_OUTPUT - fprintf(STD_OUT, "Done\n"); - fflush(STD_OUT); -#endif + VERBOSE_INFO_OUT("Done\n"); xmlFreeDoc(doc); return OK; } else { - warning(FALSE, 2, "Couldn't find all required OPML elements in: ", + warning(BLOCK, "Couldn't find all required OPML elements in: '%s'", file_name); xmlFreeDoc(doc); return OPML_ERROR; @@ -195,18 +193,18 @@ } /* - * Entry format in url list file: - * ['*' (selected) or '-' (unselected) + "000" (3 chars rank) + url [+ '>' + title] + '\n'] + * Entry format in URL list file: + * ['*' (selected) or '-' (unselected) + "000" (3 chars rank) + URL [+ '>' + title] + '\n'] * * Entry max length = FILE_NAME_MAXLEN * See also: (UN)SELECTED_URL_CHAR/STR and TITLE_TAG_CHAR/STR in tickr.h * FLIST_RANK_FORMAT and FLIST_RANK_STR_LEN in tickr_list.h */ -void get_opml_selected_element(xmlNode *some_node, const char *selected_element, const char *selected_attribute) +static void get_opml_selected_element(xmlNode *some_node, const char *selected_element, const char *selected_attribute) { xmlNode *cur_node; xmlChar *str1, *str2, *str3; - gchar *unesc_str; + char *unesc_str; char feed_title[FEED_TITLE_MAXLEN + 1]; char feed_rank[FLIST_RANK_STR_LEN + 1]; int unused; @@ -215,7 +213,7 @@ if (xmlStrcmp(cur_node->name, (const xmlChar *)selected_element) == 0) { /* Need to get attribute name and value, * then use only those whose value = "rss" for name = "type", - * then get value for name = "xmlUrl" -> rss feed url, + * then get value for name = "xmlUrl" -> rss feed URL, * also eventually get value for (NOT STANDARD) name = OPML_FEED_RANK. */ if ((str1 = xmlGetProp(cur_node, (xmlChar *)selected_attribute)) != NULL) { if (xmlStrcmp(str1, (xmlChar *)"rss") == 0) { @@ -232,23 +230,27 @@ /* then feed URL. */ unesc_str = g_uri_unescape_string((const char *)str2, NULL); opml_str_global = l_str_cat(opml_str_global, (const char*)unesc_str); - /* Get feed title from feed url - OK like that? */ + /* TODO: Should URL and resrc->id be updated for moved-permanently redirects ? */ + /* Get feed title from feed URL - OK like that ? */ str_n_cpy(tmp_url, unesc_str, FILE_NAME_MAXLEN); - if (fetch_resource(tmp_url, get_datafile_full_name_from_name(TMP1), - tmp_url) == OK) - if (get_feed_info(&unused, get_datafile_full_name_from_name(TMP1), - feed_title, NULL, NULL) == OK) + if (fetch_resource(tmp_url, get_datafile_full_name_from_name(TMP_FILE), + tmp_url) == OK) { + if (get_feed_info(&unused, get_datafile_full_name_from_name(TMP_FILE), + feed_title, NULL, NULL) == OK) { if (feed_title[0] != '\0') { opml_str_global = l_str_cat(opml_str_global, TITLE_TAG_STR); opml_str_global = l_str_cat(opml_str_global, feed_title); } + } + } opml_str_global = l_str_cat(opml_str_global, "\n"); + g_unlink(get_datafile_full_name_from_name(TMP_FILE)); inc_feed_counter(); - snprintf(tmp_str, 256, "%d feed%s imported so far, please wait...", + snprintf(tmp_str, 256, "%d feed%s imported so far, please wait ...", *get_feed_counter(), *get_feed_counter() <= 1 ? "" : "s"); - /*snprintf(tmp_str, 256, "%d feed%s imported so far, please wait... \n%s", + /*snprintf(tmp_str, 256, "%d feed%s imported so far, please wait ... \n%s", *get_feed_counter(), *get_feed_counter() <= 1 ? "" : "s", unesc_str);*/ win_with_progress_bar(WIN_WITH_PROGRESS_BAR_PULSE, tmp_str); @@ -280,7 +282,7 @@ } /* Must l_str_free() opml_str afterwards */ -char *create_opml_str_from_feed_list_node(FList *node) +static char *create_opml_str_from_feed_list_node(FList *node) { #define OPML_TITLE APP_NAME " Feed List" #define STR_SIZE (4 * 1024) @@ -299,13 +301,15 @@ " \n" "\n"; char *opml_str, tmp[STR_SIZE]; - gchar *esc_str1, *esc_str2; + char *esc_str1, *esc_str2; + time_t time2; + char time_str[64]; snprintf(tmp, STR_SIZE, opml_header, OPML_TITLE); opml_str = l_str_new(tmp); for (; node != NULL; node = node->next) { if (!g_utf8_validate(node->url, -1, NULL)) { - warning(FALSE, 3, "Non UTF-8 encoded string: ", node->url, " - Skipped"); + warning(BLOCK, "%s: '%s' - Skipped", global_error_str(NOT_UTF8_ENCODED), node->url); continue; } esc_str1 = g_uri_escape_string(node->title, " AÄääàçéèêÖöôÜüùà'()[]-_|{}/.,;:?!%€£$*+=", TRUE); @@ -316,15 +320,22 @@ g_free(esc_str2); opml_str = l_str_cat(opml_str, tmp); } - return l_str_cat(opml_str, opml_footer); + l_str_cat(opml_str, opml_footer); + /* Add time of export (as a comment) */ + time2 = time(NULL); + l_str_cat(opml_str, "\n"); + return opml_str; } -int save_str_as_opml_file(const char *str) +static int save_str_as_opml_file(const char *str) { GtkWidget *dialog; char *file_name = NULL; FILE *fp; - int exit_status = CREATE_FILE_ERROR; + int error_code = CREATE_FILE_ERROR; char tmp[TMPSTR_SIZE + 1]; gtk_window_set_keep_above(GTK_WINDOW(get_ticker_env()->win), FALSE); @@ -352,20 +363,20 @@ if ((fp = g_fopen(file_name, "wb")) != NULL) { fprintf(fp, "%s", str); fclose(fp); - exit_status = OK; + error_code = OK; } else - warning(FALSE, 3, "Can't save OPML file ", file_name, ": ", + warning(BLOCK, "Can't save OPML file '%s': %s", file_name, strerror(errno)); } } gtk_widget_destroy(dialog); - if (exit_status == OK) { + if (error_code == OK) { snprintf(tmp, TMPSTR_SIZE + 1, - "\nFeed list has been exported to OPML file: %s\n", file_name); + "\nFeed list has been exported to OPML file: '%s'\n", file_name); info_win("", tmp, INFO, FALSE); } if (file_name != NULL) g_free(file_name); check_main_win_always_on_top(); - return exit_status; + return error_code; } diff -Nru tickr-0.6.4/src/tickr/tickr_otherwins.c tickr-0.7.0/src/tickr/tickr_otherwins.c --- tickr-0.6.4/src/tickr/tickr_otherwins.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_otherwins.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -18,7 +18,7 @@ #include "tickr.h" -gint esc_key_pressed(GtkWidget *dialog2, GdkEventKey *event_key) +int esc_key_pressed(GtkWidget *dialog2, GdkEventKey *event_key) { if (event_key->keyval == GDK_Escape) { gtk_dialog_response(GTK_DIALOG(dialog2), GTK_RESPONSE_CANCEL_CLOSE); @@ -33,16 +33,15 @@ } /* - * 'Pick new file' dialog win + * 'Open Text File' dialog win */ -void open_new_txt_file(Resource *resrc) +void open_txt_file(Resource *resrc) { TickerEnv *env = get_ticker_env(); GtkWidget *dialog; - char *file_name2, tmp[TMPSTR_SIZE + 1]; - int resource_flag; - Resource resrc_bak; - int selection_mode_bak = get_ticker_env()->selection_mode; + char resrc_id_bak[FILE_NAME_MAXLEN + 1]; + char *file_name2; + int error_code; gtk_window_set_keep_above(GTK_WINDOW(env->win), FALSE); @@ -63,7 +62,7 @@ /* * Backup last valid opened resource (if any) */ - str_n_cpy(resrc_bak.id, resrc->id, FILE_NAME_MAXLEN); + str_n_cpy(resrc_id_bak, resrc->id, FILE_NAME_MAXLEN); while (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) { file_name2 = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); @@ -71,42 +70,145 @@ g_free(file_name2); get_ticker_env()->selection_mode = SINGLE; - if ((resource_flag = load_resource(resrc, NULL)) == OK) { + if ((error_code = load_resource_from_selection(resrc, NULL)) == OK) { env->reload_rq = TRUE; break; } else { - snprintf(tmp, TMPSTR_SIZE + 1, "load_resource() error %d", resource_flag); - info_win("", tmp, INFO_ERROR, FALSE); - str_n_cpy(resrc->id, resrc_bak.id, FILE_NAME_MAXLEN); - get_ticker_env()->selection_mode = selection_mode_bak; - load_resource(resrc, NULL); + warning(BLOCK, "%s(): %s", __func__, global_error_str(error_code)); + str_n_cpy(resrc->id, resrc_id_bak, FILE_NAME_MAXLEN); + load_resource_from_selection(resrc, NULL); } } gtk_widget_destroy(dialog); check_main_win_always_on_top(); } +void show_resource_info(Resource *resrc) +{ + GtkWidget *dialog, *table, *label[7], *close_but; + char tmp1[256], *tmp2, *tmp3; + int i, j; + + if (resrc->type != RESRC_URL && resrc->type != RESRC_FILE) { + info_win("Resource Properties", "\nNo information available\n", INFO_ERROR, FALSE); + return; + } + + gtk_window_set_keep_above(GTK_WINDOW(get_ticker_env()->win), FALSE); + + dialog = gtk_dialog_new_with_buttons( + "Resource Properties", GTK_WINDOW(get_ticker_env()->win), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + NULL); + + close_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL_CLOSE); + close_but = close_but; /* To get rid of compiler warning */ + + set_tickr_icon_to_dialog(GTK_WINDOW(dialog)); + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); + gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); + + g_signal_connect(G_OBJECT(dialog), "key-press-event", G_CALLBACK(esc_key_pressed), NULL); + g_signal_connect(G_OBJECT(dialog), "delete_event", G_CALLBACK(force_quit_dialog), NULL); + + table = gtk_table_new(3, 3, FALSE); + gtk_table_set_row_spacings(GTK_TABLE(table), 5); + gtk_container_set_border_width(GTK_CONTAINER(table), 15); + gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table); + + label[0] = gtk_label_new(" "); + if (resrc->type == RESRC_URL) { + label[1] = gtk_label_new("Resource type:"); + snprintf(tmp1, 256, "%s Feed", resrc->format == RSS_2_0 ? "RSS 2.0" : \ + (resrc->format == RSS_ATOM ? "Atom" : "RSS 1.0")); + label[2] = gtk_label_new(tmp1); + + label[3] = gtk_label_new("Feed title:"); + label[4] = gtk_label_new(resrc->feed_title); + + label[5] = gtk_label_new("Feed URL:"); + tmp2 = l_str_new("id[i] != '\0' && j < (FILE_NAME_MAXLEN * 2) - 4; i++, j++) + if (resrc->id[i] != '&') + tmp3[j] = resrc->id[i]; + else { + str_n_cpy(tmp3 + j, "&", 5); + j += 4; + } + tmp3[j] = '\0'; + tmp2 = l_str_cat(tmp2, tmp3); + tmp2 = l_str_cat(tmp2, "\">"); + tmp2 = l_str_cat(tmp2, tmp3); + tmp2 = l_str_cat(tmp2, ""); + label[6] = gtk_label_new(tmp2); + l_str_free(tmp2); + free2(tmp3); + gtk_label_set_use_markup(GTK_LABEL(label[6]), TRUE); + + for (i = 0; i < 7; i++) + gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); + + VERBOSE_INFO_OUT("Resource properties:\n" + " Resource type: %s\n Feed title: %s\n Feed URL: %s\n", + tmp1, resrc->feed_title, resrc->id) + } else if (resrc->type == RESRC_FILE) { + label[1] = gtk_label_new("Resource type: "); + label[2] = gtk_label_new("File"); + + label[3] = gtk_label_new("File name: "); + label[4] = gtk_label_new(resrc->id); + gtk_label_set_selectable(GTK_LABEL(label[4]), TRUE); + + for (i = 0; i < 5; i++) + gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); + + VERBOSE_INFO_OUT("Resource Properties:\n" + " Resource type: File\n File name: %s\n", resrc->id) + } + + gtk_table_attach_defaults(GTK_TABLE(table), label[0], 1, 2, 0, 1); + + gtk_table_attach_defaults(GTK_TABLE(table), label[1], 0, 1, 0, 1); + gtk_table_attach_defaults(GTK_TABLE(table), label[2], 2, 3, 0, 1); + + gtk_table_attach_defaults(GTK_TABLE(table), label[3], 0, 1, 1, 2); + gtk_table_attach_defaults(GTK_TABLE(table), label[4], 2, 3, 1, 2); + + if (resrc->type == RESRC_URL) { + gtk_table_attach_defaults(GTK_TABLE(table), label[5], 0, 1, 2, 3); + gtk_table_attach_defaults(GTK_TABLE(table), label[6], 2, 3, 2, 3); + } + + gtk_widget_show_all(dialog); + while (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_CANCEL_CLOSE); + + gtk_widget_destroy(dialog); + check_main_win_always_on_top(); +} + static void get_layout_dims(GtkWidget *view, int *layout_width, int *layout_height, char *str) { - PangoLayout *p_layout; + PangoLayout *p_layout; p_layout = pango_layout_new(gtk_widget_get_pango_context(view)); pango_layout_set_text(p_layout, str, -1); - pango_layout_get_pixel_size2(p_layout, layout_width, layout_height); + pango_layout_get_pixel_size(p_layout, layout_width, layout_height); if (p_layout != NULL) g_object_unref(p_layout); } -void help_win() -{ #ifndef G_OS_WIN32 -# define FONT "DejaVu Sans Mono 8" /* 8 9 10 OK */ +# define HLPWIN_FONT "DejaVu Sans Mono 8" /* 8 9 10 OK */ #else -# define FONT "Courier New 8" +# define HLPWIN_FONT "Courier New 8" #endif #define HLPWIN_FG_COLOR "#000000ff" /* Black */ #define HLPWIN_BG_COLOR "#ffffffff" /* White */ +void help_win() +{ GtkWidget *dialog, *sc_win, *view; GtkTextBuffer *buf; PangoFontDescription *font_des; @@ -142,7 +244,7 @@ view = gtk_text_view_new_with_buffer(buf); gtk_text_view_set_editable(GTK_TEXT_VIEW(view), FALSE); gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(view), FALSE); - font_des = pango_font_description_from_string(FONT); + font_des = pango_font_description_from_string(HLPWIN_FONT); gtk_widget_modify_font(view, font_des); get_gdk_color_from_hexstr(HLPWIN_FG_COLOR, &fg_color, &fgc_alpha); @@ -192,7 +294,7 @@ check_main_win_always_on_top(); } -static gint license_win() +static int license_win() { GtkWidget *dialog, *label; char *txt; @@ -241,10 +343,16 @@ return TRUE; } +static int go_to_paypal0() +{ + go_to_paypal(); + return TRUE; +} + void about_win() { - GtkWidget *dialog, *table, *image = NULL, *label[4]; - GtkWidget *license_but, *close_but; + GtkWidget *dialog, *table, *image = NULL, *label[5]; + GtkWidget *license_but, *go_to_paypal_but, *close_but; gtk_window_set_keep_above(GTK_WINDOW(get_ticker_env()->win), FALSE); @@ -254,6 +362,7 @@ NULL); license_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "License", GTK_RESPONSE_NONE); + go_to_paypal_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Donate" , GTK_RESPONSE_NONE); close_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL_CLOSE); close_but = close_but; /* to Get rid of one stupid compiler warning */ @@ -262,10 +371,15 @@ gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); g_signal_connect(G_OBJECT(license_but), "clicked", G_CALLBACK(license_win), NULL); + g_signal_connect(G_OBJECT(go_to_paypal_but), "clicked", G_CALLBACK(go_to_paypal0), NULL); g_signal_connect(G_OBJECT(dialog), "key-press-event", G_CALLBACK(esc_key_pressed), NULL); g_signal_connect(G_OBJECT(dialog), "delete_event", G_CALLBACK(force_quit_dialog), NULL); +#ifndef ABOUT_WIN_QUOTE table = gtk_table_new(5, 1, FALSE); +#else + table = gtk_table_new(6, 1, FALSE); +#endif gtk_table_set_row_spacings(GTK_TABLE(table), 5); gtk_container_set_border_width(GTK_CONTAINER(table), 15); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table); @@ -273,10 +387,10 @@ image = gtk_image_new_from_file(get_imagefile_full_name_from_name(TICKR_LOGO)); gtk_table_attach_defaults(GTK_TABLE(table), image, 0, 1, 0, 1); - label[0] = gtk_label_new("\n" APP_NAME " version " APP_VERSION_NUMBER " - Feed Reader"); + label[0] = gtk_label_new("\n" APP_NAME " version " APP_V_NUM " - Feed Reader"); gtk_label_set_use_markup(GTK_LABEL(label[0]), TRUE); gtk_table_attach_defaults(GTK_TABLE(table), label[0], 0, 1, 1, 2); - label[1] = gtk_label_new("Copyright (C) Emmanuel Thomas-Maurin 2009-2013"); + label[1] = gtk_label_new("" COPYRIGHT_STR ""); gtk_label_set_use_markup(GTK_LABEL(label[1]), TRUE); gtk_table_attach_defaults(GTK_TABLE(table), label[1], 0, 1, 2, 3); label[2] = gtk_label_new("" SUPPORT_EMAIL_ADDR ""); @@ -285,6 +399,11 @@ label[3] = gtk_label_new("" WEBSITE_URL ""); gtk_label_set_use_markup(GTK_LABEL(label[3]), TRUE); gtk_table_attach_defaults(GTK_TABLE(table), label[3], 0, 1, 4, 5); +#ifdef ABOUT_WIN_QUOTE + label[4] = gtk_label_new("\n\"" ABOUT_WIN_QUOTE "\""); + gtk_label_set_use_markup(GTK_LABEL(label[4]), TRUE); + gtk_table_attach_defaults(GTK_TABLE(table), label[4], 0, 1, 5, 6); +#endif gtk_widget_show_all(dialog); while (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_CANCEL_CLOSE); @@ -294,25 +413,70 @@ } /* - * Info, warning or error. - * ==================================================================== - * get_params()->disable_popups applies to info_win(), info_win_wait() + * Insert newline(s) if one string (ie between 2 newlines) is too long + * (ie > MAX_LINE_LEN). Returned string must be free2() afterwards. + */ +#define MAX_LINE_LEN 100 +#define MAX_NEWLINES_N 20 + +static char *insert_newlines_if_too_long(const char *txt) +{ + char *txt2; + int line_len, word_len; + int i, j, k; + + txt2 = malloc2(strlen(txt) + MAX_NEWLINES_N + 1); + line_len = 0; + word_len = 0; + i = j = k = 0; + + while (*(txt + i) != '\0') { + if (*(txt + i) == ' ') + word_len = -1; + if (*(txt + i) == '\n') { + line_len = -1; + word_len = -1; + } else if (line_len > 0 && line_len % MAX_LINE_LEN == 0) { + if (k++ < MAX_NEWLINES_N) { + if (word_len < line_len) { + i -= word_len; + j -= word_len + 1; + } + *(txt2 + j++) = '\n'; + line_len = 0; + word_len = 0; + } else + break; + } + *(txt2 + j++) = *(txt + i++); + line_len++; + word_len++; + } + *(txt2 + j) = '\0'; + + return txt2; +} + +/* + * Info, warning or error. Format text in case of long strings. + * ======================================================================== + * get_params()->disable_popups applies to info_win(), info_win_no_block(), * and warning(). * warning() always send info to sdtout/stderr. - * ==================================================================== - * should format text in case we have a long string ? + * ======================================================================== */ -void info_win(const char *title, const char *txt, info_type info, gboolean selectable) +void info_win(const char *title, const char *txt, info_type info, zboolean selectable) { GtkWidget *dialog, *table, *image = NULL, *label[2]; - gint layout_width, layout_height; + char *txt2; if (get_params()->disable_popups == 'y') return; gtk_window_set_keep_above(GTK_WINDOW(get_ticker_env()->win), FALSE); dialog = gtk_dialog_new_with_buttons( - title, GTK_WINDOW(get_ticker_env()->win), + /* FIXME: Use APP_NAME if title is empty ? */ + title[0] != '\0' ? title : APP_NAME, GTK_WINDOW(get_ticker_env()->win), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); @@ -331,8 +495,8 @@ gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table); if (info == INFO) { - /* Better without any image if info only so do nothing here */ - /*image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG);*/ + /* Better without any image if info only so do nothing here - + image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG);*/ } else if (info == INFO_WARNING) { image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); gtk_table_attach_defaults(GTK_TABLE(table), image, 0, 1, 0, 1); @@ -341,18 +505,23 @@ gtk_table_attach_defaults(GTK_TABLE(table), image, 0, 1, 0, 1); } - label[0] = gtk_label_new(txt); - /* Better if disabled + txt2 = insert_newlines_if_too_long(txt); + label[0] = gtk_label_new(txt2); + free2((char *)txt2); + + /* Better if disabled - gtk_label_set_use_markup(GTK_LABEL(label[0]), TRUE);*/ + pango_layout_set_single_paragraph_mode(gtk_label_get_layout(GTK_LABEL(label[0])), FALSE); + /* Useless now - Hmmm, should be pango_layout_get_pixel_size(gtk_label_get_layout(GTK_LABEL(label[0])), &layout_width, &layout_height); if (info == INFO) { if (layout_width > get_ticker_env()->screen_w - 60) gtk_widget_set_size_request(label[0], get_ticker_env()->screen_w - 60, -1); } else { - if (layout_width > get_ticker_env()->screen_w - 120) /* Extra 60 pixels for image width */ + if (layout_width > get_ticker_env()->screen_w - 120) // Extra 60 pixels for image width gtk_widget_set_size_request(label[0], get_ticker_env()->screen_w - 120, -1); - } + }*/ if (selectable) gtk_label_set_selectable(GTK_LABEL(label[0]), TRUE); gtk_table_attach_defaults(GTK_TABLE(table), label[0], 1, 2, 0, 1); @@ -363,16 +532,60 @@ gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); + while (gtk_events_pending()) /* So that win will close immediately */ + gtk_main_iteration(); check_main_win_always_on_top(); } +/* Need only gtk_init() so called only from big_error() in tickr_error.c. */ +void minimalistic_info_win(const char *title, const char *txt) +{ + GtkWidget *dialog, *table, *image = NULL, *label[2]; + char *txt2; + + dialog = gtk_dialog_new_with_buttons( + title, NULL, + GTK_DIALOG_MODAL, + GTK_STOCK_OK, GTK_RESPONSE_OK, + NULL); + + set_tickr_icon_to_dialog(GTK_WINDOW(dialog)); + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); + gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); + gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE); + + table = gtk_table_new(1, 3, FALSE); + gtk_table_set_col_spacings(GTK_TABLE(table), 10); + gtk_container_set_border_width(GTK_CONTAINER(table), 0); + gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table); + + image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_DIALOG); + gtk_table_attach_defaults(GTK_TABLE(table), image, 0, 1, 0, 1); + + txt2 = insert_newlines_if_too_long(txt); + label[0] = gtk_label_new(txt2); + free2((char *)txt2); + pango_layout_set_single_paragraph_mode(gtk_label_get_layout(GTK_LABEL(label[0])), FALSE); + + gtk_table_attach_defaults(GTK_TABLE(table), label[0], 1, 2, 0, 1); + label[1] = gtk_label_new(""); + gtk_table_attach_defaults(GTK_TABLE(table), label[1], 2, 3, 0, 1); + + gtk_widget_show_all(dialog); + gtk_dialog_run(GTK_DIALOG(dialog)); + + gtk_widget_destroy(dialog); + while (gtk_events_pending()) /* So that win will close immediately */ + gtk_main_iteration(); +} + /* Don't block but show up for ms then close. * TODO: write a more configurable func ? */ -void info_win_wait(const char *txt, int delay) +void info_win_no_block(const char *txt, int delay) { GtkWidget *win; GtkWidget *table, *image, *label[2]; - gint layout_width, layout_height; + int layout_width, layout_height; if (get_params()->disable_popups == 'y') return; @@ -393,7 +606,7 @@ gtk_table_attach_defaults(GTK_TABLE(table), image, 0, 1, 0, 1); label[0] = gtk_label_new(txt); - /* Better if disabled + /* Better if disabled - gtk_label_set_use_markup(GTK_LABEL(label[0]), TRUE);*/ pango_layout_get_pixel_size(gtk_label_get_layout(GTK_LABEL(label[0])), &layout_width, &layout_height); @@ -404,29 +617,32 @@ gtk_table_attach_defaults(GTK_TABLE(table), label[1], 2, 3, 0, 1); gtk_widget_show_all(win); - /* So that win will popup immediately */ - while (gtk_events_pending()) + while (gtk_events_pending()) /* So that win will popup immediately */ gtk_main_iteration(); #ifndef G_OS_WIN32 - sleep(delay / 1000); + nanosleep2(delay * 1000000); #else Sleep(delay); #endif gtk_widget_destroy(win); + while (gtk_events_pending()) /* So that win will close immediately */ + gtk_main_iteration(); check_main_win_always_on_top(); } -/* Win centered */ -int question_win(const char *txt) +/* Win centered. + * default_response = YES / NO / -1 (or anything != YES and != NO) for nothing selected. */ +int question_win(const char *txt, int default_response) { - return question_win_at(txt, GTK_WIN_POS_CENTER); + return question_win_at(txt, default_response, GTK_WIN_POS_CENTER); } -int question_win_at(const char *txt, int win_pos) +/* default_response = YES / NO / -1 (or anything != YES and != NO) for nothing selected. */ +int question_win_at(const char *txt, int default_response, int win_pos) { GtkWidget *dialog, *table, *image, *label[2]; - gint response; + int response; gtk_window_set_keep_above(GTK_WINDOW(get_ticker_env()->win), FALSE); @@ -441,8 +657,12 @@ gtk_window_set_position(GTK_WINDOW(dialog), win_pos); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE); - /* Why always no ? - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_NO);*/ + if (default_response == YES) + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES); + else if (default_response == NO) + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_NO); + else + default_response = -1; table = gtk_table_new(1, 3, FALSE); gtk_table_set_col_spacings(GTK_TABLE(table), 10); @@ -458,15 +678,19 @@ gtk_table_attach_defaults(GTK_TABLE(table), label[1], 2, 3, 0, 1); gtk_widget_show_all(dialog); + if (default_response == -1) + gtk_window_set_focus(GTK_WINDOW(dialog), NULL); response = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); + while (gtk_events_pending()) /* So that win will close immediately */ + gtk_main_iteration(); check_main_win_always_on_top(); return ((response == GTK_RESPONSE_YES) ? YES : NO); } -/* This one is buggy as the spinner don't always spin as expected (hmm...) */ -void win_with_spinner(win_with_spinner_mode mode, const char *txt) +/* The spinner doesn't always spin as expected (hmm...) so now commented out */ +/*void win_with_spinner(win_with_spinner_mode mode, const char *txt) { static GtkWidget *win; GtkWidget *hbox, *label; @@ -497,8 +721,7 @@ gtk_container_set_border_width(GTK_CONTAINER(GTK_BOX(hbox)), 15); gtk_widget_show_all(win); - /* So that win will popup immediately */ - while (gtk_events_pending()) + while (gtk_events_pending()) // So that win will popup immediately gtk_main_iteration(); #ifndef G_OS_WIN32 gtk_spinner_start(GTK_SPINNER(spinner)); @@ -510,12 +733,12 @@ gtk_widget_destroy(win); check_main_win_always_on_top(); } else - warning(FALSE, 1, "win_with_spinner(): Invalid mode"); -} + warning(BLOCK, "win_with_spinner(): Invalid mode"); +}*/ void win_with_progress_bar(win_with_progress_bar_mode mode, const char *txt) { - static GtkWidget *win, *hbox, *progress_bar; + static GtkWidget *win, *hbox, *progress_bar; if (mode == WIN_WITH_PROGRESS_BAR_OPEN) { gtk_window_set_keep_above(GTK_WINDOW(get_ticker_env()->win), FALSE); @@ -536,8 +759,7 @@ gtk_widget_show_all(win); - /* So that win will popup immediately */ - while (gtk_events_pending()) + while (gtk_events_pending()) /* So that win will popup immediately */ gtk_main_iteration(); } else if (mode == WIN_WITH_PROGRESS_BAR_PULSE) { if (txt != NULL) @@ -550,5 +772,16 @@ gtk_widget_destroy(win); check_main_win_always_on_top(); } else - warning(FALSE, 1, "win_with_spinner(): Invalid mode"); + warning(BLOCK, "win_with_progress_bar(): Invalid mode"); } + +#ifndef G_OS_WIN32 +void nanosleep2(long nano_sec) +{ + struct timespec ts; + + ts.tv_sec = 0; + ts.tv_nsec = nano_sec; + nanosleep(&ts, NULL); +} +#endif diff -Nru tickr-0.6.4/src/tickr/tickr_params.c tickr-0.7.0/src/tickr/tickr_params.c --- tickr-0.6.4/src/tickr/tickr_params.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_params.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -20,14 +20,15 @@ void set_default_options(Params *prm) { - char tmp_font[FONT_MAXLEN + 1]; + char tmp_font[FONT_MAXLEN + 1]; prm->delay = DELAY; prm->shift_size = SHIFTSIZE; compact_font(tmp_font, FONTNAME, FONTSIZE); - str_n_cpy(prm->font_n_s, tmp_font, FONT_MAXLEN); + str_n_cpy(prm->font_name_size, tmp_font, FONT_MAXLEN); get_gdk_color_from_hexstr(FGCOLOR, &prm->fg_color, &prm->fg_color_alpha); + /*get_gdk_color_from_hexstr(HIGHLIGHTFGCOLOR, &prm->highlight_fg_color, &prm->highlight_fg_color_alpha);*/ get_gdk_color_from_hexstr(BGCOLOR, &prm->bg_color, &prm->bg_color_alpha); prm->set_gradient_bg = SETGRADIENTBG; get_gdk_color_from_hexstr(BGCOLOR2, &prm->bg_color2, &prm->bg_color2_alpha); @@ -41,23 +42,23 @@ prm->windec = WINDEC; prm->always_on_top = ALWAYSONTOP; prm->win_transparency = WINTRANSPARENCY; + prm->icon_in_taskbar = ICONINTASKBAR; + prm->win_sticky = WINSTICKY; + prm->override_redirect = OVERRIDE_REDIRECT; prm->shadow = SHADOW; prm->shadow_offset_x = SHADOWOFFSET_X; prm->shadow_offset_y = SHADOWOFFSET_Y; prm->shadow_fx = SHADOWFX; - prm->icon_in_taskbar = ICONINTASKBAR; - prm->win_sticky = WINSTICKY; - str_n_cpy(prm->line_delimiter, LINEDELIMITER, DELIMITER_MAXLEN); - str_n_cpy(prm->cutline_delimiter, CUTLINEDELIMITER, DELIMITER_MAXLEN); prm->special_chars = SPECIALCHARS; prm->new_page_char = NEWPG; prm->tab_char = TABCH; prm->rss_refresh = RSSREFRESH; + prm->reverse_sc = REVERSESCROLLING; prm->feed_title = FEEDTITLE; str_n_cpy(prm->feed_title_delimiter, FEEDTITLEDELIMITER, DELIMITER_MAXLEN); prm->item_title = ITEMTITLE; @@ -66,6 +67,7 @@ str_n_cpy(prm->item_description_delimiter, ITEMDESCRIPTIONDELIMITER, DELIMITER_MAXLEN); prm->n_items_per_feed = NITEMSPERFEED; + /*prm->mark_item_action = MARKITEMACTION;*/ prm->strip_html_tags = STRIPHTMLTAGS; prm->upper_case_text = UPPERCASETEXT; str_n_cpy(prm->homefeed, HOMEFEED, FILE_NAME_MAXLEN); @@ -74,18 +76,21 @@ str_n_cpy(prm->open_link_args, OPENLINKARGS, FILE_NAME_MAXLEN); prm->clock = CLOCK; + prm->clock_sec = CLOCKSEC; + prm->clock_12h = CLOCK12H; + prm->clock_date = CLOCKDATE; get_gdk_color_from_hexstr(CFGCOLOR, &prm->clock_fg_color, &prm->clock_fg_color_alpha); get_gdk_color_from_hexstr(CBGCOLOR, &prm->clock_bg_color, &prm->clock_bg_color_alpha); prm->set_clock_gradient_bg = SETCLOCKGRADIENTBG; get_gdk_color_from_hexstr(CBGCOLOR2, &prm->clock_bg_color2, &prm->clock_bg_color2_alpha); compact_font(tmp_font, CFONTNAME, CFONTSIZE); - str_n_cpy(prm->clock_font_n_s, tmp_font, FONT_MAXLEN); + str_n_cpy(prm->clock_font_name_size, tmp_font, FONT_MAXLEN); prm->disable_popups = DISABLEPOPUPS; prm->pause_on_mouseover = PAUSEONMOUSEOVER; prm->disable_leftclick = DISABLELEFTCLICK; - prm->mouse_wheel_scroll = MOUSEWHEELSCROLL; - prm->sfpicker_closes_when_pointer_leaves = SFPICKERCLOSESWHENPOINTERLEAVES; + prm->mouse_wheel_action = MOUSEWHEELACTION; + prm->sfeedpicker_autoclose = SFEEDPICKERAUTOCLOSE; prm->enable_feed_ordering = ENABLEFEEDORDERING; prm->use_authentication = USEAUTHENTICATION; @@ -95,6 +100,8 @@ str_n_cpy(prm->proxy_port, PROXYPORT, PROXY_PORT_MAXLEN); prm->use_proxy_authentication = USEPROXYAUTHENTICATION; str_n_cpy(prm->proxy_user, PROXYUSER, PROXY_USER_MAXLEN); + prm->connect_timeout = CONNECT_TIMEOUT; + prm->send_recv_timeout = SENDRECV_TIMEOUT; } /* @@ -116,16 +123,16 @@ for (i = 0; ; i++) { /* * Here fgets() read OPTION_MAXLEN + 1 char max including - * '\n' then add '\0' (if I'm right...) + * '\n' then add '\0' (if I'm right) */ if (i >= N_OPTION_MAX) { ptr[i] = NULL; - warning(FALSE, 5, "Too many lines in configuration file: ", - get_datafile_full_name_from_name(CONFIG_FILE), - "(max = ", itoa2(N_OPTION_MAX), ")" - "\nWon't parse further than limit\n"); + warning(BLOCK, "Too many lines in configuration file '%s' " + "(max = %d)\nWon't parse further than limit\n", + get_datafile_full_name_from_name(CONFIG_FILE), N_OPTION_MAX); break; } + /* TODO: Should use getline() instead ? */ if (fgets(options_array[i], OPTION_MAXLEN + 2, conf_fp) == NULL) { ptr[i] = NULL; break; @@ -141,8 +148,8 @@ j = 0; fclose(conf_fp); } else - fprintf(STD_ERR, "Can't read configuration file: %s - %s\n", - get_datafile_full_name_from_name(CONFIG_FILE), strerror(errno)); + INFO_ERR("Can't read configuration file '%s': %s\n", + get_datafile_full_name_from_name(CONFIG_FILE), strerror(errno)) return j; } @@ -152,41 +159,45 @@ */ int parse_options_array(Params *prm, int n_options, const char *option[]) { - int i, exit_status = OK; + int i, j, error_code = OK; if (n_options > N_OPTION_MAX) { n_options = N_OPTION_MAX; - fprintf(STD_ERR, - "Too many options (max = %d) - Won't parse further than limit\n", - N_OPTION_MAX); - exit_status = OPTION_TOO_MANY; + INFO_ERR("Too many options (max = %d) - Won't parse further than limit\n", + N_OPTION_MAX) + error_code = OPTION_TOO_MANY; } for (i = 0; i < n_options && option[i] != NULL; i++) - if (get_name_value_from_option(prm, option[i]) != OK) - exit_status = OPTION_ERROR; - return exit_status; + if ((j = get_name_value_from_option(prm, option[i])) != OK) { + /* FIXME: Will only get last error code */ + error_code = j; + /* But if OPTION_ERROR_QUIT is set to TRUE */ + if (OPTION_ERROR_QUIT) + break; + } + return error_code; } int get_name_value_from_option(Params *prm, const char *option) { /* * Options are splitted into name and value. - * font -> fname is FONT_NAME_MAXLEN char max long, fsize FONT_SIZE_MAXLEN, - * plus 1 extra space so font_n_s (font name size) is up to + * font -> font_name is FONT_NAME_MAXLEN char max long, font_size FONT_SIZE_MAXLEN, + * plus 1 extra space so font_name_size is up to * FONT_MAXLEN = FONT_NAME_MAXLEN + 1 + FONT_SIZE_MAXLEN char long. * OPTION_MAXLEN = OPTION_NAME_MAXLEN + OPTION_VALUE_MAXLEN + 4 (-name="value"). * * === If unsure, check this in tickr.h === */ char name[OPTION_NAME_MAXLEN + 1], value[OPTION_VALUE_MAXLEN + 1]; - char fname[FONT_NAME_MAXLEN + 1], fsize[FONT_SIZE_MAXLEN + 1]; - char cfname[FONT_NAME_MAXLEN + 1], cfsize[FONT_SIZE_MAXLEN + 1]; + char font_name[FONT_NAME_MAXLEN + 1], font_size[FONT_SIZE_MAXLEN + 1]; + char c_font_name[FONT_NAME_MAXLEN + 1], c_font_size[FONT_SIZE_MAXLEN + 1]; char tmp[OPTION_MAXLEN + 1]; char tmp_font[FONT_MAXLEN + 1]; - int i, exit_status = OK; + int i, error_code = OK; - split_font(prm->font_n_s, fname, fsize); - split_font(prm->clock_font_n_s, cfname, cfsize); + split_font(prm->font_name_size, font_name, font_size); + split_font(prm->clock_font_name_size, c_font_name, c_font_size); /* * Split option into name & value if any */ @@ -202,8 +213,8 @@ break; } } else if (option[0] != '\0') { - fprintf(STD_ERR, "Invalid option: %s\n", option); - return (exit_status = OPTION_INVALID); + INFO_ERR("Invalid option: %s\n", option) + return (error_code = OPTION_INVALID); } /* * All *string* values are saved inclosed in a pair of ". When read, enclosing " (or ') @@ -223,32 +234,39 @@ else if (strcmp(name, "shiftsize") == 0) prm->shift_size = atoi(value); else if (strcmp(name, "fontname") == 0) - str_n_cpy(fname, value, FONT_NAME_MAXLEN); + str_n_cpy(font_name, value, FONT_NAME_MAXLEN); else if (strcmp(name, "fontsize") == 0) { - str_n_cpy(fsize, value, FONT_SIZE_MAXLEN); - if (atoi(fsize) > FONT_MAXSIZE) { - snprintf(fsize, FONT_SIZE_MAXLEN + 1, "%3d", FONT_MAXSIZE); - fprintf(STD_ERR, "Font size set to %d (can't be above)\n", - FONT_MAXSIZE); + str_n_cpy(font_size, value, FONT_SIZE_MAXLEN); + if (atoi(font_size) > FONT_MAXSIZE) { + snprintf(font_size, FONT_SIZE_MAXLEN + 1, "%3d", FONT_MAXSIZE); + INFO_ERR("Font size set to %d (can't be above)\n", + FONT_MAXSIZE) } } else if (strcmp(name, "fgcolor") == 0) { if (!get_gdk_color_from_hexstr(value, &prm->fg_color, &prm->fg_color_alpha)) { get_gdk_color_from_hexstr(FGCOLOR, &prm->fg_color, &prm->fg_color_alpha); - exit_status = OPTION_VALUE_INVALID; + error_code = OPTION_VALUE_INVALID; } - } else if (strcmp(name, "bgcolor") == 0) { + } else /*if (strcmp(name, "highlightfgcolor") == 0) { + if (!get_gdk_color_from_hexstr(value, &prm->highlight_fg_color, + &prm->highlight_fg_color_alpha)) { + get_gdk_color_from_hexstr(HIGHLIGHTFGCOLOR, &prm->highlight_fg_color, + &prm->highlight_fg_color_alpha); + error_code = OPTION_VALUE_INVALID; + } + } else*/ if (strcmp(name, "bgcolor") == 0) { if (!get_gdk_color_from_hexstr(value, &prm->bg_color, &prm->bg_color_alpha)) { get_gdk_color_from_hexstr(BGCOLOR, &prm->bg_color, &prm->bg_color_alpha); - exit_status = OPTION_VALUE_INVALID; + error_code = OPTION_VALUE_INVALID; } } else if (strcmp(name, "setgradientbg") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->set_gradient_bg = value[0]; } else if (strcmp(name, "bgcolor2") == 0) { @@ -256,12 +274,12 @@ &prm->bg_color2_alpha)) { get_gdk_color_from_hexstr(BGCOLOR, &prm->bg_color2, &prm->bg_color2_alpha); - exit_status = OPTION_VALUE_INVALID; + error_code = OPTION_VALUE_INVALID; } } else if (strcmp(name, "disablescreenlimits") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->disable_screen_limits = value[0]; } else if (strcmp(name, "win_x") == 0) @@ -283,65 +301,67 @@ prm->win_h = DRWA_HEIGHT_MIN; } else if (strcmp(name, "windec") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->windec = value[0]; } else if (strcmp(name, "alwaysontop") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->always_on_top = value[0]; } else if (strcmp(name, "wintransparency") == 0) { - /* Compare as integers (because less bug-prone) then set as gdouble. + /* Compare as integers (because less bug-prone) then set as double. * Saved to / retrieved from config file as [transparency x 10]. */ prm->win_transparency = atoi(value); if ((int)prm->win_transparency < 1) { - fprintf(STD_ERR, "Invalid value: %s - will be set to 1\n", option); + INFO_ERR("Invalid value: %s - will be set to 1\n", option) prm->win_transparency = 1.0; - exit_status = OPTION_VALUE_INVALID; + error_code = OPTION_VALUE_INVALID; } else if ((int)prm->win_transparency > 10) { - fprintf(STD_ERR, "Invalid value: %s - will be set to 10\n", option); + INFO_ERR("Invalid value: %s - will be set to 10\n", option) prm->win_transparency = 10.0; - exit_status = OPTION_VALUE_INVALID; + error_code = OPTION_VALUE_INVALID; } prm->win_transparency /= 10; } else if (strcmp(name, "iconintaskbar") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->icon_in_taskbar = value[0]; } else if (strcmp(name, "winsticky") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->win_sticky = value[0]; + } else if (strcmp(name, "overrideredirect") == 0) { + if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; + } else + prm->override_redirect = value[0]; } else if (strcmp(name, "shadow") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->shadow = value[0]; } - /* Should check value here */ - else if (strcmp(name, "shadowoffset_x") == 0) + else if (strcmp(name, "shadowoffset_x") == 0) /* Should check value here */ prm->shadow_offset_x = atoi(value); - /* Should check value here */ - else if (strcmp(name, "shadowoffset_y") == 0) + else if (strcmp(name, "shadowoffset_y") == 0) /* Should check value here */ prm->shadow_offset_y = atoi(value); else if (strcmp(name, "shadowfx") == 0) prm->shadow_fx = atoi(value); else if (strcmp(name, "linedelimiter") == 0) str_n_cpy(prm->line_delimiter, value, DELIMITER_MAXLEN); - else if (strcmp(name, "cutlinedelimiter") == 0) - str_n_cpy(prm->cutline_delimiter, value, DELIMITER_MAXLEN); else if (strcmp(name, "specialchars") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->special_chars = value[0]; } else if (strcmp(name, "newpgchar") == 0) @@ -350,42 +370,55 @@ prm->tab_char = value[0]; else if (strcmp(name, "rssrefresh") == 0) prm->rss_refresh = atoi(value); - else if (strcmp(name, "feedtitle") == 0) { + else if (strcmp(name, "revsc") == 0) { + if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; + } else + prm->reverse_sc = value[0]; + } else if (strcmp(name, "feedtitle") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->feed_title = value[0]; } else if (strcmp(name, "feedtitledelimiter") == 0) str_n_cpy(prm->feed_title_delimiter, value, DELIMITER_MAXLEN); else if (strcmp(name, "itemtitle") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->item_title = value[0]; } else if (strcmp(name, "itemtitledelimiter") == 0) str_n_cpy(prm->item_title_delimiter, value, DELIMITER_MAXLEN); else if (strcmp(name, "itemdescription") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->item_description = value[0]; } else if (strcmp(name, "itemdescriptiondelimiter") == 0) str_n_cpy(prm->item_description_delimiter, value, DELIMITER_MAXLEN); else if (strcmp(name, "nitemsperfeed") == 0) prm->n_items_per_feed = atoi(value); - else if (strcmp(name, "rmtags") == 0) { + else /*if (strcmp(name, "markitemaction") == 0) { + if (strcmp(value, "h") != 0 && strcmp(value, "c") != 0 \ + && strcmp(value, "n") != 0) { + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; + } else + prm->mark_item_action = value[0]; + } else*/ if (strcmp(name, "rmtags") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->strip_html_tags = value[0]; } else if (strcmp(name, "uppercasetext") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->upper_case_text = value[0]; @@ -398,32 +431,50 @@ else if (strcmp(name, "clock") == 0) { if (strcmp(value, "l") != 0 && strcmp(value, "r") != 0 \ && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->clock = value[0]; + } else if (strcmp(name, "clocksec") == 0) { + if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; + } else + prm->clock_sec = value[0]; + } else if (strcmp(name, "clock12h") == 0) { + if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; + } else + prm->clock_12h = value[0]; + } else if (strcmp(name, "clockdate") == 0) { + if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; + } else + prm->clock_date = value[0]; } else if (strcmp(name, "clockfontname") == 0) - str_n_cpy(cfname, value, FONT_NAME_MAXLEN); + str_n_cpy(c_font_name, value, FONT_NAME_MAXLEN); else if (strcmp(name, "clockfontsize") == 0) - str_n_cpy(cfsize, value, FONT_SIZE_MAXLEN); + str_n_cpy(c_font_size, value, FONT_SIZE_MAXLEN); else if (strcmp(name, "clockfgcolor") == 0) { if (!get_gdk_color_from_hexstr(value, &prm->clock_fg_color, &prm->clock_fg_color_alpha)) { get_gdk_color_from_hexstr(CFGCOLOR, &prm->clock_fg_color, &prm->clock_fg_color_alpha); - exit_status = OPTION_VALUE_INVALID; + error_code = OPTION_VALUE_INVALID; } } else if (strcmp(name, "clockbgcolor") == 0) { if (!get_gdk_color_from_hexstr(value, &prm->clock_bg_color, &prm->clock_bg_color_alpha)) { get_gdk_color_from_hexstr(CBGCOLOR, &prm->clock_bg_color, &prm->clock_bg_color_alpha); - exit_status = OPTION_VALUE_INVALID; + error_code = OPTION_VALUE_INVALID; } } else if (strcmp(name, "setclockgradientbg") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->set_clock_gradient_bg = value[0]; } else if (strcmp(name, "clockbgcolor2") == 0) { @@ -431,50 +482,50 @@ &prm->clock_bg_color2_alpha)) { get_gdk_color_from_hexstr(BGCOLOR, &prm->clock_bg_color2, &prm->clock_bg_color2_alpha); - exit_status = OPTION_VALUE_INVALID; + error_code = OPTION_VALUE_INVALID; } } else if (strcmp(name, "disablepopups") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->disable_popups = value[0]; } else if (strcmp(name, "pauseonmouseover") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->pause_on_mouseover = value[0]; } else if (strcmp(name, "disableleftclick") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->disable_leftclick = value[0]; - } else if (strcmp(name, "mousewheelscroll") == 0) { + } else if (strcmp(name, "mousewheelaction") == 0) { if (strcmp(value, "s") != 0 && strcmp(value, "f") != 0 \ && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else - prm->mouse_wheel_scroll = value[0]; - } else if (strcmp(name, "sfpickercloseswhenpointerleaves") == 0) { + prm->mouse_wheel_action = value[0]; + } else if (strcmp(name, "sfeedpickerautoclose") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else - prm->sfpicker_closes_when_pointer_leaves = value[0]; + prm->sfeedpicker_autoclose = value[0]; } else if (strcmp(name, "enablefeedordering") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else prm->enable_feed_ordering = value[0]; /* Params in connection settings win */ } else if (strcmp(name, "useauth") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else { prm->use_authentication = value[0]; set_use_authentication(value[0] == 'y' ? TRUE : FALSE); @@ -487,8 +538,8 @@ str_n_cpy(get_http_auth_psw(), value, PSW_MAXLEN); else if (strcmp(name, "useproxy") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else { prm->use_proxy = value[0]; set_use_proxy(value[0] == 'y' ? TRUE : FALSE); @@ -501,8 +552,8 @@ str_n_cpy(get_proxy_port(), value, PROXY_PORT_MAXLEN); } else if (strcmp(name, "useproxyauth") == 0) { if (strcmp(value, "y") != 0 && strcmp(value, "n") != 0) { - fprintf(STD_ERR, "Invalid value: %s\n", option); - exit_status = OPTION_VALUE_INVALID; + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; } else { prm->use_proxy_authentication = value[0]; set_use_proxy_auth(value[0] == 'y' ? TRUE : FALSE); @@ -513,34 +564,45 @@ /* This option is never saved */ } else if (strcmp(name, "proxypsw") == 0) str_n_cpy(get_proxy_auth_psw(), value, PROXY_PSW_MAXLEN); + else if (strcmp(name, "connect-timeout") == 0) { + if (atoi(value) < 1 || atoi(value) > 60) { + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; + } else + prm->connect_timeout = atoi(value); + } else if (strcmp(name, "sendrecv-timeout") == 0) { + if (atoi(value) < 1 || atoi(value) > 60) { + INFO_ERR("Invalid value: %s\n", option) + error_code = OPTION_VALUE_INVALID; + } else + prm->send_recv_timeout = atoi(value); /* Connect params until here */ - /* This option is only set from command line */ - else if (strcmp(name, "instance-id") == 0) - ;/* Does nothing but avoid an 'unknown option' warning/error */ - /* This option is only set from command line */ - else if (strcmp(name, "no-ui") == 0) - ;/* Does nothing but avoid an 'unknown option' warning/error */ - else { - fprintf(STD_ERR, "Unknown option: %s\n", option); - exit_status = OPTION_UNKNOWN; + /* Following options are only set from command line (and never saved) */ + } else if (strcmp(name, "instance-id") == 0) { + /* Does nothing but avoid an 'unknown option' warning/error */ + } else if (strcmp(name, "no-ui") == 0) { + /* Does nothing but avoid an 'unknown option' warning/error */ + } else { + INFO_ERR("Unknown option: %s\n", option) + error_code = OPTION_UNKNOWN; } - compact_font(tmp_font, fname, fsize); - str_n_cpy(prm->font_n_s, tmp_font, FONT_MAXLEN); - compact_font(tmp_font, cfname, cfsize); - str_n_cpy(prm->clock_font_n_s, tmp_font, FONT_MAXLEN); - return exit_status; + compact_font(tmp_font, font_name, font_size); + str_n_cpy(prm->font_name_size, tmp_font, FONT_MAXLEN); + compact_font(tmp_font, c_font_name, c_font_size); + str_n_cpy(prm->clock_font_name_size, tmp_font, FONT_MAXLEN); + return error_code; } void save_to_config_file(const Params *prm) { FILE *conf_fp; - char fname[FONT_NAME_MAXLEN + 1], fsize[FONT_SIZE_MAXLEN + 1]; - char cfname[FONT_NAME_MAXLEN + 1], cfsize[FONT_SIZE_MAXLEN + 1]; + char font_name[FONT_NAME_MAXLEN + 1], font_size[FONT_SIZE_MAXLEN + 1]; + char c_font_name[FONT_NAME_MAXLEN + 1], c_font_size[FONT_SIZE_MAXLEN + 1]; char tmp[4 * 1024]; if ((conf_fp = g_fopen(get_datafile_full_name_from_name(CONFIG_FILE), "wb")) != NULL) { - split_font(prm->font_n_s, fname, fsize); - split_font(prm->clock_font_n_s, cfname, cfsize); + split_font(prm->font_name_size, font_name, font_size); + split_font(prm->clock_font_name_size, c_font_name, c_font_size); snprintf(tmp, 4 * 1024, "%s%s%s", /* All *string* values are saved inclosed in a pair of ". */ @@ -549,6 +611,7 @@ "-fontname=\"%s\"\n" "-fontsize=%d\n" "-fgcolor=\"%s\"\n" + /*"-highlightfgcolor=\"%s\"\n"*/ "-bgcolor=\"%s\"\n" "-setgradientbg=%c\n" "-bgcolor2=\"%s\"\n" @@ -562,16 +625,17 @@ "-wintransparency=%d\n" "-iconintaskbar=%c\n" "-winsticky=%c\n" + "-overrideredirect=%c\n" "-shadow=%c\n" - "-shadowoffset_x=%d\n", + "-shadowoffset_x=%d\n" "-shadowoffset_y=%d\n" "-shadowfx=%d\n" "-linedelimiter=\"%s\"\n" - "-cutlinedelimiter=\"%s\"\n" - "-specialchars=%c\n" + "-specialchars=%c\n", "-newpgchar=%c\n" "-tabchar=%c\n" "-rssrefresh=%d\n" + "-revsc=%c\n" "-feedtitle=%c\n" "-feedtitledelimiter=\"%s\"\n" "-itemtitle=%c\n" @@ -579,23 +643,27 @@ "-itemdescription=%c\n" "-itemdescriptiondelimiter=\"%s\"\n" "-nitemsperfeed=%d\n" + /*"-markitemaction=%c\n"*/ "-rmtags=%c\n" "-uppercasetext=%c\n" "-homefeed=\"%s\"\n" "-openlinkcmd=\"%s\"\n" - "-openlinkargs=\"%s\"\n", + "-openlinkargs=\"%s\"\n" "-clock=%c\n" + "-clocksec=%c\n" + "-clock12h=%c\n" + "-clockdate=%c\n" "-clockfontname=\"%s\"\n" "-clockfontsize=%d\n" "-clockfgcolor=\"%s\"\n" "-clockbgcolor=\"%s\"\n" "-setclockgradientbg=%c\n" - "-clockbgcolor2=\"%s\"\n" + "-clockbgcolor2=\"%s\"\n", "-disablepopups=%c\n" "-pauseonmouseover=%c\n" "-disableleftclick=%c\n" - "-mousewheelscroll=%c\n" - "-sfpickercloseswhenpointerleaves=%c\n" + "-mousewheelaction=%c\n" + "-sfeedpickerautoclose=%c\n" "-enablefeedordering=%c\n" "-useauth=%c\n" "-user=\"%s\"\n" @@ -604,12 +672,15 @@ "-proxyport=\"%s\"\n" "-useproxyauth=%c\n" "-proxyuser=\"%s\"\n" + "-connect-timeout=%d\n" + "-sendrecv-timeout=%d\n" ); fprintf(conf_fp, tmp, prm->delay, prm->shift_size, - fname, atoi(fsize), + font_name, atoi(font_size), get_hexstr_from_gdk_color(&prm->fg_color, &prm->fg_color_alpha), + /*get_hexstr_from_gdk_color(&prm->highlight_fg_color, &prm->highlight_fg_color_alpha),*/ get_hexstr_from_gdk_color(&prm->bg_color, &prm->bg_color_alpha), prm->set_gradient_bg, get_hexstr_from_gdk_color(&prm->bg_color2, &prm->bg_color2_alpha), @@ -623,16 +694,17 @@ (int)(prm->win_transparency * 10), prm->icon_in_taskbar, prm->win_sticky, + prm->override_redirect, prm->shadow, prm->shadow_offset_x, prm->shadow_offset_y, prm->shadow_fx, prm->line_delimiter, - prm->cutline_delimiter, prm->special_chars, prm->new_page_char, prm->tab_char, prm->rss_refresh, + prm->reverse_sc, prm->feed_title, prm->feed_title_delimiter, prm->item_title, @@ -640,14 +712,18 @@ prm->item_description, prm->item_description_delimiter, prm->n_items_per_feed, + /*prm->mark_item_action,*/ prm->strip_html_tags, prm->upper_case_text, prm->homefeed, prm->open_link_cmd, prm->open_link_args, prm->clock, - cfname, - atoi(cfsize), + prm->clock_sec, + prm->clock_12h, + prm->clock_date, + c_font_name, + atoi(c_font_size), get_hexstr_from_gdk_color(&prm->clock_fg_color, &prm->clock_fg_color_alpha), get_hexstr_from_gdk_color(&prm->clock_bg_color, &prm->clock_bg_color_alpha), prm->set_clock_gradient_bg, @@ -655,8 +731,8 @@ prm->disable_popups, prm->pause_on_mouseover, prm->disable_leftclick, - prm->mouse_wheel_scroll, - prm->sfpicker_closes_when_pointer_leaves, + prm->mouse_wheel_action, + prm->sfeedpicker_autoclose, prm->enable_feed_ordering, prm->use_authentication, prm->user, @@ -664,13 +740,14 @@ prm->proxy_host, prm->proxy_port, prm->use_proxy_authentication, - prm->proxy_user + prm->proxy_user, + prm->connect_timeout, + prm->send_recv_timeout ); fclose(conf_fp); } else - warning(FALSE, 4, "Can't save configuration file ", - get_datafile_full_name_from_name(CONFIG_FILE), ": ", - strerror(errno)); + warning(BLOCK, "Can't save configuration file '%s': %s", + get_datafile_full_name_from_name(CONFIG_FILE), strerror(errno)); } /* @@ -705,7 +782,7 @@ errflag = 1; } if (errflag != 0) { - fprintf(STD_ERR, "Invalid color: %s\n", str); + INFO_ERR("Invalid color: %s\n", str) return FALSE; } else return TRUE; @@ -723,7 +800,7 @@ count++; count &= 63; snprintf(str[count], 10, "#%02x%02x%02x%02x", color->red / 256, color->green / 256, - color->blue / 256, *color_alpha / 256); + color->blue / 256, *color_alpha / 256); if (strlen(str[count]) != 9) return NULL; else @@ -731,12 +808,42 @@ } /* + * Adjust size in font_name_and_size str by computing font size from required height + * (str must be able to store FONT_MAXLEN chars.) Does nothing if height <= 0. + */ +void adjust_font_size_to_rq_height(char *font_name_and_size, int height) +{ + char f_name[FONT_NAME_MAXLEN + 1]; + char f_size[FONT_SIZE_MAXLEN + 1]; + + if (height > 0) { + split_font(font_name_and_size, f_name, f_size); + snprintf(f_size, FONT_SIZE_MAXLEN + 1, "%3d", get_font_size_from_layout_height(height, f_name)); + /* Font size can't be > FONT_MAXSIZE */ + if (atoi(f_size) > FONT_MAXSIZE) + snprintf(f_size, FONT_SIZE_MAXLEN + 1, "%3d", FONT_MAXSIZE); + compact_font(font_name_and_size, f_name, f_size); + } else if (height == 0) + DEBUG_INFO("Required height = 0\n") + else + INFO_ERR("%s() error: Required height < 0\n", __func__) +} + +int get_font_size_from_font_name_size(const char *font_name_size) +{ + char font_name[FONT_NAME_MAXLEN + 1], font_size[FONT_SIZE_MAXLEN + 1]; + + split_font(font_name_size, font_name, font_size); + return atoi(font_size); +} + +/* * Space needed for font_name: FONT_NAME_MAXLEN + 1 bytes / font_size: FONT_SIZE_MAXLEN + 1 bytes */ void split_font(const char *font_name_size, char *font_name, char *font_size) { - char tmp[FONT_MAXLEN + 1]; - int i; + char tmp[FONT_MAXLEN + 1]; + int i; if (font_name_size[0] == '\0') { font_name[0] = '\0'; diff -Nru tickr-0.6.4/src/tickr/tickr_prefwin.c tickr-0.7.0/src/tickr/tickr_prefwin.c --- tickr-0.6.4/src/tickr/tickr_prefwin.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_prefwin.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -18,18 +18,16 @@ #include "tickr.h" -#define BLANK_STR_1 " " -#define BLANK_STR_2 " " -#define LABEL1(str) str ":" BLANK_STR_1 -#define LABEL2(str1, str2) str1 " (" str2 "):" BLANK_STR_1 +#define BLANK_STR_2_SP " " +#define BLANK_STR_8_SP " " -/* These variables and widgets are all set as static global for convenience. */ +/* These variables and widgets are all set as static global for convenience */ static TickerEnv *env; -static gchar current_url[FILE_NAME_MAXLEN + 1]; +static char current_url[FILE_NAME_MAXLEN + 1]; -static GtkWidget *dialog, *sc_win, *entry_homefeed; -static GtkWidget *table, *label[128], *hbox1, *hbox2, *hbox3; /* This should be enough but check anyways */ +static GtkWidget *dialog, *sc_win, *entry_homefeed, *table; static GtkWidget *cancel_but, *reset_but, *apply_but, *ok_but; +static GtkWidget *fullsettings_but, *connsettings_but; static GtkWidget *top_but, *bottom_but, *fullwidth_but, *curfeed_but; static GtkWidget *spinbut_delay, *spinbut_shiftsize; static GtkWidget *spinbut_winx, *spinbut_winy, *spinbut_winw, *spinbut_winh; @@ -39,19 +37,20 @@ static GtkWidget *spinbut_shadowoffsetx, *spinbut_shadowoffsety; static GtkWidget *spinbut_shadowfx, *spinbut_rssrefresh; static GtkWidget *spinbut_wintransparency, *spinbut_nitemsperfeed; -static GtkWidget *checkbut_shadow, *checkbut_alwaysontop, *checkbut_windec; -static GtkWidget *checkbut_spchars; +static GtkWidget *checkbut_shadow, *checkbut_alwaysontop, *checkbut_overrideredirect; +static GtkWidget *checkbut_windec, *checkbut_spchars, *checkbut_revsc; static GtkWidget *checkbut_feedtitle, *checkbut_itemtitle, *checkbut_itemdes; -/*static GtkWidget *checkbut_; ALPHA */ -static GtkWidget *checkbut_striptags, *checkbut_uppercase, *checkbut_nopopups; -static GtkWidget *checkbut_mouseover, *checkbut_noleftclick; +static GtkWidget *checkbut_striptags, *checkbut_uppercase; +static GtkWidget *checkbut_clocksec, *checkbut_clock12h, *checkbut_clockdate; +static GtkWidget *checkbut_nopopups, *checkbut_mouseover, *checkbut_noleftclick; static GtkWidget *checkbut_sfpickercloseswhenpointerleaves, *checkbut_feedordering; static GtkWidget *font_but, *clock_font_but; -static GtkWidget *fg_color_but, *bg_color_but, *bg_color2_but; +static GtkWidget *fg_color_but, /* *highlight_fg_color_but,*/ *bg_color_but, *bg_color2_but; static GtkWidget *clock_fg_color_but, *clock_bg_color_but, *clock_bg_color2_but; -static GtkWidget *rbut_box1, *radio_but1_1, *radio_but1_2, *radio_but1_3; -static GtkWidget *rbut_box2, *radio_but2_1, *radio_but2_2, *radio_but2_3; -static GtkWidget *entry_linedel, *entry_cutlinedel, *entry_newpagech, *entry_tabch; +/*static GtkWidget *rbut_box_mi, *radio_but_mi_1, *radio_but_mi_2, *radio_but_mi_3;*/ +static GtkWidget *rbut_box_clock, *radio_but_clock_1, *radio_but_clock_2, *radio_but_clock_3; +static GtkWidget *rbut_box_mw, *radio_but_mw_1, *radio_but_mw_2, *radio_but_mw_3; +static GtkWidget *entry_linedel, *entry_newpagech, *entry_tabch; static GtkWidget *entry_feedtitledel, *entry_itemtitledel, *entry_itemdesdel; static GtkWidget *entry_openlinkcmd, *entry_openlinkargs; static GtkObject *adj_delay, *adj_shiftsize, *adj_winx, *adj_winy; @@ -59,35 +58,41 @@ static GtkObject *adj_shadowoffsety, *adj_rssrefresh; static GtkObject *adj_wintransparency, *adj_nitemsperfeed; -static gint update_win_y_w_adj(GtkWidget *widget) { - int disable_screen_limits; +/* Need this prototype */ +static void set_ui_changes_to_params(Params *, zboolean); + +static int update_win_x_y_w_adj(GtkWidget *widget) { + zboolean disable_screen_limits; widget = widget; - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_disablescreenlimits))) + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_disablescreenlimits))) disable_screen_limits = TRUE; else disable_screen_limits = FALSE; + gtk_adjustment_set_upper(GTK_ADJUSTMENT(adj_winx), disable_screen_limits ? WIN_MAX_X : env->screen_w); gtk_adjustment_set_upper(GTK_ADJUSTMENT(adj_winy), disable_screen_limits ? WIN_MAX_Y : env->screen_h); gtk_adjustment_set_upper(GTK_ADJUSTMENT(adj_winw), disable_screen_limits ? WIN_MAX_W : env->screen_w); + gtk_adjustment_changed(GTK_ADJUSTMENT(adj_winx)); gtk_adjustment_changed(GTK_ADJUSTMENT(adj_winy)); gtk_adjustment_changed(GTK_ADJUSTMENT(adj_winw)); + gtk_spin_button_update(GTK_SPIN_BUTTON(spinbut_winx)); gtk_spin_button_update(GTK_SPIN_BUTTON(spinbut_winy)); gtk_spin_button_update(GTK_SPIN_BUTTON(spinbut_winw)); return TRUE; } -static gint move_to_top(GtkWidget *widget) +static int move_to_top(GtkWidget *widget) { widget = widget; gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbut_winy), 0); return TRUE; } -static gint move_to_bottom(GtkWidget *widget) +static int move_to_bottom(GtkWidget *widget) { - char font_n_s[FONT_MAXLEN + 1]; - char fname[FONT_NAME_MAXLEN + 1], fsize[FONT_SIZE_MAXLEN + 1]; - gint requested_font_size, requested_h, y_bottom; + char font_name_size[FONT_MAXLEN + 1]; + char font_name[FONT_NAME_MAXLEN + 1], font_size[FONT_SIZE_MAXLEN + 1]; + int requested_font_size, requested_h, y_bottom; /* We backup this param first because... */ char disable_popups_bak = get_params()->disable_popups; @@ -96,32 +101,32 @@ widget = widget; /* We need to know requested ticker height */ - requested_h = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winh)); + requested_h = gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winh)); if (requested_h > 0 && requested_h < DRWA_HEIGHT_MIN) requested_h = DRWA_HEIGHT_MIN; else if (requested_h == 0) { /* Compute ticker height from requested font size */ - str_n_cpy(font_n_s, (char *)gtk_font_button_get_font_name(GTK_FONT_BUTTON(font_but)), FONT_MAXLEN); - split_font(font_n_s, fname, fsize); + str_n_cpy(font_name_size, (char *)gtk_font_button_get_font_name(GTK_FONT_BUTTON(font_but)), FONT_MAXLEN); + split_font(font_name_size, font_name, font_size); /* In all cases, font size can't be > FONT_MAXSIZE */ - requested_font_size = MIN(atoi(fsize), FONT_MAXSIZE); - snprintf(fsize, FONT_SIZE_MAXLEN + 1, "%3d", requested_font_size); - compact_font(font_n_s, fname, fsize); - requested_h = get_layout_height_from_fnamesize(font_n_s); + requested_font_size = MIN(atoi(font_size), FONT_MAXSIZE); + snprintf(font_size, FONT_SIZE_MAXLEN + 1, "%3d", requested_font_size); + compact_font(font_name_size, font_name, font_size); + requested_h = get_layout_height_from_font_name_size(font_name_size); } y_bottom = env->screen_h - requested_h; #ifndef G_OS_WIN32 /* How to get taskbar height on Linux ? */ - warning(FALSE, 3, "Taskbar height: Will use ", itoa2(ARBITRARY_TASKBAR_HEIGHT), - " pixels arbitrary value - Please adjust as necessary afterwards"); + warning(BLOCK, "Taskbar height: Will use %d pixels arbitrary value - " + "Please adjust as necessary afterwards", ARBITRARY_TASKBAR_HEIGHT); y_bottom -= ARBITRARY_TASKBAR_HEIGHT; #else if (get_win32_taskbar_height() != -1) y_bottom -= get_win32_taskbar_height(); else { - warning(FALSE, 3, "Couldn't compute Taskbar height: Will use ", itoa2(ARBITRARY_TASKBAR_HEIGHT), - " pixels arbitrary value - Please adjust as necessary afterwards"); + warning(BLOCK, "Couldn't compute Taskbar height: Will use %d pixels arbitrary value - " + "Please adjust as necessary afterwards", ARBITRARY_TASKBAR_HEIGHT); y_bottom -= ARBITRARY_TASKBAR_HEIGHT; } #endif @@ -131,7 +136,7 @@ return TRUE; } -static gint set_full_width(GtkWidget *widget) +static int set_full_width(GtkWidget *widget) { widget = widget; gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbut_winw), env->screen_w); @@ -140,22 +145,173 @@ return TRUE; } -static gint get_current_url(GtkWidget *widget) +static int get_current_url(GtkWidget *widget) { widget = widget; gtk_entry_set_text(GTK_ENTRY(entry_homefeed), current_url); return TRUE; } +GtkLabel *bg_color2_label; + +static int check_set_gradient_widgets(GtkWidget *widget) +{ + widget = widget; + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_setgradientbg))) { + gtk_widget_set_sensitive(GTK_WIDGET(bg_color2_label), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(bg_color2_but), TRUE); + } else { + gtk_widget_set_sensitive(GTK_WIDGET(bg_color2_label), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(bg_color2_but), FALSE); + } + return TRUE; +} + +GtkLabel *newpagech_label, *tabch_label; + +static int check_set_sp_chars_widgets(GtkWidget *widget) +{ + widget = widget; + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_spchars))) { + gtk_widget_set_sensitive(GTK_WIDGET(newpagech_label), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(entry_newpagech), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(tabch_label), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(entry_tabch), TRUE); + } else { + gtk_widget_set_sensitive(GTK_WIDGET(newpagech_label), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(entry_newpagech), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(tabch_label), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(entry_tabch), FALSE); + } + return TRUE; +} + +GtkLabel *clock_sec_label, *clock_12h_label, *clock_date_label, *clock_font_label, *clock_fg_color_label, + *clock_bg_color_label, *setclockgradientbg_label, *clock_bg_color2_label; + +static int check_set_clock_widgets(GtkWidget *widget) +{ + widget = widget; + if (!(zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_but_clock_3))) { /* ! (clock = none) */ + gtk_widget_set_sensitive(GTK_WIDGET(clock_sec_label), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(checkbut_clocksec), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_12h_label), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(checkbut_clock12h), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_date_label), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(checkbut_clockdate), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_font_label), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_font_but), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_fg_color_label), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_fg_color_but), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_bg_color_label), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_bg_color_but), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(setclockgradientbg_label), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(checkbut_setclockgradientbg), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_bg_color2_label), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_bg_color2_but), TRUE); + } else { + gtk_widget_set_sensitive(GTK_WIDGET(clock_sec_label), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(checkbut_clocksec), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_12h_label), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(checkbut_clock12h), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_date_label), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(checkbut_clockdate), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_font_label), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_font_but), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_fg_color_label), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_fg_color_but), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_bg_color_label), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_bg_color_but), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(setclockgradientbg_label), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(checkbut_setclockgradientbg), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_bg_color2_label), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(clock_bg_color2_but), FALSE); + } + return TRUE; +} + +/* For alignment of GTK widgets */ +#define LEFT 0 +#define RIGHT 1 +#define EXPAND 2 + +static GtkLabel *table_attach_styled_double_cell(GtkWidget *table2, char *text1, char *text2, char *tooltip, + GtkWidget *w1, GtkWidget *w2, GtkWidget *w3, int column1, int column2, int row, int alignment1, int alignment2) +{ + GtkWidget *hbox, *label; + char *label_text, *tooltip_text; + + /* Label in column 1 */ + label_text = l_str_new(text1); + if (text2 != NULL) { + label_text = l_str_cat(label_text, " ("); + label_text = l_str_cat(label_text, text2); + label_text = l_str_cat(label_text, "):" BLANK_STR_2_SP); + } else + label_text = l_str_cat(label_text, ":" BLANK_STR_2_SP); + label = gtk_label_new(label_text); + gtk_label_set_use_markup(GTK_LABEL(label), TRUE); + gtk_misc_set_alignment(GTK_MISC(label), alignment1, 0.5); + gtk_table_attach_defaults(GTK_TABLE(table2), label, column1, column1 + 1, row, row + 1); + l_str_free(label_text); + + /* Widgets in column 2 */ + hbox = gtk_hbox_new(FALSE, 0); + if (alignment2 == RIGHT) + gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(NULL), TRUE, TRUE, 0); + if (w1 != NULL) + gtk_box_pack_start(GTK_BOX(hbox), w1, alignment2 == EXPAND ? TRUE : FALSE, + alignment2 == EXPAND ? TRUE : FALSE, 0); + if (w2 != NULL) + gtk_box_pack_start(GTK_BOX(hbox), w2, alignment2 == EXPAND ? TRUE : FALSE, + alignment2 == EXPAND ? TRUE : FALSE, 0); + if (w3 != NULL) + gtk_box_pack_start(GTK_BOX(hbox), w3, alignment2 == EXPAND ? TRUE : FALSE, + alignment2 == EXPAND ? TRUE : FALSE, 0); + if (alignment2 == LEFT) + gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(NULL), TRUE, TRUE, 0); + gtk_table_attach_defaults(GTK_TABLE(table2), hbox, column2, column2 + 1, row, row + 1); + + /* Tooltip */ + tooltip_text = l_str_new(tooltip); + gtk_widget_set_tooltip_text(label, tooltip_text); + gtk_widget_set_tooltip_text(hbox, tooltip_text); + l_str_free(tooltip_text); + return GTK_LABEL(label); +} + /* - * Open a dialog to edit all params. - * Return 0 or 1 if we want to immediately reopen the dialog. + * CHECK THIS: + * - If font size is changed, tickr height is set to 0 + * - If tickr height is changed, font size is adjusted + * -> ???? + * if (gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winh)) > 0) */ -int modify_params(Params *prm) + +/* Window layout (kind of) */ +#ifdef COLUMN_1_ALIGN +# undef COLUMN_1_ALIGN +#endif +#ifdef COLUMN_2_ALIGN +# undef COLUMN_2_ALIGN +#endif +#ifdef ROW_SPACING +# undef ROW_SPACING +#endif +#define COLUMN_1_ALIGN RIGHT +#define COLUMN_2_ALIGN LEFT +#define ROW_SPACING 5 + +/* + * Open a dialog to edit a few useful params. (This is actually a stripped + * down, slightly modified version of modify_params()). + * Return next action requested (if any). + */ +next_action easily_modify_params(Params *prm) { - char c[2]= "c"; - gint response; - int changes_have_been_applied, exit_status = 0, i; + int response; + zboolean changes_have_been_made; + int do_next = DO_NEXT_NOTHING, i; Params *prm_bak; env = get_ticker_env(); @@ -170,6 +326,301 @@ set_tickr_icon_to_dialog(GTK_WINDOW(dialog)); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); + gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); + + g_signal_connect(G_OBJECT(dialog), "key-press-event", G_CALLBACK(esc_key_pressed), NULL); + g_signal_connect(G_OBJECT(dialog), "delete_event", G_CALLBACK(force_quit_dialog), NULL); + + fullsettings_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Full\nSettings", GTK_RESPONSE_FULL_SETTINGS); + connsettings_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Connection\nSettings", GTK_RESPONSE_CONN_SETTINGS); + cancel_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL_CLOSE); + reset_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Reset", GTK_RESPONSE_RESET); + /* We only have 'OK', which apply ***and*** save settings. */ + ok_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_OK, GTK_RESPONSE_OK); + apply_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_APPLY, GTK_RESPONSE_APPLY); + + gtk_widget_set_tooltip_text(fullsettings_but, "Full settings minus connection settings"); + gtk_widget_set_tooltip_text(ok_but, "Apply, save and quit"); + gtk_widget_set_tooltip_text(apply_but, "Don't save and don't quit"); + + table = gtk_table_new(12, 3, FALSE); + gtk_table_set_row_spacings(GTK_TABLE(table), ROW_SPACING); + gtk_table_set_col_spacings(GTK_TABLE(table), 0); + gtk_container_set_border_width(GTK_CONTAINER(table), 15); + gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table); + gtk_table_attach_defaults(GTK_TABLE(table), gtk_label_new(BLANK_STR_8_SP), 1, 2, 0, 1); + + i = 0; +#ifdef COLUMN_1 +# undef COLUMN_1 +#endif +#ifdef COLUMN_2 +# undef COLUMN_2 +#endif +#define COLUMN_1 0 +#define COLUMN_2 2 + /* + * Delay + */ + adj_delay = gtk_adjustment_new(prm->delay, 1, 50, 1, 5, 0); + spinbut_delay = gtk_spin_button_new(GTK_ADJUSTMENT(adj_delay), 0.0, 0); + table_attach_styled_double_cell(table, "Delay", "Milliseconds", + APP_NAME " speed = K1 / scrolling delay\n- Decrease delay to speed up scrolling\n" + "- Increase delay to slow down scrolling", + spinbut_delay, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * Font + */ + font_but = gtk_font_button_new_with_font(prm->font_name_size); + table_attach_styled_double_cell(table, "Font", NULL, + "WARNING: Font size will be overridden by " APP_NAME " height, if height > 0", + font_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * fg color + */ + fg_color_but = gtk_color_button_new_with_color(&prm->fg_color); + gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(fg_color_but), TRUE); + gtk_color_button_set_alpha(GTK_COLOR_BUTTON(fg_color_but), prm->fg_color_alpha); + table_attach_styled_double_cell(table, "Foreground Color", NULL, NULL, + fg_color_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * bg color + */ + bg_color_but = gtk_color_button_new_with_color(&prm->bg_color); + gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(bg_color_but), TRUE); + gtk_color_button_set_alpha(GTK_COLOR_BUTTON(bg_color_but), prm->bg_color_alpha); + table_attach_styled_double_cell(table, "Background Color", NULL, NULL, + bg_color_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * Set gradient bg + */ + checkbut_setgradientbg = gtk_check_button_new(); + if (prm->set_gradient_bg == 'y') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_setgradientbg), TRUE); + else if (prm->set_gradient_bg == 'n') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_setgradientbg), FALSE); + table_attach_styled_double_cell(table, "Use a gradient background", NULL, NULL, + checkbut_setgradientbg, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * bg color2 + */ + bg_color2_but = gtk_color_button_new_with_color(&prm->bg_color2); + gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(bg_color2_but), TRUE); + gtk_color_button_set_alpha(GTK_COLOR_BUTTON(bg_color2_but), prm->bg_color2_alpha); + bg_color2_label = table_attach_styled_double_cell(table, "Background Color2", NULL, NULL, + bg_color2_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * win_y + */ + adj_winy = gtk_adjustment_new(prm->win_y, 0, + (prm->disable_screen_limits == 'y' ? WIN_MAX_Y : env->screen_h), 1, 5, 0); + spinbut_winy = gtk_spin_button_new(GTK_ADJUSTMENT(adj_winy), 0.0, 0); + top_but = gtk_button_new_with_label("Top"); + bottom_but = gtk_button_new_with_label("Bottom"); + table_attach_styled_double_cell(table, "Vertical Location", "Pixels", NULL, + top_but, bottom_but, spinbut_winy, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * win_h + */ + adj_winh = gtk_adjustment_new(prm->win_h, 0, env->screen_h, 1, 5, 0); + spinbut_winh = gtk_spin_button_new(GTK_ADJUSTMENT(adj_winh), 0.0, 0); + table_attach_styled_double_cell(table, APP_NAME " Height", "Pixels", + "WARNING: If > 0, will override font size", + spinbut_winh, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * Window always-on-top + */ + checkbut_alwaysontop = gtk_check_button_new(); + if (prm->always_on_top == 'y') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_alwaysontop), TRUE); + else if (prm->always_on_top == 'n') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_alwaysontop), FALSE); + table_attach_styled_double_cell(table, APP_NAME " always above other windows", NULL, NULL, + checkbut_alwaysontop, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * Reverse scrolling + */ + checkbut_revsc = gtk_check_button_new(); + if (prm->reverse_sc == 'y') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_revsc), TRUE); + else if (prm->reverse_sc == 'n') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_revsc), FALSE); + + table_attach_styled_double_cell(table, "Reverse scrolling", NULL, + "For languages written/read from R to L", + checkbut_revsc, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * Read n items max per feed + */ + adj_nitemsperfeed = gtk_adjustment_new(prm->n_items_per_feed, 0, 500, 1, 5, 0); + spinbut_nitemsperfeed = gtk_spin_button_new(GTK_ADJUSTMENT(adj_nitemsperfeed), 0.0, 0); + table_attach_styled_double_cell(table, "Read N items max per feed", NULL, "0 = no limit", + spinbut_nitemsperfeed, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * Mouse wheel scrolling behaviour + */ + radio_but_mw_1 = gtk_radio_button_new_with_label(NULL, "Speed"); + radio_but_mw_2 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but_mw_1), "Feed"); + radio_but_mw_3 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but_mw_1), "None"); + rbut_box_mw = gtk_hbox_new(TRUE, 2); + gtk_box_pack_start(GTK_BOX(rbut_box_mw), radio_but_mw_1, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(rbut_box_mw), radio_but_mw_2, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(rbut_box_mw), radio_but_mw_3, TRUE, TRUE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mw_1), TRUE); + if (prm->mouse_wheel_action == 's') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mw_1), TRUE); + else if (prm->mouse_wheel_action == 'f') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mw_2), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mw_3), TRUE); + table_attach_styled_double_cell(table, "Mouse Wheel acts on", NULL, + "Use Mouse Wheel for alternative action", + rbut_box_mw, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + + /* Connect buttons / widgets to callbacks */ + g_signal_connect(G_OBJECT(checkbut_setgradientbg), "clicked", G_CALLBACK(check_set_gradient_widgets), NULL); + g_signal_connect(G_OBJECT(top_but), "clicked", G_CALLBACK(move_to_top), NULL); + g_signal_connect(G_OBJECT(bottom_but), "clicked", G_CALLBACK(move_to_bottom), NULL); + + /* This must be run once at least. */ + check_set_gradient_widgets(NULL); + + /* This will let us know if changes have been made. */ + prm_bak = malloc2(sizeof(Params)); + memcpy((void *)prm_bak, (const void *)prm, sizeof(Params)); + changes_have_been_made = FALSE; + + gtk_widget_grab_focus(cancel_but); + gtk_widget_show_all(dialog); + gtk_window_set_focus(GTK_WINDOW(dialog), NULL); + + while (1) { + response = gtk_dialog_run(GTK_DIALOG(dialog)); + env->suspend_rq = TRUE; + if (response == GTK_RESPONSE_RESET) { + if (question_win("Reset *all* settings to default values ?\n" + "(Your current settings will be lost)", NO) == YES) { + /* OK like that ? */ + set_default_options(prm); + current_feed(); + env->reload_rq = TRUE; + do_next = DO_NEXT_REOPEN; + break; + } else + continue; + } else if (response == GTK_RESPONSE_FULL_SETTINGS || response == GTK_RESPONSE_APPLY || + response == GTK_RESPONSE_OK) { + set_ui_changes_to_params(prm, FALSE); + } + if (response == GTK_RESPONSE_FULL_SETTINGS) { + /* FIXME: What's best to do about ui changes here ???? */ + do_next = DO_NEXT_OPEN_FULL_SETTINGS; + break; + } else if (response == GTK_RESPONSE_CONN_SETTINGS) { + /* FIXME: What's best to do about ui changes here ???? */ + if (question_win("Save changes you (eventually) made before leaving ?", -1) == YES) + set_ui_changes_to_params(prm, FALSE); + /*if (question_win("Unsaved changes will be lost. Continue ?", NO) == NO) + continue; // Means stay in the loop - Don't get confused here ;) */ + do_next = DO_NEXT_OPEN_CONN_SETTINGS; + break; + } else if (response == GTK_RESPONSE_APPLY) { /* Force apply */ + /* + * We want a new pixmap so that changes will be effective... now! + * + * Some setting changes (like 'read n items per feed') need the stream + * to be reloaded + */ + current_feed(); + changes_have_been_made = TRUE; + env->suspend_rq = FALSE; + } else if (response == GTK_RESPONSE_OK) { + if (prm->item_title == 'n' && prm->item_description == 'n') { + warning(BLOCK, "%s\n%s", "You can't uncheck both 'Item title' and 'Item description'", + "(because no much useful information would be displayed)"); + continue; + } + /* Apply and save when necessary */ + if (memcmp((const void *)prm, (const void *)prm_bak, sizeof(Params)) != 0 || \ + changes_have_been_made) { + /* + * Some setting changes (like 'read n items per feed') need the stream + * to be reloaded + */ + current_feed(); + save_to_config_file(prm); + } + break; + } else { + /* Restore and apply when necessary */ + if (memcmp((const void *)prm, (const void *)prm_bak, sizeof(Params)) != 0 || \ + changes_have_been_made) { + memcpy((void *)prm, (const void *)prm_bak, sizeof(Params)); + /* + * Some setting changes (like 'read n items per feed') need the stream + * to be reloaded + */ + current_feed(); + } + break; + } + } + free2(prm_bak); + gtk_widget_destroy(dialog); + check_main_win_always_on_top(); + env->suspend_rq = FALSE; + return do_next; +} + +/* Window layout (kind of) */ +#ifdef COLUMN_1_ALIGN +# undef COLUMN_1_ALIGN +#endif +#ifdef COLUMN_2_ALIGN +# undef COLUMN_2_ALIGN +#endif +#ifdef ROW_SPACING +# undef ROW_SPACING +#endif +#define COLUMN_1_ALIGN LEFT +#define COLUMN_2_ALIGN EXPAND/*RIGHT*/ +#define ROW_SPACING 5 + +/* + * Open a dialog to edit all params. + * Return next action requested (if any). + */ +next_action modify_params(Params *prm) +{ + char c[2]= "c"; + int response; + zboolean changes_have_been_made; + int do_next = DO_NEXT_NOTHING, i; + Params *prm_bak; + + env = get_ticker_env(); + str_n_cpy(current_url, get_resource()->id, FILE_NAME_MAXLEN); + + gtk_window_set_keep_above(GTK_WINDOW(env->win), FALSE); + + dialog = gtk_dialog_new_with_buttons( + "Full Settings", GTK_WINDOW(env->win), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + NULL); + + set_tickr_icon_to_dialog(GTK_WINDOW(dialog)); + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); g_signal_connect(G_OBJECT(dialog), "key-press-event", G_CALLBACK(esc_key_pressed), NULL); g_signal_connect(G_OBJECT(dialog), "delete_event", G_CALLBACK(force_quit_dialog), NULL); @@ -179,14 +630,18 @@ GTK_POLICY_AUTOMATIC); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), sc_win); + connsettings_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Connection Settings", GTK_RESPONSE_CONN_SETTINGS); cancel_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL_CLOSE); - reset_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Reset", GTK_RESPONSE_NO); /* Strange... */ + reset_but = gtk_dialog_add_button(GTK_DIALOG(dialog), "Reset", GTK_RESPONSE_RESET); /* We only have 'OK', which apply ***and*** save settings. */ ok_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_OK, GTK_RESPONSE_OK); apply_but = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_APPLY, GTK_RESPONSE_APPLY); + gtk_widget_set_tooltip_text(ok_but, "Apply, save and quit"); + gtk_widget_set_tooltip_text(apply_but, "Don't save and don't quit"); + table = gtk_table_new(17, 5, FALSE); - gtk_table_set_row_spacings(GTK_TABLE(table), 5); + gtk_table_set_row_spacings(GTK_TABLE(table), ROW_SPACING); gtk_table_set_col_spacings(GTK_TABLE(table), 0); gtk_container_set_border_width(GTK_CONTAINER(table), 15); gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sc_win), table); @@ -194,976 +649,731 @@ gtk_widget_set_size_request(sc_win, 1000, 450); i = 0; -#define COLUMN1 0, 1 -#define COLUMN2 1, 2 -#define COLUMN3 2, 3 +#ifdef COLUMN_1 +# undef COLUMN_1 +#endif +#ifdef COLUMN_2 +# undef COLUMN_2 +#endif +#define COLUMN_1 0 +#define COLUMN_2 1 /* * Delay */ - label[i] = gtk_label_new(LABEL2("Delay", "Milliseconds")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); adj_delay = gtk_adjustment_new(prm->delay, 1, 50, 1, 5, 0); spinbut_delay = gtk_spin_button_new(GTK_ADJUSTMENT(adj_delay), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_delay, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Delay", "Milliseconds", + APP_NAME " speed = K1 / scrolling delay\n- Decrease delay to speed up scrolling\n" + "- Increase delay to slow down scrolling", + spinbut_delay, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Shift size */ - label[i] = gtk_label_new(LABEL2("Shift size", "Pixels")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); adj_shiftsize = gtk_adjustment_new(prm->shift_size, 1, 200, 1, 5, 0); spinbut_shiftsize = gtk_spin_button_new(GTK_ADJUSTMENT(adj_shiftsize), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_shiftsize, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Shift size", "Pixels", + APP_NAME " speed = K2 x shift size\nYou can increase shift size and delay simultaneously " + "to reduce CPU load although scrolling will get less smooth", + spinbut_shiftsize, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Font */ - label[i] = gtk_label_new(LABEL2("Font", "Size can't be > 200")); /* Check this is up to date */ - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); - font_but = gtk_font_button_new_with_font(prm->font_n_s); - gtk_table_attach_defaults(GTK_TABLE(table), font_but, COLUMN2, i, i + 1); + font_but = gtk_font_button_new_with_font(prm->font_name_size); + table_attach_styled_double_cell(table, "Font", "Size can't be > 200", /* Check this is up to date */ + "WARNING: Font size will be overridden by " APP_NAME " height, if height > 0", + font_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * fg color */ - label[i] = gtk_label_new(LABEL1("Foreground color")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); fg_color_but = gtk_color_button_new_with_color(&prm->fg_color); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(fg_color_but), TRUE); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(fg_color_but), prm->fg_color_alpha); - gtk_table_attach_defaults(GTK_TABLE(table), fg_color_but, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Foreground Color", NULL, NULL, + fg_color_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* + * Marked items fg color + */ + /*highlight_fg_color_but = gtk_color_button_new_with_color(&prm->highlight_fg_color); + gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(highlight_fg_color_but), TRUE); + gtk_color_button_set_alpha(GTK_COLOR_BUTTON(highlight_fg_color_but), prm->highlight_fg_color_alpha); + table_attach_styled_double_cell(table, "Marked items foreground color", NULL, NULL, + highlight_fg_color_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++;*/ + /* * bg color */ - label[i] = gtk_label_new(LABEL1("Background color")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); bg_color_but = gtk_color_button_new_with_color(&prm->bg_color); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(bg_color_but), TRUE); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(bg_color_but), prm->bg_color_alpha); - gtk_table_attach_defaults(GTK_TABLE(table), bg_color_but, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Background Color", NULL, NULL, + bg_color_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Set gradient bg */ - label[i] = gtk_label_new(LABEL1("Set gradient background")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_setgradientbg = gtk_check_button_new(); if (prm->set_gradient_bg == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_setgradientbg), TRUE); else if (prm->set_gradient_bg == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_setgradientbg), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_setgradientbg, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Use a gradient background", NULL, NULL, + checkbut_setgradientbg, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * bg color2 */ - label[i] = gtk_label_new(LABEL1("Background color2")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); bg_color2_but = gtk_color_button_new_with_color(&prm->bg_color2); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(bg_color2_but), TRUE); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(bg_color2_but), prm->bg_color2_alpha); - gtk_table_attach_defaults(GTK_TABLE(table), bg_color2_but, COLUMN2, i, i + 1); + bg_color2_label = table_attach_styled_double_cell(table, "Background Color2", NULL, NULL, + bg_color2_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Disable screen limits */ - label[i] = gtk_label_new(LABEL2("Disable screen limits", "Y position / Width")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_disablescreenlimits = gtk_check_button_new(); if (prm->disable_screen_limits == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_disablescreenlimits), TRUE); else if (prm->disable_screen_limits == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_disablescreenlimits), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_disablescreenlimits, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Disable screen limits", NULL, + "Apply to " APP_NAME " X, Y positions and width", + checkbut_disablescreenlimits, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * win_x */ - label[i] = gtk_label_new(LABEL2("X position", "Pixels")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); - adj_winx = gtk_adjustment_new(prm->win_x, 0, env->screen_w - 20, 1, 5, 0); + adj_winx = gtk_adjustment_new(prm->win_x, 0, + (prm->disable_screen_limits == 'y' ? WIN_MAX_X : env->screen_w - 20), 1, 5, 0); /* Magic value '20' found here */ spinbut_winx = gtk_spin_button_new(GTK_ADJUSTMENT(adj_winx), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_winx, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "X position", "Pixels", NULL, + spinbut_winx, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * win_y */ - hbox1 = gtk_hbox_new(FALSE, 0); - label[i] = gtk_label_new(LABEL2("Y position", "Pixels")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_box_pack_start(GTK_BOX(hbox1), label[i], FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(hbox1), gtk_label_new(NULL), TRUE, FALSE, 0); - top_but = gtk_button_new_with_label("Top"); - gtk_box_pack_start(GTK_BOX(hbox1), top_but, FALSE, FALSE, 0); - bottom_but = gtk_button_new_with_label("Bottom"); - gtk_box_pack_start(GTK_BOX(hbox1), bottom_but, FALSE, FALSE, 0); - gtk_table_attach_defaults(GTK_TABLE(table), hbox1, COLUMN1, i, i + 1); adj_winy = gtk_adjustment_new(prm->win_y, 0, (prm->disable_screen_limits == 'y' ? WIN_MAX_Y : env->screen_h), 1, 5, 0); spinbut_winy = gtk_spin_button_new(GTK_ADJUSTMENT(adj_winy), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_winy, COLUMN2, i, i + 1); + top_but = gtk_button_new_with_label("Top"); + bottom_but = gtk_button_new_with_label("Bottom"); + table_attach_styled_double_cell(table, "Y position", "Pixels", NULL, + top_but, bottom_but, spinbut_winy, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * win_w */ - hbox2 = gtk_hbox_new(FALSE, 0); - label[i] = gtk_label_new(LABEL2("Width", "Pixels")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_box_pack_start(GTK_BOX(hbox2), label[i], FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(hbox2), gtk_label_new(NULL), TRUE, FALSE, 0); - fullwidth_but = gtk_button_new_with_label("Full width"); - gtk_box_pack_start(GTK_BOX(hbox2), fullwidth_but, FALSE, FALSE, 0); - gtk_table_attach_defaults(GTK_TABLE(table), hbox2, COLUMN1, i, i + 1); adj_winw = gtk_adjustment_new(prm->win_w, DRWA_WIDTH_MIN, (prm->disable_screen_limits == 'y' ? WIN_MAX_W : env->screen_w), 1, 5, 0); spinbut_winw = gtk_spin_button_new(GTK_ADJUSTMENT(adj_winw), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_winw, COLUMN2, i, i + 1); + fullwidth_but = gtk_button_new_with_label("Full width"); + table_attach_styled_double_cell(table, "Width", "Pixels", NULL, + fullwidth_but, spinbut_winw, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * win_h */ - label[i] = gtk_label_new(LABEL2("Height", "Pixels - Override font size if > 0")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); adj_winh = gtk_adjustment_new(prm->win_h, 0, env->screen_h, 1, 5, 0); spinbut_winh = gtk_spin_button_new(GTK_ADJUSTMENT(adj_winh), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_winh, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, APP_NAME " Height", "Pixels", + "WARNING: If > 0, will override font size", + spinbut_winh, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * windec */ - label[i] = gtk_label_new(LABEL1("Window decoration")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_windec = gtk_check_button_new(); if (prm->windec == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_windec), TRUE); else if (prm->windec == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_windec), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_windec, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Window decoration", NULL, NULL, + checkbut_windec, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Window always-on-top */ - label[i] = gtk_label_new(LABEL1("Window Always-On-Top")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_alwaysontop = gtk_check_button_new(); if (prm->always_on_top == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_alwaysontop), TRUE); else if (prm->always_on_top == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_alwaysontop), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_alwaysontop, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Window Always-On-Top", NULL, NULL, + checkbut_alwaysontop, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Window transparency */ - label[i] = gtk_label_new(LABEL2("Window opacity", "x 10")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); /* transparency set from gui ranges from 1 (0.1) to 10 (1.0) / 0.0 (invisible!) is kind of "useless" */ adj_wintransparency = gtk_adjustment_new(prm->win_transparency * 10, 1, 10, 1, 2, 0); spinbut_wintransparency = gtk_spin_button_new(GTK_ADJUSTMENT(adj_wintransparency), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_wintransparency, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Window opacity", "x 10", NULL, + spinbut_wintransparency, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Icon in taskbar */ - label[i] = gtk_label_new(LABEL1("Icon in Taskbar")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_iconintaskbar = gtk_check_button_new(); if (prm->icon_in_taskbar == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_iconintaskbar), TRUE); else if (prm->icon_in_taskbar == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_iconintaskbar), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_iconintaskbar, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Icon in Taskbar", NULL, NULL, + checkbut_iconintaskbar, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Window sticky */ - label[i] = gtk_label_new(LABEL1("Visible on all User Desktops")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_winsticky = gtk_check_button_new(); if (prm->win_sticky == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_winsticky), TRUE); else if (prm->win_sticky == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_winsticky), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_winsticky, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Visible on all User Desktops", NULL, NULL, + checkbut_winsticky, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * Set window override_redirect flag + */ + checkbut_overrideredirect = gtk_check_button_new(); + if (prm->override_redirect == 'y') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_overrideredirect), TRUE); + else if (prm->override_redirect == 'n') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_overrideredirect), FALSE); + table_attach_styled_double_cell(table, "Set override_redirect flag", "Warning:\n***EXPERIMENTAL***", + APP_NAME " will bypass window manager, which may lead to unexpected behaviour - " + "You've been warned ;)", + checkbut_overrideredirect, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Shadow */ - label[i] = gtk_label_new(LABEL1("Shadow")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_shadow = gtk_check_button_new(); if (prm->shadow == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_shadow), TRUE); else if (prm->shadow == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_shadow), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_shadow, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Shadow", NULL, NULL, + checkbut_shadow, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * shadow_offset_x */ - label[i] = gtk_label_new(LABEL2("Shadow x offset", "Pixels")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); adj_shadowoffsetx = gtk_adjustment_new(prm->shadow_offset_x, -20, 20, 1, 5, 0); spinbut_shadowoffsetx = gtk_spin_button_new(GTK_ADJUSTMENT(adj_shadowoffsetx), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_shadowoffsetx, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Shadow x offset", "Pixels", NULL, + spinbut_shadowoffsetx, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * shadow_offset_y */ - label[i] = gtk_label_new(LABEL2("Shadow y offset", "Pixels")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); adj_shadowoffsety = gtk_adjustment_new(prm->shadow_offset_y, -20, 20, 1, 5, 0); spinbut_shadowoffsety = gtk_spin_button_new(GTK_ADJUSTMENT(adj_shadowoffsety), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_shadowoffsety, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Shadow y offset", "Pixels", NULL, + spinbut_shadowoffsety, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * shadow_fx */ - label[i] = gtk_label_new(LABEL2("Shadow fx", "0 = none -> 10 = full")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); adj_shadowfx = gtk_adjustment_new(prm->shadow_fx, 0, 10, 1, 5, 0); spinbut_shadowfx = gtk_spin_button_new(GTK_ADJUSTMENT(adj_shadowfx), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_shadowfx, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Shadow fx", "0 = none -> 10 = full", NULL, + spinbut_shadowfx, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Line delimiter */ - label[i] = gtk_label_new(LABEL1("Line delimiter")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); entry_linedel = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY(entry_linedel), DELIMITER_MAXLEN); gtk_entry_set_text(GTK_ENTRY(entry_linedel), prm->line_delimiter); - gtk_table_attach_defaults(GTK_TABLE(table), entry_linedel, COLUMN2, i, i + 1); - i++; - /* - * Cut line delimiter - */ - label[i] = gtk_label_new(LABEL1("Cut line delimiter")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); - entry_cutlinedel = gtk_entry_new(); - gtk_entry_set_max_length(GTK_ENTRY(entry_cutlinedel), DELIMITER_MAXLEN); - gtk_entry_set_text(GTK_ENTRY(entry_cutlinedel), prm->cutline_delimiter); - gtk_table_attach_defaults(GTK_TABLE(table), entry_cutlinedel, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Line delimiter", NULL, + "String that will replace every newline occurence", + entry_linedel, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Enable special chars */ - label[i] = gtk_label_new(LABEL2("Special characters enabled", "Text files only")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_spchars = gtk_check_button_new(); if (prm->special_chars == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_spchars), TRUE); else if (prm->special_chars == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_spchars), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_spchars, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Special characters enabled", NULL, + "Apply only to text files", + checkbut_spchars, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * 'new page' special char */ - label[i] = gtk_label_new(LABEL1("'New page' special character")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); entry_newpagech = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY(entry_newpagech), 1); /* This does nothing - gtk_entry_set_width_chars(GTK_ENTRY(entry_newpagech), 1);*/ c[0] = prm->new_page_char; gtk_entry_set_text(GTK_ENTRY(entry_newpagech), c); - gtk_table_attach_defaults(GTK_TABLE(table), entry_newpagech, COLUMN2, i, i + 1); + newpagech_label = table_attach_styled_double_cell(table, "'New page' special character", NULL, NULL, + entry_newpagech, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * 'tab' special char */ - label[i] = gtk_label_new(LABEL1("'Tab' (8 spaces) special character")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); entry_tabch = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY(entry_tabch), 1); /* This does nothing - gtk_entry_set_width_chars(GTK_ENTRY(entry_tabch), 1);*/ c[0] = prm->tab_char; gtk_entry_set_text(GTK_ENTRY(entry_tabch), c); - gtk_table_attach_defaults(GTK_TABLE(table), entry_tabch, COLUMN2, i, i + 1); + tabch_label = table_attach_styled_double_cell(table, "'Tab' (8 spaces) special character", NULL, NULL, + entry_tabch, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; - -/* Commenting this block would change from 2 columns to 1 single column window */ - label[i] = gtk_label_new(BLANK_STR_2); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN3, 0, 1); - + /* + * Reload delay (rss refresh) - Now up to 1440 mn = 24 h + */ + adj_rssrefresh = gtk_adjustment_new(prm->rss_refresh, 0, 1440, 1, 5, 0); + spinbut_rssrefresh = gtk_spin_button_new(GTK_ADJUSTMENT(adj_rssrefresh), 0.0, 0); + table_attach_styled_double_cell(table, "Reload delay", "Minutes", + "Delay before reloading resource (URL or text file.)\n" + "0 = never force reload - Otherwise, apply only if no TTL inside " + "feed or if resource is text file.\n" + "(Actually, in multiple selections mode, all feeds are always reloaded " + "sequentially, because there is no caching involved)", + spinbut_rssrefresh, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * Reverse scrolling + */ + checkbut_revsc = gtk_check_button_new(); + if (prm->reverse_sc == 'y') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_revsc), TRUE); + else if (prm->reverse_sc == 'n') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_revsc), FALSE); + table_attach_styled_double_cell(table, "Reverse scrolling", NULL, + "For languages written/read from R to L", + checkbut_revsc, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + +/* Commenting out this block would change from 2 columns to 1 single column window */ + gtk_table_attach_defaults(GTK_TABLE(table), + gtk_label_new(BLANK_STR_8_SP BLANK_STR_8_SP BLANK_STR_8_SP), 2, 3, 0, 1); i = 0; -#undef COLUMN1 -#define COLUMN1 3, 4 -#undef COLUMN2 -#define COLUMN2 4, 5 -/* (commenting until here) */ - /* - * Reload delay (rss refresh) - */ - label[i] = gtk_label_new(LABEL2("Reload delay", "Minutes - If no TTL or if text file")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); - adj_rssrefresh = gtk_adjustment_new(prm->rss_refresh, 1, 60, 1, 5, 0); - spinbut_rssrefresh= gtk_spin_button_new(GTK_ADJUSTMENT(adj_rssrefresh), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_rssrefresh, COLUMN2, i, i + 1); - i++; - /* - * ALPHA - Read all then show all - */ - /*label[i] = gtk_label_new(LABEL1("(ALPHA) Read all then show all")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); - checkbut_ = gtk_check_button_new(); - if (prm-> == 'y') - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_), TRUE); - else if (prm-> == 'n') - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_, COLUMN2, i, i + 1); - i++;*/ +#ifdef COLUMN_1 +# undef COLUMN_1 +#endif +#ifdef COLUMN_2 +# undef COLUMN_2 +#endif +#define COLUMN_1 3 +#define COLUMN_2 4 +/* (commenting out until here) */ + /* * Feed title */ - label[i] = gtk_label_new(LABEL1("Feed title")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_feedtitle = gtk_check_button_new(); if (prm->feed_title == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_feedtitle), TRUE); else if (prm->feed_title == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_feedtitle), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_feedtitle, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Show feed title", NULL, NULL, + checkbut_feedtitle, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Feed title delimiter */ - label[i] = gtk_label_new(LABEL1("Feed title delimiter")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); entry_feedtitledel = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY(entry_feedtitledel), DELIMITER_MAXLEN); gtk_entry_set_text(GTK_ENTRY(entry_feedtitledel), prm->feed_title_delimiter); - gtk_table_attach_defaults(GTK_TABLE(table), entry_feedtitledel, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Feed title delimiter", NULL, NULL, + entry_feedtitledel, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Item title */ - label[i] = gtk_label_new(LABEL1("Item title")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_itemtitle = gtk_check_button_new(); if (prm->item_title == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_itemtitle), TRUE); else if (prm->item_title == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_itemtitle), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_itemtitle, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Show item title", NULL, NULL, + checkbut_itemtitle, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Item title delimiter */ - label[i] = gtk_label_new(LABEL1("Item title delimiter")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); entry_itemtitledel = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY(entry_itemtitledel), DELIMITER_MAXLEN); gtk_entry_set_text(GTK_ENTRY(entry_itemtitledel), prm->item_title_delimiter); - gtk_table_attach_defaults(GTK_TABLE(table), entry_itemtitledel, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Item title delimiter", NULL, NULL, + entry_itemtitledel, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Item description */ - label[i] = gtk_label_new(LABEL1("Item description")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_itemdes = gtk_check_button_new(); if (prm->item_description == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_itemdes), TRUE); else if (prm->item_description == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_itemdes), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_itemdes, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Show item description", NULL, NULL, + checkbut_itemdes, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Item description delimiter */ - label[i] = gtk_label_new(LABEL1("Item description delimiter")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); entry_itemdesdel = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY(entry_itemdesdel), DELIMITER_MAXLEN); gtk_entry_set_text(GTK_ENTRY(entry_itemdesdel), prm->item_description_delimiter); - gtk_table_attach_defaults(GTK_TABLE(table), entry_itemdesdel, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Item description delimiter", NULL, NULL, + entry_itemdesdel, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Read n items max per feed */ - label[i] = gtk_label_new(LABEL2("Read N items max per feed", "0 = no limit")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); adj_nitemsperfeed = gtk_adjustment_new(prm->n_items_per_feed, 0, 500, 1, 5, 0); spinbut_nitemsperfeed = gtk_spin_button_new(GTK_ADJUSTMENT(adj_nitemsperfeed), 0.0, 0); - gtk_table_attach_defaults(GTK_TABLE(table), spinbut_nitemsperfeed, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Read N items max per feed", NULL, "0 = no limit", + spinbut_nitemsperfeed, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* + * Mark item action + */ + /*radio_but_mi_1 = gtk_radio_button_new_with_label(NULL, "Hide"); + radio_but_mi_2 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but_mi_1), "Color"); + radio_but_mi_3 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but_mi_1), "None"); + rbut_box_mi = gtk_hbox_new(TRUE, 2); + gtk_box_pack_start(GTK_BOX(rbut_box_mi), radio_but_mi_1, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(rbut_box_mi), radio_but_mi_2, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(rbut_box_mi), radio_but_mi_3, TRUE, TRUE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mi_1), TRUE); + if (prm->mark_item_action == 'h') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mi_1), TRUE); + else if (prm->mark_item_action == 'c') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mi_2), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mi_3), TRUE); + table_attach_styled_double_cell(table, "Mark item action", NULL, NULL, + rbut_box_mi, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++;*/ + /* * Remove html tags */ - label[i] = gtk_label_new(LABEL1("Strip html tags")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_striptags = gtk_check_button_new(); if (prm->strip_html_tags == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_striptags), TRUE); else if (prm->strip_html_tags == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_striptags), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_striptags, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Strip HTML tags", NULL, NULL, + checkbut_striptags, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Upper case text */ - label[i] = gtk_label_new(LABEL1("Set all text to upper case")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_uppercase = gtk_check_button_new(); if (prm->upper_case_text == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_uppercase), TRUE); else if (prm->upper_case_text == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_uppercase), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_uppercase, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Set all text to upper case", NULL, NULL, + checkbut_uppercase, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Homefeed / set current feed as homefeed */ - hbox3 = gtk_hbox_new(FALSE, 0); - label[i] = gtk_label_new(LABEL2("Default feed", "'Homefeed'")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_box_pack_start(GTK_BOX(hbox3), label[i], FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(hbox3), gtk_label_new(NULL), TRUE, FALSE, 0); - curfeed_but = gtk_button_new_with_label("Current feed"); - gtk_box_pack_start(GTK_BOX(hbox3), curfeed_but, FALSE, FALSE, 0); - gtk_table_attach_defaults(GTK_TABLE(table), hbox3, COLUMN1, i, i + 1); + curfeed_but = gtk_button_new_with_label("Current"); entry_homefeed = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY(entry_homefeed), FILE_NAME_MAXLEN); gtk_entry_set_text(GTK_ENTRY(entry_homefeed), prm->homefeed); - gtk_table_attach_defaults(GTK_TABLE(table), entry_homefeed, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Default feed", "'Homefeed'", NULL, + curfeed_but, entry_homefeed, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* - * "Open in browser" command line + * "Open in Browser" Shell command */ - label[i] = gtk_label_new(LABEL1("'Open in Browser' command line")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); entry_openlinkcmd = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY(entry_openlinkcmd), FILE_NAME_MAXLEN); gtk_entry_set_text(GTK_ENTRY(entry_openlinkcmd), prm->open_link_cmd); - gtk_table_attach_defaults(GTK_TABLE(table), entry_openlinkcmd, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "'Open in Browser' Shell command", NULL, + "Browser to open links with", + entry_openlinkcmd, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* - * "Open in browser" args + * "Open in Browser" args */ - label[i] = gtk_label_new(LABEL1("'Open in Browser' optional arguments")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); entry_openlinkargs = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY(entry_openlinkargs), FILE_NAME_MAXLEN); gtk_entry_set_text(GTK_ENTRY(entry_openlinkargs), prm->open_link_args); - gtk_table_attach_defaults(GTK_TABLE(table), entry_openlinkargs, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Optional arguments", NULL, + "'Open in Browser' optional arguments", + entry_openlinkargs, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Clock */ - label[i] = gtk_label_new(LABEL1("Clock")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); - radio_but1_1 = gtk_radio_button_new_with_label(NULL, "Left"); - radio_but1_2 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but1_1), "Right"); - radio_but1_3 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but1_1), "None"); - rbut_box1 = gtk_hbox_new(TRUE, 2); - gtk_box_pack_start(GTK_BOX(rbut_box1), radio_but1_1, TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(rbut_box1), radio_but1_2, TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(rbut_box1), radio_but1_3, TRUE, TRUE, 0); + radio_but_clock_1 = gtk_radio_button_new_with_label(NULL, "Left"); + radio_but_clock_2 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but_clock_1), "Right"); + radio_but_clock_3 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but_clock_1), "None"); + rbut_box_clock = gtk_hbox_new(TRUE, 2); + gtk_box_pack_start(GTK_BOX(rbut_box_clock), radio_but_clock_1, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(rbut_box_clock), radio_but_clock_2, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(rbut_box_clock), radio_but_clock_3, TRUE, TRUE, 0); if (prm->clock == 'l') - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but1_1), TRUE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_clock_1), TRUE); else if (prm->clock == 'r') - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but1_2), TRUE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_clock_2), TRUE); else - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but1_3), TRUE); - gtk_table_attach_defaults(GTK_TABLE(table), rbut_box1, COLUMN2, i, i + 1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_clock_3), TRUE); + table_attach_styled_double_cell(table, "Clock", NULL, NULL, + rbut_box_clock, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * Clock - show seconds + */ + checkbut_clocksec = gtk_check_button_new(); + if (prm->clock_sec == 'y') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_clocksec), TRUE); + else if (prm->clock_sec == 'n') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_clocksec), FALSE); + clock_sec_label = table_attach_styled_double_cell(table, "Show seconds", NULL, NULL, + checkbut_clocksec, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * Clock - 12h time format + */ + checkbut_clock12h = gtk_check_button_new(); + if (prm->clock_12h == 'y') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_clock12h), TRUE); + else if (prm->clock_12h == 'n') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_clock12h), FALSE); + clock_12h_label = table_attach_styled_double_cell(table, "12h time format", NULL, NULL, + checkbut_clock12h, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); + i++; + /* + * Clock - show date + */ + checkbut_clockdate = gtk_check_button_new(); + if (prm->clock_date == 'y') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_clockdate), TRUE); + else if (prm->clock_date == 'n') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_clockdate), FALSE); + clock_date_label = table_attach_styled_double_cell(table, "Show date", NULL, NULL, + checkbut_clockdate, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Clock font */ - label[i] = gtk_label_new(LABEL2("Clock font", "Size can't be > ticker height")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); - clock_font_but = gtk_font_button_new_with_font(prm->clock_font_n_s); - gtk_table_attach_defaults(GTK_TABLE(table), clock_font_but, COLUMN2, i, i + 1); + clock_font_but = gtk_font_button_new_with_font(prm->clock_font_name_size); + clock_font_label = table_attach_styled_double_cell(table, "Clock font", NULL, + "Clock font size can't be > " APP_NAME " height", + clock_font_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Clock fg color */ - label[i] = gtk_label_new(LABEL1("Clock foreground color")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); clock_fg_color_but = gtk_color_button_new_with_color(&prm->clock_fg_color); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(clock_fg_color_but), TRUE); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(clock_fg_color_but), prm->clock_fg_color_alpha); - gtk_table_attach_defaults(GTK_TABLE(table), clock_fg_color_but, COLUMN2, i, i + 1); + clock_fg_color_label = table_attach_styled_double_cell(table, "Clock foreground color", NULL, NULL, + clock_fg_color_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Clock bg color */ - label[i] = gtk_label_new(LABEL1("Clock background color")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); clock_bg_color_but = gtk_color_button_new_with_color(&prm->clock_bg_color); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(clock_bg_color_but), TRUE); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(clock_bg_color_but), prm->clock_bg_color_alpha); - gtk_table_attach_defaults(GTK_TABLE(table), clock_bg_color_but, COLUMN2, i, i + 1); + clock_bg_color_label = table_attach_styled_double_cell(table, "Clock background color", NULL, NULL, + clock_bg_color_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Set clock gradient bg */ - label[i] = gtk_label_new(LABEL1("Set clock gradient background")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_setclockgradientbg = gtk_check_button_new(); if (prm->set_clock_gradient_bg == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_setclockgradientbg), TRUE); else if (prm->set_clock_gradient_bg == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_setclockgradientbg), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_setclockgradientbg, COLUMN2, i, i + 1); + setclockgradientbg_label = table_attach_styled_double_cell(table, "Set clock gradient background", NULL, NULL, + checkbut_setclockgradientbg, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Clock bg color2 */ - label[i] = gtk_label_new(LABEL1("Clock background color2")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); clock_bg_color2_but = gtk_color_button_new_with_color(&prm->clock_bg_color2); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(clock_bg_color2_but), TRUE); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(clock_bg_color2_but), prm->clock_bg_color2_alpha); - gtk_table_attach_defaults(GTK_TABLE(table), clock_bg_color2_but, COLUMN2, i, i + 1); + clock_bg_color2_label = table_attach_styled_double_cell(table, "Clock background color2", NULL, NULL, + clock_bg_color2_but, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Disable popups */ - label[i] = gtk_label_new(LABEL1("Disable error/warning popup windows")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_nopopups = gtk_check_button_new(); if (prm->disable_popups == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_nopopups), TRUE); else if (prm->disable_popups == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_nopopups), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_nopopups, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Disable error/warning popups", NULL, + "Prevent error/warning windows to popup", + checkbut_nopopups, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Pause on mouse-over */ - label[i] = gtk_label_new(LABEL1("Pause ticker on mouse-over")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_mouseover = gtk_check_button_new(); if (prm->pause_on_mouseover == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_mouseover), TRUE); else if (prm->pause_on_mouseover == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_mouseover), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_mouseover, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Pause ticker on mouse-over", NULL, NULL, + checkbut_mouseover, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Disable left-ckick */ - label[i] = gtk_label_new(LABEL1("Disable left-click")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_noleftclick = gtk_check_button_new(); if (prm->disable_leftclick == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_noleftclick), TRUE); else if (prm->disable_leftclick == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_noleftclick), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_noleftclick, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Disable left-click", NULL, NULL, + checkbut_noleftclick, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Mouse wheel scrolling behaviour */ - label[i] = gtk_label_new(LABEL2("Mouse wheel acts on", "+ Ctrl = other value")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); - radio_but2_1 = gtk_radio_button_new_with_label(NULL, "Speed"); - radio_but2_2 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but2_1), "Feed"); - radio_but2_3 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but2_1), "None"); - rbut_box2 = gtk_hbox_new(TRUE, 2); - gtk_box_pack_start(GTK_BOX(rbut_box2), radio_but2_1, TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(rbut_box2), radio_but2_2, TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(rbut_box2), radio_but2_3, TRUE, TRUE, 0); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but2_1), TRUE); - if (prm->mouse_wheel_scroll == 's') - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but2_1), TRUE); - else if (prm->mouse_wheel_scroll == 'f') - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but2_2), TRUE); + radio_but_mw_1 = gtk_radio_button_new_with_label(NULL, "Speed"); + radio_but_mw_2 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but_mw_1), "Feed"); + radio_but_mw_3 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_but_mw_1), "None"); + rbut_box_mw = gtk_hbox_new(TRUE, 2); + gtk_box_pack_start(GTK_BOX(rbut_box_mw), radio_but_mw_1, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(rbut_box_mw), radio_but_mw_2, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(rbut_box_mw), radio_but_mw_3, TRUE, TRUE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mw_1), TRUE); + if (prm->mouse_wheel_action == 's') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mw_1), TRUE); + else if (prm->mouse_wheel_action == 'f') + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mw_2), TRUE); else - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but2_3), TRUE); - gtk_table_attach_defaults(GTK_TABLE(table), rbut_box2, COLUMN2, i, i + 1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_but_mw_3), TRUE); + table_attach_styled_double_cell(table, "Mouse Wheel acts on", NULL, + "Use Mouse Wheel for alternative action", + rbut_box_mw, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* - * Quick feed picker (selected feeds) closes when pointer leaves + * Selected feed picker window closes when pointer leaves area */ - label[i] = gtk_label_new(LABEL1("S Feed Picker closes when pointer leaves")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_sfpickercloseswhenpointerleaves = gtk_check_button_new(); - if (prm->sfpicker_closes_when_pointer_leaves == 'y') + if (prm->sfeedpicker_autoclose == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_sfpickercloseswhenpointerleaves), TRUE); - else if (prm->sfpicker_closes_when_pointer_leaves == 'n') + else if (prm->sfeedpicker_autoclose == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_sfpickercloseswhenpointerleaves), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_sfpickercloseswhenpointerleaves, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Selected Feed Picker auto-close", NULL, + "Selected Feed Picker window closes when pointer leaves area", + checkbut_sfpickercloseswhenpointerleaves, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); i++; /* * Enable feed re-ordering (by user) */ - label[i] = gtk_label_new(LABEL2("Enable feed re-ordering", "by User")); - gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); - gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label[i], COLUMN1, i, i + 1); checkbut_feedordering = gtk_check_button_new(); if (prm->enable_feed_ordering == 'y') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_feedordering), TRUE); else if (prm->enable_feed_ordering == 'n') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbut_feedordering), FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), checkbut_feedordering, COLUMN2, i, i + 1); + table_attach_styled_double_cell(table, "Enable feed re-ordering", NULL, + "Allow user to re-order feeds by assigning ranks to them", + checkbut_feedordering, NULL, NULL, COLUMN_1, COLUMN_2, i, COLUMN_1_ALIGN, COLUMN_2_ALIGN); /* Connect buttons / widgets to callbacks */ + g_signal_connect(G_OBJECT(checkbut_setgradientbg), "clicked", G_CALLBACK(check_set_gradient_widgets), NULL); + g_signal_connect(G_OBJECT(checkbut_disablescreenlimits), "clicked", G_CALLBACK(update_win_x_y_w_adj), NULL); + g_signal_connect(G_OBJECT(checkbut_spchars), "clicked", G_CALLBACK(check_set_sp_chars_widgets), NULL); + g_signal_connect(G_OBJECT(radio_but_clock_1), "clicked", G_CALLBACK(check_set_clock_widgets), NULL); + g_signal_connect(G_OBJECT(radio_but_clock_2), "clicked", G_CALLBACK(check_set_clock_widgets), NULL); + g_signal_connect(G_OBJECT(radio_but_clock_3), "clicked", G_CALLBACK(check_set_clock_widgets), NULL); g_signal_connect(G_OBJECT(top_but), "clicked", G_CALLBACK(move_to_top), NULL); g_signal_connect(G_OBJECT(bottom_but), "clicked", G_CALLBACK(move_to_bottom), NULL); g_signal_connect(G_OBJECT(fullwidth_but), "clicked", G_CALLBACK(set_full_width), NULL); g_signal_connect(G_OBJECT(curfeed_but), "clicked", G_CALLBACK(get_current_url), NULL); - g_signal_connect(G_OBJECT(checkbut_disablescreenlimits), "clicked", G_CALLBACK(update_win_y_w_adj), NULL); - /* This will let us know if changes have been made / applied / must be applied */ + /* This must be run once at least */ + check_set_gradient_widgets(NULL); + update_win_x_y_w_adj(NULL); + check_set_sp_chars_widgets(NULL); + check_set_clock_widgets(NULL); + + /* This will let us know if changes have been made */ prm_bak = malloc2(sizeof(Params)); memcpy((void *)prm_bak, (const void *)prm, sizeof(Params)); - changes_have_been_applied = FALSE; + changes_have_been_made = FALSE; + gtk_widget_grab_focus(cancel_but); gtk_widget_show_all(dialog); + gtk_window_set_focus(GTK_WINDOW(dialog), NULL); - while (TRUE) { + while (1) { response = gtk_dialog_run(GTK_DIALOG(dialog)); env->suspend_rq = TRUE; - if (response == GTK_RESPONSE_NO) { /* Reset */ - if (question_win("Reset all settings to default values ?\n" - "(Your current settings will be lost)") == YES) { + if (response == GTK_RESPONSE_RESET) { + if (question_win("Reset *all* settings to default values ?\n" + "(Your current settings will be lost)", NO) == YES) { /* OK like that ? */ set_default_options(prm); current_feed(); env->reload_rq = TRUE; - exit_status = 1; + do_next = DO_NEXT_REOPEN; break; } else continue; } else if (response == GTK_RESPONSE_APPLY || response == GTK_RESPONSE_OK) { - /* Delay */ - prm->delay = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_delay)); - - /* Shift size */ - prm->shift_size = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_shiftsize)); - - /* Colors - fg and bg */ - gtk_color_button_get_color(GTK_COLOR_BUTTON(fg_color_but), &prm->fg_color); - prm->fg_color_alpha = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(fg_color_but)); - gtk_color_button_get_color(GTK_COLOR_BUTTON(bg_color_but), &prm->bg_color); - prm->bg_color_alpha = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(bg_color_but)); - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_setgradientbg))) - prm->set_gradient_bg = 'y'; - else - prm->set_gradient_bg = 'n'; - gtk_color_button_get_color(GTK_COLOR_BUTTON(bg_color2_but), &prm->bg_color2); - prm->bg_color2_alpha = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(bg_color2_but)); - - /* Font */ - str_n_cpy(prm->font_n_s, (char *)gtk_font_button_get_font_name( - GTK_FONT_BUTTON(font_but)), FONT_MAXLEN); - - /* Disable screen limits */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_disablescreenlimits))) - prm->disable_screen_limits = 'y'; - else - prm->disable_screen_limits = 'n'; - - /* Window x, y, w, h */ - prm->win_x = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winx)); - prm->win_y = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winy)); - prm->win_w = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winw)); - - /* If win_h is != 0, it will override requested font size with computed one. */ - prm->win_h = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winh)); - if (prm->win_h > 0 && prm->win_h < DRWA_HEIGHT_MIN) - prm->win_h = DRWA_HEIGHT_MIN; - - /* Window decoration */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_windec))) - prm->windec = 'y'; - else - prm->windec = 'n'; - - /* Window always-on-top */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_alwaysontop))) - prm->always_on_top = 'y'; - else - prm->always_on_top = 'n'; - - /* Window transparency */ - prm->win_transparency = gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_wintransparency)) / 10; - - /* Icon in taskbar */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_iconintaskbar))) - prm->icon_in_taskbar = 'y'; - else - prm->icon_in_taskbar = 'n'; - - /* Window sticky */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_winsticky))) - prm->win_sticky = 'y'; - else - prm->win_sticky = 'n'; - - /* Shadow */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_shadow))) - prm->shadow = 'y'; - else - prm->shadow = 'n'; - prm->shadow_offset_x = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_shadowoffsetx)); - prm->shadow_offset_y = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_shadowoffsety)); - prm->shadow_fx = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_shadowfx)); - - /* Line and cut line delimiters */ - str_n_cpy(prm->line_delimiter, - (char *)gtk_entry_get_text(GTK_ENTRY(entry_linedel)), DELIMITER_MAXLEN); - str_n_cpy(prm->cutline_delimiter, - (char *)gtk_entry_get_text(GTK_ENTRY(entry_cutlinedel)), DELIMITER_MAXLEN); - - /* Enable special chars */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_spchars))) - prm->special_chars = 'y'; - else - prm->special_chars = 'n'; - prm->new_page_char = gtk_entry_get_text(GTK_ENTRY(entry_newpagech))[0]; - prm->tab_char = gtk_entry_get_text(GTK_ENTRY(entry_tabch))[0]; - - /* Reload delay (rss refresh) */ - prm->rss_refresh = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_rssrefresh)); - - /* Feed title */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_feedtitle))) - prm->feed_title = 'y'; - else - prm->feed_title = 'n'; - str_n_cpy(prm->feed_title_delimiter, - (char *)gtk_entry_get_text(GTK_ENTRY(entry_feedtitledel)), DELIMITER_MAXLEN); - - /* Item title */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_itemtitle))) - prm->item_title = 'y'; - else - prm->item_title = 'n'; - str_n_cpy(prm->item_title_delimiter, - (char *)gtk_entry_get_text(GTK_ENTRY(entry_itemtitledel)), DELIMITER_MAXLEN); - - /* Item decription */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_itemdes))) - prm->item_description = 'y'; - else - prm->item_description = 'n'; - str_n_cpy(prm->item_description_delimiter, - (char *)gtk_entry_get_text(GTK_ENTRY(entry_itemdesdel)), DELIMITER_MAXLEN); - - /* Read n items max per feed */ - prm->n_items_per_feed = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_nitemsperfeed)); - - /* Strip html tags */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_striptags))) - prm->strip_html_tags = 'y'; - else - prm->strip_html_tags = 'n'; - - /* Upper case text */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_uppercase))) - prm->upper_case_text = 'y'; - else - prm->upper_case_text = 'n'; - - /* Homefeed */ - str_n_cpy(prm->homefeed, - (char *)gtk_entry_get_text(GTK_ENTRY(entry_homefeed)), FILE_NAME_MAXLEN); - - /* Open link cmd */ - str_n_cpy(prm->open_link_cmd, - (char *)gtk_entry_get_text(GTK_ENTRY(entry_openlinkcmd)), FILE_NAME_MAXLEN); - - /* Open link args */ - str_n_cpy(prm->open_link_args, - (char *)gtk_entry_get_text(GTK_ENTRY(entry_openlinkargs)), FILE_NAME_MAXLEN); - - /* Clock */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_but1_1))) - prm->clock = 'l'; - else if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_but1_2))) - prm->clock = 'r'; - else - prm->clock = 'n'; - - str_n_cpy(prm->clock_font_n_s, (char *)gtk_font_button_get_font_name(GTK_FONT_BUTTON(clock_font_but)), FONT_MAXLEN); - - gtk_color_button_get_color(GTK_COLOR_BUTTON(clock_fg_color_but), &prm->clock_fg_color); - prm->clock_fg_color_alpha = gtk_color_button_get_alpha( GTK_COLOR_BUTTON(clock_fg_color_but)); - gtk_color_button_get_color(GTK_COLOR_BUTTON(clock_bg_color_but), &prm->clock_bg_color); - prm->clock_bg_color_alpha = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(clock_bg_color_but)); - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_setclockgradientbg))) - prm->set_clock_gradient_bg = 'y'; - else - prm->set_clock_gradient_bg = 'n'; - gtk_color_button_get_color(GTK_COLOR_BUTTON(clock_bg_color2_but), &prm->clock_bg_color2); - prm->clock_bg_color2_alpha = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(clock_bg_color2_but)); - - /* Disable popups */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_nopopups))) - prm->disable_popups = 'y'; - else - prm->disable_popups = 'n'; - - /* Pause on mouse-over */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_mouseover))) - prm->pause_on_mouseover = 'y'; - else - prm->pause_on_mouseover = 'n'; - - /* Disable left-click */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_noleftclick))) - prm->disable_leftclick = 'y'; - else - prm->disable_leftclick = 'n'; - - /* Mouse wheel scrolling behaviour */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_but2_1))) - prm->mouse_wheel_scroll = 's'; - else if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_but2_2))) - prm->mouse_wheel_scroll = 'f'; - else - prm->mouse_wheel_scroll = 'n'; - - /* Quick feed picker (selected feeds) closes when pointer leaves */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( - checkbut_sfpickercloseswhenpointerleaves))) - prm->sfpicker_closes_when_pointer_leaves = 'y'; - else - prm->sfpicker_closes_when_pointer_leaves = 'n'; - - /* Enable feed re-ordering (by user) */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_feedordering))) - prm->enable_feed_ordering = 'y'; - else - prm->enable_feed_ordering = 'n'; + set_ui_changes_to_params(prm, TRUE); } - /* We want a new pixmap so that changes will be effective... now! */ - if (response == GTK_RESPONSE_APPLY) { /* Force apply */ - /* Some setting changes (like 'read n items per feed') need the stream - * to be reloaded, so now we use: */ + if (response == GTK_RESPONSE_CONN_SETTINGS) { + /* FIXME: What's best to do about ui changes here ???? */ + if (question_win("Save changes you (eventually) made before leaving ?", -1) == YES) + set_ui_changes_to_params(prm, TRUE); + /*if (question_win("Unsaved changes will be lost. Continue ?", NO) == NO) + continue; // Means stay in the loop - Don't get confused here ;) */ + do_next = DO_NEXT_OPEN_CONN_SETTINGS; + break; + } else if (response == GTK_RESPONSE_APPLY) { /* Force apply */ + /* + * We want a new pixmap so that changes will be effective... now! + * + * Some setting changes (like 'read n items per feed') need the stream + * to be reloaded + */ current_feed(); - /* instead of: update_pixmap_from_opened_stream(); - OK like that ? */ - changes_have_been_applied = TRUE; + changes_have_been_made = TRUE; env->suspend_rq = FALSE; } else if (response == GTK_RESPONSE_OK) { - if (prm->item_title == 'n' && prm->item_description == 'n') - if (question_win("You have unchecked both 'Item title' and 'Item description'.\n" - "No much useful information will be displayed. Continue ?") == NO) - continue; + if (prm->item_title == 'n' && prm->item_description == 'n') { + warning(BLOCK, "%s\n%s", "You can't uncheck both 'Item title' and 'Item description'", + "(because no much useful information would be displayed)"); + continue; + } /* Apply and save when necessary */ if (memcmp((const void *)prm, (const void *)prm_bak, sizeof(Params)) != 0 || \ - changes_have_been_applied) { - /* Some setting changes (like 'read n items per feed') need the stream - * to be reloaded, so now we use: */ + changes_have_been_made) { + /* + * Some setting changes (like 'read n items per feed') need the stream + * to be reloaded + */ current_feed(); - /* instead of: update_pixmap_from_opened_stream(); - OK like that ? */ save_to_config_file(prm); } break; } else { /* Restore and apply when necessary */ if (memcmp((const void *)prm, (const void *)prm_bak, sizeof(Params)) != 0 || \ - changes_have_been_applied) { + changes_have_been_made) { memcpy((void *)prm, (const void *)prm_bak, sizeof(Params)); - /* Some setting changes (like 'read n items per feed') need the stream - * to be reloaded, so now we use: */ + /* + * Some setting changes (like 'read n items per feed') need the stream + * to be reloaded + */ current_feed(); - /* instead of: update_pixmap_from_opened_stream(); - OK like that ? */ } break; } @@ -1172,5 +1382,266 @@ gtk_widget_destroy(dialog); check_main_win_always_on_top(); env->suspend_rq = FALSE; - return exit_status; + return do_next; +} + +static void set_ui_changes_to_params(Params *prm, zboolean full) +{ + /* Delay */ + prm->delay = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_delay)); + + if (full) { + /* Shift size */ + prm->shift_size = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_shiftsize)); + } + + /* Font */ + str_n_cpy(prm->font_name_size, (char *)gtk_font_button_get_font_name( + GTK_FONT_BUTTON(font_but)), FONT_MAXLEN); + + /* Colors - fg and bg */ + gtk_color_button_get_color(GTK_COLOR_BUTTON(fg_color_but), &prm->fg_color); + prm->fg_color_alpha = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(fg_color_but)); + /*gtk_color_button_get_color(GTK_COLOR_BUTTON(highlight_fg_color_but), &prm->highlight_fg_color); + prm->highlight_fg_color_alpha = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(highlight_fg_color_but));*/ + gtk_color_button_get_color(GTK_COLOR_BUTTON(bg_color_but), &prm->bg_color); + prm->bg_color_alpha = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(bg_color_but)); + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_setgradientbg))) + prm->set_gradient_bg = 'y'; + else + prm->set_gradient_bg = 'n'; + gtk_color_button_get_color(GTK_COLOR_BUTTON(bg_color2_but), &prm->bg_color2); + prm->bg_color2_alpha = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(bg_color2_but)); + + if (full) { + /* Disable screen limits */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_disablescreenlimits))) + prm->disable_screen_limits = 'y'; + else + prm->disable_screen_limits = 'n'; + } + + if (full) { + /* Window x, w */ + prm->win_x = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winx)); + prm->win_w = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winw)); + } + + /* Window y */ + prm->win_y = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winy)); + + /* If win_h is > 0, it will override requested font size with computed one. */ + prm->win_h = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winh)); + if (prm->win_h > 0 && prm->win_h < DRWA_HEIGHT_MIN) + prm->win_h = DRWA_HEIGHT_MIN; + + if (full) { + /* Window decoration */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_windec))) + prm->windec = 'y'; + else + prm->windec = 'n'; + } + + /* Window always-on-top */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_alwaysontop))) + prm->always_on_top = 'y'; + else + prm->always_on_top = 'n'; + + if (full) { + /* Window transparency */ + prm->win_transparency = gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_wintransparency)) / 10; + + /* Icon in taskbar */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_iconintaskbar))) + prm->icon_in_taskbar = 'y'; + else + prm->icon_in_taskbar = 'n'; + + /* Window sticky */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_winsticky))) + prm->win_sticky = 'y'; + else + prm->win_sticky = 'n'; + + /* Set window override_redirect flag */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_overrideredirect))) + prm->override_redirect = 'y'; + else + prm->override_redirect = 'n'; + + /* Shadow */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_shadow))) + prm->shadow = 'y'; + else + prm->shadow = 'n'; + prm->shadow_offset_x = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_shadowoffsetx)); + prm->shadow_offset_y = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_shadowoffsety)); + prm->shadow_fx = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_shadowfx)); + + /* Line delimiter */ + str_n_cpy(prm->line_delimiter, + (char *)gtk_entry_get_text(GTK_ENTRY(entry_linedel)), DELIMITER_MAXLEN); + + /* Enable special chars */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_spchars))) + prm->special_chars = 'y'; + else + prm->special_chars = 'n'; + prm->new_page_char = gtk_entry_get_text(GTK_ENTRY(entry_newpagech))[0]; + prm->tab_char = gtk_entry_get_text(GTK_ENTRY(entry_tabch))[0]; + + /* Reload delay (rss refresh) */ + prm->rss_refresh = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_rssrefresh)); + } + + /* Reverse scrolling */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_revsc))) + prm->reverse_sc = 'y'; + else + prm->reverse_sc = 'n'; + + if (full) { + /* Feed title */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_feedtitle))) + prm->feed_title = 'y'; + else + prm->feed_title = 'n'; + str_n_cpy(prm->feed_title_delimiter, + (char *)gtk_entry_get_text(GTK_ENTRY(entry_feedtitledel)), DELIMITER_MAXLEN); + + /* Item title */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_itemtitle))) + prm->item_title = 'y'; + else + prm->item_title = 'n'; + str_n_cpy(prm->item_title_delimiter, + (char *)gtk_entry_get_text(GTK_ENTRY(entry_itemtitledel)), DELIMITER_MAXLEN); + + /* Item decription */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_itemdes))) + prm->item_description = 'y'; + else + prm->item_description = 'n'; + str_n_cpy(prm->item_description_delimiter, + (char *)gtk_entry_get_text(GTK_ENTRY(entry_itemdesdel)), DELIMITER_MAXLEN); + } + + /* Read n items max per feed */ + prm->n_items_per_feed = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_nitemsperfeed)); + + if (full) { + /* Mark item action */ + /*if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_but_mi_1))) + prm->mark_item_action = 'h'; + else if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_but_mi_2))) + prm->mark_item_action = 'c'; + else + prm->mark_item_action = 'n';*/ + + /* Strip html tags */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_striptags))) + prm->strip_html_tags = 'y'; + else + prm->strip_html_tags = 'n'; + + /* Upper case text */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_uppercase))) + prm->upper_case_text = 'y'; + else + prm->upper_case_text = 'n'; + + /* Homefeed */ + str_n_cpy(prm->homefeed, + (char *)gtk_entry_get_text(GTK_ENTRY(entry_homefeed)), FILE_NAME_MAXLEN); + + /* Open link cmd */ + str_n_cpy(prm->open_link_cmd, + (char *)gtk_entry_get_text(GTK_ENTRY(entry_openlinkcmd)), FILE_NAME_MAXLEN); + + /* Open link args */ + str_n_cpy(prm->open_link_args, + (char *)gtk_entry_get_text(GTK_ENTRY(entry_openlinkargs)), FILE_NAME_MAXLEN); + + /* Clock */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_but_clock_1))) + prm->clock = 'l'; + else if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_but_clock_2))) + prm->clock = 'r'; + else + prm->clock = 'n'; + + /* Clock - show seconds */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_clocksec))) + prm->clock_sec = 'y'; + else + prm->clock_sec = 'n'; + + /* Clock - 12h time format */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_clock12h))) + prm->clock_12h = 'y'; + else + prm->clock_12h = 'n'; + + /* Clock - show date */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_clockdate))) + prm->clock_date = 'y'; + else + prm->clock_date = 'n'; + + str_n_cpy(prm->clock_font_name_size, (char *)gtk_font_button_get_font_name(GTK_FONT_BUTTON(clock_font_but)), FONT_MAXLEN); + + gtk_color_button_get_color(GTK_COLOR_BUTTON(clock_fg_color_but), &prm->clock_fg_color); + prm->clock_fg_color_alpha = gtk_color_button_get_alpha( GTK_COLOR_BUTTON(clock_fg_color_but)); + gtk_color_button_get_color(GTK_COLOR_BUTTON(clock_bg_color_but), &prm->clock_bg_color); + prm->clock_bg_color_alpha = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(clock_bg_color_but)); + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_setclockgradientbg))) + prm->set_clock_gradient_bg = 'y'; + else + prm->set_clock_gradient_bg = 'n'; + gtk_color_button_get_color(GTK_COLOR_BUTTON(clock_bg_color2_but), &prm->clock_bg_color2); + prm->clock_bg_color2_alpha = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(clock_bg_color2_but)); + + /* Disable popups */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_nopopups))) + prm->disable_popups = 'y'; + else + prm->disable_popups = 'n'; + + /* Pause on mouse-over */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_mouseover))) + prm->pause_on_mouseover = 'y'; + else + prm->pause_on_mouseover = 'n'; + + /* Disable left-click */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_noleftclick))) + prm->disable_leftclick = 'y'; + else + prm->disable_leftclick = 'n'; + } + + /* Mouse wheel scrolling behaviour */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_but_mw_1))) + prm->mouse_wheel_action = 's'; + else if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_but_mw_2))) + prm->mouse_wheel_action = 'f'; + else + prm->mouse_wheel_action = 'n'; + + if (full) { + /* Selected feed picker window closes when pointer leaves area */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( + checkbut_sfpickercloseswhenpointerleaves))) + prm->sfeedpicker_autoclose = 'y'; + else + prm->sfeedpicker_autoclose = 'n'; + + /* Enable feed re-ordering (by user) */ + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_feedordering))) + prm->enable_feed_ordering = 'y'; + else + prm->enable_feed_ordering = 'n'; + } } diff -Nru tickr-0.6.4/src/tickr/tickr_quickfeedpicker.c tickr-0.7.0/src/tickr/tickr_quickfeedpicker.c --- tickr-0.6.4/src/tickr/tickr_quickfeedpicker.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_quickfeedpicker.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -25,7 +25,7 @@ enum {COLUMN_INT, COLUMN_STRING_TITLE, COLUMN_STRING_URL, N_COLUMNS}; -static gint enter_key_pressed(GtkWidget *dialog2, GdkEventKey *event_key) +static int enter_key_pressed(GtkWidget *dialog2, GdkEventKey *event_key) { if (event_key->keyval == GDK_Return) { gtk_dialog_response(GTK_DIALOG(dialog2), GTK_RESPONSE_OK); @@ -34,16 +34,16 @@ return FALSE; } -static gint mouse_over_area(GtkWidget *widget, GdkEvent *event) +static int mouse_over_area(GtkWidget *widget, GdkEvent *event) { static int i = 0; widget = widget; - if (get_params()->sfpicker_closes_when_pointer_leaves == 'y' &&\ + if (get_params()->sfeedpicker_autoclose == 'y' &&\ event->type == GDK_LEAVE_NOTIFY && i == 0) { i = 1; return TRUE; - } else if (get_params()->sfpicker_closes_when_pointer_leaves == 'y' &&\ + } else if (get_params()->sfeedpicker_autoclose == 'y' &&\ event->type == GDK_LEAVE_NOTIFY && i == 1) { i = 0; force_quit_dialog(dialog); @@ -52,12 +52,12 @@ return FALSE; } -/* Tree selection callback - get url */ -static gint tree_selection_changed(GtkTreeSelection *selection) +/* Tree selection callback - get URL */ +static int tree_selection_changed(GtkTreeSelection *selection) { GtkTreeModel *tree_model; GtkTreeIter iter; - gchar *str_url; + char *str_url; if (gtk_tree_selection_get_selected(selection, &tree_model, &iter)) { gtk_tree_model_get(tree_model, &iter, @@ -72,11 +72,11 @@ } /* Catch double-click on tree view */ -static gint double_click_on_tree_view(GtkTreeView *tree_view, GtkTreePath *tree_path) +static int double_click_on_tree_view(GtkTreeView *tree_view, GtkTreePath *tree_path) { GtkTreeModel *tree_model; GtkTreeIter iter; - gchar *str_url; + char *str_url; tree_model = gtk_tree_view_get_model(tree_view); if (gtk_tree_model_get_iter(tree_model, &iter, tree_path)) { @@ -111,7 +111,7 @@ } } -/* Actually ***selected feed*** picker */ +/* Actually ***selected feed*** picker. */ void quick_feed_picker() { GtkTreeView *tree_view; @@ -119,7 +119,7 @@ GtkCellRenderer *renderer1, *renderer2; GtkTreeViewColumn *column1, *column2; GtkTreeSelection *selection; - gint response; + int response; dialog = gtk_dialog_new_with_buttons( "Selected Feed Picker", GTK_WINDOW(get_ticker_env()->win), @@ -127,12 +127,12 @@ NULL); set_tickr_icon_to_dialog(GTK_WINDOW(dialog)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE); + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE/*GTK_WIN_POS_CENTER*/); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); gtk_container_set_border_width(GTK_CONTAINER(dialog), 0); - gtk_widget_set_size_request(dialog, 600, 150); /* NEW - OK ? - previously 450, 200 */ + gtk_widget_set_size_request(dialog, 600, 150); /* Not sure about that: - if (get_params()->sfpicker_closes_when_pointer_leaves == 'y') + if (get_params()->sfeedpicker_autoclose == 'y') gtk_window_set_decorated(GTK_WINDOW(dialog), FALSE);*/ sc_win = gtk_scrolled_window_new(NULL, NULL); @@ -145,8 +145,8 @@ flist = f_list_first(get_feed_selection()); fill_list_store_from_flnode(list_store); } else { - warning(FALSE, 2, "No feed selection available\n", - "(You have set 'Mouse wheel scrolling applies to: Feed' and\n" + warning(BLOCK, "No feed selection available\n", + "(You have set 'Mouse Wheel acts on: Feed' and\n" "either there is no feed list or no feed has been selected)"); gtk_widget_destroy(dialog); return; @@ -174,9 +174,16 @@ g_signal_connect(G_OBJECT(tree_view), "leave-notify-event", G_CALLBACK(mouse_over_area), NULL); gtk_widget_show_all(dialog); - if (IS_FLIST(flist) && (get_resource()->id)[0] != '\0') - if ((f_index = f_list_search(flist, (get_resource()->id))) > -1) + if (IS_FLIST(flist) && (get_resource()->id)[0] != '\0') { + if ((f_index = f_list_search(flist, get_resource()->id)) > -1) highlight_and_go_to_row(tree_view, selection, f_index + 1); + /* + * Try original URL in case of HTTP redirects. + * TODO: Find best practice - Should new URL replace original URL ? + */ + else if ((f_index = f_list_search(flist, get_resource()->orig_url)) > -1) + highlight_and_go_to_row(tree_view, selection, f_index + 1); + } while ((response = gtk_dialog_run(GTK_DIALOG(dialog))) != GTK_RESPONSE_CANCEL_CLOSE) { if (response == GTK_RESPONSE_OK) { if ((f_index = f_list_search(flist, url)) > -1) { diff -Nru tickr-0.6.4/src/tickr/tickr_quicksetup.c tickr-0.7.0/src/tickr/tickr_quicksetup.c --- tickr-0.6.4/src/tickr/tickr_quicksetup.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_quicksetup.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ static Params *prm, *prm_bak; static GtkWidget *qsetup; static GtkWidget *top_but, *bottom_but, *spinbut_winy, *checkbut_alwaysontop; -static GtkWidget *checkbut_feedtitle, *checkbut_itemtitle, *checkbut_itemdes; -static GtkWidget *entry_openlinkcmd, *checkbut_nopopups; +/*static GtkWidget *checkbut_feedtitle, *checkbut_itemtitle, *checkbut_itemdes;*/ +static GtkWidget *entry_openlinkcmd/*, *checkbut_nopopups*/; static GtkObject* adj_winy; static void qsetup_prepare(GtkWidget *widget, GtkWidget *page, gpointer data) @@ -42,9 +42,9 @@ gtk_main_quit(); } -static gint qsetup_del_event() +static int qsetup_del_event() { - if (question_win("Cancel quick setup ?") == YES) { + if (question_win("Cancel quick setup ?", -1) == YES) { memcpy((void *)prm, (const void *)prm_bak, sizeof(Params)); gtk_main_quit(); return FALSE; @@ -58,48 +58,48 @@ switch((int)data) { case 1: /* Window y */ - prm->win_y = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winy)); + prm->win_y = (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(spinbut_winy)); break; case 2: /* Window always-on-top */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_alwaysontop))) + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_alwaysontop))) prm->always_on_top = 'y'; else prm->always_on_top = 'n'; break; - case 3: - /* Feed title */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_feedtitle))) + /*case 3: + // Feed title + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_feedtitle))) prm->feed_title = 'y'; else prm->feed_title = 'n'; break; case 4: - /* Item title */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_itemtitle))) + // Item title + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_itemtitle))) prm->item_title = 'y'; else prm->item_title = 'n'; break; case 5: - /* Item decription */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_itemdes))) + // Item decription + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_itemdes))) prm->item_description = 'y'; else prm->item_description = 'n'; - break; - case 6: + break;*/ + case 3/*6*/: /* Open link cmd */ str_n_cpy(prm->open_link_cmd, (char *)gtk_entry_get_text(GTK_ENTRY(entry_openlinkcmd)), FILE_NAME_MAXLEN); break; - case 7: - /* Disable popups */ - if ((gboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_nopopups))) + /*case 7: + // Disable popups + if ((zboolean)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbut_nopopups))) prm->disable_popups = 'y'; else prm->disable_popups = 'n'; - break; + break;*/ default: break; } @@ -109,13 +109,13 @@ { widget = widget; data = data; - if (gtk_assistant_get_current_page(GTK_ASSISTANT(qsetup)) == 8) { + if (gtk_assistant_get_current_page(GTK_ASSISTANT(qsetup)) == 4/*8*/) { save_to_config_file(prm); gtk_main_quit(); } } -static gint move_to_top(GtkWidget *widget) +static int move_to_top(GtkWidget *widget) { widget = widget; get_params()->win_y = 0; @@ -123,11 +123,11 @@ return TRUE; } -static gint move_to_bottom(GtkWidget *widget) +static int move_to_bottom(GtkWidget *widget) { - char font_n_s[FONT_MAXLEN + 1]; - char fname[FONT_NAME_MAXLEN + 1], fsize[FONT_SIZE_MAXLEN + 1]; - gint requested_font_size, requested_h, y_bottom; + char font_name_size[FONT_MAXLEN + 1]; + char font_name[FONT_NAME_MAXLEN + 1], font_size[FONT_SIZE_MAXLEN + 1]; + int requested_font_size, requested_h, y_bottom; /* We backup this param first because... */ char disable_popups_bak = get_params()->disable_popups; @@ -141,27 +141,27 @@ requested_h = DRWA_HEIGHT_MIN; else if (requested_h == 0) { /* Compute ticker height from requested font size */ - str_n_cpy(font_n_s, get_params()->font_n_s, FONT_MAXLEN); - split_font(font_n_s, fname, fsize); + str_n_cpy(font_name_size, get_params()->font_name_size, FONT_MAXLEN); + split_font(font_name_size, font_name, font_size); /* In all cases, font size can't be > FONT_MAXSIZE */ - requested_font_size = MIN(atoi(fsize), FONT_MAXSIZE); - snprintf(fsize, FONT_SIZE_MAXLEN + 1, "%3d", requested_font_size); - compact_font(font_n_s, fname, fsize); - requested_h = get_layout_height_from_fnamesize(font_n_s); + requested_font_size = MIN(atoi(font_size), FONT_MAXSIZE); + snprintf(font_size, FONT_SIZE_MAXLEN + 1, "%3d", requested_font_size); + compact_font(font_name_size, font_name, font_size); + requested_h = get_layout_height_from_font_name_size(font_name_size); } y_bottom = env->screen_h - requested_h; #ifndef G_OS_WIN32 /* How to get taskbar height on Linux ? */ - warning(FALSE, 3, "Taskbar height: Will use ", itoa2(ARBITRARY_TASKBAR_HEIGHT), - " pixels arbitrary value - Please adjust as necessary afterwards"); + warning(BLOCK, "Taskbar height: Will use %d pixels arbitrary value - " + "Please adjust as necessary afterwards", ARBITRARY_TASKBAR_HEIGHT); y_bottom -= ARBITRARY_TASKBAR_HEIGHT; #else if (get_win32_taskbar_height() != -1) y_bottom -= get_win32_taskbar_height(); else { - warning(FALSE, 3, "Couldn't compute Taskbar height: Will use ", itoa2(ARBITRARY_TASKBAR_HEIGHT), - " pixels arbitrary value - Please adjust as necessary afterwards"); + warning(BLOCK, "Couldn't compute Taskbar height: Will use %d pixels arbitrary value - " + "Please adjust as necessary afterwards", ARBITRARY_TASKBAR_HEIGHT); y_bottom -= ARBITRARY_TASKBAR_HEIGHT; } #endif @@ -171,6 +171,10 @@ return TRUE; } +/* + * TODO: which other ones here ???? + * Reverse scrolling / Read n items max per feed / Mouse wheel scrolling behaviour + */ void quick_setup(Params *prm0) { #define N_PAGES_MAX 16 @@ -213,7 +217,7 @@ hbox[i] = gtk_hbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox[i]), 15); - label[i] = gtk_label_new("Y position (Pixels):"); + label[i] = gtk_label_new("Vertical Location (Pixels):"); gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); gtk_box_pack_start(GTK_BOX(hbox[i]), label[i], FALSE, FALSE, 0); @@ -242,7 +246,7 @@ hbox[i] = gtk_hbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox[i]), 15); - label[i] = gtk_label_new("Window Always-On-Top:"); + label[i] = gtk_label_new(APP_NAME " always above other windows:"); gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); gtk_box_pack_start(GTK_BOX(hbox[i]), label[i], FALSE, FALSE, 0); @@ -266,7 +270,8 @@ gtk_assistant_set_page_title(GTK_ASSISTANT(qsetup), page[i], APP_NAME " always-on-top"); i++; - /* Feed title */ +/* Following 3 pages now disabled: + // Feed title hbox[i] = gtk_hbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox[i]), 15); @@ -294,7 +299,7 @@ gtk_assistant_set_page_title(GTK_ASSISTANT(qsetup), page[i], "Display feed title"); i++; - /* Item title */ + // Item title hbox[i] = gtk_hbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox[i]), 15); @@ -322,7 +327,7 @@ gtk_assistant_set_page_title(GTK_ASSISTANT(qsetup), page[i], "Display item title"); i++; - /* Item description */ + // Item description hbox[i] = gtk_hbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox[i]), 15); @@ -349,17 +354,14 @@ gtk_assistant_set_page_type(GTK_ASSISTANT(qsetup), page[i], GTK_ASSISTANT_PAGE_CONTENT); gtk_assistant_set_page_title(GTK_ASSISTANT(qsetup), page[i], "Display item description"); i++; +*/ /* "Open in browser" command line */ hbox[i] = gtk_hbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox[i]), 15); -#ifndef G_OS_WIN32 - label[i] = gtk_label_new("'Open in Browser' command line:"); -#else - label[i] = gtk_label_new("'Open in Browser' command line:\n" - "(leave blank if unsure)"); -#endif + label[i] = gtk_label_new("Browser to open links with:\n" + "(Shell command - leave blank/unchanged if unsure)"); gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); gtk_box_pack_start(GTK_BOX(hbox[i]), label[i], FALSE, FALSE, 0); @@ -381,7 +383,8 @@ gtk_assistant_set_page_title(GTK_ASSISTANT(qsetup), page[i], "Pick a Browser"); i++; - /* Disable popups */ +/* This page also disabled: + // Disable popups hbox[i] = gtk_hbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox[i]), 15); @@ -408,13 +411,15 @@ gtk_assistant_set_page_type(GTK_ASSISTANT(qsetup), page[i], GTK_ASSISTANT_PAGE_CONTENT); gtk_assistant_set_page_title(GTK_ASSISTANT(qsetup), page[i], "Disable popups"); i++; +*/ /* Confirm page */ hbox[i] = gtk_hbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox[i]), 15); label[i] = gtk_label_new("Quick setup complete !\n" - "To open the full setup window, right-click then 'Edit > Preferences'."); + "To open the preferences or full settings window, right-click on " APP_NAME " then\n" + " 'Edit > Preferences' or 'Edit > Full Settings'."); gtk_label_set_use_markup(GTK_LABEL(label[i]), TRUE); gtk_misc_set_alignment(GTK_MISC(label[i]), 0, 0.5); gtk_box_pack_start(GTK_BOX(hbox[i]), label[i], FALSE, FALSE, 0); @@ -432,11 +437,11 @@ g_signal_connect(G_OBJECT(spinbut_winy), "changed", G_CALLBACK(keep_setting), (gpointer)1); g_signal_connect(G_OBJECT(checkbut_alwaysontop), "toggled", G_CALLBACK(keep_setting), (gpointer)2); - g_signal_connect(G_OBJECT(checkbut_feedtitle), "toggled", G_CALLBACK(keep_setting), (gpointer)3); + /*g_signal_connect(G_OBJECT(checkbut_feedtitle), "toggled", G_CALLBACK(keep_setting), (gpointer)3); g_signal_connect(G_OBJECT(checkbut_itemtitle), "toggled", G_CALLBACK(keep_setting), (gpointer)4); - g_signal_connect(G_OBJECT(checkbut_itemdes), "toggled", G_CALLBACK(keep_setting), (gpointer)5); - g_signal_connect(G_OBJECT(entry_openlinkcmd), "changed", G_CALLBACK(keep_setting), (gpointer)6); - g_signal_connect(G_OBJECT(checkbut_nopopups), "toggled", G_CALLBACK(keep_setting), (gpointer)7); + g_signal_connect(G_OBJECT(checkbut_itemdes), "toggled", G_CALLBACK(keep_setting), (gpointer)5);*/ + g_signal_connect(G_OBJECT(entry_openlinkcmd), "changed", G_CALLBACK(keep_setting), (gpointer)3/*6*/); + /*g_signal_connect(G_OBJECT(checkbut_nopopups), "toggled", G_CALLBACK(keep_setting), (gpointer)7);*/ g_signal_connect(G_OBJECT(qsetup), "cancel", G_CALLBACK(qsetup_cancel), NULL); g_signal_connect(G_OBJECT(qsetup), "prepare", G_CALLBACK(qsetup_prepare), NULL); diff -Nru tickr-0.6.4/src/tickr/tickr_render.c tickr-0.7.0/src/tickr/tickr_render.c --- tickr-0.6.4/src/tickr/tickr_render.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_render.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -18,146 +18,356 @@ #include "tickr.h" +#define NO_RESOURCE_STR "No resource" +#define WELCOME_STR "Welcome to " APP_NAME " v" APP_V_NUM " ! "\ + "To open the main menu, right-click here ..." + /* - * Render n lines of a stream (opened text file) into an image (cairo surface) - * of one long single line of text. - * - One single stream is likely to be splitted into several text parts. - * - n is limited because surface width must be <= (XPIXMAP_MAXWIDTH = 32 K - 1) - * (DO THIS STILL APPLY TO CAIRO IMAGE SURFACES ?) - * - Return addr of newly created surface. - * If returned surface is NULL then render_exit_status is set accordingly and - * should be checked to know which error occured - * (otherwise render_exit_status = OK or RENDER_NO_RESOURCE or - * RENDER_LINE_TOO_LONG). - * LINE_MAXLEN should be set to ensure that we won't have too-long lines. + * 'Private' struct's used to make an open stream 'readable' and 'renderable' + * in both directions (L to R and R to L). */ -cairo_surface_t *render_stream_to_surface(FILE *fp, FeedLinkAndOffset *link_and_offset, const Params *prm, \ - int *render_exit_status) +typedef struct { + char *str; + zboolean is_valid; /* Means string is readable (filled) and free-able */ + int width; /* Used to compute links' offsets */ +} RenderString; + +typedef struct { + RenderString render_str[N_RENDER_STR_MAX]; /* Array of strings from stream */ + int n; /* Number of strings (<= N_RENDER_STR_MAX) */ + int i; /* Current string index, -1 means empty array or error */ + int links_extra_offset; /* For the current surface */ +} RenderStringArray; + +/* 'Private' static array */ +static RenderStringArray s_a0, *s_a = &s_a0; + +/* Prototypes for static funcs */ +static cairo_surface_t *render_string_and_layout_to_surface(const char *, PangoLayout *, const Params *, int *); +static zboolean fill_in_string_array_from_stream(FILE *, FeedLinkAndOffset *, PangoLayout *, const Params *, int *); +static int parse_utf8_str_until_layout_width(char *, PangoLayout *, int); +static char *get_current_string_in_array(int *); +static char *fill_in_offset_array_update_big_string(char *, FeedLinkAndOffset *, PangoLayout *); +static char *get_big_string_from_stream(FILE *, PangoLayout *, const Params *, int *); +static char *no_resource_str(PangoLayout *); +/*static char *welcome_str(PangoLayout *);*/ +static char *create_empty_line_from_layout(PangoLayout *); +static char *create_tab_line(); +static int get_layout_width(PangoLayout *, const char *); +static int get_layout_height(PangoLayout *, const char *); + +/* Init on first call, do nothing on next calls. */ +void init_render_string_array() +{ + int i; + static int j = -1; + + if (j == -1) { + for (i = 0; i < N_RENDER_STR_MAX; i++) { + s_a->render_str[i].is_valid = FALSE; + s_a->render_str[i].width = 0; + } + s_a->n = 0; + s_a->i = -1; + s_a->links_extra_offset = 0; + j++; + } +} + +void free_all_render_strings_in_array() { - TickerEnv *env = get_ticker_env(); - char *txt_str; + int i; + + /* See: init_render_string_array() */ + for (i = 0; i < N_RENDER_STR_MAX; i++) { + if (s_a->render_str[i].is_valid) { + l_str_free(s_a->render_str[i].str); + s_a->render_str[i].is_valid = FALSE; + } + s_a->render_str[i].width = 0; + } + /* Also reset all int vars */ + s_a->n = 0; + s_a->i = -1; + s_a->links_extra_offset = 0; +} + +/* For the current surface */ +int get_links_extra_offset() +{ + return s_a->links_extra_offset; +} + +/* + * Render a stream (opened text file) into images (cairo surfaces) of single + * lines of text. Any surface width must be <= (XPIXMAP_MAXWIDTH = 32 K - 1) + * because, for some reason, X pixmap width and height are signed 16-bit + * integers (not sure if this relates to X or Pixman, but one can see this + * very limit set in cairo-image-surface.c in cairo sources.) Which is a + * PITA because implementation would be so much more staighforward otherwise. + * + * So one stream must be splitted into an array of strings on first call + * and each string is rendered on each call, from first to last if scrolling + * dir is R to L, or from last to first if scrolling dir is L to R. When + * all strings have been rendered, get_ticker_env()->feed_fully_rendered + * is set to TRUE. This flag can also be used to 'reset' this function + * (as well as get_ticker_env()->reload_rq). + * + * Return newly created surface, or NULL if error. + * If returned surface is NULL, then error_code is set accordingly and should + * be checked to know which error occured. + * (Could be: OK, RENDER_NO_RESOURCE, RENDER_CAIRO_IMAGE_SURFACE_TOO_WIDE, + * RENDER_CREATE_CAIRO_IMAGE_SURFACE_ERROR, RENDER_PANGO_LAYOUT_WIDTH_OVERFLOW, + * RENDER_FILL_IN_STR_ARRAY_ERROR, RENDER_PROCESS_STR_ARRAY_ERROR, + * READ_FROM_STREAM_ERROR.) + * + * Also set get_resource()->link_and_offset.offset_in_surface values. + */ +cairo_surface_t *render_stream_to_surface(FILE *fp, FeedLinkAndOffset *link_and_offset, const Params *prm, int *error_code) +{ + cairo_surface_t *c_surf = NULL; + char *cur_str, *str; + PangoContext *context; PangoLayout *p_layout; PangoFontDescription *f_des; - int layout_width, layout_height; - cairo_t *cr; - cairo_pattern_t *cr_p; - float shadow_k; - char tmp[4]; - int i, j; + /*zboolean welcome = FALSE;*/ - *render_exit_status = OK; - env->stream_fully_read = FALSE; + if (get_ticker_env()->reload_rq) + get_ticker_env()->feed_fully_rendered = TRUE; + *error_code = OK; /* * Create layout */ - p_layout = pango_layout_new(gtk_widget_get_pango_context(env->win)); + context = gtk_widget_get_pango_context(get_ticker_env()->win); + p_layout = pango_layout_new(context); pango_layout_set_attributes(p_layout, NULL); pango_layout_set_single_paragraph_mode(p_layout, TRUE); - - f_des = pango_font_description_from_string((const char *)prm->font_n_s); + f_des = pango_font_description_from_string((const char *)prm->font_name_size); pango_layout_set_font_description(p_layout, f_des); pango_font_description_free(f_des); - pango_layout_context_changed(p_layout); /* - * Get text string from stream + * Get one string (from text string array from stream) */ - txt_str = l_str_new(NULL); - + init_render_string_array(); if (fp != NULL) { - txt_str = stream_to_htext(fp, txt_str, p_layout, prm, render_exit_status); - if (*render_exit_status != OK && *render_exit_status != RENDER_LINE_TOO_LONG) { - l_str_free(txt_str); - return NULL; + if (get_ticker_env()->feed_fully_rendered) { + free_all_render_strings_in_array(); + if (!fill_in_string_array_from_stream(fp, link_and_offset, p_layout, prm, error_code)) { + warning(M_S_MOD, "%s(): fill_in_string_array_from_stream(): %s", __func__, + global_error_str(*error_code)); + /* We consider we don't have any valid resource */ + *error_code = RENDER_NO_RESOURCE; + } + } else + *error_code = OK; + + if (*error_code == OK) { + cur_str = get_current_string_in_array(error_code); + if (cur_str != NULL) + str = l_str_new(cur_str); + else { + warning(M_S_MOD, "%s(): get_current_string_in_array(): %s", + __func__, global_error_str(*error_code)); + /* Again, we consider we don't have any valid resource */ + *error_code = RENDER_NO_RESOURCE; + } } - } else { - txt_str = void_stream_to_htext(txt_str, p_layout); - *render_exit_status = RENDER_NO_RESOURCE; } - /* - * Translate link ranks inside (eventually splitted) text into offsets in surface. - * - * Scan text for "00n" and get - * offset = layout_width(< text from start to tag >), - * for every rss item found - * then remove tags and fill an array of FeedLinkAndOffset's - * with offsets (rank and url variables are already filled). - */ - link_and_offset->offset_in_surface = env->drwa_width; /* First offset (000) = env->drwa_width */ - for (i = 1; i < NFEEDLINKANDOFFSETMAX; i++) /* Then we reset all other offsets to 0 */ - (link_and_offset + i)->offset_in_surface = 0; - for (i = 0; txt_str[i] != '\0'; i++) { - if (txt_str[i] == LINK_TAG_CHAR) { - str_n_cpy(tmp ,txt_str + i + 1, 3); - j = atoi(tmp); - txt_str[i] = '\0'; - if (j > 0 && j < NFEEDLINKANDOFFSETMAX) - (link_and_offset + j)->offset_in_surface = get_layout_width(p_layout, txt_str); - txt_str = l_str_cat(txt_str, txt_str + i + 4); - } + + if (fp == NULL || *error_code != OK) { + get_resource()->id[0] = '\0'; + free_all_render_strings_in_array(); + /*if (welcome) + str = welcome_str(p_layout); + else*/ + str = no_resource_str(p_layout); + s_a->render_str[0].str = str; + s_a->n = 1; + s_a->i = 0; + if (M_S_MOD) + get_ticker_env()->feed_fully_rendered = TRUE; + } + + c_surf = render_string_and_layout_to_surface(str, p_layout, prm, error_code); + /* + * If out of limits, set flag so that, in multiple selection mode, + * to load next feed on next call. + */ + if (STANDARD_SCROLLING) { + if (s_a->i > s_a->n - 1) + get_ticker_env()->feed_fully_rendered = TRUE; + } else { + if (s_a->i < 0) + get_ticker_env()->feed_fully_rendered = TRUE; } + + l_str_free(str); + if (p_layout != NULL) + g_object_unref(p_layout); + return c_surf; +} + +/* + * Create a cairo surface (image) of a string and layout. + * 'Tail surface' is used in sequential calls to this function, ie the + * 2nd call will get the tail part of the first call surface, which will + * be the beginning part of the new surface. + * + * By setting get_ticker_env()->feed_fully_rendered to TRUE, the function + * is kind of reset, and 'tail surface' is destroyed + * + * Return surface or NULL if error (and set error_code). + */ +static cairo_surface_t *render_string_and_layout_to_surface(const char *str2, PangoLayout *p_layout, const Params *prm, int *error_code) +{ + int layout_width, layout_height, shift_x; + char *str, *empty_line; + cairo_surface_t *c_surf = NULL; + static cairo_surface_t *c_tail_surf = NULL; + cairo_t *c_context; + cairo_t *c_tail_context; + cairo_pattern_t *c_pattern; + cairo_status_t c_status; + float shadow_k; + zboolean errors = FALSE; +#ifdef G_OS_WIN32 + WCHAR u202d[6]; +#endif + + if (REVERSE_SCROLLING) { +#ifndef G_OS_WIN32 + str = l_str_new("\u202d"); /* Unicode LTR override - NEED THIS TO GET THINGS RIGHT (so to speak) */ +#else + g_unichar_to_utf8(L'\u202d', (char *)u202d); + str = l_str_new((char *)u202d); +#endif + str = l_str_cat(str, str2); + } else + str = l_str_new(str2); + /* + * 'Tail' surface stuff + */ + if (get_ticker_env()->feed_fully_rendered) { + if (c_tail_surf != NULL) + cairo_surface_destroy(c_tail_surf); + c_tail_surf = NULL; + /* Reset 'global' variable get_ticker_env()->feed_fully_rendered */ + get_ticker_env()->feed_fully_rendered = FALSE; + } + if (c_tail_surf == NULL) { + empty_line = create_empty_line_from_layout(p_layout); + if (STANDARD_SCROLLING) + str = l_str_insert_at_b(str, empty_line); + else + str = l_str_cat(str, empty_line); + l_str_free(empty_line); + shift_x = 0; + } else + shift_x = get_ticker_env()->drwa_width; /* * Fill layout */ - pango_layout_set_text(p_layout, txt_str, -1); - l_str_free(txt_str); - + pango_layout_set_text(p_layout, str, -1); pango_layout_context_changed(p_layout); - pango_layout_get_pixel_size2(p_layout, &layout_width, &layout_height); - env->surf_width = (gint)layout_width; - env->surf_height = (gint)layout_height; - - if (env->surf_width > XPIXMAP_MAXWIDTH) { - g_object_unref(p_layout); - *render_exit_status = RENDER_CAIRO_IMAGE_SURFACE_TOO_WIDE; + pango_layout_get_pixel_size(p_layout, &layout_width, &layout_height); + if (layout_width + shift_x > XPIXMAP_MAXWIDTH) { + *error_code = RENDER_CAIRO_IMAGE_SURFACE_TOO_WIDE; + l_str_free(str); return NULL; } /* * Create cairo image surface onto which layout will be rendered */ - env->c_surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, - env->surf_width, env->surf_height); - if (cairo_surface_status(env->c_surf) != CAIRO_STATUS_SUCCESS) { - cairo_surface_destroy(env->c_surf); - *render_exit_status = RENDER_CREATE_CAIRO_IMAGE_SURFACE_ERROR; - return (env->c_surf = NULL); + c_surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, + layout_width + shift_x, layout_height); + if ((c_status = cairo_surface_status(c_surf)) != CAIRO_STATUS_SUCCESS) { + INFO_ERR("%s(): cairo_image_surface_create(): %s\n", __func__, + cairo_status_to_string(c_status)) + *error_code = RENDER_CREATE_CAIRO_IMAGE_SURFACE_ERROR; + cairo_surface_destroy(c_surf); + if (c_tail_surf != NULL) + cairo_surface_destroy(c_tail_surf); + l_str_free(str); + return NULL; + } + c_context = cairo_create(c_surf); + /* + * Copy c_tail_surf at beginning of c_surf + * + * === If reverse sc, replace 'tail' with 'head' and beginning part with ending part === + */ + if (shift_x > 0) { + if (STANDARD_SCROLLING) { + /* + * cairo_set_source_(): dest_x - src_x, dest_y - src_y + */ + cairo_set_source_surface(c_context, c_tail_surf, 0, 0); + /* + * cairo_rectangle(): dest_x, dest_y, src_w, src_h + */ + cairo_rectangle(c_context, 0, 0, shift_x, layout_height); + } else { + cairo_set_source_surface(c_context, c_tail_surf, layout_width, 0); + cairo_rectangle(c_context, layout_width, 0, shift_x, layout_height); + } + cairo_set_operator(c_context, CAIRO_OPERATOR_SOURCE); + cairo_fill(c_context); + cairo_surface_destroy(c_tail_surf); } - cr = cairo_create(env->c_surf); /* * Render layout */ /* Draw background */ if (get_params()->set_gradient_bg == 'y') { - cr_p = cairo_pattern_create_linear(0.0, 0.0, 0.0, (float)env->surf_height); - if (cairo_pattern_status(cr_p) == CAIRO_STATUS_SUCCESS) { - if (cairo_pattern_get_type(cr_p) == CAIRO_PATTERN_TYPE_LINEAR) { - cairo_pattern_add_color_stop_rgba(cr_p, 0.0, + c_pattern = cairo_pattern_create_linear(0.0, 0.0, 0.0, (float)layout_height); + if ((c_status = cairo_pattern_status(c_pattern)) == CAIRO_STATUS_SUCCESS) { + if (cairo_pattern_get_type(c_pattern) == CAIRO_PATTERN_TYPE_LINEAR) { + cairo_pattern_add_color_stop_rgba(c_pattern, 0.0, (float)prm->bg_color.red / G_MAXUINT16, (float)prm->bg_color.green / G_MAXUINT16, (float)prm->bg_color.blue / G_MAXUINT16, (float)prm->bg_color_alpha / G_MAXUINT16); - cairo_pattern_add_color_stop_rgba(cr_p, 1.0, + cairo_pattern_add_color_stop_rgba(c_pattern, 1.0, (float)prm->bg_color2.red / (G_MAXUINT16), (float)prm->bg_color2.green / (G_MAXUINT16), (float)prm->bg_color2.blue / (G_MAXUINT16), (float)prm->bg_color_alpha / G_MAXUINT16); - cairo_set_source(cr, cr_p); - cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); - cairo_paint(cr); - } else - fprintf(STD_ERR, "render_stream_to_surface(): " - "Cairo pattern type != linear (gradient)\n"); - } else - fprintf(STD_ERR, "render_stream_to_surface(): " - "Cairo_pattern_create_linear() error\n"); - cairo_pattern_destroy(cr_p); + cairo_set_source(c_context, c_pattern); + if (STANDARD_SCROLLING) + cairo_rectangle(c_context, shift_x, 0, layout_width, layout_height); + else + cairo_rectangle(c_context, 0, 0, layout_width, layout_height); + cairo_set_operator(c_context, CAIRO_OPERATOR_SOURCE); + cairo_fill(c_context); + } else { + INFO_ERR("%s(): Cairo pattern type != linear (gradient)\n", __func__) + errors = TRUE; + } + } else { + INFO_ERR("%s(): cairo_pattern_create_linear(): %s\n", __func__, + cairo_status_to_string(c_status)) + errors = TRUE; + } + cairo_pattern_destroy(c_pattern); } else { - cairo_set_source_rgba(cr, + cairo_set_source_rgba(c_context, (float)prm->bg_color.red / G_MAXUINT16, (float)prm->bg_color.green / G_MAXUINT16, (float)prm->bg_color.blue / G_MAXUINT16, (float)prm->bg_color_alpha / G_MAXUINT16); - cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); - cairo_paint(cr); + if (STANDARD_SCROLLING) + cairo_rectangle(c_context, shift_x, 0, layout_width, layout_height); + else + cairo_rectangle(c_context, 0, 0, layout_width, layout_height); + cairo_set_operator(c_context, CAIRO_OPERATOR_SOURCE); + cairo_fill(c_context); + } + if (errors) { + *error_code = RENDER_CREATE_CAIRO_IMAGE_SURFACE_ERROR; + cairo_surface_destroy(c_surf); + cairo_destroy(c_context); + l_str_free(str); + return NULL; } /* Draw foreground */ if (prm->shadow == 'y') { @@ -169,270 +379,519 @@ else shadow_k = 1.0 - (float)prm->shadow_fx / 10.0; if (get_params()->set_gradient_bg == 'y') { - cr_p = cairo_pattern_create_linear(0.0, 0.0, 0.0, (float)env->surf_height); - if (cairo_pattern_status(cr_p) == CAIRO_STATUS_SUCCESS) { - if (cairo_pattern_get_type(cr_p) == CAIRO_PATTERN_TYPE_LINEAR) { - cairo_pattern_add_color_stop_rgba(cr_p, 0.0, + c_pattern = cairo_pattern_create_linear(0.0, 0.0, 0.0, (float)layout_height); + if ((c_status = cairo_pattern_status(c_pattern)) == CAIRO_STATUS_SUCCESS) { + if (cairo_pattern_get_type(c_pattern) == CAIRO_PATTERN_TYPE_LINEAR) { + cairo_pattern_add_color_stop_rgba(c_pattern, 0.0, (float)prm->bg_color.red * shadow_k / G_MAXUINT16, (float)prm->bg_color.green * shadow_k / G_MAXUINT16, (float)prm->bg_color.blue * shadow_k / G_MAXUINT16, (float)prm->bg_color_alpha / G_MAXUINT16); - cairo_pattern_add_color_stop_rgba(cr_p, 1.0, + cairo_pattern_add_color_stop_rgba(c_pattern, 1.0, (float)prm->bg_color2.red * shadow_k / (G_MAXUINT16), (float)prm->bg_color2.green * shadow_k / (G_MAXUINT16), (float)prm->bg_color2.blue * shadow_k / (G_MAXUINT16), (float)prm->bg_color_alpha / G_MAXUINT16); - cairo_set_source(cr, cr_p); - pango_cairo_update_layout(cr, p_layout); - cairo_move_to(cr, prm->shadow_offset_x, prm->shadow_offset_y); - cairo_set_operator(cr, CAIRO_OPERATOR_OVER); - pango_cairo_show_layout(cr, p_layout); - } else - fprintf(STD_ERR, "render_stream_to_surface(): " - "Cairo pattern type != linear (gradient)\n"); - } else - fprintf(STD_ERR, "render_stream_to_surface(): " - "Cairo_pattern_create_linear() error\n"); - cairo_pattern_destroy(cr_p); + cairo_set_source(c_context, c_pattern); + pango_cairo_update_layout(c_context, p_layout); + if (STANDARD_SCROLLING) + cairo_rectangle(c_context, shift_x + prm->shadow_offset_x, prm->shadow_offset_y, + layout_width, layout_height); + else + cairo_rectangle(c_context, prm->shadow_offset_x, prm->shadow_offset_y, + layout_width, layout_height); + cairo_set_operator(c_context, CAIRO_OPERATOR_OVER); + pango_cairo_show_layout(c_context, p_layout); + } else { + INFO_ERR("%s(): Cairo pattern type != linear (gradient)\n", __func__) + errors = TRUE; + } + } else { + INFO_ERR("%s(): cairo_pattern_create_linear(): %s\n", __func__, + cairo_status_to_string(c_status)) + errors = TRUE; + } + cairo_pattern_destroy(c_pattern); } else { - cairo_set_source_rgba(cr, + cairo_set_source_rgba(c_context, (float)prm->bg_color.red * shadow_k / G_MAXUINT16, (float)prm->bg_color.green * shadow_k / G_MAXUINT16, (float)prm->bg_color.blue * shadow_k / G_MAXUINT16, (float)prm->bg_color_alpha / G_MAXUINT16); - pango_cairo_update_layout(cr, p_layout); - cairo_move_to(cr, prm->shadow_offset_x, prm->shadow_offset_y); - cairo_set_operator(cr, CAIRO_OPERATOR_OVER); - pango_cairo_show_layout(cr, p_layout); + pango_cairo_update_layout(c_context, p_layout); + if (STANDARD_SCROLLING) + cairo_rectangle(c_context, shift_x + prm->shadow_offset_x, prm->shadow_offset_y, + layout_width, layout_height); + else + cairo_rectangle(c_context, prm->shadow_offset_x, prm->shadow_offset_y, + layout_width, layout_height); + cairo_set_operator(c_context, CAIRO_OPERATOR_OVER); + pango_cairo_show_layout(c_context, p_layout); } } - /* Draw text */ - cairo_set_source_rgba(cr, + if (errors) { + *error_code = RENDER_CREATE_CAIRO_IMAGE_SURFACE_ERROR; + cairo_surface_destroy(c_surf); + cairo_destroy(c_context); + l_str_free(str); + return NULL; + } + cairo_set_source_rgba(c_context, (float)prm->fg_color.red / G_MAXUINT16, (float)prm->fg_color.green / G_MAXUINT16, (float)prm->fg_color.blue / G_MAXUINT16, (float)prm->fg_color_alpha / G_MAXUINT16); - pango_cairo_update_layout(cr, p_layout); - cairo_move_to(cr, 0, 0); - cairo_set_operator(cr, CAIRO_OPERATOR_OVER); - pango_cairo_show_layout(cr, p_layout); + pango_cairo_update_layout(c_context, p_layout); + if (STANDARD_SCROLLING) + cairo_rectangle(c_context, shift_x, 0, layout_width, layout_height); + else + cairo_rectangle(c_context, 0, 0, layout_width, layout_height); + cairo_set_operator(c_context, CAIRO_OPERATOR_OVER); + pango_cairo_show_layout(c_context, p_layout); + /* + * Create 'tail' surface + */ + c_tail_surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, + get_ticker_env()->drwa_width, layout_height); + c_tail_context = cairo_create(c_tail_surf); + if (STANDARD_SCROLLING) { + cairo_set_source_surface(c_tail_context, c_surf, - layout_width - shift_x + get_ticker_env()->drwa_width, 0); + cairo_rectangle(c_tail_context, 0, 0, get_ticker_env()->drwa_width, layout_height); + } else { + cairo_set_source_surface(c_tail_context, c_surf, 0, 0); + cairo_rectangle(c_tail_context, 0, 0, get_ticker_env()->drwa_width, layout_height); + } + cairo_set_operator(c_tail_context, CAIRO_OPERATOR_SOURCE); + cairo_fill(c_tail_context); + cairo_destroy(c_tail_context); + if ((c_status = cairo_surface_status(c_tail_surf)) != CAIRO_STATUS_SUCCESS) { + INFO_ERR("%s(): cairo_image_surface_create(): %s\n", __func__, + cairo_status_to_string(c_status)) + *error_code = RENDER_CREATE_CAIRO_IMAGE_SURFACE_ERROR; + cairo_surface_destroy(c_surf); + cairo_surface_destroy(c_tail_surf); + l_str_free(str); + return NULL; + } /* * Drawing done - return surface */ - if (p_layout != NULL) - g_object_unref(p_layout); - cairo_destroy(cr); - return env->c_surf; + *error_code = OK; /* Needed ? Can't hurt anyways */ + cairo_destroy(c_context); + l_str_free(str); + return c_surf; } /* - * Split stream into a a set of long lines so that, after rendering of each one, - * we get a cairo image surface whose width is <= (XPIXMAP_MAXWIDTH = 32 K - 1). - * If one line is longer than tmp2_size, it will get truncated and CUTLINE_DELIMITER - * will be appended but we should make sure that this will not happen. + * Read and split stream into an array of lines so that, after rendering of any line, + * we always get a cairo image surface whose width is <= XPIXMAP_MAXWIDTH. + * Stream (*not* checked) is expected to be not NULL. + * + * s_a is a 'private' (static) RenderStringArray. */ -char *stream_to_htext(FILE *fp, char *txt_str, PangoLayout *p_layout, const Params *prm, int *render_exit_status) +static zboolean fill_in_string_array_from_stream(FILE *fp, FeedLinkAndOffset *link_and_offset, + PangoLayout *p_layout, const Params *prm, int *error_code) { - TickerEnv *env = get_ticker_env(); - static int text_splitted = FALSE; - static char *ending_str = NULL; - long int file_pos; - char *tmp1, *tmp2; - size_t tmp1_size = LINE_MAXLEN * 4; /* Anyways, this is adjusted by getline() */ - size_t tmp2_size = 64 * 1024; /* This should always be enough (hmmm...) */ - int c = 0; - char *empty_line; - int empty_line_length, empty_line_width, txt_str_width;/* Length in chars, width in pixels */ - int i, j, k; -#ifndef G_OS_WIN32 - ssize_t n; -#endif + char *big_str, *sub_str, c; + int max_width, i, j; - *render_exit_status = OK; - /* - * Creating an "empty line" - */ - empty_line = l_str_new(NULL); - do - empty_line = l_str_cat(empty_line, " "); - while ((empty_line_width = get_layout_width(p_layout, empty_line)) < env->drwa_width); - empty_line_length = strlen(empty_line); - if (env->reload_rq) - text_splitted = FALSE; - /* - * We start with an "empty line" but if text has been splitted. - */ - if (!text_splitted) { - txt_str = l_str_cat(txt_str, empty_line); - txt_str_width = empty_line_width; - } else { - if (ending_str != NULL) { - txt_str = l_str_cat(txt_str, ending_str); - txt_str_width = get_layout_width(p_layout, txt_str); - } else { - *render_exit_status = RENDER_NULL_ENDINGSTR; - return txt_str; + /* First we get the 'big' string. */ + big_str = get_big_string_from_stream(fp, p_layout, prm, error_code); + if (big_str == NULL) + return FALSE; + else if (get_resource()->type == RESRC_FILE && strlen(big_str) > 50 * 1024) { + /* FIXME: *MUST* BE OPTIMIZED (A LOT) */ + if (question_win("In this version, processing 'big' text files (size > 50 KiB) takes ages.\n" + "(Time seems to increase exponentially with file size and this needs to be fixed.)\n" + "Continue anyways ?", NO) == NO) { + *error_code = RENDER_NO_RESOURCE; + l_str_free(big_str); + big_str = NULL; + return FALSE; } } - if (ending_str != NULL) { - l_str_free(ending_str); - ending_str = NULL; - } - text_splitted = FALSE; - /* - * Then we read stream (text file) into txt_str, one line at a time. - * Text file has been previously formatted with extra newline's so that - * no line is longer than LINE_MAXLEN. - * We must make sure that no line needs to be cut (width > (XPIXMAP_MAXWIDTH = 32 K - 1) - * after rendering) but how do we set LINE_MAXLEN properly ? - * LINE_MAXLEN < (XPIXMAP_MAXWIDTH = 32 K - 1) / FONT_MAXSIZE = about 163 if maxsize = 200 - * so 128 should always be OK (see tickr.h) - * - * (It could be better, for performance reasons, to replace LINE_MAXLEN - * by a variable like: line_maxlen = k * XPIXMAP_MAXWIDTH / font_size, - * especially when font_size is big.) + if (get_layout_width(p_layout, big_str) == 0) { + *error_code = RENDER_PANGO_LAYOUT_WIDTH_OVERFLOW; + l_str_free(big_str); + big_str = NULL; + return FALSE; + } + + /* + * Compute offsets for 'big' string. + * get_resource()->link_and_offset->url values are already set. */ - tmp1 = malloc2((tmp1_size + 1) * sizeof(char)); /* tmp1 will get 1 line */ - tmp2 = malloc2((tmp2_size + 1) * sizeof(char)); /* tmp2 will get 1 "expanded" line */ + big_str = fill_in_offset_array_update_big_string(big_str, link_and_offset, p_layout); + + /* Then we fill in array with sub-strings. */ + max_width = XPIXMAP_MAXWIDTH - (2 * get_ticker_env()->drwa_width) - prm->shadow_offset_x; /* - * txt_str will get all n lines + * For debugging purposes, we can set max_width to a smaller value so that we get multiple sub-strings (RenderString's) + * ie setting max_width to 2000 or 3000; */ - while (1) { - file_pos = ftell(fp); + sub_str = big_str; + + for (i = 0; i < N_RENDER_STR_MAX; i++) { #ifndef G_OS_WIN32 - if ((n = getline(&tmp1, &tmp1_size, fp)) == -1) { -#else - if (fgets(tmp1, tmp1_size, fp) == NULL) { + if (get_resource()->type == RESRC_FILE) + VERBOSE_INFO_OUT("\r%c Processing, please wait ... ", spinning_shape()) #endif - /* - * eof or error ? - */ - if (feof(fp) == 0) { - *render_exit_status = RENDER_GETLINE_ERROR; - return txt_str; - } - /* - * Text file fully read - * -> reset to beginning in single selection mode - * or - * -> set flag so that to load next feed in multiple selection mode - */ - if (env->selection_mode == SINGLE) - fseek(fp, 0, SEEK_SET); - else - env->stream_fully_read = TRUE; + s_a->render_str[i].str = l_str_new(NULL); + s_a->render_str[i].is_valid = TRUE; + s_a->render_str[i].width = 0; + + j = parse_utf8_str_until_layout_width(sub_str, p_layout, max_width); + if (j == -2) { + /* -2 means error */ + *error_code = RENDER_FILL_IN_STR_ARRAY_ERROR; + warning(M_S_MOD, "%s(): %s", __func__, global_error_str(*error_code)); break; + } else if (j > 0) { + /* = sub-string length in bytes (vs UTF-8 chars) */ + c = *(sub_str + j); + *(sub_str + j) = '\0'; + if (g_utf8_validate(sub_str, -1, NULL)) { + s_a->render_str[i].str = l_str_cat(s_a->render_str[i].str, sub_str); + s_a->render_str[i].width = get_layout_width(p_layout, s_a->render_str[i].str); + } else + *error_code = RENDER_FILL_IN_STR_ARRAY_ERROR; + *(sub_str + j) = c; + sub_str += j; + if (*error_code == RENDER_FILL_IN_STR_ARRAY_ERROR) + break; } else { + /* 0 or -1 means string width (in pixels) is already <= max_width */ + if (g_utf8_validate(sub_str, -1, NULL)) { + s_a->render_str[i].str = l_str_cat(s_a->render_str[i].str, sub_str); + s_a->render_str[i].width = get_layout_width(p_layout, s_a->render_str[i].str); + } else + *error_code = RENDER_FILL_IN_STR_ARRAY_ERROR; + break; + } + } #ifndef G_OS_WIN32 - for (i = 0, j = 0; i < n; i++) { -#else - for (i = 0, j = 0; i < (int)strlen(tmp1); i++) { + if (get_resource()->type == RESRC_FILE) + VERBOSE_INFO_OUT("Done\n") #endif - /* - * This is not supposed to happen but if tmp2_size was wrongly set - */ - if ((size_t)j >= tmp2_size - strlen(prm->cutline_delimiter) - 1) { - str_n_cpy(&tmp2[j], prm->cutline_delimiter, OPTION_VALUE_MAXLEN); - j += strlen(prm->cutline_delimiter); - warning(FALSE, 1, "stream_to_htext(): Line is too long"); - *render_exit_status = RENDER_LINE_TOO_LONG; - break; - } - c = tmp1[i]; - k = 1; - if (c == '\n') { /* tmp1 last char, because we use getline() / fgets(). */ - str_n_cpy(&tmp2[j], prm->line_delimiter, OPTION_VALUE_MAXLEN); - j += strlen(prm->line_delimiter); + l_str_free(big_str); + + if (i >= N_RENDER_STR_MAX) { /* Just warn - OK ? */ + warning(BLOCK, "%s(): Need more than %d strings to render stream.\n" + "Compile option N_RENDER_STR_MAX should be adjust accordingly.\n", + __func__, N_RENDER_STR_MAX); + i = N_RENDER_STR_MAX - 1; + } + + s_a->n = i + 1; + if (STANDARD_SCROLLING) + s_a->i = 0; + else + s_a->i = s_a->n - 1; + + if (*error_code == OK) + return TRUE; + else + return FALSE; +} + +/* + * Get length (in bytes) of a sub-string (of an UTF-8 string) whose, if set inside + * a layout, will have a width (in pixels) near but <= max_width. + * + * Returned length is not the max length possible, but differs only from max length + * by a small amount of bytes (which is OK for what this function is used for, and + * this also makes the function a little bit faster.) + * + * Return sub-string length in bytes (vs UTF-8 chars), -1 if string width (in pixels) + * is already <= max_width, -2 if error. + */ +static int parse_utf8_str_until_layout_width(char *str, PangoLayout *p_layout, int max_width) +{ + char *p, c; + int str_width = get_layout_width(p_layout, str); /* In pixels */ + size_t str_len = strlen(str); /* In bytes */ + long offset, delta; /* In UTF-8 chars, ie 1 to 4 bytes */ + zboolean is_beyond; + + if (str_width > max_width) { + offset = g_utf8_strlen(str, -1); + delta = offset / 2; + p = str; + is_beyond = TRUE; + while (1) { + offset += is_beyond ? - delta: delta; + delta /= 2; + if (delta == 0) + delta = 1; + p = g_utf8_offset_to_pointer(str, offset); + if (p == NULL || p < str || p > str + str_len) { + VERBOSE_INFO_ERR("%s(): g_utf8_offset_to_pointer() returned invalid pointer\n", + __func__) + return -2; + } + c = *p; + *p = '\0'; + str_width = get_layout_width(p_layout, str); + *p = c; + if (str_width == -1) { + VERBOSE_INFO_ERR("%s(): get_layout_width() error\n", __func__) + return -2; + } else if (str_width == max_width) + break; + else if (str_width > max_width) + is_beyond = TRUE; + else { + if (max_width - str_width < 50) break; - } - if (prm->special_chars == 'y') { - if (c == prm->new_page_char) { - c = ' '; - k = empty_line_length; - } else if (c == prm->tab_char) { - c = ' '; - k = TAB_SIZE; - } - } - while (k-- > 0) { - if (prm->upper_case_text != 'y') - tmp2[j++] = c; - else - tmp2[j++] = toupper(c); - } + is_beyond = FALSE; } - tmp2[j] = '\0'; } - txt_str_width += get_layout_width(p_layout, tmp2); - if (txt_str_width > XPIXMAP_MAXWIDTH - 2 * empty_line_width - prm->shadow_offset_x) { - /* - * Need to split text into several parts. - * We don't add this line but will use it in next surface. - */ - fseek(fp, file_pos, SEEK_SET); - text_splitted = TRUE; - break; - } else - txt_str = l_str_cat(txt_str, tmp2); + if (p != NULL) + return (int)(p - str); + else + return -1; + } else if (str_width == -1) { /* Error computing width */ + VERBOSE_INFO_ERR("%s(): get_layout_width() error\n", __func__) + return -2; + } else /* Nothing to do */ + return -1; +} + +/* + * Return current str (or NULL if error) and increment/decrement index for + * next call. Also compute s_a->links_extra_offset for current surface. + * + * s_a is a 'private' (static) RenderStringArray. + */ +static char *get_current_string_in_array(int *error_code) +{ + int j; + + *error_code = RENDER_PROCESS_STR_ARRAY_ERROR; + + if (s_a->n < 1) { + INFO_ERR("%s(): s_a->n (= %d) < 1\n", __func__, s_a->n) + return NULL; + } else if (s_a->i >= 0 && s_a->i < s_a->n) { + if (s_a->render_str[s_a->i].str == NULL) { + INFO_ERR("%s(): s_a->render_str[%d].str = NULL\n", __func__, s_a->i) + return NULL; + } else if (!s_a->render_str[s_a->i].is_valid) { + INFO_ERR("%s(): s_a->render_str[%d].is_valid = FALSE\n", __func__, s_a->i) + return NULL; + } else { + /* Compute links extra offset for current surface */ + s_a->links_extra_offset = 0; + for (j = 0; j < s_a->i; j++) + s_a->links_extra_offset += s_a->render_str[j].width; + DEBUG_INFO("RenderStringArray: s_a->n = %d, s_a->i = %d\n", s_a->n, s_a->i) + *error_code = OK; + /* New index on next call */ + if (STANDARD_SCROLLING) + return s_a->render_str[s_a->i++].str; + else + return s_a->render_str[s_a->i--].str; + } + } else { + INFO_ERR("%s(): s_a->i (= %d) is out of bounds (0 - %d)\n", __func__, s_a->i, s_a->n - 1) + return NULL; } +} + +/* + * Translate link ranks inside text into offsets in surface. + * + * Scan text for "00n" and get offset = layout_width(< text from start to tag >), + * for every rss item found. Then remove tags and fill an array of FeedLinkAndOffset's with offsets + * (ranks and URLs are already known/set). + * + * For reverse scrolling, work somehow differently + * + * Return new str. + */ +static char *fill_in_offset_array_update_big_string(char *str, FeedLinkAndOffset *link_and_offset, PangoLayout *p_layout) +{ + char tmp[4]; + int i, j; + + if (STANDARD_SCROLLING) { + link_and_offset->offset_in_surface = get_ticker_env()->drwa_width; /* First offset (000) = get_ticker_env()->drwa_width */ + for (i = 1; i < NFEEDLINKANDOFFSETMAX; i++) /* We reset all other offsets to 0 */ + (link_and_offset + i)->offset_in_surface = 0; + } else { + for (i = 0; i < NFEEDLINKANDOFFSETMAX; i++) /* We reset all offsets to 0 */ + (link_and_offset + i)->offset_in_surface = 0; + } + + for (i = 0; str[i] != '\0'; i++) { + if (str[i] == LINK_TAG_CHAR) { + str_n_cpy(tmp, str + i + 1, 3); + j = atoi(tmp); + str[i] = '\0'; + if (j > 0 && j < NFEEDLINKANDOFFSETMAX) { + if (STANDARD_SCROLLING) + (link_and_offset + j)->offset_in_surface = + get_ticker_env()->drwa_width + get_layout_width(p_layout, str); + else + (link_and_offset + j)->offset_in_surface = get_layout_width(p_layout, str); + } + str = l_str_cat(str, str + i + 4); + } + } + + if (REVERSE_SCROLLING) + (link_and_offset)->offset_in_surface = get_layout_width(p_layout, str); /* First offset = layout width of full string */ + + return str; +} + +/* + * Create a single long string from stream and do some processing (line delimiters, + * special chars, upper case text.) Created string must be l_str_free'd when done. + * Stream is expected to be not NULL, but *not* checked. + * If error, return NULL and set error_code. + */ +static char *get_big_string_from_stream(FILE *fp, PangoLayout *p_layout, const Params *prm, int *error_code) +{ + char *str, *empty_line, *tab_line; + char *tmp, *p, *p2, c; + size_t tmp_size = FGETS_STR_MAXLEN; + + fseek(fp, 0, SEEK_SET); + empty_line = create_empty_line_from_layout(p_layout); + tab_line = create_tab_line(); + + str = l_str_new(NULL); /* - * And we end with an "empty line" but if text has been splitted, + * We read stream (text file) one line at a time, to build str */ - if (!text_splitted) { - txt_str = l_str_cat(txt_str, empty_line); - ending_str = NULL; - } else { + tmp = malloc2((tmp_size + 1) * sizeof(char)); + +#ifndef G_OS_WIN32 + while (getline(&tmp, &tmp_size, fp) != -1) { +#else + while (fgets(tmp, tmp_size, fp) != NULL) { +#endif + for (p = tmp; p != NULL && *p != '\0'; p = g_utf8_find_next_char(p, NULL)) { + if (*p == '\n') + str = l_str_cat(str, prm->line_delimiter); + else if (*p == prm->new_page_char && prm->special_chars == 'y') + str = l_str_cat(str, empty_line); + else if (*p == prm->tab_char && prm->special_chars == 'y') + str = l_str_cat(str, tab_line); + else { + p2 = g_utf8_find_next_char(p, NULL); + if (p2 != NULL) { + c = *p2; + *p2 = '\0'; + str = l_str_cat(str, p); + *p2 = c; + } else + break; + } + } + } + free(tmp); + + /* EOF or error ? */ + if (feof(fp) != 0) { + if (prm->upper_case_text == 'y') { + p = g_utf8_strup(str, -1); + l_str_free(str); + str = l_str_new(p); + g_free(p); + } /* - * in which case we keep "tail" of txt_str whose width is drwa_width. + * str ends with an "empty line" */ - i = strlen(txt_str) - 1; - while (get_layout_width(p_layout, txt_str + i--) <= env->drwa_width); - ending_str = l_str_new(txt_str + i + 1); + if (STANDARD_SCROLLING) + str = l_str_cat(str, empty_line); + else + str = l_str_insert_at_b(str, empty_line); + *error_code = OK; + } else { + l_str_free(str); + str = NULL; + *error_code = READ_FROM_STREAM_ERROR; + INFO_ERR("%s(): %s\n", __func__, global_error_str(*error_code)) } - free2(tmp1); - free2(tmp2); + + l_str_free(empty_line); + l_str_free(tab_line); + + return str; +} + +/* Returned string must be l_str_free'd when done. */ +static char *no_resource_str(PangoLayout *p_layout) +{ + char *str, *empty_line = create_empty_line_from_layout(p_layout); + + str = l_str_new(empty_line); + str = l_str_cat(str, NO_RESOURCE_STR); + str = l_str_cat(str, empty_line); l_str_free(empty_line); - return txt_str; + + return str; } -char *void_stream_to_htext(char *txt_str, PangoLayout *p_layout) +/* Returned string must be l_str_free'd when done. */ +/*static char *welcome_str(PangoLayout *p_layout) +{ + char *str, *empty_line = create_empty_line_from_layout(p_layout); + + str = l_str_new(empty_line); + str = l_str_cat(str, WELCOME_STR); + str = l_str_cat(str, empty_line); + l_str_free(empty_line); + + return str; +}*/ + +/* Created string must be l_str_free'd when done. */ +static char *create_empty_line_from_layout(PangoLayout *p_layout) { - TickerEnv *env = get_ticker_env(); - char *empty_line; + char *empty_line = l_str_new(NULL); - empty_line = l_str_new(NULL); do empty_line = l_str_cat(empty_line, " "); - while (get_layout_width(p_layout, empty_line) < env->drwa_width); + while (get_layout_width(p_layout, empty_line) < get_ticker_env()->drwa_width); - txt_str = l_str_cat(txt_str, empty_line); - txt_str = l_str_cat(txt_str, "No resource"); - txt_str = l_str_cat(txt_str, empty_line); - l_str_free(empty_line); + return empty_line; +} + +/* Created string must be l_str_free'd when done. */ +static char *create_tab_line() +{ + char *tab_line = l_str_new(NULL); + int i; - return txt_str; + for (i = 0; i < TAB_SIZE; i++) + tab_line = l_str_cat(tab_line, " "); + + return tab_line; } -int get_fsize_from_layout_height(gint height, const char *fontname) +int get_font_size_from_layout_height(int height, const char *font_name2) { PangoLayout *p_layout; PangoFontDescription *f_des; - char fnamesize[FONT_MAXLEN + 1]; - char fname[FONT_NAME_MAXLEN + 1], fsize[FONT_SIZE_MAXLEN + 1]; - char check_str[] = "gjpqyÀÄÅÇÉÖÜ€£$!&({[?|"; /* Should be enough - Is it? */ - gint height2; + char font_name_size[FONT_MAXLEN + 1]; + char font_name[FONT_NAME_MAXLEN + 1], font_size[FONT_SIZE_MAXLEN + 1]; + char check_str[] = "gjpqyÀÄÅÇÉÖÜ€£$!&({[?|"; /* Should be enough - Is it ? */ + int height2; int i = 1; p_layout = pango_layout_new(gtk_widget_get_pango_context(get_ticker_env()->win)); pango_layout_set_attributes(p_layout, NULL); pango_layout_set_single_paragraph_mode(p_layout, TRUE); - str_n_cpy(fname, fontname, FONT_NAME_MAXLEN); + str_n_cpy(font_name, font_name2, FONT_NAME_MAXLEN); do { - snprintf(fsize, FONT_SIZE_MAXLEN + 1, "%3d", i++); - compact_font(fnamesize, fname, fsize); - f_des = pango_font_description_from_string((const char *)fnamesize); + snprintf(font_size, FONT_SIZE_MAXLEN + 1, "%3d", i++); + compact_font(font_name_size, font_name, font_size); + f_des = pango_font_description_from_string((const char *)font_name_size); pango_layout_set_font_description(p_layout, f_des); pango_font_description_free(f_des); height2 = get_layout_height(p_layout, check_str); @@ -444,18 +903,19 @@ return (i - 1); } -gint get_layout_height_from_fnamesize(const char *fnamesize) +/* In *pixels*, return -1 if error. */ +int get_layout_height_from_font_name_size(const char *font_name_size) { PangoLayout *p_layout; PangoFontDescription *f_des; char check_str[] = "gjpqyÀÄÅÇÉÖÜ€£$!&({[?|"; - gint height; + int height; p_layout = pango_layout_new(gtk_widget_get_pango_context(get_ticker_env()->win)); pango_layout_set_attributes(p_layout, NULL); pango_layout_set_single_paragraph_mode(p_layout, TRUE); - f_des = pango_font_description_from_string(fnamesize); + f_des = pango_font_description_from_string(font_name_size); pango_layout_set_font_description(p_layout, f_des); pango_font_description_free(f_des); @@ -466,38 +926,82 @@ return height; } -gint get_layout_width(PangoLayout *p_layout, const char *str) +/* In *pixels*, return 0 if empty str, -1 if error. */ +static int get_layout_width(PangoLayout *p_layout, const char *str) { - int layout_width, layout_height; - - pango_layout_set_text(p_layout, str, -1); - pango_layout_context_changed(p_layout); - pango_layout_get_pixel_size2(p_layout, &layout_width, &layout_height); + int layout_width; - return (gint)layout_width; + if (str != NULL) { + if (str[0] != '\0') { + pango_layout_set_text(p_layout, str, -1); + pango_layout_context_changed(p_layout); + pango_layout_get_pixel_size(p_layout, &layout_width, NULL); + } else { + DEBUG_INFO("%s(pango_layout, str): str length = 0 - Troubles ahead ?\n", __func__) + return 0; + } + } else { + VERBOSE_INFO_ERR("%s(pango_layout, str): str is NULL\n", __func__) + layout_width = -1; + } + return layout_width; } -gint get_layout_height(PangoLayout *p_layout, const char *str) +/* In *pixels*, return 0 if empty str, -1 if error. */ +static int get_layout_height(PangoLayout *p_layout, const char *str) { - int layout_width, layout_height; + int layout_height; - pango_layout_set_text(p_layout, str, -1); - pango_layout_context_changed(p_layout); - pango_layout_get_pixel_size2(p_layout, &layout_width, &layout_height); + if (str != NULL) { + if (str[0] != '\0') { + pango_layout_set_text(p_layout, str, -1); + pango_layout_context_changed(p_layout); + pango_layout_get_pixel_size(p_layout, NULL, &layout_height); + } else { + DEBUG_INFO("%s(pango_layout, str): str length = 0 - Troubles ahead ?\n", __func__) + return 0; + } + } else { + VERBOSE_INFO_ERR("%s(pango_layout, str): str is NULL\n", __func__) + layout_height = -1; + } + return layout_height; +} + +/* Return '-', '\', '|', '/', sequentially */ +char spinning_shape() +{ + static int counter = 0; + char str[4] = "-\\|/"; - return (gint)layout_height; + counter = counter & 3; + return str[counter++]; } -/* To avoid troubles in case of an empty string inside layout */ -void pango_layout_get_pixel_size2(PangoLayout *p_layout, int *layout_width, int *layout_height) +/* + * Show begining and end of a 'long' UTF-8 string, mainly for debugging purposes + * -> Fist 30 chars + " ... " + last 30 chars + */ +void show_str_beginning_and_end(char *str) { - if (strlen(pango_layout_get_text(p_layout)) > 0) - pango_layout_get_pixel_size(p_layout, layout_width, layout_height); - else { - *layout_width = 0; - *layout_height = 0; - fprintf(STD_ERR, - "pango_layout_get_pixel_size2(): Text length = 0 - Troubles ahead ?\n"); + char *p, c; + char *s1 = NULL, *s2 = NULL; + int i; + + for (p = str, i = 0; p != NULL && *p != '\0'; p = g_utf8_find_next_char(p, NULL), i++) { + if (i == 30) { + c = *p; + *p = 0; + s1 = l_str_new(str); + *p = c; + } else if (i == (int)strlen(str) - 30) { + s2 = l_str_new(p); + break; + } } - return; + INFO_OUT("%s ... %s\n", s1, s2) + if (s1 != NULL) + l_str_free(s1); + if (s2 != NULL) + l_str_free(s2); } diff -Nru tickr-0.6.4/src/tickr/tickr_resource.c tickr-0.7.0/src/tickr/tickr_resource.c --- tickr-0.6.4/src/tickr/tickr_resource.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_resource.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 * * * This program is free software: you can redistribute it and/or modify @@ -20,14 +20,14 @@ #include "tickr_html_entities.h" /* - * Build selection f_list from full feed f_list. + * Build selection f_list from full f_list. * * Always use get/set_feed_list() and get/set_feed_selection() to access * FList *feed_list and FList *feed_selection defined in tickr_main.c. */ int build_feed_selection_from_feed_list() { - FList *new_selection = NULL, *node = get_feed_list(); + FList *new_selection = NULL, *node = get_feed_list(); if (IS_FLIST(node)) { for (node = f_list_first(node); IS_FLIST(node); node = node->next) @@ -49,49 +49,45 @@ } /* - * feed_index_in_selection starts at 0 - * (these funcs do nothing in single selection mode) + * feed_index_in_selection starts at 0. + * These funcs do nothing in single selection mode. */ -/* Always reload -> OK like that ? */ void current_feed() { FList *selection = get_feed_selection(); int f_index; - if (get_ticker_env()->selection_mode == MULTIPLE) { + if (M_S_MOD) { if ((f_index = f_list_index(selection)) == 0) set_feed_selection(f_list_last(selection)); else if (f_index > 0) - set_feed_selection(f_list_nth(selection, f_index /* (rank = f_index + 1) - 1 */)); + set_feed_selection(f_list_nth(selection, f_index)); /* (rank = f_index + 1) - 1 */ get_ticker_env()->reload_rq = TRUE; } } -/* Always reload -> OK like that ? */ void first_feed() { - if (get_ticker_env()->selection_mode == MULTIPLE) { + if (M_S_MOD) { set_feed_selection(f_list_first(get_feed_selection())); get_ticker_env()->reload_rq = TRUE; } } -/* Always reload -> OK like that ? */ void last_feed() { - if (get_ticker_env()->selection_mode == MULTIPLE) { + if (M_S_MOD) { set_feed_selection(f_list_last(get_feed_selection())); get_ticker_env()->reload_rq = TRUE; } } -/* TODO: check that - buggy ???? */ -gboolean previous_feed() +zboolean previous_feed() { FList *selection = get_feed_selection(); int f_index; - if (get_ticker_env()->selection_mode == MULTIPLE) { + if (M_S_MOD) { if ((f_index = f_list_index(selection)) > 1 || f_index == 0) { if (f_index > 1) set_feed_selection(f_list_nth(selection, f_index - 1)); @@ -100,36 +96,41 @@ get_ticker_env()->reload_rq = TRUE; return TRUE; } else if (f_index == 1) - info_win_wait("This is already the first feed", INFO_WIN_WAIT_TIMEOUT); + info_win_no_block("This is already the first feed", INFO_WIN_WAIT_TIMEOUT); } return FALSE; } -/* TODO: check that - buggy ???? */ -gboolean next_feed() +zboolean next_feed() { FList *selection = get_feed_selection(); int f_index; - if (get_ticker_env()->selection_mode == MULTIPLE) { + if (M_S_MOD) { if ((f_index = f_list_index(selection)) > 0) { get_ticker_env()->reload_rq = TRUE; return TRUE; } else - info_win_wait("This is already the last feed", INFO_WIN_WAIT_TIMEOUT); + info_win_no_block("This is already the last feed", INFO_WIN_WAIT_TIMEOUT); } return FALSE; } /* - * - Single mode: (re)load resrc->id = text file if it exists or rss feed if valid. - * - Multiple mode: load sequentially all selected feeds in feed list. + * - Single selection mode: (re)load resrc->id = rss feed if valid or text file if it exists. + * - Multiple selection mode: load sequentially all selected feeds in feed list. * - * In case of url: load_resource() -> get_feed() -> parse_rss20/rss10/atom_xml_file(). + * In case of URL: + * load_resource_from_selection() -> get_feed() -> fetch_resource() -> parse_xml_file() -> format_resource() + * + * - file:///... is considered an URL and will be 'xml-parsed'. + * - /path/file_name will be processed as a non-xml text file. + * + * Return OK or error code. */ -int load_resource(Resource *resrc, FList *feed_selection) +int load_resource_from_selection(Resource *resrc, FList *feed_selection) { - int rss_status, exit_status; + int rss_status, error_code; if (resrc->fp != NULL) { fclose(resrc->fp); @@ -143,7 +144,7 @@ resrc->type = RESRC_TYPE_UNDETERMINED; resrc->format = RSS_FORMAT_UNDETERMINED; - if (get_ticker_env()->selection_mode == MULTIPLE) { + if (M_S_MOD) { if (IS_FLIST(feed_selection)) { str_n_cpy(resrc->id, feed_selection->url, FILE_NAME_MAXLEN); if (IS_FLIST(feed_selection->next)) @@ -151,120 +152,175 @@ else if (IS_FLIST(f_list_first(feed_selection))) feed_selection = f_list_first(feed_selection); set_feed_selection(feed_selection); - } else { - warning(TRUE, 1, "No feed selected - ", + } else { + warning(M_S_MOD, "No feed selected or no feed selection available\n" "Switching to single selection mode"); get_ticker_env()->selection_mode = SINGLE; resrc->id[0] = '\0'; - /*warning(TRUE, 1, "No feed selection available - " - "Switching to single selection mode"); - get_ticker_env()->selection_mode = SINGLE; - resrc->id[0] = '\0';*/ } } - if (resrc->id[0] == '\0') { - resrc->type = RESRC_UNSPECIFIED; - fprintf(STD_ERR, "No resource specified\n"); - exit_status = RESOURCE_UNSPECIFIED; - } else { - /* - * Is there an existing file ? - */ - if ((resrc->fp = g_fopen(resrc->id, "rb")) == NULL) { - /* - * If not, have we a valid rss url instead ? - */ + if (resrc->id[0] != '\0') { + if (strcmp(get_scheme_from_url(resrc->id), "http") == 0 || + strcmp(get_scheme_from_url(resrc->id), "https") == 0 || + strcmp(get_scheme_from_url(resrc->id), "file") == 0) { + resrc->type = RESRC_URL; if ((rss_status = get_feed(resrc, get_params())) != OK) { - if (rss_status != FEED_UNPARSABLE && rss_status != FEED_EMPTY &&\ - rss_status != FEED_NO_ITEM_OR_ENTRY_ELEMENT &&\ - rss_status != FEED_DOWNLOAD_ERROR &&\ - rss_status != FEED_FORMAT_ERROR &&\ - rss_status != CONNECT_TOO_MANY_ERRORS) { - warning(get_ticker_env()->selection_mode == MULTIPLE, - 2, "get_feed() error ", itoa2(rss_status)); + /* Don't display some error messages supposedly already shown */ + if ( rss_status != OPEN_FILE_ERROR && + rss_status != FEED_FORMAT_ERROR && + rss_status != FEED_UNPARSABLE && + rss_status != FEED_EMPTY && + rss_status != FEED_NO_ITEM_OR_ENTRY_ELEMENT && + rss_status != TCP_SOCK_CANT_CONNECT && + rss_status != CONNECT_TOO_MANY_ERRORS && + rss_status != RESOURCE_ENCODING_ERROR && + rss_status != HTTP_INVALID_PORT_NUM && + rss_status != HTTP_BAD_REQUEST && + rss_status != HTTP_FORBIDDEN && + rss_status != HTTP_NOT_FOUND && + rss_status != HTTP_GONE && + rss_status != HTTP_INT_SERVER_ERROR && + rss_status != HTTP_NO_STATUS_CODE) { + if (rss_status <= 10000) + warning(M_S_MOD, "get_feed(%s, ...): %s", resrc->id, + global_error_str(rss_status)); } - resrc->id[0] ='\0'; if (rss_status == CONNECT_TOO_MANY_ERRORS) - exit_status = CONNECT_TOO_MANY_ERRORS; - else - exit_status = RESOURCE_INVALID; - } else { - resrc->type = RESRC_URL; - exit_status = OK; - } + error_code = CONNECT_TOO_MANY_ERRORS; + else { + resrc->id[0] ='\0'; + error_code = RESOURCE_INVALID; + } + } else + error_code = OK; } else { resrc->type = RESRC_FILE; - exit_status = OK; + if ((resrc->fp = g_fopen(resrc->id, "rb")) == NULL) { + warning(M_S_MOD, "Can't open '%s': %s", resrc->id, strerror(errno)); + resrc->id[0] ='\0'; + error_code = RESOURCE_NOT_FOUND; + } else + error_code = OK; } + } else { + resrc->type = RESRC_UNSPECIFIED; + error_code = NO_RESOURCE_SPECIFIED; } - if (exit_status == OK) { - if (format_resource(resrc, XML_DUMP) == RESOURCE_FORMAT_ERROR) { - big_error(RESOURCE_FORMAT_ERROR, 1, "format_resource() error"); - exit_status = RESOURCE_FORMAT_ERROR; + if (error_code == OK) { + if ((error_code = format_resource(resrc, XML_DUMP)) == OK) + if (resrc->type == RESRC_URL) + error_code = format_resource(resrc, XML_DUMP_EXTRA); + if (error_code != OK) { + warning(M_S_MOD, "%s: %s", global_error_str(FEED_FORMAT_ERROR), resrc->id); + resrc->id[0] ='\0'; } - if (resrc->type == RESRC_URL) - if (format_resource(resrc, XML_DUMP_EXTRA) == RESOURCE_FORMAT_ERROR) { - big_error(RESOURCE_FORMAT_ERROR, 1, "format_resource() error"); - exit_status = RESOURCE_FORMAT_ERROR; - } } - return exit_status; + return error_code; } /* - * Strip html tags, - * then 'translate' html entities, - * then check for lines longer than LINE_MAXLEN and insert newline's if any, - * then resrc->fp refers to a "formatted" file. + * Do: + * - Check UTF-8 encoding + * - Strip html tags + * - 'Translate' html entities + * Then resrc->fp refers to a "formatted" file. + * + * Return OK or error code (FEED_FORMAT_ERROR, CREATE_FILE_ERROR, NOT_UTF8_ENCODED, + * READ_FROM_STREAM_ERROR). + * */ -int format_resource(Resource *resrc, const char *file_name) +int format_resource(Resource *resrc, const char *pathname) { - FILE *fp, *tmp_fp; - char *str1, *str2, entity[16]; - size_t str1_size = 8 * 1024; - int is_inside_tag, entity_found, c, i, j; - gchar *p; + FILE *fp; + char *str; + int i; - if (strcmp(file_name, XML_DUMP) == 0) + if (strcmp(pathname, XML_DUMP) == 0) fp = resrc->fp; - else if (strcmp(file_name, XML_DUMP_EXTRA) == 0) + else if (strcmp(pathname, XML_DUMP_EXTRA) == 0) fp = resrc->fp_extra; - else - return RESOURCE_FORMAT_ERROR; + else { + VERBOSE_INFO_ERR("%s(): %s\n", __func__, global_error_str(FEED_FORMAT_ERROR)) /* TODO: Which error here ? */ + return FEED_FORMAT_ERROR; + } + + if ((i = get_stream_contents(fp, &str, TRUE)) == OK) { + if (get_resource()->type == RESRC_URL) /* ???? */ + str = format_resource_str(str); + fclose(fp); + if ((fp = open_new_datafile_with_name(pathname, "wb+")) != NULL) { + fprintf(fp, "%s", str); + fseek(fp, 0, SEEK_SET); + i = OK; + } else { + i = CREATE_FILE_ERROR; + VERBOSE_INFO_ERR("%s(): %s: '%s'\n", __func__, global_error_str(i), pathname) + } + l_str_free(str); + } else { + fclose(fp); + VERBOSE_INFO_ERR("%s(): %s\n", __func__, global_error_str(i)) + } + + if (strcmp(pathname, XML_DUMP) == 0) + resrc->fp = fp; + else if (strcmp(pathname, XML_DUMP_EXTRA) == 0) + resrc->fp_extra = fp; - /* Strip html tags */ - tmp_fp = open_new_datafile_with_name(TMP1, "wb+"); - is_inside_tag = FALSE; - i = 0; - while ((c = fgetc(fp)) != (int)EOF) { - if (get_params()->strip_html_tags == 'y') { - if (c == '<') { - is_inside_tag = TRUE; - i = 0; - } else if (c == '>') - is_inside_tag = FALSE; + return i; +} + +/* + * Actual 'formatting' is done here. + * str must have been created with l_str_new() (or malloc()). + */ +char *format_resource_str(char *str) +{ +#define ENTITY_LEN 15 + char *str2, *s, *d; + char entity[ENTITY_LEN + 1]; + zboolean is_inside, strip_tags, entity_found; + int i, j; + char c; + + /* + * Strip html tags + */ + str2 = l_str_new(str); + strip_tags = get_params()->strip_html_tags == 'y' ? TRUE : FALSE; + is_inside = FALSE; + + for (s = str, d = str2; s < str + strlen(str); s++) { + c = *s; + if (strip_tags) { + if (c == '<') + is_inside = TRUE; + else if (c == '>') + is_inside = FALSE; } else - is_inside_tag = FALSE; - /* A little bit confusing here... */ - if (!is_inside_tag && !(get_params()->strip_html_tags == 'y' && c == '>')) - fputc((int)c, tmp_fp); - else if (i++ < 1) - fputc((int)' ', tmp_fp); + is_inside = FALSE; + if (!is_inside && !(strip_tags && c == '>')) + *d++ = c; } - fclose(fp); - fp = tmp_fp; - fseek(fp, 0, SEEK_SET); - /* 'Translate' html entities + *d = '\0'; + l_str_free(str); + str = str2; + /* + * 'Translate' html entities * * Libxml2 html named entities issue (not a Tickr bug): * Libxml2 reads html *numerical* entities, not *named* ones (with a few exceptions) * so, for instance,   is OK but   is not. */ - tmp_fp = open_new_datafile_with_name(TMP2, "wb+"); - while ((c = fgetc(fp)) != (int)EOF) { + str2 = l_str_new(str); + /* TODO: How to make *sure* enough space is allocated ? */ + str2 = realloc2(str2, strlen(str) * 2 + TMPSTR_SIZE); /* Original size x 2 + TMPSTR_SIZE */ + + for (s = str, d = str2; s < str + strlen(str) && d < str2 + strlen(str2) - ENTITY_LEN;) { + c = *s++; entity_found = FALSE; if (c == '&') { i = 0; @@ -274,87 +330,109 @@ entity_found = TRUE; break; } - } while ((c = fgetc(fp)) != (int)EOF && i < 15); + } while ((c = *s++) != '\0' && i < ENTITY_LEN); entity[i] = '\0'; if (entity_found) { - /* If entity is numerical, we need to remove any leading '0' in numerical - * value before comparing with strings in html_entity array. */ + /* + * If entity is numerical, we need to remove any leading '0' in numerical + * value before comparing with strings in html_entity array. + */ if (entity[1] == '#' && entity[2] == '0') { j = atoi(entity + 2); - str_n_cpy(entity + 2, itoa2(j), 14); + str_n_cpy(entity + 2, itoa2(j), ENTITY_LEN - 1); str_n_cat(entity, ";", 1); } j = 0; while (html_entity[j] != NULL) { - if (strcmp(entity, html_entity[j]) == 0 ||\ + if (strcmp(entity, html_entity[j]) == 0 || strcmp(entity, html_entity[j + 1]) == 0) { - fputs(html_entity[j + 2], tmp_fp); + str_n_cpy(d, html_entity[j + 2], strlen(html_entity[j + 2])); + d += strlen(html_entity[j + 2]); break; } else j += 3; } } else { - fputc((int)'&', tmp_fp); - fseek(fp, -i, SEEK_CUR); + *d++ = '&'; + s -= i; } } else - fputc((int)c, tmp_fp); + *d++ = c; } - fclose(fp); - fp = tmp_fp; + + l_str_free(str); + str = str2; + remove_trailing_whitespaces_from_str(str); + str = realloc2(str, strlen(str) + 1); + return str; +} + +/* + * Convert from a specified encoding to UTF-8. + * New str must be g_free'd after usage. + */ +char *convert_str_to_utf8(const char *str, const char *encoding) +{ + char *str2; + gsize read, write; + GError *error = NULL; + + if ((str2 = g_convert(str, -1, "UTF-8", encoding, &read, &write, &error)) != NULL) { + VERBOSE_INFO_ERR("%s(): Expected original encoding = '%s'\n", __func__, encoding) + return str2; + } else { + VERBOSE_INFO_ERR("%s(): %s\n", __func__, error->message) + g_error_free(error); + return NULL; + } +} + +/* + * Read full contents of an opened stream and check UTF-8 encoding + * (don't close stream afterward but rewind it). + * str must be l_str_free'd after usage. + * Return OK or NOT_UTF8_ENCODED or READ_FROM_STREAM_ERROR. + */ +int get_stream_contents(FILE *fp, char **str, zboolean check_utf8) +{ + size_t str2_size = FGETS_STR_MAXLEN; + char *str2 = malloc2(str2_size * sizeof(char)); + int i; + fseek(fp, 0, SEEK_SET); + *str = l_str_new(NULL); - /* Newline stuff */ - tmp_fp = open_new_datafile_with_name(file_name, "wb+"); - str1 = malloc2(str1_size * sizeof(char)); - str2 = l_str_new(NULL); #ifndef G_OS_WIN32 - while (getline(&str1, &str1_size, fp) != -1) + while (getline(&str2, &str2_size, fp) != -1) #else - while (fgets(str1, str1_size, fp) != NULL) + while (fgets(str2, str2_size, fp) != NULL) #endif - str2 = l_str_cat(str2, str1); - free2(str1); - /* XML_DUMP: Check for lines longer than LINE_MAXLEN and insert newline's if any */ - if (strcmp(file_name, XML_DUMP) == 0) { - i = 0; - for (p = str2; *p != '\0'; p = g_utf8_find_next_char(p, NULL)) { - if (*p == '\n') - i = 0; - /* - * If the word we are parsing isn't longer than WORD_MAXLEN - * chars, we replace the 1st ' ' found after it with '\n', - * otherwise the word is cut off. - */ - if (i >= LINE_MAXLEN - WORD_MAXLEN) - if (i >= LINE_MAXLEN || g_unichar_isspace(*p)) { - *p = '\n'; - i = 0; - continue; - } - i++; - } - } else { - /* TODO: What should be done for: XML_DUMP_EXTRA ? - * Remove '\n' ? Not sure so doing nothing. */ - /*for (p = str2; *p != '\0'; p = g_utf8_find_next_char(p, NULL)) - if (*p == '\n')*/ - } - fputs(str2, tmp_fp); - l_str_free(str2); - fclose(fp); - fp = tmp_fp; - fseek(fp, 0, SEEK_SET); + *str = l_str_cat(*str, str2); + free2(str2); - if (strcmp(file_name, XML_DUMP) == 0) - resrc->fp = fp; - else if (strcmp(file_name, XML_DUMP_EXTRA) == 0) - resrc->fp_extra = fp; + if (feof(fp) != 0) { + if (check_utf8) { + if (g_utf8_validate(*str, -1, NULL)) + i = OK; + else /*{ + str2 = convert_str_to_utf8((const char*)*str, get_params()->alt_encoding); + if (str2 != NULL) { + l_str_free(*str); + *str = l_str_new(str2); + g_free(str2); + i = OK; + } else*/ + i = NOT_UTF8_ENCODED; + /*}*/ + } else + i = OK; + } else + i = READ_FROM_STREAM_ERROR; - /* Remove tmp files */ - g_remove(get_datafile_full_name_from_name(TMP1)); - g_remove(get_datafile_full_name_from_name(TMP2)); - return OK; + fseek(fp, 0, SEEK_SET); + if (i != OK) + VERBOSE_INFO_ERR("%s(): %s\n", __func__, global_error_str(i)) + return i; } /* @@ -365,7 +443,8 @@ gtk_window_set_icon_from_file(dialog, get_imagefile_full_name_from_name(TICKR_ICON), NULL); } -/* Open/create file in data dir from name. +/* + * Open/create file in data dir from name. * Data dir = config files, not images files. */ FILE *open_new_datafile_with_name(const char *name, const char *mode_str) @@ -376,19 +455,20 @@ str_n_cpy(file_name, get_datafile_full_name_from_name(name), FILE_NAME_MAXLEN); if ((fp = g_fopen(file_name, mode_str)) == NULL) { if (mode_str[0] == 'w') - big_error(CREATE_FILE_ERROR, 4, "Error creating file ", file_name, ": ", strerror(errno)); + big_error(CREATE_FILE_ERROR, "Can't create file '%s': %s", file_name, strerror(errno)); else if (mode_str[0] == 'r') - big_error(OPEN_FILE_ERROR, 4, "Error opening file ", file_name, ": ", strerror(errno)); + big_error(OPEN_FILE_ERROR, "Can't open file '%s': %s", file_name, strerror(errno)); } return fp; } -/* Get full path and name for file in data dir from name. +/* + * Get full path and name for file in data dir from name. * Data dir = config files, not images files. */ char *get_datafile_full_name_from_name(const char *name) { - static char file_name[FILE_NAME_MAXLEN + 1]; + static char file_name[FILE_NAME_MAXLEN + 1]; snprintf(file_name, FILE_NAME_MAXLEN + 1 - 2, "%s%c%s", get_datadir_full_path(), SEPARATOR_CHAR, name); if (get_instance_id() != 0) @@ -399,13 +479,13 @@ /* Now, image files */ char *get_imagefile_full_name_from_name(const char *name) { - static char file_name[FILE_NAME_MAXLEN + 1]; + static char file_name[FILE_NAME_MAXLEN + 1]; #ifndef G_OS_WIN32 snprintf(file_name, FILE_NAME_MAXLEN + 1, "%s%c%s", IMAGES_PATH, SEPARATOR_CHAR, name); #else snprintf(file_name, FILE_NAME_MAXLEN + 1, "%s%c%s%c%s", - get_progfiles_dir(), SEPARATOR_CHAR, IMAGES_PATH, SEPARATOR_CHAR, name); + get_progfiles_dir(), SEPARATOR_CHAR, IMAGES_PATH, SEPARATOR_CHAR, name); #endif return file_name; } @@ -413,7 +493,7 @@ /* Data dir = config files, not images files */ char *get_datadir_full_path() { - static char full_path[TMPSTR_SIZE + 1]; + static char full_path[TMPSTR_SIZE + 1]; #ifndef G_OS_WIN32 snprintf(full_path, TMPSTR_SIZE + 1, "%s%c%s", usr_home_dir(), SEPARATOR_CHAR, TICKR_DIR_NAME); @@ -425,7 +505,7 @@ char *usr_home_dir() { - static char str[TMPSTR_SIZE+ 1] = ""; + static char str[TMPSTR_SIZE+ 1] = ""; #ifndef G_OS_WIN32 return str_n_cpy(str, getpwuid(getuid())->pw_dir, TMPSTR_SIZE); @@ -434,18 +514,32 @@ return str; } -/* Fix non-ascii (for instance cyrillic) user name in app data dir issue on win32 .*/ +/* Fix non-ascii (for instance cyrillic) user name in app data dir issue on win32. */ #ifdef G_OS_WIN32 const char *get_appdata_dir_utf8() { static char file_name[FILE_NAME_MAXLEN + 1]; - gchar *filename_utf8; + char *file_name_utf8; - if ((filename_utf8 = g_utf16_to_utf8((const gunichar2 *)get_appdata_dir_w(), FILE_NAME_MAXLEN, NULL, NULL, NULL)) != NULL) { - str_n_cpy(file_name, filename_utf8, FILE_NAME_MAXLEN); - g_free(filename_utf8); + if ((file_name_utf8 = g_utf16_to_utf8((const gunichar2 *)get_appdata_dir_w(), FILE_NAME_MAXLEN, + NULL, NULL, NULL)) != NULL) { + str_n_cpy(file_name, file_name_utf8, FILE_NAME_MAXLEN); + g_free(file_name_utf8); return (const char *)file_name; } else return NULL; } #endif + +const char *get_sample_url_list_full_name() +{ + static char file_name[FILE_NAME_MAXLEN + 1]; + +#ifndef G_OS_WIN32 + snprintf(file_name, FILE_NAME_MAXLEN + 1, "%s%c%s", INSTALL_PATH, SEPARATOR_CHAR, URL_LIST_FILE); +#else + snprintf(file_name, FILE_NAME_MAXLEN + 1, "%s%c%s%c%s", + get_progfiles_dir(), SEPARATOR_CHAR, TICKR_DIR_NAME, SEPARATOR_CHAR, URL_LIST_FILE); +#endif + return (const char *)file_name; +} diff -Nru tickr-0.6.4/src/tickr/tickr_socket.c tickr-0.7.0/src/tickr/tickr_socket.c --- tickr-0.6.4/src/tickr/tickr_socket.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_socket.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,341 +0,0 @@ -/* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 - * - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "tickr.h" -#include "tickr_socket.h" - -/* - * Can use IPv4 or IPv6 - */ -#ifndef G_OS_WIN32 -static void *get_in_addr(struct sockaddr *s_a) -{ - if (s_a->sa_family == AF_INET) - return &(((struct sockaddr_in *)s_a)->sin_addr); - else - return &(((struct sockaddr_in6 *)s_a)->sin6_addr); -} -#endif - -/* - * Open stream socket in non-blocking mode and connect to host. - * Return socket fd (> 0) / SOCK_CREATE_ERROR (-1 on Linux) if error. - */ -sockt connect_to_host(const char *host, const char *portnum_str) -{ - sockt sock; -#ifndef G_OS_WIN32 - char ipa_str[INET6_ADDRSTRLEN]; -#else - u_long i_mode = 1; /* != 0 to enable non-blocking mode */ -#endif - struct addrinfo hints, *server_info, *ptr; - fd_set read_set, write_set; - struct timeval timeout; - int s_opt_value; - socklen_t s_opt_len = sizeof(sockt); - int i; - - /* addrinfo stuff */ - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; -/*#ifdef VERBOSE_OUTPUT - FPRINTF_FFLUSH_3(STD_OUT, "Resolving %s ... ", host); - FPRINTF_FFLUSH_3(STD_OUT, "Resolving %s ...\n", host); -#endif*/ - if ((i = getaddrinfo(host, portnum_str, &hints, &server_info)) != 0) { - if (USE_PROXY_FLAG) { -#ifndef G_OS_WIN32 - WARNING(FALSE, 4, "getaddrinfo() error: ", host, ": ", gai_strerror(i)); -#else - WARNING(FALSE, 4, "getaddrinfo() error: ", host, ": ", sock_error_message()); -#endif - } else { -#ifndef G_OS_WIN32 - FPRINTF_FFLUSH_4(STD_ERR, "getaddrinfo() error: %s: %s\n", host, gai_strerror(i)); -#else - FPRINTF_FFLUSH_4(STD_ERR, "getaddrinfo() error: %s: %s\n", host, sock_error_message()); -#endif - } - return -1; - } -/*#ifdef VERBOSE_OUTPUT - FPRINTF_FFLUSH_2(STD_OUT, "Done\n"); -#endif*/ - /* We get a list */ - for (ptr = server_info; ptr != NULL; ptr = ptr->ai_next) { - /* Create socket */ - if ((sock = socket(ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol)) == SOCK_CREATE_ERROR) { - FPRINTF_FFLUSH_3(STD_ERR, "Error: %s\n", sock_error_message()); - continue; - } - /* Set socket in non-blocking mode */ -#ifndef G_OS_WIN32 - if ((i = fcntl(sock, F_GETFL, 0)) == SOCK_FUNC_ERROR) { - FPRINTF_FFLUSH_3(STD_ERR, "fcntl() error: %s\n", sock_error_message()); - CLOSE_SOCK(sock); - break; - } else if (fcntl(sock, F_SETFL, i | O_NONBLOCK) == SOCK_FUNC_ERROR) { - FPRINTF_FFLUSH_3(STD_ERR, "fcntl() error: %s\n", sock_error_message()); - CLOSE_SOCK(sock); - break; - } -#else - if (ioctlsocket(sock, FIONBIO, &i_mode) == SOCK_FUNC_ERROR) { - FPRINTF_FFLUSH_3(STD_ERR, "ioctlsocket() error %s\n", sock_error_message()); - CLOSE_SOCK(sock); - break; - } -#endif - /* Get IP addr from server_info */ -#ifdef VERBOSE_OUTPUT -#ifndef G_OS_WIN32 - inet_ntop(ptr->ai_family, get_in_addr((struct sockaddr *)ptr->ai_addr), - ipa_str, sizeof(ipa_str)); - /*FPRINTF_FFLUSH_4(STD_OUT, "Connecting to %s (%s) ...\n", ipa_str, host);*/ - FPRINTF_FFLUSH_4(STD_OUT, "Connecting to %s (%s) ... ", ipa_str, host); -#else - /* Available only on Vista and above but we don't really need that (do we?) so disabled. - InetNtop(ptr->ai_family, get_in_addr((struct sockaddr *)ptr->ai_addr), s, sizeof(s));*/ - /*FPRINTF_FFLUSH_3(STD_OUT, "Connecting to %s ...\n", host);*/ - FPRINTF_FFLUSH_3(STD_OUT, "Connecting to %s ... ", host); -#endif -#endif - /* Connect */ - if ((i = connect(sock, ptr->ai_addr, ptr->ai_addrlen)) == SOCK_FUNC_ERROR && -#ifndef G_OS_WIN32 - errno == EINPROGRESS) { -#else - WSAGetLastError() == WSAEWOULDBLOCK) { -#endif - /* As socket is in non-blocking mode, we must use select() */ - FD_ZERO(&read_set); - FD_ZERO(&write_set); - FD_SET(sock, &read_set); - FD_SET(sock, &write_set); - timeout.tv_sec = CONNECT_TIMEOUT; - timeout.tv_usec = 0; - if ((i = select(sock + 1, &read_set, &write_set, NULL, &timeout)) == SOCK_FUNC_ERROR) { - FPRINTF_FFLUSH_3(STD_ERR, "select() error: %s\n", sock_error_message()); - } else if (i == 0){ - FPRINTF_FFLUSH_2(STD_ERR, "Timed out\n"); - } else if (FD_ISSET(sock, &read_set) || FD_ISSET(sock, &write_set)) { - if (getsockopt(sock, SOL_SOCKET, SO_ERROR, - (void *)(&s_opt_value), &s_opt_len) == SOCK_FUNC_ERROR) { - FPRINTF_FFLUSH_3(STD_ERR, "getsockopt() error: %s\n", sock_error_message()); - } else if (s_opt_value == 0) { -#ifdef VERBOSE_OUTPUT - FPRINTF_FFLUSH_2(STD_OUT, "OK\n"); -#endif - freeaddrinfo(server_info); - return sock; - } -#ifndef G_OS_WIN32 - FPRINTF_FFLUSH_3(STD_ERR, "getsockopt(): %s\n", strerror(s_opt_value)); -#else - FPRINTF_FFLUSH_3(STD_ERR, "getsockopt(): %s\n", win32_error_msg(s_opt_value)); -#endif - CLOSE_SOCK(sock); - break; - } - CLOSE_SOCK(sock); - break; - } else if (i == 0) { -#ifdef VERBOSE_OUTPUT - FPRINTF_FFLUSH_2(STD_OUT, "OK\n"); -#endif - freeaddrinfo(server_info); - return sock; - } else { - FPRINTF_FFLUSH_3(STD_ERR, "connect() error: %s\n", sock_error_message()); - CLOSE_SOCK(sock); - } - } - freeaddrinfo(server_info); - return -1; -} - -int writable_data_is_available_on_socket(sockt sock) -{ - fd_set write_set; - struct timeval timeout; - int i; - - FD_ZERO(&write_set); - FD_SET(sock, &write_set); - timeout.tv_sec = SEND_RECV_TIMEOUT_SEC; - timeout.tv_usec = SEND_RECV_TIMEOUT_USEC; - if ((i = select(sock + 1, NULL, &write_set, NULL, &timeout)) == SOCK_FUNC_ERROR) { - FPRINTF_FFLUSH_3(STD_ERR, "select() error: %s\n", sock_error_message()); - return SELECT_ERROR; - } else if (i == 0) { - return SELECT_TIMED_OUT; - } else { - if (FD_ISSET(sock, &write_set)) - return SELECT_TRUE; - else - return SELECT_FALSE; - } -} - -int readable_data_is_available_on_socket(sockt sock) -{ - fd_set read_set; - struct timeval timeout; - int i; - - FD_ZERO(&read_set); - FD_SET(sock, &read_set); - timeout.tv_sec = SEND_RECV_TIMEOUT_SEC; - timeout.tv_usec = SEND_RECV_TIMEOUT_USEC; - if ((i = select(sock + 1, &read_set, NULL, NULL, &timeout)) == SOCK_FUNC_ERROR) { - FPRINTF_FFLUSH_3(STD_ERR, "select() error: %s\n", sock_error_message()); - return SELECT_ERROR; - } else if (i == 0) { - return SELECT_TIMED_OUT; - } else { - if (FD_ISSET(sock, &read_set)) - return SELECT_TRUE; - else - return SELECT_FALSE; - } -} - -/* - * Return n bytes sent or SOCK_FUNC_ERROR (-1 on Linux) if error (connection - * closed by server or ?) - */ -int send_full(sockt sock, const char *str) -{ - int len = strlen(str), i, j = 0; - - while (writable_data_is_available_on_socket(sock) == SELECT_TRUE) { - if ((i = send(sock, str + j, len, 0)) != SOCK_FUNC_ERROR) { - if (i > 0) { - j += i; - len -= i; - if (len == 0) - break; - } else { - /* Something to do ? */ - } - } else { - j = SOCK_FUNC_ERROR; -#ifndef G_OS_WIN32 - if (errno == EPIPE) { -#else - if ((i = WSAGetLastError()) == WSAECONNRESET || i == WSAECONNABORTED ||\ - i == WSAESHUTDOWN) { -#endif -#ifdef VERBOSE_OUTPUT - FPRINTF_FFLUSH_2(STD_ERR, "Connection closed by server\n"); -#endif - } else { - FPRINTF_FFLUSH_3(STD_ERR, "send() error: %s\n", sock_error_message()); - } - break; - } - } - return j; -} - -/* - * Return response = recv_full(socket, &bytes_received, &status) or NULL if error. - * -> status = SOCK_OK, CONNECTION_CLOSED_BY_SERVER, RECV_ERROR or SOCK_SHOULD_BE_CLOSED. - * -> allocate memory for response (must be freed afterwards with free2() if != NULL). - */ -char *recv_full(sockt sock, int *bytes_received, int *status) -{ - char *response, *full_response; - int i; - - *bytes_received = 0; - *status = RECV_ERROR; - response = malloc2(RECV_CHUNK_LEN + 1); - response[0] = '\0'; - full_response = l_str_new(response); - while (readable_data_is_available_on_socket(sock) == SELECT_TRUE) { - if ((i = recv(sock, response, RECV_CHUNK_LEN, 0)) != SOCK_FUNC_ERROR) { - if (i > 0) { - response[MIN(i, RECV_CHUNK_LEN)] = '\0'; - full_response = l_str_cat(full_response, response); - *bytes_received += i; - *status = SOCK_OK; - } else if (i == 0) { - *status = CONNECTION_CLOSED_BY_SERVER; -#ifdef VERBOSE_OUTPUT - FPRINTF_FFLUSH_2(STD_ERR, "Connection closed by server\n"); -#endif - break; - } - } else { -#ifndef G_OS_WIN32 - *status = RECV_ERROR; - l_str_free(full_response); - full_response = NULL; -#ifdef VERBOSE_OUTPUT - FPRINTF_FFLUSH_3(STD_ERR, "recv() error: %s\n", sock_error_message()); -#endif -#else - if ((i = WSAGetLastError()) == WSAECONNRESET || i == WSAECONNABORTED ||\ - i == WSAESHUTDOWN) { - *status = SOCK_SHOULD_BE_CLOSED; -#ifdef VERBOSE_OUTPUT - FPRINTF_FFLUSH_2(STD_ERR, "Connection closed by server\n"); -#endif - } else { - *status = RECV_ERROR; - l_str_free(full_response); - full_response = NULL; -#ifdef VERBOSE_OUTPUT - FPRINTF_FFLUSH_3(STD_ERR, "recv() error: %s\n", win32_error_msg(i)); -#endif - } -#endif - break; - } - } - free2(response); - return full_response; -} - -#ifdef G_OS_WIN32 -const char *win32_error_msg(int i) -{ - static char str[1024]; - gchar *win32_str; - - win32_str = g_win32_error_message(i); - str_n_cpy(str, (const char *)win32_str, 1023); - g_free(win32_str); - return (const char *)str; -} -#endif - -const char *sock_error_message() -{ - static char str[1024]; - -#ifndef G_OS_WIN32 - str_n_cpy(str, strerror(errno), 1023); -#else - str_n_cpy(str, win32_error_msg(WSAGetLastError()), 1023); -#endif - return (const char *)str; -} diff -Nru tickr-0.6.4/src/tickr/tickr_socket.h tickr-0.7.0/src/tickr/tickr_socket.h --- tickr-0.6.4/src/tickr/tickr_socket.h 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_socket.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -/* - * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 - * - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef INC_TICKR_SOCKET_H -#define INC_TICKR_SOCKET_H - -#define USE_PROXY_FLAG get_use_proxy() -#define WARNING(a1, a2, a3, a4, a5, a6) warning(a1, a2, a3, a4, a5, a6) -#define SOCK_OK OK - -/* Check these 2 values - need more testing (1s / 0.5s / 0.1.s) */ -#define SEND_RECV_TIMEOUT_SEC 1 -#define SEND_RECV_TIMEOUT_USEC 0 - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef G_OS_WIN32 -# include -# include -# include -# include -# include -# include -#else -# define _WIN32_WINNT 0x0501 /* Win version = XP or higher */ -# include -# include -# include -# include -# include -# include -#endif -#include "../libetm-0.4.4/libetm.h" - -#define CONNECT_TIMEOUT 5 -#define RECV_CHUNK_LEN (16 * 1024 - 1) - -#ifndef G_OS_WIN32 -typedef int sockt; -# define SOCK_CREATE_ERROR -1 /* socket() */ -# define SOCK_FUNC_ERROR -1 /* setsockopt(), bind(), listen(), select(), connect(), - * send(), recv(), fnctl(), ioctlsocket() */ -# define CLOSE_SOCK(s) close(s) -#else -typedef SOCKET sockt; -# define SOCK_CREATE_ERROR INVALID_SOCKET -# define SOCK_FUNC_ERROR SOCKET_ERROR -# define CLOSE_SOCK(s) closesocket(s) -#endif - -typedef enum { - SOCK_ERROR = LIBETM_LASTERRORCODE + 1, - SOCK_CANT_CONNECT, - SOCK_SHOULD_BE_CLOSED, - - SELECT_ERROR, - SELECT_TIMED_OUT, - SELECT_TRUE, - SELECT_FALSE, - - SEND_ERROR, - RECV_ERROR, - - CONNECTION_CLOSED_BY_SERVER, - - SOCKET_LASTERRORCODE -} socket_error_code; - -#define FPRINTF_FFLUSH_2(a1, a2); {fprintf(a1, a2); fflush(a1);} -#define FPRINTF_FFLUSH_3(a1, a2, a3); {fprintf(a1, a2, a3); fflush(a1);} -#define FPRINTF_FFLUSH_4(a1, a2, a3, a4); {fprintf(a1, a2, a3, a4); fflush(a1);} - -/* - * Open stream socket in non-blocking mode and connect to host. - * Return socket fd (> 0) / SOCK_CREATE_ERROR (-1 on Linux) if error. - */ -sockt connect_to_host(const char *, const char *); - -int writable_data_is_available_on_socket(sockt); - -int readable_data_is_available_on_socket(sockt); - -/* - * Return n bytes sent or SOCK_FUNC_ERROR (-1 on Linux) if error (connection - * closed by server or ?) - */ -int send_full(sockt, const char *); - -/* - * Return response = recv_full(socket, &bytes_received, &status) or NULL if error. - * -> status = SOCK_OK, CONNECTION_CLOSED_BY_SERVER, RECV_ERROR or SOCK_SHOULD_BE_CLOSED. - * -> allocate memory for response (must be freed afterwards with free2() if != NULL). - */ -char *recv_full(sockt, int *, int *); - -#ifdef G_OS_WIN32 -const char *win32_error_msg(int); -#endif - -const char *sock_error_message(); -#endif /* INC_TICKR_SOCKET_H */ diff -Nru tickr-0.6.4/src/tickr/tickr_tls.c tickr-0.7.0/src/tickr/tickr_tls.c --- tickr-0.6.4/src/tickr/tickr_tls.c 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_tls.c 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,224 @@ +/* + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 + * + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "tickr.h" +#include "tickr_tls.h" + +/* Global GnuTLS variables: session and credentials */ +static gnutls_session_t tls_s; +static gnutls_certificate_credentials_t tls_c; + +gnutls_session_t *get_tls_session() +{ + return &tls_s; +} + +gnutls_certificate_credentials_t *get_tls_cred() +{ + return &tls_c; +} + +/* + * Retrieve available credentials and check X509 server certificate. + */ +int tls_connect(gnutls_session_t *s, gnutls_certificate_credentials_t *c, + const sockt *sock, const char *url, const char *host) +{ + int i; + + if ((i = gnutls_certificate_allocate_credentials(c)) != GNUTLS_E_SUCCESS) { + warning(M_S_MOD, "%s:\ngnutls_certificate_allocate_credentials() error: %s", + url, gnutls_strerror(i)); + return TLS_ERROR; + } + if ((i = gnutls_certificate_set_x509_system_trust(*c)) < 0) { + warning(M_S_MOD, "%s:\ngnutls_certificate_set_x509_system_trust() error: %s", + url, gnutls_strerror(i)); + gnutls_certificate_free_credentials(*c); + return TLS_ERROR; + } else { + DEBUG_INFO("gnutls_certificate_set_x509_system_trust(): %d certificates processed\n", i); + } + gnutls_certificate_set_verify_function(*c, verif_cert_callback); + if ((i = gnutls_init(s, GNUTLS_CLIENT)) != GNUTLS_E_SUCCESS) { + warning(M_S_MOD, "%s:\ngnutls_init() error: %s", url, gnutls_strerror(i)); + gnutls_certificate_free_credentials(*c); + return TLS_ERROR; + } + gnutls_session_set_ptr(*s, (void *)host); + gnutls_server_name_set(*s, GNUTLS_NAME_DNS, host, strlen(host)); + if ((i = gnutls_priority_set_direct(*s, "NORMAL:%COMPAT", NULL)) != GNUTLS_E_SUCCESS) { + warning(M_S_MOD, "%s:\ngnutls_priority_set_direct() error: %s", url, gnutls_strerror(i)); + gnutls_certificate_free_credentials(*c); + gnutls_deinit(*s); + return TLS_ERROR; + } else if ((i = gnutls_credentials_set(*s, GNUTLS_CRD_CERTIFICATE, *c)) != GNUTLS_E_SUCCESS) { + warning(M_S_MOD, "%s:\ngnutls_credentials_set() error: %s", url, gnutls_strerror(i)); + gnutls_certificate_free_credentials(*c); + gnutls_deinit(*s); + return TLS_ERROR; + } + gnutls_transport_set_int(*s, *sock); + gnutls_handshake_set_timeout(*s, GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT); + do { + i = gnutls_handshake(*s); + if (i < 0 && gnutls_error_is_fatal(i)) { + warning(M_S_MOD, "%s:\ngnutls_handshake() error: %s", url, gnutls_strerror(i)); + gnutls_certificate_free_credentials(*c); + gnutls_deinit(*s); + return TLS_ERROR; + } + } while (i < 0); + return OK; +} + +void tls_disconnect(gnutls_session_t *s, gnutls_certificate_credentials_t *c, const char *url) +{ + int i, j; + + gnutls_certificate_free_credentials(*c); + for (j = 0; j < 3; j++) { /* 3 times */ + if ((i = gnutls_bye(*s, GNUTLS_SHUT_RDWR)) == GNUTLS_E_SUCCESS) + break; + else if (i == GNUTLS_E_AGAIN || i == GNUTLS_E_INTERRUPTED) + continue; + else { + INFO_ERR("%s:\ngnutls_bye() error: %s\n", url, gnutls_strerror(i)) + break; + } + } + gnutls_deinit(*s); +} + +int verif_cert_callback(gnutls_session_t s) +{ + char *host; + unsigned int status; + int type; + gnutls_datum_t output; + int i; + + host = gnutls_session_get_ptr(s); + if ((i = gnutls_certificate_verify_peers3(s, host, &status)) < 0) { + INFO_ERR("gnutls_certificate_verify_peers3() error: %s\n", gnutls_strerror(i)) + return GNUTLS_E_CERTIFICATE_ERROR; + } + if (status == 0) { + DEBUG_INFO("Certificate is OK, yep !!\n"); + return 0; + } else { + /*if (question_win("WARNING: Certificate is not trusted. Continue anyways ?") == YES) + return 0; + else + return GNUTLS_E_CERTIFICATE_ERROR;*/ + type = gnutls_certificate_type_get(s); + if ((i = gnutls_certificate_verification_status_print(status, type, &output, 0)) < 0) { + INFO_ERR("gnutls_certificate_verification_status_print() error: %s\n", + gnutls_strerror(i)) + return GNUTLS_E_CERTIFICATE_ERROR; + } + warning(M_S_MOD, "Certificate is not trusted\n%s", output.data); + gnutls_free(output.data); + return GNUTLS_E_CERTIFICATE_ERROR; + } +} + +/* + * Using GnuTLS session. + * TODO: Re-check everything, especially errno vs gnutls error codes + */ +#define FPRINTF_FFLUSH_2(a1, a2); {fprintf(a1, a2); fflush(a1);} +#define FPRINTF_FFLUSH_3(a1, a2, a3); {fprintf(a1, a2, a3); fflush(a1);} + +/* + * Return n bytes sent or (if < 0) some GNUTLS_E_ error. + */ +int tcp_tls_send_full(sockt sock, gnutls_session_t s, const char *str) +{ + int len = strlen(str), i, j = 0; + + while (writable_data_is_available_on_tcp_socket(sock) == SELECT_TRUE) { + if ((i = gnutls_record_send(s, str + j, len)) > 0) { + j += i; + len -= i; + if (len == 0) + break; + } else if (i == 0) { + if (len > 0) + VERBOSE_INFO_ERR("tcp_tls_send_full(): Not all bytes sent ?") + break; + } else if (i == GNUTLS_E_AGAIN || i == GNUTLS_E_INTERRUPTED) { + continue; + } else if (i == GNUTLS_E_REHANDSHAKE) { + /*INFO_ERR("Server requests TLS renegotiation\n")*/ + INFO_ERR("gnutls_record_send() error: %s\n", gnutls_strerror(i)) + j = i; + break; + } else { + INFO_ERR("gnutls_record_send() error: %s\n", gnutls_strerror(i)) + if (gnutls_error_is_fatal(i)) { + j = i; + break; + } + } + } + return j; +} + +/* + * Return response = tcp_tls_recv_full(socket, gnutls_session, &bytes_received, &status) + * or NULL if error. + * -> status = OK or CONNECTION_CLOSED_BY_SERVER or some GNUTLS_E_ error. + * -> allocate memory for response (must be freed afterwards with free2() if != NULL). + */ +char *tcp_tls_recv_full(sockt sock, gnutls_session_t s, int *bytes_received, int *status) +{ + char *response, *full_response; + int i; + + *bytes_received = 0; + response = malloc2(TLS_RECV_CHUNK_LEN + 1); + response[0] = '\0'; + full_response = l_str_new(response); + while (readable_data_is_available_on_tcp_socket(sock) == SELECT_TRUE) { + if ((i = gnutls_record_recv(s, response, TLS_RECV_CHUNK_LEN)) > 0) { + response[MIN(i, TLS_RECV_CHUNK_LEN)] = '\0'; + full_response = l_str_cat(full_response, response); + *bytes_received += i; + *status = OK; + } else if (i == 0) { /* EOF */ + if (gnutls_record_check_pending(s) == 0) { + *status = OK; + break; + } + } else if (i == GNUTLS_E_AGAIN || i == GNUTLS_E_INTERRUPTED) { + continue; + } else { + INFO_ERR("gnutls_record_recv() error: %s\n", + gnutls_strerror(i)) + if (gnutls_error_is_fatal(i)) { + *status = i; + l_str_free(full_response); + full_response = NULL; + break; + } + } + } + free2(response); + return full_response; +} diff -Nru tickr-0.6.4/src/tickr/tickr_tls.h tickr-0.7.0/src/tickr/tickr_tls.h --- tickr-0.6.4/src/tickr/tickr_tls.h 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/src/tickr/tickr_tls.h 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * TICKR - GTK-based Feed Reader - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 + * + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef INC_TICKR_TLS_H +#define INC_TICKR_TLS_H + +#define REQUIRED_GNUTLS_V_NUM 0x030109 +#define REQUIRED_GNUTLS_V_NUM_STR "3.1.9" + +#define TLS_RECV_CHUNK_LEN RECV_CHUNK_LEN /* In libetm-0.5.0/tcp_socket.h */ + +gnutls_session_t *get_tls_session(); +gnutls_certificate_credentials_t *get_tls_cred(); +int tls_connect(gnutls_session_t *, gnutls_certificate_credentials_t *, + const sockt *, const char *, const char *); +void tls_disconnect(gnutls_session_t *, gnutls_certificate_credentials_t *, + const char *); +int verif_cert_callback(gnutls_session_t); +int tcp_tls_send_full(sockt, gnutls_session_t, const char *); +char *tcp_tls_recv_full(sockt, gnutls_session_t, int *, int *); +#endif /* INC_TICKR_TLS_H */ diff -Nru tickr-0.6.4/tickr.1 tickr-0.7.0/tickr.1 --- tickr-0.6.4/tickr.1 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/tickr.1 2020-05-31 19:46:20.000000000 +0000 @@ -1,12 +1,20 @@ -.TH TICKR 1 "May 23, 2013" +.TH TICKR 1 "May 31, 2020" .SH NAME .B Tickr - GTK-based highly graphically-customizable Feed Ticker. .SH SYNOPSIS .B tickr -[\-help/\-version/\-license/\-instance\-id=n/\-no\-ui/\-dumpfontlist] +[\-help, \-h, \-? / \-version, \-v / \-license, \-l] .br -[options (\-name[=value])...] [resource (file name or URL)] +[\-dumpfontlist / \-dumpconfig / \-dumperrorcodes] +.br +[\-instance\-id=n / \-no\-ui] +.br +[\-connect\-timeout=n / \-sendrecv\-timeout=n] +.br +[options (\-name[=value])...] +.br +[resource (URL or file name)] .SH DESCRIPTION .B Tickr is a GTK-based RSS/Atom Reader that displays feeds as a smooth @@ -23,6 +31,15 @@ .B license Print out license .TP +.B dumpfontlist +Send list of available fonts to stdout +.TP +.B dumpconfig +Send content of config file to stdout +.TP +.B dumperrorcodes +Send error codes and strings to stdout +.TP .B instance\-id=n n = 1 to 99 - Use this when launching several instances simultaneously, each instance using its own config and dump files (to be effective, @@ -30,19 +47,26 @@ .TP .B no\-ui Disable opening of UI elements which can modify settings and/or URL -list/selection +list/selection (to be effective, no\-ui must be the 1st or 2nd argument) .TP -.B dumpfontlist -Send list of available fonts to stdout +.B \-connect\-timeout=n +n = 1 to 60 (seconds) - Override default connect timeout value +(= 5 seconds), useful if proxy or slow internet link +.TP +.B \-sendrecv\-timeout=n +Same as above for send/recv timeout (default value = 1 second) .TP .B delay=n -Delay in milliseconds +Delay in milliseconds (-> speed = K / delay) .TP .B shiftsize=n -Shift size in pixels +Shift size in pixels (-> speed = K x shift size) .TP .B fgcolor=#rrggbbaa Foreground 32-bit hexa color +#.TP +#.B highlightfgcolor=#rrggbbaa +#Marked items foreground 32-bit hexa color .TP .B bgcolor=#rrggbbaa Background 32-bit hexa color @@ -60,7 +84,7 @@ Font size (can't be > 200) .TP .B disablescreenlimits=[y/n] -Allow win_y and win_w to be greater than screen dimensions +Allow win_x, win_y and win_w to be greater than screen dimensions .TP .B win_x=n Window position - x @@ -80,6 +104,9 @@ .B alwaysontop=[y/n] Window always-on-top .TP +.B fullscreen=[y/n] +Fullscreen mode (experimental) +.TP .B wintransparency=n Actually window opacity from 1 to 10 (0 = none -> 10 = full) .TP @@ -104,9 +131,6 @@ .B linedelimiter='str' String to be appended at end of line .TP -.B cutlinedelimiter='str' -String to be appended after a cut line -.TP .B specialchars=[y/n] Enable or disable special characters. This is only useful when resource is a file, not an URL @@ -118,7 +142,14 @@ \'Tab' (8 spaces) special character .TP .B rssrefresh=n -Refresh rate in minutes (if no TTL inside feed / always applies for files) +Refresh rate in minutes = delay before reloading resource (URL or text +file.) 0 = never force reload. Otherwise, apply only if no TTL inside +feed or if resource is text file. +(Actually, in multiple selections mode, all feeds are always reloaded +sequentially, because there is no caching involved) +.TP +.B revsc=[y/n] +Reverse scrolling (= L to R) .TP .B feedtitle=[y/n] Show or hide feed title @@ -139,7 +170,10 @@ String to be appended after item description .TP .B nitemsperfeed=n -Read N items max per feed +Read N items max per feed (0 = no limit) +#.TP +#.B markitemaction=[h/c/n] +#Mark item action: hide / color / none .TP .B rmtags=[y/n] Strip html tags @@ -161,11 +195,20 @@ .B clock=[l/r/n] Clock location: left / right / none .TP +.B clocksec=[y/n] +Show seconds +.TP +.B clock12h=[y/n] +12h time format +.TP +.B clockdate=[y/n] +Show date +.TP .B clockfontname='fontname' Clock font name .TP .B clockfontsize=n -Clock font size (can't be > ticker height) +Clock font size (can't be > Tickr height) .TP .B clockfgcolor=#rrggbbaa Clock foreground 32-bit hexa color @@ -183,18 +226,18 @@ Disable error/warning popup windows .TP .B pauseonmouseover=[y/n] -Pause ticker on mouseover +Pause Tickr on mouseover .TP .B disableleftclick=[y/n] Disable left-click .TP -.B mousewheelscroll=[s/f/n] -Mouse wheel scrolling applies to: (ticker\-)speed / feed(\-in\-list) / none +.B mousewheelaction=[s/f/n] +Mouse wheel acts on: (Tickr\-)speed / feed(\-in\-list) / none .br -(if set, Ctrl + mouse wheel scrolling applies to other value) +(use \ + mouse wheel for alternative action) .TP -.B sfpickercloseswhenpointerleaves=[y/n] -Selected feed picker closes when pointer leaves +.B sfeedpickerautoclose=[y/n] +Selected feed picker window closes when pointer leaves area .TP .B enablefeedordering=[y/n] Enable feed re-ordering (by user) @@ -228,7 +271,7 @@ .SH NOTES Mouse usage: .PP -- To open the main menu, right-click inside ticker area. +- To open the main menu, right-click inside Tickr area. .PP - You can import feed subscriptions from another feed reader with .br @@ -236,15 +279,23 @@ .PP - To open a link in your browser, left-click on text. .PP -- Use mouse wheel to either adjust ticker scrolling speed or open the +- Use mouse wheel to either adjust Tickr scrolling speed or open the \'Selected Feed Picker' window to quickly move between selected feeds -(and use Ctrl + mouse wheel for the other option.) +(use \ + mouse wheel for alternative action.) +.PP +Local resources: +.PP +- file:///path/file_name is considered an URL and will be XML-parsed, ie +a RSS or Atom format is expected. +.PP +- /path/file_name will be processed as a non-XML text file, ie the file +will be read 'as is'. .PP -The default browser is Firefox. You may change this setting to your favourite -one in the Preferences window. +You can set your favourite browser in the Full Settings window. Otherwise, +the system default one will be looked for. .PP Tickr parses command line arguments and looks for option(s) then for one -resource, the rest of the line is ignored. It reads too configuration file +resource, the rest of the line is ignored. It also reads configuration file \'tickr-conf' located in /home//.tickr/ if it exists (or \'tickr-conf' if an instance id has been set to n.) See FILES. .PP diff -Nru tickr-0.6.4/tickr.desktop tickr-0.7.0/tickr.desktop --- tickr-0.6.4/tickr.desktop 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/tickr.desktop 2020-05-31 19:46:20.000000000 +0000 @@ -7,5 +7,5 @@ Icon=/usr/share/tickr/pixmaps/tickr-icon.xpm Exec=/usr/bin/tickr Comment=GTK-based highly graphically-customizable Feed Ticker -Categories=GNOME;GTK;Network;News +Categories=GTK;Network;News; Name[en_US]=Tickr - Feed Reader diff -Nru tickr-0.6.4/tickr-feed-list.opml tickr-0.7.0/tickr-feed-list.opml --- tickr-0.6.4/tickr-feed-list.opml 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/tickr-feed-list.opml 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,52 @@ + + + + Tickr Feed List + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru tickr-0.6.4/tickr-url-list tickr-0.7.0/tickr-url-list --- tickr-0.6.4/tickr-url-list 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/tickr-url-list 2020-05-31 19:46:20.000000000 +0000 @@ -1,32 +1,46 @@ +- 0http://communities-dominate.blogs.com/brands/atom.xml>Communities Dominate Brands - 0http://feeds.arstechnica.com/arstechnica/index>Ars Technica -- 0http://feeds.feedburner.com/d0od>Omg! Ubuntu! +- 0http://feeds.feedburner.com/d0od>OMG! Ubuntu! +- 0http://feeds.feedburner.com/linuxquestions/lqnews>LinuxQuestions.org - Linux - News - 0http://feeds.feedburner.com/ubuntu-news?format=xml>Ubuntu Fridge -- 0http://feeds.finance.yahoo.com/rss/2.0/category-stocks?region=US&lang=en-US>Yahoo! Finance: Stocks News +- 0http://feeds.finance.yahoo.com/rss/2.0/headline?s=yhoo®ion=US&lang=en-US>Yahoo! Finance: YHOO News +* 0http://feeds.reuters.com/Reuters/worldNews>Reuters: World News +* 0http://news.google.com/news?cf=all&hl=en&pz=1k&output=rss +* 0http://news.yahoo.com/rss/world>World News Headlines - Yahoo News - 0http://newsrss.bbc.co.uk/rss/newsonline_world_edition/business/rss.xml>BBC News - Business * 0http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml>BBC News - Home -* 0http://newsrss.bbc.co.uk/rss/newsonline_world_edition/science/nature/rss.xml>BBC News - Science & Environment -* 0http://newsrss.bbc.co.uk/rss/newsonline_world_edition/technology/rss.xml>BBC News - Technology -- 0http://newsrss.bbc.co.uk/rss/sportonline_world_edition/motorsport/formula_one/rss.xml>BBC Sport | Motorsport | Formula 1 | World Edition -- 0http://nyt.hs.fi/rss>Nyt -- 0http://planet.debian.net/rss20.xml>Planet Debian +- 0http://newsrss.bbc.co.uk/rss/newsonline_world_edition/science/nature/rss.xml>BBC News - Science & Environment +- 0http://newsrss.bbc.co.uk/rss/newsonline_world_edition/technology/rss.xml>BBC News - Technology +- 0http://newsrss.bbc.co.uk/rss/sportonline_world_edition/motorsport/formula_one/rss.xml>BBC Sport - Formula 1 +- 0http://planet.debian.org/rss20.xml>Planet Debian - 0http://planet.ubuntu.com/rss20.xml>Planet Ubuntu -- 0http://rss.cnn.com/rss/edition.rss>CNN.com -- 0http://rss.slashdot.org/Slashdot/slashdot>Slashdot +* 0http://rss.cnn.com/rss/edition.rss>CNN.com - RSS Channel - Intl Homepage - News +- 0http://rss.cnn.com/rss/money_markets.rss>Latest stock market news from Wall Street - CNNMoney.com +- 0http://rss.cnn.com/rss/money_technology.rss>Technology news - CNNMoney.com +- 0http://rss.cnn.com/rss/money_topstories.rss>Business and financial news - CNNMoney.com +* 0http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml>NYT > Home Page +* 0http://rss.slashdot.org/Slashdot/slashdot>Slashdot - 0http://rss.weather.com/rss/national/rss_nwf_rss.xml?cm_ven=NWF&cm_cat=rss&par=NWF_rss>The Weather Channel: National Weather Outlook -- 0http://static.feed.rbc.ru/rbc/logical/rbcdaily.ru/daily.rss>РБК daily - последний выпуск +- 0http://static.feed.rbc.ru/rbc/logical/rbcdaily.ru/daily.rss>газета РБК - последний выпуск - 0http://tuxmobil.org/tuxmobil_rss.rdf>TuxMobil - 0http://www.aamulehti.fi/cs/Satellite?c=AMChannelFeed_C&cid=1194596264225&p=1194596117294&pagename=KAL_newssite%2FAMChannelFeed_C%2FAMArticleFeedIngressRSS20>Aamulehden uutiset -- 0http://www.france24.com/fr/monde/rss>Info, news & actualité, information internationale en direc -- 0http://www.guardian.co.uk/news/blog/rss>News: News blog | guardian.co.uk +- 0http://www.france24.com/fr/monde/rss>A la une – France 24 - L’Actualité Internationale 24h/2 - 0http://www.hs.fi/uutiset/rss/>Uutiset - HS.fi +- 0http://www.iltalehti.fi/rss/uutiset.xml>Iltalehti.fi tuoreimmat uutiset - 0http://www.nasa.gov/rss/breaking_news.rss>NASA Breaking News -- 0http://www.nasa.gov/rss/shuttle_station.rss>Space Shuttle and International Space Station News -- 0http://www.nasdaq.com/aspxcontent/NasdaqRSS.aspx?data=quotes&symbol=IBM&symbol=GOOG&symbol=YAHO>NASDAQ.com Stock Tracker +* 0http://www.nasa.gov/rss/shuttle_station.rss>Space Station News +- 0http://www.nasdaq.com/aspxcontent/NasdaqRSS.aspx?data=quotes&symbol=GOOG>NASDAQ.com Stock Tracker +- 0http://www.nasdaq.com/aspxcontent/NasdaqRSS.aspx?data=quotes&symbol=IBM>NASDAQ.com Stock Tracker - 0http://www.nasdaq.com/aspxcontent/NasdaqRSS.aspx?data=uvup>Stocks Up on Unusual Volume - 0http://www.nytimes.com/services/xml/rss/nyt/International.xml>NYT > World - 0http://www.rususa.com/tools/rss/feed.asp-rss-newsrus>RusUSA.com News: News in Russian -- 0http://www.ts.fi/online/rss.xml>Turun Sanomat - Uutiset - RSS -- 0http://www.tv5.org/TV5Site/rss/actualites.php?rub=12>TV5.org info - Nouvelles technologies -- 0http://www.tv5.org/TV5Site/rss/actualites.php?rub=14>TV5.org info - Science/environnement -- 0http://www.tv5.org/TV5Site/rss/actualites.php?rub=2>TV5.org info - Monde -- 0http://www.tv5.org/TV5Site/rss/actualites.php?rub=7>TV5.org info - Economie/finances +- 0http://www.theguardian.com/world/rss/>World news | The Guardian +- 0http://www.ts.fi/online/rss.xml>Etusivu - Turun Sanomat - RSS +- 0http://www.tv5.org/TV5Site/rss/actualites.php?rub=12>TV5MONDE info - Nouvelles technologies +- 0http://www.tv5.org/TV5Site/rss/actualites.php?rub=14>TV5MONDE info - Science/environnement +- 0http://www.tv5.org/TV5Site/rss/actualites.php?rub=2>TV5MONDE info - Monde +- 0http://www.tv5.org/TV5Site/rss/actualites.php?rub=7>TV5MONDE info - Economie/finances +- 0http://www.ynet.co.il/Integration/StoryRss2.xml>ynet - חדשות +- 0https://news.yahoo.com/rss/world>World News Headlines - Yahoo News +- 0https://www.eff.org/rss/updates.xml>Deeplinks +* 0http://news.google.com/news?cf=all&hl=en&pz=1k&output=rss diff -Nru tickr-0.6.4/TODO tickr-0.7.0/TODO --- tickr-0.6.4/TODO 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/TODO 2020-05-31 19:46:20.000000000 +0000 @@ -1,55 +1,106 @@ bug list -------- -- remaining 1 pixel wide line when enabling then disabling left clock - -> WTF ? +(not a bug) +- -win_x not working BUT seems to actually relate to window manager: + win_x > 0 is only effective when win_w < screen_w (ie the window can + only be located 'within' the screen) -- item title and description both uncheked -> do sth ? +- "an apostrophe in the RSS source truncates the ticker after the apostrophe, + and it begins again from the beginning. See https://youtu.be/l9r9kBv24GE?t=3m42s" + -> was in some beta version, seems fixed now for ''' - is it ? -- how to prevent libxml2 segfaults ? +- setting wins -> OK ???? + - unsaved changes will be lost -> stay, continue without saving, or + save and continue + - test if changes have been made + - reset in single selection mode doesn't apply + - some setting changes not detected, nor re-computed + -> clock width changes with not-padded hours from 9 to 10 and 12 to 1 -- previous/next feed - already-first/last-feed warning seems buggy +- optimize processing time of 'big' text files -stuff to implement and requests for new features ------------------------------------------------- +stuff to implement and new features requests +-------------------------------------------- -- add things to quicksetup: keyboard and mouse things, ? +- implement dual licensing: paid licenses for commercial use ???? -- new options: +- make end-of-feed-blank-line a setting (alternative = str) - - pause scrolling for n seconds for each item -> -pauseeach=n +- run socket code in a separate thread (asynchronously) ? or use + g_timeout_add() and g_idle_add() when loading a feed, to avoid gui + blocking ? - - remove clicked items from feed -> -rmclickeditems=[y/n] +- find best practice - should new URL replace original URL in case of + HTTP redirects ? + -> tickr_feedpicker.c: add/upd with redirects -> what to do ? should + keep if moved is not tmp - - read from stdin -> -text="" +- should 'overrideredirect' option be set only from CLI ? - - sound alerts -> -allowsoundalerts=[y/n] +- a few alternate encodings support (internally converted) ? - - read n times then exit -> -nread=n +- read from stdin -> -text="" ? + -> echo "hello" > msg_file && tickr msg_file - - read all then show all -> -readallthenshowall=[y/n] +- polish prefs/full settings -> what about font size <-> tickr height ? - this is a better alternative to feed delimiter setting -> - make a new feed from all selected feeds (kind of new reading mode) +- editable feed title -- https support (ssl/tls) +- need sth really convenient to go to prev/next feed -- can gdk/cairo frame drawing be synced with vsync ? +- new clock delimiter setting -- split tickr_main.c (too big now) in 2 or more modules ? +- marked items stuff -> FeedLinkAndOffset - highlight keywords ? -- check/setup default answer for question_win() +- wait for scrolling to complete before reloading feed (ie queue + reloading) -- add 'open feed picker' after getting sample list +- outline text -- run socket code in a separate thread (asynchronously) ? or use - g_timeout_add() and g_idle_add() when loading a feed, to avoid gui - blocking ? +- new way of handling CLI args: "-revsc" = "-revsc=DEFAULT_VALUE" - translations (finnish, french, german, spanish, russian, chinese, japanese, ?) +- split tickr_main.c (too big & a mess now) in 2 or more modules. + +- what about: new expandable dynamic arrays in libetm ? + -> mainly useful for array of 'big' elements + +- move FList from tickr_list.c/h to libetm: dl_list.c/h (generic + double-linked lists) + +- what about: read all then show all -> -readallthenshowall=[y/n] ? + + is this a better alternative to feed delimiter setting -> + make a new feed from all selected feeds (kind of new reading mode) ? + +- no win32 drive letter in file:/// URL + +- new -attop -attop+=n -atbottom -atbottom-=n CLI options + +- -no-ui option should include preventing users to close the program + +- new -conffile=FILE CLI option + +-- + +- timeout to check network connectivity ? + +-- + +- some caching mecanism ? + +- ability to disable feed item tooltip + +- add some plugin-able stuff + +- hide tickr on mouseover (????) -> on + mouseover + +- add 'feed organizer' after getting sample list + - update this: question at program start-up about new feed list format conversion: if version = 0.6.2 and feed list exists and feed list backup doesn't @@ -61,12 +112,16 @@ - search/filter feature (option to filter out feed items on str, publication date, ...) +- add things to quicksetup: keyboard and mouse things, ? + +- can gdk/cairo frame drawing be synced with vsync ? + (nothing decided yet) -- is it worth switching to gtk3 ? +- new option 'disable right-click' ???? not sure yet -- color-coded feeds +- is it worth switching to gtk3 ? - implement digest access authentication @@ -78,6 +133,8 @@ - handles to drag window -- backward scrolling +- pause scrolling for n seconds for each item -> -pauseeach=n + +- sound alerts -> -allowsoundalerts=[y/n] -- time format settings +- read n times then exit -> -nread=n diff -Nru tickr-0.6.4/win32_install_stuff/build-win32-installer tickr-0.7.0/win32_install_stuff/build-win32-installer --- tickr-0.6.4/win32_install_stuff/build-win32-installer 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/win32_install_stuff/build-win32-installer 2020-05-31 19:46:20.000000000 +0000 @@ -5,20 +5,21 @@ BIN_DIR="tickr-win32-bin" IMAGES_DIR="../../images" WIN32_INSTALL_STUFF_DIR="../../win32_install_stuff" +GTK_RUNTIME_DIR="../../gtk2-win32-full-runtime" DLLS_DIR=$WIN32_INSTALL_STUFF_DIR"/dlls" TXT_FILES_DIR="../.." -GTK_RUNTIME_DIR="../../gtk2-win32-full-runtime" cp $IMAGES_DIR/tickr-icon.ico ./ -/usr/local/reshack/reshacker.exe -add tickr.exe, tickr.exe, tickr-icon.ico, ICONGROUP, TICKRICON, +c:/program\ files/ResHack/reshacker.exe -add tickr.exe, tickr.exe, tickr-icon.ico, ICONGROUP, TICKRICON, rm tickr-icon.ico mkdir -p $BIN_DIR -cp -r $GTK_RUNTIME_DIR/* $BIN_DIR/ -cp -r $GTK_RUNTIME_DIR/*.* $BIN_DIR/ cp tickr.exe $BIN_DIR/ cp $IMAGES_DIR/tickr-*.png $BIN_DIR/ +cp -r $GTK_RUNTIME_DIR/* $BIN_DIR/ cp $DLLS_DIR/*.dll $BIN_DIR/ cp $DLLS_DIR/*.dll.a $BIN_DIR/ +cp -r $DLLS_DIR/libgnutls-win32/* $BIN_DIR/ +cp -r $DLLS_DIR/libfribidi-win32/* $BIN_DIR/ cp $WIN32_INSTALL_STUFF_DIR/LICENSE $BIN_DIR/ cp $TXT_FILES_DIR/COPYING $BIN_DIR/ cp $TXT_FILES_DIR/README $BIN_DIR/ diff -Nru tickr-0.6.4/win32_install_stuff/installer.iss tickr-0.7.0/win32_install_stuff/installer.iss --- tickr-0.6.4/win32_install_stuff/installer.iss 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/win32_install_stuff/installer.iss 2020-05-31 19:46:20.000000000 +0000 @@ -7,26 +7,26 @@ ; previous app id (for News): AppId={{4C30F291-1B7B-4E53-AB2E-8F515B8F99E5} AppId={{A3E7BF61-5796-451F-8DC4-753E4BA6B048} AppName=Tickr -AppVersion=0.6.4 -;AppVerName=Tickr 0.6.4 +AppVersion=0.7.0 +;AppVerName=Tickr 0.7.0 AppPublisher=ETMSoftware -AppPublisherURL=http://www.newsrssticker.com -AppSupportURL=http://www.newsrssticker.com -AppUpdatesURL=http://www.newsrssticker.com +AppPublisherURL=http://www.open-tickr.net/ +AppSupportURL=http://www.open-tickr.net/help.php +AppUpdatesURL=http://www.open-tickr.net/download.php DefaultDirName={pf}\Tickr DisableDirPage=no DefaultGroupName=Tickr DisableProgramGroupPage=no -LicenseFile=C:\MinGW\msys\1.0\home\manutm\src\tickr-0.6.4\win32_install_stuff\LICENSE -OutputDir=C:\Documents and Settings\manutm\Bureau\binaries -OutputBaseFilename=Tickr-0.6.4-Setup -SetupIconFile=C:\MinGW\msys\1.0\home\manutm\src\tickr-0.6.4\images\tickr-icon.ico +LicenseFile=C:\MinGW\msys\1.0\home\manutm\src\tickr-0.7.0\win32_install_stuff\LICENSE +OutputDir=C:\Users\manutm\Desktop\binaries +OutputBaseFilename=Tickr-0.7.0-Setup +SetupIconFile=C:\MinGW\msys\1.0\home\manutm\src\tickr-0.7.0\images\tickr-icon.ico Compression=lzma SolidCompression=yes [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" -Name: "basque"; MessagesFile: "compiler:Languages\Basque.isl" +; (not available in new version) Name: "basque"; MessagesFile: "compiler:Languages\Basque.isl" Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl" Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl" Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl" @@ -43,21 +43,21 @@ Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl" Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl" Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" -Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl" +; (not available in new version) Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl" Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl" Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl" [Tasks] -Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 [Files] -Source: "C:\MinGW\msys\1.0\home\manutm\src\tickr-0.6.4\src\tickr\tickr-win32-bin\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\MinGW\msys\1.0\home\manutm\src\tickr-0.7.0\src\tickr\tickr-win32-bin\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] Name: "{group}\Tickr"; Filename: "{app}\tickr.exe" -Name: "{group}\{cm:ProgramOnTheWeb,Tickr}"; Filename: "http://www.newsrssticker.com" +Name: "{group}\{cm:ProgramOnTheWeb,Tickr}"; Filename: "http://www.open-tickr.net" Name: "{group}\{cm:UninstallProgram,Tickr}"; Filename: "{uninstallexe}" Name: "{commondesktop}\Tickr"; Filename: "{app}\tickr.exe"; Tasks: desktopicon Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Tickr"; Filename: "{app}\tickr.exe"; Tasks: quicklaunchicon diff -Nru tickr-0.6.4/win32_install_stuff/LICENSE tickr-0.7.0/win32_install_stuff/LICENSE --- tickr-0.6.4/win32_install_stuff/LICENSE 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/win32_install_stuff/LICENSE 2020-05-31 19:46:20.000000000 +0000 @@ -1,6 +1,6 @@ ====== TICKR LICENSE ====== -Tickr version 0.6.4 - Copyright (C) Emmanuel Thomas-Maurin 2009-2013 +Tickr version 0.7.0 - Copyright (C) Emmanuel Thomas-Maurin 2009-2020 Tickr is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru tickr-0.6.4/win32_install_stuff/Makefile-libetm-win32 tickr-0.7.0/win32_install_stuff/Makefile-libetm-win32 --- tickr-0.6.4/win32_install_stuff/Makefile-libetm-win32 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/win32_install_stuff/Makefile-libetm-win32 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -# Makefile for libetm-0.4.4 - win32 version - -src = str_mem.c error.c misc.c win32_specific.c -obj = $(src:.c=.o) -headers = libetm.h $(src:.c=.h) - -CC = gcc - -CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ - -ffast-math -pedantic -DWIN32_V - -all: libetm.a - -$(obj): $(src) $(headers) Makefile - $(CC) $(CFLAGS) -c $(src) - -libetm.a: $(obj) - ar -r libetm.a $(obj) - -.PHONY: install -install: - mkdir -p /usr/local/include/libetm - cp $(headers) /usr/local/include/libetm/ - cp libetm.a /usr/local/lib/ - -.PHONY: clean -clean: - rm $(obj) libetm.a diff -Nru tickr-0.6.4/win32_install_stuff/Makefile-tickr-win32 tickr-0.7.0/win32_install_stuff/Makefile-tickr-win32 --- tickr-0.6.4/win32_install_stuff/Makefile-tickr-win32 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/win32_install_stuff/Makefile-tickr-win32 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -# Makefile for TICKR - GTK-based Feed Reader - win32 version - -src = tickr_main.c tickr_resource.c tickr_render.c tickr_params.c\ - tickr_clock.c tickr_feedparser.c tickr_list.c tickr_feedpicker.c\ - tickr_prefwin.c tickr_otherwins.c tickr_misc.c tickr_helptext.c\ - tickr_opml.c tickr_http.c tickr_socket.c tickr_connectwin.c\ - tickr_quickfeedpicker.c tickr_quicksetup.c tickr_check4updates.c - -obj = $(src:.c=.o) - -CC = gcc - -CFLAGS = -O2 -Wall -Wextra -Wunused-parameter -Wshadow -Wpointer-arith\ - -ffast-math -pedantic `pkg-config --cflags gtk+-2.0`\ - -I/usr/local/include/libxml2 -DWIN32_V - -LIBS = --mms-bitfields -mwindows -lwinmm -lrpcrt4 -liphlpapi -lws2_32\ - ../libetm-0.4.4/libetm.a `pkg-config --libs gtk+-2.0`\ - -static ../../win32_install_stuff/dlls/libxml2.dll.a - -all: tickr - -$(obj): $(src) tickr.h Makefile - $(CC) $(CFLAGS) -c $(src) - -tickr: $(obj) - $(CC) -o tickr $(obj) $(LIBS) - -.PHONY: clean -clean: - rm -f $(obj) tickr.exe diff -Nru tickr-0.6.4/win32_install_stuff/README_gui_font tickr-0.7.0/win32_install_stuff/README_gui_font --- tickr-0.6.4/win32_install_stuff/README_gui_font 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/win32_install_stuff/README_gui_font 2020-05-31 19:46:20.000000000 +0000 @@ -1,2 +1,2 @@ -To change Tickr user interface font on Window (and also all GTK apps that -you may use), edit and copy .gtkrc-2.0 in 'C:\Documents and Settings\USER_NAME +To change Tickr user interface font on Windows (and also all GTK apps that +you may use), edit and copy .gtkrc-2.0 in 'C:\Documents and Settings\USER_NAME\' diff -Nru tickr-0.6.4/win32_install_stuff/README_required_dlls tickr-0.7.0/win32_install_stuff/README_required_dlls --- tickr-0.6.4/win32_install_stuff/README_required_dlls 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/win32_install_stuff/README_required_dlls 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,15 @@ +dlls to be copied here (win32_install_stuff/) + +=== libxml2-2.dll.a version 2.7.8 === +from http://xmlsoft.org/sources/win32/libxml2-2.7.8.win32.zip +also need to copy libxml2-2.7.8.win32 to C:/MinGW/msys/1.0/home/manutm/src/ + +=== libglib-2.0-0.dll === +glib-2.26.0 patched to use timeGetTime() instead of +GetSystemTimeAsFileTime() in order to get a much better highest resolution +value +-> from 15 ms to a few ms + +=== libgnutls-win32/* === +gnutls-3.4.1-w32 +(from ftp://ftp.gnutls.org/gcrypt/gnutls/w32/) diff -Nru tickr-0.6.4/win32_install_stuff/required_dlls tickr-0.7.0/win32_install_stuff/required_dlls --- tickr-0.6.4/win32_install_stuff/required_dlls 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/win32_install_stuff/required_dlls 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -libxml2-2.dll.a version 2.7.8 diff -Nru tickr-0.6.4/xlib_stuff/test_x_pixmap_max_width.c tickr-0.7.0/xlib_stuff/test_x_pixmap_max_width.c --- tickr-0.6.4/xlib_stuff/test_x_pixmap_max_width.c 1970-01-01 00:00:00.000000000 +0000 +++ tickr-0.7.0/xlib_stuff/test_x_pixmap_max_width.c 2020-05-31 19:46:20.000000000 +0000 @@ -0,0 +1,99 @@ +/* + * Trying to determine max width of a X pixmap. If signed 16-bit int, + * should be 32767. + * + * Copyright (C) Emmanuel Thomas-Maurin 2016-2020 + * + * Compile with: gcc -o test_x_pixmap_max_width test_x_pixmap_max_width.c -lX11 + */ + +#include +#include +#include +#include +#include + +#define FPRINTF(...) \ + {fprintf(stdout, __VA_ARGS__); fflush(stdout);} + +int main(int argc, char *argv[]) +{ + Display *displ; + int screen_num; + Window win; + GC gc; + Pixmap pixmap; + unsigned int width; + unsigned int height; + unsigned int depth; + char *displ_name = getenv("DISPLAY"); + struct timespec tm_req, tm_rem; + int i, j; + + if ((displ = XOpenDisplay(displ_name)) != NULL) { + screen_num = DefaultScreen(displ); + + win = XCreateSimpleWindow( + displ, RootWindow(displ, screen_num), + 0, 0, 400, 200, 2, + BlackPixel(displ, screen_num), + WhitePixel(displ, screen_num)); + + FPRINTF("=== Trying to determine max width of a X pixmap ===\n\n" + "XCreatePixmap() is supposed to use unsigned int for width and height but it\n" + "actually uses signed 16-bit int, and this can be verified by creating pixmaps\n" + "of variable width in loop and see what happens.\n\n" + "-> If signed 16-bit int, last valid width should be 32767, and any value above\n" + "that should trigger an error - So let's try\n\n"); + + height = 50; + depth = DefaultDepth(displ, screen_num); + + FPRINTF("Will create pixmap: variable width, height = %d, depth = %d\n" + "Press to proceed\n", + height, depth); + fgetc(stdin); + + XMapWindow(displ, win); + XSync(displ, False); + + width = 0; + j = 0; + tm_req.tv_sec = 0; + tm_req.tv_nsec = 10000000; + + for (i = 1; i < 2000; i++) { + if (width < 32750 || width > 32780) + width = i * 50; + else { + width++; + i = (32780 / 50) + 1; + } + + FPRINTF("\rwidth = %d --- ", width) + + pixmap = XCreatePixmap(displ, RootWindow(displ, screen_num), width, height, depth); + gc = XCreateGC(displ, pixmap, 0, NULL); + XSetForeground(displ, gc, BlackPixel(displ, screen_num)); + XFillRectangle(displ, pixmap, gc, 0, 0, width, height); + XClearArea(displ, win, 0, 0, 400, 200, False); + XCopyArea(displ, pixmap, win, gc, 0, 0, 200, 50, 25 * j / 4, 25 * j / 4); + if (++j > 32) + j = 0; + XMapWindow(displ, win); + XFlush(displ); + XMoveWindow(displ, win, 1000, 0); + nanosleep(&tm_req, &tm_rem); + + XFreePixmap(displ, pixmap); + XFreeGC(displ, gc); + XSync(displ, False); + } + FPRINTF("\n") + return 0; + } else { + fprintf(stderr, "%s: Can't connect to X server '%s'\n", + argv[0], displ_name); + return 1; + } +} diff -Nru tickr-0.6.4/xlib_stuff/win-config.c tickr-0.7.0/xlib_stuff/win-config.c --- tickr-0.6.4/xlib_stuff/win-config.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/xlib_stuff/win-config.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,4 +1,5 @@ -/* (Re)Configure xwin +/* + * (Re)Configure xwin * Compile with: gcc -o win-config win-config.c -lX11 */ diff -Nru tickr-0.6.4/xlib_stuff/xlib-prog.c tickr-0.7.0/xlib_stuff/xlib-prog.c --- tickr-0.6.4/xlib_stuff/xlib-prog.c 2013-05-23 15:01:28.000000000 +0000 +++ tickr-0.7.0/xlib_stuff/xlib-prog.c 2020-05-31 19:46:20.000000000 +0000 @@ -1,4 +1,5 @@ -/* Very basic xlib prog +/* + * Very basic xlib prog * Compile with: gcc -o xlib-prog xlib-prog.c -lX11 */ @@ -28,12 +29,15 @@ displ_w = DisplayWidth(displ, screen_num); displ_h = DisplayHeight(displ, screen_num); - win_w = displ_w / 2; - win_h = displ_h / 2; win_x = displ_w / 4; win_y = displ_h / 4; + win_w = displ_w / 2; + win_h = displ_h / 2; win_border_w = 2; + fprintf(stdout, "win_x = %d, win_y = %d, win_w = %d, win_h = %d\n", + win_x, win_y, win_w, win_h); + win = XCreateSimpleWindow( displ, RootWindow(displ, screen_num), win_x, win_y, win_w, win_h, win_border_w, @@ -43,6 +47,10 @@ XMapWindow(displ, win); XSync(displ, False); + /* Need this to get the correct win position */ + XMoveWindow(displ, win, win_x, win_y); + XSync(displ, False); + sleep(5); XCloseDisplay(displ); return 0;