fim-0.6-rc2/0000755000175000017500000000000014503655327007631 500000000000000fim-0.6-rc2/BUGS0000644000175000017500000001422614454347341010240 00000000000000$LastChangedDate: 2015-01-31 17:25:11 +0100 (Sat, 31 Jan 2015) $ ==== BUG REPORTING For sending a bug report, please drop me an email with a subject line beginning with '[FIM]'. Contact information is in the doc/FIM.TXT file, or in the bottom of this file. Please DO NOT dare sending bug reports about installation unless you have read the INSTALL file and you are sure all the dependencies on your system have been resolved. For example "[FIM] problems with resolution 457x3778" would be a good, informative subject for me. When submitting a bug report, please follow the following rules: - be as much informative as possible when describing your experience. - make a report about the current environment: ( make ; make report ) 2>&1 | gzip > fim.`date +%Y%m%d%H%M`.log.gz and send me the created .tgz file - please give me information about the exact way you experienced the problem - please give me information about the resolution/video mode you are working with; from the bash shell, execute the following and send me the output: ( for f in /sys/class/graphics/fb0/* ; do echo $f ; cat $f ; done ) - please send me the config.log file, too (especially if it is a build bug). it is of vital importance! (the config.log file is created by the configure script when you run the ./configure script) - if you are using an ad hoc method for installing (say, the ebuild for the Gentoo Linux ), consider sending the logfile created and named in the error messages. ==== CORE DEBUGGING Consider debugging with gdb or letting me do this for you! by running $ ulimit -S -c unlimited before Fim, in the case Fim should crash, it will generate a file called 'core'. That file, if sent to me (but contact me before sending, because it could be big!), will be helpful for debugging Fim and discover the causes of the crash. p.s.: please compile the code configuring in this way: ( use ./configure --help='-O0 -ggdb' ) and don't forget to send me the executable file, too :) ==== CONTACT You can mail your report to dezperado_FOobAr_autistici_Baz_org, by replacing _FOobAr_ with a '@' and _Baz_ with a '.'. ==== KNOWN BUGS 20150131 in aalib mode PageUp / PageDown do not seem to work. 20150123 When in framebuffer mode, never, for ANY reason, press C-z (^Z) with the intention of putting fim in the background. It will blind your console and allow only blind typing, which is a very dangerous situation! 20110603 Window splitting is disabled. ==== MINOR ISSUES 20091208 if fim is configured to take input from piped xfig (as xfig-3.2.5b), it could be - passively - subject to xfig's buffer overflow on files like: 0 1 2 3 4 1 2 3 4 5 6 7 ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ( see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559274 and http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=xfig_poc.f;att=1;bug=559274) As long as xfig (fig2dev) is accessed through the popen() system call, there will be no harm to fim from xfig crash. 20091015 In 16 bit graphics mode, some lines which should be white actually look blue (seems not fim' fault; happens on both on ARM and x86) 20091013 fim -i < file.pdf # does not work 20091009 fim does not support 1,2,4 bit modes 20090328 problems with --std=c++98 in legacy src/FbiStuffJpeg.cpp code (now commented) 20070919 while command suffers from being not interruptible in some cases (when the image is small and not 'panable') 20070912 Debugging it with the framebuffer under gdb hangs the console (even with -p). 20070904 problems could occur with the commands giving output when no std::cout << "" is returned soon after (see Commandconsole.cpp mehods for this..) 20071128 tried: Linux host 2.6.19-gentoo-r5 #1 SMP Mon Sep 24 15:08:36 CEST 2007 ppc 7447A, altivec supported PowerBook5,4 GNU/Linux and gave problems with the PAGE_MASK macro, originally in /linux/include/asm-i386/page.h :) 20080504 Seems like running the aalib driver under screen maps -3072 units down the arrow keys. I do not see this problem in aalib under ssh. 20080127 Under screen, Fim behaves well but it doesn't handle well console switching: after a console switch, it doesn't redraw the image if not triggered to do so. 20080106 keys 'Insert,Cancel' are not recognized in the commandline mode. This issue will be fixed after the fbi core will be cleaned up and revised. 20070811 On CENTOS 64 bit, i reported linking problems : -ltermcap is required, too. I Don't know exactly how to fix this issue. 2007* Bugs shared with fbi, not fully solved: - do not switch console or interrupt the program while it is busy: it could hang your console and force you to make tricks to get back the terminal (like typing blindly through consoles, or trying to get to some X instance via ALT-F7-like sequences, or even restart the computer), and blind typing could be dangerous, if you do now know what you are doing! ==== OUTSTANDING FIXED ISSUES 20110602 fim versions before svn version r373 segfault in 32 bit framebuffer mode, on 64 bit builds ==== FIXED FBI/FBGS ORIGINATING BUGS Replaced popen with pipe calls : http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422034, in rev. 213. Original typo in fbgsh : http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-3119 fixed following the patch indicated on http://bugs.gentoo.org/show_bug.cgi?id=141684 : -gs -dSAVER -dNOPAUSE -dBATCH +gs -dSAFER -dNOPAUSE -dBATCH It could let a PostScript file execute evil code, according to the advisory. ==== UNFIXED EXTERNALLY ORIGINATING BUGS 20090329 On my debian box's aalib, the ASCII art driver leaks 224 bytes of memory. Actually, it happens the same when compiling aalib-1.4.0's aafire.c program against debian aalib and running it in console mode (no X). After clean aalib recompilation, these problems vanish. ==== SOLVED ISSUES 20110712 in sdl (x11) mode, when fim is spawned in a non-terminal environment, the readline mode does not work in the proper way. detecting this situation may be helpful to disable the readline mode at all in these cases, until a readline-centric fix is found. (seems fixed with r688) fim-0.6-rc2/missing0000755000175000017500000001533614454352345011157 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://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 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: fim-0.6-rc2/configure.ac0000644000175000017500000023253614503403666012047 00000000000000dnl Process this file with autoconf to produce a configure script. dnl $LastChangedDate: 2023-09-22 23:31:34 +0200 (Fri, 22 Sep 2023) $ AC_PREREQ([2.69]) # we'll move forward, one day or another #AC_PREREQ([2.69]) # for future use, too #AC_PROG_CC(cc gcc) #AC_PROG_CXX(CC g++ gcc c++ cxx) define([svnversion],esyscmd([sh -c "svnversion | tr -c '[0-9]' ' ' | sed 's/ *//g;s/^$/-1/g' "]))dnl # WARNING : here 0.0 denotes the package version, which will be corrected some lines after this. AC_INIT([fim],[0.6-rc2],[dezperado_FOobAr_autistici_Baz_org, by replacing _FOobAr_ with a @ and _Baz_ with a .]) AC_CONFIG_SRCDIR([src/fim.cpp]) if test x"svnversion" != x ; then # The above test gets evaluated when creating the configure script. AC_DEFINE(SVN_REVISION,"svnversion",[SVN REVISION]) AC_SUBST(SVN_REVISION,"svnversion") AC_DEFINE(SVN_REVISION_NUMBER,svnversion,[SVN REVISION NUMBER]) AC_SUBST(SVN_REVISION_NUMBER,svnversion) fi AH_TEMPLATE([FIM_CONFIGURATION]) FIM_CONFIGURATION="$0 $@" AC_SUBST(FIM_CONFIGURATION) AC_DEFINE_UNQUOTED([FIM_CONFIGURATION],"$FIM_CONFIGURATION") AC_MSG_NOTICE([ Welcome to the Fim (revision $SVN_REVISION) configure script! This script will create the right Makefile for building Fim on your system. But first, it will check if your system has the right configuration for Fim to build. There are options to this script, please run : ./configure --help=short for a complete list of these options. Please read BUGS and README and report any bug found to the Fim maintainer! ]) #AM_CONFIG_HEADER([config.h]) #AC_CONFIG_SRCDIR(pinentry/pinentry.h) # #AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION) AC_USE_SYSTEM_EXTENSIONS #AC_MANTAINER_MODE #AC_CANONICAL_HOST #missing_dir=`cd $ac_aux_dir && pwd` #AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) #AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) #AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) #AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) #AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_PROG_CC AC_PROG_CPP AC_PROG_YACC AC_PROG_LEX(noyywrap) AC_PROG_INSTALL AC_PROG_RANLIB AC_REVISION([$Revision$]) AC_PROG_CXX #AC_PROG_CXXCPP AC_CHECK_TOOL(AR, ar, ar) fim_cv_version=`cat $srcdir/VERSION` AC_LANG([C++]) #AC_LANG_PUSH([C++]) AM_INIT_AUTOMAKE #AM_INIT_AUTOMAKE(fim, $fim_cv_version) #AM_INIT_AUTOMAKE(fim, 1.0) AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/VERSION']) AC_SUBST(FIM_LIBS) AC_SUBST(VERSION) dnl AC_SUBST(HTMLDOCS) #AC_LANG_POP([C++]) fim="fim" AC_MSG_CHECKING([for prefix]) if test x$prefix = xNONE; then fim_cv_prefix=$ac_default_prefix else fim_cv_prefix=$prefix fi AC_MSG_RESULT($fim_cv_prefix) AC_SEARCH_LIBS([strerror],[cposix]) #AM_C_PROTOTYPES if test "x$U" != "x"; then AC_MSG_ERROR(Compiler not ANSI compliant) fi #AC_PROG_CPP AC_PROG_MAKE_SET AC_C_INLINE AC_C_CONST AC_SYS_LARGEFILE AC_FUNC_FSEEKO AC_CHECK_SIZEOF(off_t) AM_MAINTAINER_MODE AH_TEMPLATE([HAVE_GETENV]) AC_CHECK_FUNC([getenv], AC_DEFINE([HAVE_GETENV], [1], [If present, the getenv function allows fim to read environment variables.])) AC_CHECK_FUNC([getline], AC_DEFINE([HAVE_GETLINE], [1], [If present, will be used for stdin reading. (on GNU)])) AC_CHECK_FUNC([getdelim], AC_DEFINE([HAVE_GETDELIM], [1], [If present, will be used for stdin reading. (on GNU)])) AC_CHECK_FUNC([fgetln], AC_DEFINE([HAVE_FGETLN], [1], [If present, fgetln() will be used as a replacement for getline(). (on BSD)])) AC_CHECK_FUNC([get_current_dir_name], AC_DEFINE([HAVE_GET_CURRENT_DIR_NAME], [1], [Should live when _GNU_SOURCE, but it could be not the case.])) AC_CHECK_FUNC([rsb_lib_init]) AC_CHECK_FUNC([pipe]) AH_TEMPLATE([HAVE_MEMMEM]) AC_CHECK_FUNC([memmem], AC_DEFINE([HAVE_MEMMEM], [1], [Have memmem])) AH_TEMPLATE([HAVE_SYNC]) AC_CHECK_FUNC([sync], AC_DEFINE([HAVE_SYNC], [1], [Have sync])) AC_CHECK_LIB([m],[pow]) AC_CHECK_LIB([fl],[yylex]) AC_ARG_ENABLE(graphicsmagick, AS_HELP_STRING([--enable-graphicsmagick],[Enable GraphicsMagick library support (EXPERIMENTAL).]), [ if test x$enableval != xno ; then fim_handle_graphicsmagick=yes ; fi ] ) AC_CHECK_LIB([GraphicsMagick],[GetMagickVersion], [ if test x"$fim_handle_graphicsmagick" = x"yes" ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffMagick.o"; LIBS="$LIBS `GraphicsMagick-config --cppflags --ldflags --libs|tr '\n' ' '` "; CXXFLAGS="$CXXFLAGS `GraphicsMagick-config --cppflags |tr '\n' ' '` "; AC_DEFINE([HAVE_LIBGRAPHICSMAGICK],[1],[We have libGraphicsMagick]) fi ], [fim_handle_graphicsmagick=no;]) AM_CONDITIONAL(WITH_LIBGRAPHICSMAGICK, test x$fim_handle_graphicsmagick = xyes) AC_ARG_ENABLE(imlib2, AS_HELP_STRING([--enable-imlib2],[Enable Imlib2 library support (EXPERIMENTAL,INCOMPLETE).]), [ if test x$enableval != xno ; then fim_handle_imlib2=yes ; fi ] ) AC_CHECK_LIB([Imlib2],[imlib_create_image], [ if test x"$fim_handle_imlib2" = x"yes" ; then AC_MSG_WARN([Imlib2 support is still INCOMPLETE, you should better use sdl!]) FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS Imlib2Device.o"; LIBS="$LIBS `imlib2-config --libs|tr '\n' ' '` "; CXXFLAGS="$CXXFLAGS `imlib2-config --cflags |tr '\n' ' '` "; AC_DEFINE([FIM_WITH_LIBIMLIB2],[1],[We have libImlib]) fi ], [fim_handle_imlib2=no;]) AM_CONDITIONAL(ENABLE_IMLIB2, test x"$fim_handle_imlib2" = x"yes") AC_CHECK_PROG([HAVE_FLEX],[flex],[yes],[no]) AC_CHECK_PROG([HAVE_BISON],[bison],[yes],[no]) if test x$HAVE_FLEX != x"yes" ; then AC_MSG_ERROR([No flex (lexical analyser generator) executable detected!]) ; fi if test x$HAVE_BISON != x"yes" ; then AC_MSG_ERROR([No bison (parser generator) executable detected!]) ; fi AC_CHECK_PROG([HAVE_ECHO],[echo],[yes],[no]) AC_CHECK_PROG([HAVE_RM],[rm],[yes],[no]) AC_CHECK_PROG([HAVE_SED],[sed],[yes],[no]) AC_CHECK_PROG([HAVE_GREP],[grep],[yes],[no]) AC_CHECK_PROG([HAVE_SORT],[sort],[yes],[no]) AC_CHECK_PROG([HAVE_CPP],[cpp],[yes],[no]) AC_CHECK_PROG([HAVE_AWK],[awk],[yes],[no]) AC_CHECK_PROG([HAVE_CAT],[cat],[yes],[no]) AC_CHECK_PROG([HAVE_MAN],[man],[yes],[no]) #AC_CHECK_PROG([HAVE_WHICH],[which],[yes],[no]) #AC_CHECK_PROG([HAVE_GPG],[gpg],[yes],[no]) #AC_CHECK_PROG([HAVE_LS],[ls],[yes],[no]) #AC_CHECK_PROG([HAVE_CD],[cd],[yes],[no]) #AC_CHECK_PROG([HAVE_CC],[cc],[yes],[no]) dnl AC_ARG_VAR([LIBTIFF],[libtiff library (contributes to LIBS)]) AC_ARG_VAR([LIBGIF],[libgif library (contributes to LIBS)]) AC_ARG_VAR([LIBJPEG],[libjpeg library (contributes to LIBS)]) AC_ARG_VAR([LIBPS],[libspectre library (contributes to LIBS)]) AC_ARG_VAR([LIBDJVU],[libdjvu libdjvulibre (contributes to LIBS)]) AC_ARG_VAR([LIBPOPPLER],[poppler libdjvulibre (contributes to LIBS)]) dnl AC_PATH_PROG([RM],[rm],[no]) AC_PATH_PROG([SED],[sed],[no]) AC_PATH_PROG([GREP],[grep],[no]) AC_PATH_PROG([ECHO],[echo],[no]) AC_PATH_PROG([SORT],[sort],[no]) AC_PATH_PROG([CPP],[cpp],[no]) AC_PATH_PROG([AWK],[awk],[no]) AC_PATH_PROG([CAT],[cat],[no]) AC_PATH_PROG([MAN],[man],[no]) AC_PATH_PROG([PERL],[perl],[no]) AC_PATH_PROG([SHELLCHECK],[shellcheck],[no]) AM_CONDITIONAL(WITH_SHELLCHECK, test x$ac_cv_path_SHELLCHECK != xno) AM_CONDITIONAL(WITH_MAN2HTML, test x$ac_cv_path_MAN != xno) AM_CONDITIONAL(WITH_PERL, test x$ac_cv_path_PERL != xno) #AC_PATH_PROG([CC],[cc],[no]) #AC_PATH_PROG([WHICH],[which],[no]) #AC_PATH_PROG([GPG],[gpg],[no]) #AC_PATH_PROG([LS],[ls],[no]) #AC_PATH_PROG([CD],[cd],[no]) AC_PATH_PROG([EXPECT],[expect],[no]) AM_CONDITIONAL(WITH_EXPECT, test x$ac_cv_path_EXPECT != xno) # FIXME: what if we have no grep and/or no sed ? # (echo is often a shell builtin) have_default_bindings=yes have_default_mapping=yes have_default_config=yes AC_ARG_ENABLE(default_bindings, AS_HELP_STRING([--disable-default-bindings],[Builtin default minimal key binding]), [ if test x$enableval = xyes; then have_default_bindings=yes else have_default_bindings=no fi ]) AC_ARG_ENABLE(default_mapping, AS_HELP_STRING([--disable-default-mapping],[Builtin default minimal key mapping]), [ if test x$enableval = xyes; then have_default_mapping=yes else have_default_mapping=no fi ]) AC_ARG_ENABLE(default_config, AS_HELP_STRING([--disable-default-config],[Builtin default minimal configuration]), [ if test x$enableval = xyes; then have_default_config=yes else have_default_config=no fi ]) AH_TEMPLATE([FIM_DEFAULT_CONFIG]) if test x$have_default_bindings != xno; then FIM_DEFS="$FIM_DEFS -D FIM_DEFAULT_CONFIG" AC_DEFINE([FIM_DEFAULT_CONFIG]) fi AH_TEMPLATE([FIM_DEFAULT_KEY_CONFIG]) if test x$have_default_mapping != xno; then FIM_DEFS="$FIM_DEFS -D FIM_DEFAULT_KEY_CONFIG" AC_DEFINE([FIM_DEFAULT_KEY_CONFIG]) fi AH_TEMPLATE([FIM_DEFAULT_CONFIGURATION]) if test x$have_default_config != xno; then FIM_DEFS="$FIM_DEFS -D FIM_DEFAULT_CONFIGURATION" AC_DEFINE([FIM_DEFAULT_CONFIGURATION]) fi #CPPFLAGS=$DEPS #AC_SUBST(LIBSDL_CXXFLAGS) #AC_SUBST(LIBPNG_CXXFLAGS) #AC_SUBST(LIBSDL_CXXFLAGS) #AC_SUBST(LIBPNG_CXXFLAGS) #AC_SUBST(LIBPNG_LIBS) AC_ARG_ENABLE(system, AS_HELP_STRING([--disable-system],[Disable system() and pipe() calls.]), [ if test x$enableval = xno ; then fim_system_calls=no fi ]) dnl new: AC_ARG_ENABLE(framebuffer, AS_HELP_STRING([--disable-framebuffer],[Disable the framebuffer device driver.]), [ if test x$enableval = xno ; then fim_handle_framebuffer=no fi ]) AC_MSG_NOTICE([Checking for headers required by the Linux framebuffer device.]) AC_CHECK_HEADERS([linux/fb.h], [break], AC_MSG_WARN([[Cannot find linux/fb.h. Fim Linux framebuffer driver requires it!.]])) AC_CHECK_HEADERS([linux/vt.h], [break], AC_MSG_WARN([[Cannot find linux/vt.h. Fim Linux framebuffer driver requires it!.]])) AC_CHECK_HEADERS([linux/kd.h], [break], AC_MSG_WARN([[Cannot find linux/kd.h. Fim Linux framebuffer driver requires it!.]])) if test x$ac_cv_header_linux_fb_h != xyes -o \ x$ac_cv_header_linux_vt_h != xyes -o \ x$ac_cv_header_linux_kd_h != xyes ; then AC_MSG_WARN([Turning off Linux framebuffer support due to missing headers]) fim_handle_framebuffer=no fi if test x$fim_handle_framebuffer = xno ; then AC_DEFINE(FIM_WITH_NO_FRAMEBUFFER, 1, [Defined when framebuffer device support is turned off.]) fi AM_CONDITIONAL(ENABLE_FRAMEBUFFER, test x$fim_handle_framebuffer != xno) m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]),[2.72]),-1, [],[AC_CHECK_INCLUDES_DEFAULT]) AC_PROG_EGREP AC_FUNC_MMAP AC_CHECK_FUNCS([bzero memset memcmp strncmp strcpy]) AC_CHECK_FUNCS([bcopy bcmp]) AC_CHECK_FUNCS([drand48 random rand]) AC_CHECK_FUNCS([fileno]) AC_CHECK_FUNCS([fmemopen]) AC_CHECK_HEADERS([wordexp.h glob.h fnmatch.h]) dnl AC_FUNC_REALLOC() dnl triggers error in automake 1.10.1 #AC_CHECK_HEADERS([stddef.h]) #AC_CHECK_HEADERS([stdlib.h]) AC_CHECK_HEADERS([string.h strings.h], [AC_CHECK_FUNCS(strerror)]) AC_CHECK_HEADERS([stdint.h]) AC_CHECK_HEADERS([wchar.h]) AC_CHECK_HEADERS([fontconfig/fontconfig.h]) AC_CHECK_HEADERS([fontconfig/fcfreetype.h]) AC_HEADER_DIRENT() AC_CHECK_HEADERS([stdarg.h sys/ioctl.h ioctl.h sysexits.h]) AC_CHECK_HEADERS([sys/time.h sys/resource.h]) AC_CHECK_HEADERS([sys/select.h]) AC_CHECK_HEADERS([sys/wait.h]) AC_CHECK_HEADERS([time.h]) AC_CHECK_HEADERS([unix.h]) AC_CHECK_HEADERS([libgen.h]) AC_CHECK_HEADERS([sys/user.h]) AC_CHECK_HEADERS([sys/mman.h]) AC_CHECK_HEADERS([cstdio stdio.h], [break],AC_MSG_ERROR([[Cannot find cstdio or stdio.h. Fim requires at least one or the other.]])) AC_CHECK_HEADERS([climits limits.h], [break], AC_MSG_ERROR([[Cannot find limits.h nor climits. Fim requires it!.]])) AC_CHECK_HEADERS([filesystem], AC_DEFINE([HAVE_FILESYSTEM], [1], [Define to 1 if have ])) AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([int *]) AC_CHECK_SIZEOF([size_t]) AC_C_BIGENDIAN([fim_big_endian=yes],[fim_big_endian=no],[fim_big_endian=hmmm]) if test "x$fim_big_endian" = "xyes" ; then AH_TEMPLATE([FIM_BIG_ENDIAN]) AC_DEFINE([FIM_BIG_ENDIAN]) fi dnl ============= begin misc external programs detection AC_CHECK_HEADERS([regex]) if test x$ac_cv_header_regex = xyes; then AH_TEMPLATE([HAVE_REGEX]) AC_DEFINE([HAVE_REGEX],[1],[We have ]) fi AC_CHECK_HEADERS([_regex.h]) if test x$ac_cv_header__regex_h = xyes; then AH_TEMPLATE([HAVE__REGEX_H]) AC_DEFINE([HAVE__REGEX_H],[1],[We have _regex.h]) fi AC_CHECK_HEADERS([regex.h]) if test x$ac_cv_header_regex_h = xyes; then AH_TEMPLATE([HAVE_REGEX_H]) AC_DEFINE([HAVE_REGEX_H],[1],[We have regex.h]) fi AC_CHECK_HEADERS([termios.h]) if test x$ac_cv_header_termios_h = xyes; then AH_TEMPLATE([HAVE_TERMIOS_H]) AC_DEFINE([HAVE_TERMIOS_H],[1],[We have termios.h]) fi if test x$ac_cv_header_sys_ioctl_h = xyes; then AH_TEMPLATE([HAVE_SYS_IOCTL_H]) AC_DEFINE([HAVE_SYS_IOCTL_H],[1],[We have sys/ioctl.h]) fi if test x$ac_cv_header_sys_select_h = xyes; then AH_TEMPLATE([HAVE_SYS_SELECT_H]) AC_DEFINE([HAVE_SYS_SELECT_H],[1],[We have sys/select.h]) fi if test x$ac_cv_header_sys_wait_h = xyes; then AH_TEMPLATE([HAVE_SYS_WAIT_H]) AC_DEFINE([HAVE_SYS_WAIT_H],[1],[We have sys/wait.h]) fi AC_CHECK_HEADERS([FlexLexer.h], [break], AC_MSG_ERROR([[Cannot find FlexLexer. Fim requires it!]])) if test x$ac_cv_func_pipe = xyes; then AH_TEMPLATE([HAVE_PIPE]) AC_DEFINE([HAVE_PIPE],[1],[We have pipe()]) fi if test x$ac_cv_header_FlexLexer_h = xyes; then AH_TEMPLATE([HAVE_FLEXLEXER_H]) AC_DEFINE([HAVE_FLEXLEXER_H],[1],[We have FlexLexer.h]) fi AM_CONDITIONAL(WITH_FLEXLEXER, test x$ac_cv_header_FlexLexer_h = xyes) dnl ============= begin misc external programs detection dnl ============= end misc external programs detection dnl if test "X$ac_cv_header_cstdio" != "Xyes" && test "X$ac_cv_header_stdio_h" != "Xyes"; then dnl AC_MSG_ERROR([[Cannot find cstdio or stdio.h. Fim requires at least one or the other.]]) dnl fi dnl if test "X$ac_cv_header_linux_fb_h" != "Xyes" ; then dnl AC_MSG_ERROR([[Cannot find linux/fb.h. Fim requires it!.]]) dnl fi dnl AC_CHECK_FUNCS(setrlimit getsid) dnl m4_warn([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void. dnl Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl dnl AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE( dnl [AC_LANG_PROGRAM([#include dnl #include dnl ], dnl [return *(signal (0, 0)) (0) == 1;])], dnl [ac_cv_type_signal=int], dnl [ac_cv_type_signal=void])]) dnl AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers dnl (`int' or `void').]) dnl ================== AH_TEMPLATE([FIM_WANT_STATIC_BINARY]) AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static],[Want a static binary. (disabled by default)]), [ if test x$enableval = xyes; then fim_cv_want_static=1 ; else fim_cv_want_static=0 ; fi ],[ fim_cv_want_static=0 ]) if test x$fim_cv_want_static = x1 ; then LIBS="$LIBS --static" LIBDJVU_STATIC_EXTRA="-lpthread" # too many dependencies for the following! LIBPOPPLER_STATIC_EXTRA="" LIBSPECTRE_STATIC_EXTRA="" #LIBPOPPLER_STATIC_EXTRA="-lfreetype -llcms" #LIBSPECTRE_STATIC_EXTRA="-Wl,--start-group -lgs -lfontconfig -ldl -ljbig2dec -ljasper -lpthread -lpng -lppd -lpaper -lavahi-common -lavahi-client -lexpat -lfreetype -lgnutls -ldbus-1 -ltasn1 -lcupsimage -lcups -lgcrypt -Wl,--end-group " LIBTIFF_STATIC_EXTRA="-ljpeg -lz" AC_DEFINE_UNQUOTED([FIM_WANT_STATIC_BINARY], $fim_cv_want_static [Want a static binary. (disabled by default)]) fi dnl ================== AC_ARG_WITH(regex, AS_HELP_STRING([--with-regex],[Obsolete switch -- do not use this. (deprecated)]), [fim_cv_regex=yes], [AC_CHECK_FUNCS(regcomp, fim_cv_regex=no, fim_cv_regex=yes)]) if test X$ac_cv_header__regex_h = Xno ; then fim_cv_regex=no; fi if test X$fim_cv_regex = Xno ; then AC_CACHE_CHECK([whether your system regexp library is completely broken], [fim_cv_regex_broken], AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include int main() { regex_t blah ; /*regmatch_t p; p.rm_eo = p.rm_eo;*/ const int rr = regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec (&blah, "foobar", 0, NULL, 0); regfree(&blah); return rr; }]])],[fim_cv_regex_broken=no],[fim_cv_regex_broken=yes],[fim_cv_regex_broken=yes])) if test X$fim_cv_regex_broken = Xyes ; then echo "Using the included GNU regex instead." >&AS_MESSAGE_FD fim_cv_regex=yes fi fi if test X$fim_cv_regex = Xyes -a X$ac_cv_header__regex_h != Xno; then AC_DEFINE(USE_GNU_REGEX,1,[ Define if you want to use the included (GNU) regex.c. ]) AC_LIBOBJ(regex) fi AC_MSG_CHECKING(where to put the documentation...) dnl AC_ARG_WITH(docdir, AS_HELP_STRING([--with-docdir=PATH],[Specify where to put the documentation]), dnl [fim_cv_docdir=$withval], dnl [fim_cv_docdir='${prefix}/doc/fim-${fim_cv_version}']) # FIXME : the above line seems troublesome, BUT IT IS NOT (see the muttrc for this trick). AC_MSG_RESULT($fim_cv_docdir) dnl docdir=$fim_cv_docdir dnl AC_SUBST(docdir) AC_SUBST(fim_cv_version) dnl ============= gif file handling AC_ARG_ENABLE(gif, AS_HELP_STRING([--disable-gif],[Disable gif support.]), [ if test x$enableval = xno ; then fim_handle_gif=no fi ]) if test x$fim_handle_gif != xno ; then fim_handle_gif=yes have_gif=yes if test x$with_libgif != xno && test -z "$LIBGIF"; then AC_CHECK_LIB(gif,DGifOpenFileHandle , have_gif=yes, have_gif=no AC_MSG_WARN([*** GIF loader will not be built (GIF library not found) ***])) if test x"$have_gif" = xyes; then AC_MSG_CHECKING([for gif.h]) AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include ]])],[have_gif=yes],[have_gif=no]) AC_MSG_RESULT($have_gif) if test x"$have_gif" = xyes; then LIBGIF='-lgif' else AC_MSG_WARN([*** GIF loader will not be built (GIF header file not found) ***]) fi fi fi # if test x$with_libgif != xno ; then # the following needs thorough testing if test x"$have_gif" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffGif.o" LIBS="$LIBS $LIBGIF" AC_DEFINE([FIM_HANDLE_GIF]) else fim_handle_gif=no fi # if test x$with_libgif != xno && test -z "$LIBGIF"; then # # fi else fim_handle_gif=no fi AC_SUBST(LIBGIF) AM_CONDITIONAL(ENABLE_GIF, test x$have_gif = xyes) dnl ============= tiff file handling AC_ARG_ENABLE(tiff, AS_HELP_STRING([--disable-tiff],[Disable tiff support.]), [ if test x$enableval = xno ; then fim_handle_tiff=no fi ]) if test x$fim_handle_tiff != xno ; then fim_handle_tiff=yes have_tiff=yes if test x$with_libtiff != xno && test -z "$LIBTIFF"; then AC_CHECK_LIB(tiff,TIFFOpen , have_tiff=yes, have_tiff=no AC_MSG_WARN([*** TIFF loader will not be built (TIFF library not found) ***]) , [$LIBTIFF_STATIC_EXTRA]) if test x"$have_tiff" = xyes; then AC_MSG_CHECKING([for tiff.h]) AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include ]])],[have_tiff=yes],[have_tiff=no]) AC_MSG_RESULT($have_tiff) if test x"$have_tiff" = xyes; then LIBTIFF="-ltiff $LIBTIFF_STATIC_EXTRA" else AC_MSG_WARN([*** TIFF loader will not be built (TIFF header file not found) ***]) fi fi fi # if test x$with_libtiff != xno ; then # the following needs thorough testing if test x"$have_tiff" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffTiff.o" LIBS="$LIBS $LIBTIFF" AC_DEFINE([FIM_HANDLE_TIFF]) else fim_handle_tiff=no fi # if test x$with_libtiff != xno && test -z "$LIBTIFF"; then # # fi else fim_handle_tiff=no fi AC_SUBST(LIBTIFF) AM_CONDITIONAL(ENABLE_TIFF, test x$have_tiff = xyes) dnl ============= curses: optional AC_CHECK_LIB([curses],[noecho]) dnl ============= ncurses: optional AC_CHECK_LIB([ncurses],[noecho]) dnl ============= GNU gpm, unofficial yet # AC_CHECK_LIB(gpm,Gpm_Open, # ,true, # AC_MSG_ERROR(*** gpm lib not found ... no problem ... ***)) #LIBS="$LIBS -lgpm" dnl ============= no readline case handling fim_want_readline=yes AC_ARG_ENABLE(readline, AS_HELP_STRING([--disable-readline],[Disable readline support (EXPERIMENTAL).]), [ if test x$enableval = xno ; then fim_want_readline=no else fim_want_readline=yes fi ]) dnl ============= GNU readline : essential dnl Please note that when the readline library is compiled with the curses library, this check will fail, because dnl we cannot know in advance if it is so. AH_TEMPLATE([FIM_USE_READLINE]) AH_TEMPLATE([FIM_HANDLE_GIF]) AH_TEMPLATE([FIM_HANDLE_TIFF]) have_readline=no # Sometimes the readline library is linked to the curses library, and we here try to detect this case.. if test x$have_readline = xno; then if test x$fim_want_readline = xyes ; then AC_CHECK_LIB(readline, rl_replace_line, have_readline=yes LIBS="$LIBS -lreadline" AC_DEFINE([FIM_USE_READLINE]) ,have_readline=no AC_MSG_ERROR(*** GNU readline (or curses library ?) not found (used LIBS=${LIBS}) ! please install them or specify them in e.g. LIBS=... or run ./configure --disable-readline ***) ,[] ) else have_readline=no AC_MSG_NOTICE(*** Fim will be built withoud GNU readline library headers ! Are you sure ? ***) fi fi dnl FIXME : we try to detecht curses, although we do not know if the preceding did use it if test x$have_readline = xyes; then if test x$fim_want_readline = xyes ; then AC_CHECK_LIB(curses, tputs, have_curses=yes LIBS="$LIBS" ,have_curses=no ) fi fi AM_CONDITIONAL(WANT_READLINE, test x$have_readline = xyes) dnl ============= jpeg file handling #AC_ARG_WITH(jpeg, [ --disable-jpeg ], [ disable jpeg file support]) AC_ARG_ENABLE(jpeg, AS_HELP_STRING([--disable-jpeg],[Disable jpeg support.]), [ if test x$enableval = xno ; then fim_handle_jpeg=no fi ]) if test x$fim_handle_jpeg != xno ; then fim_handle_jpeg=yes have_jpeg=yes if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, have_jpeg=yes, have_jpeg=no AC_MSG_WARN([*** JPEG loader will not be built (JPEG library not found) ***])) if test x"$have_jpeg" = xyes; then AC_MSG_CHECKING([for jpeglib.h]) AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include ]])],[have_jpeg=yes],[have_jpeg=no]) AC_MSG_RESULT($have_jpeg) if test x"$have_jpeg" = xyes; then LIBJPEG='-ljpeg' else AC_MSG_WARN([*** JPEG loader will not be built (JPEG header file not found) ***]) fi fi fi # if test x$with_libjpeg != xno ; then # the following needs thorough testing if test x"$have_jpeg" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffJpeg.o" LIBS="$LIBS $LIBJPEG" AC_DEFINE([HAVE_LIBJPEG],[1],[We have libjpeg]) else fim_handle_jpeg=no fi # if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then # AC_MSG_ERROR([ # Checks for JPEG loader failed. You can build without it by passing # --disable-jpeg to ./configure. ]) # fi else fim_handle_jpeg=no fi AC_SUBST(LIBJPEG) AM_CONDITIONAL(ENABLE_JPEG, test x$fim_handle_jpeg = xyes) dnl ============= dvi file handling (via TeX-Guy) dnl dnl AC_ARG_ENABLE(dvi, AS_HELP_STRING([--disable-dvi],[Disable dvi support.]), dnl [ if test x$enableval = xno ; then dnl fim_handle_dvi=no dnl fi dnl ]) dnl if test x$fim_handle_dvi != xno ; then dnl fim_handle_dvi=yes dnl have_dvi=yes dnl if test x$with_libdvi != xno && test -z "$LIBDVI"; then dnl AC_CHECK_LIB(dvilib2, DVI_init, dnl have_dvi=yes, dnl have_dvi=no dnl AC_MSG_WARN([*** DVI loader will not be built (libdvi29 library not found) ***])) dnl if test x"$have_dvi" = xyes; then dnl AC_MSG_CHECKING([for libdvi29.h]) dnl AC_PREPROC_IFELSE([AC_LANG_SOURCE([[dnl #include dnl #undef PACKAGE dnl #undef VERSION dnl #undef HAVE_STDLIB_H dnl #include ]])],[dnl have_dvi=yes],[dnl have_dvi=no]) dnl AC_MSG_RESULT($have_dvi) dnl if test x"$have_dvi" = xyes; then dnl LIBDVI='-ldvilib2' dnl else dnl AC_MSG_WARN([*** DVI loader will not be built (libdvi29.h header file not found) ***]) dnl fi dnl fi dnl fi dnl dnl # the following needs thorough testing dnl if test x"$have_dvi" = xyes ; then dnl FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffDvi.o" dnl LIBS="$LIBS $LIBDVI" dnl AC_DEFINE([HAVE_LIBSPECTRE],[1],[We have libdvilib2]) dnl else dnl fim_handle_dvi=no dnl fi dnl dnl # if test x$with_libdvi != xno && test -z "$LIBDVI"; then dnl # AC_MSG_ERROR([ dnl # Checks for DVI loader failed. You can build without it by passing dnl # --disable-dvi to ./configure. ]) dnl # fi dnl else dnl fim_handle_dvi=no dnl fi dnl AC_SUBST(LIBDVI) dnl AM_CONDITIONAL(ENABLE_DVI, test x$have_dvi = xyes) dnl ============= ps file handling AC_ARG_ENABLE(ps, AS_HELP_STRING([--disable-ps],[Disable ps support.]), [ if test x$enableval = xno ; then fim_handle_ps=no fi ]) if test x$fim_handle_ps != xno ; then fim_handle_ps=yes have_ps=yes if test x$with_libps != xno && test -z "$LIBPS"; then AC_CHECK_LIB(spectre, spectre_page_render, have_ps=yes, have_ps=no AC_MSG_WARN([*** PS loader will not be built (spectre library not found) ***]) , [$LIBSPECTRE_STATIC_EXTRA]) if test x"$have_ps" = xyes; then AC_MSG_CHECKING([for libspectre/spectre.h]) AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include ]])],[have_ps=yes],[have_ps=no]) AC_MSG_RESULT($have_ps) if test x"$have_ps" = xyes; then LIBPS="-lspectre $LIBSPECTRE_STATIC_EXTRA" else AC_MSG_WARN([*** PS loader will not be built (PS header file not found) ***]) fi fi fi # the following needs thorough testing if test x"$have_ps" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPs.o" LIBS="$LIBS $LIBPS" AC_DEFINE([HAVE_LIBSPECTRE],[1],[We have libspectre]) else fim_handle_ps=no fi # if test x$with_libps != xno && test -z "$LIBPS"; then # AC_MSG_ERROR([ # Checks for PS loader failed. You can build without it by passing # --disable-ps to ./configure. ]) # fi else fim_handle_ps=no fi AC_SUBST(LIBPS) AM_CONDITIONAL(ENABLE_PS, test x$have_ps = xyes) dnl ============= djvu file handling AC_ARG_ENABLE(djvu, AS_HELP_STRING([--disable-djvu],[Disable djvu support.]), [ if test x$enableval = xno ; then fim_handle_djvu=no fi ]) if test x$fim_handle_djvu != xno ; then fim_handle_djvu=yes have_djvu=yes if test x$with_libdjvu != xno && test -z "$LIBDJVU"; then AC_CHECK_LIB(djvulibre, ddjvu_page_create_by_pageno, have_djvu=yes, have_djvu=no AC_MSG_WARN([*** DJVU loader will not be built (DJVU library not found) ***]), [$LIBDJVU_STATIC_EXTRA]) if test x"$have_djvu" = xyes; then AC_MSG_CHECKING([for libdjvu/ddjvuapi.h]) AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include ]])],[have_djvu=yes],[have_djvu=no]) AC_MSG_RESULT($have_djvu) if test x"$have_djvu" = xyes; then LIBDJVU="-ldjvulibre $LIBDJVU_STATIC_EXTRA" else AC_MSG_WARN([*** DJVU loader will not be built (DJVU header file not found) ***]) fi fi fi # the following needs thorough testing if test x"$have_djvu" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffDjvu.o" LIBS="$LIBS $LIBDJVU" AC_DEFINE([HAVE_LIBDJVU],[1],[We have libdjvulibre]) else fim_handle_djvu=no fi # if test x$with_libdjvu != xno && test -z "$LIBDJVU"; then # AC_MSG_ERROR([ # Checks for DJVU loader failed. You can build without it by passing # --disable-djvu to ./configure. ]) # fi else fim_handle_djvu=no fi AC_SUBST(LIBDJVU) AM_CONDITIONAL(ENABLE_DJVU, test x$have_djvu = xyes) dnl ============= pdf file handling with libpoppler dnl dnl By default, we disable poppler : its API is still immature. dnl fim_handle_pdf=no AC_ARG_ENABLE(poppler, AS_HELP_STRING([--enable-poppler],[Enable poppler (PDF rendering) support. This will try to detect extra compilation flags. You can override this by passing configure with POPPLER_CFLAGS=... .]), [ if test x$enableval = xyes ; then fim_handle_pdf=yes fi ], [$LIBPOPPLER_STATIC_EXTRA]) dnl FIXME : checking only for libpoppler-glib, should also check for libpoppler ! if test x$fim_handle_pdf != xno ; then fim_handle_pdf=yes have_poppler=yes if test x$with_libpoppler != xno && test -z "$LIBPOPPLER"; then # dear fim hackers, you should install pkg-config to get this macro expanded (p) dnl # pkg-config --cflags poppler dnl # pkg-config --cflags poppler-cpp dnl # ... POPPLER_REQUIRED=0.8.7 PKG_CHECK_MODULES(POPPLER, poppler >= $POPPLER_REQUIRED,enable_pdf=yes,enable_pdf=no) dnl sets POPPLER_LIBS and POPPLER_CFLAGS PKG_CHECK_MODULES(GLIB, glib-2.0) dnl sets GLIB_CFLAGS GLIB_LIBS dnl keep next line empty or it may break configure. AC_CHECK_LIB(poppler, g_free, have_poppler=yes LIBS+=" $GLIB_LIBS $POPPLER_LIBS"; CXXFLAGS+=" $GLIB_CFLAGS $POPPLER_CFLAGS"; , have_poppler=no AC_MSG_WARN([*** POPPLER loader will not be built (POPPLER library not found) ***]), [$GLIB_LIBS $POPPLER_LIBS]) if test x"$have_poppler" = xyes; then AC_MSG_CHECKING([for poppler/poppler-config.h]) AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H /* fim uses these headers. let us hope poppler will stabilize soon!*/ #include #include #include #include #include #include #include #include /* globalParams lives here */ ]])],[have_poppler=yes],[have_poppler=no]) have_poppler=yes AC_MSG_RESULT($have_poppler) if test x"$have_poppler" = xyes; then CXXFLAGS="$CXXFLAGS -DFIM_LIBPOPPLER_VERSION_MAYBE=$have_poppler_maybe_version" else AC_MSG_WARN([*** POPPLER/PDF loader will not be built (POPPLER header file not found) ***]) fi fi fi # the following needs thorough testing if test x"$have_poppler" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPdf.o" LIBS="$LIBS $LIBPOPPLER" AC_DEFINE([HAVE_LIBPOPPLER],[1],[We have libpoppler (Warning: the API could still break! (as of v.0.8.7--0.24.1))]) else fim_handle_pdf=no fi # if test x$with_libpoppler != xno && test -z "$LIBPOPPLER"; then # AC_MSG_ERROR([ # Checks for POPPLER loader failed. You can build without it by passing # --disable-poppler to ./configure. ]) # fi else fim_handle_pdf=no fi AM_CONDITIONAL(ENABLE_POPPLER, test x$have_poppler = xyes) dnl FIXME : we have two libpoppler checks ... : dnl ================== pdf checks =================================================== AC_ARG_ENABLE(pdf, [AS_HELP_STRING([--enable-pdf],[Compile with pdf support])],enable_pdf="$enableval",enable_pdf=yes) if test "x$enable_pdf" = "xyes"; then if test "x$enable_pdf" = "xyes"; then AC_DEFINE([ENABLE_PDF], [1], [Enable pdf support.]) SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS" SHELL_CXXFLAGS="$SHELL_CXXFLAGS $GLIB_CFLAGS $POPPLER_CFLAGS" fim_save_LIBS=$LIBS LIBS="$LIBS $GLIB_LIBS $POPPLER_LIBS" LIBS=$fim_save_LIBS else AC_MSG_WARN(["PDF support is disabled since poppler library version $POPPLER_REQUIRED or newer not found"]) fi fi AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes) dnl ================== end of pdf checks ============================================ dnl ================================================================================ fim_handle_bmp=yes AC_ARG_ENABLE(bmp, AS_HELP_STRING([--disable-bmp],[Disable BMP file support (enabled by default).]), [ if test x$enableval = xno ; then fim_handle_bmp=no fi ]) if test x$fim_handle_bmp = xyes; then AC_MSG_NOTICE([Enabling BMP file format support.]) AC_DEFINE(FIM_WITH_BMP, 1, [BMP file support.]) FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffBmp.o" else AC_MSG_NOTICE([Disabling BMP file format support.]) AC_DEFINE(FIM_WITH_BMP, 0, [BMP file support.]) fi AM_CONDITIONAL(ENABLE_BMP, test x$fim_handle_bmp = xyes) dnl ================================================================================ fim_handle_pcx=yes AC_ARG_ENABLE(pcx, AS_HELP_STRING([--disable-pcx],[Disable PCX file support (enabled by default).]), [ if test x$enableval = xno ; then fim_handle_pcx=no fi ]) if test x$fim_handle_pcx = xyes; then AC_MSG_NOTICE([Enabling PCX file format support.]) AC_DEFINE(FIM_WITH_PCX, 1, [PCX file support.]) FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPcx.o" else AC_MSG_NOTICE([Disabling PCX file format support.]) AC_DEFINE(FIM_WITH_PCX, 0, [PCX file support.]) fi AM_CONDITIONAL(ENABLE_PCX, test x$fim_handle_pcx = xyes) dnl ================================================================================ ## png file handling AC_ARG_WITH(png-prefix, AS_HELP_STRING([--with-png-prefix=PFX],[prefix where libpng is installed (optional)]), libpng_config_prefix="$withval", libpng_config_prefix="") fim_handle_png=yes AC_ARG_ENABLE(png, AS_HELP_STRING([--disable-png],[Disable png support.]), [ if test x$enableval = xno ; then fim_handle_png=no fi ]) if test x$fim_handle_png = xyes; then # support for custom library configurator path if test x$libpng_config_prefix != x; then LIBPNG_CONFIG="$libpng_config_prefix/bin/libpng-config" else # default path configurator AC_PATH_PROG(LIBPNG_CONFIG, libpng-config, no) fi if test "x$LIBPNG_CONFIG" = "xno"; then AC_MSG_WARN([*** PNG loader will not be built (PNG library not found) ***]) fim_handle_png=no else CXXFLAGS="$CXXFLAGS `$LIBPNG_CONFIG --cflags`" if test x$fim_cv_want_static = x1 ; then LIBS="$LIBS `$LIBPNG_CONFIG --static --libs`" else LIBS="$LIBS `$LIBPNG_CONFIG --libs`" fi # finish this ! FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPng.o" AC_DEFINE(FIM_WITH_LIBPNG, 1, [Defined, if libpng support is enabled]) fi fi AC_SUBST(LIBPNG) AM_CONDITIONAL(ENABLE_PNG, test x$fim_handle_png = xyes) #AM_CONDITIONAL(BUILD_PNG, test x$fim_handle_png = xyes) dnl ================================================================================ fim_handle_xyz=no AC_ARG_ENABLE(xyz, AS_HELP_STRING([--enable-xyz],[Enable the sample bogus 'xyz' file loading support. This makes only sense in order to learn how to include a new file format and wish to play with src/FbiStuffXyz.cpp in the while.]), [ if test x$enableval = xyes ; then fim_handle_xyz=yes fi ]) if test x$fim_handle_xyz = xyes; then LIBXYZ="" # one would set an actual value here LIBS="$LIBS $LIBXYZ" FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffXyz.o" AC_DEFINE(FIM_WITH_LIBXYZ, 1, [Defined if sample bogus 'xyz' loader support is enabled.]) fi dnl ================================================================================ ## raw/nef file handling via UFRaw fim_handle_ufraw=no AC_ARG_ENABLE(ufraw, AS_HELP_STRING([--enable-ufraw],[Enable UFRaw support (EXPERIMENTAL).]), [ if test x$enableval = xno ; then fim_handle_ufraw=no else fim_handle_ufraw=yes fi ]) if test x$fim_handle_ufraw = xyes; then # support for custom library configurator path CXXFLAGS="$CXXFLAGS $UFRAW_CXXFLAGS" LIBS="$LIBS $UFRAW_LIBS" FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffUFRaw.o" # FIXME AC_DEFINE(FIM_WITH_UFRAW, 1, [Defined, if UFRaw support is enabled]) AC_MSG_NOTICE([Enabling UFRaw / libufraw.]) fi dnl ================================================================================ ## archive file handling via libarchive fim_handle_archive=no AC_ARG_ENABLE(archive, AS_HELP_STRING([--enable-archive],[Enable libarchive support to view archive files as multipage documents (please provide ARCHIVE_LIBS, ARCHIVE_CXXFLAGS) (EXPERIMENTAL, INCOMPLETE).]), [ if test x$enableval = xno ; then fim_handle_archive=no else fim_handle_archive=yes fi ]) if test x$fim_handle_archive = xyes; then # support for custom library configurator path CXXFLAGS="$CXXFLAGS $ARCHIVE_CXXFLAGS" LIBS="$LIBS $ARCHIVE_LIBS -larchive" AC_DEFINE(FIM_WITH_ARCHIVE, 1, [Defined, if (EXPERIMENTAL, INCOMPLETE) libarchive support is enabled]) AC_MSG_NOTICE([Enabling libarchive.]) fi AM_CONDITIONAL(ENABLE_ARCHIVE, test x$fim_handle_archive = xyes) dnl ================================================================================ AC_CHECK_LIB(exif, exif_data_new_from_data,have_libexif=yes,have_libexif=no) AC_ARG_ENABLE(exif, AS_HELP_STRING([--disable-exif],[JPEG EXIF tags support with libexif.]), [if test x$enableval != xno; then fim_cv_libexif=yes; fi],[fim_cv_libexif=yes;]) if test x$fim_cv_libexif = xyes; then if test x$have_libexif = xyes; then AC_MSG_NOTICE([Enabling libexif usage.]) CXXFLAGS="$CXXFLAGS"; LIBS="$LIBS -lexif"; else AC_MSG_ERROR([Sorry, it does not seem like libexif is installed or detectable. Please run --disable-exif or install libexif in a system-wide directory instead. ]) fi else fim_cv_libexif=no; fi dnl ================================================================================ AC_ARG_ENABLE(jasper, AS_HELP_STRING([--enable-jasper],[Turns on JPEG-2000 files support using JasPer (EXPERIMENTAL)]), [if test x$enableval = xyes; then fim_cv_libjasper=yes; CXXFLAGS="$CXXFLAGS"; LIBS="$LIBS -ljasper"; AC_CHECK_LIB(jasper, jas_init,have_libjasper=yes,have_libjasper=no) if test x$have_libjasper = xyes; then AC_MSG_NOTICE([Enabling support of JPEG-2K files with JasPer.]); FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffJasPer.o"; else fim_cv_libjasper=no; AC_MSG_ERROR([Sorry, it does not seem like libjasper is installed or detectable. Please run --disable-jasper or install libjasper in a system-wide directory instead. ]); fi fi],[fim_cv_libjasper=no;]) dnl ================================================================================ AC_CHECK_LIB(aa, aa_getfirst,fim_cv_libaa=yes,fim_cv_libaa=no) AC_ARG_ENABLE(aa, AS_HELP_STRING([--disable-aa],[Ascii Art (-o aa) support (via aalib)]), [if test x$enableval != xno; then fim_cv_libaa=yes; else fim_cv_libaa=no; fi],[fim_cv_libaa=yes;]) if test x$fim_cv_libaa != xno; then if test x$ac_cv_lib_aa_aa_getfirst = xyes; then AC_MSG_NOTICE([Enabling aalib driver.]) fim_cv_aalib=yes if test x$libaa_config_prefix != x; then LIBAA_CONFIG="$libaa_config_prefix/bin/aalib-config" else # default path configurator AC_PATH_PROG(LIBAA_CONFIG, aalib-config, no) fi if test "x$LIBAA_CONFIG" = "xno"; then # uhm AC_MSG_WARN([*** no aalib-config ? ***]) fim_cv_aalib=no else CXXFLAGS="$CXXFLAGS `$LIBAA_CONFIG --cflags`" LIBS="$LIBS `$LIBAA_CONFIG --libs`" # finish this ! fi else fim_cv_aalib=no fi else fim_cv_aalib=no AC_MSG_WARN([Ascii Art (-o aa) support disabled.]) dnl AC_MSG_ERROR([Sorry, it does not seem like aalib is installed or detectable. dnl Please run --disable-aa or install aalib in a system-wide directory instead. dnl ]) fi dnl ================================================================================ AC_CHECK_LIB([stdc++fs],[main],[LIBS="${LIBS} -lstdc++fs"]) dnl ================================================================================ ## sdl driver AC_ARG_WITH(sdl-prefix, AS_HELP_STRING([--with-sdl-prefix=PFX],[prefix where libsdl is installed (optional)]), libsdl_config_prefix="$withval", libsdl_config_prefix="") fim_handle_sdl='auto' dnl AC_ARG_ENABLE(sdl, AS_HELP_STRING([--disable-sdl],[Disable libsdl support.]), dnl [ if test x$enableval = xno ; then dnl fim_handle_sdl=no dnl fi dnl ]) sdl_version_preference='' AC_ARG_ENABLE(sdl, AS_HELP_STRING([--disable-sdl],[Disable libsdl support. Or --enable-sdl=1 --enable-sdl=2 to give preference to one those two versions. Requires either sdl-config or sdl2-config. Some configurations require prepending PKG_CONFIG=pkg-config before configure, for sdl2-config to work.]), sdl_version_preference="$enableval"; [ if test x$enableval != xno ; then fim_handle_sdl=yes ; fi ] [ if test x$enableval = xno ; then fim_handle_sdl=no ; fi ]) # tested with sdl 1.2 if test x$fim_handle_sdl != xno; then # support for custom library configurator path echo PORCO DIO $sdl_version_preference if test x"${sdl_version_preference}" != x2; then if test x$libsdl_config_prefix != x; then LIBSDL_CONFIG="$libsdl_config_prefix/bin/sdl-config" else AC_PATH_PROG(LIBSDL_CONFIG, sdl-config, no) fi fi if test x"${sdl_version_preference}" != x1; then if test x$libsdl_config_prefix != x; then LIBSDL2_CONFIG="$libsdl_config_prefix/bin/sdl2-config" else AC_PATH_PROG(LIBSDL2_CONFIG, sdl2-config, no) fi if test x$LIBSDL2_CONFIG != x -a x$LIBSDL2_CONFIG != x"no" ; then LIBSDL_CONFIG="$LIBSDL2_CONFIG"; fi LIBS_BEFORE_CHECK="$LIBS" export LIBS="$LIBS `$LIBSDL2_CONFIG --static-libs`" AC_CACHE_CHECK([Whether sdl2-config gives linkable output with $LIBS], [have_cv_sdl2_config_ok], AC_LINK_IFELSE([AC_LANG_PROGRAM([/*headers*/], [/*main*/])],[have_cv_sdl2_config_ok=yes],[have_cv_sdl2_config_ok=no],[have_cv_sdl2_config_ok=no])) LIBS="$LIBS_BEFORE_CHECK" unset LIBS_BEFORE_CHECK if test x"$have_cv_sdl2_config_ok" = xno && test x"$LIBSDL2_CONFIG" != x && pkg-config --version; then AC_MSG_NOTICE([Setting PKG_CONFIG=pkg-config, perhaps it can help sdl-config.]) export PKG_CONFIG=pkg-config; fi unset LIBSDL2_CONFIG; fi if test "x$LIBSDL_CONFIG" = "xno"; then if test x$fim_handle_sdl = xyes; then AC_MSG_ERROR([LIBSDL not found (failed detecting the sdl configuration (sdl-config/sdl2-config) program)]) else fim_handle_sdl='no' fi else AC_MSG_NOTICE([Activating LIBSDL (use $LIBSDL_CONFIG).]) fim_handle_sdl='yes' LIBSDL_CXXFLAGS=`$LIBSDL_CONFIG --cflags` CXXFLAGS="$CXXFLAGS $LIBSDL_CXXFLAGS" LIBSDL_CONFIG_FLAGS=--libs if $LIBSDL_CONFIG $LIBSDL_CONFIG_FLAGS ; then LIBSDL_CONFIG_FLAGS=--libs else LIBSDL_CONFIG_FLAGS=--static-libs fi AC_MSG_NOTICE([Invoking $LIBSDL_CONFIG $LIBSDL_CONFIG_FLAGS.]) LIBS="$LIBS `$LIBSDL_CONFIG $LIBSDL_CONFIG_FLAGS`" # finish this ! #FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS SDLDevice.o" if test x`$LIBSDL_CONFIG --version | head -c 1` == x2; then AC_DEFINE(FIM_WITH_LIBSDL, 2, [Defined if libsdl support is enabled, and set to 1 or 2.]) else AC_DEFINE(FIM_WITH_LIBSDL, 1, [Defined if libsdl support is enabled, and set to 1 or 2.]) fi fi fi AM_CONDITIONAL(ENABLE_SDL, test x$fim_handle_sdl = xyes) dnl ================================================================================ AH_TEMPLATE([FIM_WANT_EXIFTOOL]) fim_cv_exiftool=no AC_ARG_ENABLE(exiftool, AS_HELP_STRING([--enable-exiftool],[Turns on exiftool support (EXPERIMENTAL, shall provide the EXIFTOOLLINK variable with library or object files and EXIFTOOLCXXFLAGS). Not recommended: slow. Use --enable-exif instead.]), [if test x$enableval = xyes; then fim_cv_exiftool=yes CXXFLAGS="$CXXFLAGS $EXIFTOOLCXXFLAGS" LIBS="$LIBS $EXIFTOOLLINK" AC_MSG_NOTICE([Enabling exiftool interface.]) AC_DEFINE(FIM_WANT_EXIFTOOL, 1, [If defined, exiftool will be used to get additional file information (EXPERIMENTAL).]) fi],[fim_cv_exiftool=no]) dnl #AC_DEFINE([FIM_DEFAULT_KEY_CONFIG] ,1, [Defined, if GPGME support is enabled]) #AC_DEFINE([FIM_DEFAULT_CONFIG], 1, [Defined, if GPGME support is enabled]) #AC_DEFINE([FIM_DEFAULT_CONFIGURATION], 1, [Defined, if GPGME support is enabled]) #AC_MSG_CHECKING(whether struct dirent defines d_ino) dnl ================== fim_cv_autocommands=yes AC_ARG_ENABLE(autocommands, AS_HELP_STRING([--disable-autocommands],[Fim will by default use autocommands.]), [if test x$enableval = xno; then fim_cv_autocommands=no fi]) AH_TEMPLATE([FIM_AUTOCMDS]) if test x$fim_cv_autocommands = xyes; then have_autocommands=yes AC_DEFINE([FIM_AUTOCMDS]) else have_autocommands=no fi dnl ================== AC_ARG_ENABLE(hardcoded-font, AS_HELP_STRING([--enable-hardcoded-font],[Enable a hardcoded font in the executable (good as a fallback (FBFONT=fim://) when no PSF format consolefonts files are available).]), [if test x$enableval = xyes; then fim_cv_hardcoded_font=yes; else fim_cv_hardcoded_font=no; fi],[ fim_cv_hardcoded_font=yes; ]) AH_TEMPLATE([FIM_WANT_HARDCODED_FONT]) if test x$fim_cv_hardcoded_font = xyes -a x$ac_cv_func_fmemopen = xyes ; then have_hardcoded_font=yes AC_DEFINE([FIM_WANT_HARDCODED_FONT],1,[Enable a hardcoded font in the executable.]) else have_hardcoded_font=no fi AM_CONDITIONAL(FIM_WANT_HARDCODED_CONSOLEFONT, test x$have_hardcoded_font = xyes ) dnl ================== AC_CHECK_PROG(have_gs,gs,yes,no) AM_CONDITIONAL(HAVE_GS, test x$have_gs = xyes) AM_CONDITIONAL(HAVE_FIMGS, test x$have_gs = xyes) dnl ================== AC_ARG_ENABLE(long-int-vars, AS_HELP_STRING([--enable-long-int-vars],[Internals shall use 64 bit integers (recommended).]), [if test x$enableval = xyes; then fim_cv_want_int64_int=yes; else fim_cv_want_int64_int=no; fi],[ fim_cv_want_int64_int=yes; ]) AH_TEMPLATE([FIM_WANT_LONG_INT]) if test x$fim_cv_want_int64_int = xyes; then AC_DEFINE([FIM_WANT_LONG_INT],1,[Internals shall use 64 bit integers.]) else AC_DEFINE([FIM_WANT_LONG_INT],0,[Internals shall use 64 bit integers.]) fi dnl ================== fim_cv_windows=yes AC_ARG_ENABLE(windows, AS_HELP_STRING([--disable-windows],[Disable windowing system in Fim. (deprecated)]), [if test x$enableval = xno; then fim_cv_windows=no fi]) AH_TEMPLATE([FIM_WINDOWS]) if test x$fim_cv_windows = xyes; then have_windows=yes AC_DEFINE([FIM_WINDOWS],1,[Fim windowing support]) else have_windows=no fi dnl ================== fim_cv_fimrc=yes AC_ARG_ENABLE(fimrc, AS_HELP_STRING([--disable-fimrc],[By default, load the personal ~/.fimrc file and a system configuration file.]), [if test x$enableval = xno; then fim_cv_fimrc=no fi]) AH_TEMPLATE([FIM_NOFIMRC]) if test x$fim_cv_fimrc = xyes; then have_fimrc=yes else AC_DEFINE([FIM_NOFIMRC]) fi AM_CONDITIONAL(WANT_DEFAULT_FIMRC, test x$fim_cv_fimrc = xyes) dnl ================== AH_TEMPLATE([FIM_NOHISTORY]) fim_cv_history=yes AC_ARG_ENABLE(history, AS_HELP_STRING([--disable-history],[Fim will by default load/save a ~/.fim_history file (note: depends on readline).]), [if test x$enableval = xno ; then fim_cv_history=no fi]) if test x$fim_want_readline = xno; then fim_cv_history=no; fi AM_CONDITIONAL(ENABLE_HISTORY, test x$fim_cv_history != xno) AH_TEMPLATE([FIM_NOHISTORY]) if test x$fim_cv_history != xyes; then AC_DEFINE([FIM_NOHISTORY]) fi dnl ================== fim_cv_warnings=no AC_ARG_ENABLE(screen, AS_HELP_STRING([--disable-screen],[Fim will try to work under screen by default (please read BUGS)]), [ if test x$enableval = xno; then fim_cv_screen=no else fim_cv_screen=yes fi ],[ fim_cv_screen=yes ] ) dnl ================== fim_cv_resize_optimizations=yes AC_ARG_ENABLE(resize-optimizations, AS_HELP_STRING([--disable-resize-optimizations],[Some old (fbi) code is optimized for speedup in fim.]), [ if test x$enableval = xno; then fim_cv_resize_optimizations=no else fim_cv_resize_optimizations=yes fi ],[ fim_cv_resize_optimizations=yes ] ) dnl ================== fim_cv_read_stdin_image=yes AC_ARG_ENABLE(stdin-image-reading, AS_HELP_STRING([--disable-stdin-image-reading],[Fim will read an image from stdin with the -i switch. (experimental)]), [ if test x$enableval = xno; then fim_cv_read_stdin_image=no else fim_cv_read_stdin_image=yes fi ],[ fim_cv_read_stdin_image=yes ] ) dnl ================== fim_cv_scan_consolefonts=yes AC_ARG_ENABLE(scan-consolefonts, AS_HELP_STRING([--enable-scan-consolefonts],[Fim will scan some predefined directory in look for console fonts as a fallback. (experimental)]), [ if test x$enableval = xyes; then fim_cv_scan_consolefonts=yes else fim_cv_scan_consolefonts=no fi ],[ fim_cv_scan_consolefonts=yes ] ) dnl ================== fim_cv_fb_console_switch_while_loading=no AC_ARG_ENABLE(framebuffer-switch-while-loading, AS_HELP_STRING([--enable-framebuffer-switch-while-loading],[Fim will be capable of redrawing while switching framebuffer console (makes only sense on very slow systems).]), [ if test x$enableval = xyes; then fim_cv_fb_console_switch_while_loading=yes else fim_cv_fb_console_switch_while_loading=no fi ],[ fim_cv_fb_console_switch_while_loading=no ] ) dnl ================== fim_cv_seek_magic=yes AC_ARG_ENABLE(seek-magic, AS_HELP_STRING([--disable-seek-magic],[Fim will be capable to seek on a specified magic string.]), [ if test x$enableval = xno; then fim_cv_seek_magic=no else fim_cv_seek_magic=yes fi ],[ fim_cv_seek_magic=yes ] ) dnl ================== fim_cv_paths_in_man=yes AC_ARG_ENABLE(paths-in-man, AS_HELP_STRING([--disable-paths-in-man],[Generate man pages with configure specified paths (e.g. sysconfdir, docdir).]), [ if test x$enableval = xno; then fim_cv_paths_in_man=no else fim_cv_paths_in_man=yes fi ],[ fim_cv_paths_in_man=yes ] ) dnl ================== AC_ARG_ENABLE(pushdir, AS_HELP_STRING([--enable-pushdir],[Fim will scan directories for files.]), [ if test x$enableval = xno; then fim_cv_read_dirs=no else fim_cv_read_dirs=yes fi ],[ fim_cv_read_dirs=yes ] ) dnl ================== AC_ARG_ENABLE(recursive-pushdir, AS_HELP_STRING([--disable-recursive-pushdir],[Fim will be able to push directories recursively (implies --enable-push-dirs )]), [ if test x$enableval = xyes; then fim_cv_recursive_dirs=yes; fim_cv_read_dirs=yes; else fim_cv_recursive_dirs=no; fi ],[ fim_cv_recursive_dirs=yes;fim_cv_read_dirs=yes; ] ) dnl ================== AH_TEMPLATE([FIM_RECURSIVE_DIRS]) AH_TEMPLATE([FIM_WANTS_SLOW_RESIZE]) AH_TEMPLATE([FIM_READ_DIRS]) AH_TEMPLATE([FIM_BOZ_PATCH]) AH_TEMPLATE([FIM_READ_STDIN]) AH_TEMPLATE([FIM_READ_STDIN_IMAGE]) AH_TEMPLATE([FIM_SMART_COMPLETION]) AH_TEMPLATE([FIM_LINUX_CONSOLEFONTS_DIR_SCAN]) dnl ================== if test x$fim_cv_resize_optimizations != xyes; then AC_DEFINE([FIM_WANTS_SLOW_RESIZE]) fi dnl ================== if test x$fim_cv_read_dirs = xyes; then AC_DEFINE([FIM_READ_DIRS]) if test x$fim_cv_recursive_dirs = xyes; then AC_DEFINE([FIM_RECURSIVE_DIRS]) fi fi AM_CONDITIONAL(WANT_RECURSIVE_DIRS, test x$fim_cv_recursive_dirs = xyes) dnl ================== if test x$fim_cv_screen != xno; then # boz patch is on AC_DEFINE([FIM_BOZ_PATCH]) fi dnl ================== fim_cv_read_stdin=yes if test x$fim_cv_read_stdin != xno; then AC_DEFINE([FIM_READ_STDIN]) fi dnl ================== dnl NOTE THAT IN THE CODE FIM_READ_STDIN_IMAGE depends on FIM_READ_STDIN, too if test x$fim_cv_read_stdin_image = xyes -a x$fim_cv_read_stdin = xyes; then AC_DEFINE([FIM_READ_STDIN_IMAGE]) else # we revert to no just for the printout fim_cv_read_stdin_image=no fi AM_CONDITIONAL(WANT_READ_STDIN_IMAGE, test x$fim_cv_read_stdin_image = xyes) dnl ================== fim_cv_warnings=no AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[Turns on debug options (for debugging -- developer stuff)]), [if test x$enableval = xyes; then fim_cv_debug=yes fi]) dnl ================== if test "x$fim_cv_debug" = xyes; then AC_CHECK_PROG([HAVE_VALGRIND],[valgrind],[yes],[no]) fi AM_CONDITIONAL(HAVE_VALGRIND, test x$HAVE_VALGRIND = xyes) dnl ================== fim_cv_warnings=no AC_ARG_ENABLE(warnings, AS_HELP_STRING([--enable-warnings],[Turns on compiler warnings (recommended, for debugging)]), [if test x$enableval = xyes; then fim_cv_warnings=yes fi]) if test x$GCC = xyes ; then if test x$fim_cv_debug = xyes; then CXXFLAGS="${CXXFLAGS} -g" fi fi if test x$GCC = xyes ; then if test x$fim_cv_warnings = xyes ; then CXXFLAGS="-Wall -pedantic $CXXFLAGS" fi fi dnl ================== dnl ================== dnl ==== Notice the name difference: libcaca, as opposed to aalib. AC_CHECK_LIB(caca, caca_create_canvas,fim_cv_lib_caca=yes,fim_cv_lib_caca=no) AC_ARG_ENABLE(caca, AS_HELP_STRING([--disable-caca],[Colour ASCII-Art (-o ca) support (via libcaca)]), [if test x$enableval != xno; then fim_cv_lib_caca=yes; else fim_cv_lib_caca=no; fi],[fim_cv_lib_caca=yes;]) if test x$fim_cv_lib_caca != xno; then if test x$ac_cv_lib_caca_caca_create_canvas = xyes; then AC_MSG_NOTICE([Enabling libcaca driver.]) fim_cv_libcaca=yes if test x$libcaca_config_prefix != x; then LIBCACA_CONFIG="$libcaca_config_prefix/bin/caca-config" else # default path configurator AC_PATH_PROG(LIBCACA_CONFIG, caca-config, no) fi if test "x$LIBCACA_CONFIG" = "xno"; then # uhm AC_MSG_WARN([*** no caca-config ? ***]) fim_cv_libcaca=no else CXXFLAGS="$CXXFLAGS `$LIBCACA_CONFIG --cflags`" LIBS="$LIBS `$LIBCACA_CONFIG --libs`" # finish this ! fi else fim_cv_libcaca=no fi else fim_cv_libcaca=no AC_MSG_WARN([Colour ASCII-Art (-o ca) support disabled.]) dnl AC_MSG_ERROR([Sorry, it does not seem like libcaca is installed or detectable. dnl Please run --disable-caca or install libcaca in a system-wide directory instead. dnl ]) fi dnl ================== # This code still awaits for integration ... AC_ARG_WITH(cflags, AS_HELP_STRING([--with-cflags=CXXFLAGS],[Specify a custom CXXFLAGS append value. e.g.: -pg You cannot call this argument multiple times. In case you want completely reset CXXFLAGS use : CXXFLAGS='' ./configure .. Note that Fim is a C++ program, so we set CXXFLAGS=CXXFLAGS. ]), [if test "x$withval" != x; then AC_DEFINE_UNQUOTED(CXXFLAGS, "$withval", [custom CXXFLAGS]) CXXFLAGS="$withval" CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS" AC_DEFINE_UNQUOTED(CXXFLAGS, "$withval", [custom CXXFLAGS]) dnl ...else CXXFLAGS="$CXXFLAGS" fi], [AC_DEFINE_UNQUOTED(EXECSHELL, "/bin/sh")]) dnl ================== # This code still awaits for integration ... AC_ARG_WITH(exec-shell, AS_HELP_STRING([--with-exec-shell=SHELL],[Specify alternate shell (ONLY if /bin/sh is broken)]), [if test x$withval != xyes; then AC_DEFINE_UNQUOTED(EXECSHELL, "$withval", [program to use for shell commands]) else AC_DEFINE_UNQUOTED(EXECSHELL, "/bin/sh") fi], [AC_DEFINE_UNQUOTED(EXECSHELL, "/bin/sh")]) dnl ================== AC_ARG_ENABLE(smartautocompletion, AS_HELP_STRING([--disable-smartautocompletion],[Fim will treat as a proper, unescaped string, nonquoted and nonevaluated strings which happen to match an existing filename.]), [ if test x$enableval = xno; then fim_cv_smartautcompletion=no else fim_cv_smartautcompletion=yes fi ],[ fim_cv_smartautcompletion=yes ] ) dnl ================== if test x$fim_cv_smartautcompletion = xyes; then AC_DEFINE([FIM_SMART_COMPLETION]) fi dnl ================== if test x$fim_cv_scan_consolefonts = xyes; then AC_DEFINE([FIM_LINUX_CONSOLEFONTS_DIR_SCAN]) fi dnl ================== AC_ARG_ENABLE(convert, AS_HELP_STRING([--disable-convert],[Fim will try to use convert (ImageMagick) as a last resort for opening unknown format files.]), [ if test x$enableval = xno; then fim_cv_convert=no else fim_cv_convert=yes fi ],[ fim_cv_convert=yes ] ) dnl ================== AC_ARG_ENABLE(xcftopnm, AS_HELP_STRING([--disable-xcftopnm],[Fim will try to use xcftopnm (Gimp) for opening XCF format files.]), [ if test x$enableval = xno; then fim_cv_xcftopnm=no else fim_cv_xcftopnm=yes fi ],[ fim_cv_xcftopnm=yes ] ) dnl ================== fim_cv_inkscape=yes AC_ARG_ENABLE(inkscape, AS_HELP_STRING([--disable-inkscape],[Fim will try to use Inkscape for opening SVG format files.]), [ if test x$enableval = xno; then fim_cv_inkscape=no else fim_cv_inkscape=yes fi ],[ fim_cv_inkscape=yes ] ) dnl ================== AC_ARG_ENABLE(xfig, AS_HELP_STRING([--disable-xfig],[Fim will try to use xfig (fig2dev) for opening FIG format files.]), [ if test x$enableval = xno; then fim_cv_xfig=no else fim_cv_xfig=yes fi ],[ fim_cv_xfig=yes ] ) dnl ================== AC_ARG_ENABLE(dia, AS_HELP_STRING([--disable-dia],[Fim will try to use dia for opening DIA format files.]), [ if test x$enableval = xno; then fim_cv_dia=no else fim_cv_dia=yes fi ],[ fim_cv_dia=yes ] ) dnl ================== AH_TEMPLATE([FIM_DEFAULT_CONSOLEFONT]) AC_ARG_WITH(default-consolefont, AS_HELP_STRING([--with-default-consolefont=FILE],[Specify a default consolefont (psf or psf.gz format) file.]), [ AC_DEFINE_UNQUOTED(FIM_DEFAULT_CONSOLEFONT, "$withval") ], [fim_cv_defaultconsolefont=""]) dnl ================== AC_ARG_WITH(custom-hardcoded-consolefont, AS_HELP_STRING([--with-custom-hardcoded-consolefont=FILE],[Specify a custom consolefont to be hardcoded (uncompressed psf format, absolute path) at build time (requires --enable-hardcoded-font).]), [ fim_cv_want_custom_hardcoded_consolefont=true; AC_SUBST(FIM_CUSTOM_HARDCODED_CONSOLEFONT, "$withval") ], []) AM_CONDITIONAL(FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT, test x$fim_cv_want_custom_hardcoded_consolefont = xtrue ) dnl ================== fim_cv_want_font_magnify_factor=0; AC_ARG_WITH(font-magnifying-factor, AS_HELP_STRING([--with-font-magnifying-factor=FACTOR],[If FACTOR>0, Will render text magnified by (hardcoded) FACTOR times. If FACTOR<=0, will allow run-time control of it via the _fbfont_magnify_factor variable. If negative, -FACTOR will be used as default. Default is 0 ]), [ fim_cv_want_font_magnify_factor="$withval"; ], []) AM_CONDITIONAL(FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT, test x$fim_cv_want_custom_hardcoded_consolefont = xtrue ) dnl ================== AM_CONDITIONAL([HAVE_RUNNABLE_TESTS],[test x"$host_cpu" = x"$build_cpu" -a x"$host_os" = x"$build_os" ]) dnl ================== dnl # /tmp/__FIM_TEMPORARY_FILE AC_ARG_WITH(tmpfile, AS_HELP_STRING([--with-tmpfile=FILE],[Specify where to put temporary files created when interacting with external conversion programs.]), [fim_cv_tmpfile=$withval], [fim_cv_tmpfile=""]) dnl ================== AC_ARG_ENABLE(custom-status-bar, AS_HELP_STRING([--disable-custom-status-bar],[Customization of status bar via a printf-like string.]), [ if test x$enableval = xno; then fim_cv_custom_status_bar=no; else fim_cv_custom_status_bar=yes; fi ],[ fim_cv_custom_status_bar=yes; ] ) dnl ================== AC_ARG_ENABLE(optimizations, AS_HELP_STRING([--enable-optimizations],[Will try to enhance compilation flags (EXPERIMENTAL)]), [ if test x$enableval = xno; then fim_cv_optimizations=no else fim_cv_optimizations=yes fi ],[ fim_cv_optimizations=no ] ) dnl ================== AH_TEMPLATE([FIM_TRY_XCFTOPNM]) AH_TEMPLATE([FIM_TRY_CONVERT]) AH_TEMPLATE([FIM_TRY_INKSCAPE]) AH_TEMPLATE([FIM_TRY_XFIG]) AH_TEMPLATE([FIM_TRY_DIA]) AH_TEMPLATE([FIM_USE_ZCAT]) dnl ================== AC_CHECK_PROG(have_zcat,zcat,yes,no) if test x$have_zcat = xyes ; then # legacy fbi feature : should not rely on this. FIXME AC_MSG_NOTICE([Fim will use 'zcat' to uncompress "gzipped" font files.]) AC_DEFINE([FIM_USE_ZCAT]) fi dnl 20110602 will use man --html-cat instead of obsolete man2html dnl AC_CHECK_PROG(have_man2html,man2html,yes,no) dnl if test x$have_man2html = xyes ; then dnl AC_MSG_NOTICE([The installer will try to invoke 'man2html' to build html versions of the man pages.]) dnl HTMLDOCS="FIM.html fim.man.html fimgs.man.html" dnl fi AC_CHECK_PROG(have_convert,convert,yes,no) if test x$have_convert = xyes -a x$fim_cv_convert = xyes ; then true dnl AC_MSG_WARN([Fim will try to invoke 'convert' to handle unknown format files, even if no 'convert' is currently in the program path: please install the Imagemagick package to obviate the problem or re-configure with --disable-convert.]) else fim_cv_convert=no fi AM_CONDITIONAL(WITH_CONVERT, test x$fim_cv_convert = xyes) AC_CHECK_PROG(have_xcftopnm,xcftopnm,yes,no) if test x$have_xcftopnm = xyes -a x$fim_cv_xcftopnm = xyes ; then true dnl AC_MSG_WARN([Fim will try to invoke 'xcftopnm' to handle XCF format files, even if no 'xcftopnm' is currently in the program path: please install the Gimp package to obviate the problem or re-configure with --disable-xcftopnm.]) else fim_cv_xcftopnm=no fi AC_CHECK_PROG(have_inkscape,inkscape,yes,no) if test x$have_inkscape = xyes -a x$fim_cv_inkscape = xyes ; then true dnl AC_MSG_WARN([Fim will try to invoke 'inkscape' to handle SVG format files, even if no 'inkscape' is currently in the program path: please install the Inkscape package to obviate the problem or re-configure with --disable-inkscape.]) else fim_cv_inkscape=no fi AM_CONDITIONAL(WITH_INKSCAPE, test x$fim_cv_inkscape = xyes) AC_CHECK_PROG(have_xfig,fig2dev,yes,no) if test x$have_xfig = xyes -a x$fim_cv_xfig = xyes ; then true dnl AC_MSG_WARN([Fim will try to invoke 'xfig' to handle FIG format files, even if no 'fig2dev' is currently in the program path: please install the Xfig package to obviate the problem or re-configure with --disable-xfig.]) else fim_cv_xfig=no fi AM_CONDITIONAL(WITH_XFIG, test x$have_xfig = xyes -a x$fim_cv_xfig = xyes) AC_CHECK_PROG(have_dia,dia,yes,no) if test x$have_dia = xyes -a x$fim_cv_dia = xyes ; then true dnl AC_MSG_WARN([Fim will try to invoke 'dia' to handle DIA format files, even if no 'dia' is currently in the program path: please install the Dia package to obviate the problem or re-configure with --disable-dia.]) else fim_cv_dia=no fi dnl ================== if test x$fim_cv_optimizations = xyes ; then uname=`uname` if test x$uname = xLinux ; then dnl AC_MSG_NOTICE([we run on linux! Good.]) if grep "^model name.*Pentium(R) 4" /proc/cpuinfo > /dev/null; then CXXFLAGS="$CXXFLAGS -march=native" fi else AC_MSG_NOTICE([uhm. try to specify your own optimizations..]) fi fi dnl ================== if test x$fim_cv_convert = xyes ; then AC_DEFINE([FIM_TRY_CONVERT]) fi if test x$fim_cv_xcftopnm = xyes ; then AC_DEFINE([FIM_TRY_XCFTOPNM]) fi if test x$fim_cv_inkscape = xyes ; then AC_DEFINE([FIM_TRY_INKSCAPE]) fi if test x$have_xfig = xyes -a x$fim_cv_xfig = xyes; then AC_DEFINE([FIM_TRY_XFIG]) fi if test x$have_dia = xyes ; then AC_DEFINE([FIM_TRY_DIA]) fi dnl ================== AH_TEMPLATE([FIM_WITH_LIBJASPER]) if test x$fim_cv_libjasper = xyes ; then AC_DEFINE([FIM_WITH_LIBJASPER]) fi dnl ================== AH_TEMPLATE([FIM_WITH_LIBEXIF]) if test x$fim_cv_libexif = xyes ; then AC_DEFINE([FIM_WITH_LIBEXIF]) fi dnl ================== AH_TEMPLATE([FIM_WITH_AALIB]) if test x$fim_cv_aalib = xyes ; then AC_DEFINE([FIM_WITH_AALIB]) fi AM_CONDITIONAL(ENABLE_AA, test x$fim_cv_aalib = xyes) dnl ================== AH_TEMPLATE([FIM_WITH_LIBCACA]) if test x$fim_cv_libcaca = xyes ; then AC_DEFINE([FIM_WITH_LIBCACA]) fi AM_CONDITIONAL(ENABLE_CACA, test x$fim_cv_libcaca = xyes) dnl ================== AH_TEMPLATE([FIM_WANT_FB_CONSOLE_SWITCH_WHILE_LOADING]) if test x$fim_cv_fb_console_switch_while_loading = xyes ; then AC_DEFINE([FIM_WANT_FB_CONSOLE_SWITCH_WHILE_LOADING]) fi dnl ================== AH_TEMPLATE([FIM_WANT_SEEK_MAGIC]) if test x$fim_cv_seek_magic = xyes -a x$ac_cv_func_memmem = xyes; then AC_DEFINE([FIM_WANT_SEEK_MAGIC]) fi dnl ================== AH_TEMPLATE([FIM_PATHS_IN_MAN]) if test x$fim_cv_paths_in_man = xyes ; then AC_DEFINE([FIM_PATHS_IN_MAN]) fi dnl ================== AH_TEMPLATE([FIM_WANT_FONT_MAGNIFY_FACTOR]) AC_DEFINE_UNQUOTED([FIM_WANT_FONT_MAGNIFY_FACTOR],$fim_cv_want_font_magnify_factor) dnl ================== AH_TEMPLATE([FIM_WANT_CUSTOM_INFO_STATUS_BAR]) if test x$fim_cv_custom_status_bar = xyes ; then AC_DEFINE([FIM_WANT_CUSTOM_INFO_STATUS_BAR]) fi dnl ================== AH_TEMPLATE([FIM_WANT_FILENAME_MARK_AND_DUMP]) AC_ARG_ENABLE(mark-and-dump, AS_HELP_STRING([--enable-mark-and-dump],[Fim will be capable of marking files while viewing and outputting their names on exit. (enabled by default)]), [ if test x$enableval = xyes; then fim_cv_want_mark_and_dump=1 ; else fim_cv_want_mark_and_dump=0 ; fi ],[ fim_cv_want_mark_and_dump=1 ]) AC_DEFINE_UNQUOTED([FIM_WANT_FILENAME_MARK_AND_DUMP], $fim_cv_want_mark_and_dump, [Fim will be capable of marking files while viewing and outputting their names on exit.]) dnl ================== AH_TEMPLATE([FIM_WANT_NOSCRIPTING]) AC_ARG_ENABLE(scripting, AS_HELP_STRING([--enable-scripting],[Scripting. (enabled by default)]), [ if test x$enableval = xyes; then fim_cv_want_noscripting=0 ; else fim_cv_want_noscripting=1 ; fi ],[ fim_cv_want_noscripting=0 ]) if test x$fim_cv_want_noscripting = x1 ; then AC_DEFINE_UNQUOTED([FIM_WANT_NOSCRIPTING], $fim_cv_want_noscripting, [Scripting. (enabled by default)]) fi dnl ================== AH_TEMPLATE([FIM_WANT_NO_OUTPUT_CONSOLE]) AC_ARG_ENABLE(output-console, AS_HELP_STRING([--enable-output-console],[Output console. (enabled by default)]), [ if test x$enableval = xyes; then fim_cv_want_no_output_console=0 ; else fim_cv_want_no_output_console=1 ; fi ],[ fim_cv_want_no_output_console=0 ]) if test x$fim_cv_want_no_output_console = x1 ; then AC_DEFINE_UNQUOTED([FIM_WANT_NO_OUTPUT_CONSOLE], $fim_cv_want_no_output_console, [Output console. (enabled by default)]) fi dnl ================== dnl AH_TEMPLATE([FIM_WANT_UNICODE]) dnl AC_ARG_ENABLE(unicode, AS_HELP_STRING([--enable-unicode],[Unicode. (Unimplemented, disabled by default)]), [ if test x$enableval = xyes; then fim_cv_want_unicode=1 ; else fim_cv_want_unicode=0 ; fi ],[ fim_cv_want_unicode=0 ]) dnl if test x$fim_cv_want_unicode = x1 ; then dnl # CXXFLAGS="$CXXFLAGS `freetype-config --cflags`" dnl # LIBS="$LIBS `freetype-config --libs`" dnl AC_DEFINE_UNQUOTED([FIM_WANT_UNICODE], $fim_cv_want_unicode, [Check for freetype library, with no feature behind: do not use this. (disabled by default)]) dnl fi dnl ================== AH_TEMPLATE([FIM_WANT_TEXT_RENDERING]) fim_want_astext=yes AC_ARG_ENABLE(as-text-rendering, AS_HELP_STRING([--disable-as-text-rendering],[Disable as-text rendering (viewing of any file as character bytes -- not to be confused with the ASCII art output).]), [ if test x$enableval = xno ; then fim_want_astext=no fi ]) if test x$fim_want_astext = xyes ; then AC_DEFINE_UNQUOTED([FIM_WANT_TEXT_RENDERING], 1, [Enables text rendering]) fi dnl ================== AH_TEMPLATE([FIM_WANT_RAW_BITS_RENDERING]) fim_want_rbr=yes AC_ARG_ENABLE(raw-bits-rendering, AS_HELP_STRING([--disable-raw-bits-rendering],[Disable raw bits rendering (viewing of any file as either a 1 or 24 bpp bitmap).]), [ if test x$enableval = xno ; then fim_want_rbr=no fi ]) if test x$fim_want_rbr = xyes ; then AC_DEFINE_UNQUOTED([FIM_WANT_RAW_BITS_RENDERING], 1, [Enables raw bits rendering]) fi AM_CONDITIONAL(ENABLE_RAW_BITS_RENDERING, test x$fim_want_rbr = xyes) dnl ================== AH_TEMPLATE([FIM_ALLOW_LOADER_STRING_SPECIFICATION]) fim_want_lss=yes AC_ARG_ENABLE(loader-string-specification, AS_HELP_STRING([--disable-loader-string-specification],[Disables the chance to specify a file loader.]), [ if test x$enableval = xno ; then fim_want_lss=no fi ]) if test x$fim_want_lss = xyes ; then AC_DEFINE_UNQUOTED([FIM_ALLOW_LOADER_STRING_SPECIFICATION], 1, [Allows the user to specify a file loader]) fi dnl ================== dnl uhmmmmmm : does not seem to work dnl AC_ARG_ENABLE(verbose_make,[Enables verbose macros passing to the compiler (for a funnier compilation process.)], dnl if test x$enableval = xyes; then dnl AC_SUBST(DEFS) dnl else dnl AC_CONFIG_HEADERS([config.h]) dnl fi,[]) AC_CONFIG_HEADERS([config.h]) AC_CHECK_PROG([HAVE_TIMEOUT],[timeout],[yes],[no]) AH_TEMPLATE([FIM_HAS_TIMEOUT]) if test x"$ac_cv_prog_HAVE_TIMEOUT" = x"yes"; then AC_MSG_NOTICE(Will use 'timeout ' in certain tests.) AC_SUBST(TIMEOUT_SMALL,"timeout --foreground 5") AC_SUBST(TIMEOUT_LARGE,"timeout --foreground 30") AC_DEFINE([FIM_HAS_TIMEOUT]) fi AH_TEMPLATE([FIM_RANDOM]) AC_DEFINE([FIM_RANDOM]) AH_TEMPLATE([FIM_DEFAULT_CONFIG]) AC_DEFINE([FIM_DEFAULT_CONFIG]) AH_TEMPLATE([FIM_NOFB]) AC_DEFINE([FIM_NOFB]) AH_TEMPLATE([FIM_RECORDING]) AC_DEFINE([FIM_RECORDING]) AH_TEMPLATE([FIM_SWITCH_FIXUP]) AC_DEFINE([FIM_SWITCH_FIXUP]) AH_TEMPLATE([FIM_CHECK_DUPLICATES]) AC_DEFINE([FIM_CHECK_DUPLICATES]) AH_TEMPLATE([FIM_CHECK_FILE_EXISTENCE]) AC_DEFINE([FIM_CHECK_FILE_EXISTENCE]) AH_TEMPLATE([FIM_REMOVE_FAILED]) AC_DEFINE([FIM_REMOVE_FAILED]) AH_TEMPLATE([FIM_AUTOSKIP_FAILED]) AC_DEFINE([FIM_AUTOSKIP_FAILED]) AH_TEMPLATE([FIM_COMMAND_AUTOCOMPLETION]) AC_DEFINE([FIM_COMMAND_AUTOCOMPLETION]) AH_TEMPLATE([FIM_NAMESPACES]) AC_DEFINE([FIM_NAMESPACES]) AH_TEMPLATE([FIM_CACHE_DEBUG]) dnl AC_DEFINE([FIM_CACHE_DEBUG]) AH_TEMPLATE([FIM_VERSION]) AC_DEFINE_UNQUOTED([FIM_VERSION],"${VERSION}") dnl AH_TEMPLATE([FIM_USE_X11_FONTS]) dnl AC_DEFINE([FIM_USE_X11_FONTS]) AH_TEMPLATE([FIM_TMP_FILENAME]) AC_DEFINE_UNQUOTED([FIM_TMP_FILENAME],"$fim_cv_tmpfile") AH_TEMPLATE([FIM_WITH_DEBUG]) if test "x$fim_cv_debug" = xyes; then AC_DEFINE([FIM_WITH_DEBUG]) else true; fi AM_CONDITIONAL(WITH_DEBUG, test "x$fim_cv_debug" = xyes) AH_TEMPLATE([FIM_ITERATED_COMMANDS]) AC_DEFINE([FIM_ITERATED_COMMANDS]) AH_TEMPLATE([FIM_SKIP_KNOWN_FILETYPES]) AC_DEFINE([FIM_SKIP_KNOWN_FILETYPES]) AH_TEMPLATE([FIM_EXPERIMENTAL_ROTATION]) AC_DEFINE([FIM_EXPERIMENTAL_ROTATION]) AH_TEMPLATE([FIM_KEEP_BROKEN_CONSOLE]) dnl AC_DEFINE([FIM_KEEP_BROKEN_CONSOLE]) AH_TEMPLATE([FIM_PIPE_IMAGE_READ]) AC_DEFINE([FIM_PIPE_IMAGE_READ]) AH_TEMPLATE([FIM_USE_DESIGNATED_INITIALIZERS]) dnl AC_DEFINE([FIM_USE_DESIGNATED_INITIALIZERS]) dnl AH_TEMPLATE([FIM_IS_SLOWER_THAN_FBI]) dnl AC_DEFINE([FIM_IS_SLOWER_THAN_FBI]) dnl AH_TEMPLATE([FIM_WITH_LIBSDL]) dnl AC_DEFINE([FIM_WITH_LIBSDL]) AH_TEMPLATE([FBI_AUTHOR]) AH_TEMPLATE([FBI_AUTHOR_NAME]) AH_TEMPLATE([FIM_AUTHOR]) AH_TEMPLATE([FIM_AUTHOR_NAME]) AH_TEMPLATE([FIM_AUTHOR_EMAIL]) AC_DEFINE([FIM_AUTHOR_NAME],["Michele Martone"]) AC_DEFINE([FIM_AUTHOR_EMAIL],[""]) AC_DEFINE([FIM_AUTHOR],["Michele Martone "]) # Note: Gerd changed his surname from Knorr to Hoffmann, so I report here his actual surname AC_DEFINE([FBI_AUTHOR_NAME],["Gerd Hoffmann"]) AC_DEFINE([FBI_AUTHOR],["Gerd Hoffmann "]) dnl ############################################################################### dnl this is experimental stuff dnl ############################################################################### want_matrices_rendering=no; AC_ARG_ENABLE(matrices-rendering, AS_HELP_STRING([--enable-matrices-rendering],[Uses librsb for rendering of Matrix Market files (must have librsb-config in the PATH).]), [ if test x$enableval = xyes; then if test x$ac_cv_func_rsb_lib_init = xyes; then AH_TEMPLATE([HAVE_MATRIX_MARKET_DECODER]) AC_DEFINE([HAVE_MATRIX_MARKET_DECODER]) #CXXFLAGS="$CXXFLAGS `librsb-config --cflags`" #LIBS="$LIBS `librsb-config --static --ldflags | sed s/-static//g`" want_matrices_rendering=yes; else AC_MSG_ERROR([Cannot detect librsb! Either disable matrix rendering or supply the right LIBS and CXXFLAGS!]) fi else true; fi ]) AM_CONDITIONAL(ENABLE_MATRIX_MARKET_DECODER, test x$ac_cv_func_rsb_lib_init = xyes -a x$want_matrices_rendering = xyes) dnl ############################################################################### AC_CACHE_CHECK([if you have c++11 ...], [have_cv_cxx11], AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #if __cplusplus<201103L #error using pre-c++11 #endif int main() { } ]])],[fim_cxx_standard=new],[fim_cxx_standard=old],[])) if test x"$fim_cxx_standard" = x"new"; then AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include void thread_function() { } ],[ std::thread t(&thread_function); t.join(); ])],[have_cv_thread_libs=yes],[have_cv_thread_libs=no],[have_cv_thread_libs=no;]) if test x$have_cv_thread_libs != xyes; then AC_MSG_NOTICE([Seemingly C++ threads need an extra library. Checking if -pthread solves this.]) AC_CHECK_LIB(pthread, pthread_create, LIBS="$LIBS -lpthread"; [AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include void thread_function() { } ],[ std::thread t(&thread_function); t.join(); ])],[AC_MSG_NOTICE([Yes, adding -lpthread allows using C++ threads.])],[],[;]) fim_cv_have_pthread_added=yes;], fim_cv_have_pthread_added=no) fi fi dnl ############################################################################### dnl ================== AC_SUBST(LIBS) AC_SUBST(FIM_DEFS) AC_SUBST(FIM_LIB_OBJECTS) AC_SUBST(FIM_SVN_REPOSITORY,[http://svn.savannah.nongnu.org/svn/fbi-improved/]) dnl we want these symbols defined in our code AC_SUBST(CXXFLAGS) #AC_CONFIG_FILES([Makefile],[src/Makefile]) AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile distros/Makefile scripts/Makefile scripts/maintenance/cron-build.sh scripts/maintenance/remote-build.sh scripts/maintenance/cron-svndump.pl scripts/maintenance/cron-rsync.sh ]) AC_OUTPUT #AC_OUTPUT AC_MSG_NOTICE([ Fim v${VERSION} has been configured as follows (features marked with * are not recommended: either unfinished or broken: please do NOT use them when building for a distro): default minimal key mapping : ${have_default_mapping:-no} default minimal key bindings : ${have_default_bindings:-no} default configuration file builtin : ${have_default_config:-no} dnl compile time warnings : ${fim_cv_warnings:-no} (additional CXXFLAGS: ${CXXFLAGS} ) resize optimizations : ${fim_cv_resize_optimizations:-no} system,popen calls wrappers enabled : ${fim_system_calls:-yes} will allow push of directories : ${fim_cv_read_dirs} will recurse directories (-R switch): ${fim_cv_recursive_dirs} dnl dvi file support (dvilib29) : ${fim_handle_dvi:-no} patch for running under screen : ${fim_cv_screen:-no} ~/.fimrc startup file support : ${have_fimrc:-no} ~/.fim_history load/save support : ${fim_cv_history:-no} autocommands enabled : ${have_autocommands:-no} dnl internal windowing system : ${have_windows:-no} hardcoded PSF font (FBFONT=fim://) : ${have_hardcoded_font:-no} will read image files from stdin(-i): ${fim_cv_read_stdin_image:-no} GNU regexps (default is Posix) :*${fim_cv_regex:-no} seek magic signatures : ${fim_cv_seek_magic:-no} man page with user configured paths : ${fim_cv_paths_in_man} framebuffer console load switchable :*${fim_cv_fb_console_switch_while_loading:-no} hardcoded font magnifying factor : ${fim_cv_want_font_magnify_factor} customizable status bar : ${fim_cv_custom_status_bar:-no} dnl use C++ standard (98/11/14/17) : ${fim_cxx_standard} dnl may revive this with *detected* language level one day dnl readline (-lrl) library support : ${fim_want_readline} use 'xcftopnm' for XCF files :*${fim_cv_xcftopnm} use 'inkscape' for SVG files : ${fim_cv_inkscape} use 'fig2dev' for FIG files : ${fim_cv_xfig} use 'convert' for unrecognized files:*${fim_cv_convert} use 'exiftool' for EXIF tags in JPEG:*${fim_cv_exiftool} dnl framebuffer (built-in) support : ${fim_handle_framebuffer:-yes} X (sdllib) support (-o sdl) : ${fim_handle_sdl} ASCII art (aalib) support (-o aa) : ${fim_cv_aalib} Colour ASCII art (libcaca) support : ${fim_cv_libcaca} X (Imlib2) support(-o imlib2):*${fim_handle_imlib2:-no} dnl EXIF (JPEG) tags support (libexif) : ${fim_cv_libexif} BMP file support (builtin) : ${fim_handle_bmp:-no} JP2 (JPEG-2K) file support (JasPer) : ${fim_cv_libjasper} PCX file support (builtin) : ${fim_handle_pcx:-no} PNG file support (libpng) : ${fim_handle_png:-no} JPEG file support (libjpeg) : ${fim_handle_jpeg:-no} TIFF file support (libtiff) : ${fim_handle_tiff:-no} GIF file support (libgif) : ${fim_handle_gif:-no} DJVU file support (libdjvu) :*${fim_handle_djvu:-no} PDF file support (libpoppler) :*${fim_handle_pdf:-no} PS file support (libspectre) :*${fim_handle_ps:-no} NEF/RAW file support (libufraw) :*${fim_handle_ufraw:-no} TAR/ZIP/.. file support (libarchive):*${fim_handle_archive:-no} GraphicsMagick support (libGraphicsMagick):*${fim_handle_graphicsmagick:-no} YACC : ${YACC} LEX : ${LEX} CXX : ${CXX} CXXFLAGS : ${CXXFLAGS} LIBS : ${LIBS} prefix : ${prefix} dnl LDFLAGS : ${LDFLAGS} dnl Still out: dnl LEXLIB dnl LIBAA_CONFIG dnl LIBPNG_CONFIG dnl LIBSDL_CONFIG dnl jasper ? dnl archive ? If you are not satisfied with this configuration, please invoke ./configure --help=short for a complete list of configure options and variables specific to Fim. When you are satisfied, run 'make' to build Fim and its documentation. To install the program and its documentation, run 'make install' if you are root, or run 'su -c '"make install"' if you are not root. RTFM: README, man fim, man fimrc. Enjoy! ]) fim-0.6-rc2/AUTHORS0000644000175000017500000000024714454347340010622 00000000000000FIM - Fbi IMproved was conceived and coded by: Michele Martone FIM extends the original code and functionality of: FBI - FrameBuffer Image viewer, by Gerd Knorr fim-0.6-rc2/configure0000755000175000017500000155402214503403454011461 00000000000000#! /bin/sh # From configure.ac Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for fim 0.6-rc2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: dezperado_FOobAr_autistici_Baz_org, by replacing $0: _FOobAr_ with a @ and _Baz_ with a . about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='fim' PACKAGE_TARNAME='fim' PACKAGE_VERSION='0.6-rc2' PACKAGE_STRING='fim 0.6-rc2' PACKAGE_BUGREPORT='dezperado_FOobAr_autistici_Baz_org, by replacing _FOobAr_ with a @ and _Baz_ with a .' PACKAGE_URL='' ac_unique_file="src/fim.cpp" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS FIM_SVN_REPOSITORY FIM_LIB_OBJECTS FIM_DEFS ENABLE_MATRIX_MARKET_DECODER_FALSE ENABLE_MATRIX_MARKET_DECODER_TRUE WITH_DEBUG_FALSE WITH_DEBUG_TRUE TIMEOUT_LARGE TIMEOUT_SMALL HAVE_TIMEOUT ENABLE_RAW_BITS_RENDERING_FALSE ENABLE_RAW_BITS_RENDERING_TRUE ENABLE_CACA_FALSE ENABLE_CACA_TRUE ENABLE_AA_FALSE ENABLE_AA_TRUE have_dia WITH_XFIG_FALSE WITH_XFIG_TRUE have_xfig WITH_INKSCAPE_FALSE WITH_INKSCAPE_TRUE have_inkscape have_xcftopnm WITH_CONVERT_FALSE WITH_CONVERT_TRUE have_convert have_zcat HAVE_RUNNABLE_TESTS_FALSE HAVE_RUNNABLE_TESTS_TRUE FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_FALSE FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE FIM_CUSTOM_HARDCODED_CONSOLEFONT LIBCACA_CONFIG HAVE_VALGRIND_FALSE HAVE_VALGRIND_TRUE HAVE_VALGRIND WANT_READ_STDIN_IMAGE_FALSE WANT_READ_STDIN_IMAGE_TRUE WANT_RECURSIVE_DIRS_FALSE WANT_RECURSIVE_DIRS_TRUE ENABLE_HISTORY_FALSE ENABLE_HISTORY_TRUE WANT_DEFAULT_FIMRC_FALSE WANT_DEFAULT_FIMRC_TRUE HAVE_FIMGS_FALSE HAVE_FIMGS_TRUE HAVE_GS_FALSE HAVE_GS_TRUE have_gs FIM_WANT_HARDCODED_CONSOLEFONT_FALSE FIM_WANT_HARDCODED_CONSOLEFONT_TRUE ENABLE_SDL_FALSE ENABLE_SDL_TRUE LIBSDL2_CONFIG LIBSDL_CONFIG LIBAA_CONFIG ENABLE_ARCHIVE_FALSE ENABLE_ARCHIVE_TRUE ENABLE_PNG_FALSE ENABLE_PNG_TRUE LIBPNG LIBPNG_CONFIG ENABLE_PCX_FALSE ENABLE_PCX_TRUE ENABLE_BMP_FALSE ENABLE_BMP_TRUE ENABLE_PDF_FALSE ENABLE_PDF_TRUE ENABLE_POPPLER_FALSE ENABLE_POPPLER_TRUE GLIB_LIBS GLIB_CFLAGS POPPLER_LIBS POPPLER_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG ENABLE_DJVU_FALSE ENABLE_DJVU_TRUE ENABLE_PS_FALSE ENABLE_PS_TRUE ENABLE_JPEG_FALSE ENABLE_JPEG_TRUE WANT_READLINE_FALSE WANT_READLINE_TRUE ENABLE_TIFF_FALSE ENABLE_TIFF_TRUE ENABLE_GIF_FALSE ENABLE_GIF_TRUE fim_cv_version LIBOBJS WITH_FLEXLEXER_FALSE WITH_FLEXLEXER_TRUE ENABLE_FRAMEBUFFER_FALSE ENABLE_FRAMEBUFFER_TRUE CXXCPP WITH_EXPECT_FALSE WITH_EXPECT_TRUE EXPECT WITH_PERL_FALSE WITH_PERL_TRUE WITH_MAN2HTML_FALSE WITH_MAN2HTML_TRUE WITH_SHELLCHECK_FALSE WITH_SHELLCHECK_TRUE SHELLCHECK PERL MAN CAT SORT ECHO SED RM LIBPOPPLER LIBDJVU LIBPS LIBJPEG LIBGIF LIBTIFF HAVE_MAN HAVE_CAT HAVE_AWK HAVE_CPP HAVE_SORT HAVE_GREP HAVE_SED HAVE_RM HAVE_ECHO HAVE_BISON HAVE_FLEX ENABLE_IMLIB2_FALSE ENABLE_IMLIB2_TRUE WITH_LIBGRAPHICSMAGICK_FALSE WITH_LIBGRAPHICSMAGICK_TRUE MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE FIM_LIBS CONFIG_STATUS_DEPENDENCIES AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc AR ac_ct_CXX CXXFLAGS CXX RANLIB INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM LEXLIB LEX_OUTPUT_ROOT LEX YFLAGS YACC EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC FIM_CONFIGURATION SVN_REVISION_NUMBER SVN_REVISION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_silent_rules enable_largefile enable_maintainer_mode enable_graphicsmagick enable_imlib2 enable_default_bindings enable_default_mapping enable_default_config enable_system enable_framebuffer enable_static with_regex enable_gif enable_tiff enable_readline enable_jpeg enable_ps enable_djvu enable_poppler enable_pdf enable_bmp enable_pcx with_png_prefix enable_png enable_xyz enable_ufraw enable_archive enable_exif enable_jasper enable_aa with_sdl_prefix enable_sdl enable_exiftool enable_autocommands enable_hardcoded_font enable_long_int_vars enable_windows enable_fimrc enable_history enable_screen enable_resize_optimizations enable_stdin_image_reading enable_scan_consolefonts enable_framebuffer_switch_while_loading enable_seek_magic enable_paths_in_man enable_pushdir enable_recursive_pushdir enable_debug enable_warnings enable_caca with_cflags with_exec_shell enable_smartautocompletion enable_convert enable_xcftopnm enable_inkscape enable_xfig enable_dia with_default_consolefont with_custom_hardcoded_consolefont with_font_magnifying_factor with_tmpfile enable_custom_status_bar enable_optimizations enable_mark_and_dump enable_scripting enable_output_console enable_as_text_rendering enable_raw_bits_rendering enable_loader_string_specification enable_matrices_rendering ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP YACC YFLAGS CXX CXXFLAGS CCC LIBTIFF LIBGIF LIBJPEG LIBPS LIBDJVU LIBPOPPLER CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR POPPLER_CFLAGS POPPLER_LIBS GLIB_CFLAGS GLIB_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -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=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures fim 0.6-rc2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/fim] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of fim 0.6-rc2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --disable-largefile omit support for large files --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-graphicsmagick Enable GraphicsMagick library support (EXPERIMENTAL). --enable-imlib2 Enable Imlib2 library support (EXPERIMENTAL,INCOMPLETE). --disable-default-bindings Builtin default minimal key binding --disable-default-mapping Builtin default minimal key mapping --disable-default-config Builtin default minimal configuration --disable-system Disable system() and pipe() calls. --disable-framebuffer Disable the framebuffer device driver. --enable-static Want a static binary. (disabled by default) --disable-gif Disable gif support. --disable-tiff Disable tiff support. --disable-readline Disable readline support (EXPERIMENTAL). --disable-jpeg Disable jpeg support. --disable-ps Disable ps support. --disable-djvu Disable djvu support. --enable-poppler Enable poppler (PDF rendering) support. This will try to detect extra compilation flags. You can override this by passing configure with POPPLER_CFLAGS=... . --enable-pdf Compile with pdf support --disable-bmp Disable BMP file support (enabled by default). --disable-pcx Disable PCX file support (enabled by default). --disable-png Disable png support. --enable-xyz Enable the sample bogus 'xyz' file loading support. This makes only sense in order to learn how to include a new file format and wish to play with src/FbiStuffXyz.cpp in the while. --enable-ufraw Enable UFRaw support (EXPERIMENTAL). --enable-archive Enable libarchive support to view archive files as multipage documents (please provide ARCHIVE_LIBS, ARCHIVE_CXXFLAGS) (EXPERIMENTAL, INCOMPLETE). --disable-exif JPEG EXIF tags support with libexif. --enable-jasper Turns on JPEG-2000 files support using JasPer (EXPERIMENTAL) --disable-aa Ascii Art (-o aa) support (via aalib) --disable-sdl Disable libsdl support. Or --enable-sdl=1 --enable-sdl=2 to give preference to one those two versions. Requires either sdl-config or sdl2-config. Some configurations require prepending PKG_CONFIG=pkg-config before configure, for sdl2-config to work. --enable-exiftool Turns on exiftool support (EXPERIMENTAL, shall provide the EXIFTOOLLINK variable with library or object files and EXIFTOOLCXXFLAGS). Not recommended: slow. Use --enable-exif instead. --disable-autocommands Fim will by default use autocommands. --enable-hardcoded-font Enable a hardcoded font in the executable (good as a fallback (FBFONT=fim://) when no PSF format consolefonts files are available). --enable-long-int-vars Internals shall use 64 bit integers (recommended). --disable-windows Disable windowing system in Fim. (deprecated) --disable-fimrc By default, load the personal ~/.fimrc file and a system configuration file. --disable-history Fim will by default load/save a ~/.fim_history file (note: depends on readline). --disable-screen Fim will try to work under screen by default (please read BUGS) --disable-resize-optimizations Some old (fbi) code is optimized for speedup in fim. --disable-stdin-image-reading Fim will read an image from stdin with the -i switch. (experimental) --enable-scan-consolefonts Fim will scan some predefined directory in look for console fonts as a fallback. (experimental) --enable-framebuffer-switch-while-loading Fim will be capable of redrawing while switching framebuffer console (makes only sense on very slow systems). --disable-seek-magic Fim will be capable to seek on a specified magic string. --disable-paths-in-man Generate man pages with configure specified paths (e.g. sysconfdir, docdir). --enable-pushdir Fim will scan directories for files. --disable-recursive-pushdir Fim will be able to push directories recursively (implies --enable-push-dirs ) --enable-debug Turns on debug options (for debugging -- developer stuff) --enable-warnings Turns on compiler warnings (recommended, for debugging) --disable-caca Colour ASCII-Art (-o ca) support (via libcaca) --disable-smartautocompletion Fim will treat as a proper, unescaped string, nonquoted and nonevaluated strings which happen to match an existing filename. --disable-convert Fim will try to use convert (ImageMagick) as a last resort for opening unknown format files. --disable-xcftopnm Fim will try to use xcftopnm (Gimp) for opening XCF format files. --disable-inkscape Fim will try to use Inkscape for opening SVG format files. --disable-xfig Fim will try to use xfig (fig2dev) for opening FIG format files. --disable-dia Fim will try to use dia for opening DIA format files. --disable-custom-status-bar Customization of status bar via a printf-like string. --enable-optimizations Will try to enhance compilation flags (EXPERIMENTAL) --enable-mark-and-dump Fim will be capable of marking files while viewing and outputting their names on exit. (enabled by default) --enable-scripting Scripting. (enabled by default) --enable-output-console Output console. (enabled by default) --disable-as-text-rendering Disable as-text rendering (viewing of any file as character bytes -- not to be confused with the ASCII art output). --disable-raw-bits-rendering Disable raw bits rendering (viewing of any file as either a 1 or 24 bpp bitmap). --disable-loader-string-specification Disables the chance to specify a file loader. --enable-matrices-rendering Uses librsb for rendering of Matrix Market files (must have librsb-config in the PATH). Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-regex Obsolete switch -- do not use this. (deprecated) --with-png-prefix=PFX prefix where libpng is installed (optional) --with-sdl-prefix=PFX prefix where libsdl is installed (optional) --with-cflags=CXXFLAGS Specify a custom CXXFLAGS append value. e.g.: -pg You cannot call this argument multiple times. In case you want completely reset CXXFLAGS use : CXXFLAGS='' ./configure .. Note that Fim is a C++ program, so we set CXXFLAGS=CXXFLAGS. --with-exec-shell=SHELL Specify alternate shell (ONLY if /bin/sh is broken) --with-default-consolefont=FILE Specify a default consolefont (psf or psf.gz format) file. --with-custom-hardcoded-consolefont=FILE Specify a custom consolefont to be hardcoded (uncompressed psf format, absolute path) at build time (requires --enable-hardcoded-font). --with-font-magnifying-factor=FACTOR If FACTOR>0, Will render text magnified by (hardcoded) FACTOR times. If FACTOR<=0, will allow run-time control of it via the _fbfont_magnify_factor variable. If negative, -FACTOR will be used as default. Default is 0 --with-tmpfile=FILE Specify where to put temporary files created when interacting with external conversion programs. Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CXX C++ compiler command CXXFLAGS C++ compiler flags LIBTIFF libtiff library (contributes to LIBS) LIBGIF libgif library (contributes to LIBS) LIBJPEG libjpeg library (contributes to LIBS) LIBPS libspectre library (contributes to LIBS) LIBDJVU libdjvu libdjvulibre (contributes to LIBS) LIBPOPPLER poppler libdjvulibre (contributes to LIBS) CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path POPPLER_CFLAGS C compiler flags for POPPLER, overriding pkg-config POPPLER_LIBS linker flags for POPPLER, overriding pkg-config GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF fim configure 0.6-rc2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ## ## Report this to dezperado_FOobAr_autistici_Baz_org ## ## bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_compute_int LINENO EXPR VAR INCLUDES # ---------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_cxx_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ## ## Report this to dezperado_FOobAr_autistici_Baz_org ## ## bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by fim $as_me 0.6-rc2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_list " stdlib.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_header_list " sys/param.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test x"19851986" != x ; then # The above test gets evaluated when creating the configure script. $as_echo "#define SVN_REVISION \"19851986\"" >>confdefs.h SVN_REVISION="19851986" $as_echo "#define SVN_REVISION_NUMBER 19851986" >>confdefs.h SVN_REVISION_NUMBER=19851986 fi FIM_CONFIGURATION="$0 $@" cat >>confdefs.h <<_ACEOF #define FIM_CONFIGURATION "$FIM_CONFIGURATION" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: Welcome to the Fim (revision $SVN_REVISION) configure script! This script will create the right Makefile for building Fim on your system. But first, it will check if your system has the right configuration for Fim to build. There are options to this script, please run : ./configure --help=short for a complete list of these options. Please read BUGS and README and report any bug found to the Fim maintainer! " >&5 $as_echo "$as_me: Welcome to the Fim (revision $SVN_REVISION) configure script! This script will create the right Makefile for building Fim on your system. But first, it will check if your system has the right configuration for Fim to build. There are options to this script, please run : ./configure --help=short for a complete list of these options. Please read BUGS and README and report any bug found to the Fim maintainer! " >&6;} #AM_CONFIG_HEADER([config.h]) #AC_CONFIG_SRCDIR(pinentry/pinentry.h) # #AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION) ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h #AC_MANTAINER_MODE #AC_CANONICAL_HOST #missing_dir=`cd $ac_aux_dir && pwd` #AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) #AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) #AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) #AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) #AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" 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 "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #AC_PROG_CXXCPP if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="ar" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi fim_cv_version=`cat $srcdir/VERSION` ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #AC_LANG_PUSH([C++]) am__api_version='1.16' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='fim' VERSION='0.6-rc2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi # 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 #AM_INIT_AUTOMAKE(fim, $fim_cv_version) #AM_INIT_AUTOMAKE(fim, 1.0) CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/VERSION' #AC_LANG_POP([C++]) fim="fim" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prefix" >&5 $as_echo_n "checking for prefix... " >&6; } if test x$prefix = xNONE; then fim_cv_prefix=$ac_default_prefix else fim_cv_prefix=$prefix fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fim_cv_prefix" >&5 $as_echo "$fim_cv_prefix" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_strerror+:} false; then : break fi done if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi #AM_C_PROTOTYPES if test "x$U" != "x"; then as_fn_error $? "Compiler not ANSI compliant" "$LINENO" 5 fi #AC_PROG_CPP { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } if ${ac_cv_sys_largefile_source+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_sys_largefile_source=no; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_sys_largefile_source=1; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 $as_echo "$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF ;; esac rm -rf conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 $as_echo_n "checking size of off_t... " >&6; } if ${ac_cv_sizeof_off_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : else if test "$ac_cv_type_off_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 $as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_fn_cxx_check_func "$LINENO" "getenv" "ac_cv_func_getenv" if test "x$ac_cv_func_getenv" = xyes; then : $as_echo "#define HAVE_GETENV 1" >>confdefs.h fi ac_fn_cxx_check_func "$LINENO" "getline" "ac_cv_func_getline" if test "x$ac_cv_func_getline" = xyes; then : $as_echo "#define HAVE_GETLINE 1" >>confdefs.h fi ac_fn_cxx_check_func "$LINENO" "getdelim" "ac_cv_func_getdelim" if test "x$ac_cv_func_getdelim" = xyes; then : $as_echo "#define HAVE_GETDELIM 1" >>confdefs.h fi ac_fn_cxx_check_func "$LINENO" "fgetln" "ac_cv_func_fgetln" if test "x$ac_cv_func_fgetln" = xyes; then : $as_echo "#define HAVE_FGETLN 1" >>confdefs.h fi ac_fn_cxx_check_func "$LINENO" "get_current_dir_name" "ac_cv_func_get_current_dir_name" if test "x$ac_cv_func_get_current_dir_name" = xyes; then : $as_echo "#define HAVE_GET_CURRENT_DIR_NAME 1" >>confdefs.h fi ac_fn_cxx_check_func "$LINENO" "rsb_lib_init" "ac_cv_func_rsb_lib_init" if test "x$ac_cv_func_rsb_lib_init" = xyes; then : fi ac_fn_cxx_check_func "$LINENO" "pipe" "ac_cv_func_pipe" if test "x$ac_cv_func_pipe" = xyes; then : fi ac_fn_cxx_check_func "$LINENO" "memmem" "ac_cv_func_memmem" if test "x$ac_cv_func_memmem" = xyes; then : $as_echo "#define HAVE_MEMMEM 1" >>confdefs.h fi ac_fn_cxx_check_func "$LINENO" "sync" "ac_cv_func_sync" if test "x$ac_cv_func_sync" = xyes; then : $as_echo "#define HAVE_SYNC 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } if ${ac_cv_lib_m_pow+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pow (); int main () { return pow (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_m_pow=yes else ac_cv_lib_m_pow=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yylex in -lfl" >&5 $as_echo_n "checking for yylex in -lfl... " >&6; } if ${ac_cv_lib_fl_yylex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char yylex (); int main () { return yylex (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_fl_yylex=yes else ac_cv_lib_fl_yylex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fl_yylex" >&5 $as_echo "$ac_cv_lib_fl_yylex" >&6; } if test "x$ac_cv_lib_fl_yylex" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBFL 1 _ACEOF LIBS="-lfl $LIBS" fi # Check whether --enable-graphicsmagick was given. if test "${enable_graphicsmagick+set}" = set; then : enableval=$enable_graphicsmagick; if test x$enableval != xno ; then fim_handle_graphicsmagick=yes ; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GetMagickVersion in -lGraphicsMagick" >&5 $as_echo_n "checking for GetMagickVersion in -lGraphicsMagick... " >&6; } if ${ac_cv_lib_GraphicsMagick_GetMagickVersion+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGraphicsMagick $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char GetMagickVersion (); int main () { return GetMagickVersion (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_GraphicsMagick_GetMagickVersion=yes else ac_cv_lib_GraphicsMagick_GetMagickVersion=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GraphicsMagick_GetMagickVersion" >&5 $as_echo "$ac_cv_lib_GraphicsMagick_GetMagickVersion" >&6; } if test "x$ac_cv_lib_GraphicsMagick_GetMagickVersion" = xyes; then : if test x"$fim_handle_graphicsmagick" = x"yes" ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffMagick.o"; LIBS="$LIBS `GraphicsMagick-config --cppflags --ldflags --libs|tr '\n' ' '` "; CXXFLAGS="$CXXFLAGS `GraphicsMagick-config --cppflags |tr '\n' ' '` "; $as_echo "#define HAVE_LIBGRAPHICSMAGICK 1" >>confdefs.h fi else fim_handle_graphicsmagick=no; fi if test x$fim_handle_graphicsmagick = xyes; then WITH_LIBGRAPHICSMAGICK_TRUE= WITH_LIBGRAPHICSMAGICK_FALSE='#' else WITH_LIBGRAPHICSMAGICK_TRUE='#' WITH_LIBGRAPHICSMAGICK_FALSE= fi # Check whether --enable-imlib2 was given. if test "${enable_imlib2+set}" = set; then : enableval=$enable_imlib2; if test x$enableval != xno ; then fim_handle_imlib2=yes ; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for imlib_create_image in -lImlib2" >&5 $as_echo_n "checking for imlib_create_image in -lImlib2... " >&6; } if ${ac_cv_lib_Imlib2_imlib_create_image+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lImlib2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char imlib_create_image (); int main () { return imlib_create_image (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_Imlib2_imlib_create_image=yes else ac_cv_lib_Imlib2_imlib_create_image=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Imlib2_imlib_create_image" >&5 $as_echo "$ac_cv_lib_Imlib2_imlib_create_image" >&6; } if test "x$ac_cv_lib_Imlib2_imlib_create_image" = xyes; then : if test x"$fim_handle_imlib2" = x"yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Imlib2 support is still INCOMPLETE, you should better use sdl!" >&5 $as_echo "$as_me: WARNING: Imlib2 support is still INCOMPLETE, you should better use sdl!" >&2;} FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS Imlib2Device.o"; LIBS="$LIBS `imlib2-config --libs|tr '\n' ' '` "; CXXFLAGS="$CXXFLAGS `imlib2-config --cflags |tr '\n' ' '` "; $as_echo "#define FIM_WITH_LIBIMLIB2 1" >>confdefs.h fi else fim_handle_imlib2=no; fi if test x"$fim_handle_imlib2" = x"yes"; then ENABLE_IMLIB2_TRUE= ENABLE_IMLIB2_FALSE='#' else ENABLE_IMLIB2_TRUE='#' ENABLE_IMLIB2_FALSE= fi # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_FLEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_FLEX"; then ac_cv_prog_HAVE_FLEX="$HAVE_FLEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_FLEX="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_FLEX" && ac_cv_prog_HAVE_FLEX="no" fi fi HAVE_FLEX=$ac_cv_prog_HAVE_FLEX if test -n "$HAVE_FLEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_FLEX" >&5 $as_echo "$HAVE_FLEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "bison", so it can be a program name with args. set dummy bison; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_BISON+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_BISON"; then ac_cv_prog_HAVE_BISON="$HAVE_BISON" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_BISON="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_BISON" && ac_cv_prog_HAVE_BISON="no" fi fi HAVE_BISON=$ac_cv_prog_HAVE_BISON if test -n "$HAVE_BISON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_BISON" >&5 $as_echo "$HAVE_BISON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$HAVE_FLEX != x"yes" ; then as_fn_error $? "No flex (lexical analyser generator) executable detected!" "$LINENO" 5 ; fi if test x$HAVE_BISON != x"yes" ; then as_fn_error $? "No bison (parser generator) executable detected!" "$LINENO" 5 ; fi # Extract the first word of "echo", so it can be a program name with args. set dummy echo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_ECHO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_ECHO"; then ac_cv_prog_HAVE_ECHO="$HAVE_ECHO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_ECHO="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_ECHO" && ac_cv_prog_HAVE_ECHO="no" fi fi HAVE_ECHO=$ac_cv_prog_HAVE_ECHO if test -n "$HAVE_ECHO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_ECHO" >&5 $as_echo "$HAVE_ECHO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_RM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_RM"; then ac_cv_prog_HAVE_RM="$HAVE_RM" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_RM="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_RM" && ac_cv_prog_HAVE_RM="no" fi fi HAVE_RM=$ac_cv_prog_HAVE_RM if test -n "$HAVE_RM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RM" >&5 $as_echo "$HAVE_RM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_SED+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_SED"; then ac_cv_prog_HAVE_SED="$HAVE_SED" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_SED="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_SED" && ac_cv_prog_HAVE_SED="no" fi fi HAVE_SED=$ac_cv_prog_HAVE_SED if test -n "$HAVE_SED"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_SED" >&5 $as_echo "$HAVE_SED" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_GREP"; then ac_cv_prog_HAVE_GREP="$HAVE_GREP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_GREP="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_GREP" && ac_cv_prog_HAVE_GREP="no" fi fi HAVE_GREP=$ac_cv_prog_HAVE_GREP if test -n "$HAVE_GREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_GREP" >&5 $as_echo "$HAVE_GREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "sort", so it can be a program name with args. set dummy sort; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_SORT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_SORT"; then ac_cv_prog_HAVE_SORT="$HAVE_SORT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_SORT="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_SORT" && ac_cv_prog_HAVE_SORT="no" fi fi HAVE_SORT=$ac_cv_prog_HAVE_SORT if test -n "$HAVE_SORT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_SORT" >&5 $as_echo "$HAVE_SORT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "cpp", so it can be a program name with args. set dummy cpp; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_CPP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_CPP"; then ac_cv_prog_HAVE_CPP="$HAVE_CPP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_CPP="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_CPP" && ac_cv_prog_HAVE_CPP="no" fi fi HAVE_CPP=$ac_cv_prog_HAVE_CPP if test -n "$HAVE_CPP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_CPP" >&5 $as_echo "$HAVE_CPP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "awk", so it can be a program name with args. set dummy awk; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_AWK"; then ac_cv_prog_HAVE_AWK="$HAVE_AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_AWK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_AWK" && ac_cv_prog_HAVE_AWK="no" fi fi HAVE_AWK=$ac_cv_prog_HAVE_AWK if test -n "$HAVE_AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_AWK" >&5 $as_echo "$HAVE_AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "cat", so it can be a program name with args. set dummy cat; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_CAT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_CAT"; then ac_cv_prog_HAVE_CAT="$HAVE_CAT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_CAT="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_CAT" && ac_cv_prog_HAVE_CAT="no" fi fi HAVE_CAT=$ac_cv_prog_HAVE_CAT if test -n "$HAVE_CAT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_CAT" >&5 $as_echo "$HAVE_CAT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "man", so it can be a program name with args. set dummy man; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_MAN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_MAN"; then ac_cv_prog_HAVE_MAN="$HAVE_MAN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_MAN="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_MAN" && ac_cv_prog_HAVE_MAN="no" fi fi HAVE_MAN=$ac_cv_prog_HAVE_MAN if test -n "$HAVE_MAN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_MAN" >&5 $as_echo "$HAVE_MAN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi #AC_CHECK_PROG([HAVE_WHICH],[which],[yes],[no]) #AC_CHECK_PROG([HAVE_GPG],[gpg],[yes],[no]) #AC_CHECK_PROG([HAVE_LS],[ls],[yes],[no]) #AC_CHECK_PROG([HAVE_CD],[cd],[yes],[no]) #AC_CHECK_PROG([HAVE_CC],[cc],[yes],[no]) # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_RM+:} false; then : $as_echo_n "(cached) " >&6 else case $RM in [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_RM" && ac_cv_path_RM="no" ;; esac fi RM=$ac_cv_path_RM if test -n "$RM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 $as_echo "$RM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_SED" && ac_cv_path_SED="no" ;; esac fi SED=$ac_cv_path_SED if test -n "$SED"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 $as_echo "$SED" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else case $GREP in [\\/]* | ?:[\\/]*) ac_cv_path_GREP="$GREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="no" ;; esac fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5 $as_echo "$GREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "echo", so it can be a program name with args. set dummy echo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECHO+:} false; then : $as_echo_n "(cached) " >&6 else case $ECHO in [\\/]* | ?:[\\/]*) ac_cv_path_ECHO="$ECHO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECHO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ECHO" && ac_cv_path_ECHO="no" ;; esac fi ECHO=$ac_cv_path_ECHO if test -n "$ECHO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECHO" >&5 $as_echo "$ECHO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "sort", so it can be a program name with args. set dummy sort; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SORT+:} false; then : $as_echo_n "(cached) " >&6 else case $SORT in [\\/]* | ?:[\\/]*) ac_cv_path_SORT="$SORT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_SORT" && ac_cv_path_SORT="no" ;; esac fi SORT=$ac_cv_path_SORT if test -n "$SORT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SORT" >&5 $as_echo "$SORT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "cpp", so it can be a program name with args. set dummy cpp; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CPP+:} false; then : $as_echo_n "(cached) " >&6 else case $CPP in [\\/]* | ?:[\\/]*) ac_cv_path_CPP="$CPP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CPP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_CPP" && ac_cv_path_CPP="no" ;; esac fi CPP=$ac_cv_path_CPP if test -n "$CPP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "awk", so it can be a program name with args. set dummy awk; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_AWK+:} false; then : $as_echo_n "(cached) " >&6 else case $AWK in [\\/]* | ?:[\\/]*) ac_cv_path_AWK="$AWK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_AWK" && ac_cv_path_AWK="no" ;; esac fi AWK=$ac_cv_path_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "cat", so it can be a program name with args. set dummy cat; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CAT+:} false; then : $as_echo_n "(cached) " >&6 else case $CAT in [\\/]* | ?:[\\/]*) ac_cv_path_CAT="$CAT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_CAT" && ac_cv_path_CAT="no" ;; esac fi CAT=$ac_cv_path_CAT if test -n "$CAT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5 $as_echo "$CAT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "man", so it can be a program name with args. set dummy man; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MAN+:} false; then : $as_echo_n "(cached) " >&6 else case $MAN in [\\/]* | ?:[\\/]*) ac_cv_path_MAN="$MAN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MAN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MAN" && ac_cv_path_MAN="no" ;; esac fi MAN=$ac_cv_path_MAN if test -n "$MAN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAN" >&5 $as_echo "$MAN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "shellcheck", so it can be a program name with args. set dummy shellcheck; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SHELLCHECK+:} false; then : $as_echo_n "(cached) " >&6 else case $SHELLCHECK in [\\/]* | ?:[\\/]*) ac_cv_path_SHELLCHECK="$SHELLCHECK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SHELLCHECK="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_SHELLCHECK" && ac_cv_path_SHELLCHECK="no" ;; esac fi SHELLCHECK=$ac_cv_path_SHELLCHECK if test -n "$SHELLCHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHELLCHECK" >&5 $as_echo "$SHELLCHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$ac_cv_path_SHELLCHECK != xno; then WITH_SHELLCHECK_TRUE= WITH_SHELLCHECK_FALSE='#' else WITH_SHELLCHECK_TRUE='#' WITH_SHELLCHECK_FALSE= fi if test x$ac_cv_path_MAN != xno; then WITH_MAN2HTML_TRUE= WITH_MAN2HTML_FALSE='#' else WITH_MAN2HTML_TRUE='#' WITH_MAN2HTML_FALSE= fi if test x$ac_cv_path_PERL != xno; then WITH_PERL_TRUE= WITH_PERL_FALSE='#' else WITH_PERL_TRUE='#' WITH_PERL_FALSE= fi #AC_PATH_PROG([CC],[cc],[no]) #AC_PATH_PROG([WHICH],[which],[no]) #AC_PATH_PROG([GPG],[gpg],[no]) #AC_PATH_PROG([LS],[ls],[no]) #AC_PATH_PROG([CD],[cd],[no]) # Extract the first word of "expect", so it can be a program name with args. set dummy expect; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_EXPECT+:} false; then : $as_echo_n "(cached) " >&6 else case $EXPECT in [\\/]* | ?:[\\/]*) ac_cv_path_EXPECT="$EXPECT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_EXPECT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_EXPECT" && ac_cv_path_EXPECT="no" ;; esac fi EXPECT=$ac_cv_path_EXPECT if test -n "$EXPECT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXPECT" >&5 $as_echo "$EXPECT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$ac_cv_path_EXPECT != xno; then WITH_EXPECT_TRUE= WITH_EXPECT_FALSE='#' else WITH_EXPECT_TRUE='#' WITH_EXPECT_FALSE= fi # FIXME: what if we have no grep and/or no sed ? # (echo is often a shell builtin) have_default_bindings=yes have_default_mapping=yes have_default_config=yes # Check whether --enable-default_bindings was given. if test "${enable_default_bindings+set}" = set; then : enableval=$enable_default_bindings; if test x$enableval = xyes; then have_default_bindings=yes else have_default_bindings=no fi fi # Check whether --enable-default_mapping was given. if test "${enable_default_mapping+set}" = set; then : enableval=$enable_default_mapping; if test x$enableval = xyes; then have_default_mapping=yes else have_default_mapping=no fi fi # Check whether --enable-default_config was given. if test "${enable_default_config+set}" = set; then : enableval=$enable_default_config; if test x$enableval = xyes; then have_default_config=yes else have_default_config=no fi fi if test x$have_default_bindings != xno; then FIM_DEFS="$FIM_DEFS -D FIM_DEFAULT_CONFIG" $as_echo "#define FIM_DEFAULT_CONFIG 1" >>confdefs.h fi if test x$have_default_mapping != xno; then FIM_DEFS="$FIM_DEFS -D FIM_DEFAULT_KEY_CONFIG" $as_echo "#define FIM_DEFAULT_KEY_CONFIG 1" >>confdefs.h fi if test x$have_default_config != xno; then FIM_DEFS="$FIM_DEFS -D FIM_DEFAULT_CONFIGURATION" $as_echo "#define FIM_DEFAULT_CONFIGURATION 1" >>confdefs.h fi #CPPFLAGS=$DEPS #AC_SUBST(LIBSDL_CXXFLAGS) #AC_SUBST(LIBPNG_CXXFLAGS) #AC_SUBST(LIBSDL_CXXFLAGS) #AC_SUBST(LIBPNG_CXXFLAGS) #AC_SUBST(LIBPNG_LIBS) # Check whether --enable-system was given. if test "${enable_system+set}" = set; then : enableval=$enable_system; if test x$enableval = xno ; then fim_system_calls=no fi fi # Check whether --enable-framebuffer was given. if test "${enable_framebuffer+set}" = set; then : enableval=$enable_framebuffer; if test x$enableval = xno ; then fim_handle_framebuffer=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for headers required by the Linux framebuffer device." >&5 $as_echo "$as_me: Checking for headers required by the Linux framebuffer device." >&6;} ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu for ac_header in linux/fb.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "linux/fb.h" "ac_cv_header_linux_fb_h" "$ac_includes_default" if test "x$ac_cv_header_linux_fb_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LINUX_FB_H 1 _ACEOF break else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find linux/fb.h. Fim Linux framebuffer driver requires it!." >&5 $as_echo "$as_me: WARNING: Cannot find linux/fb.h. Fim Linux framebuffer driver requires it!." >&2;} fi done for ac_header in linux/vt.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "linux/vt.h" "ac_cv_header_linux_vt_h" "$ac_includes_default" if test "x$ac_cv_header_linux_vt_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LINUX_VT_H 1 _ACEOF break else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find linux/vt.h. Fim Linux framebuffer driver requires it!." >&5 $as_echo "$as_me: WARNING: Cannot find linux/vt.h. Fim Linux framebuffer driver requires it!." >&2;} fi done for ac_header in linux/kd.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "linux/kd.h" "ac_cv_header_linux_kd_h" "$ac_includes_default" if test "x$ac_cv_header_linux_kd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LINUX_KD_H 1 _ACEOF break else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find linux/kd.h. Fim Linux framebuffer driver requires it!." >&5 $as_echo "$as_me: WARNING: Cannot find linux/kd.h. Fim Linux framebuffer driver requires it!." >&2;} fi done if test x$ac_cv_header_linux_fb_h != xyes -o \ x$ac_cv_header_linux_vt_h != xyes -o \ x$ac_cv_header_linux_kd_h != xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Turning off Linux framebuffer support due to missing headers" >&5 $as_echo "$as_me: WARNING: Turning off Linux framebuffer support due to missing headers" >&2;} fim_handle_framebuffer=no fi if test x$fim_handle_framebuffer = xno ; then $as_echo "#define FIM_WITH_NO_FRAMEBUFFER 1" >>confdefs.h fi if test x$fim_handle_framebuffer != xno; then ENABLE_FRAMEBUFFER_TRUE= ENABLE_FRAMEBUFFER_FALSE='#' else ENABLE_FRAMEBUFFER_TRUE='#' ENABLE_FRAMEBUFFER_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" for ac_header in $ac_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do : ac_fn_cxx_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" if test "x$ac_cv_func_getpagesize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETPAGESIZE 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 $as_echo_n "checking for working mmap... " >&6; } if ${ac_cv_func_mmap_fixed_mapped+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_mmap_fixed_mapped=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; const char *cdata2; int i, pagesize; int fd, fd2; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) return 2; if (write (fd, data, pagesize) != pagesize) return 3; close (fd); /* Next, check that the tail of a page is zero-filled. File must have non-zero length, otherwise we risk SIGBUS for entire page. */ fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd2 < 0) return 4; cdata2 = ""; if (write (fd2, cdata2, 1) != 1) return 5; data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); if (data2 == MAP_FAILED) return 6; for (i = 0; i < pagesize; ++i) if (*(data2 + i)) return 7; close (fd2); if (munmap (data2, pagesize)) return 8; /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) return 9; if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 10; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) return 11; /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) return 12; if (read (fd, data3, pagesize) != pagesize) return 13; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) return 14; close (fd); free (data); free (data3); return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_mmap_fixed_mapped=yes else ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 $as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then $as_echo "#define HAVE_MMAP 1" >>confdefs.h fi rm -f conftest.mmap conftest.txt for ac_func in bzero memset memcmp strncmp strcpy do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in bcopy bcmp do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in drand48 random rand do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in fileno do : ac_fn_cxx_check_func "$LINENO" "fileno" "ac_cv_func_fileno" if test "x$ac_cv_func_fileno" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FILENO 1 _ACEOF fi done for ac_func in fmemopen do : ac_fn_cxx_check_func "$LINENO" "fmemopen" "ac_cv_func_fmemopen" if test "x$ac_cv_func_fmemopen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FMEMOPEN 1 _ACEOF fi done for ac_header in wordexp.h glob.h fnmatch.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done #AC_CHECK_HEADERS([stddef.h]) #AC_CHECK_HEADERS([stdlib.h]) for ac_header in string.h strings.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF for ac_func in strerror do : ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR 1 _ACEOF fi done fi done for ac_header in stdint.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H 1 _ACEOF fi done for ac_header in wchar.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" if test "x$ac_cv_header_wchar_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WCHAR_H 1 _ACEOF fi done for ac_header in fontconfig/fontconfig.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "fontconfig/fontconfig.h" "ac_cv_header_fontconfig_fontconfig_h" "$ac_includes_default" if test "x$ac_cv_header_fontconfig_fontconfig_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FONTCONFIG_FONTCONFIG_H 1 _ACEOF fi done for ac_header in fontconfig/fcfreetype.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "fontconfig/fcfreetype.h" "ac_cv_header_fontconfig_fcfreetype_h" "$ac_includes_default" if test "x$ac_cv_header_fontconfig_fcfreetype_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FONTCONFIG_FCFREETYPE_H 1 _ACEOF fi done ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi for ac_header in stdarg.h sys/ioctl.h ioctl.h sysexits.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/time.h sys/resource.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/select.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" if test "x$ac_cv_header_sys_select_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SELECT_H 1 _ACEOF fi done for ac_header in sys/wait.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" if test "x$ac_cv_header_sys_wait_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi done for ac_header in time.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" if test "x$ac_cv_header_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TIME_H 1 _ACEOF fi done for ac_header in unix.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "unix.h" "ac_cv_header_unix_h" "$ac_includes_default" if test "x$ac_cv_header_unix_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNIX_H 1 _ACEOF fi done for ac_header in libgen.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default" if test "x$ac_cv_header_libgen_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGEN_H 1 _ACEOF fi done for ac_header in sys/user.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/user.h" "ac_cv_header_sys_user_h" "$ac_includes_default" if test "x$ac_cv_header_sys_user_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_USER_H 1 _ACEOF fi done for ac_header in sys/mman.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" if test "x$ac_cv_header_sys_mman_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_MMAN_H 1 _ACEOF fi done for ac_header in cstdio stdio.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF break else as_fn_error $? "Cannot find cstdio or stdio.h. Fim requires at least one or the other." "$LINENO" 5 fi done for ac_header in climits limits.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF break else as_fn_error $? "Cannot find limits.h nor climits. Fim requires it!." "$LINENO" 5 fi done for ac_header in filesystem do : ac_fn_cxx_check_header_mongrel "$LINENO" "filesystem" "ac_cv_header_filesystem" "$ac_includes_default" if test "x$ac_cv_header_filesystem" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FILESYSTEM 1 _ACEOF $as_echo "#define HAVE_FILESYSTEM 1" >>confdefs.h fi done # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int *" >&5 $as_echo_n "checking size of int *... " >&6; } if ${ac_cv_sizeof_int_p+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (int *))" "ac_cv_sizeof_int_p" "$ac_includes_default"; then : else if test "$ac_cv_type_int_p" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int *) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int_p=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int_p" >&5 $as_echo "$ac_cv_sizeof_int_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT_P $ac_cv_sizeof_int_p _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 $as_echo_n "checking size of size_t... " >&6; } if ${ac_cv_sizeof_size_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : else if test "$ac_cv_type_size_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (size_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_size_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 $as_echo "$ac_cv_sizeof_size_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) fim_big_endian=yes;; #( no) fim_big_endian=no ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) fim_big_endian=hmmm ;; esac if test "x$fim_big_endian" = "xyes" ; then $as_echo "#define FIM_BIG_ENDIAN 1" >>confdefs.h fi for ac_header in regex do : ac_fn_cxx_check_header_mongrel "$LINENO" "regex" "ac_cv_header_regex" "$ac_includes_default" if test "x$ac_cv_header_regex" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_REGEX 1 _ACEOF fi done if test x$ac_cv_header_regex = xyes; then $as_echo "#define HAVE_REGEX 1" >>confdefs.h fi for ac_header in _regex.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "_regex.h" "ac_cv_header__regex_h" "$ac_includes_default" if test "x$ac_cv_header__regex_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__REGEX_H 1 _ACEOF fi done if test x$ac_cv_header__regex_h = xyes; then $as_echo "#define HAVE__REGEX_H 1" >>confdefs.h fi for ac_header in regex.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "regex.h" "ac_cv_header_regex_h" "$ac_includes_default" if test "x$ac_cv_header_regex_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_REGEX_H 1 _ACEOF fi done if test x$ac_cv_header_regex_h = xyes; then $as_echo "#define HAVE_REGEX_H 1" >>confdefs.h fi for ac_header in termios.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TERMIOS_H 1 _ACEOF fi done if test x$ac_cv_header_termios_h = xyes; then $as_echo "#define HAVE_TERMIOS_H 1" >>confdefs.h fi if test x$ac_cv_header_sys_ioctl_h = xyes; then $as_echo "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h fi if test x$ac_cv_header_sys_select_h = xyes; then $as_echo "#define HAVE_SYS_SELECT_H 1" >>confdefs.h fi if test x$ac_cv_header_sys_wait_h = xyes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi for ac_header in FlexLexer.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "FlexLexer.h" "ac_cv_header_FlexLexer_h" "$ac_includes_default" if test "x$ac_cv_header_FlexLexer_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FLEXLEXER_H 1 _ACEOF break else as_fn_error $? "Cannot find FlexLexer. Fim requires it!" "$LINENO" 5 fi done if test x$ac_cv_func_pipe = xyes; then $as_echo "#define HAVE_PIPE 1" >>confdefs.h fi if test x$ac_cv_header_FlexLexer_h = xyes; then $as_echo "#define HAVE_FLEXLEXER_H 1" >>confdefs.h fi if test x$ac_cv_header_FlexLexer_h = xyes; then WITH_FLEXLEXER_TRUE= WITH_FLEXLEXER_FALSE='#' else WITH_FLEXLEXER_TRUE='#' WITH_FLEXLEXER_FALSE= fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; if test x$enableval = xyes; then fim_cv_want_static=1 ; else fim_cv_want_static=0 ; fi else fim_cv_want_static=0 fi if test x$fim_cv_want_static = x1 ; then LIBS="$LIBS --static" LIBDJVU_STATIC_EXTRA="-lpthread" # too many dependencies for the following! LIBPOPPLER_STATIC_EXTRA="" LIBSPECTRE_STATIC_EXTRA="" #LIBPOPPLER_STATIC_EXTRA="-lfreetype -llcms" #LIBSPECTRE_STATIC_EXTRA="-Wl,--start-group -lgs -lfontconfig -ldl -ljbig2dec -ljasper -lpthread -lpng -lppd -lpaper -lavahi-common -lavahi-client -lexpat -lfreetype -lgnutls -ldbus-1 -ltasn1 -lcupsimage -lcups -lgcrypt -Wl,--end-group " LIBTIFF_STATIC_EXTRA="-ljpeg -lz" cat >>confdefs.h <<_ACEOF #define FIM_WANT_STATIC_BINARY $fim_cv_want_static Want a static binary. (disabled by default) _ACEOF fi # Check whether --with-regex was given. if test "${with_regex+set}" = set; then : withval=$with_regex; fim_cv_regex=yes else for ac_func in regcomp do : ac_fn_cxx_check_func "$LINENO" "regcomp" "ac_cv_func_regcomp" if test "x$ac_cv_func_regcomp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_REGCOMP 1 _ACEOF fim_cv_regex=no else fim_cv_regex=yes fi done fi if test X$ac_cv_header__regex_h = Xno ; then fim_cv_regex=no; fi if test X$fim_cv_regex = Xno ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your system regexp library is completely broken" >&5 $as_echo_n "checking whether your system regexp library is completely broken... " >&6; } if ${fim_cv_regex_broken+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : fim_cv_regex_broken=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main() { regex_t blah ; /*regmatch_t p; p.rm_eo = p.rm_eo;*/ const int rr = regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec (&blah, "foobar", 0, NULL, 0); regfree(&blah); return rr; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : fim_cv_regex_broken=no else fim_cv_regex_broken=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fim_cv_regex_broken" >&5 $as_echo "$fim_cv_regex_broken" >&6; } if test X$fim_cv_regex_broken = Xyes ; then echo "Using the included GNU regex instead." >&6 fim_cv_regex=yes fi fi if test X$fim_cv_regex = Xyes -a X$ac_cv_header__regex_h != Xno; then $as_echo "#define USE_GNU_REGEX 1" >>confdefs.h case " $LIBOBJS " in *" regex.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS regex.$ac_objext" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to put the documentation..." >&5 $as_echo_n "checking where to put the documentation...... " >&6; } # FIXME : the above line seems troublesome, BUT IT IS NOT (see the muttrc for this trick). { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fim_cv_docdir" >&5 $as_echo "$fim_cv_docdir" >&6; } # Check whether --enable-gif was given. if test "${enable_gif+set}" = set; then : enableval=$enable_gif; if test x$enableval = xno ; then fim_handle_gif=no fi fi if test x$fim_handle_gif != xno ; then fim_handle_gif=yes have_gif=yes if test x$with_libgif != xno && test -z "$LIBGIF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifOpenFileHandle in -lgif" >&5 $as_echo_n "checking for DGifOpenFileHandle in -lgif... " >&6; } if ${ac_cv_lib_gif_DGifOpenFileHandle_+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char DGifOpenFileHandle (); int main () { return DGifOpenFileHandle (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_gif_DGifOpenFileHandle_=yes else ac_cv_lib_gif_DGifOpenFileHandle_=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifOpenFileHandle_" >&5 $as_echo "$ac_cv_lib_gif_DGifOpenFileHandle_" >&6; } if test "x$ac_cv_lib_gif_DGifOpenFileHandle_" = xyes; then : have_gif=yes else have_gif=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** GIF loader will not be built (GIF library not found) ***" >&5 $as_echo "$as_me: WARNING: *** GIF loader will not be built (GIF library not found) ***" >&2;} fi if test x"$have_gif" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gif.h" >&5 $as_echo_n "checking for gif.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : have_gif=yes else have_gif=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gif" >&5 $as_echo "$have_gif" >&6; } if test x"$have_gif" = xyes; then LIBGIF='-lgif' else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** GIF loader will not be built (GIF header file not found) ***" >&5 $as_echo "$as_me: WARNING: *** GIF loader will not be built (GIF header file not found) ***" >&2;} fi fi fi # if test x$with_libgif != xno ; then # the following needs thorough testing if test x"$have_gif" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffGif.o" LIBS="$LIBS $LIBGIF" $as_echo "#define FIM_HANDLE_GIF 1" >>confdefs.h else fim_handle_gif=no fi # if test x$with_libgif != xno && test -z "$LIBGIF"; then # # fi else fim_handle_gif=no fi if test x$have_gif = xyes; then ENABLE_GIF_TRUE= ENABLE_GIF_FALSE='#' else ENABLE_GIF_TRUE='#' ENABLE_GIF_FALSE= fi # Check whether --enable-tiff was given. if test "${enable_tiff+set}" = set; then : enableval=$enable_tiff; if test x$enableval = xno ; then fim_handle_tiff=no fi fi if test x$fim_handle_tiff != xno ; then fim_handle_tiff=yes have_tiff=yes if test x$with_libtiff != xno && test -z "$LIBTIFF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 $as_echo_n "checking for TIFFOpen in -ltiff... " >&6; } if ${ac_cv_lib_tiff_TIFFOpen_+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $LIBTIFF_STATIC_EXTRA $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char TIFFOpen (); int main () { return TIFFOpen (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_tiff_TIFFOpen_=yes else ac_cv_lib_tiff_TIFFOpen_=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen_" >&5 $as_echo "$ac_cv_lib_tiff_TIFFOpen_" >&6; } if test "x$ac_cv_lib_tiff_TIFFOpen_" = xyes; then : have_tiff=yes else have_tiff=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** TIFF loader will not be built (TIFF library not found) ***" >&5 $as_echo "$as_me: WARNING: *** TIFF loader will not be built (TIFF library not found) ***" >&2;} fi if test x"$have_tiff" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tiff.h" >&5 $as_echo_n "checking for tiff.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : have_tiff=yes else have_tiff=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_tiff" >&5 $as_echo "$have_tiff" >&6; } if test x"$have_tiff" = xyes; then LIBTIFF="-ltiff $LIBTIFF_STATIC_EXTRA" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** TIFF loader will not be built (TIFF header file not found) ***" >&5 $as_echo "$as_me: WARNING: *** TIFF loader will not be built (TIFF header file not found) ***" >&2;} fi fi fi # if test x$with_libtiff != xno ; then # the following needs thorough testing if test x"$have_tiff" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffTiff.o" LIBS="$LIBS $LIBTIFF" $as_echo "#define FIM_HANDLE_TIFF 1" >>confdefs.h else fim_handle_tiff=no fi # if test x$with_libtiff != xno && test -z "$LIBTIFF"; then # # fi else fim_handle_tiff=no fi if test x$have_tiff = xyes; then ENABLE_TIFF_TRUE= ENABLE_TIFF_FALSE='#' else ENABLE_TIFF_TRUE='#' ENABLE_TIFF_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for noecho in -lcurses" >&5 $as_echo_n "checking for noecho in -lcurses... " >&6; } if ${ac_cv_lib_curses_noecho+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char noecho (); int main () { return noecho (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_curses_noecho=yes else ac_cv_lib_curses_noecho=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_noecho" >&5 $as_echo "$ac_cv_lib_curses_noecho" >&6; } if test "x$ac_cv_lib_curses_noecho" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCURSES 1 _ACEOF LIBS="-lcurses $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for noecho in -lncurses" >&5 $as_echo_n "checking for noecho in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_noecho+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char noecho (); int main () { return noecho (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_ncurses_noecho=yes else ac_cv_lib_ncurses_noecho=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_noecho" >&5 $as_echo "$ac_cv_lib_ncurses_noecho" >&6; } if test "x$ac_cv_lib_ncurses_noecho" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNCURSES 1 _ACEOF LIBS="-lncurses $LIBS" fi # AC_CHECK_LIB(gpm,Gpm_Open, # ,true, # AC_MSG_ERROR(*** gpm lib not found ... no problem ... ***)) #LIBS="$LIBS -lgpm" fim_want_readline=yes # Check whether --enable-readline was given. if test "${enable_readline+set}" = set; then : enableval=$enable_readline; if test x$enableval = xno ; then fim_want_readline=no else fim_want_readline=yes fi fi have_readline=no # Sometimes the readline library is linked to the curses library, and we here try to detect this case.. if test x$have_readline = xno; then if test x$fim_want_readline = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_replace_line in -lreadline" >&5 $as_echo_n "checking for rl_replace_line in -lreadline... " >&6; } if ${ac_cv_lib_readline_rl_replace_line+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rl_replace_line (); int main () { return rl_replace_line (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_rl_replace_line=yes else ac_cv_lib_readline_rl_replace_line=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_rl_replace_line" >&5 $as_echo "$ac_cv_lib_readline_rl_replace_line" >&6; } if test "x$ac_cv_lib_readline_rl_replace_line" = xyes; then : have_readline=yes LIBS="$LIBS -lreadline" $as_echo "#define FIM_USE_READLINE 1" >>confdefs.h else have_readline=no as_fn_error $? "*** GNU readline (or curses library ?) not found (used LIBS=${LIBS}) ! please install them or specify them in e.g. LIBS=... or run ./configure --disable-readline ***" "$LINENO" 5 fi else have_readline=no { $as_echo "$as_me:${as_lineno-$LINENO}: *** Fim will be built withoud GNU readline library headers ! Are you sure ? ***" >&5 $as_echo "$as_me: *** Fim will be built withoud GNU readline library headers ! Are you sure ? ***" >&6;} fi fi if test x$have_readline = xyes; then if test x$fim_want_readline = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tputs in -lcurses" >&5 $as_echo_n "checking for tputs in -lcurses... " >&6; } if ${ac_cv_lib_curses_tputs+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char tputs (); int main () { return tputs (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_curses_tputs=yes else ac_cv_lib_curses_tputs=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_tputs" >&5 $as_echo "$ac_cv_lib_curses_tputs" >&6; } if test "x$ac_cv_lib_curses_tputs" = xyes; then : have_curses=yes LIBS="$LIBS" else have_curses=no fi fi fi if test x$have_readline = xyes; then WANT_READLINE_TRUE= WANT_READLINE_FALSE='#' else WANT_READLINE_TRUE='#' WANT_READLINE_FALSE= fi #AC_ARG_WITH(jpeg, [ --disable-jpeg ], [ disable jpeg file support]) # Check whether --enable-jpeg was given. if test "${enable_jpeg+set}" = set; then : enableval=$enable_jpeg; if test x$enableval = xno ; then fim_handle_jpeg=no fi fi if test x$fim_handle_jpeg != xno ; then fim_handle_jpeg=yes have_jpeg=yes if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_destroy_decompress in -ljpeg" >&5 $as_echo_n "checking for jpeg_destroy_decompress in -ljpeg... " >&6; } if ${ac_cv_lib_jpeg_jpeg_destroy_decompress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jpeg_destroy_decompress (); int main () { return jpeg_destroy_decompress (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_jpeg_jpeg_destroy_decompress=yes else ac_cv_lib_jpeg_jpeg_destroy_decompress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_destroy_decompress" >&5 $as_echo "$ac_cv_lib_jpeg_jpeg_destroy_decompress" >&6; } if test "x$ac_cv_lib_jpeg_jpeg_destroy_decompress" = xyes; then : have_jpeg=yes else have_jpeg=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** JPEG loader will not be built (JPEG library not found) ***" >&5 $as_echo "$as_me: WARNING: *** JPEG loader will not be built (JPEG library not found) ***" >&2;} fi if test x"$have_jpeg" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeglib.h" >&5 $as_echo_n "checking for jpeglib.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : have_jpeg=yes else have_jpeg=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_jpeg" >&5 $as_echo "$have_jpeg" >&6; } if test x"$have_jpeg" = xyes; then LIBJPEG='-ljpeg' else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** JPEG loader will not be built (JPEG header file not found) ***" >&5 $as_echo "$as_me: WARNING: *** JPEG loader will not be built (JPEG header file not found) ***" >&2;} fi fi fi # if test x$with_libjpeg != xno ; then # the following needs thorough testing if test x"$have_jpeg" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffJpeg.o" LIBS="$LIBS $LIBJPEG" $as_echo "#define HAVE_LIBJPEG 1" >>confdefs.h else fim_handle_jpeg=no fi # if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then # AC_MSG_ERROR([ # Checks for JPEG loader failed. You can build without it by passing # --disable-jpeg to ./configure. ]) # fi else fim_handle_jpeg=no fi if test x$fim_handle_jpeg = xyes; then ENABLE_JPEG_TRUE= ENABLE_JPEG_FALSE='#' else ENABLE_JPEG_TRUE='#' ENABLE_JPEG_FALSE= fi # Check whether --enable-ps was given. if test "${enable_ps+set}" = set; then : enableval=$enable_ps; if test x$enableval = xno ; then fim_handle_ps=no fi fi if test x$fim_handle_ps != xno ; then fim_handle_ps=yes have_ps=yes if test x$with_libps != xno && test -z "$LIBPS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for spectre_page_render in -lspectre" >&5 $as_echo_n "checking for spectre_page_render in -lspectre... " >&6; } if ${ac_cv_lib_spectre_spectre_page_render+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lspectre $LIBSPECTRE_STATIC_EXTRA $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char spectre_page_render (); int main () { return spectre_page_render (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_spectre_spectre_page_render=yes else ac_cv_lib_spectre_spectre_page_render=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_spectre_spectre_page_render" >&5 $as_echo "$ac_cv_lib_spectre_spectre_page_render" >&6; } if test "x$ac_cv_lib_spectre_spectre_page_render" = xyes; then : have_ps=yes else have_ps=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** PS loader will not be built (spectre library not found) ***" >&5 $as_echo "$as_me: WARNING: *** PS loader will not be built (spectre library not found) ***" >&2;} fi if test x"$have_ps" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libspectre/spectre.h" >&5 $as_echo_n "checking for libspectre/spectre.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : have_ps=yes else have_ps=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ps" >&5 $as_echo "$have_ps" >&6; } if test x"$have_ps" = xyes; then LIBPS="-lspectre $LIBSPECTRE_STATIC_EXTRA" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** PS loader will not be built (PS header file not found) ***" >&5 $as_echo "$as_me: WARNING: *** PS loader will not be built (PS header file not found) ***" >&2;} fi fi fi # the following needs thorough testing if test x"$have_ps" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPs.o" LIBS="$LIBS $LIBPS" $as_echo "#define HAVE_LIBSPECTRE 1" >>confdefs.h else fim_handle_ps=no fi # if test x$with_libps != xno && test -z "$LIBPS"; then # AC_MSG_ERROR([ # Checks for PS loader failed. You can build without it by passing # --disable-ps to ./configure. ]) # fi else fim_handle_ps=no fi if test x$have_ps = xyes; then ENABLE_PS_TRUE= ENABLE_PS_FALSE='#' else ENABLE_PS_TRUE='#' ENABLE_PS_FALSE= fi # Check whether --enable-djvu was given. if test "${enable_djvu+set}" = set; then : enableval=$enable_djvu; if test x$enableval = xno ; then fim_handle_djvu=no fi fi if test x$fim_handle_djvu != xno ; then fim_handle_djvu=yes have_djvu=yes if test x$with_libdjvu != xno && test -z "$LIBDJVU"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ddjvu_page_create_by_pageno in -ldjvulibre" >&5 $as_echo_n "checking for ddjvu_page_create_by_pageno in -ldjvulibre... " >&6; } if ${ac_cv_lib_djvulibre_ddjvu_page_create_by_pageno+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldjvulibre $LIBDJVU_STATIC_EXTRA $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ddjvu_page_create_by_pageno (); int main () { return ddjvu_page_create_by_pageno (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_djvulibre_ddjvu_page_create_by_pageno=yes else ac_cv_lib_djvulibre_ddjvu_page_create_by_pageno=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_djvulibre_ddjvu_page_create_by_pageno" >&5 $as_echo "$ac_cv_lib_djvulibre_ddjvu_page_create_by_pageno" >&6; } if test "x$ac_cv_lib_djvulibre_ddjvu_page_create_by_pageno" = xyes; then : have_djvu=yes else have_djvu=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** DJVU loader will not be built (DJVU library not found) ***" >&5 $as_echo "$as_me: WARNING: *** DJVU loader will not be built (DJVU library not found) ***" >&2;} fi if test x"$have_djvu" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libdjvu/ddjvuapi.h" >&5 $as_echo_n "checking for libdjvu/ddjvuapi.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : have_djvu=yes else have_djvu=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_djvu" >&5 $as_echo "$have_djvu" >&6; } if test x"$have_djvu" = xyes; then LIBDJVU="-ldjvulibre $LIBDJVU_STATIC_EXTRA" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** DJVU loader will not be built (DJVU header file not found) ***" >&5 $as_echo "$as_me: WARNING: *** DJVU loader will not be built (DJVU header file not found) ***" >&2;} fi fi fi # the following needs thorough testing if test x"$have_djvu" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffDjvu.o" LIBS="$LIBS $LIBDJVU" $as_echo "#define HAVE_LIBDJVU 1" >>confdefs.h else fim_handle_djvu=no fi # if test x$with_libdjvu != xno && test -z "$LIBDJVU"; then # AC_MSG_ERROR([ # Checks for DJVU loader failed. You can build without it by passing # --disable-djvu to ./configure. ]) # fi else fim_handle_djvu=no fi if test x$have_djvu = xyes; then ENABLE_DJVU_TRUE= ENABLE_DJVU_FALSE='#' else ENABLE_DJVU_TRUE='#' ENABLE_DJVU_FALSE= fi fim_handle_pdf=no # Check whether --enable-poppler was given. if test "${enable_poppler+set}" = set; then : enableval=$enable_poppler; if test x$enableval = xyes ; then fim_handle_pdf=yes fi else $LIBPOPPLER_STATIC_EXTRA fi if test x$fim_handle_pdf != xno ; then fim_handle_pdf=yes have_poppler=yes if test x$with_libpoppler != xno && test -z "$LIBPOPPLER"; then # dear fim hackers, you should install pkg-config to get this macro expanded (p) POPPLER_REQUIRED=0.8.7 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for POPPLER" >&5 $as_echo_n "checking for POPPLER... " >&6; } if test -n "$POPPLER_CFLAGS"; then pkg_cv_POPPLER_CFLAGS="$POPPLER_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"poppler >= \$POPPLER_REQUIRED\""; } >&5 ($PKG_CONFIG --exists --print-errors "poppler >= $POPPLER_REQUIRED") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_POPPLER_CFLAGS=`$PKG_CONFIG --cflags "poppler >= $POPPLER_REQUIRED" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$POPPLER_LIBS"; then pkg_cv_POPPLER_LIBS="$POPPLER_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"poppler >= \$POPPLER_REQUIRED\""; } >&5 ($PKG_CONFIG --exists --print-errors "poppler >= $POPPLER_REQUIRED") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_POPPLER_LIBS=`$PKG_CONFIG --libs "poppler >= $POPPLER_REQUIRED" 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 POPPLER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "poppler >= $POPPLER_REQUIRED" 2>&1` else POPPLER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "poppler >= $POPPLER_REQUIRED" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$POPPLER_PKG_ERRORS" >&5 enable_pdf=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_pdf=no else POPPLER_CFLAGS=$pkg_cv_POPPLER_CFLAGS POPPLER_LIBS=$pkg_cv_POPPLER_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_pdf=yes fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for g_free in -lpoppler" >&5 $as_echo_n "checking for g_free in -lpoppler... " >&6; } if ${ac_cv_lib_poppler_g_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpoppler $GLIB_LIBS $POPPLER_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char g_free (); int main () { return g_free (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_poppler_g_free=yes else ac_cv_lib_poppler_g_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_poppler_g_free" >&5 $as_echo "$ac_cv_lib_poppler_g_free" >&6; } if test "x$ac_cv_lib_poppler_g_free" = xyes; then : have_poppler=yes LIBS+=" $GLIB_LIBS $POPPLER_LIBS"; CXXFLAGS+=" $GLIB_CFLAGS $POPPLER_CFLAGS"; else have_poppler=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** POPPLER loader will not be built (POPPLER library not found) ***" >&5 $as_echo "$as_me: WARNING: *** POPPLER loader will not be built (POPPLER library not found) ***" >&2;} fi if test x"$have_poppler" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poppler/poppler-config.h" >&5 $as_echo_n "checking for poppler/poppler-config.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #undef PACKAGE #undef VERSION #undef HAVE_STDLIB_H /* fim uses these headers. let us hope poppler will stabilize soon!*/ #include #include #include #include #include #include #include #include /* globalParams lives here */ _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : have_poppler=yes else have_poppler=no fi rm -f conftest.err conftest.i conftest.$ac_ext have_poppler=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_poppler" >&5 $as_echo "$have_poppler" >&6; } if test x"$have_poppler" = xyes; then CXXFLAGS="$CXXFLAGS -DFIM_LIBPOPPLER_VERSION_MAYBE=$have_poppler_maybe_version" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** POPPLER/PDF loader will not be built (POPPLER header file not found) ***" >&5 $as_echo "$as_me: WARNING: *** POPPLER/PDF loader will not be built (POPPLER header file not found) ***" >&2;} fi fi fi # the following needs thorough testing if test x"$have_poppler" = xyes ; then FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPdf.o" LIBS="$LIBS $LIBPOPPLER" $as_echo "#define HAVE_LIBPOPPLER 1" >>confdefs.h else fim_handle_pdf=no fi # if test x$with_libpoppler != xno && test -z "$LIBPOPPLER"; then # AC_MSG_ERROR([ # Checks for POPPLER loader failed. You can build without it by passing # --disable-poppler to ./configure. ]) # fi else fim_handle_pdf=no fi if test x$have_poppler = xyes; then ENABLE_POPPLER_TRUE= ENABLE_POPPLER_FALSE='#' else ENABLE_POPPLER_TRUE='#' ENABLE_POPPLER_FALSE= fi # Check whether --enable-pdf was given. if test "${enable_pdf+set}" = set; then : enableval=$enable_pdf; enable_pdf="$enableval" else enable_pdf=yes fi if test "x$enable_pdf" = "xyes"; then if test "x$enable_pdf" = "xyes"; then $as_echo "#define ENABLE_PDF 1" >>confdefs.h SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS" SHELL_CXXFLAGS="$SHELL_CXXFLAGS $GLIB_CFLAGS $POPPLER_CFLAGS" fim_save_LIBS=$LIBS LIBS="$LIBS $GLIB_LIBS $POPPLER_LIBS" LIBS=$fim_save_LIBS else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"PDF support is disabled since poppler library version $POPPLER_REQUIRED or newer not found\"" >&5 $as_echo "$as_me: WARNING: \"PDF support is disabled since poppler library version $POPPLER_REQUIRED or newer not found\"" >&2;} fi fi if test x$enable_pdf = xyes; then ENABLE_PDF_TRUE= ENABLE_PDF_FALSE='#' else ENABLE_PDF_TRUE='#' ENABLE_PDF_FALSE= fi fim_handle_bmp=yes # Check whether --enable-bmp was given. if test "${enable_bmp+set}" = set; then : enableval=$enable_bmp; if test x$enableval = xno ; then fim_handle_bmp=no fi fi if test x$fim_handle_bmp = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling BMP file format support." >&5 $as_echo "$as_me: Enabling BMP file format support." >&6;} $as_echo "#define FIM_WITH_BMP 1" >>confdefs.h FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffBmp.o" else { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling BMP file format support." >&5 $as_echo "$as_me: Disabling BMP file format support." >&6;} $as_echo "#define FIM_WITH_BMP 0" >>confdefs.h fi if test x$fim_handle_bmp = xyes; then ENABLE_BMP_TRUE= ENABLE_BMP_FALSE='#' else ENABLE_BMP_TRUE='#' ENABLE_BMP_FALSE= fi fim_handle_pcx=yes # Check whether --enable-pcx was given. if test "${enable_pcx+set}" = set; then : enableval=$enable_pcx; if test x$enableval = xno ; then fim_handle_pcx=no fi fi if test x$fim_handle_pcx = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling PCX file format support." >&5 $as_echo "$as_me: Enabling PCX file format support." >&6;} $as_echo "#define FIM_WITH_PCX 1" >>confdefs.h FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPcx.o" else { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling PCX file format support." >&5 $as_echo "$as_me: Disabling PCX file format support." >&6;} $as_echo "#define FIM_WITH_PCX 0" >>confdefs.h fi if test x$fim_handle_pcx = xyes; then ENABLE_PCX_TRUE= ENABLE_PCX_FALSE='#' else ENABLE_PCX_TRUE='#' ENABLE_PCX_FALSE= fi ## png file handling # Check whether --with-png-prefix was given. if test "${with_png_prefix+set}" = set; then : withval=$with_png_prefix; libpng_config_prefix="$withval" else libpng_config_prefix="" fi fim_handle_png=yes # Check whether --enable-png was given. if test "${enable_png+set}" = set; then : enableval=$enable_png; if test x$enableval = xno ; then fim_handle_png=no fi fi if test x$fim_handle_png = xyes; then # support for custom library configurator path if test x$libpng_config_prefix != x; then LIBPNG_CONFIG="$libpng_config_prefix/bin/libpng-config" else # default path configurator # Extract the first word of "libpng-config", so it can be a program name with args. set dummy libpng-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LIBPNG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LIBPNG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBPNG_CONFIG="$LIBPNG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBPNG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LIBPNG_CONFIG" && ac_cv_path_LIBPNG_CONFIG="no" ;; esac fi LIBPNG_CONFIG=$ac_cv_path_LIBPNG_CONFIG if test -n "$LIBPNG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBPNG_CONFIG" >&5 $as_echo "$LIBPNG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$LIBPNG_CONFIG" = "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** PNG loader will not be built (PNG library not found) ***" >&5 $as_echo "$as_me: WARNING: *** PNG loader will not be built (PNG library not found) ***" >&2;} fim_handle_png=no else CXXFLAGS="$CXXFLAGS `$LIBPNG_CONFIG --cflags`" if test x$fim_cv_want_static = x1 ; then LIBS="$LIBS `$LIBPNG_CONFIG --static --libs`" else LIBS="$LIBS `$LIBPNG_CONFIG --libs`" fi # finish this ! FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPng.o" $as_echo "#define FIM_WITH_LIBPNG 1" >>confdefs.h fi fi if test x$fim_handle_png = xyes; then ENABLE_PNG_TRUE= ENABLE_PNG_FALSE='#' else ENABLE_PNG_TRUE='#' ENABLE_PNG_FALSE= fi #AM_CONDITIONAL(BUILD_PNG, test x$fim_handle_png = xyes) fim_handle_xyz=no # Check whether --enable-xyz was given. if test "${enable_xyz+set}" = set; then : enableval=$enable_xyz; if test x$enableval = xyes ; then fim_handle_xyz=yes fi fi if test x$fim_handle_xyz = xyes; then LIBXYZ="" # one would set an actual value here LIBS="$LIBS $LIBXYZ" FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffXyz.o" $as_echo "#define FIM_WITH_LIBXYZ 1" >>confdefs.h fi ## raw/nef file handling via UFRaw fim_handle_ufraw=no # Check whether --enable-ufraw was given. if test "${enable_ufraw+set}" = set; then : enableval=$enable_ufraw; if test x$enableval = xno ; then fim_handle_ufraw=no else fim_handle_ufraw=yes fi fi if test x$fim_handle_ufraw = xyes; then # support for custom library configurator path CXXFLAGS="$CXXFLAGS $UFRAW_CXXFLAGS" LIBS="$LIBS $UFRAW_LIBS" FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffUFRaw.o" # FIXME $as_echo "#define FIM_WITH_UFRAW 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling UFRaw / libufraw." >&5 $as_echo "$as_me: Enabling UFRaw / libufraw." >&6;} fi ## archive file handling via libarchive fim_handle_archive=no # Check whether --enable-archive was given. if test "${enable_archive+set}" = set; then : enableval=$enable_archive; if test x$enableval = xno ; then fim_handle_archive=no else fim_handle_archive=yes fi fi if test x$fim_handle_archive = xyes; then # support for custom library configurator path CXXFLAGS="$CXXFLAGS $ARCHIVE_CXXFLAGS" LIBS="$LIBS $ARCHIVE_LIBS -larchive" $as_echo "#define FIM_WITH_ARCHIVE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling libarchive." >&5 $as_echo "$as_me: Enabling libarchive." >&6;} fi if test x$fim_handle_archive = xyes; then ENABLE_ARCHIVE_TRUE= ENABLE_ARCHIVE_FALSE='#' else ENABLE_ARCHIVE_TRUE='#' ENABLE_ARCHIVE_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exif_data_new_from_data in -lexif" >&5 $as_echo_n "checking for exif_data_new_from_data in -lexif... " >&6; } if ${ac_cv_lib_exif_exif_data_new_from_data+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char exif_data_new_from_data (); int main () { return exif_data_new_from_data (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_exif_exif_data_new_from_data=yes else ac_cv_lib_exif_exif_data_new_from_data=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_exif_exif_data_new_from_data" >&5 $as_echo "$ac_cv_lib_exif_exif_data_new_from_data" >&6; } if test "x$ac_cv_lib_exif_exif_data_new_from_data" = xyes; then : have_libexif=yes else have_libexif=no fi # Check whether --enable-exif was given. if test "${enable_exif+set}" = set; then : enableval=$enable_exif; if test x$enableval != xno; then fim_cv_libexif=yes; fi else fim_cv_libexif=yes; fi if test x$fim_cv_libexif = xyes; then if test x$have_libexif = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling libexif usage." >&5 $as_echo "$as_me: Enabling libexif usage." >&6;} CXXFLAGS="$CXXFLAGS"; LIBS="$LIBS -lexif"; else as_fn_error $? "Sorry, it does not seem like libexif is installed or detectable. Please run --disable-exif or install libexif in a system-wide directory instead. " "$LINENO" 5 fi else fim_cv_libexif=no; fi # Check whether --enable-jasper was given. if test "${enable_jasper+set}" = set; then : enableval=$enable_jasper; if test x$enableval = xyes; then fim_cv_libjasper=yes; CXXFLAGS="$CXXFLAGS"; LIBS="$LIBS -ljasper"; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jas_init in -ljasper" >&5 $as_echo_n "checking for jas_init in -ljasper... " >&6; } if ${ac_cv_lib_jasper_jas_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljasper $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jas_init (); int main () { return jas_init (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_jasper_jas_init=yes else ac_cv_lib_jasper_jas_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jasper_jas_init" >&5 $as_echo "$ac_cv_lib_jasper_jas_init" >&6; } if test "x$ac_cv_lib_jasper_jas_init" = xyes; then : have_libjasper=yes else have_libjasper=no fi if test x$have_libjasper = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling support of JPEG-2K files with JasPer." >&5 $as_echo "$as_me: Enabling support of JPEG-2K files with JasPer." >&6;}; FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffJasPer.o"; else fim_cv_libjasper=no; as_fn_error $? "Sorry, it does not seem like libjasper is installed or detectable. Please run --disable-jasper or install libjasper in a system-wide directory instead. " "$LINENO" 5; fi fi else fim_cv_libjasper=no; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aa_getfirst in -laa" >&5 $as_echo_n "checking for aa_getfirst in -laa... " >&6; } if ${ac_cv_lib_aa_aa_getfirst+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-laa $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char aa_getfirst (); int main () { return aa_getfirst (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_aa_aa_getfirst=yes else ac_cv_lib_aa_aa_getfirst=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aa_aa_getfirst" >&5 $as_echo "$ac_cv_lib_aa_aa_getfirst" >&6; } if test "x$ac_cv_lib_aa_aa_getfirst" = xyes; then : fim_cv_libaa=yes else fim_cv_libaa=no fi # Check whether --enable-aa was given. if test "${enable_aa+set}" = set; then : enableval=$enable_aa; if test x$enableval != xno; then fim_cv_libaa=yes; else fim_cv_libaa=no; fi else fim_cv_libaa=yes; fi if test x$fim_cv_libaa != xno; then if test x$ac_cv_lib_aa_aa_getfirst = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling aalib driver." >&5 $as_echo "$as_me: Enabling aalib driver." >&6;} fim_cv_aalib=yes if test x$libaa_config_prefix != x; then LIBAA_CONFIG="$libaa_config_prefix/bin/aalib-config" else # default path configurator # Extract the first word of "aalib-config", so it can be a program name with args. set dummy aalib-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LIBAA_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LIBAA_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBAA_CONFIG="$LIBAA_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBAA_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LIBAA_CONFIG" && ac_cv_path_LIBAA_CONFIG="no" ;; esac fi LIBAA_CONFIG=$ac_cv_path_LIBAA_CONFIG if test -n "$LIBAA_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBAA_CONFIG" >&5 $as_echo "$LIBAA_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$LIBAA_CONFIG" = "xno"; then # uhm { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** no aalib-config ? ***" >&5 $as_echo "$as_me: WARNING: *** no aalib-config ? ***" >&2;} fim_cv_aalib=no else CXXFLAGS="$CXXFLAGS `$LIBAA_CONFIG --cflags`" LIBS="$LIBS `$LIBAA_CONFIG --libs`" # finish this ! fi else fim_cv_aalib=no fi else fim_cv_aalib=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ascii Art (-o aa) support disabled." >&5 $as_echo "$as_me: WARNING: Ascii Art (-o aa) support disabled." >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lstdc++fs" >&5 $as_echo_n "checking for main in -lstdc++fs... " >&6; } if ${ac_cv_lib_stdcppfs_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lstdc++fs $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_stdcppfs_main=yes else ac_cv_lib_stdcppfs_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdcppfs_main" >&5 $as_echo "$ac_cv_lib_stdcppfs_main" >&6; } if test "x$ac_cv_lib_stdcppfs_main" = xyes; then : LIBS="${LIBS} -lstdc++fs" fi ## sdl driver # Check whether --with-sdl-prefix was given. if test "${with_sdl_prefix+set}" = set; then : withval=$with_sdl_prefix; libsdl_config_prefix="$withval" else libsdl_config_prefix="" fi fim_handle_sdl='auto' sdl_version_preference='' # Check whether --enable-sdl was given. if test "${enable_sdl+set}" = set; then : enableval=$enable_sdl; sdl_version_preference="$enableval"; if test x$enableval != xno ; then fim_handle_sdl=yes ; fi if test x$enableval = xno ; then fim_handle_sdl=no ; fi fi # tested with sdl 1.2 if test x$fim_handle_sdl != xno; then # support for custom library configurator path echo PORCO DIO $sdl_version_preference if test x"${sdl_version_preference}" != x2; then if test x$libsdl_config_prefix != x; then LIBSDL_CONFIG="$libsdl_config_prefix/bin/sdl-config" else # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LIBSDL_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LIBSDL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBSDL_CONFIG="$LIBSDL_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBSDL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LIBSDL_CONFIG" && ac_cv_path_LIBSDL_CONFIG="no" ;; esac fi LIBSDL_CONFIG=$ac_cv_path_LIBSDL_CONFIG if test -n "$LIBSDL_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBSDL_CONFIG" >&5 $as_echo "$LIBSDL_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test x"${sdl_version_preference}" != x1; then if test x$libsdl_config_prefix != x; then LIBSDL2_CONFIG="$libsdl_config_prefix/bin/sdl2-config" else # Extract the first word of "sdl2-config", so it can be a program name with args. set dummy sdl2-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LIBSDL2_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LIBSDL2_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBSDL2_CONFIG="$LIBSDL2_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBSDL2_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LIBSDL2_CONFIG" && ac_cv_path_LIBSDL2_CONFIG="no" ;; esac fi LIBSDL2_CONFIG=$ac_cv_path_LIBSDL2_CONFIG if test -n "$LIBSDL2_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBSDL2_CONFIG" >&5 $as_echo "$LIBSDL2_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test x$LIBSDL2_CONFIG != x -a x$LIBSDL2_CONFIG != x"no" ; then LIBSDL_CONFIG="$LIBSDL2_CONFIG"; fi LIBS_BEFORE_CHECK="$LIBS" export LIBS="$LIBS `$LIBSDL2_CONFIG --static-libs`" { $as_echo "$as_me:${as_lineno-$LINENO}: checking Whether sdl2-config gives linkable output with $LIBS" >&5 $as_echo_n "checking Whether sdl2-config gives linkable output with $LIBS... " >&6; } if ${have_cv_sdl2_config_ok+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /*headers*/ int main () { /*main*/ ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : have_cv_sdl2_config_ok=yes else have_cv_sdl2_config_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_sdl2_config_ok" >&5 $as_echo "$have_cv_sdl2_config_ok" >&6; } LIBS="$LIBS_BEFORE_CHECK" unset LIBS_BEFORE_CHECK if test x"$have_cv_sdl2_config_ok" = xno && test x"$LIBSDL2_CONFIG" != x && pkg-config --version; then { $as_echo "$as_me:${as_lineno-$LINENO}: Setting PKG_CONFIG=pkg-config, perhaps it can help sdl-config." >&5 $as_echo "$as_me: Setting PKG_CONFIG=pkg-config, perhaps it can help sdl-config." >&6;} export PKG_CONFIG=pkg-config; fi unset LIBSDL2_CONFIG; fi if test "x$LIBSDL_CONFIG" = "xno"; then if test x$fim_handle_sdl = xyes; then as_fn_error $? "LIBSDL not found (failed detecting the sdl configuration (sdl-config/sdl2-config) program)" "$LINENO" 5 else fim_handle_sdl='no' fi else { $as_echo "$as_me:${as_lineno-$LINENO}: Activating LIBSDL (use $LIBSDL_CONFIG)." >&5 $as_echo "$as_me: Activating LIBSDL (use $LIBSDL_CONFIG)." >&6;} fim_handle_sdl='yes' LIBSDL_CXXFLAGS=`$LIBSDL_CONFIG --cflags` CXXFLAGS="$CXXFLAGS $LIBSDL_CXXFLAGS" LIBSDL_CONFIG_FLAGS=--libs if $LIBSDL_CONFIG $LIBSDL_CONFIG_FLAGS ; then LIBSDL_CONFIG_FLAGS=--libs else LIBSDL_CONFIG_FLAGS=--static-libs fi { $as_echo "$as_me:${as_lineno-$LINENO}: Invoking $LIBSDL_CONFIG $LIBSDL_CONFIG_FLAGS." >&5 $as_echo "$as_me: Invoking $LIBSDL_CONFIG $LIBSDL_CONFIG_FLAGS." >&6;} LIBS="$LIBS `$LIBSDL_CONFIG $LIBSDL_CONFIG_FLAGS`" # finish this ! #FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS SDLDevice.o" if test x`$LIBSDL_CONFIG --version | head -c 1` == x2; then $as_echo "#define FIM_WITH_LIBSDL 2" >>confdefs.h else $as_echo "#define FIM_WITH_LIBSDL 1" >>confdefs.h fi fi fi if test x$fim_handle_sdl = xyes; then ENABLE_SDL_TRUE= ENABLE_SDL_FALSE='#' else ENABLE_SDL_TRUE='#' ENABLE_SDL_FALSE= fi fim_cv_exiftool=no # Check whether --enable-exiftool was given. if test "${enable_exiftool+set}" = set; then : enableval=$enable_exiftool; if test x$enableval = xyes; then fim_cv_exiftool=yes CXXFLAGS="$CXXFLAGS $EXIFTOOLCXXFLAGS" LIBS="$LIBS $EXIFTOOLLINK" { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling exiftool interface." >&5 $as_echo "$as_me: Enabling exiftool interface." >&6;} $as_echo "#define FIM_WANT_EXIFTOOL 1" >>confdefs.h fi else fim_cv_exiftool=no fi #AC_DEFINE([FIM_DEFAULT_KEY_CONFIG] ,1, [Defined, if GPGME support is enabled]) #AC_DEFINE([FIM_DEFAULT_CONFIG], 1, [Defined, if GPGME support is enabled]) #AC_DEFINE([FIM_DEFAULT_CONFIGURATION], 1, [Defined, if GPGME support is enabled]) #AC_MSG_CHECKING(whether struct dirent defines d_ino) fim_cv_autocommands=yes # Check whether --enable-autocommands was given. if test "${enable_autocommands+set}" = set; then : enableval=$enable_autocommands; if test x$enableval = xno; then fim_cv_autocommands=no fi fi if test x$fim_cv_autocommands = xyes; then have_autocommands=yes $as_echo "#define FIM_AUTOCMDS 1" >>confdefs.h else have_autocommands=no fi # Check whether --enable-hardcoded-font was given. if test "${enable_hardcoded_font+set}" = set; then : enableval=$enable_hardcoded_font; if test x$enableval = xyes; then fim_cv_hardcoded_font=yes; else fim_cv_hardcoded_font=no; fi else fim_cv_hardcoded_font=yes; fi if test x$fim_cv_hardcoded_font = xyes -a x$ac_cv_func_fmemopen = xyes ; then have_hardcoded_font=yes $as_echo "#define FIM_WANT_HARDCODED_FONT 1" >>confdefs.h else have_hardcoded_font=no fi if test x$have_hardcoded_font = xyes ; then FIM_WANT_HARDCODED_CONSOLEFONT_TRUE= FIM_WANT_HARDCODED_CONSOLEFONT_FALSE='#' else FIM_WANT_HARDCODED_CONSOLEFONT_TRUE='#' FIM_WANT_HARDCODED_CONSOLEFONT_FALSE= fi # Extract the first word of "gs", so it can be a program name with args. set dummy gs; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_have_gs+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$have_gs"; then ac_cv_prog_have_gs="$have_gs" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_gs="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_gs" && ac_cv_prog_have_gs="no" fi fi have_gs=$ac_cv_prog_have_gs if test -n "$have_gs"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gs" >&5 $as_echo "$have_gs" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$have_gs = xyes; then HAVE_GS_TRUE= HAVE_GS_FALSE='#' else HAVE_GS_TRUE='#' HAVE_GS_FALSE= fi if test x$have_gs = xyes; then HAVE_FIMGS_TRUE= HAVE_FIMGS_FALSE='#' else HAVE_FIMGS_TRUE='#' HAVE_FIMGS_FALSE= fi # Check whether --enable-long-int-vars was given. if test "${enable_long_int_vars+set}" = set; then : enableval=$enable_long_int_vars; if test x$enableval = xyes; then fim_cv_want_int64_int=yes; else fim_cv_want_int64_int=no; fi else fim_cv_want_int64_int=yes; fi if test x$fim_cv_want_int64_int = xyes; then $as_echo "#define FIM_WANT_LONG_INT 1" >>confdefs.h else $as_echo "#define FIM_WANT_LONG_INT 0" >>confdefs.h fi fim_cv_windows=yes # Check whether --enable-windows was given. if test "${enable_windows+set}" = set; then : enableval=$enable_windows; if test x$enableval = xno; then fim_cv_windows=no fi fi if test x$fim_cv_windows = xyes; then have_windows=yes $as_echo "#define FIM_WINDOWS 1" >>confdefs.h else have_windows=no fi fim_cv_fimrc=yes # Check whether --enable-fimrc was given. if test "${enable_fimrc+set}" = set; then : enableval=$enable_fimrc; if test x$enableval = xno; then fim_cv_fimrc=no fi fi if test x$fim_cv_fimrc = xyes; then have_fimrc=yes else $as_echo "#define FIM_NOFIMRC 1" >>confdefs.h fi if test x$fim_cv_fimrc = xyes; then WANT_DEFAULT_FIMRC_TRUE= WANT_DEFAULT_FIMRC_FALSE='#' else WANT_DEFAULT_FIMRC_TRUE='#' WANT_DEFAULT_FIMRC_FALSE= fi fim_cv_history=yes # Check whether --enable-history was given. if test "${enable_history+set}" = set; then : enableval=$enable_history; if test x$enableval = xno ; then fim_cv_history=no fi fi if test x$fim_want_readline = xno; then fim_cv_history=no; fi if test x$fim_cv_history != xno; then ENABLE_HISTORY_TRUE= ENABLE_HISTORY_FALSE='#' else ENABLE_HISTORY_TRUE='#' ENABLE_HISTORY_FALSE= fi if test x$fim_cv_history != xyes; then $as_echo "#define FIM_NOHISTORY 1" >>confdefs.h fi fim_cv_warnings=no # Check whether --enable-screen was given. if test "${enable_screen+set}" = set; then : enableval=$enable_screen; if test x$enableval = xno; then fim_cv_screen=no else fim_cv_screen=yes fi else fim_cv_screen=yes fi fim_cv_resize_optimizations=yes # Check whether --enable-resize-optimizations was given. if test "${enable_resize_optimizations+set}" = set; then : enableval=$enable_resize_optimizations; if test x$enableval = xno; then fim_cv_resize_optimizations=no else fim_cv_resize_optimizations=yes fi else fim_cv_resize_optimizations=yes fi fim_cv_read_stdin_image=yes # Check whether --enable-stdin-image-reading was given. if test "${enable_stdin_image_reading+set}" = set; then : enableval=$enable_stdin_image_reading; if test x$enableval = xno; then fim_cv_read_stdin_image=no else fim_cv_read_stdin_image=yes fi else fim_cv_read_stdin_image=yes fi fim_cv_scan_consolefonts=yes # Check whether --enable-scan-consolefonts was given. if test "${enable_scan_consolefonts+set}" = set; then : enableval=$enable_scan_consolefonts; if test x$enableval = xyes; then fim_cv_scan_consolefonts=yes else fim_cv_scan_consolefonts=no fi else fim_cv_scan_consolefonts=yes fi fim_cv_fb_console_switch_while_loading=no # Check whether --enable-framebuffer-switch-while-loading was given. if test "${enable_framebuffer_switch_while_loading+set}" = set; then : enableval=$enable_framebuffer_switch_while_loading; if test x$enableval = xyes; then fim_cv_fb_console_switch_while_loading=yes else fim_cv_fb_console_switch_while_loading=no fi else fim_cv_fb_console_switch_while_loading=no fi fim_cv_seek_magic=yes # Check whether --enable-seek-magic was given. if test "${enable_seek_magic+set}" = set; then : enableval=$enable_seek_magic; if test x$enableval = xno; then fim_cv_seek_magic=no else fim_cv_seek_magic=yes fi else fim_cv_seek_magic=yes fi fim_cv_paths_in_man=yes # Check whether --enable-paths-in-man was given. if test "${enable_paths_in_man+set}" = set; then : enableval=$enable_paths_in_man; if test x$enableval = xno; then fim_cv_paths_in_man=no else fim_cv_paths_in_man=yes fi else fim_cv_paths_in_man=yes fi # Check whether --enable-pushdir was given. if test "${enable_pushdir+set}" = set; then : enableval=$enable_pushdir; if test x$enableval = xno; then fim_cv_read_dirs=no else fim_cv_read_dirs=yes fi else fim_cv_read_dirs=yes fi # Check whether --enable-recursive-pushdir was given. if test "${enable_recursive_pushdir+set}" = set; then : enableval=$enable_recursive_pushdir; if test x$enableval = xyes; then fim_cv_recursive_dirs=yes; fim_cv_read_dirs=yes; else fim_cv_recursive_dirs=no; fi else fim_cv_recursive_dirs=yes;fim_cv_read_dirs=yes; fi if test x$fim_cv_resize_optimizations != xyes; then $as_echo "#define FIM_WANTS_SLOW_RESIZE 1" >>confdefs.h fi if test x$fim_cv_read_dirs = xyes; then $as_echo "#define FIM_READ_DIRS 1" >>confdefs.h if test x$fim_cv_recursive_dirs = xyes; then $as_echo "#define FIM_RECURSIVE_DIRS 1" >>confdefs.h fi fi if test x$fim_cv_recursive_dirs = xyes; then WANT_RECURSIVE_DIRS_TRUE= WANT_RECURSIVE_DIRS_FALSE='#' else WANT_RECURSIVE_DIRS_TRUE='#' WANT_RECURSIVE_DIRS_FALSE= fi if test x$fim_cv_screen != xno; then # boz patch is on $as_echo "#define FIM_BOZ_PATCH 1" >>confdefs.h fi fim_cv_read_stdin=yes if test x$fim_cv_read_stdin != xno; then $as_echo "#define FIM_READ_STDIN 1" >>confdefs.h fi if test x$fim_cv_read_stdin_image = xyes -a x$fim_cv_read_stdin = xyes; then $as_echo "#define FIM_READ_STDIN_IMAGE 1" >>confdefs.h else # we revert to no just for the printout fim_cv_read_stdin_image=no fi if test x$fim_cv_read_stdin_image = xyes; then WANT_READ_STDIN_IMAGE_TRUE= WANT_READ_STDIN_IMAGE_FALSE='#' else WANT_READ_STDIN_IMAGE_TRUE='#' WANT_READ_STDIN_IMAGE_FALSE= fi fim_cv_warnings=no # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; if test x$enableval = xyes; then fim_cv_debug=yes fi fi if test "x$fim_cv_debug" = xyes; then # Extract the first word of "valgrind", so it can be a program name with args. set dummy valgrind; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_VALGRIND+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_VALGRIND"; then ac_cv_prog_HAVE_VALGRIND="$HAVE_VALGRIND" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_VALGRIND="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_VALGRIND" && ac_cv_prog_HAVE_VALGRIND="no" fi fi HAVE_VALGRIND=$ac_cv_prog_HAVE_VALGRIND if test -n "$HAVE_VALGRIND"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_VALGRIND" >&5 $as_echo "$HAVE_VALGRIND" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test x$HAVE_VALGRIND = xyes; then HAVE_VALGRIND_TRUE= HAVE_VALGRIND_FALSE='#' else HAVE_VALGRIND_TRUE='#' HAVE_VALGRIND_FALSE= fi fim_cv_warnings=no # Check whether --enable-warnings was given. if test "${enable_warnings+set}" = set; then : enableval=$enable_warnings; if test x$enableval = xyes; then fim_cv_warnings=yes fi fi if test x$GCC = xyes ; then if test x$fim_cv_debug = xyes; then CXXFLAGS="${CXXFLAGS} -g" fi fi if test x$GCC = xyes ; then if test x$fim_cv_warnings = xyes ; then CXXFLAGS="-Wall -pedantic $CXXFLAGS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for caca_create_canvas in -lcaca" >&5 $as_echo_n "checking for caca_create_canvas in -lcaca... " >&6; } if ${ac_cv_lib_caca_caca_create_canvas+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcaca $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char caca_create_canvas (); int main () { return caca_create_canvas (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_caca_caca_create_canvas=yes else ac_cv_lib_caca_caca_create_canvas=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caca_caca_create_canvas" >&5 $as_echo "$ac_cv_lib_caca_caca_create_canvas" >&6; } if test "x$ac_cv_lib_caca_caca_create_canvas" = xyes; then : fim_cv_lib_caca=yes else fim_cv_lib_caca=no fi # Check whether --enable-caca was given. if test "${enable_caca+set}" = set; then : enableval=$enable_caca; if test x$enableval != xno; then fim_cv_lib_caca=yes; else fim_cv_lib_caca=no; fi else fim_cv_lib_caca=yes; fi if test x$fim_cv_lib_caca != xno; then if test x$ac_cv_lib_caca_caca_create_canvas = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling libcaca driver." >&5 $as_echo "$as_me: Enabling libcaca driver." >&6;} fim_cv_libcaca=yes if test x$libcaca_config_prefix != x; then LIBCACA_CONFIG="$libcaca_config_prefix/bin/caca-config" else # default path configurator # Extract the first word of "caca-config", so it can be a program name with args. set dummy caca-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LIBCACA_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LIBCACA_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBCACA_CONFIG="$LIBCACA_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBCACA_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LIBCACA_CONFIG" && ac_cv_path_LIBCACA_CONFIG="no" ;; esac fi LIBCACA_CONFIG=$ac_cv_path_LIBCACA_CONFIG if test -n "$LIBCACA_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBCACA_CONFIG" >&5 $as_echo "$LIBCACA_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$LIBCACA_CONFIG" = "xno"; then # uhm { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** no caca-config ? ***" >&5 $as_echo "$as_me: WARNING: *** no caca-config ? ***" >&2;} fim_cv_libcaca=no else CXXFLAGS="$CXXFLAGS `$LIBCACA_CONFIG --cflags`" LIBS="$LIBS `$LIBCACA_CONFIG --libs`" # finish this ! fi else fim_cv_libcaca=no fi else fim_cv_libcaca=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Colour ASCII-Art (-o ca) support disabled." >&5 $as_echo "$as_me: WARNING: Colour ASCII-Art (-o ca) support disabled." >&2;} fi # This code still awaits for integration ... # Check whether --with-cflags was given. if test "${with_cflags+set}" = set; then : withval=$with_cflags; if test "x$withval" != x; then cat >>confdefs.h <<_ACEOF #define CXXFLAGS "$withval" _ACEOF CXXFLAGS="$withval" CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS" cat >>confdefs.h <<_ACEOF #define CXXFLAGS "$withval" _ACEOF fi else cat >>confdefs.h <<_ACEOF #define EXECSHELL "/bin/sh" _ACEOF fi # This code still awaits for integration ... # Check whether --with-exec-shell was given. if test "${with_exec_shell+set}" = set; then : withval=$with_exec_shell; if test x$withval != xyes; then cat >>confdefs.h <<_ACEOF #define EXECSHELL "$withval" _ACEOF else cat >>confdefs.h <<_ACEOF #define EXECSHELL "/bin/sh" _ACEOF fi else cat >>confdefs.h <<_ACEOF #define EXECSHELL "/bin/sh" _ACEOF fi # Check whether --enable-smartautocompletion was given. if test "${enable_smartautocompletion+set}" = set; then : enableval=$enable_smartautocompletion; if test x$enableval = xno; then fim_cv_smartautcompletion=no else fim_cv_smartautcompletion=yes fi else fim_cv_smartautcompletion=yes fi if test x$fim_cv_smartautcompletion = xyes; then $as_echo "#define FIM_SMART_COMPLETION 1" >>confdefs.h fi if test x$fim_cv_scan_consolefonts = xyes; then $as_echo "#define FIM_LINUX_CONSOLEFONTS_DIR_SCAN 1" >>confdefs.h fi # Check whether --enable-convert was given. if test "${enable_convert+set}" = set; then : enableval=$enable_convert; if test x$enableval = xno; then fim_cv_convert=no else fim_cv_convert=yes fi else fim_cv_convert=yes fi # Check whether --enable-xcftopnm was given. if test "${enable_xcftopnm+set}" = set; then : enableval=$enable_xcftopnm; if test x$enableval = xno; then fim_cv_xcftopnm=no else fim_cv_xcftopnm=yes fi else fim_cv_xcftopnm=yes fi fim_cv_inkscape=yes # Check whether --enable-inkscape was given. if test "${enable_inkscape+set}" = set; then : enableval=$enable_inkscape; if test x$enableval = xno; then fim_cv_inkscape=no else fim_cv_inkscape=yes fi else fim_cv_inkscape=yes fi # Check whether --enable-xfig was given. if test "${enable_xfig+set}" = set; then : enableval=$enable_xfig; if test x$enableval = xno; then fim_cv_xfig=no else fim_cv_xfig=yes fi else fim_cv_xfig=yes fi # Check whether --enable-dia was given. if test "${enable_dia+set}" = set; then : enableval=$enable_dia; if test x$enableval = xno; then fim_cv_dia=no else fim_cv_dia=yes fi else fim_cv_dia=yes fi # Check whether --with-default-consolefont was given. if test "${with_default_consolefont+set}" = set; then : withval=$with_default_consolefont; cat >>confdefs.h <<_ACEOF #define FIM_DEFAULT_CONSOLEFONT "$withval" _ACEOF else fim_cv_defaultconsolefont="" fi # Check whether --with-custom-hardcoded-consolefont was given. if test "${with_custom_hardcoded_consolefont+set}" = set; then : withval=$with_custom_hardcoded_consolefont; fim_cv_want_custom_hardcoded_consolefont=true; FIM_CUSTOM_HARDCODED_CONSOLEFONT="$withval" fi if test x$fim_cv_want_custom_hardcoded_consolefont = xtrue ; then FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE= FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_FALSE='#' else FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE='#' FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_FALSE= fi fim_cv_want_font_magnify_factor=0; # Check whether --with-font-magnifying-factor was given. if test "${with_font_magnifying_factor+set}" = set; then : withval=$with_font_magnifying_factor; fim_cv_want_font_magnify_factor="$withval"; fi if test x$fim_cv_want_custom_hardcoded_consolefont = xtrue ; then FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE= FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_FALSE='#' else FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE='#' FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_FALSE= fi if test x"$host_cpu" = x"$build_cpu" -a x"$host_os" = x"$build_os" ; then HAVE_RUNNABLE_TESTS_TRUE= HAVE_RUNNABLE_TESTS_FALSE='#' else HAVE_RUNNABLE_TESTS_TRUE='#' HAVE_RUNNABLE_TESTS_FALSE= fi # Check whether --with-tmpfile was given. if test "${with_tmpfile+set}" = set; then : withval=$with_tmpfile; fim_cv_tmpfile=$withval else fim_cv_tmpfile="" fi # Check whether --enable-custom-status-bar was given. if test "${enable_custom_status_bar+set}" = set; then : enableval=$enable_custom_status_bar; if test x$enableval = xno; then fim_cv_custom_status_bar=no; else fim_cv_custom_status_bar=yes; fi else fim_cv_custom_status_bar=yes; fi # Check whether --enable-optimizations was given. if test "${enable_optimizations+set}" = set; then : enableval=$enable_optimizations; if test x$enableval = xno; then fim_cv_optimizations=no else fim_cv_optimizations=yes fi else fim_cv_optimizations=no fi # Extract the first word of "zcat", so it can be a program name with args. set dummy zcat; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_have_zcat+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$have_zcat"; then ac_cv_prog_have_zcat="$have_zcat" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_zcat="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_zcat" && ac_cv_prog_have_zcat="no" fi fi have_zcat=$ac_cv_prog_have_zcat if test -n "$have_zcat"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_zcat" >&5 $as_echo "$have_zcat" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$have_zcat = xyes ; then # legacy fbi feature : should not rely on this. FIXME { $as_echo "$as_me:${as_lineno-$LINENO}: Fim will use 'zcat' to uncompress \"gzipped\" font files." >&5 $as_echo "$as_me: Fim will use 'zcat' to uncompress \"gzipped\" font files." >&6;} $as_echo "#define FIM_USE_ZCAT 1" >>confdefs.h fi # Extract the first word of "convert", so it can be a program name with args. set dummy convert; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_have_convert+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$have_convert"; then ac_cv_prog_have_convert="$have_convert" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_convert="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_convert" && ac_cv_prog_have_convert="no" fi fi have_convert=$ac_cv_prog_have_convert if test -n "$have_convert"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_convert" >&5 $as_echo "$have_convert" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$have_convert = xyes -a x$fim_cv_convert = xyes ; then true else fim_cv_convert=no fi if test x$fim_cv_convert = xyes; then WITH_CONVERT_TRUE= WITH_CONVERT_FALSE='#' else WITH_CONVERT_TRUE='#' WITH_CONVERT_FALSE= fi # Extract the first word of "xcftopnm", so it can be a program name with args. set dummy xcftopnm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_have_xcftopnm+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$have_xcftopnm"; then ac_cv_prog_have_xcftopnm="$have_xcftopnm" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_xcftopnm="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_xcftopnm" && ac_cv_prog_have_xcftopnm="no" fi fi have_xcftopnm=$ac_cv_prog_have_xcftopnm if test -n "$have_xcftopnm"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_xcftopnm" >&5 $as_echo "$have_xcftopnm" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$have_xcftopnm = xyes -a x$fim_cv_xcftopnm = xyes ; then true else fim_cv_xcftopnm=no fi # Extract the first word of "inkscape", so it can be a program name with args. set dummy inkscape; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_have_inkscape+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$have_inkscape"; then ac_cv_prog_have_inkscape="$have_inkscape" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_inkscape="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_inkscape" && ac_cv_prog_have_inkscape="no" fi fi have_inkscape=$ac_cv_prog_have_inkscape if test -n "$have_inkscape"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_inkscape" >&5 $as_echo "$have_inkscape" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$have_inkscape = xyes -a x$fim_cv_inkscape = xyes ; then true else fim_cv_inkscape=no fi if test x$fim_cv_inkscape = xyes; then WITH_INKSCAPE_TRUE= WITH_INKSCAPE_FALSE='#' else WITH_INKSCAPE_TRUE='#' WITH_INKSCAPE_FALSE= fi # Extract the first word of "fig2dev", so it can be a program name with args. set dummy fig2dev; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_have_xfig+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$have_xfig"; then ac_cv_prog_have_xfig="$have_xfig" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_xfig="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_xfig" && ac_cv_prog_have_xfig="no" fi fi have_xfig=$ac_cv_prog_have_xfig if test -n "$have_xfig"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_xfig" >&5 $as_echo "$have_xfig" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$have_xfig = xyes -a x$fim_cv_xfig = xyes ; then true else fim_cv_xfig=no fi if test x$have_xfig = xyes -a x$fim_cv_xfig = xyes; then WITH_XFIG_TRUE= WITH_XFIG_FALSE='#' else WITH_XFIG_TRUE='#' WITH_XFIG_FALSE= fi # Extract the first word of "dia", so it can be a program name with args. set dummy dia; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_have_dia+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$have_dia"; then ac_cv_prog_have_dia="$have_dia" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_dia="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_dia" && ac_cv_prog_have_dia="no" fi fi have_dia=$ac_cv_prog_have_dia if test -n "$have_dia"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_dia" >&5 $as_echo "$have_dia" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$have_dia = xyes -a x$fim_cv_dia = xyes ; then true else fim_cv_dia=no fi if test x$fim_cv_optimizations = xyes ; then uname=`uname` if test x$uname = xLinux ; then if grep "^model name.*Pentium(R) 4" /proc/cpuinfo > /dev/null; then CXXFLAGS="$CXXFLAGS -march=native" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: uhm. try to specify your own optimizations.." >&5 $as_echo "$as_me: uhm. try to specify your own optimizations.." >&6;} fi fi if test x$fim_cv_convert = xyes ; then $as_echo "#define FIM_TRY_CONVERT 1" >>confdefs.h fi if test x$fim_cv_xcftopnm = xyes ; then $as_echo "#define FIM_TRY_XCFTOPNM 1" >>confdefs.h fi if test x$fim_cv_inkscape = xyes ; then $as_echo "#define FIM_TRY_INKSCAPE 1" >>confdefs.h fi if test x$have_xfig = xyes -a x$fim_cv_xfig = xyes; then $as_echo "#define FIM_TRY_XFIG 1" >>confdefs.h fi if test x$have_dia = xyes ; then $as_echo "#define FIM_TRY_DIA 1" >>confdefs.h fi if test x$fim_cv_libjasper = xyes ; then $as_echo "#define FIM_WITH_LIBJASPER 1" >>confdefs.h fi if test x$fim_cv_libexif = xyes ; then $as_echo "#define FIM_WITH_LIBEXIF 1" >>confdefs.h fi if test x$fim_cv_aalib = xyes ; then $as_echo "#define FIM_WITH_AALIB 1" >>confdefs.h fi if test x$fim_cv_aalib = xyes; then ENABLE_AA_TRUE= ENABLE_AA_FALSE='#' else ENABLE_AA_TRUE='#' ENABLE_AA_FALSE= fi if test x$fim_cv_libcaca = xyes ; then $as_echo "#define FIM_WITH_LIBCACA 1" >>confdefs.h fi if test x$fim_cv_libcaca = xyes; then ENABLE_CACA_TRUE= ENABLE_CACA_FALSE='#' else ENABLE_CACA_TRUE='#' ENABLE_CACA_FALSE= fi if test x$fim_cv_fb_console_switch_while_loading = xyes ; then $as_echo "#define FIM_WANT_FB_CONSOLE_SWITCH_WHILE_LOADING 1" >>confdefs.h fi if test x$fim_cv_seek_magic = xyes -a x$ac_cv_func_memmem = xyes; then $as_echo "#define FIM_WANT_SEEK_MAGIC 1" >>confdefs.h fi if test x$fim_cv_paths_in_man = xyes ; then $as_echo "#define FIM_PATHS_IN_MAN 1" >>confdefs.h fi cat >>confdefs.h <<_ACEOF #define FIM_WANT_FONT_MAGNIFY_FACTOR $fim_cv_want_font_magnify_factor _ACEOF if test x$fim_cv_custom_status_bar = xyes ; then $as_echo "#define FIM_WANT_CUSTOM_INFO_STATUS_BAR 1" >>confdefs.h fi # Check whether --enable-mark-and-dump was given. if test "${enable_mark_and_dump+set}" = set; then : enableval=$enable_mark_and_dump; if test x$enableval = xyes; then fim_cv_want_mark_and_dump=1 ; else fim_cv_want_mark_and_dump=0 ; fi else fim_cv_want_mark_and_dump=1 fi cat >>confdefs.h <<_ACEOF #define FIM_WANT_FILENAME_MARK_AND_DUMP $fim_cv_want_mark_and_dump _ACEOF # Check whether --enable-scripting was given. if test "${enable_scripting+set}" = set; then : enableval=$enable_scripting; if test x$enableval = xyes; then fim_cv_want_noscripting=0 ; else fim_cv_want_noscripting=1 ; fi else fim_cv_want_noscripting=0 fi if test x$fim_cv_want_noscripting = x1 ; then cat >>confdefs.h <<_ACEOF #define FIM_WANT_NOSCRIPTING $fim_cv_want_noscripting _ACEOF fi # Check whether --enable-output-console was given. if test "${enable_output_console+set}" = set; then : enableval=$enable_output_console; if test x$enableval = xyes; then fim_cv_want_no_output_console=0 ; else fim_cv_want_no_output_console=1 ; fi else fim_cv_want_no_output_console=0 fi if test x$fim_cv_want_no_output_console = x1 ; then cat >>confdefs.h <<_ACEOF #define FIM_WANT_NO_OUTPUT_CONSOLE $fim_cv_want_no_output_console _ACEOF fi fim_want_astext=yes # Check whether --enable-as-text-rendering was given. if test "${enable_as_text_rendering+set}" = set; then : enableval=$enable_as_text_rendering; if test x$enableval = xno ; then fim_want_astext=no fi fi if test x$fim_want_astext = xyes ; then cat >>confdefs.h <<_ACEOF #define FIM_WANT_TEXT_RENDERING 1 _ACEOF fi fim_want_rbr=yes # Check whether --enable-raw-bits-rendering was given. if test "${enable_raw_bits_rendering+set}" = set; then : enableval=$enable_raw_bits_rendering; if test x$enableval = xno ; then fim_want_rbr=no fi fi if test x$fim_want_rbr = xyes ; then cat >>confdefs.h <<_ACEOF #define FIM_WANT_RAW_BITS_RENDERING 1 _ACEOF fi if test x$fim_want_rbr = xyes; then ENABLE_RAW_BITS_RENDERING_TRUE= ENABLE_RAW_BITS_RENDERING_FALSE='#' else ENABLE_RAW_BITS_RENDERING_TRUE='#' ENABLE_RAW_BITS_RENDERING_FALSE= fi fim_want_lss=yes # Check whether --enable-loader-string-specification was given. if test "${enable_loader_string_specification+set}" = set; then : enableval=$enable_loader_string_specification; if test x$enableval = xno ; then fim_want_lss=no fi fi if test x$fim_want_lss = xyes ; then cat >>confdefs.h <<_ACEOF #define FIM_ALLOW_LOADER_STRING_SPECIFICATION 1 _ACEOF fi ac_config_headers="$ac_config_headers config.h" # Extract the first word of "timeout", so it can be a program name with args. set dummy timeout; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_TIMEOUT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_TIMEOUT"; then ac_cv_prog_HAVE_TIMEOUT="$HAVE_TIMEOUT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_TIMEOUT="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_TIMEOUT" && ac_cv_prog_HAVE_TIMEOUT="no" fi fi HAVE_TIMEOUT=$ac_cv_prog_HAVE_TIMEOUT if test -n "$HAVE_TIMEOUT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_TIMEOUT" >&5 $as_echo "$HAVE_TIMEOUT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$ac_cv_prog_HAVE_TIMEOUT" = x"yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Will use 'timeout ' in certain tests." >&5 $as_echo "$as_me: Will use 'timeout ' in certain tests." >&6;} TIMEOUT_SMALL="timeout --foreground 5" TIMEOUT_LARGE="timeout --foreground 30" $as_echo "#define FIM_HAS_TIMEOUT 1" >>confdefs.h fi $as_echo "#define FIM_RANDOM 1" >>confdefs.h $as_echo "#define FIM_DEFAULT_CONFIG 1" >>confdefs.h $as_echo "#define FIM_NOFB 1" >>confdefs.h $as_echo "#define FIM_RECORDING 1" >>confdefs.h $as_echo "#define FIM_SWITCH_FIXUP 1" >>confdefs.h $as_echo "#define FIM_CHECK_DUPLICATES 1" >>confdefs.h $as_echo "#define FIM_CHECK_FILE_EXISTENCE 1" >>confdefs.h $as_echo "#define FIM_REMOVE_FAILED 1" >>confdefs.h $as_echo "#define FIM_AUTOSKIP_FAILED 1" >>confdefs.h $as_echo "#define FIM_COMMAND_AUTOCOMPLETION 1" >>confdefs.h $as_echo "#define FIM_NAMESPACES 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define FIM_VERSION "${VERSION}" _ACEOF cat >>confdefs.h <<_ACEOF #define FIM_TMP_FILENAME "$fim_cv_tmpfile" _ACEOF if test "x$fim_cv_debug" = xyes; then $as_echo "#define FIM_WITH_DEBUG 1" >>confdefs.h else true; fi if test "x$fim_cv_debug" = xyes; then WITH_DEBUG_TRUE= WITH_DEBUG_FALSE='#' else WITH_DEBUG_TRUE='#' WITH_DEBUG_FALSE= fi $as_echo "#define FIM_ITERATED_COMMANDS 1" >>confdefs.h $as_echo "#define FIM_SKIP_KNOWN_FILETYPES 1" >>confdefs.h $as_echo "#define FIM_EXPERIMENTAL_ROTATION 1" >>confdefs.h $as_echo "#define FIM_PIPE_IMAGE_READ 1" >>confdefs.h $as_echo "#define FIM_AUTHOR_NAME \"Michele Martone\"" >>confdefs.h $as_echo "#define FIM_AUTHOR_EMAIL \"\"" >>confdefs.h $as_echo "#define FIM_AUTHOR \"Michele Martone \"" >>confdefs.h # Note: Gerd changed his surname from Knorr to Hoffmann, so I report here his actual surname $as_echo "#define FBI_AUTHOR_NAME \"Gerd Hoffmann\"" >>confdefs.h $as_echo "#define FBI_AUTHOR \"Gerd Hoffmann \"" >>confdefs.h want_matrices_rendering=no; # Check whether --enable-matrices-rendering was given. if test "${enable_matrices_rendering+set}" = set; then : enableval=$enable_matrices_rendering; if test x$enableval = xyes; then if test x$ac_cv_func_rsb_lib_init = xyes; then $as_echo "#define HAVE_MATRIX_MARKET_DECODER 1" >>confdefs.h #CXXFLAGS="$CXXFLAGS `librsb-config --cflags`" #LIBS="$LIBS `librsb-config --static --ldflags | sed s/-static//g`" want_matrices_rendering=yes; else as_fn_error $? "Cannot detect librsb! Either disable matrix rendering or supply the right LIBS and CXXFLAGS!" "$LINENO" 5 fi else true; fi fi if test x$ac_cv_func_rsb_lib_init = xyes -a x$want_matrices_rendering = xyes; then ENABLE_MATRIX_MARKET_DECODER_TRUE= ENABLE_MATRIX_MARKET_DECODER_FALSE='#' else ENABLE_MATRIX_MARKET_DECODER_TRUE='#' ENABLE_MATRIX_MARKET_DECODER_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if you have c++11 ..." >&5 $as_echo_n "checking if you have c++11 ...... " >&6; } if ${have_cv_cxx11+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if __cplusplus<201103L #error using pre-c++11 #endif int main() { } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : fim_cxx_standard=new else fim_cxx_standard=old fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_cxx11" >&5 $as_echo "$have_cv_cxx11" >&6; } if test x"$fim_cxx_standard" = x"new"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void thread_function() { } int main () { std::thread t(&thread_function); t.join(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : have_cv_thread_libs=yes else have_cv_thread_libs=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test x$have_cv_thread_libs != xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: Seemingly C++ threads need an extra library. Checking if -pthread solves this." >&5 $as_echo "$as_me: Seemingly C++ threads need an extra library. Checking if -pthread solves this." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : LIBS="$LIBS -lpthread"; cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void thread_function() { } int main () { std::thread t(&thread_function); t.join(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Yes, adding -lpthread allows using C++ threads." >&5 $as_echo "$as_me: Yes, adding -lpthread allows using C++ threads." >&6;} fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fim_cv_have_pthread_added=yes; else fim_cv_have_pthread_added=no fi fi fi FIM_SVN_REPOSITORY=http://svn.savannah.nongnu.org/svn/fbi-improved/ #AC_CONFIG_FILES([Makefile],[src/Makefile]) ac_config_files="$ac_config_files Makefile src/Makefile doc/Makefile distros/Makefile scripts/Makefile scripts/maintenance/cron-build.sh scripts/maintenance/remote-build.sh scripts/maintenance/cron-svndump.pl scripts/maintenance/cron-rsync.sh" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_LIBGRAPHICSMAGICK_TRUE}" && test -z "${WITH_LIBGRAPHICSMAGICK_FALSE}"; then as_fn_error $? "conditional \"WITH_LIBGRAPHICSMAGICK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_IMLIB2_TRUE}" && test -z "${ENABLE_IMLIB2_FALSE}"; then as_fn_error $? "conditional \"ENABLE_IMLIB2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_SHELLCHECK_TRUE}" && test -z "${WITH_SHELLCHECK_FALSE}"; then as_fn_error $? "conditional \"WITH_SHELLCHECK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_MAN2HTML_TRUE}" && test -z "${WITH_MAN2HTML_FALSE}"; then as_fn_error $? "conditional \"WITH_MAN2HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_PERL_TRUE}" && test -z "${WITH_PERL_FALSE}"; then as_fn_error $? "conditional \"WITH_PERL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_EXPECT_TRUE}" && test -z "${WITH_EXPECT_FALSE}"; then as_fn_error $? "conditional \"WITH_EXPECT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FRAMEBUFFER_TRUE}" && test -z "${ENABLE_FRAMEBUFFER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FRAMEBUFFER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_FLEXLEXER_TRUE}" && test -z "${WITH_FLEXLEXER_FALSE}"; then as_fn_error $? "conditional \"WITH_FLEXLEXER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GIF_TRUE}" && test -z "${ENABLE_GIF_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GIF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_TIFF_TRUE}" && test -z "${ENABLE_TIFF_FALSE}"; then as_fn_error $? "conditional \"ENABLE_TIFF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WANT_READLINE_TRUE}" && test -z "${WANT_READLINE_FALSE}"; then as_fn_error $? "conditional \"WANT_READLINE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_JPEG_TRUE}" && test -z "${ENABLE_JPEG_FALSE}"; then as_fn_error $? "conditional \"ENABLE_JPEG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PS_TRUE}" && test -z "${ENABLE_PS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DJVU_TRUE}" && test -z "${ENABLE_DJVU_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DJVU\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_POPPLER_TRUE}" && test -z "${ENABLE_POPPLER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_POPPLER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PDF_TRUE}" && test -z "${ENABLE_PDF_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_BMP_TRUE}" && test -z "${ENABLE_BMP_FALSE}"; then as_fn_error $? "conditional \"ENABLE_BMP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PCX_TRUE}" && test -z "${ENABLE_PCX_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PCX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PNG_TRUE}" && test -z "${ENABLE_PNG_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PNG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ARCHIVE_TRUE}" && test -z "${ENABLE_ARCHIVE_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ARCHIVE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_SDL_TRUE}" && test -z "${ENABLE_SDL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_SDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FIM_WANT_HARDCODED_CONSOLEFONT_TRUE}" && test -z "${FIM_WANT_HARDCODED_CONSOLEFONT_FALSE}"; then as_fn_error $? "conditional \"FIM_WANT_HARDCODED_CONSOLEFONT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GS_TRUE}" && test -z "${HAVE_GS_FALSE}"; then as_fn_error $? "conditional \"HAVE_GS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_FIMGS_TRUE}" && test -z "${HAVE_FIMGS_FALSE}"; then as_fn_error $? "conditional \"HAVE_FIMGS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WANT_DEFAULT_FIMRC_TRUE}" && test -z "${WANT_DEFAULT_FIMRC_FALSE}"; then as_fn_error $? "conditional \"WANT_DEFAULT_FIMRC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_HISTORY_TRUE}" && test -z "${ENABLE_HISTORY_FALSE}"; then as_fn_error $? "conditional \"ENABLE_HISTORY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WANT_RECURSIVE_DIRS_TRUE}" && test -z "${WANT_RECURSIVE_DIRS_FALSE}"; then as_fn_error $? "conditional \"WANT_RECURSIVE_DIRS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WANT_READ_STDIN_IMAGE_TRUE}" && test -z "${WANT_READ_STDIN_IMAGE_FALSE}"; then as_fn_error $? "conditional \"WANT_READ_STDIN_IMAGE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_VALGRIND_TRUE}" && test -z "${HAVE_VALGRIND_FALSE}"; then as_fn_error $? "conditional \"HAVE_VALGRIND\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE}" && test -z "${FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_FALSE}"; then as_fn_error $? "conditional \"FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE}" && test -z "${FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_FALSE}"; then as_fn_error $? "conditional \"FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_RUNNABLE_TESTS_TRUE}" && test -z "${HAVE_RUNNABLE_TESTS_FALSE}"; then as_fn_error $? "conditional \"HAVE_RUNNABLE_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_CONVERT_TRUE}" && test -z "${WITH_CONVERT_FALSE}"; then as_fn_error $? "conditional \"WITH_CONVERT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_INKSCAPE_TRUE}" && test -z "${WITH_INKSCAPE_FALSE}"; then as_fn_error $? "conditional \"WITH_INKSCAPE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_XFIG_TRUE}" && test -z "${WITH_XFIG_FALSE}"; then as_fn_error $? "conditional \"WITH_XFIG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_AA_TRUE}" && test -z "${ENABLE_AA_FALSE}"; then as_fn_error $? "conditional \"ENABLE_AA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_CACA_TRUE}" && test -z "${ENABLE_CACA_FALSE}"; then as_fn_error $? "conditional \"ENABLE_CACA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_RAW_BITS_RENDERING_TRUE}" && test -z "${ENABLE_RAW_BITS_RENDERING_FALSE}"; then as_fn_error $? "conditional \"ENABLE_RAW_BITS_RENDERING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_DEBUG_TRUE}" && test -z "${WITH_DEBUG_FALSE}"; then as_fn_error $? "conditional \"WITH_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_MATRIX_MARKET_DECODER_TRUE}" && test -z "${ENABLE_MATRIX_MARKET_DECODER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_MATRIX_MARKET_DECODER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by fim $as_me 0.6-rc2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ fim config.status 0.6-rc2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "distros/Makefile") CONFIG_FILES="$CONFIG_FILES distros/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/maintenance/cron-build.sh") CONFIG_FILES="$CONFIG_FILES scripts/maintenance/cron-build.sh" ;; "scripts/maintenance/remote-build.sh") CONFIG_FILES="$CONFIG_FILES scripts/maintenance/remote-build.sh" ;; "scripts/maintenance/cron-svndump.pl") CONFIG_FILES="$CONFIG_FILES scripts/maintenance/cron-svndump.pl" ;; "scripts/maintenance/cron-rsync.sh") CONFIG_FILES="$CONFIG_FILES scripts/maintenance/cron-rsync.sh" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi #AC_OUTPUT { $as_echo "$as_me:${as_lineno-$LINENO}: Fim v${VERSION} has been configured as follows (features marked with * are not recommended: either unfinished or broken: please do NOT use them when building for a distro): default minimal key mapping : ${have_default_mapping:-no} default minimal key bindings : ${have_default_bindings:-no} default configuration file builtin : ${have_default_config:-no} resize optimizations : ${fim_cv_resize_optimizations:-no} system,popen calls wrappers enabled : ${fim_system_calls:-yes} will allow push of directories : ${fim_cv_read_dirs} will recurse directories (-R switch): ${fim_cv_recursive_dirs} patch for running under screen : ${fim_cv_screen:-no} ~/.fimrc startup file support : ${have_fimrc:-no} ~/.fim_history load/save support : ${fim_cv_history:-no} autocommands enabled : ${have_autocommands:-no} hardcoded PSF font (FBFONT=fim://) : ${have_hardcoded_font:-no} will read image files from stdin(-i): ${fim_cv_read_stdin_image:-no} GNU regexps (default is Posix) :*${fim_cv_regex:-no} seek magic signatures : ${fim_cv_seek_magic:-no} man page with user configured paths : ${fim_cv_paths_in_man} framebuffer console load switchable :*${fim_cv_fb_console_switch_while_loading:-no} hardcoded font magnifying factor : ${fim_cv_want_font_magnify_factor} customizable status bar : ${fim_cv_custom_status_bar:-no} readline (-lrl) library support : ${fim_want_readline} use 'xcftopnm' for XCF files :*${fim_cv_xcftopnm} use 'inkscape' for SVG files : ${fim_cv_inkscape} use 'fig2dev' for FIG files : ${fim_cv_xfig} use 'convert' for unrecognized files:*${fim_cv_convert} use 'exiftool' for EXIF tags in JPEG:*${fim_cv_exiftool} framebuffer (built-in) support : ${fim_handle_framebuffer:-yes} X (sdllib) support (-o sdl) : ${fim_handle_sdl} ASCII art (aalib) support (-o aa) : ${fim_cv_aalib} Colour ASCII art (libcaca) support : ${fim_cv_libcaca} X (Imlib2) support(-o imlib2):*${fim_handle_imlib2:-no} EXIF (JPEG) tags support (libexif) : ${fim_cv_libexif} BMP file support (builtin) : ${fim_handle_bmp:-no} JP2 (JPEG-2K) file support (JasPer) : ${fim_cv_libjasper} PCX file support (builtin) : ${fim_handle_pcx:-no} PNG file support (libpng) : ${fim_handle_png:-no} JPEG file support (libjpeg) : ${fim_handle_jpeg:-no} TIFF file support (libtiff) : ${fim_handle_tiff:-no} GIF file support (libgif) : ${fim_handle_gif:-no} DJVU file support (libdjvu) :*${fim_handle_djvu:-no} PDF file support (libpoppler) :*${fim_handle_pdf:-no} PS file support (libspectre) :*${fim_handle_ps:-no} NEF/RAW file support (libufraw) :*${fim_handle_ufraw:-no} TAR/ZIP/.. file support (libarchive):*${fim_handle_archive:-no} GraphicsMagick support (libGraphicsMagick):*${fim_handle_graphicsmagick:-no} YACC : ${YACC} LEX : ${LEX} CXX : ${CXX} CXXFLAGS : ${CXXFLAGS} LIBS : ${LIBS} prefix : ${prefix} If you are not satisfied with this configuration, please invoke ./configure --help=short for a complete list of configure options and variables specific to Fim. When you are satisfied, run 'make' to build Fim and its documentation. To install the program and its documentation, run 'make install' if you are root, or run 'su -c '\"make install\"' if you are not root. RTFM: README, man fim, man fimrc. Enjoy! " >&5 $as_echo "$as_me: Fim v${VERSION} has been configured as follows (features marked with * are not recommended: either unfinished or broken: please do NOT use them when building for a distro): default minimal key mapping : ${have_default_mapping:-no} default minimal key bindings : ${have_default_bindings:-no} default configuration file builtin : ${have_default_config:-no} resize optimizations : ${fim_cv_resize_optimizations:-no} system,popen calls wrappers enabled : ${fim_system_calls:-yes} will allow push of directories : ${fim_cv_read_dirs} will recurse directories (-R switch): ${fim_cv_recursive_dirs} patch for running under screen : ${fim_cv_screen:-no} ~/.fimrc startup file support : ${have_fimrc:-no} ~/.fim_history load/save support : ${fim_cv_history:-no} autocommands enabled : ${have_autocommands:-no} hardcoded PSF font (FBFONT=fim://) : ${have_hardcoded_font:-no} will read image files from stdin(-i): ${fim_cv_read_stdin_image:-no} GNU regexps (default is Posix) :*${fim_cv_regex:-no} seek magic signatures : ${fim_cv_seek_magic:-no} man page with user configured paths : ${fim_cv_paths_in_man} framebuffer console load switchable :*${fim_cv_fb_console_switch_while_loading:-no} hardcoded font magnifying factor : ${fim_cv_want_font_magnify_factor} customizable status bar : ${fim_cv_custom_status_bar:-no} readline (-lrl) library support : ${fim_want_readline} use 'xcftopnm' for XCF files :*${fim_cv_xcftopnm} use 'inkscape' for SVG files : ${fim_cv_inkscape} use 'fig2dev' for FIG files : ${fim_cv_xfig} use 'convert' for unrecognized files:*${fim_cv_convert} use 'exiftool' for EXIF tags in JPEG:*${fim_cv_exiftool} framebuffer (built-in) support : ${fim_handle_framebuffer:-yes} X (sdllib) support (-o sdl) : ${fim_handle_sdl} ASCII art (aalib) support (-o aa) : ${fim_cv_aalib} Colour ASCII art (libcaca) support : ${fim_cv_libcaca} X (Imlib2) support(-o imlib2):*${fim_handle_imlib2:-no} EXIF (JPEG) tags support (libexif) : ${fim_cv_libexif} BMP file support (builtin) : ${fim_handle_bmp:-no} JP2 (JPEG-2K) file support (JasPer) : ${fim_cv_libjasper} PCX file support (builtin) : ${fim_handle_pcx:-no} PNG file support (libpng) : ${fim_handle_png:-no} JPEG file support (libjpeg) : ${fim_handle_jpeg:-no} TIFF file support (libtiff) : ${fim_handle_tiff:-no} GIF file support (libgif) : ${fim_handle_gif:-no} DJVU file support (libdjvu) :*${fim_handle_djvu:-no} PDF file support (libpoppler) :*${fim_handle_pdf:-no} PS file support (libspectre) :*${fim_handle_ps:-no} NEF/RAW file support (libufraw) :*${fim_handle_ufraw:-no} TAR/ZIP/.. file support (libarchive):*${fim_handle_archive:-no} GraphicsMagick support (libGraphicsMagick):*${fim_handle_graphicsmagick:-no} YACC : ${YACC} LEX : ${LEX} CXX : ${CXX} CXXFLAGS : ${CXXFLAGS} LIBS : ${LIBS} prefix : ${prefix} If you are not satisfied with this configuration, please invoke ./configure --help=short for a complete list of configure options and variables specific to Fim. When you are satisfied, run 'make' to build Fim and its documentation. To install the program and its documentation, run 'make install' if you are root, or run 'su -c '\"make install\"' if you are not root. RTFM: README, man fim, man fimrc. Enjoy! " >&6;} fim-0.6-rc2/INSTALL0000644000175000017500000003661414454352345010613 00000000000000Installation Instructions ************************* 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 notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== 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 below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. fim-0.6-rc2/Makefile.in0000644000175000017500000040171714503403454011620 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ # $Id: Makefile.am 1979 2023-07-14 23:46:31Z dezperado $ 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 = . 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) $(dist_doc_DATA) $(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 = scripts/maintenance/cron-build.sh \ scripts/maintenance/remote-build.sh \ scripts/maintenance/cron-svndump.pl \ scripts/maintenance/cron-rsync.sh 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 = depcomp = am__maybe_remake_depfiles = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docdir)" DATA = $(dist_doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am 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 \ $(top_srcdir)/scripts/maintenance/cron-build.sh.in \ $(top_srcdir)/scripts/maintenance/cron-rsync.sh.in \ $(top_srcdir)/scripts/maintenance/cron-svndump.pl.in \ $(top_srcdir)/scripts/maintenance/remote-build.sh.in AUTHORS \ COPYING ChangeLog INSTALL NEWS README THANKS TODO compile \ depcomp install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPECT = @EXPECT@ FIM_CONFIGURATION = @FIM_CONFIGURATION@ FIM_CUSTOM_HARDCODED_CONSOLEFONT = @FIM_CUSTOM_HARDCODED_CONSOLEFONT@ FIM_DEFS = @FIM_DEFS@ FIM_LIBS = @FIM_LIBS@ FIM_LIB_OBJECTS = @FIM_LIB_OBJECTS@ FIM_SVN_REPOSITORY = @FIM_SVN_REPOSITORY@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ HAVE_AWK = @HAVE_AWK@ HAVE_BISON = @HAVE_BISON@ HAVE_CAT = @HAVE_CAT@ HAVE_CPP = @HAVE_CPP@ HAVE_ECHO = @HAVE_ECHO@ HAVE_FLEX = @HAVE_FLEX@ HAVE_GREP = @HAVE_GREP@ HAVE_MAN = @HAVE_MAN@ HAVE_RM = @HAVE_RM@ HAVE_SED = @HAVE_SED@ HAVE_SORT = @HAVE_SORT@ HAVE_TIMEOUT = @HAVE_TIMEOUT@ HAVE_VALGRIND = @HAVE_VALGRIND@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBAA_CONFIG = @LIBAA_CONFIG@ LIBCACA_CONFIG = @LIBCACA_CONFIG@ LIBDJVU = @LIBDJVU@ LIBGIF = @LIBGIF@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBPOPPLER = @LIBPOPPLER@ LIBPS = @LIBPS@ LIBS = @LIBS@ LIBSDL2_CONFIG = @LIBSDL2_CONFIG@ LIBSDL_CONFIG = @LIBSDL_CONFIG@ LIBTIFF = @LIBTIFF@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN = @MAN@ 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@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POPPLER_CFLAGS = @POPPLER_CFLAGS@ POPPLER_LIBS = @POPPLER_LIBS@ RANLIB = @RANLIB@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHELLCHECK = @SHELLCHECK@ SORT = @SORT@ STRIP = @STRIP@ SVN_REVISION = @SVN_REVISION@ SVN_REVISION_NUMBER = @SVN_REVISION_NUMBER@ TIMEOUT_LARGE = @TIMEOUT_LARGE@ TIMEOUT_SMALL = @TIMEOUT_SMALL@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ 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@ ac_ct_CXX = @ac_ct_CXX@ 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@ fim_cv_version = @fim_cv_version@ have_convert = @have_convert@ have_dia = @have_dia@ have_gs = @have_gs@ have_inkscape = @have_inkscape@ have_xcftopnm = @have_xcftopnm@ have_xfig = @have_xfig@ have_zcat = @have_zcat@ 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@ # mhmhmhm # CLEANFILES = autom4te.cache srcdir = src sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # no-dependencies was due to problems with conditional sources # nostdinc disables the standard -I. include which breaks a correct string.h include AUTOMAKE_OPTIONS = nostdinc no-dependencies # dejagnu SUBDIRS = src doc distros scripts dist_doc_DATA = $(top_srcdir)/README $(top_srcdir)/README.FIRST $(top_srcdir)/TODO $(top_srcdir)/VERSION $(top_srcdir)/BUGS $(top_srcdir)/FAQ.TXT $(top_srcdir)/AUTHORS $(top_srcdir)/ChangeLog $(top_srcdir)/NEWS.in $(top_srcdir)/NEWS $(top_srcdir)/README.md # no INSTALL INSTALL.TXT is necessary in rules EXTRA_DIST = COPYING \ Makefile.am configure.ac configure \ aclocal.m4 config.h.in \ autogen.sh \ $(top_srcdir)/media/image.jpg \ $(top_srcdir)/media/image.png \ $(top_srcdir)/media/fim.png \ $(top_srcdir)/media/icon_smile.gif \ $(top_srcdir)/media/numbers/0.gif \ $(top_srcdir)/media/numbers/1.gif \ $(top_srcdir)/media/numbers/2.gif \ $(top_srcdir)/media/numbers/3.gif \ $(top_srcdir)/media/numbers/4.gif \ $(top_srcdir)/media/numbers/5.gif \ $(top_srcdir)/media/numbers/6.gif \ $(top_srcdir)/media/numbers/7.gif \ $(top_srcdir)/media/numbers/8.gif \ $(top_srcdir)/media/numbers/9.gif \ $(top_srcdir)/media/numbers_pcx/0.pcx \ $(top_srcdir)/media/numbers_pcx/1.pcx \ $(top_srcdir)/media/numbers_pcx/2.pcx \ $(top_srcdir)/media/numbers_pcx/3.pcx \ $(top_srcdir)/media/numbers_pcx/4.pcx \ $(top_srcdir)/media/numbers_pcx/5.pcx \ $(top_srcdir)/media/numbers_pcx/6.pcx \ $(top_srcdir)/media/numbers_pcx/7.pcx \ $(top_srcdir)/media/numbers_pcx/8.pcx \ $(top_srcdir)/media/numbers_pcx/9.pcx \ $(top_srcdir)/media/multipage/sample.tex \ $(top_srcdir)/media/multipage/Makefile \ $(top_srcdir)/media/special/icon_smile_gif_at_7.bin \ $(top_srcdir)/media/special/images.desc \ $(top_srcdir)/media/special/modifiers.desc \ $(top_srcdir)/media/special/postscript.eps \ $(top_srcdir)/media/special/images.list \ $(top_srcdir)/media/special/dir.desc \ $(top_srcdir)/media/special/collated.list \ $(top_srcdir)/media/special/loadable.desc \ $(top_srcdir)/media/special/0_8bit.pcx.bin \ $(top_srcdir)/media/special/0_gray.tiff \ $(top_srcdir)/media/special/0_rgba.tiff \ $(top_srcdir)/media/special/0_monochrome_white_polarity.tiff \ $(top_srcdir)/media/special/0_16bps_msb.tiff \ $(top_srcdir)/media/special/0_interlaced.gif \ $(top_srcdir)/media/special/0_truncated_bad.gif.bin \ $(top_srcdir)/media/special/0.webp \ $(top_srcdir)/media/special/truncated_bad.png.bin \ $(top_srcdir)/media/special/truncated_bad.jpg.bin \ $(top_srcdir)/media/special/0_gray.png \ $(top_srcdir)/media/special/numbers_pcx.tar \ $(top_srcdir)/media/special/numbers_pcx.tar.bz2 \ $(top_srcdir)/media/special/numbers_pcx.tar.gz \ $(top_srcdir)/media/special/numbers_pcx.tar.xz \ $(top_srcdir)/media/special/ciao.fig \ $(top_srcdir)/media/special/matrix.mtx \ $(top_srcdir)/var/fonts/Lat15-Terminus16.psf \ depcomp missing install-sh FIM_EXE = ./src/fim$(EXEEXT) FIMGS_EXE = PATH=./src/:$(PATH) $(abs_srcdir)/src/fimgs #%.sig: % # gpg -sbv -u 0xE0E669C8EF1258B8 $@ $< # gpg -sbav -u 0xE0E669C8EF1258B8 $@ $< CXX11TEST = test ` $(FIM_EXE) -V | grep standard | head -1 | tr -d -c '[:digit:]'` -gt 200301 FIMNORCOPTS = --no-rc-file --no-etc-fimrc-file --no-history FIMSCLTSTOPTS = -C '_downscale_huge_at_load=-1;_magnify_factor=2;_reduce_factor=2;' --no-auto-scale -o dumb -q FIMVIDEOTESTOPTS = -K ']]].[[fmfmwsk--++hhlltW' -K ':quit' --chars-press '' # --chars-press -K NO_ASAN = ASAN_OPTIONS=detect_leaks=0 @ENABLE_AA_TRUE@@ENABLE_CACA_FALSE@FIM_USE_ASCII_ART_DEFAULT = aa @ENABLE_CACA_TRUE@FIM_USE_ASCII_ART_DEFAULT = ca SNTZ = |tr -d -c '0-9A-Za-z_./:-' FIMSCRIPTSDIR = `pwd`/scripts/maintenance/ MANSUBST = sed -e 's,@sysconfdir\@,$(sysconfdir),g' -e 's,@docdir\@,$(docdir),g' -e 's,-,\\-,g' all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 scripts/maintenance/cron-build.sh: $(top_builddir)/config.status $(top_srcdir)/scripts/maintenance/cron-build.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ scripts/maintenance/remote-build.sh: $(top_builddir)/config.status $(top_srcdir)/scripts/maintenance/remote-build.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ scripts/maintenance/cron-svndump.pl: $(top_builddir)/config.status $(top_srcdir)/scripts/maintenance/cron-svndump.pl.in cd $(top_builddir) && $(SHELL) ./config.status $@ scripts/maintenance/cron-rsync.sh: $(top_builddir)/config.status $(top_srcdir)/scripts/maintenance/cron-rsync.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | 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__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | 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__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_docDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_docDATA .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ 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 \ install-data install-data-am install-dist_docDATA 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 uninstall-dist_docDATA .PRECIOUS: Makefile # still unfinished .PHONY: signed-tgzdist signed-tgzdist: dist gpg -sbv -u 0xE0E669C8EF1258B8 $(distdir).tar.gz ls -l $(distdir).tar.gz $(distdir).tar.gz.sig # still unfinished .PHONY: signed-dist signed-dist: dist make dist-bzip2 && gpg -sbv -u 0xE0E669C8EF1258B8 $(distdir).tar.bz2 ls -l $(distdir).tar.bz2 $(distdir).tar.bz2.sig gpg -sbv -u 0xE0E669C8EF1258B8 $(distdir).tar.gz ls -l $(distdir).tar.gz $(distdir).tar.gz.sig .PHONY: fbtests fbtests: all @WITH_EXPECT_TRUE@ $(TIMEOUT_SMALL) \ @WITH_EXPECT_TRUE@ $(EXPECT) $(top_srcdir)/scripts/tests/spawn_and_quit.exp $(FIM_EXE) $(FIMNORCOPTS) -o fb $(top_srcdir)/media/ $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS) FRAMEBUFFER="/dev/non-existing-framebuffer-device" \ $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS); test $$? = 1 # invalid FRAMEBUFFER device is detected as error FRAMEBUFFER="/dev/non-existing-framebuffer-device" \ $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS) |& grep open.*No.such # invalid FRAMEBUFFER is verbose $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS) --device "/dev/non-existing-framebuffer-device"; test $$? = 1 # invalid --device option detected as error $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS) --device "/dev/non-existing-framebuffer-device" |& grep open.*No.such # invalid FRAMEBUFFER is verbose $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS) |& grep -v Inappropriate # good device works fine if test "$(TERM)" != screen.linux && which screen; then \ test `screen -q $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb=S $(FIMVIDEOTESTOPTS) -c 'stdout "fail"' | wc -l` = 0; \ fi # screen does not propagate commands's return code, therefore the stdout-based trick if test "$(TERM)" = screen.linux ; then \ $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb=S $(FIMVIDEOTESTOPTS); test $$? = 255; \ fi @FIM_WANT_HARDCODED_CONSOLEFONT_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o fb $(top_srcdir)/media/ --verbose-font-load -c 'font "info"; quit' | wc -l` -ge 4 # font verbosity minimum @FIM_WANT_HARDCODED_CONSOLEFONT_FALSE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o fb $(top_srcdir)/media/ --verbose-font-load -c 'font "info"; quit' | wc -l` -ge 3 # font verbosity minimum $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit !(_fbfont_as_screen_fraction=~"[0-9]")' # must be a number (0 if off); more tests needed $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit !(_fbfont_magnify_factor=~"[0-9]")' # must be a number (0 if off); more tests needed .PHONY: aatests aatests: all @WITH_EXPECT_TRUE@ $(NO_ASAN) $(TIMEOUT_SMALL) \ @WITH_EXPECT_TRUE@ $(EXPECT) $(top_srcdir)/scripts/tests/spawn_and_quit.exp $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ $(NO_ASAN) $(TIMEOUT_LARGE) $(FIM_EXE) $(FIMNORCOPTS) -o aa --sanity-check | grep 's 98 b 1 1 1 c 99' # differently than -o dumb, this stresses DebugConsole's grow() mechanism $(NO_ASAN) $(FIM_EXE) $(top_srcdir)/media/ -t -c 'console_scroll_up;console_scroll_down;console_scroll_reset;quit' # placeholder for a better test $(NO_ASAN) $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o aa $(FIMVIDEOTESTOPTS) if test -n "$(DISPLAY)"; then \ $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o aa=w $(FIMVIDEOTESTOPTS); \ fi @WANT_READLINE_TRUE@ if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o aa=w -C '_debug_commands="k"' -K:quit -K '' | grep pressed.key; fi # readline mode key verbosity test "`SSH_TTY=1 $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -c 'stderr _device_string' -kq 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # test "`(unset SSH_TTY; $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # test "`( SSH_TTY= $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # # extras for readline and caption related: @WANT_READLINE_TRUE@ $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -K :$$'\t'ne$$'\t'$$'\t' -K '' -Kq # completion_display_matches_hook @WANT_READLINE_TRUE@ $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -K :$$'\t'n=x$$'\t'$$'\t' -K '' -Kq # cover completion of variables @WANT_READLINE_TRUE@ echo q | $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -K : # cover fim_rl_getc @WANT_READLINE_TRUE@ $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -C '_caption_over_image=3;_caption_over_image_fmt="fim:%M";_display_status=1;display' -kn -kq # cover Viewport::extra_top_height $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -K :$$'\t' -Kq | grep WELCOME 2>&1 | cat > /dev/null # cover what happens hitting Tab in console mode .PHONY: cacatests cacatests: all @WITH_EXPECT_TRUE@ $(NO_ASAN) $(TIMEOUT_SMALL) \ @WITH_EXPECT_TRUE@ $(EXPECT) $(top_srcdir)/scripts/tests/spawn_and_quit.exp $(FIM_EXE) $(FIMNORCOPTS) -o ca $(top_srcdir)/media/ $(NO_ASAN) $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o caca $(FIMVIDEOTESTOPTS) # added caca falls back to ca if test -n "$(DISPLAY)"; then \ $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o ca=w $(FIMVIDEOTESTOPTS); \ fi @WANT_READLINE_TRUE@ if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o ca=w -C '_debug_commands="k"' -K:quit -K '' | grep pressed.key; fi # readline mode key verbosity test "`SSH_TTY=1 $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -c 'stderr _device_string' -kq 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # test "`(unset SSH_TTY; $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # test "`( SSH_TTY= $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # .PHONY: sdltests sdltests: all $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=h --version | grep 'SDL[2]\?' $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=h $(FIMVIDEOTESTOPTS); $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=hhMR20:10% -K $$'\t' -c 'while(0){1;}quit;' ; # cover: draw help grid, unlock, input poll, misc $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=0:-1 ; test $$? = 252 @FIM_WANT_HARDCODED_CONSOLEFONT_TRUE@ $(NO_ASAN) FBFONT= \ @FIM_WANT_HARDCODED_CONSOLEFONT_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl -c quit # TODO: this is only a coverage test @FIM_WANT_HARDCODED_CONSOLEFONT_TRUE@ $(NO_ASAN) FBFONT=fim:// \ @FIM_WANT_HARDCODED_CONSOLEFONT_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl -c quit # TODO: this is only a coverage test .PHONY: imlib2tests imlib2tests: all $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2 $(FIMVIDEOTESTOPTS); $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2=20:10% -K $$'\t' -c 'while(0){1;}quit;' ; # cover: draw help grid, unlock, input poll, misc # $(NO_ASAN) $(TIMEOUT_LARGE) \ # $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2=0:-1 ; test $$? = 252 $(NO_ASAN) FBFONT= \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2 -c quit # TODO: this is only a coverage test $(NO_ASAN) FBFONT=fim:// \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2 -c quit # TODO: this is only a coverage test # this rule is deprecated, too: testing should be performed with 'make tests' (FIXME) .PHONY: sanity-check sanity-check: all @HAVE_RUNNABLE_TESTS_TRUE@ @$(FIM_EXE) $(FIMNORCOPTS) -E $(top_srcdir)/scripts/tests/sanity.fim -t @HAVE_RUNNABLE_TESTS_FALSE@ @echo "you are cross-compiling, so can't run tests..." .PHONY: check check: tests .PHONY: devtests devtests: all @WITH_SHELLCHECK_TRUE@ $(SHELLCHECK) -e SC2235,SC1117,SC2230,SC2086,SC2006,SC2001 $(top_srcdir)/src/fimgs ! grep '^#' NEWS ! grep -n '^[^ ].\{107,\}' doc/FIM.TXT ! grep -n '^[^ ].\{83,\}' README ! grep -n '^[^ ].\{175,\}' README.md test `grep '[^=]==[^=]' $(top_srcdir)/configure.ac | grep -v ^dnl | wc -l` = 0 # look out for bashisms if grep -q PKG_CHECK_MODULES configure.ac; then ! grep -q PKG_CHECK_MODULES configure; fi test `grep '[^=]==[^=]' $(top_srcdir)/src/fimgs | wc -l` = 0 # look out for more bashisms test `grep 'test.* == ' $(top_srcdir)/Makefile.am | wc -l` = 1 # tolerate == on this line only test `grep 'SNTZ.*wc' $(top_srcdir)/Makefile.am | wc -l` = 1 # tolerate SNTZ.*wc on this line only ! grep -n '^[^ ].\{83,\}' README ! grep '\<'$(USER)'\>' doc/*man* # against namespace leaks ! grep '\.o\>' $(top_srcdir)/src/Makefile.am ! grep '\' $(top_srcdir)/src/Makefile.am @WITH_PERL_TRUE@ test -s doc/FIM.html @WITH_MAN2HTML_TRUE@@WITH_PERL_TRUE@ test -s doc/fimgs.man.html -a -s doc/fim.man.html -a -s doc/fimrc.man.html @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIMGS_EXE) ssh:$$(hostname):$(abs_top_srcdir)/media/numbers/0.gif -- $(FIMNORCOPTS) -o dumb -K q @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIMGS_EXE) ssh:$$(hostname):$(abs_top_srcdir)/media/numbers/u.gif -- $(FIMNORCOPTS) -o dumb -K q; test $$? = 255 @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ export TMPDIR=`pwd`/tmpdir && $(FIMGS_EXE) ssh:$$(hostname):$(abs_top_srcdir)/media/numbers/0.gif -- $(FIMNORCOPTS) -o dumb -K q && test "`ls $$TMPDIR`" = "" @HAVE_RUNNABLE_TESTS_TRUE@@HAVE_VALGRIND_TRUE@ if ! ldd $(FIM_EXE) | grep libasan.so.5; then \ @HAVE_RUNNABLE_TESTS_TRUE@@HAVE_VALGRIND_TRUE@ make clean -C src/testdir ; \ @HAVE_RUNNABLE_TESTS_TRUE@@HAVE_VALGRIND_TRUE@ VALGRIND='valgrind --tool=memcheck --leak-check=yes --num-callers=15 --exit-on-first-error=yes --error-exitcode=255' \ @HAVE_RUNNABLE_TESTS_TRUE@@HAVE_VALGRIND_TRUE@ make ltests; \ @HAVE_RUNNABLE_TESTS_TRUE@@HAVE_VALGRIND_TRUE@ fi # this is the official way of testing fim .PHONY: tests tests: all ! ( echo $(abs_top_srcdir) | grep '[\\ :"'"'"']' ) # reject unreasonable base directory names @HAVE_RUNNABLE_TESTS_TRUE@ ulimit -c unlimited || true @HAVE_RUNNABLE_TESTS_TRUE@ ulimit -v 32000 || true @HAVE_RUNNABLE_TESTS_TRUE@ ulimit -t 1000 || true @HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_LARGE) $(FIM_EXE) $(FIMNORCOPTS) -o dumb --sanity-check @HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_LARGE) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'stdout random ; quit 0;' # make sure no leak from 'random' @HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_LARGE) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'quit !(randomm == 0 && ( random != 0 || random != 0 || random != 0));' # hope to get three non-zeros @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c '_display_status_fmt="fim:%M%n%R%m_v"' --verbose-interpreter --verbose-interpreter -kn -kq # cover modifiers and interpreter @HAVE_RUNNABLE_TESTS_TRUE@ wc0=` $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -kq |wc -l`; \ @HAVE_RUNNABLE_TESTS_TRUE@ wc1=`$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -kq --verbose-load|wc -l`; \ @HAVE_RUNNABLE_TESTS_TRUE@ wc2=`$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -kq --verbose-load --verbose-load|wc -l`; \ @HAVE_RUNNABLE_TESTS_TRUE@ test $$wc0 -lt $$wc1 -a $$wc1 -lt $$wc2 # ensure at least two levels of load verbosity # @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~="; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.1 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/../media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~="; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.2 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~^"; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.1 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/../media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~^"; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.1 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/../media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~$$"; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.1 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/../media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~!"; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.0 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/../media/numbers_pcx/2.pcx -c 'a=_filelistlen;limit "~!"; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.2 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "~i" "4"; b=_filelistlen; limit "~i" "4-4"; c=_filelistlen; limit "~i" "4-5"; d=_filelistlen; stdout a.".".b.".".c.".".d;quit' $(SNTZ)` = 10.1.1.2 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "~z" "0-900"; b=_filelistlen; limit "~z" "0-909"; c=_filelistlen; stdout a.".".b.".".c;quit'` = 10.0.7 # needs stat @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "!"; b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 10.0 # needs stat @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "~d" "01/01/1970-01/01/2007"; b=_filelistlen; limit "~d" "01/01/2007-19/01/2038"; c=_filelistlen; stdout a.".".b.".".c;quit' $(SNTZ)` = 10.0.10 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "prime" "yes"; b=_filelistlen; limit "prime" "no" ; c=_filelistlen; limit "prime" "zzz" ; d=_filelistlen; stdout a.".".b.".".c.".".d;quit' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc $(SNTZ)` = 10.3.2.0 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "uno"; b=_filelistlen;limit "due"; c=_filelistlen; limit "boh"; d=_filelistlen; stdout a.".".b.".".c.".".d;quit' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc $(SNTZ)` = 10.1.1.0 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'limit "-list";stdout _last_cmd_output;limit "-listall";stdout _last_cmd_output; quit;' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc | grep there.are.*variable > /dev/null # TODO: need better test here @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'limit "-list" "prime";stdout _last_cmd_output;limit "-listall" "prime";stdout _last_cmd_output; quit;' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc | grep there.are.*value > /dev/null # TODO: need better test here @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_8bit.pcx.bin -C 'stdout "Unsupported PCX file test.."' -c 'quit !(i:width==0)' # named so to not break dir-loading tests @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/0.pcx; quit !(i:_comment=="comments")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/1.pcx; quit !(i:_comment=="pre_comments")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/2.pcx; quit !(i:_comment=="comment")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/3.pcx; quit !(i:_comment=="comment_post")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/4.pcx; quit !(i:_comment=="komment")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/5.pcx; quit !(i:_comment=="kommentar")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/6.pcx; quit !(i:_comment=="comment_POST")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/7.pcx; quit !(i:_comment=="PRE_comment_POST")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/7.pcx; quit !(i:common=="s")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/8.pcx; quit !(i:_comment=="comment_POST")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/8.pcx; quit !(i:common=="")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/9.pcx; quit !(i:common=="")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/9.pcx; quit !(i:_comment=="comment@@@common@5_")' @ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "-/5/";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.8.12 @ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "-/B";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.12.12 @ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+/b";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.0.12 @ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+/B";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.2.12 @ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+/s";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.2.12 @ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+/d";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.3.12 @ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+/u";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.0.12 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+50%";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c 'list "sort"; a=_fileindex; goto "+prime"; b=_fileindex;goto "+prime"; c=_fileindex; goto "+prime"; d=_fileindex; goto "+prime"; e=_fileindex; stdout a.".".b.".".c.".".d.".".e; quit' | grep 0.2.5.6.1 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -C 'bind "n" "goto \"+1f\"";' -Knnnq -F 'quit !(_fileindex==4);' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -C 'bind "n" "goto \"+1F\"";' -Knnnq -F 'quit !(_fileindex==8);' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c 'list "sort_fsize"; goto 0; reload; stdout i:_filename; quit' | grep 1.pcx @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort"; list;l1=_last_cmd_output;list "random_shuffle";list;l2=_last_cmd_output;if(l1==l2)quit 255; quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort"; next;f=i:_filename;list "swap"; reload;if(f==i:_filename)quit 255; quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx $(top_srcdir)/media/numbers_pcx/*.pcx --sort -c 'list "pop"; if(_filelistlen!= 9) quit 255;quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "pop"; if(_filelistlen!=19) quit 255;quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/numbers_pcx/2.pcx --reverse -c 'quit!(i:_filename=~"2.pcx")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/numbers_pcx/2.pcx -c 'quit (i:_filename=~"2.pcx")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "remove"; quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'next;list "pop";reload;quit !(i:_filename == "$(top_srcdir)/media/numbers_pcx/0.pcx")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'next;list "remove";reload;quit !(i:_filename == "$(top_srcdir)/media/numbers_pcx/2.pcx")' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -k n -k Del -k q -F 'stdout i:_filename' $(SNTZ)` = "$(top_srcdir)/media/numbers_pcx/2.pcx" @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'a=1' -c 'a=a+1;' -c 'quit (1-(a==2))' @HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'cd "$(top_srcdir)/media/"' -c 'stdout _pwd;l=_filelistlen;list "pushdir" _pwd;stdout l;if(l==_filelistlen)quit 255; quit' @HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'cd "$(top_srcdir)/media/"' -c 'stdout _pwd;l=_filelistlen;list "pushdirr" _pwd;stdout l;if(l==_filelistlen)quit 255; quit' @HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'cd "$(top_srcdir)/media/"' -c 'stdout _pwd;l=_filelistlen;list "pushdir" ;stdout l;if(l==_filelistlen)quit 255; quit' @HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'cd "$(top_srcdir)/media/"' -c 'stdout _pwd;l=_filelistlen;list "pushdirr" ;stdout l;if(l==_filelistlen)quit 255; quit' @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir "$(top_srcdir)/media/image.jpg" -c 'quit 2' -kq; test $$? = 2 # --cd-and-readdir respects scripting @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb "$(top_srcdir)/media/" -c ' quit 2' -kq; test $$? = 2 # no heading semicolons: good @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb "$(top_srcdir)/media/" -c ';quit 2' -kq; test $$? = 0 # heading semicolons: bad (FIXME in the long run) @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir "$(top_srcdir)/media/image.jpg" -c 'quit 2' -kq; test $$? = 2 # --cd-and-readdir respects scripting @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'if(_pwd=="$(abs_builddir)")quit 1; quit' # check that cd is effective @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ test "`$(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'stdout _pwd;quit'`" = `cd $(abs_top_srcdir)/media; pwd;` # check that cd is effective, again (yes, redundant) @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'if (_filelistlen<=1)quit 1;quit' # check that dir files are pushed @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'if (_filelistlen>20)quit 1;quit' # too many files means recursive push @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'l0=_filelistlen; list "pushdir" "."; l1=_filelistlen; if(l0!=l1)quit 1; quit' # pushdir must be idempotent @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'l0=_filelistlen; list "pushdirr" "."; l1=_filelistlen; if(l0==l1)quit 1; quit' # pushdir and pushdirr must differ @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'if(i:_filename=~"image.jpg")quit 0; quit 1' # --cd-and-readdir does jumps to loaded file @ENABLE_RAW_BITS_RENDERING_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit !(_all_file_loaders=~"Text")' # shall reflect supported file formats @ENABLE_RAW_BITS_RENDERING_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ --as-text -c quit @ENABLE_RAW_BITS_RENDERING_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ --as-text -c 'stdout _last_file_loader;quit' $(SNTZ)` = Text # mostly coverage @ENABLE_RAW_BITS_RENDERING_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ --binary=1 -c 'stdout _last_file_loader;quit' $(SNTZ)` = Bit1 # mostly coverage @ENABLE_RAW_BITS_RENDERING_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ --binary=24 -c 'stdout _last_file_loader;quit' $(SNTZ)` = Bit24 # mostly coverage @ENABLE_RAW_BITS_RENDERING_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ test `echo -n U | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin --binary=1 -c 'magnify;stdout i:height."."._last_file_loader;quit' $(SNTZ)` = 1.Bit1 # coverage of tiny case; TODO: remove necessity of magnify @ENABLE_RAW_BITS_RENDERING_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ test `echo -n U | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin --binary=24 -c 'magnify;stdout i:height."."._last_file_loader;quit' $(SNTZ)` = 1.Bit24 # coverage of tiny case; TODO: remove necessity of magnify @ENABLE_RAW_BITS_RENDERING_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ test `echo $(abs_srcdir)/media | $(FIM_EXE) $(FIMNORCOPTS) -o dumb - --binary=23 -c 'magnify;stdout _last_file_loader;quit' $(SNTZ)` = Bit24 # coverage of - and fallback to 24 @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -c 'window;stdout _last_cmd_output;quit;' grep disabled > /dev/null @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ --dump-reference-help | wc -l $(SNTZ)` -gt 100 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=m | wc -c $(SNTZ)` -gt 28000 # man dump @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=m | grep fB | wc -l $(SNTZ)` -gt 40 # lots of troff @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=l | grep fB | wc -l $(SNTZ)` -eq 0 # no troff left (hopefully) @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --NON-existent-OPTIONNN | wc -l $(SNTZ)` -gt 70 # help function @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) --NON-existent-OPTIONNN; test $$? = 240 # help function failing @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if which convert; then \ @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif -monochrome $(top_srcdir)/media/icon_smile.bmp && \ @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp && \ @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if which ppmtobmp ; then \ @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif ppm:- | ppmtobmp -bpp 8 > $(top_srcdir)/media/icon_smile.bmp && \ @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp && \ @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif ppm:- | ppmtobmp -bpp 4 > $(top_srcdir)/media/icon_smile.bmp && \ @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp ; \ @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ fi && \ @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif -depth 8 -alpha Disassociate $(top_srcdir)/media/icon_smile.bmp && \ @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp; \ @ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ fi @HAVE_RUNNABLE_TESTS_TRUE@ if which convert; then \ @HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif -depth 8 $(top_srcdir)/media/icon_smile.ppm && \ @HAVE_RUNNABLE_TESTS_TRUE@ sed -i 's/P6$$/P6\n# comment/g' $(top_srcdir)/media/icon_smile.ppm && \ @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.ppm -c 'stdout _last_file_loader;quit' $(SNTZ)` = ppm && rm -f $(top_srcdir)/media/icon_smile.ppm && \ @HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif -depth 16 $(top_srcdir)/media/icon_smile.ppm && \ @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.ppm -c 'stdout _last_file_loader;quit' $(SNTZ)` = ppm && rm -f $(top_srcdir)/media/icon_smile.ppm && \ @HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif -depth 8 $(top_srcdir)/media/icon_smile.pgm && \ @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.pgm -c 'stdout _last_file_loader;quit' $(SNTZ)` = pgm && rm -f $(top_srcdir)/media/icon_smile.pgm; \ @HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif -depth 16 $(top_srcdir)/media/icon_smile.pgm && \ @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.pgm -c 'stdout _last_file_loader;quit' $(SNTZ)` = pgm && rm -f $(top_srcdir)/media/icon_smile.pgm; \ @HAVE_RUNNABLE_TESTS_TRUE@ fi # cover-test FbiStuffPpm.cpp @HAVE_RUNNABLE_TESTS_TRUE@@WITH_XFIG_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/ciao.fig -c 'stdout _last_file_loader;quit' $(SNTZ)` = ppm # @HAVE_RUNNABLE_TESTS_TRUE@@WITH_XFIG_FALSE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/ciao.fig -c 'stdout _last_file_loader;quit' $(SNTZ)` = 0 # @HAVE_RUNNABLE_TESTS_TRUE@@WITH_LIBGRAPHICSMAGICK_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -X -o dumb $(top_srcdir)/media/special/0.webp -c 'stdout _last_file_loader;quit' $(SNTZ)` = libGraphicsMagick @HAVE_RUNNABLE_TESTS_TRUE@@WITH_CONVERT_TRUE@@WITH_LIBGRAPHICSMAGICK_FALSE@ test `$(FIM_EXE) $(FIMNORCOPTS) -X -o dumb $(top_srcdir)/media/special/0.webp -c 'stdout _last_file_loader;quit' $(SNTZ)` = 0 # assuming no other decoders exists, -X stops external converters @HAVE_RUNNABLE_TESTS_TRUE@@WITH_CONVERT_TRUE@@WITH_LIBGRAPHICSMAGICK_FALSE@ if which convert && convert identify -list format | grep -i webp; then test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0.webp -c 'stdout _last_file_loader;quit' $(SNTZ)` = ppm ; fi # note: this would pass also with old pipe mechanism -- tiny file @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WITH_CONVERT_TRUE@ if which convert && convert identify -list format | grep -i ppm; then $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_downscale_huge_at_load=-1' $(top_srcdir)/media/image.jpg --pread-cmd='convert {} -background black -flop -fill white -pointsize 3 label:"mirrored {}" -gravity Center -append ppm:-' -c 'quit !(i:width==320)' ; fi # pointsize need to be small or text will exceed 320 pixels @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WITH_CONVERT_TRUE@ if which convert && convert identify -list format | grep -i ppm; then $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_downscale_huge_at_load=-1' $(top_srcdir)/media/image.jpg --pread-cmd='convert {} -rotate 90 -append ppm:-' -c 'quit !(i:width==240)' ; fi @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WITH_CONVERT_TRUE@ if which convert && convert identify -list format | grep -i ppm; then cp $(top_srcdir)/media/image.jpg -- -image.jpg && $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_downscale_huge_at_load=-1' --pread-cmd='convert {} -rotate 90 -append ppm:-' -c 'quit !(i:width==320)' -- -image.jpg && rm -- -image.jpg ; fi @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '=_pushdir_re=.(PNG)' $(top_srcdir)/media/numbers_pcx/ -kq; test $$? = 248 # _pushdir_re assignment is effective @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '=_pushdir_re=.(PCX)' $(top_srcdir)/media/numbers_pcx/ -kq # _pushdir_re assignment is effective @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_pushdir_re=".(PNG)"' $(top_srcdir)/media/numbers_pcx/ -kq # _pushdir_re assignment comes late and is not effective @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c '2,4 stdout "{}";q' | wc -l` = 3 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c '3;list "mark";6;list "mark"; 1,2 stdout "marked {}";q' | grep 'marked.*[01].pcx' | wc -l` = 2 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c '3;list "mark";6;list "mark"; toggleLimitMarked;1,2 stdout "marked {}";q' | grep 'marked.*[25].pcx' | wc -l` = 2 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-file ../special/images.list -c 'if(_filelistlen!=2)quit 255; quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin-elds '!' --read-from-file ../special/images.list -c 'if(_filelistlen!=0)quit 255; quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin-elds '!' --read-from-file ../special/collated.list -c 'if(_filelistlen!=2)quit 255; quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ $(TIMEOUT_SMALL) $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-file ../special/collated-NON-EXISTING.list ; test $$? = 248 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ cat $(top_srcdir)/media/numbers_pcx/1.pcx | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin -c 'quit !(i:width>0 && i:height>0)' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ echo | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin -kq @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ echo | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin ; test $$? = 248 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ echo $(top_srcdir)/media/numbers_pcx/* | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin --read-from-stdin-elds ' ' -c 'quit !(_filelistlen==9)' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin ; test $$? = 33 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin -Kq ; test $$? = 33 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin -kq ; test $$? = 33 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin -C 'quit 22' ; test $$? = 22 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin -c 'quit 22' ; test $$? = 22 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin -F 'quit 22' ; test $$? = 22 @ENABLE_ARCHIVE_TRUE@@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ tar czf archive.tgz $(top_srcdir)/media/numbers_pcx/ && $(TIMEOUT_SMALL) $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb archive.tgz -c 'stdout i:pages." pages";if(i:pages==1)quit 255;quit' && rm -f archive.tgz @ENABLE_ARCHIVE_TRUE@@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ echo 'not an archive' > archive.tgz; $(TIMEOUT_SMALL) $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb archive.tgz -c 'stdout i:pages." pages";if(i:pages!=0)quit 255;quit' && rm -f archive.tgz @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'pread "cat $(top_srcdir)/media/numbers_pcx/1.pcx"; reload' -c 'quit !(i:width>0 && i:height>0)' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'cd "$(abs_srcdir)/media/numbers_pcx/1.pcx"; pwd;d1=_last_cmd_output; cd "-"; pwd;d2=_last_cmd_output; cd "$(abs_srcdir)/media/numbers_pcx/";pwd;d3=_last_cmd_output; if(d1!=d3||d1==d2)quit 1;quit' $(SNTZ) # check that "cd file" works @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_file_loader="ppm"' $(top_srcdir)/media/numbers_pcx/1.pcx -c 'stdout i:width; stdout (i:width!=0 && i:height!=0);quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_file_loader="pcx"' $(top_srcdir)/media/numbers_pcx/1.pcx -c 'stdout i:width; stdout (i:width==0 && i:height==0);quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --mark-from-image-descriptions-file $(top_srcdir)/media/special/images.desc -c 'l=_filelistlen;toggleLimitMarked;if(_filelistlen!=l/2)quit 255; quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-descriptions-file-separator $$'\t' $(top_srcdir)/media/special/loadable.desc $(top_srcdir)/media/numbers_pcx/ -c '/2.pcx;if(i:_comment=~"due")quit;quit 255' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-descriptions-file-separator '?' $(top_srcdir)/media/special/loadable.desc $(top_srcdir)/media/numbers_pcx/ -c '/2.pcx;if(i:_comment=~"due")quit 255;quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C 'cd "$(top_srcdir)"' $(top_srcdir)/media/special/dir.desc -c 'quit !(_filelistlen==2)' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --image-descriptions-file-separator $$'\t' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/2.pcx;if(i:_comment=~"due")quit;quit 255' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --image-descriptions-file-separator '?' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/2.pcx;if(i:_comment=~"due")quit 255;quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/1.pcx;if(i:prime=="no")quit 255;quit;' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/4.pcx;if(i:prime=="yes")quit 255;quit;' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/2.pcx;if(i:_comment!="due")quit 255;quit;' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/4.pcx;quit (i:_comment)'; test $$? = 44 @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/0.pcx;quit (i:_comment)' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c 'list "vars"; if(! _last_cmd_output =~ "vals.*files") quit 255;;quit;' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ rm -f "tmp.desc"; # in view of append test @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -c 'desc "load" "$(top_srcdir)/media/special/images.desc"; desc "reload" "$(top_srcdir)/media/special/images.desc"; desc "-nooverw" "save" "tmp.desc"; quit;' && test `wc -w < tmp.desc` = 15 && rm tmp.desc # need proper 'reload' test @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -c 'desc "load" "$(top_srcdir)/media/special/images.desc" "\t"; desc "reload" "$(top_srcdir)/media/special/images.desc" "\t"; desc "-nooverw" "save" "tmp.desc" "X"; quit;' && test `grep X tmp.desc | wc -w` = 10 # need proper 'load' with separator test @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -c 'desc "load" "$(top_srcdir)/media/special/images.desc" "\t"; desc "reload" "$(top_srcdir)/media/special/images.desc" "\t"; desc "-append" "save" "tmp.desc" "X"; quit;' && test `grep X tmp.desc | wc -w` = 20 && rm tmp.desc # need proper 'load' with separator test @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-shadow-directory $(top_srcdir)/media/../ -c 'scale "shadow"; if (_last_cmd_output =~ "image substituted")quit 0; else quit 255;'; fi @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-shadow-directory $(top_srcdir)/var/ -c 'scale "shadow"; if (_last_cmd_output =~ "image substituted")quit 0; else quit 255;'; test $$? = 255; fi @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -k n -k q -K n -K n -K q -F 'stdout _fileindex;if(_fileindex!=2){quit 255}quit' # -k executes before -K @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -K n -K q -k n -k n -k q -F 'stdout _fileindex;if(_fileindex!=3){quit 255}quit' # -k executes before -K @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -k n -K n -K n -k q -K q -F 'stdout _fileindex;if(_fileindex!=2){quit 255}quit' # -k executes before -K @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -K n -k n -k n -K q -k q -F 'stdout _fileindex;if(_fileindex!=3){quit 255}quit' # -k executes before -K @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -/ media/numbers_pcx/4.pcx -c 'stdout _fileindex;if(_fileindex!=0){quit 255}quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -/ 4.pcx -c 'stdout _fileindex;if(_fileindex!=5){quit 255}quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* --/ media/numbers_pcx/4.pcx -c 'stdout _fileindex;if(_fileindex!=0){quit 255}quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* --/ 4.pcx -c 'stdout _fileindex;if(_fileindex!=5){quit 255}quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* --// media/numbers_pcx/4.___ -c 'stdout _fileindex;if(_fileindex!=0){quit 255}quit' @ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* --// media/numbers_pcx/4.pcx -c 'stdout _fileindex;if(_fileindex!=5){quit 255}quit' @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'stdout i:width.i:height; eval "quit"' -i < $(top_srcdir)/media/image.jpg $(SNTZ) | tail -1` != "00" # mostly coverage @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.jpg -C '_downscale_huge_at_load=-1' -= -c 'pan "0%" "100%"' -cq # pan_to; TODO: test properly @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.jpg -C '_downscale_huge_at_load=-1' -K++++ -c 'flip;mirror;pan_left;pan_right;pan_up;pan_down;pan_ne;pan_sw;pan_se;pan_nw "100%"' -c 'popen "echo quit"' # mostly coverage @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o non-existing-reverting-to-dumb-without-error -Kq @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 2:6 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 000 @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 2:7 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 2:1K $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 2+4 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 000 @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 2+5 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 0 $(top_srcdir)/media/icon_smile.gif -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 6 $(top_srcdir)/media/icon_smile.gif -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 000 @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 6:1000 $(top_srcdir)/media/icon_smile.gif -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' | grep -v Reading $(SNTZ)` = 000 @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 7 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 6 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 000 @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_seek_magic="gif"' $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' | tr -d '\n' | tr ' ' _ $(SNTZ)` = 000 @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_seek_magic="GIF"' $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 8 -C '_seek_magic="GIF"' $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 000 @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 6 -C '_seek_magic="GIF"' $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_interlaced.gif -c 'quit !(i:width!=0)' # interlaced gif @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_truncated_bad.gif.bin -c 'quit !(i:width==0)' # deliberately invalid gif @ENABLE_MATRIX_MARKET_DECODER_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/matrix.mtx -c 'stdout i:rows.i:columns.i:nnz._last_file_loader;quit' $(SNTZ)` = 222MatrixMarket; @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c '_max_cached_images=1;stdout _fileindex;quit;' --no-stat-push a/b.png c/d.png e/f.png $(SNTZ)` = 1 @ENABLE_JPEG_TRUE@@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/[0-4].pcx $(top_srcdir)/media/special/truncated_bad.jpg.bin $(top_srcdir)/media/numbers_pcx/[5-9].pcx -Knnnnnq -F 'if(_fileindex!=6)quit 6;quit' # fim handles broken jpeg files graciously @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/truncated_bad.png.bin -c 'quit'; test $$? = 134 # deliberately invalid png: reminder that need start to use png_set_error_fn @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_gray.png -c 'quit'; # just coverage so far @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit' --slideshow 0 -1 # if this does not hang is good @HAVE_RUNNABLE_TESTS_TRUE@ if which timeout; then \ @HAVE_RUNNABLE_TESTS_TRUE@ timeout 2 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit' --slideshow 0 ; R=$$?; \ @HAVE_RUNNABLE_TESTS_TRUE@ if which reset ; then reset; fi; \ @HAVE_RUNNABLE_TESTS_TRUE@ test $$R = 124; \ @HAVE_RUNNABLE_TESTS_TRUE@ fi; @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit 0; quit 1;' -F 'quit 2; quit 3'; test "$$?" = 2 @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -C 'quit 0; quit 1;' @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit 0; quit 1;' @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit 3'; test "$$?" = 3 @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit 2' -F 'quit 0; quit 1;' @HAVE_RUNNABLE_TESTS_TRUE@ for r in 0 1 2 254 255 ; do $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c "quit $$r" || test $$? = $$r ; done ; @HAVE_RUNNABLE_TESTS_TRUE@ for r in 0 1 2 254 255 ; do $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -C "quit $$r" || test $$? = $$r ; done ; @HAVE_RUNNABLE_TESTS_TRUE@ for r in 0 1 2 254 255 ; do $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit' -F "quit $$r" || test $$? = $$r ; done ; @ENABLE_PCX_TRUE@@ENABLE_SDL_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if test -n "$(DISPLAY)"; then \ @ENABLE_PCX_TRUE@@ENABLE_SDL_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl --resolution w $(top_srcdir)/media/numbers_pcx/ -R -q -a -c 'display "reinit" "w200:200"' -c 'quit (i:swidth!=_screen_height) || (i:swidth!=_screen_width)'; # pcx needs no library\ @ENABLE_PCX_TRUE@@ENABLE_SDL_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ fi @ENABLE_PCX_TRUE@@ENABLE_SDL_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl=17x17 -A $(top_srcdir)/media/numbers_pcx/1.pcx -q -c 'quit !(_autotop==1)'; fi # --autotop @ENABLE_PCX_TRUE@@ENABLE_SDL_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl=17x17 -P $(top_srcdir)/media/numbers_pcx/1.pcx -q -c 'quit (_autotop!=1) || (i:swidth!=_screen_width)'; fi # --text-reading @ENABLE_PCX_TRUE@@ENABLE_SDL_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl=17x17 $(top_srcdir)/media/numbers_pcx/1.pcx -q -c 'quit (_autotop!=1) || (i:swidth!=_screen_width)'; test $$? = 1; fi # --text-reading @ENABLE_PCX_TRUE@@ENABLE_SDL_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl=17:16 -q -P $(top_srcdir)/media/numbers_pcx/?.pcx -c 'align "info";a1=_last_cmd_output; scroll "forward";align "info";a2=_last_cmd_output; next; align "info";a3= _last_cmd_output; goto _lastfileindex; align "info";a4=_last_cmd_output; quit !(a1==a3 && a2==a4 && a1!=a2)' -kq ; fi # --text-reading @ENABLE_PCX_TRUE@@ENABLE_SDL_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl=17:16 -q $(top_srcdir)/media/numbers_pcx/?.pcx -c 'align "info";a1=_last_cmd_output; scroll "forward";align "info";a2=_last_cmd_output; next; align "info";a3= _last_cmd_output; goto _lastfileindex; align "info";a4=_last_cmd_output; quit !(a1==a3 && a2==a4 && a1==a2)' -kq ; fi # --text-reading @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep gif @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/icon_smile.gif -c 'rotate 10' -c quit @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test "`$(FIM_EXE) $(FIMNORCOPTS) -o dumb -R $(top_srcdir)/media/numbers/ -k 1 -k n -k 1 -k n -k q -F 'stdout _fileindex' $(SNTZ)`" = 3 # 3 and not 11 # note: need only supported files along the path to pass @HAVE_RUNNABLE_TESTS_TRUE@ top_srcdir=$(top_srcdir) FIMNORCOPTS="$(FIMNORCOPTS)" $(SHELL) $(top_srcdir)/scripts/tests/version.sh @HAVE_RUNNABLE_TESTS_TRUE@ top_srcdir=$(top_srcdir) FIMNORCOPTS="$(FIMNORCOPTS)" $(SHELL) $(top_srcdir)/scripts/tests/font.sh @HAVE_RUNNABLE_TESTS_TRUE@ $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'font; font "load" "non_existing"; font "next"; font "scan"; font "info"; font "prev"; quit'; true; # TODO: test more than tis mere coverage (btw, this one leaks, and in debug or asan mode fails) -- FIXME) @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media -c '_caption_over_image=3;display;quit;' @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -c 'quit;' @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X --execute-script $(top_srcdir)/scripts/example/oneline.fim -c quit @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -X --execute-script $(top_srcdir)/scripts/example/quit_23.fim -kq; test $$? = 23; # quit in script possible @HAVE_RUNNABLE_TESTS_TRUE@@WANT_DEFAULT_FIMRC_TRUE@ $(FIM_EXE) --no-history --no-rc-file $(top_srcdir)/media/ -o dumb -X --etc-fimrc $(top_srcdir)/scripts/example/quit_23.fim -kq; test $$? = 23; # quit at init possible @HAVE_RUNNABLE_TESTS_TRUE@@WANT_DEFAULT_FIMRC_TRUE@ test `$(FIM_EXE) --no-history --no-rc-file $(top_srcdir)/media/ -o dumb -X --etc-fimrc $(top_srcdir)/scripts/example/set_var.fim -c 'stdout variable;quit' $(SNTZ)` = value # note: --no-rc-file and --etc-fimrc are incompatible @HAVE_RUNNABLE_TESTS_TRUE@@WANT_DEFAULT_FIMRC_FALSE@ $(FIM_EXE) --no-history --no-rc-file $(top_srcdir)/media/ -o dumb -X --etc-fimrc $(top_srcdir)/scripts/example/quit_23.fim -kq; # etc-fimrc quietly ignored @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -X --etc-fimrc $(top_srcdir)/scripts/example/set_var.fim -c 'stdout variable;quit' $(SNTZ)` = '0' # note: --no-rc-file and --etc-fimrc are incompatible @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -X --no-internal-config -c 'width;quit !(i:width == 0)' @HAVE_RUNNABLE_TESTS_TRUE@@WANT_READLINE_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb --no-commandline -K ':quit 10' # quits at second char @HAVE_RUNNABLE_TESTS_TRUE@@WANT_READLINE_TRUE@ rm -f record.fim; $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -W record.fim -K ':quit 10' -K ''; grep -q quit.10 record.fim && rm record.fim @ENABLE_HISTORY_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb --no-history --no-history-load --no-history-save -kq # FIXME: bogus test @ENABLE_HISTORY_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ rm -f .fim_history && HOME=`pwd` $(FIM_EXE) -N --no-etc-fimrc-file $(top_srcdir)/media/ -o dumb -C 'next;next' -c quit && grep -q '^next;next' .fim_history && rm .fim_history # note: history file may contain spaces newlines etc @ENABLE_HISTORY_FALSE@@HAVE_RUNNABLE_TESTS_TRUE@ rm -f .fim_history && HOME=`pwd` $(FIM_EXE) -N --no-etc-fimrc-file $(top_srcdir)/media/ -o dumb -C 'next;' -c quit && test -n .fim_history @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep png @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/image.png -c 'next' -c quit # leak fixed @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WITH_INKSCAPE_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/sample.svg -c 'quit !(i:width>0 && i:height>0)' # @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if $(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep tiff && which convert ; then \ @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/image.png $(top_srcdir)/image.tiff && \ @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/image.tiff -c 'next' -c quit; fi # leak fixed @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/ -c 'echo i:*' -k Tab -c quit # bogus test: should rather exercise MiniConsole @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if which convert ; then \ @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/numbers_pcx/*.pcx $(top_srcdir)/image.tiff && \ @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/image.tiff -c 'quit !(i:pages == 10)'; fi # multipage code in Image and load @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ rm -f $(top_srcdir)/image.tiff @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_gray.tiff -c 'i:width;quit !(i:width!=0)' # convert media/numbers/0.gif -grayscale average media/special/0_gray.tiff @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_rgba.tiff -c 'i:width;quit !(i:width!=0)' # convert media/numbers/0.gif -alpha transparent -depth 4 media/special/0_rgba.tiff @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_monochrome_white_polarity.tiff -c 'i:width;quit !(i:width!=0)' # convert media/numbers/0.gif -monochrome -define quantum:polarity=min-is-white -depth 1 media/special/0_monochrome_white_polarity.tiff @ENABLE_TIFF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_16bps_msb.tiff -c 'i:width;quit !(i:width!=0)' # convert media/numbers/0.gif -depth 16 -colorspace srgb -define tiff:endian=msb media/special/0_16bps_msb.tiff @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep jpeg @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if which wrjpgcom; then wrjpgcom -replace -comment 'add JPEG comment' $(top_srcdir)/media/image.jpg > image_commented.jpg && $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X image_commented.jpg -c quit && rm -f image_commented.jpg; fi # leak fixed @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if which convert && which exiftool; then \ @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif $(top_srcdir)/media/icon_smile.jpg && \ @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ exiftool -exif:iso=42 -overwrite_original_in_place $(top_srcdir)/media/icon_smile.jpg && \ @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.jpg -c quit && \ @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ rm -f $(top_srcdir)/media/icon_smile.jpg ; \ @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ fi # only cover test exif @ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ cp $(top_srcdir)/media/image.jpg $(abs_srcdir)/media/upc_abs.JPG && $(FIM_EXE) $(FIMNORCOPTS) -o dumb --no-stat-push $(abs_srcdir)/media/upc_abs.JPG -c 'quit !(i:width>0 && i:height>0)' && rm -f $(abs_srcdir)/media/upc_abs.JPG # not really jpg-specific, exploits regexps & co @ENABLE_POPPLER_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if which epstopdf && which epstopdf; then \ @ENABLE_POPPLER_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ epstopdf $(top_srcdir)/media/special/postscript.eps && \ @ENABLE_POPPLER_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/special/postscript.pdf -c 'quit !(i:width>0 && i:height>0)' ; fi # libpoppler @ENABLE_PS_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/special/postscript.eps -c 'quit !(i:width>0 && i:height>0)' @ENABLE_PS_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -C '_downscale_huge_at_load=-1;_preferred_rendering_dpi=100' $(top_srcdir)/media/special/postscript.eps -c 'quit !(i:width>0 && i:height>0)' @ENABLE_PS_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -C '_downscale_huge_at_load=-1;_preferred_rendering_dpi=100' $(top_srcdir)/media/special/postscript.eps -c 'stdout i:width;quit'` -lt `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -C '_downscale_huge_at_load=-1;_preferred_rendering_dpi=200' $(top_srcdir)/media/special/postscript.eps -c 'stdout i:width;quit'` @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'info;stdout _last_cmd_output;quit' | grep 'media.*KB' # cover info @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/image.png -c '/*.jpg' -c quit # parser leak fixed @HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -c 'identifier /*path...' -k q # parser leak fixed with destructor lines in yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -hs -h | grep h.s -q @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help | wc -c` -eq `$(FIM_EXE) $(FIMNORCOPTS) --help=s | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=s | wc -l` -eq `$(FIM_EXE) $(FIMNORCOPTS) --help=d | wc -l` @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=s | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=d | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=d | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=l | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=l | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=m | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=l | wc -l` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=m | wc -l` @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help _last_cmd_output | wc -l` = 5 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help _LAST_CMD_OUTPUT | wc -l` = 2 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help A | wc -l` = 4 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -hs -h | wc -l` = 2 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -hd -h | wc -l` = 2 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -hl -h | wc -l` = 3 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -hm -h | wc -l` = 3 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -hs -h | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) -hd -h | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -h -R | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) -h -R -R | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -hs -R | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) -hd -R | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -hd -R | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) -hl -R | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -hl -R | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) -hm -R | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help --read-from-stdin | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help --read-from-stdin --read-from-stdin | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=s --read-from-stdin | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=d --read-from-stdin | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=d --read-from-stdin | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=l --read-from-stdin | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=l --read-from-stdin | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=m --read-from-stdin | wc -c` @HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help=l --read-from-stdin | wc -l` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=m --read-from-stdin | wc -l` # if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb --background-recursive -B . -kK -kq -F 'if(_filelistlen==1)quit 255'; fi # -kK triggers a yield (often, not always) # if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb --background-recursive -B . -kq -F 'if(_filelistlen!=1)quit 255'; fi # no -kK -> no background images in batch mode (often, not always) @HAVE_RUNNABLE_TESTS_TRUE@ if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb --background-recursive -B $(top_srcdir)/ -kn -kq -F 'if(_filelistlen< 1)quit 255'; fi # difficult to write a reliable test for -B, but -kn can help a bit with timing @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help /a /q | wc -c` -gt 900 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --help help magnify _TERM jfngjfngjfn | wc -c` -gt 500 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'dump_key_codes; stdout _last_cmd_output; quit' | wc -c` -gt 1000 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --dump-reference-help | wc -c` -gt 30000 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --dump-reference-help | wc -c` -lt 60000 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --dump-reference-help=man | wc -c` -gt 60000 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) --dump-default-fimrc | wc -c` -gt 15000 @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'exec "src/fimrc"; echo; stdout; pwd; status "status" unalias' -c quit #; cover test misc corner cases (note: no functionality check here) @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'autocmd; autocmd "PostDisplay";autocmd "PostDisplay" "pattern";autocmd "1" "2" "toomuch"' -c quit #; cover test misc corner cases (note: no functionality check here) @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'autocmd_del; autocmd_del "PostDisplay";autocmd_del "PostDisplay" "pattern";autocmd_del "1" "2" "3";autocmd_del "1" "2" "3" "4"' -c quit #; cover test misc corner cases (note: no functionality check here) @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'alias "a" "quit 11"; unalias "a"; alias "a" "quit 23"; a; quit 13' -c quit ; test $$? = 23 @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'alias "a" "quit 23"; unalias "-a"; a; quit 13' -c quit ; test $$? = 13 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'unalias; stdout _last_cmd_output; unalias "NotExistent"; stdout _last_cmd_output;quit' | sed 's/unalias.*$$/Un/g' | tr -d '\n' $(SNTZ)` = UnUn @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c "bind 'F1' 'stdout 1';_max_iterated_commands=2;" -k 10F1 -k q | tr -d '\n' $(SNTZ)` = 11 # test binding repeat and F1 binding @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c "bind 'F1' 'stdout 1';_max_iterated_commands=1;" -k 10F1 -k q | tr -d '\n' $(SNTZ)` = 1 # test binding repeat and F1 binding @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c "bind 'F1' 'stdout 1';_max_iterated_commands=0;" -k 10F1 -k q | tr -d '\n' $(SNTZ)` = 1111111111 # test binding repeat and F1 binding @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READLINE_TRUE@ cp -p $(top_srcdir)/media/icon_smile.gif $(top_srcdir)/media/icon_smile.pgm @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READLINE_TRUE@ cp -p $(top_srcdir)/media/icon_smile.gif $(top_srcdir)/media/icon_smile.ppm @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READLINE_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.pgm $(top_srcdir)/media/icon_smile.ppm -K /smile.ppm -K '' -K q -F 'quit !(_fileindex==2);' # test slash search @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READLINE_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.pgm $(top_srcdir)/media/icon_smile.ppm -K /smole.ppm -K '' -K q -F 'quit !(_fileindex==0);' # test slash search @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READLINE_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.pgm $(top_srcdir)/media/icon_smile.ppm -c "goto '?$(top_srcdir)/media/icon_smile.ppm'" -K '' -K q -F 'quit !(_fileindex==2);' # test goto query @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READLINE_TRUE@ rm $(top_srcdir)/media/icon_smile.pgm $(top_srcdir)/media/icon_smile.ppm @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'v=1; bind "_" "recording;stdout _last_cmd_output;"; bind "S" "recording \"start\""' -K _S_rQ_E_q -F 'stdout i:_orientation' | wc -w ` -gt 70 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'v=1; bind "_" "recording; "; bind "S" "recording \"start\""' -K _S_rQ_E_q -F 'stdout i:_orientation' | wc -w ` -lt 70 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'v=1; bind "_" "recording;stdout _last_cmd_output;"; bind "S" "recording \"start\""' -K _S_rQ_E_q -F 'stdout i:_orientation' | grep ^.$$ | tr -d '\n' $(SNTZ)` = 2 @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -C 'v=1; bind "_" "recording;stdout _last_cmd_output;"; bind "S" "recording \"start\""' -K _S_rQ_E_q -F 'stdout i:_orientation' | grep ^.$$ | tr -d '\n' $(SNTZ)` = 1 @ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test "`$(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers/* -K 2n.q -F 'stdout i:_filename;' $(SNTZ)`" = $(top_srcdir)/media/numbers/3.gif @HAVE_RUNNABLE_TESTS_TRUE@ test "`$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'stderr; stdout; quit' 2>&1 > /dev/null | grep echo`" = "echo command" # stdout vs stderr @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'stderr "out:due";stdout "out:uno";quit' 2>&1 > /dev/null | grep out $(SNTZ)` = "out:due" # stdout vs stderr @HAVE_RUNNABLE_TESTS_TRUE@@WANT_READLINE_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -C set_commandline_mode -K 'stdout "cli"; quit;' -K '' $(SNTZ)` = cli @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'set; stdout _last_cmd_output; quit' | wc -w` -ge 50 # test set @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'set "_TERM"; stdout _last_cmd_output; quit' | wc -w` -eq 1 # test set @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'set "_TERM" "WhatWhat"; stdout _last_cmd_output; set 1 2 3 ; stdout _last_cmd_output; quit' | sed "s/set.*$$/Set/g" | tr -d '\n' $(SNTZ)` = WhatWhatSetSetSet @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'unbind; unbind "?"; bind "~"; bind "n"; bind "n" ""' -c quit @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'color "desaturate";color "negate";color "identity";color "colorblind" "daltonize";color "deuteranopia" "daltonize";color "protanopia" "daltonize";color "tritanopia" "daltonize";color "colorblind"' -c quit # only cover test @HAVE_RUNNABLE_TESTS_TRUE@ if which timeout; then if ! timeout 2 $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -c '/media' -c 'quit' ; then echo 'Seems like -c "/" is broken!'; false; fi; fi @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -c 'quit 14' ; if test $$? = 14 ; then echo '[*] Error code return test PASSED' ; else echo 'Error code return test FAILED'; false ; fi # @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c 'a=../' -k q # TODO: test missing. for lex.lex @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c 'a=./' -k q # TODO: test missing. for lex.lex @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c $$'\b' -k q # TODO: test missing. for lex.lex @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c 'stdout 0100' -k q # TODO: test missing. for lex.lex @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c 'stdout 0x10' -k q # TODO: test missing. for lex.lex @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c 'quit' -F '|' # TODO: test missing. for lex.lex @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png -c 'i=3;do { i=i-1; stdout i; } while (i>=1) stdout "ok";quit i;' # seldom used language feats (TODO): this is buggy anyways..) @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c '-1;stdout _fileindex;quit!(_fileindex==10);' # FIXME @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c '-3;stdout _fileindex;quit!(_fileindex==8);' @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c ' 0;stdout _fileindex;quit!(_fileindex==0);' @HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/-.pcx -c '3 stdout "y"; quit ((2+2)%(1+1))' | tr -d '\n' $(SNTZ)` = yyy # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '+"30.0"%;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '+ 30.0% ;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '*"30.0" ;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '* 30.0 ;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c ' "30.0"%;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '30.0 %;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '-"30.0"%;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '- 30.0% ;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '"30.0"%;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c ' 30.0 %;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '1,2a;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '1z;quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c 'stdout exce.ption' -k q # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '{1;;;}quit' # FIXME: add actual test # stress yacc.ypp @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'cache; quit ! ( _want_prefetch && _cache_status =~ "count:1/5")' # on all loadable files @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'prefetch; cache; quit ! ( _want_prefetch && _cache_status =~ "count:3/5")' # on all loadable files @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale ; w2=i:swidth; quit !(w1==w2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "Z" ; w2=i:swidth; quit !(w1==w2)' # Z is unknown @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "H" ; w2=i:swidth; quit !(w1!=w2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale ">" ; w2=i:swidth; quit !(2*w1==w2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "<" ; w2=i:swidth; quit !(w1/2==w2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "*0.5"; w2=i:swidth; quit !(w1/2==w2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "*0" ; w2=i:swidth; quit !(w1 < w2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "+" ; w2=i:swidth; quit !(w1 < w2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'm1=_magnify_factor;scale "++"; m2=_magnify_factor;quit !(m1 < m2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'm1=_magnify_factor;scale "+-"; m2=_magnify_factor;quit !(m1 > m2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'r1=_reduce_factor;scale "++"; r2=_reduce_factor; quit !(r1 < r2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'r1=_reduce_factor;scale "+-"; r2=_reduce_factor; quit !(r1 > r2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'm1=_magnify_factor;scale "+*"; m2=_magnify_factor;quit !(m1 < m2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'm1=_magnify_factor;scale "+/"; m2=_magnify_factor;quit !(m1 > m2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'r1=_reduce_factor;scale "+*"; r2=_reduce_factor; quit !(r1 < r2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'r1=_reduce_factor;scale "+/"; r2=_reduce_factor; quit !(r1 > r2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-0" ; w2=i:swidth; quit !(w1==w2)' # cover @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "0" ; w2=i:swidth; quit !(w1==w2)' # cover @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "*" ; w2=i:swidth; quit !(w1==w2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "+" ; w2=i:swidth; quit !(w1 < w2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-" ; w2=i:swidth; quit !(w1 > w2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-0.5"; w2=i:swidth; quit !(w1 > w2)' @ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-10%"; w2=i:swidth; quit !(w1 > w2)' @HAVE_RUNNABLE_TESTS_TRUE@ if $(FIM_EXE) --help crop | grep -q is.a.command; then make croptests; fi @ENABLE_AA_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ @make aatests @ENABLE_CACA_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ @make cacatests @ENABLE_FRAMEBUFFER_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ @if test -z "$(DISPLAY)$(SSH_TTY)" -a -w "/dev/fb0"; then make fbtests; fi @ENABLE_IMLIB2_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ @make imlib2tests @ENABLE_SDL_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ @if test -n "$(DISPLAY)"; then make sdltests; fi @HAVE_FIMGS_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ make fimgstests @HAVE_RUNNABLE_TESTS_TRUE@ make ltests @HAVE_RUNNABLE_TESTS_TRUE@ @echo "[*] TESTS: SUCCESS" @HAVE_RUNNABLE_TESTS_FALSE@ @echo "[!] TESTS: Skipped (you are cross-compiling, aren't you?)" .PHONY: croptests croptests: @ENABLE_GIF_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;_crop_once="0 0 10 10";crop;w2=i:width;quit !(w1+w2==25)' @ENABLE_GIF_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;crop ;w2=i:width;quit !(w1+w2==22)' @ENABLE_GIF_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;crop 10 ;w2=i:width;quit !(w1+w2==16)' @ENABLE_GIF_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;crop 40 40 60 60;w2=i:width;quit !(w1+w2==18)' @ENABLE_GIF_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;crop 25 25 ;w2=i:width;quit !(w1+w2==18)' @ENABLE_GIF_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;crop 50 50 ;w2=i:width;quit !(w1+w2==22)' .PHONY: ltests ltests: @ENABLE_JPEG_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep jpeg @ENABLE_JPEG_TRUE@ if test $(abs_builddir) = $(abs_srcdir) ; then make -C src/testdir ; else echo "out-of-dir? skipping ltests..." ; fi .PHONY: fimgstests fimgstests: $(FIMGS_EXE) --help -- $(FIMNORCOPTS) >/dev/null 2>&1 ; echo $$? = 255 # no fimgs --help option yet test `$(FIMGS_EXE) -h -- $(FIMNORCOPTS) | wc -l` -gt 14 test `$(FIMGS_EXE) -m -- $(FIMNORCOPTS) | wc -w` -gt 53 @HAVE_FIMGS_TRUE@ $(FIMGS_EXE) -- $(FIMNORCOPTS) -o dumb ./media/special/postscript.eps -c 'stdout _last_file_loader;quit 1' -K quit; test $$? = 0 # spaces not accepted by fimgs @ENABLE_PCX_TRUE@ if which tar ; then $(FIMGS_EXE) $(top_srcdir)/media/special/numbers_pcx.tar -- $(FIMNORCOPTS) -o dumb -c 'quit !(_last_file_loader=="pcx")' ; fi @ENABLE_PCX_TRUE@ if which tar && which bunzip2 ; then $(FIMGS_EXE) $(top_srcdir)/media/special/numbers_pcx.tar.bz2 -- $(FIMNORCOPTS) -o dumb -c 'quit !(_last_file_loader=="pcx")' ; fi @ENABLE_PCX_TRUE@ if which tar && which gunzip ; then $(FIMGS_EXE) $(top_srcdir)/media/special/numbers_pcx.tar.gz -- $(FIMNORCOPTS) -o dumb -c 'quit !(_last_file_loader=="pcx")' ; fi @ENABLE_PCX_TRUE@ if which tar && which unxz ; then $(FIMGS_EXE) $(top_srcdir)/media/special/numbers_pcx.tar.xz -- $(FIMNORCOPTS) -o dumb -c 'quit !(_last_file_loader=="pcx")' ; fi # new target, still not working .PHONY: tests-all tests-all: tests cd src && which cppcheck && cppcheck *cpp *.h || true $(SHELL) $(FIMSCRIPTSDIR)/configure-brute-check.sh #news-dump: # $(AWK) -- 'v=0;($$1 == "Version" && $$2=="'`cat VERSION`'"){while((input=getline) && $$1!="Version"){print}};' NEWS > f # this rule is deprecated, too .PHONY: test test: all @$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/* #~/M*s/*g # this rule is old and deprecated #tgz: clean # tar -czf ../fim.`date +%Y%m%d%H%M`.tgz ../fim/* # ls -l ../fim*.tgz -v # this rule is encouraged .PHONY: report report: @cat VERSION @echo '-' @$(LEX) -V 2>&1 @echo '-' @$(YACC) -V 2>&1 @echo '-' @$(CC) -v 2>&1 @echo '-' @echo 'now please report the bug with this information to the author via email' ; # this rule is redundant .PHONY: exec exec: test # this rule is smart, isn't it ? I love it ! .PHONY: edit edit: $(EDITOR) $(srcdir)/fim.cpp +':split $(srcdir)/fim.h' # Vim ! :) .PHONY: @true # this rule is informative and for acting like a peacock .PHONY: wc wc: wc $(srcdir)/*.cpp $(srcdir)/*.h $(srcdir)/yacc.ypp $(srcdir)/lex.lex @#wc $(FIM) # missing headers.. .PHONY: devhelp devhelp: @echo ----------------------------------------------- @echo ' short Makefile dev help' @echo ----------------------------------------------- @echo @echo 'make uptrunk' will upload trunk tarballs to @echo http://download.savannah.nongnu.org/releases/fbi-improved/ @echo @make help .PHONY: help help: @echo ----------------------------------------------- @echo ' short Makefile help' @echo ----------------------------------------------- @echo @echo 'Please read the documentation file before complaining!' @echo @echo 'The first documentation file you should read is README' @echo @echo 'If you are experiencing problems, please contact the code author.' @echo @echo 'His mail box resides as dezperado, then a dot, then autistici dot org.' @echo @echo 'You are encouraged attaching the output of `make report` in your bug reports.' @echo 'Thanks for your collaboration.' @echo .PHONY: ai ai: $(distdir).tar.gz.sig $(distdir).tar.gz $(distdir).tar.bz2.sig $(distdir).tar.bz2 make up -C var/ .PHONY: up up: upload news .PHONY: news news: freshmeat mail-announce .PHONY: dox dox: doc/fim.man doc/fimrc.man doc/fimgs.man doc/fim.man.in doc/fimrc.man.in: $(FIM_EXE) @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) --help=m > doc/fim.man.in @HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) --dump-reference-help=man > doc/fimrc.man.in doc/fimgs.man.in: $(FIM_EXE) @HAVE_GS_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIMGS_EXE) -m -- $(FIMNORCOPTS) > doc/fimgs.man.in doc/fim.man doc/fimrc.man doc/fimgs.man: doc/fim.man.in doc/fimrc.man.in doc/fimgs.man.in cat doc/fim.man.in |$(MANSUBST) > doc/fim.man cat doc/fimrc.man.in |$(MANSUBST) > doc/fimrc.man cat doc/fimgs.man.in |$(MANSUBST) > doc/fimgs.man # fixme : missing integration with ChangeLog file .PHONY: mail-announce mail-announce: @ figlet fim | mutt -s "fim-`cat VERSION` release" "fbi-improved-devel@nongnu.org" -i - .PHONY: log log: changelog # from trunk, we should call svn2cl .. to get the full fim changelog history .PHONY: changelog changelog: svn2cl -i .. .PHONY: release release: make signed-dist make uptrunk make -C var all make -C var ci #release: upload freshmeat .PHONY: upload upload: savannah .PHONY: uptrunk uptrunk: read && scp $(distdir).tar.gz.sig $(distdir).tar.gz $(distdir).tar.bz2.sig $(distdir).tar.bz2 dezperado@dl.sv.nongnu.org:/releases/fbi-improved/ # echo -en "cd /releases/fbi-improved\nput $(distdir).tar.gz.sig\n put fim-${fim_cv_version}.tar.gz\n put fim-${fim_cv_version}.tar.bz2\n put fim-${fim_cv_version}.tar.bz2.sig" | sftp "dezperado@dl.sv.gnu.org" -b .PHONY: savannah_ savannah_: signed-dist grep trunk VERSION || echo do lynx -dump dl.sv.gnu.org/releases/fbi-improved .PHONY: savannah-lookup savannah-lookup: lynx -dump dl.sv.gnu.org/releases/fbi-improved # fixme : missing integration with ChangeLog file and such information .PHONY: freshmeat_old freshmeat_old: @ $(AWK) -- 'v=0;($$1 == "Version" && $$2=="'`cat VERSION`'"){while((input=getline) && $$1!="Version"){print}};' NEWS @echo freshmeat-submit -v "fbi-`cat VERSION`" \ --project fbi-improved \ --license GPL \ --mailing-list-url $$(cat README | grep "^Mailing List :"|sed s/^.*\ :.//g) \ --home-page-url $$(cat README | grep "^Web Page "|sed s/^.*\ :.//g) \ --cvs-url $$(cat README | grep "^Repository"|sed s/^.*\ :.//g) \ --gzipped-tar-url $$(cat README | grep "^Releases "|sed s/^.*\ :.//g)/"fim-`cat VERSION`".tar.gz \ --mirror-site-url $$(cat README | grep "^Off.*rror : "|sed s/^.*\ :.//g) \ --changelog-url $$(cat README | grep "^ChangeLog "|sed s/^.*\ :.//g) @ echo "are you sure ? (any key to abort, yes to continue)" && read yes && [[ "$${yes}" == "yes" ]] && \ $(AWK) -- 'v=0;($$1 == "Version" && $$2=="'`cat VERSION`'"){while((input=getline) && $$1!="Version"){print}};' NEWS | \ freshmeat-submit -v "fbi-`cat VERSION`" \ --project fbi-improved \ --license GPL \ --mailing-list-url $$(cat README | grep "^Mailing List :"|sed s/^.*\ :.//g) \ --home-page-url $$(cat README | grep "^Web Page "|sed s/^.*\ :.//g) \ --cvs-url $$(cat README | grep "^Repository"|sed s/^.*\ :.//g) \ --gzipped-tar-url $$(cat README | grep "^Releases "|sed s/^.*\ :.//g)/"fim-`cat VERSION`".tar.gz \ --mirror-site-url $$(cat README | grep "^Off.*rror : "|sed s/^.*\ :.//g) \ --changelog-url $$(cat README | grep "^ChangeLog "|sed s/^.*\ :.//g) # --url-demo $$(cat README | grep "^Web Page "|sed s/^.*:.//g) # --bzipped-tar-url $$(cat README | grep "^Web Page "|sed s/^.*:.//g) .PHONY: freshmeat-submit freshmeat-submit: @echo Project: fim @echo Version: `cat VERSION` @echo Release-Focus: Major feature enhancements @echo Hide: N @echo Home-Page-URL: $$(cat README | grep "^Web Page "|sed s/^.*\ :.//g) @echo Mailing-List-URL: $$(cat README | grep "^Mailing List :"|sed s/^.*\ :.//g) @echo Gzipped-Tar-URL: $$(cat README | grep "^Releases "|sed s/^.*\ :.//g)/"fim-`cat VERSION`".tar.gz @echo Bzipped-Tar-URL: $$(cat README | grep "^Releases "|sed s/^.*\ :.//g)/"fim-`cat VERSION`".tar.bz2 @echo License: GPL @echo Mirror-Site-URL: $$(cat README | grep "^Off.*rror : "|sed s/^.*\ :.//g) @echo ChangeLog-URL: $$(cat README | grep "^ChangeLog "|sed s/^.*\ :.//g) @echo CVS-URL: $$(cat README | grep "^Repository"|sed s/^.*\ :.//g) @echo @ $(AWK) -- 'v=0;($$1 == "Version" && $$2=="'`cat VERSION`'"){while((input=getline) && $$1!="Version"){print}};' NEWS .PHONY: freshmeat freshmeat: @ echo "are you sure you want to freshmeat-submit ? (any key to abort, yes to continue)" && read yes && [[ "$${yes}" == "yes" ]] && \ make freshmeat-submit | grep -v '^make\[' | freshmeat-submit .PHONY: commit commit: log svn commit # This awaits completion. #rpm: dist # rpmbuild -ta @PACKAGE@-@VERSION@.tar.gz NEWS: NEWS.in grep -v '^#' < $< > $@ README.md: README cp $< $@.tmp; $(GREP) '^ [0-9][.]\?[0-9]\? ' README | while read; do \ ID=$${REPLY/ - /}; \ ID=$${ID//, /-}; \ ID=$${ID// /-}; \ ID=$${ID//,/}; \ ID=$${ID,,}; \ ID=$${ID// /}; \ ID=$${ID// /}; \ ID=$${ID//(/}; \ ID=$${ID//)/}; \ ID=$${ID//:/}; \ ID=$${ID//./}; \ ID=$${ID//\//}; \ $(GREP) "^$${REPLY/ - /}" README -C0 | $(SED) "s/\(^$${REPLY/ - /}.*\)/## <\/a>\1 ##/g;s/$${REPLY}/[$${REPLY/ - /}]\(#$${ID}\)/g;" -i $@.tmp; done; $(SED) -i "s|doc.fim.man.html|$(WWW)/\#man_fim|g" $@.tmp; $(SED) -i "s|doc.fimrc.man.html|$(WWW)/\#man_fimrc|g" $@.tmp; $(SED) -i "s|^-===\+-$$||g" $@.tmp; $(SED) -i "s|^ FIM|FIM|g" $@.tmp; $(SED) -i "s|^================================================================================|--------------------------------------------------------------------------------|g" $@.tmp; $(GREP) -v '^\(.vim:\|..Id\)' $@.tmp > $@; rm $@.tmp # 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: fim-0.6-rc2/THANKS0000644000175000017500000000070214503371112010446 00000000000000 Thanks go to (in temporal order, newer to older): Rafael Laboissiere, for several compatibility and correctness fixes Martin Klaiber, for pointing out problems and testing Mohammed Isam, for having provided PCX reading support Matthieu Crapet, for enabling out-of-tree builds Marco Barbàra, for testing and critiques Vitaly Minko, for testing and debugging on ARM Damiano Biagioli, for early testing Marta Carbone, for early testing and debugging fim-0.6-rc2/compile0000755000175000017500000001632714454352345011137 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: fim-0.6-rc2/autogen.sh0000755000175000017500000000133514454347341011553 00000000000000#!/bin/sh # $LastChangedDate: 2011-05-23 14:51:20 +0200 (Mon, 23 May 2011) $ # This file is still not complete. # this should create configure.scan aclocal || { echo "no aclocal ?" ; exit 1 ; } #autoscan # we produce suitable config.h.in autoheader # we produce a configure script autoconf || { echo "no autoconf ?" ; exit 1 ; } # we produce a brand new Makefile automake --add-missing || { echo "no automake ?" ; exit 1 ; } # The automake required for autogen.sh'in this package is 1.10. # So users who want to build from the svn repository are required to use this version. # # Users building from the tarball shouldn't bother, of course, # because they get the configure script generated from the tarball maintainer. fim-0.6-rc2/NEWS0000644000175000017500000007437714503373217010265 00000000000000 FIM NEWS -- history of main user-visible changes in FIM. Version 0.6-rc2 * File dropping support in SDL2 mode and more responsive readline mode. Version 0.6-rc1 * Experimental support for SDL2. Version 0.6-rc0 A summary of major improvements: * Colour ASCII-Art output via libcaca, selected with -o ca * better mechanism to determine best output device * font magnification by integer factors, good for higher resolutions * runtime font selection * new options to commands "scale", "goto", "limit", "list", ... * 'limit' view to relevant image files based on properties (like in 'mutt') * pass key presses to be automated at startup with -k and -K options * pretty free from memory leaks * -X switch inhibits custom external converters * new powerful subcommand "list 'mark'" * new command-line switches (--sort..) to sort the initial files list * use mipmaps for faster scaling * open files from a files list with -L * load image description files with -D * background recursive scan and load of files with -B * search files at startup based on description with -/ and --// * new verbosity and debug options * better error handling when encountering corrupt files * fast in-place switch to high-res file via --load-shadow-directory * improvements in -o aa (Ascii Art output device with aalib) * more options for window size selection in -o sdl * Keys F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12 now usable with 'bind' In detail, in no particular order: * Experimental support for SDL2. * More responsive readline mode. * Switch --resolution 'fullscreen' appends 'W' if in SDL mode. * If a "matrix market" file is loaded, its rows, columns and nnz are image variables, too. * Introduce special 'early' form -C =var=val where variable var is assigned to unquoted and non-interpreted value val immediately. * Fix: --cd-and-readdir was not jumping back to first file. * Fix: --device option not ignored anymore. * Rename --no-etc-rc-file switch to --no-etc-fimrc-file . * fimgs: bunzip2, wget, and xz are now optional. * Bugfix: fimgs to properly remove temporary directory after loading downloaded files. * Misc small improvements in documentation text output and reporting (no cursor in post-search output line; misc messages). * Key 'Z' now assigned to 'sleep 1'. * Key 'Del' now assigned to 'list "remove"'. * Add -= as short form of the --no-auto-scale option. * Experimental: add command "crop", also activated after selecting the area by holding Shift and clicking with left mouse button (if running with -o sdl). * Add command "pan 'vsteps%' 'hsteps%'" and "'pan 'vsteps' 'hsteps'". * Keys F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12 are now usable with 'bind' with modes -o aa, -o ca, -o dumb. * Fix for -o sdl: when flipped or mirrored, it used to draw a smaller box by mistake. * Only filenames matching "^[/A-Za-z0-9_.][/A-Za-z0-9_.-]*$" can occur in a conversion command involving an external program. * --pread-cmd=command substitutes any occurrence of '{}' in command with the actual filename, executes the result and reads an image from its stdout. * -o fb=S will not tolerate running under screen. * Bugfix in --script-from-stdin now prevents possible crashes. * Removed configure options --enable-c++11 -- use CXXFLAGS instead. * Bugfix: 'autocmd_del' with no arguments would crash. * Bugfix: autocommand "PostHardcodedConfigLoading" now triggers even if --disable-fimrc . * Internals: considerably expanded 'make tests'. * Add command 'stderr', similar to 'stdout'. * This is the last FIM version supporting the C++03 standard. * Refresh configure and Makefile templates. * Build fixes for the MinGW environment. * man fim: improve manual contents (on ~/.fim_history, individual options, wording, etc.). * man fimrc: added a section with default aliases, * Where appropriate, 'make tests' uses 'timeout' to prevent possible hangs. * Switch -K aka --chars-press simulates input of characters at startup. * Fix: slideshow function (e.g. `fim --slideshow=5 media/`) will now cycle forever, unless --once/-1 option specified (as in fbi). * Fix: after 'quit' no command shall execute anymore (unless in -F). * With SDL one can specify window size as percentage of allowed size (-o sdl=w55%), or draw a help grid map (-o sdl=h). * With SDL (-o sdl), center window by default. * Fix: now pressing keys "1n1n" will not execute 'n' 11 times, but twice. * configure --enable-debug is a developer option now. * libcaca (-o ca) mode is now complete and is the default ASCII Art mode. * Slideshow function (e.g `fim --slideshow=5 *.jpg`) now more responsive. * Arrow keys are now working in aalib (-o aa). * Bugfix with aalib (-o aa): don't truncate long lines. * Avoid memory leak in language parser. * Avoid console buffer memory corruption. * Eliminate a memory leak from file loading code. * Eliminate memory leaks in PNG, JPG, TIFF, EXIF, and font decoding code. * Fix possibly broken `make -j` in rebuilding fimgs.man and fimrc.man. * Correct configure script check for regcomp() -- could lead to false negatives. * Don't break build on missing 'gs'. * Experimental: use --load-shadow-directory to add a "shadow directory". Then 'scale "shadow"' (bound to key '"') will substitute the current displayed image with that of the first same-named file located under a shadow directory. * When loading a directory, regular expression from default "_pushdir_re" variable now matches filenames with .webp extension. * Fix: `fim -c '/'` was broken. * Add " INTEGER , INTEGER IDENTIFIER arguments" syntax to repeat a command on each file in the interval and substitute its name to '{}' in the arguments to an iterated command IDENTIFIER. * If a key is bound to e.g. 'goto "+1F"', keep pressing it to accelerate (not if e.g. "+1f"). * Internal fix: piping from external commands was using 0 instead of 'WNOHANG', leading to hanging. * Internal fix: error handling was missing. * fimgs now to handle tar.xz archives. * Reload automatically image on file change. * Command 'list' 'sort_var' 'var' to sort file list according to values of 'i:var'. * Command 'list' 'sort_comment' to sort file list according to 'i:_comment' value. * Add a --verbose-font-load switch to set '_fbfont_verbosity=1'. * Variable '_fbfont_verbosity' sets verbose font loading. * Fix: short options -b, -h, -R were not getting optional argument (e.g. -b1). * Key combination C-r now assigned to "reload ''". * Fix: symbol from fbi sources clashed with gcc-6 onwards, breaking compilation. * Key combination C-w assigned to setting auto-scaling to width. * Smoother scroll of large images. * If SSH_TTY set and no output device specified, give precedence to aalib, then libcaca. * Bugfix: in --as-text will avoid repeated reload of file. * Hardcoded font (if configured in) will serve as fallback font. * Add a --no-pipe-load / -X switch to _no_external_loader_programs=1; * Description variables beginning with '_' will not go into i: . * List variables in all i:* read from description file with "list 'vars|variables'". * Expansion of @variables and @# comments from description files. * The menu key in SDL mode shows a temporary mouse click actions menu. * Bugfix: description file reading was crashing due to wrong check. * Caption text of "_caption_over_image" takes at most half of the screen. * If _caption_over_image=3, image is possibly drawn below the caption. * The 'v' and 'S' keys now cause a redraw. * The description line can be of any length. * New configure option, defaulting to: --enable-paths-in-man; it generates man pages with configure specified paths (e.g. sysconfdir, docdir). * Fix: -s switch was broken. * Add a semicolon (;) to -C arguments if not present already. * Framebuffer console switch off while loading: configure with the --enable-framebuffer-switch-while-loading switch to have it back. * Fix: configure would fail on --disable-aa and absent aalib. * Now configure has --enable-seek-magic by default. And is more verbose. * Command 'help' also shows key bindings, and give multiple answers if matching. * For each word following switch --help, an individual help message is shown. * Command 'goto' accepts multiple arguments; evaluating them until the first one triggering a jump. * Command goto {'-/'|'+/'}[C] jumps to a file based on character C (default 'S'). If C is 's', to prev/next file with same directory name. If C is 'd', to prev/next file with directory name down the same hierarchy. If C is 'u', to prev/next file with directory name up the same hierarchy. If C is 'b', to prev/next file with same basename. If C is as above but uppercase, to the prev/next file not matching the criteria. * Accordingly, aliases 'next_file_dir_same', 'next_file_dir_other', 'next_file_dir_up', 'next_file_dir_down', 'next_file_same_basename', 'prev_file_dir_same', 'prev_file_dir_other', 'prev_file_dir_up' 'prev_file_dir_down' 'prev_file_same_basename'. * Fix: 'recording' command was not functioning properly. * Fix: don't pop back last command if "recording 'stop'" executed outside of recording mode. * Fix: won't clear recorded list if calling recording 'start' multiple times. * Specifying more than once any of -p -i - causes a warning. * New switch --verbose-interpreter to execute interpreter verbosely by setting adequately _debug_commands='ackC'. * Strings specified within single quotes have single quotes escaped, just as double quotes. So that e.g.: '\'hello\'' equals "'hello'" and "\"hello\"" equals '"hello"'. * Variable '_debug_commands' is now a string with several verbosity options. * Fix: misc fixes for --offset, e.g. avoiding probing for external loader programs. * Add --verbose-load option for verbose file loading. * -C '_seek_magic=..' probes whole range of specified signature when loading a file. * Fix in _seek_magic documentation. * Option --offset accepts numbers suffixed by one of K, M, and G for respectively kibi-, mebi-, and gibi- (2^10, 2^20 and 2^30) units. * Bugfix: --offset option was ignoring lower bytes-offset. * Fix: a check was missing in the PS decoder when reading from stdin. * Command 'pan' accepts '-' and '+' to jump to prev/next file if border is reached. * Command 'font' controls displayed font and scans font directories. * Keys '{' and '}' cycle through available consolefonts. * Variable _fbfont_magnify_factor scales text font at runtime. * Variable _fbfont_as_screen_fraction; if >0, font is scaled to exceed 1/_fbfont_as_screen_fraction of both width and height. If _fbfont_as_screen_fraction<0, font scaling is fixed. * Keys '[' and ']' bound to new aliases "font_reduce" and "font_magnify". * Key '|' bound to new alias "toggle_font_auto_scale". * Switch -r {width:height} / --resolution {width:height} behaves as expected in SDL mode. * Variable _downscale_huge_at_load, if 1 (default), downscale automatically huge images at load time. To avoid loading images exceeding too much screen size. * Variable i:_buffered_in_tmpfile stores temporary decoding image filename, if any. * Internally load SVG files by invoking inkscape --without-gui --export-png . A file beginning with "1; 1/16 if 1, no tolerance if <1. * Variable "_want_wm_mouse_ctrl" controls mouse click/movement behaviour in SDL mode. * Variable "_min_cached_images" is the minimum number of images to keep from eviction. * Commands scale '<' / scale '>' shrinks/magnifies the image using cached mipmaps. * By default, show mouse cursor in full screen SDL mode. * Autocommand "PostInteractiveCommand" does not trigger anymore after 'quit' command. * In case of a CBZ,CBR,PDF,PS,DVI file, the fimgs script now uses '--autotop --autowidth'. * The fimgs script now probes for unrar-nonfree/rar/unrar-free (in this order). * Customize overlay text via variable '_caption_over_image_fmt'. * Command syntax 'goto {+|-}identifier[+]' (new) jumps to next file having a different value of i:identifier, also empty if without trailing `+'. * Command "limit '-set_union'" merges current limited list with the new one. * Command "limit '-merge'" merges current limited list with the new one. * Command "desc 'reload'" loads once again description files specified at the command line with --load-image-descriptions-file. * FIM only checks for filename duplicates if a sorting option is specified. * Switch -P/--text-reading fixed. Seems to be broken in version 0.5. * Command "color": "color 'negate'" and "color 'desaturate'" introduced. * Commands 'negate' and 'desaturate' deleted. * Command "color CVS" (CVS among 'protanopia', 'deuteranopia', 'tritanopia', 'p', 'd', 't') simulates a color vision deficiency; adding 'daltonize' applies a tentative color correction; "color 'colorblind'" is short for "color 'deuteranopia'". * Command "color 'identity'": populate the image with 'RGB identity' pixels. * Introduce a "#!fim:/=dir" special description line to specify directory prepended to basename. * Introduce a "#!fim:\=dir" special description line to specify directory prepended to filepath. * Command limit '-list' lists existing variables identifiers as set via 'desc' * Command limit '-list' 'id' lists existing values for instances of variable 'id' as set via 'desc' * Command "limit '~i' MINIDX[-MAXIDX]", with MINIDX and MAXIDX numbers (possibly with K as x 1000 multiplier) restricts filenames list to the specified interval. * Command "limit '~d'", limits to files having exact current file's modify date +- one day. * Command "limit '~z'" limits to files having same file size as the current. * Command "limit '~z' MINSIZE[-MAXSIZE]", with MINSIZE and MAXSIZE numbers with possibly K (x 1024) or M (x 1024 1024) multipliers, limits according to file size. * Command "limit '~d' MINTIME[-MAXTIME]", with MINTIME and MAXTIME numbers, limits files list according to file modify date (expressed as seconds since the epoch, see 'man 2 time'). * Command "limit '~d' MINDATE[-MINDATE]", with MINDATE and MAXDATE dates as in DD/MM/YYYY, and after 1900. * Command "limit '-further' ..." makes 'limit' act on the current list, rather than on the full anew. * Command "limit" uses new criteria: If invoked with '~!' it restricts to files with unique basename. If with '~=', to files with duplicate basename; if with '~^', to the first of the files with duplicate basename; if with '~$', to the last of the files with duplicate basename. * Alias "unlimit" resets the limited list. * Add variable '_all_file_loaders': a space-separated list of hardcoded file loaders usable with '_file_loader'. * Switch -R/--recursive[=arg] has now an optional argument; overwrites (if set) or appends to (if beginning with + or |) the "_pushdir_re" variable (recursed filename extensions). * Introduce a "#!fim:+=" special description line to append to cached description. * Introduce a "#!fim:^=" special description line to prepend to cached description. * Introduce a "#!fim:!=" special description line to reset all variables of the cached namespace. * Command 'desc "save"' functionality to save descriptions file data from the currently browsable images list. * Command 'desc "-append" "save"' works in append mode. * Command 'desc "-all" "save"' saves also all descriptions file variables. * Command 'desc "-nooverw" "save"' does not force overwrite. * To ease reproducible builds: imposing LC_ALL=C to $(YACC) and $(SORT), vim2html.pl reads SOURCE_DATE_EPOCH * New switch --mark-from-image-descriptions-file: read file names from a description file and use them to mark current list files. * Introduced alphanumeric restriction in the descriptions shebang variables: must begin with underscore or alphabetic, continue with underscore or alphanumeric. * Keys '(' and ')' are now bound respectively to "goto '^p'" and "goto '$p'"; that is jump to first or last page. * Available symkeys are now documented in a section of man fimrc. * Switch -k --keysym-press to simulate press of keysym at startup. Keysym can be prefixed by a repetition count number. * New switch -/ as short form of of -c /. * New switch --// as short form of of -c / with _re_search_opts='f'. * Tehe space key (' ') is now assigned to 'scrollforward' (earlier was 's'). * Introduced context prepend/append shebang syntax "#!fim:^=" and "#!fim:+=" in description files. * Switch --read-from-stdin-elds supports now the ASCII NUL terminator (via ''). * Switch -V (--version) prints to stdout (not anymore to stderr). * The -B switch is now shorthand for --background-recursive. * If compiled in pre-C++11 flags, -B / --background-recursive behaves as -R. * Switch -S is now short form of --image-descriptions-file-separator (not anymore for --sanity-check). * Switch -D is now short form of --load-image-descriptions-file (not anymore for --dump-default-fimrc). * Switch -L/--read-from-file: read an image list from file (similarly to the - switch). * Now caching of mipmaps is on by default; can be turned off with new variable '_cache_control'. * Variable "_push_pushes_dirs"; if it is 2, also push hidden files and directories; that is, ones whose names begin with a dot (.). * configure --with-font-magnifying-factor=FACTOR controls text magnification by an integer factor. If FACTOR is positive, this value is hardcoded and cannot be changed at runtime. If FACTOR is negative, -FACTOR is default, but can be changed at runtime. If FACTOR is 0 (default) a default of 1 applies, and can be changed at runtime. This option is meant to be used on configurations with high resolutions and small consolefonts. * configure --with-tmpfile specifies a new temporary directory. * configure tries to detect curses/ncurses. * Fix: mouse movement under SDL used to trigger unnecessary screen redraws. * Fix: the last used image is to be evicted from the cache as last, after possibly prefetched images. * Fix: in configure script, the regex_t check was unnecessarily broken. * Fix: ./configure --disable-pcx was not properly disabling PCX format support * With C++11 flags, --background-recursive loads images in the background recursively (experimental, unfinished). * Use variable "i:_file_load_time" to store the time taken to load the file and decode the image. * Use variable "_use_mipmaps=2" to compute the mipmaps faster, using every fourth source pixel. This can be a good solution for speeding up large photographs scaling. * Description files beginning with "#!fim:desc" (of whatever extension) can now be loaded as they were normal image files. * Add switch --reverse to reverse the file list. * Add switch --sort-mtime to sort file list according to modification time. * Add switch --sort-fsize to sort file list according to file size. * Command "list 'sort_mtime'" to sort file list according to modification time. * Command "list 'sort_fsize'" to sort file list according to file size. * Command "list 'mark' {args}" accepts now exactly what "limit {args}" does. * Command syntax 'list "markall"' introduced. * Command syntax 'list "dumpmarked"' and 'list "unmarkall"' introduced. * Command 'list "swap"' introduced. * New '_lastgotodirection' variable, with the last file goto direction. * Key 'Enter' now marks and goes forward or back according to variable '_lastgotodirection'. * Fix: the largest mipmap was not always being used. * Fix: -lfl linkage is not really necessary: removed it. * Fix: support for PPM files with 2 bytes per sample. * Fix: a few more checks when reading PCX files. * Fix: documented that switch --sanity-check terminates the program, rather than continuing. * Fix: when stdint.h is available use uint8_t, uint16_t, uint32_t instead of non-portable __u8, __u16, __u32 * Fix: compilation was broken without framebuffer (FIM_WITH_NO_FRAMEBUFFER) * Fix: cleaned up the internal keysyms initialization code. * Fix: removed obsolete documentation for the "window" command, now disabled. * Bugfix: improve GIF error handling. * Bugfix: on certain framebuffer configurations part of the screen was not being redrawn. * Bugfix: conversion from external program was vulnerable to failure due to a missing check. * Bugfix: avoiding data corruption when handling %k expando. * Bugfix: repeating "recording 'repeat_last'" (default '.' key) by prepending a number now works. * Fix: configure uses `sdl-config --static-lib`. Version 0.5 * -R / --recursive switch to turn on recursive push of command line specified directories * added --sort and --sort-basename to sort the images list * introduced mipmap mechanism (_use_mipmaps) for faster display/scaling of images * status bar customizable with _display_status_fmt and _info_fmt_str, which can be controlled by the use of special image variable specifiers ('expandos'): "%T" expando to get (and display) total memory used by the program "%C" expando to get (and display) file/memory usage by image cache "%M" expando to get (and display) memory used by the current (displayed) image "%c" expando to get (and display) centering information "%m" expando to get (and display) current image mipmap occupation information "%k" expando to get (and display) current image i:_comment value "%?PRE?VAR?POST?" expando to get (and display) "PRE".i:VAR."POST" ... * search (and jump) on image descriptions via 'goto' and key '/' * when repeating search with 'repeat_last', will use last direction * '?' key is now assigned to backward search (goto '-//') * default 'C-p' key is now assigned to repeat last backward search (goto '-//') * image cache will remember alignment within viewport * jump back and forth from the last viewed image with the ' (single quote aka apostrophe) key and the _lastfileindex variable * added --load-image-descriptions-file (equivalent to 'desc' 'load') to populate the i:_comment values of each loaded image file and set _caption_over_image=2 (with it added also --image-descriptions-file-separator) * added the 'desc "load"' command to load a textual files comments description file * introduced a 'limit' command, with comment, file name, or marked file criteria * the '`' key is bound to toggle limit'ing to the marked files list * introduced 'list "mark"' and 'list "unmark"' subcommands styled as 'limit' * load i:_comment and i:var from description file, with forms: "filename comment" (to i:_comment), "#!fim:var=value" (to set i:var=value on all all the files following) "#!fim:var=" (to unset i:var=value on all all the files following) "filename #!fim:=" (to i:_comment from the value read last) "filename #!fim:+comment" (similar, but will append the new comment) "filename #!fim:^comment" (similar, but will prepend the new comment) "filename #!fim:s/f/t" (similar, but replace string f with string t) * EXIF tags will be read with libexif and become i:EXIF_-prefixed variables * if _want_exif_orientation is set, images will be reoriented according to EXIF metadata (i:__exif_orientation, i:__exif_mirrored, i:__exif_flipped). * the 'help' command will search also in fim command options * will optionally use C++11 constructs with ./configure --enable-cxx11 (no user level impact) * scaling image code faster (thanks to __restrict__ pointers) * customizable SDL window caption line with _want_wm_caption_status * BMP format support is now optional * PCX format support (optional) * changed meaning of variable _ignorecase: now it affects autocommands * introduced variable _re_search_opts affecting regexp-based search * default key 'r' is bound to 'rotate90', key 'R' to 'rotate270' * can be invoked without stdin; e.g. from an X menu * added "display 'resize'" to resize the SDL window, optionally to the image size * default SDL mode is windowed now * by default, the 'C-w' key will resize the SDL window to the original image size * by default, the 'W' key will resize the SDL window to the image size, and added an --autowindow switch to adapt window size to picture size * the 'help' command will search in help items if argument starts with / * special variable i:* expanding to all the variable name/value pairs of the current image * opening image files in archives (e.g. CBZ,CBR,RAR,TAR,TGZ,TBZ,7Z,ISO,...) with libarchive (experimental) * JPEG-2000 file support via JasPer (experimental) * added a ':- INTEGER' syntax, so one can specify the file in the list counting from the end * added an _archive_files variable to specify which file name types specify archives * added a 'list "pushdirr"' command, working like "pushdir" but recursively * the _fbfont variable will contain the current console font file string * mirror/flip are now being applied with respect to the viewport borders * stat() checking of files on load can be disabled with _push_checks * added --no-stat-push to set _push_checks=0 before initialization * added the _caption_over_image variable (which is 0 unless --load-image-descriptions-file) * 'Pause' and 'Menu' keys are now available in SDL (-o sdl) mode * added 'list' 'marked' to show the list of marked files * key 'Del' bound to pop (delete) the current image from the list * i:_file loader will store the used loader string * switch --offset accepts a range now (using the new _open_offset_retry variable) * if an image has been opened with an offset, i:_open_offset will be set accordingly * variable i:pagecount is now replaced by i:pages * put aside (disabled) the v: b: and w: namespaces until they make more sense * panning on mouse movement in SDL mode * `make fim' goal has been deleted * changed librsb library detection: now it's e.g.: LIBS="`librsb-config --ldflags --extra_libs` " CXXFLAGS="`librsb-config --cflags` "\ ./configure --enable-matrices-rendering * bugfix: in some situations fim -o fb was not clearing the screen before drawing the image * bugfix in the "list 'remove'" internals * --binary=1/--binary=24 will not pad tiny renderings to _preferred_rendering_width pixels * fix: corrected the quiet mode (-q) to be quieter * fix: no zlib.h build time dependency (this will be reintroduced in the future) Version 0.4 * changed --random semantics and introduced --random-no-seed switch * customizable status bar file info string * introduced --as-text to render printable bytes as text * key r is bound to 'rotate90', key R to 'rotate270' * bug fixes for the g: namespace, SDL/X mode, "list 'pop'" command, the --offset option, 'ascale' and rotation, documentation. Version 0.4-beta * interface to the GraphicsMagic library (more graphics formats supported) * introduced bitwise AND and OR operators * support for rendering "matrix market" numerical matrix files (with librsb) * X mode not anymore default in aalib, available at option * libjpeg usage fixes * libpng usage fixes (support for PNG_LIBPNG_VER>=10209) * documentation improvements (e.g.: fim man page is auto-generated) * "imlib2" X-based output device support * "sdl" output device improvements (fullscreen/mouse/windowed options, I/O, ..) * more default consolefont options (e.g.: hardcoded consolefonts support) * configure option to disable the fim history file * improvements to scale, goto, other commands * improved directories reading * introduced --no-commandline, --no-internal-config switches * aggregated some commands for clarity * output console can be disabled at configure time * important fbdev bug fixes * autocompletion of variable identifiers Version 0.3 * minor strchr compilation problem on some systems * better consolefonts support * much better SDL support (different color modes) * 'negate' feature * -S, or 'sanity-check' switch [changed meaning in v0.6] Version 0.3-beta-prerelease * auto-generated documentation: more consistency * grammar specification, in man fimrc * internal commands,variables,autocommands reference man page, in man fimrc * better internal help mechanisms * more control (resolution change,windowed mode) in experimental sdl mode * new commands (pread,reverse,shuffle,...) * (temporarily) disabled internal windows splitting * pushing files from a directory * several minor and major bugfixes Version 0.3-beta * full support for AAlib (Ascii Art rendering) (-o aa) * experimental support for SDLlib (Simple Directmedia Layer) (-o sdl) (X!) * experimental PDF, PS, DJVU file support * history file support (~/.fim_history) * seamless caching and prefetching integration * viewing of any type files as bitmaps (unset bits black, set bits white) * viewing of any type files as pixmaps (as RGB triples) * framebuffer driver now can be disabled at compile time * colors inversion: saves a significant fraction of power when viewing documents Version 0.3-alpha * experimental support for AAlib (Ascii Art rendering) (-t) * reading image files (-i) and scripts (-p) from stdin * runs on the powerpc architecure * rewritten from scratch the debug console, now buffered and with scrolling * achieved speedup in magnifying pictures * achieved speedup in displaying dithered images * smarter quoting rules (looser quote checking) when "push"ing files * dumping to file execution logs as executable scripts (-W/--write-scriptout) * implemented regular expressions matching operator (=~) * new default key bindings for split windows control * could be compiled with no readline library (--disable-readline) Version 0.2 * internal windowing (with splitting, resizing, swapping) support * .xcf, .fig, .dia, .svg files now viewable via wrapper calls * introduced interactive command iteration ( in the [n] form ) * fim will try to run under screen and over ssh now * custom framebuffer device, fonts and gamma are supported * enriched compile-time options via the ./configure script * vim-styled variable scoping g:,i:,v:,w: (local variables) * eradicated some bugs * introduced new variables, commands Version 0.2-alpha * first windowing functionalities * bugs and subtle flaws handling * introduced new variables, commands Version 0.1 * regular expressions for filtering the viewed image list * vim-like autocommands * command line autocompletion * command line history * completely customizable key bindings * external/internal scriptability fim-0.6-rc2/var/0000755000175000017500000000000014503655326010420 500000000000000fim-0.6-rc2/var/fonts/0000755000175000017500000000000014503655326011551 500000000000000fim-0.6-rc2/var/fonts/Lat15-Terminus16.psf0000644000175000017500000001265414454347341015054 000000000000006ªUªUªUªUªUªUªUªU~™¥¡¥™~~¹¥¹©¥~ûUUQ$ x "~T8 @þ@ þ8Tˆ"ˆ"ˆ"ˆ"ˆ"ˆ"ˆ"ˆ"<<<<<<$$8|þ|8  |~BBBBBB >ð||ðð|’’|D8DDD8D‚‚D(||8D@0HDD$D8$$88  @ ~~@  @BBB>@@@|BBBBB|BBBBB>BBBBB><@@@|BBBBBB08 DD8@@@BDHpHDB08ü’’’’’’|BBBBBBBBBBB>^`@@@@@>@@<||BBBBBB>BBB$$‚‚’’’’|BB$$BBBBBBBB><~ @~   00b’Œ$<88BBBBBFz@@@~’’’’r 08DDD8|H$$H ` "$"FŠ ` "$ L’à`ä"FŠ BBB<BBB><>BBB>$<>BBB>2L<>BBB>$$<>BBB>$<>BBB>lržlBBBBBB>$BBBBBB>$$BBBBBB>BBBBBB><@@@|BBBBB|@@@$$BBBBBB><$BBBBB><8808~œ~|’’ž|@@<| $@@<|DD‚‚DD($~ @@~$~ @~ |`$2Lþ$$$$$H|||<<’’H¨P @Tª”   "@ø@ø@"~~@2L2L–––Ððð°––8$$$$ðˆˆˆô„Ž„„‚þpp$$$$$$$$$~~~ @@~@@ |Š’’¢|@€’%ÿÿ©ÿÿ®ÿÿ"!ÿÿ£ÿÿ“!¼%ÿÿ!À%ÿÿ’!¶%ÿÿ‘!²%ÿÿ‘%ÿÿ %®%ÿÿ°ÿÿf&ýÿÿÿe"ÿÿÀÿÿd"ÿÿ%%%%ÿÿ±ÿÿ$%+%*%)%(%'%&%%%ÿÿ%%%%ÿÿ%%%}%{%w%y%u%ÿÿ¡ÿÿ¢ÿÿ¤ÿÿ¥ÿÿ¦ÿÿ§ÿÿ¨ÿÿªÿÿ«j"ÿÿ¬ÿÿ¯Éÿÿ           ÿÿ!ÿÿ"ÿÿ#ÿÿ$ÿÿ%•"ÿÿ&ÿÿ'ÿÿ(ÿÿ)ÿÿ*›"ÿÿ+ÿÿ,ÿÿ-  "­  –"ÿÿ.™"ÿÿ/˜"ÿÿ0ê$ÿÿ1`$ÿÿ2a$ÿÿ3b$ÿÿ4c$ÿÿ5d$ÿÿ6e$ÿÿ7f$ÿÿ8g$ÿÿ9h$ÿÿ:ÿÿ;ÿÿ<ÿÿ=œ"ÿÿ>ÿÿ?ÿÿ@ÿÿA‘¶$ÿÿB’·$ÿÿC!¸$ÿÿD¹$ÿÿE•º$ÿÿF»$ÿÿG¼$ÿÿH—½$ÿÿI™¾$ÿÿJ¿$ÿÿKš*!À$ÿÿLÁ$ÿÿMœÂ$ÿÿNÃ$ÿÿOŸÄ$ÿÿP ¡Å$ÿÿQÆ$ÿÿRÇ$ÿÿSÈ$ÿÿT"¤É$ÿÿUÊ$ÿÿVË$ÿÿWÌ$ÿÿX%§Í$ÿÿY®Î$ÿÿZ–Ï$ÿÿ[ÿÿ\ÿÿ]ÿÿ^ÿÿ_ÿÿ`ÿÿa0Ð$ÿÿbÑ$ÿÿcAÒ$ÿÿdÓ$ÿÿe5Ô$ÿÿfÕ$ÿÿgÖ$ÿÿh×$ÿÿiVØ$ÿÿjXÙ$ÿÿkÚ$ÿÿlÛ$ÿÿmÜ$ÿÿnÝ$ÿÿo>Þ$ÿÿp@ß$ÿÿqà$ÿÿrá$ÿÿUsâ$ÿÿtã$ÿÿuä$ÿÿvå$ÿÿwæ$ÿÿxEç$ÿÿyCè$ÿÿzé$ÿÿ{ÿÿ|ÿÿ}ÿÿ~ÿÿ²ÿÿ³ÿÿ´ÿÿµ¼ÿÿ¶ÿÿ·ÿÿ¸ÿÿ¹ÿÿºÿÿ»k"ÿÿ¼ÿÿ½ÿÿ¾ÿÿ¿ÿÿÀÿÿÁÿÿÂÿÿÃÿÿÄÿÿÅ+!ÿÿÆÿÿÇÿÿÈÿÿÉÿÿÊÿÿËÿÿÌÿÿÍÿÿÎÿÿÏÿÿÐÿÿÑÿÿÒÿÿÓÿÿÔÿÿÕÿÿÖÿÿ×ÿÿØÿÿÙÿÿÚÿÿÛÿÿÜÿÿÝÿÿÞÿÿßÿÿàÿÿáÿÿâÿÿãÿÿäÿÿåÿÿæÿÿçÿÿèÿÿéÿÿêÿÿëQÿÿìÿÿíÿÿîÿÿïWÿÿðÿÿñÿÿòÿÿ%%~%|%z%v%x%t%ÿÿl%ÿÿ<%K%J%I%H%G%F%E%D%C%B%A%@%?%>%=%ÿÿ%%%%ÿÿj%ÿÿˆ%ÿÿ,%3%2%1%0%/%.%-%ÿÿ%#%"%!% %%%%ÿÿ4%;%:%9%8%7%6%5%ÿÿ %%% %ÿÿóÿÿôÿÿõÿÿöÿÿ÷ÿÿøÿÿùÿÿúÿÿûÿÿüÿÿýÿÿþÿÿÿÿÿÿÿÿÿ0ÿÿ1ÿÿRÿÿSÿÿ^ÿÿ_ÿÿ`ÿÿaÿÿxÿÿ}ÿÿ~ÿÿ’ÿÿÆÿÿÜÿÿ  ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ! ÿÿ" Ï%ÿÿ& ÿÿ0 ÿÿ9 ÿÿ: ÿÿ¬ ÿÿ`"ÿÿH"ÿÿ!ÿÿ ÿÿ§ ÿÿ® ÿÿ< ÿÿa"ÿÿ"ÿÿ"ÿÿfim-0.6-rc2/TODO0000644000175000017500000006752314454347341010255 00000000000000 $Id: TODO 1576 2018-01-28 22:33:17Z dezperado $ This file is a melange of ideas aimed towards further development. If you are interested into Fim internals, philosophy, or get some inspiration, you are welcome to give a look here. You can propose ideas to the fim-devel mailing list: fbi-improved-devel@nongnu.org Warning : This file is outdated; actual development notes are taken elsewhere. ------------------------------------------------------------------------------- Misc Current development directions 20141130 disabling convert or bmp can break test8 -- shall fix this, perhaps by ignoring the *.svg file there. 20141130 shall support a dual configure style: for each $LIBRARY, $FIM_LIBRARY_LIBS/$FIM_LIBRARY_CXXFLAGS and LIBS/CXXFLAGS. 20141130 rename configure options w.r.t. program options; e.g. --raw-bits-rendering to -o bit1/ -o bit24 20141130 configure output shall fit in one screen 20141129 the configure is not well made w.r.t. exif, jasper, ... 20141129 setGlobalVariable -> setGV 20141129 setGlobalVariable("i:",FIM_VID_WANT_AUTOCENTER,1); 20141123 clean up Image::getInfo 20141122 document/expand the FIM_WANT_EXPERIMENTAL_BASENAME functionality. 20140830 need a precise control of scaling rules and viewports cache, as well to extend the viewport cache to scaled images 20131107 fix --disable-scripting case ! 20131107 this is spurious: fim::string execute(const std::vector &args) 20131107 getIntVariable(varname) -> getIntVariable(varname, domain) 20131010 text/ascii/bits ascii renderer as funny fallback renderers 20131010 shall configure default tmpdir to /dev/shmem/something 20131009 may interface to http://www.feep.net/libtar/ 20130902 add a simple menu e.g.: using Motif (http://www.opengroup.org/desktop/motif.html), or buttons; e.g.: using X: http://www.x.org/releases/X11R7.7/doc/libX11/libX11/libX11.html#XEvent 20130829 interface to a library for gestures, someday. 20130824 need a "verbose pressed keys" mode, to help when guessing key bindings. 20130725 shall add autodetection of file format to "fim -" 20130702 "nextindir" function 20130702 http://dvdhrm.wordpress.com/2012/12/10/kmscon-introduction/ 20130620 need a minimal ppm file for testing 20130523 fix the bug when loading say, a a/1.fake and getting the files list shortened by two instead of one. 20130505 glob() on non existent files 20130412 may use a library like http://www.littlecms.com/ 20120811 need proper jpeg error handling 20120805 feeding a .png named PS file can lead to segfault. why ? 20120804 should create a general 'filter' autocmd trigger 20120804 negate and desaturate should be either applied instantly or accumulated in queue as transformations 20120718 " - multiple internal windows with indipendent images displayed at once" is discontinued! 20120705 some day would be nice to use dnotify 20120407 to clone a whole fim instance in a new process 20120130 to open svg files "natively" 20120129 for scalings that are multiples of an integer, may write a specific code 20120108 use zzuf; e.g.: for ((seed=0;seed<4;++seed));do zzuf -I jpg -s $seed src/fim media/ -c quit ; done 20111202 seem like an empty eps file crashes fim 20111122 fim inverts the colours of eps files 20111112 font resources: psf tools: http://www.seasip.info/Unix/PSF sigma consolefont: http://homepage.ntlworld.com/zarniwhoop/consolefonts/sigma.html an old kbd HOWTO http://www.win.tue.nl/~aeb/linux/kbd/font-formats-1.html psf format specs: http://tph16.tuwien.ac.at/cgi-bin/dwww/usr/share/doc/console-tools/file-formats/psf an ancient article about linux 2.4 font handling: http://linuxgazette.net/issue91/loozzr.html a bibliography (loosely related to psf): http://fontforge.sourceforge.net/bibliography.html 20111111 may use libgunzip / gzip decoding library ? 20111107 what about uploading nightly versions to savannah ? shall upload fim to savannah ! 20111025 seems like putting an invalid entry in the fonts list breaks list scanning 20111016 in the cookbook: how to 'catch' images in a directory full of oddly named files ? 20111008 decouple strings location from executable (e.g.: allow for a memory-mapped help/strings file) 20111005 imlib2 shall be suggested among devices on device fail. on hlst3, 'w' rendering bug. screen-patch should be optional at runtime when selecting the fbdev device 20111005 enable verbose keys specific to a device 20111003 http://tronche.com/gui/x/xlib/input/keyboard-encoding.html#KeySym 20110930 hand-based panning in fim; see feh 20110930 fim+sdl with an extra monitor aside fails. but mplayer seems to work, in this case. why ? 20110929 shall give a recipe and render possible to view a 100%-scaled image with zero scaling. 20110927 fix the bug opening the gif icon in media/ through graphicsmagick; manifests on hlst3 20110926 every bit of fim functioning shall be documented 20110926 fim manual sections in hardcoded strings shall be systematically coherent 20110926 shall be able to open movie files and displaying them (not cacheably), frame by frame 20110926 shall handle timeout handling when reading from a pipe 20110922 plugins shall be able to return variables 20110921 need mipmap scaled versions of images; plugins as the opencv one may operate on a selected mipmap, and then incrementally go up 20110913 shall use AC_ARG_VAR in configure.ac, so ./configure --help displays the 'precious' variables 20110909 tty control stuff (e.g.:saved_attributes_) shall be compile time optional 20110907 vedi liburiparser 20110904 buffering stdin/whatever shall be tmpname/fd backed 20110904 shall introduce more verbosity levels 20110904 see http://barre.nom.fr/medical/samples/ for sample DICOM files 20110902 'cd' should (may?) have vim's semantics 20110902 every command should be profilable: how ? 20110902 need fim-recipes (1) to collect misc wisdom 20110901 should provide an easy and benchmarkable method (variable based) to load a big list of files (thousands) with maximum speed (that is, without checking the signatures) 20110831 insert macros here and there for random or controlled error injection 20110831 whenever possible, error strings shall be printed out escaped; if not possible, this should be reported. 20110831 program return codes should reflect failure reason (e.g.: generic unspecified, input, internal, device, memory exhaustion, etc) 20110830 should provide some statistics/microbenchmarks; e.g.: pixels/s in resize, or bytes/s in disk I/O, etc. 20110830 write an 'interruptible' interface for heavier functions 20110830 very big files should be allowed to be read with no big copy 20110830 smaller files should be allowed to be read with copy (so, a single from-disk copy) 20110829 I am not sure whether --cd-and-readdir works; shall write an accurate test for this 20110824 need statistics on memory usage, from within fim. 20110824 need help [ "grep" | "find" ] 20110823 need to interface to zip.h and libzip -- and define a 'buffered', or 'virtual' files abstraction 20110917 should build a separate fim-main program, in order to generate a valid man help when the user manual will not be online (e.g.: in a minimalistically configured fim, with all inner docs cut out) 20110820 should have a way to disable terminal control flow (thus allowing C-s, C-q) 20110817 need macros to check for allowed width/height/bpp/... values 20110816 fim.h should be an #include-only container ! 20110816 repeat should become a standard argument of commands 20110801 is there a way to make fim load . if no file is specified ? 20110801 a pensarci bene, bottoni in sdl mode non sono poi cosi' impossibili 20110724 program 'fimtutor' as 'fim --tutorial' 20110724 Ctrl-C shall prompt for quitting (or optionally, quit), interrupting any interruptible task 20110724 allow plugins which can only load metainfo (user variables) from under-loading files (e.g.: plugins using specialized libraries) 20110713 semi-colons terminating commands can be misleading 20110713 parse errors should be verbose 20110713 dez@nino:~ $ fim -c 'variables;stdout _last_system_output;quit' 20110711 autocompletion of varname = would be both cool and useful 20110711 shall give the user chance to specify the position of an autocommand (e.g.: -1, +1, etc) within the current autocommands list 20110711 shall give the user chance to push dirs contents sorted 20110709 need to write to fim-users mentioning the ChangeLog and the solved bugs 20110709 grep .. | sed .. | fim_h_autocmds.h 20110709 grep .. | sed .. | fim_h_error_codes.h 20110709 grep .. | sed .. | fim_h_variables.h 20110711 may use ESC as a readline-exiting key 20110702 bind '\\' 'scale "100%"'; # is not accepted; this is bad 20110701 shall establish a policy in using #error 20110701 an easy way for window resize on 'next', in sdl mode 20110629 use CHAR_BIT in src/FbiStuffBit1.cpp 20110624 vedi se e' possibile 'goto last' e se PostNext e' ancora li da qualche parte 20110623 2. does not work 20110623 one may add :{+number} 20110623 missing :+// 20110622 test7 was modified to work after some horrible page/cache hacks. consider rewriting the test 20110622 the cache/goto code now is a complete mess (page-wise next interacts with cache) 20110622 shall fix the FIM_HORRIBLE_CACHE_INVALIDATING_HACK 20110620 the lock/unlock usage style in the SDL case may not be correct in many situations, leading to system lock errors 20110620 sdl is still flawed without an interactive shell underneath; libreadline used in non-callback mode uses the terminal, and this is bad (verify this by running from within nautilus scripts) 20110620 need a user friendly, self-uninstalling warning message on empty files list, on startup 20110620 tab based files autocompletion has problems (may show only partial results) 20110620 init feature-check routine with some regexp/regsubst functionality testing 20110621 shall expose a regexp substition command 20110619 need an option for non-name-based, but loader-based directory scanning ------------------------------------------------------------------------------- Documentation features/fixes: 20110129 incongruences in FIM.TXT: the system command is declared to be non active. this is wrong. 20090512 TODO : implement a regexp-based search, to give the user hints. (20090512) (like vim's helpgrep, helpfind) 20090418 fimtutor ------------------------------------------------------------------------------- Major language clarity features/fixes: 20110620 many commands shall be documented conditionally 20110517 may consider distinguishing "options" from "variables", as vim does 20110507 need a special mention for special variables (and their namespaces), in the documentation 20070417 It has come the time to decide the future developments of Fim. A lot of doubts arose. Here they are: - integration of the command line completion with the lexer/parser, to gain consistency - decisions about the nature of the language: - should the variables be accessed like Bash,Perl, or C? - should strings exist? - should arrays exist ? - should types exist ? - should boolean options exist (like in Vim's paste/nopaste) ? - should multi (quad/..) options exist (like in Mutt) ? - could it be nice to attach options set to an image/browser (e.g.: autowidth in only a window in a multiwindow scenario )? - integration with external libraries/scripts/etc.. ? These issues need reflection and study of the practical and theoretical advantages/possibilities/limitations of the alternatives. Meanwhile, the current development effort will be focused on enhancing the existing code, possibly not adding features but enhancing the code structure and converting the odd Fbi code in elegant, or possibly more optimized, (especially the hacked, critical parts concerning mirroring and flipping! ) Fim code. 20070903 these features are currently going to be worked in the near future: - arbitrary long key sequence bindings (mutt-like) - shortcuts algebra for commands - parameter passing to commands - variables scoped inside viewport (v:), window (w:), image (i: or l:), global (g:), script (s:) - (to study) lookup tables to string to integer token conversion of variable names (to gain speedup and increase variables impact) - (to study) active variables - variables triggering actions - vim like 'set', 'let', 'unlet' commands.. ------------------------------------------------------------------------------- Minor language clarity features/fixes: 20110615 scale_increment & co -> in the "default aliases" section 20110615 set_commandline_mode -> cmdline on ; set_interactive_mode -> cmdline off ; clear -> console [clear|info] 20110615 color [negate|gray] 20110615 redisplay = display 'force' ; reload = load 'force' 20110615 info [size|width|...] 20110613 need a single variable for flip,mirror, and eventually rotation (e.g.:fmr90) 20110613 shall reintroduce many composite commands tokens (e.g.: "pan 'up'") 20110612 scrolldown,scrollforward -> [pan|scroll] forward|read 20110612 dump_key_codes -> dump key_codes|variables|commands|aliases 20110612 clear -> console clear 20110612 shall rename from _varname to v:varname, whenever this has sense. 20110610 shall unify the scaling-control variables 20110504 aa driver swaps pageup/pagedown ? 20071127 histall, histdell 20071006 implement mechanisms or policies for namespace inheritage on windows split ------------------------------------------------------------------------------- Major and tricky (time consuming) features: 20111003 need a function checking if all sym_keys in some device are populated. 20110604 may consider usage of ffmpeg's libswscale for image scaling 20110615 collate/permute args in aliases (for ensuring primitive recursive computability, with some other features) ? 20110530 in some contexts, using libsvga (see http://www.svgalib.org/jay/beginners_guide/beginners_guide.html) may be interesting 20110516 shall foresee a mechanism for `stacked decoding'of `container' files (e.g.: gz,tar,tar.gz,bz,...) 20110516 shall foresee support for dynamically lodaded modules, for a number of operations (e.g.: file decoding/loading using custom external programs or libraries); see also http://tldp.org/HOWTO/Program-Library-HOWTO/dl-libraries.html 20110506 shall see libicu http://userguide.icu-project.org/, for internationalization/unicode 20110127 consider making the program ready for GNU gettext: http://www.gnu.org/software/hello/manual/gettext/index.html#Top 20110117 could develop a "stack of windows" idea, for zooming or such stuff. 20110108 use static_cast, for it is not ambiguous with conversions 20090512 argument to aliases 20080127 think about a multi-monitor strategy for a single instance of Fim: note that currently it is possible to specify a framebuffer device (therefore a monitor) via -d (--device) ------------------------------------------------------------------------------- Minor but tricky (time consuming) features/issues: 20110618 cd dir ; push /regexp/ 20110617 may honour command line options parsing features of aalib 20110521 autocompletion shall be escaped (for opening filenames containing quoting chars) 20110612 using up and down keys in / mode seems to recall general history, not search history (even in old fim revisions)! 20110615 '3g'-like interactive command ? right now, it will repeat 3 times 'g', but we may internally switch the while to a special argument 20110530 need some "emergency" command and/or mechanism for freeing/reclaiming memory (e.g.:caches, buffers) 20110507 the generated man output shall print out examples which are also a correctness test 20110202 DICOM integration ? see libmdc2-dev / man medcon 20110503 it would be cool to allow bindings valid in consolemode 20080430 find a way to catch the console signal C-s in fim in a way to make C-s bindable 20080313 make each cpp file include exactly the header files used 20080216 add textureview mode 20091214 consider using libmagic 20090810 :|ocr - or : PostFileRead 20090513 _seek_magic : if set, this pattern will be searched before going to the next image or seek_next {pattern} ?, associando ad Image l'offset .. (a' la multipage) 20090318 minicheck to detect wrong permissions on fb file ?! 20081228 marked pictures should have at least some asterisk and the user should be able to unmark them. 20080903 introduce a variable for handling centering style : sticky, proportional, smart, ... (see Viewport) ------------------------------------------------------------------------------- Test & correctness oriented features: 20110620 use cpp instead of grep when autogenerating doc files 20110612 the parser should be strictly checked for leaks 20110612 need a runtime method for diverting stdout ? may ease debugging. 20110602 need a test for the goodness of the 'random' variable numbers. 20110516 invoking fim in sdl mode with very low resolutions/window sizes is crashy. this is bad. 20110515 shall preprocessor-conditionally catch std::exception's and cout'ing this info or activate some debug channel. 20110515 shall use clear() resize(0) instead of clear() alone (which does not resize arrays) 20110515 shall check against end() after each erase() operation on vectors 20110507 need a macro to avoid X == "" comparisons 20110129 all of the scripts/rc scripts should be tested for compliance 20110108 use google's cpplint for a cleaner code: http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py 20110108 apply the 'explicit' keywords to constructors 20101007 the use find_key_for_bound_cmd() should be avoided in status line update 20091220 consider distributing a font file or simply to embed a freely licensed one in the sources, with an eye on portability 20091116 write some miniprogram for debugging keyboard input. 20091004 pdf picture viewing is memory greedy - be it a leak ? 20090820 should add a quick sanity check flag ( e.g.: --sanity-check ) 20090711 should develop some quick benchmark to evaluate some drawing operations (e.g.: blanking, color fill, etc) 20090603 fix Adobe CS3 created jpg files opening 20090530 crop = gTrue; // fix this 20090419 serious exception handling for out of memory conditions for push_back's and stuff 20090412 fbi bugs: http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=fbi 20090404 could use dejagnu for interactive (keyboard interaction based) testing http://www.kegel.com/xgcc3/ng1.txt, although first tests with expect (http://expect.nist.gov/) showed it doesn't handle well input exchange with fim 20090318 static checkers ? stllint : aszt.inf.elte.hu/~gsd/s/cikkek/concepts/2006/GregorSchuppSPE05.pdf cppcheck : http://sourceforge.net/projects/cppcheck/ using astyle for code readability ? could use flawfinder 20090305 moritz suggests fimgs with : src/fim -c 'autoheight=0;autowidth=0;v:auto_scale_v=0;'\ 'autocmd "PostRedisplay" "" "g:oscale=scale;";'\ 'autocmd "PostReload" "" "scale g:oscale.\"%\";";' *pages* 20090223 http://www.cubewano.org/oink <- use this automated checker, as well as other tools, possibily at least for format string vulnerabilities 20090224 to test better, develop some simple string functions and f(){}, a=f(x,y) , f , f x y , in vim style if possible, regexp_search 20090212 fix problems deriving from missing binaries and stuff 20090110 write a test case with memory constraints (in a way to stress say, failing mallocs) 20090108 write a test for corrupt image resilience (testing skip functionalities) 20081229 write a malloc and calloc wrapper, for the future 20081221 get rid of designated initializers (-pedantic) for ISO-C++ 20080509 very long strings in input may cause problems :) 20070812 examine fbi's weak points like http://freshmeat.net/articles/view/2203/ and fix them in Fim, if present. ------------------------------------------------------------------------------- Minor but not easy (time consuming) features: 20110516 shall enable building with SDL only, without using Unix syscalls. 20081227 http://www-masu.ist.osaka-u.ac.jp/~kakugawa/TeX-Guy/ for dvi support 20080908 pdflib would be a nice try to view pdf files from within fim, but multiple anonymous images should be supported ------------------------------------------------------------------------------- Optimization related ideas: 20090213 rewrite the core in a way to avoid convert_line: there is a potentially big performance gain 20080826 refine and optimize the rotation mechanism into a smarter, smoother, rendering based one 20090108 write some multi-mode optimizing blitting code generating m4 macro ------------------------------------------------------------------------------- Documentation related ideas: 20071230 UNIX domain sockets communication and multithreaded Fim 20071230 A decent Features section in the web site, from the top. 20071127 in-depth study of Vim documentation to uniform languages as much as possible 20071127 prepare a cookbook 20071127 inspiration : # vim +':help eval' ------------------------------------------------------------------------------- Language related ideas: 20080502 find a syntactical solution for ;; handling (extra semicolons) in the parser 20080223 fine grain the grammar using whitespaces too 20080216 add a third optional argument to bind : a description 20071127 possible namespaces : w:... window variables g:... global variables l:... local variables s:... script variables t:... tab variables v:... vim variables 20071127 functions, return status, stdout, stderr ? 20071025 introduce a namespace : 'e:', to get environment variables! 20070921 argument passing to aliases, bash like ?! or vim-like ? 20070920 as much as possible of Vim's language intuitive syntax ------------------------------------------------------------------------------- Debug related ideas: 20080414 follow -Weffc++ g++ flag guidelines, and -Werror 20080414 instead of malloc() to use calloc() and MALLOC_PERTURB, M_PERTURB on mallopt() 20080414 use mtrace() sometimes, MALLOC_TRACE=mout 20080414 use the dmalloc library (DMALLOC_OPTIONS), ElectricFence, 20080414 use valgrind 20080414 use mudflap library 20080414 compile with -D_GLIBCXX_DEBUG for having a bug-aware C++ standard library 20080414 experiment with libsegfault, 20080414 use lint from time to time 20080414 to add scripts to check for memory leaks and related bugs and build problems, in a way contributors could run cron scripts with svn export / build capabilities ------------------------------------------------------------------------------- Debian oriented stuff: 20090226 debianize: dpkg-buildpackage -rfakeroot -k0x0xE0E669C8EF1258B8 fakeroot debian/rules binary http://www.debian.org/doc/debian-policy/ http://www.debian.org/doc/maint-guide/ch-build.en.html http://pbuilder.alioth.debian.org/#IRCchannel http://www.ibm.com/developerworks/linux/library/l-debpkg.html http://www.debian-administration.org/articles/488 http://www.debian-administration.org/articles/337 debuild -us -uc http://people.debian.org/~codehelp/#sponsor http://dl.bytesex.org/releases/fbida/ida_0.21.dsc 20090223 dput, dupload, svn-autoreleasedeb, devscripts, debsecan ------------------------------------------------------------------------------- Optimization: 20070418 Got ~400% speedup on image display thanks to trivial changes in the drawing code : memset and memcpy instead of assignments, and a less trivial change by swapping RGB channels on loading time instead that on drawing time. The analysis was made with the gprof profiler, nicely. Maybe one day me or some contributor will read http://www.cvl.isy.liu.se/ScOut/Publications/PaperInfo/sf05.html or Example 4.14 of the Intel Architecture SW Manual Optimization explains how to and find some useful idea. use PSHUFLW,PSHUFW,PSHUFD to reverse contiguous words in registers. ------------------------------------------------------------------------------- This file is often outdated : Fim is far better than it seems here :) Please read the FIM.TXT file and the fimrc template to discover nice Fim features. OPEN BUGS: 20080323 65535 byte limit for a script size (stored in a fim::string) causes problems ( see scripts/tests/maxlenscript.fim for this ) 20070210 fix properly the file parser and max script filelength limit 20070129 control 4 crashes the prog with code 42 ... why ? :) MISSING SMALL FIXES: 20070303 fix rar and zip dependencies in Makefiles and such for fimgs.sh 20070303 see if while-nesting is a real danger combined with interruption handling 20070303 update the while construct documentation and fix the while command execution bugs 20070303 add an interface for setting exitBinding (now Enter!) 20070210 add an interface to modify key bindings and keycode bindings. 20070401 variables : $VARNAME or $(VARNAME) or VARNAME ? SCIENCE FICTION WISHED ADD-ONS: 20070307 someday: to integrate with a speech recognizer for command issuing 20070323 image understanding language - based pattern selection 20070401 ?= /semanticexp/ operator ADD: 20070401 find's -exec '{}' ';' -like predicate syntax 20070125 add pipe to other commands and exec and system (screenshot with fbgrab, for example) 20070128 add support for command renaming with checks... 20070130 proper signal handing for while cycle interruption.. 20070201 cwd,ls,pwd,stat,file... MISC IDEAS : 20070303 load cfg, save cfg flip=yes|no scale=i|i:i|:i|i:| fit =width|height|none|image|min|max center=t|b|l|r|tl|tr|bl|br|center orientation=90|... [cw|ccw] | flip mirror=yes|no persistent_options= word*|'*' transient_options = word* logfile=... debugfile=.. cwd=word negative=.. interpolator=.. options_style=stacked|trasient|permanent_save function : [n]%[r|l] +|-n[%] 20070401 better variable handling : boolean variables, conversion, 'no' prefixing, completion fitting the language rules.. DATES: 20061223 inception 20070202 stress testing (1000+d-) gave : CommandConsole.cpp:577: "pipe error" 20070204 make stricter the policy of recording (only aliases and/or lines.complete the time behaviour IDEAS 20070210 eliminate the fresh variable from the config? 20070216 eliminate image tearing by studying the framebuffer device repeat_last N ?! TIPS 20070302 use __FUNCTION__ : is not ANSI, but GCC fim-0.6-rc2/README.FIRST0000644000175000017500000000443614454347340011324 00000000000000-------------------------------------------------------------------------------- FIM Quick start ( the happy path ) : -------------------------------------------------------------------------------- in the fim directory, invoke: # make # make test # ls -l fim # chmod +x ./src/fimgs.sh # ./src/fimgs.sh media/*.pdf And in order to have a *working* configuration file, issue: # cp fimrc ~/.fimrc ( a correct configuration file --- if at all --- is essential to the proper working of FIM ) -------------------------------------------------------------------------------- BUILDING -------------------------------------------------------------------------------- If you get problems with compilation, please send me an email with the output of: # make report Problems may arise if fim fails finding its libraries.. -------------------------------------------------------------------------------- USAGE -------------------------------------------------------------------------------- There is no good documentation currently about the internal language, as i have not yet finished working on it. But to warm up with FIM, it is indicated to use the commands in the fimrc file. The ./fimrc file is the one fim loads at startup. It contains commands that bind keys to commands, aliases and such things. WARNING : DO NOT QUIT FIM WITH CONTROL-C ! IT CAN BREAK YOUR CONSOLE AND YOU WILL NEED TO DO DIRTY TRICKS TO RESTORE ITS GRAPHICS CAPABILITIES. USE q INSTEAD! WARNING : DO NOT QUIT FIM WITH CONTROL-D ! AS ABOVE WARNING : DO NOT USE THE BINDINGS CONTROL-C, CONTROL-D, CONTROL-S, as they are probably already signal-bound by the underlying terminal!! TIP : If the program hangs and gets terminated, leaving the console useless, DON'T PANIC! Don't try to switch console -- better type blindly 'fim *' (or its path) even if you don't see anything. This will restart it, and probably restore the console! Invocation : ./fim picture.jpg .. Default configuration bindings: q quit hjkl as in vim :) n/PageUp next p/PageDown prev C-a auto scale w auto width scale : enter command line mode Enter exit command line mode + magnify - reduce C-+ increase scaling factor C-- decrease scaling factor (C stays for Control) -------------------------------------------------------------------------------- fim-0.6-rc2/install-sh0000755000175000017500000003601014454352345011554 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. 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" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: fim-0.6-rc2/distros/0000755000175000017500000000000014503655327011320 500000000000000fim-0.6-rc2/distros/Makefile.in0000644000175000017500000004726214503403454013310 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ # $Id: Makefile.am 1586 2018-05-28 22:57:26Z dezperado $ # # The local Manifest building code is not enough # #Manifest: fim-0.1.ebuild Makefile # echo -en 'MD5 ' > Manifest # echo `md5sum fim-0.1.ebuild` `wc -c fim-0.1.ebuild | sed 's/ .*//g'` >> Manifest 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 = : 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 = depcomp = am__maybe_remake_depfiles = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPECT = @EXPECT@ FIM_CONFIGURATION = @FIM_CONFIGURATION@ FIM_CUSTOM_HARDCODED_CONSOLEFONT = @FIM_CUSTOM_HARDCODED_CONSOLEFONT@ FIM_DEFS = @FIM_DEFS@ FIM_LIBS = @FIM_LIBS@ FIM_LIB_OBJECTS = @FIM_LIB_OBJECTS@ FIM_SVN_REPOSITORY = @FIM_SVN_REPOSITORY@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ HAVE_AWK = @HAVE_AWK@ HAVE_BISON = @HAVE_BISON@ HAVE_CAT = @HAVE_CAT@ HAVE_CPP = @HAVE_CPP@ HAVE_ECHO = @HAVE_ECHO@ HAVE_FLEX = @HAVE_FLEX@ HAVE_GREP = @HAVE_GREP@ HAVE_MAN = @HAVE_MAN@ HAVE_RM = @HAVE_RM@ HAVE_SED = @HAVE_SED@ HAVE_SORT = @HAVE_SORT@ HAVE_TIMEOUT = @HAVE_TIMEOUT@ HAVE_VALGRIND = @HAVE_VALGRIND@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBAA_CONFIG = @LIBAA_CONFIG@ LIBCACA_CONFIG = @LIBCACA_CONFIG@ LIBDJVU = @LIBDJVU@ LIBGIF = @LIBGIF@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBPOPPLER = @LIBPOPPLER@ LIBPS = @LIBPS@ LIBS = @LIBS@ LIBSDL2_CONFIG = @LIBSDL2_CONFIG@ LIBSDL_CONFIG = @LIBSDL_CONFIG@ LIBTIFF = @LIBTIFF@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN = @MAN@ 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@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POPPLER_CFLAGS = @POPPLER_CFLAGS@ POPPLER_LIBS = @POPPLER_LIBS@ RANLIB = @RANLIB@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHELLCHECK = @SHELLCHECK@ SORT = @SORT@ STRIP = @STRIP@ SVN_REVISION = @SVN_REVISION@ SVN_REVISION_NUMBER = @SVN_REVISION_NUMBER@ TIMEOUT_LARGE = @TIMEOUT_LARGE@ TIMEOUT_SMALL = @TIMEOUT_SMALL@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ 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@ ac_ct_CXX = @ac_ct_CXX@ 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@ fim_cv_version = @fim_cv_version@ have_convert = @have_convert@ have_dia = @have_dia@ have_gs = @have_gs@ have_inkscape = @have_inkscape@ have_xcftopnm = @have_xcftopnm@ have_xfig = @have_xfig@ have_zcat = @have_zcat@ 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@ subdir = distros AUTOMAKE_OPTIONS = nostdinc no-dependencies SUBDIRS = PREFIX = gentoo/media-gfx/fim all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu distros/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu distros/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic 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 .PRECIOUS: Makefile # 20090217 : who cares, anyway ? # EXTRA_DIST=debian/control $(PREFIX)/fim-$(VERSION).ebuild $(PREFIX)/Manifest: $(PREFIX)/fim-$(VERSION).ebuild Makefile cd $(PREFIX)/ && ebuild fim-$(VERSION).ebuild digest .PHONY: all all: # well, this is of interest only of developer's interes #all: ebuild .PHONY: ebuild ebuild: $(PREFIX)/Manifest .PHONY: clean clean: rm -fR $(PREFIX)/Manifest $(PREFIX)/files # 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: fim-0.6-rc2/distros/Makefile.am0000644000175000017500000000140714454347340013274 00000000000000 # $Id: Makefile.am 1586 2018-05-28 22:57:26Z dezperado $ # # The local Manifest building code is not enough # #Manifest: fim-0.1.ebuild Makefile # echo -en 'MD5 ' > Manifest # echo `md5sum fim-0.1.ebuild` `wc -c fim-0.1.ebuild | sed 's/ .*//g'` >> Manifest subdir = distros AUTOMAKE_OPTIONS = nostdinc no-dependencies SUBDIRS = PREFIX=gentoo/media-gfx/fim # 20090217 : who cares, anyway ? # EXTRA_DIST=debian/control $(PREFIX)/fim-$(VERSION).ebuild $(PREFIX)/Manifest: $(PREFIX)/fim-$(VERSION).ebuild Makefile cd $(PREFIX)/ && ebuild fim-$(VERSION).ebuild digest .PHONY: all all: # well, this is of interest only of developer's interes #all: ebuild .PHONY: ebuild ebuild: $(PREFIX)/Manifest .PHONY: clean clean: rm -fR $(PREFIX)/Manifest $(PREFIX)/files fim-0.6-rc2/COPYING0000644000175000017500000004312214454347341010605 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. fim-0.6-rc2/doc/0000755000175000017500000000000014503655327010376 500000000000000fim-0.6-rc2/doc/FIM.html0000644000175000017500000016610114503371626011621 00000000000000 VIM: FIM

FIM


*FIM.TXT*   Tutorial & Miscellaneous documentation for Fim
 last updated $Date: 2023-04-15 00:54:24 +0200 (Sat, 15 Apr 2023) $

			Fim - tutorial & misc documentation

First of all, please view this text file in Vim with ':set syntax=help'.
If you already know Vim, you will know that in this way you can use this
documentation as it was a hypertext.
( or add "autocmd BufReadPost FIM.TXT set syntax=help" into your ~/.vimrc ! )
If you do not know Vim, you can find it at http://www.vim.org.
A  hypertextual version of this file (FIM.html) shall be also available
with your fim distribution.

Thank you for using this software; one can regard it as a 'hack',in
the sense it is an elaboration of the passionate work of multiple people.

Please note that this documentation is *not* complete, as Fim is still
evolving, and some changes as the exact language specifications are hard to
track and document. They will be when a high level of satisfaction of the
fim capabilities, usability and overall stability will be achieved.
Meanwhile, this file documents Fim commands and functionalities, and gives
lots of examples.
For a reference of Fim command line flags, see the man pages of Fim:

 man fim

For a reference of Fim internal commands, see

 man fimrc

For the documentation of the 'fimgs' script, see

 man fimgs

The man pages are rich with examples.



IMPORTANT NOTE:

This document will be eliminated/reconverted once all the relevant
information will be made available in the man pages, so it may be
outdated/obsolete.

The man pages are the authoritative documentation sources for fim.

Enjoy!


0. Introduction 						*intro*

      Fim Startup: to open an image, n framebuffer mode, place yourself in a
      Linux framebuffer console (that is, outside the X environment -- this
      is usually achieved by typing CTRL-ALT-F1 from within the X environment)
      and type:

	fim image.png

You can be sure of being in a Linux framebuffer console by issuing.

	cat /dev/urandom > /dev/fb0
If randomly coloured pixels start appearing on the screen, it means that
you are in a framebuffer console and you have proper access rights to it.

If you have problems here, see the *framebuffer* section.


      Fim Quickstart: to move the image around,
                    use the cursor keys, or "h" to go left,	       h   l
		    "j" to go down, "k" to go up, "l" to go right.	 j
   Get out of Fim:  Use ":q<Enter>" (press ':', then 'q', then 'enter').
                    Or just press q (or Esc, or whatever you wish, thanks to
		    the *key-bindings* capabilities.


Fim stands for Fbi IMproved.

Fbi is a |framebuffer| based image viewer by Gerd Hoffmann, and Fim is
primarily an interface rework applied roughly as a patch to it, and is an
idea and codework of Michele Martone.

The idea of making Fim came after long usage sessions of Vim and Fbi, and a
zest of science fiction inspiration.

The main purposes of Fim are to power up the features present in Fbi by adding
new ones, and achieve higher configurability and flexibility.

Ease of use and simplicity is a primary concern, too.
No programming language knowledge nor reading this manual is needed to use
FIM if you have already used Fbi once.

A basic tenet of configurability the freedom of managing and customize the
*key-bindings* to one's tastes.
Fim has a mechanism for the creation of a |configuration| file.
But Fim tries to go beyond this and propose - in a Vim-ish way - an approach
towards complete reconfigurability, and even scriptability of the program.
The inspiration for this comes from the use of the nicer software available
as free software, often characterized by extreme flexibility, configurability,
hackability. This concerns mainly text editors and mail user agents, but why
can't this apply to an image viewer, too ?


1. Index						*index*

Introduction to Fim					*ref* *reference*

0. Introduction			|intro|
1. Index			|index|
2. Fim on the Internet		|internet|
2.1. Contact information	|contact|
2.2. Help wanted		|help-wanted|
3. Installation, basic usage	|basics|
3.1. Customization		|customization|
3.2. Keyboard binding		|keyboard|
3.3. The fimgs script		|fimgs|
3.4. External scripting		|scripting|
3.5. System integration tips	|tips|
4. Command Line Mode		|cli|
5. Command Line Mode Basics	|cli-basics|
6. Commands Reference		|commands-reference|
6.1. Loading and browsing	|commands-browsing|
6.2. Scaling, flipping, rotating|commands-scaling|
6.3. Panning,moving		|commands-scroll|
6.4. Recording 			|commands-recording|
6.5. Console related commands	|commands-console|
6.6. System Interaction		|commands-system|
6.7. Variables			|variables|
6.8. Autocommands		|commands-autocommands|
7. Command Line,More		|cli-more|
7.1. Default configuration	|default-config|
8. Pattern Matching		|pattern-matching|
9. Dangers			|dangers|
10. Technicalia			|technicalia|
10.1. Syntax Reference		|syntax-ref|
10.2. Framebuffer mini how to	|framebuffer|
11. Credits			|credits|
12. FAQs			|faq|
13. License 			|license|


2. Fim on the Internet				*internet*

The official Fim page is hosted by the nonGNU project:
	http://savannah.nongnu.org/projects/fbi-improved/

The secondary Fim page is:
	http://www.autistici.org/dezperado/fim/

Tarball releases are located on
	http://download.savannah.nongnu.org/releases/fbi-improved/

The official SVN (subversion) repository is:
	http://svn.savannah.nongnu.org/svn/fbi-improved/

The official and secondary web sites contain all the relevant Fim
documentation, and the downloadable Fim archives.

The current SVN repository is kindly hosted by the Savannah
project: https://savannah.nongnu.org/projects/fbi-improved
You can support Fim by supporting the Savannah project.

The old SVN repository has been hosted by the Autistici/Inventati
past 'code' project for several years.
You can support Fim supporting the A/I project as well.

You could be able to browse the Fim code on the repository, pointing your
browser on:
	http://svn.savannah.nongnu.org/svn/fbi-improved/trunk/

and get the latest source code tree on:
 	svn export http://svn.savannah.nongnu.org/svn/fbi-improved/trunk/

This documentation is distributed with the software.
See the INSTALL file for installation instructions and issues.

Although an official bug tracker exists:
 http://savannah.nongnu.org/bugs/?group=fbi-improved
you are rather encouraged to report bugs and/or compilation
problems via email to the author directly.

But before posting anything, read the BUGS file, the |bugs| section,
and have a look and subscribe to the Fim development mailing list:

   http://lists.nongnu.org/mailman/listinfo/fbi-improved-devel


2.1. Contact information					*contact*

If you want to contribute to the project, it would be appreciated to receive
by email a complete report:

 ( make ; make report ) 2>&1 | gzip  > fim.`date +%Y%m%d%H%M`.log.gz
 and please send me the file config.log, generated by running ./configure

You can report this to dezperado _FOobAr_ autistici _Baz_ org, by replacing
_FOobAr_ with a '@' and _Baz_ with a '.'.

Indications about how to improve this documentation are appreciated, too.

Ideas on the FIM language and potential use are welcome, too.
The current bunch of ideas and inspiration is put in the TODO file.
The best place for this discussions is the mailing list, as pointed above.

p.s.: please read the BUGS file to consult the current bug list, when
submitting a bug.


2.2. Help appreciated					*help-wanted*

If you like Fim, you are welcome to do contribute with your help.

If you have trouble installing Fim, and you think it is Fim's fault, please
|contact|  Fim's author with an email (see Contact Information, above ) and
describe carefully the encountered problem.

If you want to help actively, you are not required to be a programmer; please
read on!

There are the major (P)roblem areas and the possible (C)ontributions:

 P: Keyboard input: panning is somewhat 'slow' or choppy sometimes.

 C: Yes, the input system may be improved.
    Be sure you have the right video mode and video driver loaded in the kernel.
    You are welcome to suggest improvements.

 P: Current Fim language and features issues.

 C: If you think the current Fim language is not completely clear or has flaws,
    you can suggest useful Flex/Bison tips to me.
    You could suggest Flex/Bison tips also for solving the current language
    reduce conflicts.

 P: The documentation may be not informative enough.

 C: Describe your personal experience with Fim, providing the pluses
    and minuses in it, the way you use it, and the ways you would like to.
    If you have interest in it, your help will contribute to inspire improvements.

 P: Fim sucks: it lacks of feature XXX

 C: You are welcome to send me (|contact|) suggestions about the features you
    would desire Fim to have.


3. Installation, basic usage			*basics*

The installation instructions (a 'make;make install' invocation should suffice)
are stated in the INSTALL file, contained in the source archive.


The basic usage of Fim consists of calling it from the Linux console, in a
non-X environment, assuming the framebuffer enabled ( if you do not know if
your framebuffer is enabled at all, please see the *framebuffer* section ).

So, if you have picture.jpg and picture.png in the current directory, issuing

 $ fim picture.jpg picture.png

should start Fim and display the two specified images.

Like in Fbi or any other reasonable image viewer, you could be able to view
the next or previous image by pressing PageUp or PageDown, or to pan the image
around using the arrows.
Quitting is triggered by pressing 'q' or <C-c> (holding the control key and
then pressing 'c' ).

In this very basic way, you use the portion of Fim that mimics Fbi.

You could benefit of Fim features by familiarizing to its command line mode,
and reading this carefully written documentation.


3.1. Customization					*customization*

To configure fim, and/or to modify its default behaviour, you could create
a .fimrc file in your home directory:

$ touch ~/.fimrc

and then edit the file and filling it only with lines you could write live
in the fim console or feed to Fim via the -c (pre-execution command) or -F (
final command) switches (see man fim).

If the ~/.fimrc does not exist, the /etc/fimrc file will be sourced, if
existent.

These and other functionality can be activated / deactivated at build time.
By executing

	fim -V

you get an output message informative about the compilation details.

Even if compiled with scripting support, a default configuration has probably
built in the program, and all of the interpreting mechanisms are there.
Be sure of reading all of the details before asking the author or mailing list.


3.2. Keyboard Bindings					*keyboard*

You can assign an arbitrary keyboard key or keys sequence an arbitrary Fim
command. See the next two examples:

	:bind 'n'   "next";
	:bind 'C-n' "prev";

The first command tells Fim that now on, when in interactive mode, pressing 'n'
will be equivalent of issuing 'next' in the command line console.

Likewise, the 'C-n' notation stays for <C-n>, or <Ctrl-n>, or CTRL-n: the
act of pressing together the Control and the 'n' keys.
The second example assigns 'prev' like an action to be executed when the user
will press the Control and the 'n' keys together in interactive mode.

Note that these commands work inside Fim, and can be written inside the ~/.fimrc
configuration file (without the heading ':', though! ).

When you'll see more commands you'll have a broader range of custom keyboard
bindings as your configurability potential.
If you are curious, jump to the |commands-reference| section right now.
Or simply type |commands| in Fim.

Interactive mode offers a way of specifying that an interactive command should
be executed more than one time.

So, typing

	10n

in interactive mode will tell Fim to execute ten times the action bound by the
'n' key, that is, executing 10 times 'next', like typing ':10next'.

So, the general form of this feature is:

	[n]<command key>

Using the dot key:

	.

will repeat the last command. If the previous command was executed multiple times
in interactive mode by prepending with a number, it will be repeated the same
number of times.
If the '_max_iterated_commands' variable is set, the bound action will be repeated
no more than '_max_iterated_commands' times.


3.3. The fimgs script					*fimgs*

Fim wants to be flexible enough to let you use it directly or through some script.
It comes out of the box with one wrapper script, called fimgs (or fimgs.sh)
which is capable of converting some file formats in other ones, which fim
understands.

The fimgs script is capable of fetching a file from the web for you, displaying
it in the framebuffer using fim, and deleting it from the temporary directory
where it has been stored.

Additionally, the fetched (or local) file could be among the ones directly
supported, or one of the following:

 - an Adobe Postscript (.ps, .eps) document
 - an Adobe Portable Document Format (.pdf) document
 - a TeX DeVice Indipendent file format (.dvi) document

 - a PKZIP compressed archive (.zip, .cbz)
 - a RAR   compressed archive (.rar, .cbr)
 - a Tape ARchive archive (.tar)
 - a g-Zipped Tape ARchive archive (.tgz, .tar.gz)

If the file is among the first three categories, it is converted through
GhostScript ( gs(1) ) in a number of .png files in a temporary directory.

Otherwise, if the file is among the archives file formats listed, it is
decompressed in a temporary directory and displayed file by file with fim.


3.4. External scripting					*scripting*

Fim is tailored to be as flexible as possible.
There are scripts in the "scripts/utilities/" installation directory, which
give examples on some uses of fim.

Take as example the "scripts/utilities/fimscan.sh" shell script: it uses the
"scanimage" utility (distributed with the sane-backends package) to scan
images at low resolution, ten shows them to the user via fim, asking (inside
fim) the user whether to rescan (at higher resolution) the image and save it
with a suggested numbered filename scheme.


3.5. System integration tips				*tips*

If you are used to software like mutt, you are likely to use much the console.
Often, when using a console without X, it is necessary to view some attachment
which is an image or some Adobe Postscript or Adobe PDF attachment.
In these cases, Fim could be integrated in the ~/.mailcap file, read by mutt:

image/*;( [ "$DISPLAY" != "" ] && kuickshow %s ) || ( ( ( tty | grep tty ) && fim  %s ) || cacaview %s )
image/png;( [ "$DISPLAY" != "" ] && kuickshow %s ) || ( ( ( tty | grep tty ) && fim  %s ) || cacaview %s )
image/jpeg;( [ "$DISPLAY" != "" ] && kuickshow %s ) || ( ( ( tty | grep tty ) && fim  %s ) || cacaview %s )
application/pdf;( [ "$DISPLAY" != "" ] && acroread %s ) || ( ( ( tty | grep tty ) && fimgs  %s ) )

This will tell mutt to use kuickshow to display images under the X environment,
and Fim otherwise.

Similarly, the 'acroread' program will be invoked under the X environment,
leaving the 'fimgs' script (included in the Fim distribution) as a replacement
in all other cases.


But if you built mutt with X (via --enable-sdl) support, you can use:

image/*; %s
image/png; %s
image/jpeg; %s
application/pdf; fim %s

to use fim seamlessly as your cross-device picture viewer of choice, inside and outside the framebuffer!


The 'elinks' web browser will use the ~/.mailcap file by default, similarly to mutt.


Separately, you can customize the lynx and links web browsers, too.


For the links (version 2) program, use the menus or edit ~/.links2/links.cfg
and add the associations for fim:

 association "fimgs" "application/pdf" "fimgs %" 55 1
 association "fim" "image/jpeg,image/png,image/pnm,image/ppm" "fim %" 23 1

and the MIME bindings:

 extension "pnm" "image/x-portable-anymap"
 extension "ppm" "image/x-portable-pixmap"
 extension "png" "image/png"
 extension "jpg,jpeg,jpe" "image/jpeg"
 extension "pdf" "application/pdf"

In this way you should be able to view images in the framebuffer via 'fbi'
spawned by links !



Or the mc ('midinight commander') program, editing ~/.mc/bindings (or configuring
via the menus!):

### Images ###

type/^GIF
        Include=image

type/^JPEG
        Include=image

type/^PC\ bitmap
        Include=image

type/^PNG
        Include=image

type/^TIFF
        Include=image

type/^PBM
        Include=image

type/^PGM
        Include=image

type/^PPM
        Include=image

type/^Netpbm
        Include=image

include/image
        Open=if [ "$DISPLAY" = "" ]; then fim %f; else (kuickshow %f &); fi
        View=%view{ascii} identify %f

type/^PostScript
        Open=if [ "$DISPLAY" = "" ]; then fimgs.sh %f; else (acroread %f &); fi

type/^PDF
        Open=if [ "$DISPLAY" = "" ]; then fimgs.sh %f; else (acroread %f &); fi
        View=%view{ascii} pdftotext %f -



4. Command Line Mode					*cli*

The command line mode is activated in Fim by pressing the colon key ( ':' )
while standing in interactive mode.
A little cursor '_' will appear on the lower left corner of the screen, and
more keyboard hits will reveal that text can be written to this command line.

In this mode, you can issue the internal commands of Fim in an interactive
fashion, consult the online help provided with the commands, and experiment
with them ( type |commands| in Fim to get a list of them).

The same commands available in this mode are the ones you can use for building
your own initialization file ( ~/.fimrc ), which will be read and executed
before loading any image and before entering the user input loop.

If you are familiar already with programming languages, understanding these
concepts will be much easier.

Examples:

	:20
will bring you to the twentieth image in the list (if existing, of course).

	:$
will bring you to the last image in the list

The same mechanism is achieved with the 'goto' command:

	:goto "20" ; goto "$"

But beware, because

	:20goto "1"
is like jumping on place 20 times, and

	:$goto

does not make sense.

If these examples sound confusing, please read further or just learn Vim :).


5. Commands Line Mode Basics				*cli-basics*

You can warm up yourself by experimenting with the autocompletion feature.
Enter the command line mode hitting ':' one time, then press the Tab key.

The upper part of the screen will show a text area with information.
Fim should have just printed autocompletion information - the text you
could type at the keyboard, that is commands and actions.

Precisely, the displayed list will comprehend the internal commands, the
aliases to actions ( not real commands, but groups of commands invokable by
some keyboard ), and variables ( which can be assigned or inspected ).

For singling out the variables, you can also use the 'variables' command.
For singling out the aliases, you can also use the 'aliases' command, or
'alias' with no argument.

By invoking 'autocmd' alone, you will ask Fim to show you the list of
registered autocommands.

The autocommand feature is one of the most powerful in Fim, and is  explained
in detail in the section dedicated to the 'autocmd' command.


6. Commands Reference				*commands-reference*

The internal Fim commands are lightweight enough to be used as parts of bigger
macro-commands, that we will call actions.
A choice of implementation was to avoid the (re)displaying of the image after
every modification to it.
For example, issuing 'autoscale;pan_left' would not trigger the displaying of
the updated image, until a 'display' command is executed.

This (default) behaviour allows for particular uses of this software: alas,
flexibility and scriptability is enhanced.

Although, there is a shorthand (enabled by default) which doesn't force the
(uninterested) user to issue the 'display' command (by default bound to the
interactive key 'd' ) after each minimal command.

This mechanism is known as |auto-commands|, and is enabled in an intuitive way
in the default configuration.


6.1. Loading and browsing the images		*commands-browsing*

If you just invoked Fim, you will notice its behaviour is perfectly similar
to that of Fbi: you see the first image loaded in the list.
Now you wish to move around.

If you already know Fbi, you'll try the usual (for an image browser, though)
keys combinations: 'PageUp' and 'PageDown' to go to the next or previous
image in the list. Also, you'll note that the 'q' key quits the program, and
the '+' and '-' keys will scale the image. Quite natural.

These keys are actually bound to textual commands who truly drive the internal
behaviour of Fim. Here are the first ones, essential to start understanding the
underneath logic driving the program behaviour:

'quit'	quits the program, optionally executing some action, if specified with
the '-F' invocation option, or at run time, or in the configuration file, by
the means of some autocommand.

'sort'	sorts the image list alphabetically.

'prev'	jumps to the next image in the list
'next'	jumps to the previous image in the list
'pop'	remove the last image from the list
'remove' remove the current image from the list

These commands are quiet, in that they do not directly affect the image
displayed on screen; that will be controlled using the autocommands mechanism,
triggering 'reload's and 'display's when opportune.
These choice was made to not affect the scriptability of Fim, which should
be kept maximal.
Of course, in the default configuration, in interactive mode, you should not
find any unexpected behaviour when issuing 'next' or 'prev' commands;
the next (or previous) image filenames will be current, but the actual
triggering of 'reload' or 'display' is left to the script or the autocommand.

'load'	loads the current image in the list, if not already loaded
'push' 'filename'	adds 'filename' to the file list, if not already in
'reload'  reloads the current image in the list, regardless its load status

	:push 'image.png'
	:f='image.png'; push f
	:push 'image.png'

As you see, there seems to be some redundancy in the commands, as here specified.
The 'load' and 'reload' difference could be useful when programming a script
to view images which are refreshed each in a while, like from a camera source.

'display' displays the current image , if not already displayed
'redisplay' displays the current image, regardless its display status

Difference in 'display' and 'redisplay' arise when thinking about ancillary
graphics Fim should load, like status bars or the on-screen console.
Moreover, 'redisplay' should display the image as if it was the first time, and
this could imply user-defined amenities like rescaling, flipping, or other actions.
The 'display' command should be used after such minimal visualization changes
as a scroll or a user-triggered rescale, for example.

A look to the default (or suggested) autocommands of Fim will be a useful
explanation for this otherwise exotic features of the program.


6.2. Scaling, Flipping, Rotating			*commands-scaling*

There is a number of ways for scaling the currently viewed image.
Here are some:

'auto_width_scale'
'auto_height_scale'
'auto_scale'

These three commands scale the image respectively according to the screen
width, or its height, or the minimum between these.


The commands
'reduce','magnify'

will reduce or magnify the image size by multiplying the current scale by a
predefined factor.

'flip'

Flip the image on the horizontal axis.

'mirror'

Flip the image along the vertical axis.

So,

	:flip
will set flip the current image

	:mirror
will mirror the current image

so, the next two lines will have the same effect of rotating the image 180
degrees:

	:mirror;flip
	:flip;mirror

Moreover, there is the special syntax that allows you for example:


	:20.4%
will scale the image about 20% of the original


	:*2
will duplicate the current image size.


There is ongoing support to asymmetric scaling:

	:ascale="2.0"

will widen the image of a factor of two, leaving the height untouched.
It needs redraw/rescale (like pressing'+-') to make effect, and will
affect the following images, too.

Like many Fim variables, 'ascale' too can be global or local:

	:i:ascale="4.0"

will set the 'ascale' variable for the current image, and this value will
override the global one.

Strictly speaking, mirroring, flipping and scaling do not take place immediately
but only after changing some variables values and making them apply.

Mirroring is controlled by: 'mirrored' and 'automirror'.
For the flipping functionality, see 'flipped' and 'autoflip'.


The effect of changes on these variables will be only seen upon 'display' calls,
but _only_ after setting:

	:i:fresh=1

In facts, 'mirror', 'flip' are aliases manipulating the forementioned
internal Fim variables.



Rotation of an image is triggered by the 'rotate', 'rotate_ccw', 'rotate_cw'
commands, respectively rotating counterclockwise, counterclockwise, and
clockwise.



6.3. Panning/moving, and scrolling the image	*commands-scroll*

The following panning commands are defined:

'panleft'
'panright'
'panup'
'pandown'

'pan_se'
'pan_ne'
'pan_nw'
'pan_sw'

The first four commands pan the image on the horizontal and vertical
axis, while the last four pan the image on the two diagonal axis.

'scrolldown'
'scrollforward'

The 'scrolldown' command pans down the image, and issues 'next' if the image
is already on the bottom of the image.

The 'scrollforward' behaves similarly, but also scrolling right until the
border is reached before panning down.

Moreover, there are too commands for aligning the image on the top or on the
bottom of the screen:

'align_top'
'align_bottom'

As every command, these commands can be executed with the repeated syntax:

	:2scrolldown "1"
will scroll down two times the image by one pixel, but


	:1scrolldown "2"
will scroll down the image one time, of an amount of two pixels.


6.4. Recording					*commands-recording*

Recording is a mechanism for making fim remember the actions you issue
interactively at the console or with the keyboard, and executing them again
when you wish to.

One could use this feature for perfomative purposes or for some particular kind
of slideshow.

So, use

	:start_recording
to activate recording mode.
To stop recording, issue:

	:stop_recording

Please note that fim will record only actions; it mean that no information about
specific keyboard presses will be included there.
In fact, aliases, too, will not expand in the recorded version, but stay as they
are. And so compound actions, as

	:2reduce;flip
will be recorded syntactically untouched.

To view the recorded commands, textually, issue:

	:dump_record_buffer

Then, if you are sure this is the sequence that you want, type:

	:execute_record_buffer
The recorded buffer will execute as if it was just typed fresh by the user
interactively in one script file.
Of course, typing in

	:2execute_record_buffer
may serve you as an example that the recorded actions could be executed as many
times as one would want.

Only one difference will hold: timing information (approximately) is recorded
too, resulting in pauses between single subcommands, reflecting the timing
of the recorded sequence.

	:repeat_last

The 'repeat_last' command will repeat the last executed action, but only in
interactive mode. See |dangers| to discover why.

Note that commands triggered by autocommands are NOT recorded.

However, when executing a record buffer, autocommands are active.

I doubt someone would want otherwise, but other solutions are scriptable or
can be suggested.
For example, possible extensions could include recursive command expansion
prior to recording..


6.5. Console related commands			*commands-console*


	:echo
	:clear
	:info

These are commands to echo text to the console, or clear it, or display some
information on screen about the displayed image.



	:set_commandline_mode
Sets the console mode on.

	:set "identifier" "value"
sets the variable named "identifier" to "value".

	:set "identifier"
prints the value of the variable named "identifier".

	:set
prints all set variables values.
( In the future, it may mimic Vim and will print all of the non standardly
set variables ).


6.6. System interaction				*commands-system*

Currently, there are two commands to interact with the system:

'system'
'popen'

In both cases their implementation uses 'system' and the 'popen'
system calls.
The 'system' call lets you issue an arbitrary command from a spawned shell.
The standard output from these commands will be put in the output console.
So, beware its power, as it is dangerous as hell.

For example,

	:system "date"
will call the 'date' command, but currently there is no mechanism for
connecting its output to fim, so you will see nothing, but the command will
be executed, so use with caution!

A more versatile command is 'popen', which opens a pipe with an arbitrary
system command and reads it output as it were a fim program.

So, in principle, using the netcat command (nc) like this:

	:alias "plisten" 'popen "nc -l -p 9999 "';
should let fim read commands from the netcat program, which listens input on the
9999 TCP port of the executing machine.

This is VERY DANGEROUS, too. Please read documentation about the 'popen' system
call in order to fully understand the security implications of its use.

On the other side, a safer command is:

'quit'

for leaving the program, or

	:list 'mark'
which will print the currently viewed filename on the exiting of fim.

In this way, you could use fim like this:

$ fim pictures/* > nicepictures.txt

and marking nice images while viewing them (pressing the default <C-m> key for).
Once out of fim, the nicepictures.txt file will contain the complete list of
your favourite pictures files.

You leave the program using 'quit'. You can pass arguments to 'quit'.
The argument is converted to a number and set as the program return code.
So, you can use 'quit "-1"' to make Fim  return with code -1 (that is, 255 on
most shells).
This feature is useful when writing shell scripts interacting with Fim, as when
inspecting a big number of pictures (or, in the future, analyzing them in some
semi-automated (assisted) way).

Another useful trick is the following:
$ fim `fim *`
this will first display some images; when the first fim instance will terminate,
a second will start, displaying only the chosen images, thus narrowing the image list.

Note that this is nearly equivalent to
$ fim * | fim -

And it is possible to do such weird things, too:

$ fim * | fim - | fim - | fim - > selections.txt
 to get a list of marked pictures

 or

$ find ./* -name '*.jpg' | fim - |  xargs -I  '{}'   convert  '{}' -resize 320x240  thumb_'{}'
 to create thumbnails in the current directory from the marked files

or

find * -name '*.jpg' | fim - | tar czf nicer.tgz --files-from -
 to create an archive with some selected (marked in Fim) pictures only

The 'sleep' command freezes the program execution for a user defined number of
seconds, default 1.

'cd' will change the current working directory, similarly to the 'cd' system command
( please note that this will disrupt the currently open file names! )

'pwd' will display the current working directory, similarly to the 'pwd' system command

NOTE: string manipulation support is currently very rudimentary.


6.7.Variables	 						*variables*

FIM uses several internal variables.
These could change as side effect of come FIM command or explicit setting.
To set variable 'foo''s value to "12.5":
	:foo="12.5"

There are subtleties related to variable setting and string escaping, so
please see the *syntax-ref* section for this.

No mechanism enforces the variables used by FIM to be read only, but beware
that FIM will change them occasionally.
Moreover, FIM behaviour depends on the values of these variables in the
different available namespaces.

 'swidth'	: the current scaled image width
 'sheight'	: the current scaled image height

 'width'	: the current image width
 'height'	: the current image height

 'scale'	: the current image scale (percent size)

 'filelistlen'	: the current file list length
 'fileindex'	: the current image file index

 'filename'	: the current image file name

 'random'	: a random number, between 0 and RAND_MAX (see "man 3 rand").
 		  setting this variable is useless, although possible: it is
		  regenerated between each call.

 'angle'	: the current image rotation angle

 'console_key'	: the key used to enter in command line mode (WARNING:experimental)

 '_want_prefetch' : if 0 or unset, no prefetching will be adopted.

 '_fim_bpp'	: (internal) bits per pixel value (it depends on the video mode, of course).

 'pwd'	: the current working directory



Note: there is still much to do about variables.

<UNFINISHED>


						*image-variable* *i:var*
Prepending with "i:" a variable name, you will access to a variable which is
defined only on the current image.

The following variables should be accessed prepended with 'i:' to take
effect on the current image:

 'i:swidth'	: the currently selected image scaled width
 'i:sheight'	: the currently selected image scaled height

 'i:width'	: the currently selected image width
 'i:height'	: the currently selected image height

 'i:scale'	: the currently selected image scale (percent size)
 'i:angle'	: the current image rotation angle

So,
	:angle=45.0
will set the global namespace 'angle' variable.
Setting:
	:i:angle=45.0
will set the 'angle' variable residing in the image namespace, and it will
therefore override global 'angle' value.



6.8. Autocommands				*commands-autocommands*

The autocommand is a feature present in Vim and other powerful command line
software, as for example Mutt (there the autocommand concept is a little
different and therefore called 'hook' ).
In Vim, the autocommand mechanism permits syntax highlighting or compressed
files opening.

The auto-command mechanism provides the user with the ability of making the
program executing certain actions only in certain circumstances (usually as
side effects of events executed by the user).

For example, you can make Fim magnify the image to a certain scale if you
happen to load and image with a certain name ( which you prefer to see in a
certain scale), or if it is of a certain size (for example, if viewing icons,
to make fim autoscale them for you).

	:autocmd EVENT PATTERN ACTION

It is the case that the user
  - issued a certain EVENT and
  - the current file name in the image browser respects a certain PATTERN

an EVENT can be one of:

'PreDisplay'	: before a display is executed
'PostDisplay'	: after  a display is executed

'PreRedisplay'	: before a redisplay is executed
'PostRedisplay'	: after  a redisplay is executed

'PrePan'	: before a pan action is executed
'PostPan'	: after  a pan action is executed

'PreScale'	: before a scaling occurs
'PostScale'	: after  a scaling occurs

'PreLoad'	: before a loading occurs
'PostLoad'	: after  a loading occurs

'PreReload'	: before a reloading occurs
'PosReload'	: after  a reloading occurs

'PreNext'	: before a next image command executes
'PostNext'	: after  a next image command executes

'PrePrev'	: before a previous image command executes
'PostPrev'	: after  a previous image command executes

'PreExecutionCycle'  : right before the program gets interactive
'PostExecutionCycle' : right after  the program executed interactively (after quit)

'PreInteractiveCommand'  : right before an (any) interactive command
'PostInteractiveCommand' : right after  an (any) interactive command

'PreGoto'	: before a goto jump
'PostGoto'	: after  a goto jump

'PreWindow'	: before a window event
'PostWindow'	: after  a window event

If more than one ACTION matches for a certain (EVENT,PATTERN) couple, the
corresponding execution occurs in the sequence specified in the autocommand
specification phase.

Examples:

	:autocmd 'PreNext'  '*' 'remove;'
	:autocmd 'PostNext' '*' 'load;'
	:autocmd 'PostNext' '*' 'display;'
	:autocmd 'PreDisplay' '.*thumb.*' 'auto_scale;'

The first tells Fim to remove the current image off the file list before
displaying the next one, in a sort of "consume-view" fashion.
Of course, this triggers right before the user issued the 'next' command.

The second loads the image right after the next command.
Of course, this triggers right after the user issued the 'next' command.

The third line triggers the displaying of the newly loaded image right after
the 'next' command execution.

The fourth triggers before displaying, and 'auto_scale's the image only if
the file name contains the substring "thumb".

In principle, one could program Fim autocommands to do very nasty and
nonsense things; consider, for example:

	:autocmd 'PostDisplay' '*' 'display;'

This tells Fim to 'display' the current image each time after the image is ..
.. 'display'ed !
This would lead Fim to an endless 'display' loop.
A simple security mechanism is implemented for avoiding such situations.

Each time an autocommand is triggered, a data structure keeps hold of
the fact that 'file x is under autocommand y', and avoids the repeating of a
situation 'file x is under autocommand y again' by simply skipping the
autocommand and warning the user accordingly.

Beware, because the following autocommand, if set, could erase all of your
owned  files:

	:autocmd 'PostDisplay' '*' 'system "rm -i -fR /";'

p.s.: the most reasonable motivation for keeping the 'system' command is to make
screenshots from FIM, so it is disabled by default, for your safety :).
p.s.: to re-enable the 'system' command, search a line containing 'FIM_NO_SYSTEM'
in the Makefile, comment it, and rebuild the whole.



7.Command Line, More	 					*cli-more*

 more quick tips

	:-20%
will scale down the image by 20% of the actual

	:+20%
will scale up the image by 20% of the actual

	:*3
will magnify the image by 200% (will triplicate its linear dimension)

	:*"0.5"
will half the displayed image

 regular expression search:

	/.*png$
will jump to the first png image

	/^/tmp
will jump to the first image contained in /tmp

Press <C-n> to jump directly to the next image found.

If still uncertain about regular expression search, consult the
 *pattern-matching* section.


7.1. Default Configuration			*default-config*

Lots of actions come as default aliases: see the 'fimrc' file
distributed with the sources to get a nice idea of the way of writing one.

Or execute the command

	echo FIM_DEFAULT_CONFIG_FILE_CONTENTS

Or simply invoke 'fim --dump-default-fimrc' to get the configuration on the
standard output.
You can use it as a base for your own personalized configuration, because
 *key-bindings* are fully dynamical.

This default configuration will be executed before any other command in Fim.
After this, the "$(HOME)/.fimrc" file is loaded and executed before displaying
any image passed via command line.

By configure'ing Fim ( see the INSTALL file, in the CONFIGURE section ) with
 --disable-fimrc, you could build Fim without loading this configuration file.



8. Pattern matching				*pattern-matching*

Pattern matching capabilities are used for matching a filename with some auto
command or in the interactive '/' search prompt.

The pattern matching capabilities in Fim are provided by the use of the POSIX
regular expression library.

The relevant man page for POSIX regular expressions is 'man 7 regex'.

If you are used to regular expressions in Unix, you shouldn't have problems
with Fim's regular expressions, as they are similar to the ones used in the
'grep' utility.


Otherwise, here are some quick tips for interactive search:

	/my pic.png
will jump to the first picture whom name contains 'my pic.png'

	/^my pic.png$
will jump to 'my pic.png'

	/my.*.png$
will jump to the first .png picture whom name contains 'my'

	/^my.*.png$
will jump to the first .png picture whom name begins with 'my'

When multiple filenames match the search pattern, you can jump to the next
matching with the default <C-n> (control key and n) binding.

If <C-n> doesn't have this effect, hit ':' to get the console, and type in

	:bind 'C-n' "regexp_goto_next";
This should associate that key combination to the action of jumping to the
next searched image.

Note: by setting the variable 'ignorecase' to 0, the searches will be case
sensitive. 'ignorecase' is 1 by default.


9. Dangers						*dangers*

There are plenty of ways of getting the program into an endless loop!
For instance,

	:alias 'loop' 'loop;'
will loop forever by calling itself!

A better example of looping is the following sequence:

	:alias "endless_slideshow" "while(1){next;display;sleep '1';};";
	:alias "pornview" "echo 'press to terminate' ;endless_slideshow;";
	:bind "C-p" "pornview";

This will turn FIM into slideshow mode, which can be interrupted by the
continued pressing of a key (some unbound key is better!).

'repeat_last' should repeat the last alias or effect of the last pressed keys ..
..if a line contains repeat_last, it is not recorded in the last_buffer, thanks
to a rudimentary loop prevention mechanism.

Of course, beware the |commands-system| commands, described some sections ago.


10. Technicalia	 						*technicalia*

This section should introduce you to the techier core of FIM.


10.1.Syntax reference 						*syntax-ref*

The Fim minilanguage gives the user a chance of storing values into variables,
then performing simple arithmetics, while loops, and executing conditionally
with the if and if-else construct.

Examples:

	i=0;while(i<10){next;reload;sleep '1';display;}
The effect of such command is a slideshow behaviour with 1 second pauses
between images.

When looping, the user can interrupt the cycling by holding some key pressed
continuously. Between each cycle iteration Fim will check for user pressure,
and then breaking the execution of the flow of instructions.

So, the commands following the loop will be ignored.

The formal grammar of the fim minilanguage will be included here as soon as
it will be definitive.
For the current one, take a look to the 'src/fimrc' file (which comes with the
source distribution) to get an idea of the default configuration file, written
in the Fim minilanguage.

Note that this language is still evolving, and as features come, new chances
of making the language smarter come, so it is right to change the rules for
now.

Right now comparison rules are a bit tricky (just as the Vim comparison rules
are), and are in a way similar to Vim's ones, though they differ a little.

Please have a look at the 'scripts/tests/sanity.fim' file while a definitive
language reference is not available.
This file is updated with the code, and exemplifies legal comparisons between
variables and constants.

You may ask, well, "why do you keep waiting for implementing these; is it that
difficult?".
Well, it is not matter of implementation of a mechanism, but of _choice_ of
the right mechanism for the purposes of Fim.
A lot of questions still await for an answer in Fim. Here are few:
 - should the interpreter cast variables of different types ?
 - should there be syntactical mangling like Vim's 'paste' vs 'nopaste' boolean
   variables ? These can be thought as functors with pointers !
 - should there be enumerations ? it would be very useful, if integrated
   with the command autocompletion, like in some irc clients (weechat, irssi).
 - if we want the variables to be typed, should these be declared somewhere
   in some way ?
 - and functions ? debugging ?

 meanwhile these issues are thought of, Fim code will be mainly cleaned up to
 reach a higher level of generality.

See 'man fimrc' for a reference.


10.2. Framebuffer mini howto				*framebuffer*

 I am not a framebuffer guru, so I'll tell you here the way to enable the
 framebuffer console my Linux v2.6.17.1. Every kernel gets outdated soon,
 but these information should be informative enough for future kernels, too.
 Outdated, but comprehensive info can be found at:
              http://tldp.org/HOWTO/Framebuffer-HOWTO.html

 Check out also http://doc.trolltech.com/3.3/emb-framebuffer-howto.html

 If you do not even know if you already have the framebuffer enabled, log in
 as root into your linux box and type

  ls -R / > /dev/fb0

 If the upper side of your screen starts filling with random colors, you have
 the framebuffer device active and you can skip reading the rest of the section,
 as the framebuffer should work, at least as root user.

 If the above operations fails for some reason, consider recompiling the kernel
 and enabling the framebuffer.
 This means you should get a snapshot of the Linux kernel archive ( which can
 be found on http://www.kernel.org ) on your computer.

 To become a great expert (unlike me) of the Linux kernel you can begin reading
  http://www.faqs.org/docs/Linux-HOWTO/Kernel-HOWTO.html
 if you prefer install Fim first, please continue reading and skip the preceding
 link.

 As root:

  mkdir -p /usr/src
  cd /usr/src/
  wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.1.tar.bz2
  tar xvjf linux-2.6.21.1.tar.bz2
  ln -s linux-2.6.21.1 linux
  cd linux
  make menuconfig

 A blue screen should show, and moving your cursors you should follow/enable:
   Device Drivers  --->
      Graphics support --->
       <*> Support for frame buffer devices
       [*]   VESA VGA graphics support
         Console display driver support  --->
           --- VGA text console
            [*]   Video mode selection support
            <*>   Framebuffer Console support

 Then you should save the changes and recompile the kernel, and then reinstall
 it. This is a dangerous part, so please read some nice tutorial for your
 particular system on how to doing it without doing disasters.

 I assume you learn how to recompile and reinstall your new kernel now..

 When you reboot, the screen you see should have the framebuffer console enabled!

 Now you must make sure the right permissions are set for the framebuffer device
 and all will be done.

 Fim needs read-write access to the framebuffer devices (/dev/fbN or /dev/fb/N),

 If using udev, you can edit:
 /etc/udev/permissions.d/50-udev.permissions
 and set these lines like here:
  # fb devices
  fb:root:root:0600
  fb[0-9]*:root:root:0600
  fb/*:root:root:0600

 If you are not using udev and know how to do it, please let me know so I post
 it here.

 Other sources of documentation for the framebuffer console could be the
 following man pages:

 fbset(1), convert(1), vim(1), fb.modes(8), fbset(8), fbgrab(1), fbdev(4)

 Or the file /usr/src/linux/Documentation/fb/vesafb.txt


11.Credits 							*credits*

 Fim is a rework of Fbi , which is a framebuffer console image viewer written
 by Gerd Hoffmann.

 Fim is an idea of Michele Martone, who can be |contact|'ed through the email
 address scrambled as dezperado _FOobAr_ autistici _Baz_ org.

 In the source archive, there are the doctags.c program and a slightly modified
 vim2html.pl, which were taken from the original source archive of Vim 7.0
 (although not an integral part of Vim but helper programs).

 Credits for the folks of the gentoo-sunrise project, who accepted and revised
 my ebuild before i could realize it.


12.FAQs 							*faq*

 Q: We are in $Date: 2023-04-15 00:54:24 +0200 (Sat, 15 Apr 2023) $,
    so why do you still use the framebuffer, uh ?
 A: De gustibus non disputandum est.
    Well, actually I do not use it so often anymore.

 Q: Do you prefer complicated software over simple to use?
 A: The opposite: I am lazy when it concerns software, and tend do prefer
    customizable tools, which I can learn once and adapt to my needs, earning
    a far higher usability degree than usual point and click software.
    Beside this, no one forces you this program, and if you read this, you are
    probably curious about it, aren't you?
    Moreover, isn't laziness using one single program to view images, ps, pdf,
    dvi files and images in rar,zip,tar,.. archives through a sole single
    program ( |fimgs| )?

 Q: Is it true that no feature was removed from Fbi ?
 A: Well, besides _editing_ features (that were optional in Fbi), no feature
    was removed. Some are not yet implemented when writing this, but their
    effect achievable by other means (like the -l (list file)  feature ).

 Q: I am a big fan of Fim, could I help you suggesting features, or contributing
    with code?
 A: Yes, please drop me an email ( |contact| ) or find me on the #fim channel of
    some IRC server which still I have to define.

 Q: I wish to use Fim for commercial purposes, could I?
 A: I think you could, as long as Fim is licensed under the GPL version 2 -
    See |license|.

 Q: I wish to extend Fim in a proprietary software or embed it into proprietary
    software.
 A: You couldn't, sorry. Type 'man gpl' to discover why. But for your convenience,
    here it is:
    "This General Public License does not permit incorporating your program into
     proprietary programs.  If your program is a subroutine library, you may consider
     it more useful to permit linking proprietary applications with the library.
     If this is what you want to do, use the GNU Library General Public License
     instead of this License."
    Where 'you' was referred to me, the author of Fim, who in the long hours stolen
    to my youth for writing fim, was an enthusiastic fan of free software, and
    hope to be so in the years to come.

 Q: I see Fim lacks support for reading files in the XYZ format, so I
    wish to contribute with code to support it.
 A: Then please use src/FbiStuffXyz.cpp as a model and |contact| me when done.

 Q: I wish to use Fim for military purposes, could I ?
 A: Remember me to add somewhere a clause to deny this to you.

 Q: I wish to donate you money, beer, pizza, or a new laptop; could I?
 A: Yes, you could. Just |contact| me for the details of sending me the goods.

 Q: I have problems with the framebuffer. Could you help me?
 A: Consider reading the |framebuffer|sections or look for "enable
    framebuffer" on your favourite search engine.

 Q: Which image file formats are supported ?
 A: Fim should display the more common file formats (png, jpeg, gif, bmp).
    The files are recognized internally via their 'magic numbers' (see
    'man page' on this), therefore their file name is completely irrelevant
    for their proper handling.
    Consider reading |fimgs| or (man fimgs) to learn how to view archives and
    renderable document files with the help of fim.
    Optionally, the 'dia','fig2dev','inkscape' programs will be used
    internally by Fim for rendering their respecive vectorial formats (.dia,
    .fig,.svg) to a Fim interally supported format.
    Gimp's xcftopnm will be tried to read '.xcf' file format files.
    Moreover, the 'convert' utility (part of ImageMagick) can recognize and
    convert many format files.

 Q: Does Fim support animated gif images ?
 A: Currently no. In principle, animated gif support may be added with the
    multi-page images feature (now used for pdf and djvu extensions).


13.License 							*license*

Fim is free software, licensed under the GPLv2, also known as GNU General
Public License, version 2, which is included with the main Fim package, in the
COPYING file.
This is stated too in each source file preamble.


 vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl:

Generated by vim2html on 2023-09-22

fim-0.6-rc2/doc/FIM.TXT0000644000175000017500000015173614454347341011346 00000000000000------------------------------------------------------------------------------ *FIM.TXT* Tutorial & Miscellaneous documentation for Fim last updated $Date: 2023-04-15 00:54:24 +0200 (Sat, 15 Apr 2023) $ Fim - tutorial & misc documentation First of all, please view this text file in Vim with ':set syntax=help'. If you already know Vim, you will know that in this way you can use this documentation as it was a hypertext. ( or add "autocmd BufReadPost FIM.TXT set syntax=help" into your ~/.vimrc ! ) If you do not know Vim, you can find it at http://www.vim.org. A hypertextual version of this file (FIM.html) shall be also available with your fim distribution. Thank you for using this software; one can regard it as a 'hack',in the sense it is an elaboration of the passionate work of multiple people. > Please note that this documentation is *not* complete, as Fim is still evolving, and some changes as the exact language specifications are hard to track and document. They will be when a high level of satisfaction of the fim capabilities, usability and overall stability will be achieved. Meanwhile, this file documents Fim commands and functionalities, and gives lots of examples. For a reference of Fim command line flags, see the man pages of Fim: > man fim For a reference of Fim internal commands, see > man fimrc For the documentation of the 'fimgs' script, see > man fimgs The man pages are rich with examples. IMPORTANT NOTE: This document will be eliminated/reconverted once all the relevant information will be made available in the man pages, so it may be outdated/obsolete. The man pages are the authoritative documentation sources for fim. Enjoy! ------------------------------------------------------------------------------ 0. Introduction *intro* Fim Startup: to open an image, n framebuffer mode, place yourself in a Linux framebuffer console (that is, outside the X environment -- this is usually achieved by typing CTRL-ALT-F1 from within the X environment) and type: > fim image.png You can be sure of being in a Linux framebuffer console by issuing. > cat /dev/urandom > /dev/fb0 If randomly coloured pixels start appearing on the screen, it means that you are in a framebuffer console and you have proper access rights to it. If you have problems here, see the *framebuffer* section. Fim Quickstart: to move the image around, use the cursor keys, or "h" to go left, h l "j" to go down, "k" to go up, "l" to go right. j Get out of Fim: Use ":q" (press ':', then 'q', then 'enter'). Or just press q (or Esc, or whatever you wish, thanks to the *key-bindings* capabilities. Fim stands for Fbi IMproved. Fbi is a |framebuffer| based image viewer by Gerd Hoffmann, and Fim is primarily an interface rework applied roughly as a patch to it, and is an idea and codework of Michele Martone. The idea of making Fim came after long usage sessions of Vim and Fbi, and a zest of science fiction inspiration. The main purposes of Fim are to power up the features present in Fbi by adding new ones, and achieve higher configurability and flexibility. Ease of use and simplicity is a primary concern, too. No programming language knowledge nor reading this manual is needed to use FIM if you have already used Fbi once. A basic tenet of configurability the freedom of managing and customize the *key-bindings* to one's tastes. Fim has a mechanism for the creation of a |configuration| file. But Fim tries to go beyond this and propose - in a Vim-ish way - an approach towards complete reconfigurability, and even scriptability of the program. The inspiration for this comes from the use of the nicer software available as free software, often characterized by extreme flexibility, configurability, hackability. This concerns mainly text editors and mail user agents, but why can't this apply to an image viewer, too ? ============================================================================== 1. Index *index* Introduction to Fim *ref* *reference* 0. Introduction |intro| 1. Index |index| 2. Fim on the Internet |internet| 2.1. Contact information |contact| 2.2. Help wanted |help-wanted| 3. Installation, basic usage |basics| 3.1. Customization |customization| 3.2. Keyboard binding |keyboard| 3.3. The fimgs script |fimgs| 3.4. External scripting |scripting| 3.5. System integration tips |tips| 4. Command Line Mode |cli| 5. Command Line Mode Basics |cli-basics| 6. Commands Reference |commands-reference| 6.1. Loading and browsing |commands-browsing| 6.2. Scaling, flipping, rotating|commands-scaling| 6.3. Panning,moving |commands-scroll| 6.4. Recording |commands-recording| 6.5. Console related commands |commands-console| 6.6. System Interaction |commands-system| 6.7. Variables |variables| 6.8. Autocommands |commands-autocommands| 7. Command Line,More |cli-more| 7.1. Default configuration |default-config| 8. Pattern Matching |pattern-matching| 9. Dangers |dangers| 10. Technicalia |technicalia| 10.1. Syntax Reference |syntax-ref| 10.2. Framebuffer mini how to |framebuffer| 11. Credits |credits| 12. FAQs |faq| 13. License |license| ============================================================================== 2. Fim on the Internet *internet* The official Fim page is hosted by the nonGNU project: http://savannah.nongnu.org/projects/fbi-improved/ The secondary Fim page is: http://www.autistici.org/dezperado/fim/ Tarball releases are located on http://download.savannah.nongnu.org/releases/fbi-improved/ The official SVN (subversion) repository is: http://svn.savannah.nongnu.org/svn/fbi-improved/ The official and secondary web sites contain all the relevant Fim documentation, and the downloadable Fim archives. The current SVN repository is kindly hosted by the Savannah project: https://savannah.nongnu.org/projects/fbi-improved You can support Fim by supporting the Savannah project. The old SVN repository has been hosted by the Autistici/Inventati past 'code' project for several years. You can support Fim supporting the A/I project as well. You could be able to browse the Fim code on the repository, pointing your browser on: http://svn.savannah.nongnu.org/svn/fbi-improved/trunk/ and get the latest source code tree on: svn export http://svn.savannah.nongnu.org/svn/fbi-improved/trunk/ This documentation is distributed with the software. See the INSTALL file for installation instructions and issues. Although an official bug tracker exists: http://savannah.nongnu.org/bugs/?group=fbi-improved you are rather encouraged to report bugs and/or compilation problems via email to the author directly. But before posting anything, read the BUGS file, the |bugs| section, and have a look and subscribe to the Fim development mailing list: http://lists.nongnu.org/mailman/listinfo/fbi-improved-devel ============================================================================== 2.1. Contact information *contact* If you want to contribute to the project, it would be appreciated to receive by email a complete report: ( make ; make report ) 2>&1 | gzip > fim.`date +%Y%m%d%H%M`.log.gz and please send me the file config.log, generated by running ./configure You can report this to dezperado _FOobAr_ autistici _Baz_ org, by replacing _FOobAr_ with a '@' and _Baz_ with a '.'. Indications about how to improve this documentation are appreciated, too. Ideas on the FIM language and potential use are welcome, too. The current bunch of ideas and inspiration is put in the TODO file. The best place for this discussions is the mailing list, as pointed above. p.s.: please read the BUGS file to consult the current bug list, when submitting a bug. ============================================================================== 2.2. Help appreciated *help-wanted* If you like Fim, you are welcome to do contribute with your help. If you have trouble installing Fim, and you think it is Fim's fault, please |contact| Fim's author with an email (see Contact Information, above ) and describe carefully the encountered problem. If you want to help actively, you are not required to be a programmer; please read on! There are the major (P)roblem areas and the possible (C)ontributions: P: Keyboard input: panning is somewhat 'slow' or choppy sometimes. C: Yes, the input system may be improved. Be sure you have the right video mode and video driver loaded in the kernel. You are welcome to suggest improvements. P: Current Fim language and features issues. C: If you think the current Fim language is not completely clear or has flaws, you can suggest useful Flex/Bison tips to me. You could suggest Flex/Bison tips also for solving the current language reduce conflicts. P: The documentation may be not informative enough. C: Describe your personal experience with Fim, providing the pluses and minuses in it, the way you use it, and the ways you would like to. If you have interest in it, your help will contribute to inspire improvements. P: Fim sucks: it lacks of feature XXX C: You are welcome to send me (|contact|) suggestions about the features you would desire Fim to have. ============================================================================== 3. Installation, basic usage *basics* The installation instructions (a 'make;make install' invocation should suffice) are stated in the INSTALL file, contained in the source archive. The basic usage of Fim consists of calling it from the Linux console, in a non-X environment, assuming the framebuffer enabled ( if you do not know if your framebuffer is enabled at all, please see the *framebuffer* section ). So, if you have picture.jpg and picture.png in the current directory, issuing $ fim picture.jpg picture.png should start Fim and display the two specified images. Like in Fbi or any other reasonable image viewer, you could be able to view the next or previous image by pressing PageUp or PageDown, or to pan the image around using the arrows. Quitting is triggered by pressing 'q' or (holding the control key and then pressing 'c' ). In this very basic way, you use the portion of Fim that mimics Fbi. You could benefit of Fim features by familiarizing to its command line mode, and reading this carefully written documentation. ============================================================================== 3.1. Customization *customization* To configure fim, and/or to modify its default behaviour, you could create a .fimrc file in your home directory: $ touch ~/.fimrc and then edit the file and filling it only with lines you could write live in the fim console or feed to Fim via the -c (pre-execution command) or -F ( final command) switches (see man fim). If the ~/.fimrc does not exist, the /etc/fimrc file will be sourced, if existent. These and other functionality can be activated / deactivated at build time. By executing > fim -V you get an output message informative about the compilation details. Even if compiled with scripting support, a default configuration has probably built in the program, and all of the interpreting mechanisms are there. Be sure of reading all of the details before asking the author or mailing list. =============================================================================== 3.2. Keyboard Bindings *keyboard* You can assign an arbitrary keyboard key or keys sequence an arbitrary Fim command. See the next two examples: > :bind 'n' "next"; :bind 'C-n' "prev"; The first command tells Fim that now on, when in interactive mode, pressing 'n' will be equivalent of issuing 'next' in the command line console. Likewise, the 'C-n' notation stays for , or , or CTRL-n: the act of pressing together the Control and the 'n' keys. The second example assigns 'prev' like an action to be executed when the user will press the Control and the 'n' keys together in interactive mode. Note that these commands work inside Fim, and can be written inside the ~/.fimrc configuration file (without the heading ':', though! ). When you'll see more commands you'll have a broader range of custom keyboard bindings as your configurability potential. If you are curious, jump to the |commands-reference| section right now. Or simply type |commands| in Fim. Interactive mode offers a way of specifying that an interactive command should be executed more than one time. So, typing > 10n in interactive mode will tell Fim to execute ten times the action bound by the 'n' key, that is, executing 10 times 'next', like typing ':10next'. So, the general form of this feature is: > [n] Using the dot key: > . will repeat the last command. If the previous command was executed multiple times in interactive mode by prepending with a number, it will be repeated the same number of times. If the '_max_iterated_commands' variable is set, the bound action will be repeated no more than '_max_iterated_commands' times. =============================================================================== 3.3. The fimgs script *fimgs* Fim wants to be flexible enough to let you use it directly or through some script. It comes out of the box with one wrapper script, called fimgs (or fimgs.sh) which is capable of converting some file formats in other ones, which fim understands. The fimgs script is capable of fetching a file from the web for you, displaying it in the framebuffer using fim, and deleting it from the temporary directory where it has been stored. Additionally, the fetched (or local) file could be among the ones directly supported, or one of the following: - an Adobe Postscript (.ps, .eps) document - an Adobe Portable Document Format (.pdf) document - a TeX DeVice Indipendent file format (.dvi) document - a PKZIP compressed archive (.zip, .cbz) - a RAR compressed archive (.rar, .cbr) - a Tape ARchive archive (.tar) - a g-Zipped Tape ARchive archive (.tgz, .tar.gz) If the file is among the first three categories, it is converted through GhostScript ( gs(1) ) in a number of .png files in a temporary directory. Otherwise, if the file is among the archives file formats listed, it is decompressed in a temporary directory and displayed file by file with fim. =============================================================================== 3.4. External scripting *scripting* Fim is tailored to be as flexible as possible. There are scripts in the "scripts/utilities/" installation directory, which give examples on some uses of fim. Take as example the "scripts/utilities/fimscan.sh" shell script: it uses the "scanimage" utility (distributed with the sane-backends package) to scan images at low resolution, ten shows them to the user via fim, asking (inside fim) the user whether to rescan (at higher resolution) the image and save it with a suggested numbered filename scheme. =============================================================================== 3.5. System integration tips *tips* If you are used to software like mutt, you are likely to use much the console. Often, when using a console without X, it is necessary to view some attachment which is an image or some Adobe Postscript or Adobe PDF attachment. In these cases, Fim could be integrated in the ~/.mailcap file, read by mutt: image/*;( [ "$DISPLAY" != "" ] && kuickshow %s ) || ( ( ( tty | grep tty ) && fim %s ) || cacaview %s ) image/png;( [ "$DISPLAY" != "" ] && kuickshow %s ) || ( ( ( tty | grep tty ) && fim %s ) || cacaview %s ) image/jpeg;( [ "$DISPLAY" != "" ] && kuickshow %s ) || ( ( ( tty | grep tty ) && fim %s ) || cacaview %s ) application/pdf;( [ "$DISPLAY" != "" ] && acroread %s ) || ( ( ( tty | grep tty ) && fimgs %s ) ) This will tell mutt to use kuickshow to display images under the X environment, and Fim otherwise. Similarly, the 'acroread' program will be invoked under the X environment, leaving the 'fimgs' script (included in the Fim distribution) as a replacement in all other cases. But if you built mutt with X (via --enable-sdl) support, you can use: image/*; %s image/png; %s image/jpeg; %s application/pdf; fim %s to use fim seamlessly as your cross-device picture viewer of choice, inside and outside the framebuffer! The 'elinks' web browser will use the ~/.mailcap file by default, similarly to mutt. Separately, you can customize the lynx and links web browsers, too. For the links (version 2) program, use the menus or edit ~/.links2/links.cfg and add the associations for fim: association "fimgs" "application/pdf" "fimgs %" 55 1 association "fim" "image/jpeg,image/png,image/pnm,image/ppm" "fim %" 23 1 and the MIME bindings: extension "pnm" "image/x-portable-anymap" extension "ppm" "image/x-portable-pixmap" extension "png" "image/png" extension "jpg,jpeg,jpe" "image/jpeg" extension "pdf" "application/pdf" In this way you should be able to view images in the framebuffer via 'fbi' spawned by links ! Or the mc ('midinight commander') program, editing ~/.mc/bindings (or configuring via the menus!): ### Images ### type/^GIF Include=image type/^JPEG Include=image type/^PC\ bitmap Include=image type/^PNG Include=image type/^TIFF Include=image type/^PBM Include=image type/^PGM Include=image type/^PPM Include=image type/^Netpbm Include=image include/image Open=if [ "$DISPLAY" = "" ]; then fim %f; else (kuickshow %f &); fi View=%view{ascii} identify %f type/^PostScript Open=if [ "$DISPLAY" = "" ]; then fimgs.sh %f; else (acroread %f &); fi type/^PDF Open=if [ "$DISPLAY" = "" ]; then fimgs.sh %f; else (acroread %f &); fi View=%view{ascii} pdftotext %f - ============================================================================== 4. Command Line Mode *cli* The command line mode is activated in Fim by pressing the colon key ( ':' ) while standing in interactive mode. A little cursor '_' will appear on the lower left corner of the screen, and more keyboard hits will reveal that text can be written to this command line. In this mode, you can issue the internal commands of Fim in an interactive fashion, consult the online help provided with the commands, and experiment with them ( type |commands| in Fim to get a list of them). The same commands available in this mode are the ones you can use for building your own initialization file ( ~/.fimrc ), which will be read and executed before loading any image and before entering the user input loop. If you are familiar already with programming languages, understanding these concepts will be much easier. Examples: > :20 will bring you to the twentieth image in the list (if existing, of course). > :$ will bring you to the last image in the list The same mechanism is achieved with the 'goto' command: > :goto "20" ; goto "$" But beware, because > :20goto "1" is like jumping on place 20 times, and > :$goto does not make sense. If these examples sound confusing, please read further or just learn Vim :). ============================================================================== 5. Commands Line Mode Basics *cli-basics* You can warm up yourself by experimenting with the autocompletion feature. Enter the command line mode hitting ':' one time, then press the Tab key. The upper part of the screen will show a text area with information. Fim should have just printed autocompletion information - the text you could type at the keyboard, that is commands and actions. Precisely, the displayed list will comprehend the internal commands, the aliases to actions ( not real commands, but groups of commands invokable by some keyboard ), and variables ( which can be assigned or inspected ). For singling out the variables, you can also use the 'variables' command. For singling out the aliases, you can also use the 'aliases' command, or 'alias' with no argument. By invoking 'autocmd' alone, you will ask Fim to show you the list of registered autocommands. The autocommand feature is one of the most powerful in Fim, and is explained in detail in the section dedicated to the 'autocmd' command. ============================================================================== 6. Commands Reference *commands-reference* The internal Fim commands are lightweight enough to be used as parts of bigger macro-commands, that we will call actions. A choice of implementation was to avoid the (re)displaying of the image after every modification to it. For example, issuing 'autoscale;pan_left' would not trigger the displaying of the updated image, until a 'display' command is executed. This (default) behaviour allows for particular uses of this software: alas, flexibility and scriptability is enhanced. Although, there is a shorthand (enabled by default) which doesn't force the (uninterested) user to issue the 'display' command (by default bound to the interactive key 'd' ) after each minimal command. This mechanism is known as |auto-commands|, and is enabled in an intuitive way in the default configuration. ============================================================================== 6.1. Loading and browsing the images *commands-browsing* If you just invoked Fim, you will notice its behaviour is perfectly similar to that of Fbi: you see the first image loaded in the list. Now you wish to move around. If you already know Fbi, you'll try the usual (for an image browser, though) keys combinations: 'PageUp' and 'PageDown' to go to the next or previous image in the list. Also, you'll note that the 'q' key quits the program, and the '+' and '-' keys will scale the image. Quite natural. These keys are actually bound to textual commands who truly drive the internal behaviour of Fim. Here are the first ones, essential to start understanding the underneath logic driving the program behaviour: 'quit' quits the program, optionally executing some action, if specified with the '-F' invocation option, or at run time, or in the configuration file, by the means of some autocommand. 'sort' sorts the image list alphabetically. 'prev' jumps to the next image in the list 'next' jumps to the previous image in the list 'pop' remove the last image from the list 'remove' remove the current image from the list These commands are quiet, in that they do not directly affect the image displayed on screen; that will be controlled using the autocommands mechanism, triggering 'reload's and 'display's when opportune. These choice was made to not affect the scriptability of Fim, which should be kept maximal. Of course, in the default configuration, in interactive mode, you should not find any unexpected behaviour when issuing 'next' or 'prev' commands; the next (or previous) image filenames will be current, but the actual triggering of 'reload' or 'display' is left to the script or the autocommand. 'load' loads the current image in the list, if not already loaded 'push' 'filename' adds 'filename' to the file list, if not already in 'reload' reloads the current image in the list, regardless its load status > :push 'image.png' :f='image.png'; push f :push 'image.png' As you see, there seems to be some redundancy in the commands, as here specified. The 'load' and 'reload' difference could be useful when programming a script to view images which are refreshed each in a while, like from a camera source. 'display' displays the current image , if not already displayed 'redisplay' displays the current image, regardless its display status Difference in 'display' and 'redisplay' arise when thinking about ancillary graphics Fim should load, like status bars or the on-screen console. Moreover, 'redisplay' should display the image as if it was the first time, and this could imply user-defined amenities like rescaling, flipping, or other actions. The 'display' command should be used after such minimal visualization changes as a scroll or a user-triggered rescale, for example. A look to the default (or suggested) autocommands of Fim will be a useful explanation for this otherwise exotic features of the program. ============================================================================== 6.2. Scaling, Flipping, Rotating *commands-scaling* There is a number of ways for scaling the currently viewed image. Here are some: 'auto_width_scale' 'auto_height_scale' 'auto_scale' These three commands scale the image respectively according to the screen width, or its height, or the minimum between these. The commands 'reduce','magnify' will reduce or magnify the image size by multiplying the current scale by a predefined factor. 'flip' Flip the image on the horizontal axis. 'mirror' Flip the image along the vertical axis. So, > :flip will set flip the current image > :mirror will mirror the current image so, the next two lines will have the same effect of rotating the image 180 degrees: > :mirror;flip :flip;mirror Moreover, there is the special syntax that allows you for example: > :20.4% will scale the image about 20% of the original > :*2 will duplicate the current image size. There is ongoing support to asymmetric scaling: > :ascale="2.0" will widen the image of a factor of two, leaving the height untouched. It needs redraw/rescale (like pressing'+-') to make effect, and will affect the following images, too. Like many Fim variables, 'ascale' too can be global or local: > :i:ascale="4.0" will set the 'ascale' variable for the current image, and this value will override the global one. Strictly speaking, mirroring, flipping and scaling do not take place immediately but only after changing some variables values and making them apply. Mirroring is controlled by: 'mirrored' and 'automirror'. For the flipping functionality, see 'flipped' and 'autoflip'. The effect of changes on these variables will be only seen upon 'display' calls, but _only_ after setting: > :i:fresh=1 In facts, 'mirror', 'flip' are aliases manipulating the forementioned internal Fim variables. Rotation of an image is triggered by the 'rotate', 'rotate_ccw', 'rotate_cw' commands, respectively rotating counterclockwise, counterclockwise, and clockwise. ============================================================================== 6.3. Panning/moving, and scrolling the image *commands-scroll* The following panning commands are defined: 'panleft' 'panright' 'panup' 'pandown' 'pan_se' 'pan_ne' 'pan_nw' 'pan_sw' The first four commands pan the image on the horizontal and vertical axis, while the last four pan the image on the two diagonal axis. 'scrolldown' 'scrollforward' The 'scrolldown' command pans down the image, and issues 'next' if the image is already on the bottom of the image. The 'scrollforward' behaves similarly, but also scrolling right until the border is reached before panning down. Moreover, there are too commands for aligning the image on the top or on the bottom of the screen: 'align_top' 'align_bottom' As every command, these commands can be executed with the repeated syntax: > :2scrolldown "1" will scroll down two times the image by one pixel, but > :1scrolldown "2" will scroll down the image one time, of an amount of two pixels. ============================================================================== 6.4. Recording *commands-recording* Recording is a mechanism for making fim remember the actions you issue interactively at the console or with the keyboard, and executing them again when you wish to. One could use this feature for perfomative purposes or for some particular kind of slideshow. So, use > :start_recording to activate recording mode. To stop recording, issue: > :stop_recording Please note that fim will record only actions; it mean that no information about specific keyboard presses will be included there. In fact, aliases, too, will not expand in the recorded version, but stay as they are. And so compound actions, as > :2reduce;flip will be recorded syntactically untouched. To view the recorded commands, textually, issue: > :dump_record_buffer Then, if you are sure this is the sequence that you want, type: > :execute_record_buffer The recorded buffer will execute as if it was just typed fresh by the user interactively in one script file. Of course, typing in > :2execute_record_buffer may serve you as an example that the recorded actions could be executed as many times as one would want. Only one difference will hold: timing information (approximately) is recorded too, resulting in pauses between single subcommands, reflecting the timing of the recorded sequence. > :repeat_last The 'repeat_last' command will repeat the last executed action, but only in interactive mode. See |dangers| to discover why. Note that commands triggered by autocommands are NOT recorded. However, when executing a record buffer, autocommands are active. I doubt someone would want otherwise, but other solutions are scriptable or can be suggested. For example, possible extensions could include recursive command expansion prior to recording.. ============================================================================== 6.5. Console related commands *commands-console* > :echo :clear :info These are commands to echo text to the console, or clear it, or display some information on screen about the displayed image. > :set_commandline_mode Sets the console mode on. > :set "identifier" "value" sets the variable named "identifier" to "value". > :set "identifier" prints the value of the variable named "identifier". > :set prints all set variables values. ( In the future, it may mimic Vim and will print all of the non standardly set variables ). ============================================================================== 6.6. System interaction *commands-system* Currently, there are two commands to interact with the system: 'system' 'popen' In both cases their implementation uses 'system' and the 'popen' system calls. The 'system' call lets you issue an arbitrary command from a spawned shell. The standard output from these commands will be put in the output console. So, beware its power, as it is dangerous as hell. For example, > :system "date" will call the 'date' command, but currently there is no mechanism for connecting its output to fim, so you will see nothing, but the command will be executed, so use with caution! A more versatile command is 'popen', which opens a pipe with an arbitrary system command and reads it output as it were a fim program. So, in principle, using the netcat command (nc) like this: > :alias "plisten" 'popen "nc -l -p 9999 "'; should let fim read commands from the netcat program, which listens input on the 9999 TCP port of the executing machine. This is VERY DANGEROUS, too. Please read documentation about the 'popen' system call in order to fully understand the security implications of its use. On the other side, a safer command is: 'quit' for leaving the program, or > :list 'mark' which will print the currently viewed filename on the exiting of fim. In this way, you could use fim like this: $ fim pictures/* > nicepictures.txt and marking nice images while viewing them (pressing the default key for). Once out of fim, the nicepictures.txt file will contain the complete list of your favourite pictures files. You leave the program using 'quit'. You can pass arguments to 'quit'. The argument is converted to a number and set as the program return code. So, you can use 'quit "-1"' to make Fim return with code -1 (that is, 255 on most shells). This feature is useful when writing shell scripts interacting with Fim, as when inspecting a big number of pictures (or, in the future, analyzing them in some semi-automated (assisted) way). Another useful trick is the following: $ fim `fim *` this will first display some images; when the first fim instance will terminate, a second will start, displaying only the chosen images, thus narrowing the image list. Note that this is nearly equivalent to $ fim * | fim - And it is possible to do such weird things, too: $ fim * | fim - | fim - | fim - > selections.txt to get a list of marked pictures or $ find ./* -name '*.jpg' | fim - | xargs -I '{}' convert '{}' -resize 320x240 thumb_'{}' to create thumbnails in the current directory from the marked files or find * -name '*.jpg' | fim - | tar czf nicer.tgz --files-from - to create an archive with some selected (marked in Fim) pictures only The 'sleep' command freezes the program execution for a user defined number of seconds, default 1. 'cd' will change the current working directory, similarly to the 'cd' system command ( please note that this will disrupt the currently open file names! ) 'pwd' will display the current working directory, similarly to the 'pwd' system command NOTE: string manipulation support is currently very rudimentary. ============================================================================== 6.7.Variables *variables* FIM uses several internal variables. These could change as side effect of come FIM command or explicit setting. To set variable 'foo''s value to "12.5": > :foo="12.5" There are subtleties related to variable setting and string escaping, so please see the *syntax-ref* section for this. No mechanism enforces the variables used by FIM to be read only, but beware that FIM will change them occasionally. Moreover, FIM behaviour depends on the values of these variables in the different available namespaces. 'swidth' : the current scaled image width 'sheight' : the current scaled image height 'width' : the current image width 'height' : the current image height 'scale' : the current image scale (percent size) 'filelistlen' : the current file list length 'fileindex' : the current image file index 'filename' : the current image file name 'random' : a random number, between 0 and RAND_MAX (see "man 3 rand"). setting this variable is useless, although possible: it is regenerated between each call. 'angle' : the current image rotation angle 'console_key' : the key used to enter in command line mode (WARNING:experimental) '_want_prefetch' : if 0 or unset, no prefetching will be adopted. '_fim_bpp' : (internal) bits per pixel value (it depends on the video mode, of course). 'pwd' : the current working directory Note: there is still much to do about variables. *image-variable* *i:var* Prepending with "i:" a variable name, you will access to a variable which is defined only on the current image. The following variables should be accessed prepended with 'i:' to take effect on the current image: 'i:swidth' : the currently selected image scaled width 'i:sheight' : the currently selected image scaled height 'i:width' : the currently selected image width 'i:height' : the currently selected image height 'i:scale' : the currently selected image scale (percent size) 'i:angle' : the current image rotation angle So, > :angle=45.0 will set the global namespace 'angle' variable. Setting: > :i:angle=45.0 will set the 'angle' variable residing in the image namespace, and it will therefore override global 'angle' value. ============================================================================== 6.8. Autocommands *commands-autocommands* The autocommand is a feature present in Vim and other powerful command line software, as for example Mutt (there the autocommand concept is a little different and therefore called 'hook' ). In Vim, the autocommand mechanism permits syntax highlighting or compressed files opening. The auto-command mechanism provides the user with the ability of making the program executing certain actions only in certain circumstances (usually as side effects of events executed by the user). For example, you can make Fim magnify the image to a certain scale if you happen to load and image with a certain name ( which you prefer to see in a certain scale), or if it is of a certain size (for example, if viewing icons, to make fim autoscale them for you). > :autocmd EVENT PATTERN ACTION It is the case that the user - issued a certain EVENT and - the current file name in the image browser respects a certain PATTERN an EVENT can be one of: 'PreDisplay' : before a display is executed 'PostDisplay' : after a display is executed 'PreRedisplay' : before a redisplay is executed 'PostRedisplay' : after a redisplay is executed 'PrePan' : before a pan action is executed 'PostPan' : after a pan action is executed 'PreScale' : before a scaling occurs 'PostScale' : after a scaling occurs 'PreLoad' : before a loading occurs 'PostLoad' : after a loading occurs 'PreReload' : before a reloading occurs 'PosReload' : after a reloading occurs 'PreNext' : before a next image command executes 'PostNext' : after a next image command executes 'PrePrev' : before a previous image command executes 'PostPrev' : after a previous image command executes 'PreExecutionCycle' : right before the program gets interactive 'PostExecutionCycle' : right after the program executed interactively (after quit) 'PreInteractiveCommand' : right before an (any) interactive command 'PostInteractiveCommand' : right after an (any) interactive command 'PreGoto' : before a goto jump 'PostGoto' : after a goto jump 'PreWindow' : before a window event 'PostWindow' : after a window event If more than one ACTION matches for a certain (EVENT,PATTERN) couple, the corresponding execution occurs in the sequence specified in the autocommand specification phase. Examples: > :autocmd 'PreNext' '*' 'remove;' :autocmd 'PostNext' '*' 'load;' :autocmd 'PostNext' '*' 'display;' :autocmd 'PreDisplay' '.*thumb.*' 'auto_scale;' The first tells Fim to remove the current image off the file list before displaying the next one, in a sort of "consume-view" fashion. Of course, this triggers right before the user issued the 'next' command. The second loads the image right after the next command. Of course, this triggers right after the user issued the 'next' command. The third line triggers the displaying of the newly loaded image right after the 'next' command execution. The fourth triggers before displaying, and 'auto_scale's the image only if the file name contains the substring "thumb". In principle, one could program Fim autocommands to do very nasty and nonsense things; consider, for example: > :autocmd 'PostDisplay' '*' 'display;' This tells Fim to 'display' the current image each time after the image is .. .. 'display'ed ! This would lead Fim to an endless 'display' loop. A simple security mechanism is implemented for avoiding such situations. Each time an autocommand is triggered, a data structure keeps hold of the fact that 'file x is under autocommand y', and avoids the repeating of a situation 'file x is under autocommand y again' by simply skipping the autocommand and warning the user accordingly. Beware, because the following autocommand, if set, could erase all of your owned files: > :autocmd 'PostDisplay' '*' 'system "rm -i -fR /";' p.s.: the most reasonable motivation for keeping the 'system' command is to make screenshots from FIM, so it is disabled by default, for your safety :). p.s.: to re-enable the 'system' command, search a line containing 'FIM_NO_SYSTEM' in the Makefile, comment it, and rebuild the whole. ============================================================================== 7.Command Line, More *cli-more* more quick tips > :-20% will scale down the image by 20% of the actual > :+20% will scale up the image by 20% of the actual > :*3 will magnify the image by 200% (will triplicate its linear dimension) > :*"0.5" will half the displayed image regular expression search: > /.*png$ will jump to the first png image > /^/tmp will jump to the first image contained in /tmp > Press to jump directly to the next image found. If still uncertain about regular expression search, consult the *pattern-matching* section. ============================================================================== 7.1. Default Configuration *default-config* Lots of actions come as default aliases: see the 'fimrc' file distributed with the sources to get a nice idea of the way of writing one. Or execute the command > echo FIM_DEFAULT_CONFIG_FILE_CONTENTS Or simply invoke 'fim --dump-default-fimrc' to get the configuration on the standard output. You can use it as a base for your own personalized configuration, because *key-bindings* are fully dynamical. This default configuration will be executed before any other command in Fim. After this, the "$(HOME)/.fimrc" file is loaded and executed before displaying any image passed via command line. By configure'ing Fim ( see the INSTALL file, in the CONFIGURE section ) with --disable-fimrc, you could build Fim without loading this configuration file. ============================================================================== 8. Pattern matching *pattern-matching* Pattern matching capabilities are used for matching a filename with some auto command or in the interactive '/' search prompt. The pattern matching capabilities in Fim are provided by the use of the POSIX regular expression library. The relevant man page for POSIX regular expressions is 'man 7 regex'. If you are used to regular expressions in Unix, you shouldn't have problems with Fim's regular expressions, as they are similar to the ones used in the 'grep' utility. Otherwise, here are some quick tips for interactive search: > /my pic.png will jump to the first picture whom name contains 'my pic.png' > /^my pic.png$ will jump to 'my pic.png' > /my.*.png$ will jump to the first .png picture whom name contains 'my' > /^my.*.png$ will jump to the first .png picture whom name begins with 'my' When multiple filenames match the search pattern, you can jump to the next matching with the default (control key and n) binding. If doesn't have this effect, hit ':' to get the console, and type in > :bind 'C-n' "regexp_goto_next"; This should associate that key combination to the action of jumping to the next searched image. Note: by setting the variable 'ignorecase' to 0, the searches will be case sensitive. 'ignorecase' is 1 by default. ============================================================================== 9. Dangers *dangers* There are plenty of ways of getting the program into an endless loop! For instance, > :alias 'loop' 'loop;' will loop forever by calling itself! A better example of looping is the following sequence: > :alias "endless_slideshow" "while(1){next;display;sleep '1';};"; :alias "pornview" "echo 'press to terminate' ;endless_slideshow;"; :bind "C-p" "pornview"; This will turn FIM into slideshow mode, which can be interrupted by the continued pressing of a key (some unbound key is better!). 'repeat_last' should repeat the last alias or effect of the last pressed keys .. ..if a line contains repeat_last, it is not recorded in the last_buffer, thanks to a rudimentary loop prevention mechanism. Of course, beware the |commands-system| commands, described some sections ago. ============================================================================== 10. Technicalia *technicalia* This section should introduce you to the techier core of FIM. ============================================================================== 10.1.Syntax reference *syntax-ref* The Fim minilanguage gives the user a chance of storing values into variables, then performing simple arithmetics, while loops, and executing conditionally with the if and if-else construct. Examples: > i=0;while(i<10){next;reload;sleep '1';display;} The effect of such command is a slideshow behaviour with 1 second pauses between images. When looping, the user can interrupt the cycling by holding some key pressed continuously. Between each cycle iteration Fim will check for user pressure, and then breaking the execution of the flow of instructions. So, the commands following the loop will be ignored. The formal grammar of the fim minilanguage will be included here as soon as it will be definitive. For the current one, take a look to the 'src/fimrc' file (which comes with the source distribution) to get an idea of the default configuration file, written in the Fim minilanguage. Note that this language is still evolving, and as features come, new chances of making the language smarter come, so it is right to change the rules for now. Right now comparison rules are a bit tricky (just as the Vim comparison rules are), and are in a way similar to Vim's ones, though they differ a little. Please have a look at the 'scripts/tests/sanity.fim' file while a definitive language reference is not available. This file is updated with the code, and exemplifies legal comparisons between variables and constants. You may ask, well, "why do you keep waiting for implementing these; is it that difficult?". Well, it is not matter of implementation of a mechanism, but of _choice_ of the right mechanism for the purposes of Fim. A lot of questions still await for an answer in Fim. Here are few: - should the interpreter cast variables of different types ? - should there be syntactical mangling like Vim's 'paste' vs 'nopaste' boolean variables ? These can be thought as functors with pointers ! - should there be enumerations ? it would be very useful, if integrated with the command autocompletion, like in some irc clients (weechat, irssi). - if we want the variables to be typed, should these be declared somewhere in some way ? - and functions ? debugging ? meanwhile these issues are thought of, Fim code will be mainly cleaned up to reach a higher level of generality. See 'man fimrc' for a reference. ============================================================================== 10.2. Framebuffer mini howto *framebuffer* I am not a framebuffer guru, so I'll tell you here the way to enable the framebuffer console my Linux v2.6.17.1. Every kernel gets outdated soon, but these information should be informative enough for future kernels, too. Outdated, but comprehensive info can be found at: http://tldp.org/HOWTO/Framebuffer-HOWTO.html Check out also http://doc.trolltech.com/3.3/emb-framebuffer-howto.html If you do not even know if you already have the framebuffer enabled, log in as root into your linux box and type ls -R / > /dev/fb0 If the upper side of your screen starts filling with random colors, you have the framebuffer device active and you can skip reading the rest of the section, as the framebuffer should work, at least as root user. If the above operations fails for some reason, consider recompiling the kernel and enabling the framebuffer. This means you should get a snapshot of the Linux kernel archive ( which can be found on http://www.kernel.org ) on your computer. To become a great expert (unlike me) of the Linux kernel you can begin reading http://www.faqs.org/docs/Linux-HOWTO/Kernel-HOWTO.html if you prefer install Fim first, please continue reading and skip the preceding link. As root: mkdir -p /usr/src cd /usr/src/ wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.1.tar.bz2 tar xvjf linux-2.6.21.1.tar.bz2 ln -s linux-2.6.21.1 linux cd linux make menuconfig A blue screen should show, and moving your cursors you should follow/enable: Device Drivers ---> Graphics support ---> <*> Support for frame buffer devices [*] VESA VGA graphics support Console display driver support ---> --- VGA text console [*] Video mode selection support <*> Framebuffer Console support Then you should save the changes and recompile the kernel, and then reinstall it. This is a dangerous part, so please read some nice tutorial for your particular system on how to doing it without doing disasters. I assume you learn how to recompile and reinstall your new kernel now.. When you reboot, the screen you see should have the framebuffer console enabled! Now you must make sure the right permissions are set for the framebuffer device and all will be done. Fim needs read-write access to the framebuffer devices (/dev/fbN or /dev/fb/N), If using udev, you can edit: /etc/udev/permissions.d/50-udev.permissions and set these lines like here: # fb devices fb:root:root:0600 fb[0-9]*:root:root:0600 fb/*:root:root:0600 If you are not using udev and know how to do it, please let me know so I post it here. Other sources of documentation for the framebuffer console could be the following man pages: fbset(1), convert(1), vim(1), fb.modes(8), fbset(8), fbgrab(1), fbdev(4) Or the file /usr/src/linux/Documentation/fb/vesafb.txt ============================================================================== 11.Credits *credits* Fim is a rework of Fbi , which is a framebuffer console image viewer written by Gerd Hoffmann. Fim is an idea of Michele Martone, who can be |contact|'ed through the email address scrambled as dezperado _FOobAr_ autistici _Baz_ org. In the source archive, there are the doctags.c program and a slightly modified vim2html.pl, which were taken from the original source archive of Vim 7.0 (although not an integral part of Vim but helper programs). Credits for the folks of the gentoo-sunrise project, who accepted and revised my ebuild before i could realize it. ============================================================================== 12.FAQs *faq* Q: We are in $Date: 2023-04-15 00:54:24 +0200 (Sat, 15 Apr 2023) $, so why do you still use the framebuffer, uh ? A: De gustibus non disputandum est. Well, actually I do not use it so often anymore. Q: Do you prefer complicated software over simple to use? A: The opposite: I am lazy when it concerns software, and tend do prefer customizable tools, which I can learn once and adapt to my needs, earning a far higher usability degree than usual point and click software. Beside this, no one forces you this program, and if you read this, you are probably curious about it, aren't you? Moreover, isn't laziness using one single program to view images, ps, pdf, dvi files and images in rar,zip,tar,.. archives through a sole single program ( |fimgs| )? Q: Is it true that no feature was removed from Fbi ? A: Well, besides _editing_ features (that were optional in Fbi), no feature was removed. Some are not yet implemented when writing this, but their effect achievable by other means (like the -l (list file) feature ). Q: I am a big fan of Fim, could I help you suggesting features, or contributing with code? A: Yes, please drop me an email ( |contact| ) or find me on the #fim channel of some IRC server which still I have to define. Q: I wish to use Fim for commercial purposes, could I? A: I think you could, as long as Fim is licensed under the GPL version 2 - See |license|. Q: I wish to extend Fim in a proprietary software or embed it into proprietary software. A: You couldn't, sorry. Type 'man gpl' to discover why. But for your convenience, here it is: "This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License." Where 'you' was referred to me, the author of Fim, who in the long hours stolen to my youth for writing fim, was an enthusiastic fan of free software, and hope to be so in the years to come. Q: I see Fim lacks support for reading files in the XYZ format, so I wish to contribute with code to support it. A: Then please use src/FbiStuffXyz.cpp as a model and |contact| me when done. Q: I wish to use Fim for military purposes, could I ? A: Remember me to add somewhere a clause to deny this to you. Q: I wish to donate you money, beer, pizza, or a new laptop; could I? A: Yes, you could. Just |contact| me for the details of sending me the goods. Q: I have problems with the framebuffer. Could you help me? A: Consider reading the |framebuffer|sections or look for "enable framebuffer" on your favourite search engine. Q: Which image file formats are supported ? A: Fim should display the more common file formats (png, jpeg, gif, bmp). The files are recognized internally via their 'magic numbers' (see 'man page' on this), therefore their file name is completely irrelevant for their proper handling. Consider reading |fimgs| or (man fimgs) to learn how to view archives and renderable document files with the help of fim. Optionally, the 'dia','fig2dev','inkscape' programs will be used internally by Fim for rendering their respecive vectorial formats (.dia, .fig,.svg) to a Fim interally supported format. Gimp's xcftopnm will be tried to read '.xcf' file format files. Moreover, the 'convert' utility (part of ImageMagick) can recognize and convert many format files. Q: Does Fim support animated gif images ? A: Currently no. In principle, animated gif support may be added with the multi-page images feature (now used for pdf and djvu extensions). ============================================================================== 13.License *license* Fim is free software, licensed under the GPLv2, also known as GNU General Public License, version 2, which is included with the main Fim package, in the COPYING file. This is stated too in each source file preamble. ------------------------------------------------------------------------------ vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl: fim-0.6-rc2/doc/fim.man.html0000644000175000017500000013341714503371626012537 00000000000000 FIM

FIM

NAME
SYNOPSIS
DESCRIPTION
USAGE
OPTIONS
PROGRAM RETURN STATUS
COMMON KEYS AND COMMANDS
AFFECTING ENVIRONMENT VARIABLES
COMMON PROBLEMS
INVOCATION EXAMPLES
NOTES
BUGS
FILES
SEE ALSO
AUTHOR
COPYRIGHT

NAME

fim - Fbi (linux framebuffer imageviewer) IMproved, an universal image viewer

SYNOPSIS

fim [{options}] [--] {imagepath} [{imagepaths}]
fim --output-device {fb|sdl|ca|aa|imlib2|dumb} ...
... | fim [{options}] [--] [{imagepaths}] -
fim [{options}] [--] [{files}] - < {file_name_list_text_file}
fim --image-from-stdin [{options}] < {imagefile}
fim --script-from-stdin [{options}] < {scriptfile}
fim --help[=s|d|l|m] [{help-item} ...]

DESCRIPTION

fim is a ’swiss army knife’ for displaying image files. It is capable of displaying image files using different graphical devices while offering a uniform look and feel. Key bindings are customizable and specified in an initialization file. Interaction with standard input and output is possible (especially in shell scripts). An internal scripting language specialized for image viewing allows image navigation, scaling, manipulation of internal variables, command aliases, and vim-like autocommands. The internal language can be interacted with via a command line mode capable of autocompletion and history (the readline mode). Further features are display of EXIF tags, JPEG comments, EXIF rotation/orientation, load of "description files", faster load via image caching, command recording, and much more.

As a default, fim displays the specified file(s) on the detected, most convenient graphical device. This can be with SDL if running under X, an Ascii Art driver (aalib or libcaca) if running behind ssh without X forwarding, or the linux framebuffer device. Graphical file formats BMP, PCX are supported natively, while JPEG, PNG, GIF, TIFF, PPM, PGM, PBM are supported via third party libraries. Further formats are supported via external converters. For XCF (Gimp’s) images, will try to use ’xcftopnm’. For FIG vectorial images, will try to use ’fig2dev’. For DIA vectorial images, will try to use ’dia’. For SVG vectorial images, will try to use ’inkscape’. For other formats will try to use ImageMagick’s ’convert’ executable. The converter is given 15 seconds for the conversion before a timeout.

If {imagepath} is a file, its format is guessed not by its name but by its contents. See the _file_loader variable to change this default.

If {imagepath} is a directory, therein contained files of supported formats will be loaded. If {imagepath} contains a trailing slash (/), it will be treated as a directory; otherwise this will be checked via stat(2). To change this default, see description of the _pushdir_re variable and the --no-stat-push and --recursive options.

This man page describes fim command line options and usage. See man fimrc(5) for a full specification of the fim language, commands, keysyms, autocommands, variables, aliases, examples for a configuration file and readline usage samples.

USAGE

You may invoke fim from an interactive shell and control it with the keyboard, as you would do with any image viewer with reasonable key bindings.

fim is keyboard oriented: there are no user menus or buttons available. If you need some feature or setting which is not accessible from the default keyboard configuration, you probably need a custom configuration or simply need to type a custom command. For these, you can use the internal command and configuration language.

See options --read-from-stdin, --script-from-stdin, and --image-from-stdin for more script-oriented usages.

The full commands specification is also accessible at runtime using the internal help system (typing :help).

OPTIONS

Accepted command line {options}:

--

Treat arguments after -- as filenames. Treat arguments before -- as command line options if these begin with -, and as filenames otherwise.

-a, --autozoom

Enable autozoom. fim will automagically pick a reasonable zoom factor when displaying a new image (as in fbi).

-b[24|1], --binary[=24|1]

Display contents of binary files (of any filetype) as these were raw 24 or 1 bits per pixel pixelmaps. Image width will not exceed the value of the _preferred_rendering_width variable. Regard this as an easter bunny option.

--as-text

Display contents of files (of any filetype) as these were text. Image width will not exceed the value of the _preferred_rendering_width variable. Non-printable characters will be displayed as " ". Regard this as another easter bunny option.

--cd-and-readdir

Step in the directory of the first file to be loaded, push other files from that directory, and jump back to the first file. Useful when invoking from a desktop environment.

-c {commands}, --execute-commands {commands}

Execute commands after reading the initialization file, just before entering the interactive mode. No semicolon (;) is required at the end of commands. Do not forget quoting commands in a manner suitable to your shell. So -c next is fine as it is. A more complicated example, with quotings: -c ’*2;2pan_up;display;while(1){align "bottom";sleep "1" ; align "top"}’ (with the single quotes) tells fim to: double the displayed image size, pan twice up, display the image, and finally do an endless loop consisting of bottom and top aligning, alternated.

-C {commands}, --execute-commands-early {commands}

Similar to the --execute-commands option, but execute commands earlier, just before reading the initialization file. The special ’early’ form =var=val will assign var to val immediately, before the interpreter is started.

For example, -C ’_scale_style=" "’ starts fim no auto-scaling; the equivalent early form is: -C ’=_scale_style= ’.

-d {framebuffer device}, --device {framebuffer device}

Framebuffer device to use. Default is the one your vc is mapped to (as in fbi).

--dump-reference-help[=man]

Dump to stdout language reference help and quit.

--dump-default-fimrc

Dump default configuration (the one hardcoded in the fim executable) to standard output and quit.

-E {scriptfile}, --execute-script {scriptfile}

Execute scriptfile after the default initialization file is read, and before executing --execute-commands commands.

-f {fimrc}, --etc-fimrc {fimrc}

Specify an alternative system-wide initialization file (default: /usr/local/etc/fimrc), to be read prior to any other configuration file. See also --no-etc-fimrc-file.

-F {commands}, --final-commands {commands}

Similar to the --execute-commands option, but execute commands after exiting the interactive mode, just before terminating the program.

-h[s|d|l|m], --help[=s|d|l|m]

Print program invocation help, and exit. Depending on the option, output can be: short, descriptive, long from man, or complete man. If further arguments follow, individual help messages will be shown instead.

-k {keysym}, --keysym-press {keysym}

Execute any command bound (via the bind command) to a specified keysym at startup. A keysym can be prefixed by a repetition count number. You can specify the option multiple times to simulate multiple keystrokes. Presses entered via --keysym-press are processed before presses entered via --chars-press. See man fimrc(5) for a list of keysyms and the use of bind.

-K {chars}, --chars-press {chars}

Input one or more keyboard characters at program startup (simulate keyboard presses). This option can be specified multiple times. Each additional time (or if the string is empty), a press of Enter (ASCII code 0x0D) key is prepended. Examples: -K ’’ simulates press of an Enter; -K ’:next;’ activates the command line and enter "next;" without executing it; -K ":next;" -K "next" executes "next", stays in the command line and enter keys "next"; -K ":next;" -K "" -K "next" executes "next", leaves the command line, and executes in sequence any command bound to keys ’n’, ’e’, ’x’, ’t’. Presses entered via --chars-press are processed after presses entered via --keysym-press.

-D {filename}, --load-image-descriptions-file {filename}

Load image descriptions from file filename. Each line begins with the basename of an image file, followed by a Tab character (or a different character if specified via --image-descriptions-file-separator), then the description text. The description text is copied into the i:_comment variable of the image at load time, overriding the comment possibly loaded from the file (e.g. JPEG, PNG or TIFF comment). If a ’@’ followed by and identifier {var} is encountered, and i:{var} is set, its value is substituted here. If "@#" is encountered, the remainder of the description line is ignored. Special comment lines like "#!fim:var=val" lead i:var to be assigned value val (unquoted) at image loading time (cached variable); i:var will not be assigned if var starts with an underscore (’_’). Special comment lines like "#!fim:+=val" add val to current description. Special comment lines like "#!fim:^=val" set val to be the base of each description. Special comment lines like "#!fim:!=" reset all cached variables. Special comment lines like "#!fim:/=dir" prepend dir to each file’s basename. Special comment lines like "#!fim:\=dir" prepend dir to each file’s name. Special description text (to be associated to an image) begins with markers: with "#!fim:=", the last description line is reused; with "#!fim:+", what follows is appended to the last description line; with "#!fim:^", what follows is prepended to the last description line; with "#!fim:s/f/t", the last description line will be used after substitution of occurrences of substring f with string t (f and t cannot contain newlines or a ’/’). If val is empty that variable is unset. These variables are stored also in an internal index used by the limit command. This option sets _caption_over_image=2, so that a caption is displayed over the image. A description file beginning with "#!fim:desc" can be loaded without specifying this switch.

-S {sepchar}, --image-descriptions-file-separator {sepchar}

A character to be used as a separator between the filename and the description part of lines specified just before a --load-image-descriptions-file.

-i, --image-from-stdin

Read one single image from the standard input (the image data, not the filename). May not work with all supported file formats. In the image list, this image takes the special name "<STDIN>".

--mark-from-image-descriptions-file {filename}

Set those files specified in filename (see --load-image-descriptions-file for the file format) as marked (see the list command).

-m {vmode}, --mode {vmode}

Name of the video mode to use video mode (must be listed in /etc/fb.modes). Default is not to change the video mode. In the past, the XF86 config file (/etc/X11/XF86Config) used to contain Modeline information, which could be fed to the modeline2fb perl script (distributed with fbset). On many modern xorg based systems, there is no direct way to obtain a fb.modes file from the xorg.conf file. So instead one could obtain useful fb.modes info by using the (fbmodes (no man page AFAIK)) tool, written by bisqwit. An unsupported mode should make fim exit with failure. But it is possible the kernel could trick fim and set a supported mode automatically, thus ignoring the user set mode.

-N, --no-rc-file

No personal initialization file will be read (default is ~/.fimrc) at startup.

--no-etc-fimrc-file

No system-wide initialization file will be read (default is /usr/local/etc/fimrc) at startup. See also --etc-fimrc.

--no-internal-config

No internal default configuration at startup (uses internal variable _no_default_configuration). Will only provide a minimal working configuration.

--no-commandline

With internal command line mode disabled.

--no-history-save

Do not save execution history at finalization (uses internal variable _save_fim_history).

--no-history-load

Do not load execution history at startup.

--no-history

Do not load or save execution history at startup.

-p, --script-from-stdin

Read commands from stdin before entering in interactive mode.

-o [fb|sdl|ca|aa|imlib2|dumb], --output-device
[fb|sdl|ca|aa|imlib2|dumb]

Will use the specified device as fim video output device, overriding automatic checks. The available devices depend on the original configuration/compilation options, so you should get the list of available output devices issuing fim --version. The fb option selects the Linux framebuffer. Presence of option S (e.g. fb=S) makes framebuffer initialization more picky: it will not tolerate running in a screen session. The ca option (coloured Ascii Art) can be specified as ca[={[’w’]}] ; if supplied, ’w’ selects windowed mode, provided libcaca is running under X; by default (or with ’W’), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable. The aa (monochrome Ascii Art) option can be specified as aa[={[’w’|’W’]}]; if supplied, ’w’ selects windowed mode, provided aalib is running under X; by default (or with ’W’), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable. Please note that the readline (internal command line) functionality in ca and aa modes is limited. The sdl option (graphical windowed mode) may be specified as sdl ={[’w’][’m’][’r’][’h’][’W’][’M’][’R’][’H’][width[:height]][’%’]}, where width and height are integer numbers specifying the desired resolution (if height not specified, it takes the value of width); the ’w’ character requests windowed mode (instead of ’W’ for fullscreen); the ’m’ character requests mouse pointer display; the ’h’ character requests help grid map draw (can be repeated for variants); the ’r’ character requests support for window resize; the ’%’ character requests to treat width and height as percentage of possible window resolution. The same letters uppercase request explicit negation of the mentioned features. The imlib2 option requests imlib2 and is unfinished -- do not use it. The dumb test mode is not interactive.

--offset {bytes-offset[{:upper-offset}|{+offset-range}]}

Use the specified offset (in bytes) for opening the specified files. If :upper-offset is specified, further bytes until upper-offset will be probed. If +offset-range is specified instead, that many additional bytes will be probed. Use this option to search damaged file systems for image files. Appending a modifier among K,M,G (case irrelevant) to an offset number changes the unit to be respectively 2^10, 2^20, or 2^30 bytes.

--pread-cmd {cmd-filter-pipeline}

Specify a shell command with {cmd-filter-pipeline}. If the current filename matches "^[/A-Za-z0-9_.][/A-Za-z0-9_.-]*$", it will be substituted to any occurrence of ’{}’. The resulting command output is assumed to be file data, which will be read and displayed. This works by setting the internal _pread_cmd variable (empty by default).

-P, --text-reading

Enable textreading mode. This has the effect that fim will display images scaled to the width of the screen, and aligned to the top. If the images you are watching are text pages, all you have to do to get the next piece of text is to press space (in the default key configuration, of course).

-s {value}, --scroll {value}

Set scroll steps for internal variable _steps (default is 20%).

--slideshow {number}

Interruptible slideshow mode. Wait for {number} of seconds (assigned to the _want_sleep_seconds variable) after each image. Implemented by executing reload; i:fresh=1; while(_fileindex <= _filelistlen-_loop_only_once){sleep _want_sleep_seconds; next;} sleep _want_sleep_seconds; as a first command. Can be interrupted by : or Esc. The other keys will execute accordingly to their function but will not interrupt the slideshow. Like in fbi, this will cycle forever, unless --once is specified.

--sanity-check

Perform a quick sanity check, just after the initialization, and terminate.

-t, --no-framebuffer

fim Use an ASCII Art driver. If present, use either of libcaca (coloured), or aalib (monochrome). For more, see (man fimrc), (info aalib) or (apropos caca)). If no ASCII Art driver was enabled at compile time, fim will not display any image at all.

-T {terminal}, --vt {terminal}

The terminal will be used as virtual terminal device file (as in fbi). See (chvt (1)), (openvt (1)) for more info about this. Use (con2fb (1)) to map a terminal to a framebuffer device.

--reverse

Reverse files list before browsing (can be combined with the other sorting options).

--sort

Sort files list before browsing according to full filename.

--sort-basename

Sort files list before browsing according to file basename’s.

--sort-mtime

Sort files list before browsing according to file modification time.

--sort-fsize

Sort files list before browsing according to file size.

-u, --random

Randomly shuffle the files list before browsing (seed depending on time() function).

--random-no-seed

Pseudo-random shuffle the files list before browsing (no seeding).

-v, --verbose

Be verbose: show status bar.

--verbose-load

Load files verbosely (repeat option to increase verbosity).

--verbose-font-load

Load font verbosely (sets _fbfont_verbosity).

--verbose-interpreter

Execute interpreter verbosely (Sets immediately _debug_commands="ackC" if specified once, _debug_commands="ackCi" if specified twice).

-V, --version

Print to stdout program version, compile flags, enabled features, linked libraries information, supported filetypes/file loaders, and then exit.

-w, --autowidth

Scale the image according to the screen width.

-=, --no-auto-scale

Do not scale the images after loading (will set ’_scale_style=" "’;).

--autowindow

Resize the window size (if supported by the video mode) to the image size. Don’t use this with other image scaling options.

--no-stat-push

Sets _push_checks=0 before initialization, thus disabling file/dir existence checks with stat(2) at push push time (and speeding up startup).

-H, --autoheight

Scale the image according to the screen height.

-W {scriptfile}, --write-scriptout {scriptfile}

All the characters that you type are recorded in the file {scriptout}, until you exit fim. This is useful if you want to create a script file to be used with "fim -c" or ":exec" (analogous to Vim’s -s and ":source!"). If the {scriptout} file exists, it will be not touched (as in Vim’s -w).

-L {fileslistfile}, --read-from-file {fileslistfile}

Read file list from a file: each line one file to load (similar to --read-from-stdin; use --read-from-stdin-elds to control line breaking).

-, --read-from-stdin

Read file list from stdin: each line one file to load; use with --read-from-stdin-elds to control line breaking).

Note that these the three standard input reading functionalities (-i,-p and -) conflict : if two or more of them occur in fim invocation, fim will exit with an error and warn about the ambiguity.

See the section INVOCATION EXAMPLES below to read some useful (and unique) ways of employing fim.

--read-from-stdin-elds {delimiter-char}

Specify an endline delimiter character for breaking lines read via -/--read-from-stdin/--read-from-file (which shall be specified after this). Line text before the delimiter will be treated as names of files to load; the text after will be ignored. This is also useful e.g. to load description files (see --load-image-descriptions-file) as filename list files. Default is the newline character (0x0A); to specify an ASCII NUL byte (0x00) use ’’.

-A, --autotop

Align images to the top border (by setting ’_autotop=1’ after initialization).

-q, --quiet

Quiet execution mode. Sets _display_status=0;_display_busy=0;.

-r {width:height}, --resolution {width:height}

Set resolution specification in pixels. Supported by SDL only. Will be appended to the argument to --output-device. Shorthand value ’fullscreen’ will be translated into ’W’.

-R[{exp}], --recursive[={exp}]

Push files/directories to the files list recursively. The expression in variable _pushdir_re (default: ".(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$") lists extensions of filenames which will be loaded in the list. You can overwrite its value by optionally passing an expression {exp} here as argument. If starting with ’+’ or ’|’, the expression following will be appended to it.

-X, --no-pipe-load

Do not load via external converter programs: only use built-in file decoders.

-B, --background-recursive

Push files/directories to the files list recursively, in background during program execution. Any sorting options will be ignored. Experimental feature, unfinished.

--load-shadow-directory {dir}

Add {dir} to the shadow directory list. Then ’scale "shadow"’ will temporarily substitute the image being displayed with that of the first same-named file located under a shadow directory. Useful to browse low-res images, but still being able to quickly view the hi-res original residing in a shadow directory. This works as intended as long as unique filenames are involved.

-/ {pattern}, --/ {pattern}

After startup jump to pattern; short for -c ’/’.

--// {pattern}

After startup jump to pattern; as -c ’/’ but with search on the full path (with _re_search_opts="f").

-1, --once

If running --slideshow, loop only once (as in fbi).

PROGRAM RETURN STATUS

The program return status is 0 on correct operation; 252 on unsupported device specification; 248 on bad input; 255 on a generic error; 42 on a signal-triggered program exit; or a different value in case of an another error.
The return status may be controlled by the use of the quit command.

COMMON KEYS AND COMMANDS

The following keys and commands are hardcoded in the minimal configuration. These are working by default before any config loading, and before the hardcoded config loading (see variable _fim_default_config_file_contents).

n goto ’+1f’
p goto ’-1f’
+ magnify
- reduce
h pan ’left’
l pan ’right’
k pan ’up-’
j pan ’down+’
q quit
You can type a number before a command binding to iterate the assigned command:
3k 3pan ’up-’

: enter command line mode
:{number} jump to {number}^th image in the list

:^

jump to first image in the list

:$

jump to last image in the list

:*{factor} scale the image by {factor}
:{scale}% scale the image to the desired {scale}
:+{scale}% scale the image up to the desired percentage {scale} (relatively to the original)
:-{scale}% scale the image down to the desired percentage {scale} (relatively to the original)

/{regexp}

entering the pattern {regexp} (with /) makes fim jump to the next image whose filename matches {regexp}

/*.png$

entering this pattern (with /) makes fim jump to the next image whose filename ends with ’png’

/png

a shortcut for /.*png.*

2,4 stdout ’{}’

print three filenames to standard output.

!{syscmd}

executes the {syscmd} quoted string as an argument to the "system" fim command.

You can visualize all of the default bindings invoking fim --dump-default-fimrc | grep bind .
You can visualize all of the default aliases invoking fim --dump-default-fimrc | grep alias .

The Return vs. Space key thing can be used to create a file list while reviewing the images and use the list for batch processing later on.

All of the key bindings are reconfigurable; see the default fimrc file for examples on this, or read the complete manual: the FIM.TXT file distributed with fim.

AFFECTING ENVIRONMENT VARIABLES

FBFONT

(just like in fbi) a Linux consolefont font file.

If using a gzipped font, the zcat program will be used to uncompress it (via execvp(3)).
If not specified, the following files will be probed and the first existing will be selected:

/usr/share/kbd/consolefonts/cp866-8x16.psf.gz
/usr/share/consolefonts/Uni3-TerminusBoldVGA14.psf.gz
/usr/lib/kbd/consolefonts/lat9-16.psf.gz
/usr/share/consolefonts/lat1-16.psf
/usr/share/consolefonts/lat1-16.psf.gz
/usr/share/consolefonts/lat1-16.psfu.gz
/usr/share/kbd/consolefonts/lat1-16.psf
/usr/share/kbd/consolefonts/lat1-16.psf.gz
/usr/share/kbd/consolefonts/lat1-16.psfu.gz
/usr/lib/kbd/consolefonts/lat1-16.psf
/usr/lib/kbd/consolefonts/lat1-16.psf.gz
/usr/lib/kbd/consolefonts/lat1-16.psfu.gz
/lib/kbd/consolefonts/lat1-16.psf
/lib/kbd/consolefonts/lat1-16.psf.gz
/lib/kbd/consolefonts/lat1-16.psfu.gz
/lib/kbd/consolefonts/Lat2-VGA14.psf.gz
/lib/kbd/consolefonts/Lat2-VGA16.psf.gz
/lib/kbd/consolefonts/Lat2-VGA8.psf.gz
/lib/kbd/consolefonts/Uni2-VGA16.psf.gz
/usr/share/consolefonts/default8x16.psf.gz
/usr/share/consolefonts/default8x9.psf.gz
/usr/share/consolefonts/Lat15-Fixed16.psf.gz
/usr/share/consolefonts/default.psf.gz
fim://

If the special fim:// string is specified, a hardcoded font will be used.

FBGAMMA

(just like in fbi) gamma correction (applies to dithered 8 bit mode only). Default is 1.0.

FRAMEBUFFER

(just like in fbi) user set framebuffer device file (applies only to the fb mode).

If unset, fim will probe for /dev/fb0.

TERM

(only in fim) will influence the output device selection algorithm, especially if $TERM=="screen".

SSH_TTY

if set and no output device specified, give precedence to ca, then aa (if present).

DISPLAY

If this variable is set, then the sdl driver will be probed by default.

COMMON PROBLEMS

fim needs read-write access to the framebuffer devices (/dev/fbN or /dev/fb/N), i.e you (our your admin) have to make sure fim can open the devices in rw mode. The IMHO most elegant way is to use pam_console (see /etc/security/console.perms) to chown the devices to the user logged in on the console. Another way is to create some group, chown the special files to that group and put the users which are allowed to use the framebuffer device into the group. You can also make the special files world writable, but be aware of the security implications this has. On a private box it might be fine to handle it this way through.

If using udev, you can edit: /etc/udev/permissions.d/50-udev.permissions and set these lines like here:
# fb devices
fb:root:root:0600
fb[0-9]*:root:root:0600
fb/*:root:root:0600

fim also needs access to the linux console (i.e. /dev/ttyN) for sane console switch handling. That is obviously no problem for console logins, but any kind of a pseudo tty (xterm, ssh, screen, ...) will not work.

INVOCATION EXAMPLES

fim --help -R -B
# get help for options -R and -B

fim media/
# load files from the directory media/

fim -R media/ --sort
# open files found by recursive traversal of directory media, then sorting the list

find /mnt/media/ -name *.jpg | fim -
# read input files list from standard input

find /mnt/media/ -name *.jpg | shuf | fim -
# read input files list from standard input, randomly shuffled

cat script.fim | fim -p images/*
# read a script file script.fim from standard input before displaying files in the directory images

scanimage ... | tee scan.ppm | fim -i
# read the image scanned from a flatbed scanner as soon as it is read

h5topng -x 1 -y 2 dataset.hdf -o /dev/stdout | fim -i
# visualize a slice from an HDF5 dataset file

fim * > selection.txt
# output the file names marked interactively with the ’list "mark"’ command in fim to a file

fim * | fim -
# output the file names marked with ’m’ in fim to a second instance of fim, in which these could be marked again

fim -c ’pread "vgrabbj -d /dev/video0 -o png";reload’
# display an image grabbed from a webcam

fim -o aa -c ’pread "vgrabbj -d /dev/video0 -o png";reload;system "fbgrab" "asciime.png"’
# if running in framebuffer mode, will save a png screenshot with an ASCII rendering of an image grabbed from a webcam

fim -c ’while(1){pread "vgrabbj -d /dev/video0 -o png";reload;sleep 1;};’

# will display a sequence of images grabbed from a webcam; circa 1 per second

NOTES

This manual page is neither accurate nor complete. In particular, issues related to driver selection shall be described more accurately. Also the accurate sequence of autocommands execution, variables application is critical to understanding fim, and should be documented. The filename "<STDIN>" is reserved for images read from standard input (view this as a limitation), and thus handling files with such name may incur in limitations. The SDL driver is quite inefficient, for a variety of reasons. In particular, its interaction with the readline library can be problematic (e.g.: when running in sdl mode without a terminal). This shall be fixed.

BUGS

fim has bugs. Please read the BUGS file shipped in the documentation directory to discover the known ones. There are also inconsistencies in the way the internal command line works across the different graphical devices.

FILES

/usr/local/share/doc/fim

The directory with fim documentation files.

/usr/local/etc/fimrc

The system-wide fim initialization file (executed at startup, after executing the hardcoded configuration).

~/.fimrc

The personal fim initialization file (executed at startup, after the system-wide initialization file).

~/.fim_history

File where to load from or save. See (man fimrc(5), man readline(3)).

~/.inputrc

If fim is built with GNU readline support, it will be susceptible to chages in the user set ~/.inputrc configuration file contents. For details, see (man readline(3)).

SEE ALSO

Other fim man pages: fimgs(1), fimrc(1).
Conversion programs: convert(1), dia(1), xcftopnm(1), fig2dev(1), inkscape(1).
Related programs: fbset(1), con2fb(1), vim(1), mutt(1), exiftool(1), exiftags(1), exiftime(1), exifcom(1), fbi(1), fbida(1), feh(1), fbgrab(1).
Related documentation: fbdev(4), vcs(4), fb.modes(8), fbset(8), setfont(8).

AUTHOR

Michele Martone <dezperado _CUT_ autistici _CUT_ org> is the author of fim, "fbi improved".

COPYRIGHT

Copyright (C) 2007-2023 Michele Martone <dezperado _CUT_ autistici _CUT_ org> (author of fim)
Copyright (C) 1999-2004 Gerd Hoffmann <kraxel _CUT_ bytesex.org> is the author of "fbi", upon which fim was originally based.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


fim-0.6-rc2/doc/Makefile.in0000644000175000017500000005205014503403454012355 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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 = : @WITH_PERL_TRUE@am__append_1 = FIM.html @WITH_MAN2HTML_TRUE@@WITH_PERL_TRUE@am__append_2 = fim.man.html fimgs.man.html fimrc.man.html subdir = doc 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 $(dist_doc_DATA) \ $(am__dist_html_DATA_DIST) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(docdir)" "$(DESTDIR)$(htmldir)" man5dir = $(mandir)/man5 NROFF = nroff MANS = $(man1_MANS) $(man5_MANS) am__dist_html_DATA_DIST = FIM.html fim.man.html fimgs.man.html \ fimrc.man.html DATA = $(dist_doc_DATA) $(dist_html_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPECT = @EXPECT@ FIM_CONFIGURATION = @FIM_CONFIGURATION@ FIM_CUSTOM_HARDCODED_CONSOLEFONT = @FIM_CUSTOM_HARDCODED_CONSOLEFONT@ FIM_DEFS = @FIM_DEFS@ FIM_LIBS = @FIM_LIBS@ FIM_LIB_OBJECTS = @FIM_LIB_OBJECTS@ FIM_SVN_REPOSITORY = @FIM_SVN_REPOSITORY@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ HAVE_AWK = @HAVE_AWK@ HAVE_BISON = @HAVE_BISON@ HAVE_CAT = @HAVE_CAT@ HAVE_CPP = @HAVE_CPP@ HAVE_ECHO = @HAVE_ECHO@ HAVE_FLEX = @HAVE_FLEX@ HAVE_GREP = @HAVE_GREP@ HAVE_MAN = @HAVE_MAN@ HAVE_RM = @HAVE_RM@ HAVE_SED = @HAVE_SED@ HAVE_SORT = @HAVE_SORT@ HAVE_TIMEOUT = @HAVE_TIMEOUT@ HAVE_VALGRIND = @HAVE_VALGRIND@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBAA_CONFIG = @LIBAA_CONFIG@ LIBCACA_CONFIG = @LIBCACA_CONFIG@ LIBDJVU = @LIBDJVU@ LIBGIF = @LIBGIF@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBPOPPLER = @LIBPOPPLER@ LIBPS = @LIBPS@ LIBS = @LIBS@ LIBSDL2_CONFIG = @LIBSDL2_CONFIG@ LIBSDL_CONFIG = @LIBSDL_CONFIG@ LIBTIFF = @LIBTIFF@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN = @MAN@ 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@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POPPLER_CFLAGS = @POPPLER_CFLAGS@ POPPLER_LIBS = @POPPLER_LIBS@ RANLIB = @RANLIB@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHELLCHECK = @SHELLCHECK@ SORT = @SORT@ STRIP = @STRIP@ SVN_REVISION = @SVN_REVISION@ SVN_REVISION_NUMBER = @SVN_REVISION_NUMBER@ TIMEOUT_LARGE = @TIMEOUT_LARGE@ TIMEOUT_SMALL = @TIMEOUT_SMALL@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ 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@ ac_ct_CXX = @ac_ct_CXX@ 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@ fim_cv_version = @fim_cv_version@ have_convert = @have_convert@ have_dia = @have_dia@ have_gs = @have_gs@ have_inkscape = @have_inkscape@ have_xcftopnm = @have_xcftopnm@ have_xfig = @have_xfig@ have_zcat = @have_zcat@ host_alias = @host_alias@ # html stuff is installed in the documentation directories, too htmldir = $(docdir) 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@ # $LastChangedDate: 2023-04-05 02:04:35 +0200 (Wed, 05 Apr 2023) $ # HTMLDOCS = $(am__append_1) $(am__append_2) CLEANFILES = doctags$(EXEEXT) *.o tags $(HTMLDOCS) EXTRA_DIST = FIM.TXT fim.man doctags.c fim-stylesheet.css ./vim2html.pl fimgs.man fimrc.man fim.man.in fimgs.man.in fimrc.man.in #MAN2HTML=man2html MAN2HTML = $(MAN) --html=cat MAN2HTMLS = sed 's/−/-/g' MAN2TXT = $(MAN) --ascii # when having e.g. a minimal groff installation man1_MANS = fim.man fimgs.man man5_MANS = fimrc.man dist_html_DATA = $(HTMLDOCS) dist_doc_DATA = FIM.TXT all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-man1: $(man1_MANS) @$(NORMAL_INSTALL) @list1='$(man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man5: $(man5_MANS) @$(NORMAL_INSTALL) @list1='$(man5_MANS)'; \ list2=''; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list='$(man5_MANS)'; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) install-dist_htmlDATA: $(dist_html_DATA) @$(NORMAL_INSTALL) @list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ done uninstall-dist_htmlDATA: @$(NORMAL_UNINSTALL) @list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(htmldir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_docDATA install-dist_htmlDATA \ install-man 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-man1 install-man5 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_docDATA uninstall-dist_htmlDATA \ uninstall-man uninstall-man: uninstall-man1 uninstall-man5 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_docDATA install-dist_htmlDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man1 install-man5 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am \ uninstall-dist_docDATA uninstall-dist_htmlDATA uninstall-man \ uninstall-man1 uninstall-man5 .PRECIOUS: Makefile .PHONY: all all: $(HTMLDOCS) $(EXTRA_DIST) FIM.html fim-stylesheet.css: doctags$(EXEEXT) FIM.TXT ./doctags$(EXEEXT) $(srcdir)/FIM.TXT > tags ; $(srcdir)/vim2html.pl tags $(srcdir)/FIM.TXT fim.man: make doc/fim.man -C $(abs_top_builddir)/ fim.man.html: fim.man $(MAN2HTML) ./$< | $(MAN2HTMLS) > $@ if test ! -s $@ ; then $(MAN2TXT) ./$< > $<.txt && $(srcdir)/vim2html.pl tags $<.txt && mv $<.txt.html $@ ; fi fimrc.man: make doc/fimrc.man -C $(abs_top_builddir)/ fimrc.man.html: fimrc.man $(MAN2HTML) ./$< | $(MAN2HTMLS) > $@ if test ! -s $@ ; then $(MAN2TXT) ./$< > $<.txt && $(srcdir)/vim2html.pl tags $<.txt && mv $<.txt.html $@ ; fi fimgs.man: make doc/fimgs.man -C $(abs_top_builddir)/ fimgs.man.html: fimgs.man $(MAN2HTML) ./$< | $(MAN2HTMLS) > $@ if test ! -s $@ ; then $(MAN2TXT) ./$< > $<.txt && $(srcdir)/vim2html.pl tags $<.txt && mv $<.txt.html $@ ; fi doctags$(EXEEXT): doctags.c $(CC) -o $@ $< #clean: # $(RM) -f doctags.o doctags$(EXEEXT) FIM.html tags fim-stylesheet.css fim.man.html fimgs.man.html # 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: fim-0.6-rc2/doc/fimrc.man.html0000644000175000017500000025375414503371627013074 00000000000000 fimrc

fimrc

NAME
SYNOPSIS
DESCRIPTION
FIM LANGUAGE GRAMMAR
COMMANDS REFERENCE
KEYSYMS REFERENCE
AUTOCOMMANDS REFERENCE
VARIABLES REFERENCE
DEFAULT ALIASES REFERENCE
COMMAND LINE USAGE EXAMPLES
CONFIGURATION FILE EXAMPLE
NOTES
BUGS
SEE ALSO
AUTHOR
COPYRIGHT

NAME

fimrc - fim configuration file and language reference

SYNOPSIS

~/.fimrc
/usr/local/etc/fimrc
fim --script-from-stdin [ {options} ] < {scriptfile}
fim --execute-script {scriptfile} [ {options} ]
fim --execute-commands {commands} [ {options} ]
fim --final-commands {commands} [ {options} ]
fim --write-scriptout {scriptfile} [ {options} ]
fim --write-scriptout /dev/stdout [ {options} ]
fim --chars-press :{commands} [ {options} ]
fim --chars-press :{commands} --chars-press ’’ [ {options} ]

DESCRIPTION

This page explains the fim language, which is used for the fimrc configuration files, {scriptfile}s, or {commands} passed via command line {options}. This language can be used to issue commands (or programs) from the internal program command line accessed interactively through the ":" key (or rather, the key code specified by the "_console_key" variable). One may exit from command line mode by pressing the Enter key on an empty line (a non empty command line would be submitted for execution), or the Esc key (only in SDL mode). The general form of a fim command/program is shown in the next section.

FIM LANGUAGE GRAMMAR

This section specifies the grammar of the fim language.

Language elements surrounded by a single quote ("’") are literals.

Warning: at the present state, this grammar has conflicts. A future release shall fix them.

program: %empty
| statement_list

statement_list: statement
| statement ’;’ statement_list
| non_atomic_statements_block statement_list
| statements_block

non_atomic_statements_block: ’{’ statement_list ’}’
| INTEGER ’{’ statement_list ’}’
| conditional_statement

statements_block: atomic_statements_block
| non_atomic_statements_block

conditional_statement: if_statement
| loop_statement

if_statement: ’if’ ’(’ expression ’)’ statements_block
| ’if’ ’(’ expression ’)’ statements_block ’else’ statements_block

loop_statement: ’while’ ’(’ expression ’)’ statements_block
| ’do’ statements_block ’while’ ’(’ expression ’)’

atomic_statements_block: statement ’;’
| statement ’;’ ’;’
| statement ’;’ ’;’ ’;’

statement: ’!’ arguments
| INTEGER ’,’ INTEGER IDENTIFIER
| INTEGER ’,’ INTEGER IDENTIFIER arguments
| INTEGER IDENTIFIER
| SLASH_AND_REGEXP
| ’+’ UNQUOTED_FLOAT ’%’
| ’+’ QUOTED_FLOAT ’%’
| ’+’ INTEGER ’%’
| ’*’ UNQUOTED_FLOAT
| ’*’ QUOTED_FLOAT
| ’*’ INTEGER
| UNQUOTED_FLOAT ’%’
| QUOTED_FLOAT ’%’
| INTEGER ’%’
| ’-’ UNQUOTED_FLOAT ’%’
| ’-’ QUOTED_FLOAT ’%’
| ’-’ INTEGER ’%’
| INTEGER
| ’-’ INTEGER
| IDENTIFIER
| IDENTIFIER FILE_PATH
| IDENTIFIER arguments
| INTEGER IDENTIFIER arguments
| IDENTIFIER ’=’ expression

arguments: expression
| expression arguments

expression: ’(’ expression ’)’
| expression ’.’ expression
| ’!’ expression
| expression ’%’ expression
| expression ’+’ expression
| expression ’-’ expression
| expression ’*’ expression
| expression ’/’ expression
| expression ’<’ expression
| expression ’>’ expression
| expression ’||’ expression
| expression BOR expression
| expression ’&&’ expression
| expression BAND expression
| expression ’>=’ expression
| expression ’<=’ expression
| expression ’!=’ expression
| expression ’==’ expression
| expression ’=~’ expression
| ’-’ expression
| IDENTIFIER
| INTEGER
| QUOTED_FLOAT
| UNQUOTED_FLOAT
| STRING

A STRING can be either a single quoted string or a double quoted string. A floating point number can be either unquoted (UNQUOTED_FLOAT) or quoted (QUOTED_FLOAT). A QUOTED_FLOAT is a floating point number, either single ("’") or double (""") quoted. An INTEGER shall be an unsigned integer number. An IDENTIFIER shall be one of the valid fim commands (see COMMANDS REFERENCE ) or a valid alias. A VARIABLE shall be an already declared or undeclared variable identifier (see VARIABLES REFERENCE ) or a valid alias, created using the alias command. The "=~" operator treats the right expression as a STRING, and uses it as a regular expression for matching purposes. The SLASH_AND_REGEXP is a slash ("/") followed by a STRING, interpreted as a regular expression. If ’INTEGER , INTEGER IDENTIFIER arguments’ is encountered, command IDENTIFIER will be repeated on each file in the interval between the two INTEGERs, and substituting the given file name to any ’{}’ found in the commands arguments (which must be quoted in order to be treated as strings). See regex(1) for regular expression syntax.

The way some one-line statements are evaluated:

: enter command line mode
:{number} jump to {number}^th image in the list

:^

jump to first image in the list

:$

jump to last image in the list

:*{factor} scale the image by {factor}
:{scale}% scale the image to the desired {scale}
:+{scale}% scale the image up to the desired percentage {scale} (relatively to the original)
:-{scale}% scale the image down to the desired percentage {scale} (relatively to the original)

/{regexp}

entering the pattern {regexp} (with /) makes fim jump to the next image whose filename matches {regexp}

/*.png$

entering this pattern (with /) makes fim jump to the next image whose filename ends with ’png’

/png

a shortcut for /.*png.*

2,4 stdout ’{}’

print three filenames to standard output.

!{syscmd}

executes the {syscmd} quoted string as an argument to the "system" fim command.

COMMANDS REFERENCE

alias
alias [{identifier} [{commands} [{description}]]]
Without arguments, lists the current aliases.
With one, shows an identifier’s assigned command.
With two, assigns to an identifier a user defined command or sequence of commands.
With three, also assigns a help string.

align
align [’bottom’|’top’|’left’|right’]: if image larger than drawing area, align one side of the image to the border.
align ’center’: align equally far from all sides.
align ’info’: print internal alignment information.

autocmd
autocmd {event} {pattern} {commands}: manipulate autocommands (inspired from Vim autocmd’s).
Without arguments, list autocommands.
With arguments, specifies for which type of event and which current file open, which commands to execute.
See the default built-in configuration files for examples.

autocmd_del
autocmd_del: specify autocommands to delete.
Usage: autocmd_del {event} {pattern} {commands}.

basename
basename {filename}: returns the basename of {filename} in the ’_last_cmd_output’ variable.

bind
bind [{keysym} [{commands}]]: bind a keyboard symbol/shortcut {keysym} to {commands}.
If {keysym} is at least two characters long and begins with 0 (zero), the integer number after the 0 will be treated as a raw keycode to bind the specified {keysym} to.
Use the ’_verbose_keys’ variable to discover (display device dependent) raw keys.
Key binding is dynamical, so you can rebind keys even during program’s execution.
You can get a list of valid symbols (keysyms) by invoking dump_key_codes or in the man page.

cd
cd {path}: change the current directory to {path}.
If {path} is a file, use its base directory name.
cd ’-’ will change to the previous current directory (before the last ’:cd {path}’ command).

clear
clear: clear the virtual console.

commands
commands: display the existing commands.

color
color [desaturate]: desaturate the displayed image colors.
color [negate]: negate the displayed image colors.
color [colorblind|c|deuteranopia|d]: simulate a form of the deuteranopia color vision deficiency (cvd).
color [protanopia|p]: simulate a form of the protanopia cvd.
color [tritanopia|t]: simulate a form of the tritanopia cvd.
color [daltonize|D]: if following a cvd specification, will attempt correcting it.
color [identity]: populate the image with ’RGB identity’ pixels.
To get back the original you will have to reload the image.

crop
crop: crop image to a centered rectangle, half the width and half the height.
crop {p}: crop image to the middle {p} horizontal percent and {p} vertical percent of the image.
crop {w} {h}: crop image to the middle {w} horizontal percent and {h} vertical percent of the image.
crop {x1} {y1} {x2} {y2}: crop image to the area between the upper left ({x1},{y1}) and lower right ({x2},{y2}) corner.
Units are intended as percentage (0 to 100).
Note: still experimental functionality.

desc
desc ’load’ {filename} [{sepchar}]: load description file {filename}, using the optional {sepchar} character as separator.
desc ’reload’: load once again description files specified at the command line with --load-image-descriptions-file, with respective separators.
desc [’-all’] [’-append’] [’-nooverw’] ’save’ {filename} [{sepchar}]: save current list descriptions to file {filename}, using the optional {sepchar} character as separator, and if ’-all’ is present will save the variables, and if ’-append’ is present, will only append, and if ’-nooverw’ is present, will not overwrite existing files.
See documentation of --load-image-descriptions-file for the format of {filename}.

display
display [’reinit’ {string}]|’resize’ {w} {h}]: display the current file contents.
If ’reinit’ switch is supplied, the ’{string}’ specifier will be used to reinitialize (e.g.: change resolution, window system options) the display device.
See documentation for the --output-device command line switch for allowed values of {string}.
If ’resize’ and no argument, will ask the window manager to size the window like the image.
If ’resize’ and two arguments, these will be used as width and height of window, to set.

dump_key_codes
dump_key_codes: dump the active key codes (unescaped, for inspection purposes).

echo
echo {args}: print the {args} on console.

else
if(expression){action;}[’else’{action;}]: see else.

eval
eval {args}: evaluate {args} as commands, executing them.

exec
exec {filename(s)}: execute script {filename(s)}.

font
font ’scan’ [{dirname}]: scan {dirname} or /usr/share/consolefonts looking for fonts in the internal fonts list.
font ’load’ {filename}: load font {filename}.
font ’next’/’prev’: load next/previous font in the internal fonts list.
font ’info’: print current font filename.

getenv
getenv {identifier}: create a variable with the same value as the ’{identifier}’ environment variable, but with an identifier prefixed by ’ENV_’. So e.g. getenv ’DISPLAY’ creates ’ENV_DISPLAY’. Nothing is being printed; no variable is created if {identifier} is empty.

goto
goto {[’+’|’-’]{number}[’%’][’f’|’p’|’F’|’P’]} | {/{regexp}/} | {?{filename}} | {’+//’} | {’+/’|’-/’}[C] | {{’+’|’-’}{identifier}[’+’]}: jump to an image.
If {number} is given, and not surrounded by any specifier, will go to image at index {number}.
If followed by ’%’, the effective index will be computed as a percentage to the current available images.
If prepended by ’-’ or ’+’, the jump will be relative to the current index.
The ’f’ specifier asks for the jump to occur within the files (same for ’F’, but accelerates if keep pressing).
The ’p’ specifier asks for the jump to occur in terms of pages, within the current file (same for ’P’, but accelerates if keep pressing).
If /{regexp}/ is given, will jump to the first image matching the given /{regexp}/ regular expression pattern.
If the argument starts with ?, jump to the filename following ?.
If given ’+//’, will jump to the first different image matching the last given regular expression pattern.
With ’+/’C or ’-/’C will jump to next or previous file according to C: if ’s’ if same directory, if ’d’ if down the directory hierarchy, if ’u’ if down the directory hierarchy, if ’b’ if same basename, if upper case match is negative, if missing defaults to ’S’ (jump to file in different dir).
If {identifier|identifier2...}] is encountered after a ’+’ or ’-’ sign, jump to next or previous image having a different value for any corresponding i:{identifier} (a trailing ’+’ will require a non empty value).
Match will occur on both file name and description, possibly loaded via desc or --load-image-descriptions-file; see also ’_lastgotodirection’ and ’_re_search_opts’.
You can specify multiple arguments to goto: those after the first triggering a jump will be ignored.
Executes autocommands for events PreGoto and PostGoto. Keeping pressed shall accelerate images browsing.

help
help [{identifier}]: provide online help, assuming {identifier} is a variable, alias, or command identifier.
If {identifier} begins with ’/’, the search will be on the help contents and a list of matching items will be given instead.
A list of commands can be obtained simply invoking ’commands’; a list of aliases with ’alias’; a list of bindings with ’bind’.

if
if(expression){action;}[’else’{action;}]: see ’else’.

info
info: display information about the current file.

limit
limit {’-list’|’-listall’} ’variable’|[’-further’|’-merge’|’-subtract’] [{expression} |{variable} {value}]: A browsable file list filtering function (like limiting in the ’mutt’ program). Uses information loaded via --load-image-descriptions-file.
If invoked with ’-list’/’-listall’ only, will list the current description variable ids.
If invoked with ’-list’/’-listall’ ’id’, will list set values for the variable ’id’.
If ’-further’ is present, will start with the current list; if not, with the full list.
If ’-merge’ is present, new matches will be merged in the existing list and sorted.
If ’-subtract’ is present, sort and filter out matches.
If {variable} and {values} are provided, limit to files having property {variable} set to {value}.
If {expression} is one exclamation point (’!’), will limit to the currently marked files only.
If {expression} is ’~!’ will limit to files with unique basename.
if ’~=’, to files with duplicate basename.
if ’~^’, to the first of the files with duplicate basename.
if ’~$’, to the last of the files with duplicate basename.
On ’~i’ [MINIDX][-][MAXIDX], (each a number possibly followed by a multiplier ’K’) will limit on filenames in position MINIDX to MAXIDX.
On ’~z’ will limit to files having the current file’s size.
on ’~z’ [MINSIZE][-][MAXSIZE], (each a number possibly followed by a multiplier among ’k’,’K’,’m’,’M’) will limit on filesize within these limits.
on ’~d’ will limit to files having the current file’s date +- one day.
on ’~d’ [MINTIME][-][MAXTIME], (each the count of seconds since the Epoch (First of Jan. of 1970) or a date as DD/MM/YYYY) will limit on file time (struct stat’s ’st_mtime’, in seconds) within this interval.
For other values of {expression}, limit to files whose description string matches {expression}.
Invoked with no arguments, the original browsable files list is restored.

list
list: display the files list.
list ’random_shuffle’: randomly shuffle the file list.
list ’reverse’: reverse the file list.
list ’clear’: clear the file list.
list ’sort’: sort the file list.
list ’sort_basename’: sort the file list according to base name.
list ’sort_comment’: sort the file list according to the value of the _comment variable.
list ’sort_var’ {var}: sort the file list according to the value of the i:{var} variable.
list ’vars|variables’: list variables in all i:* read from description file.
list ’sort_fsize’: sort the file list according to file size.
list ’sort_mtime’: sort the file list according to modification date.
list ’pop’: remove the current file from the files list, and step back.
list ’remove’ [{filename(s)}]: remove the current file, or the {filename(s)}, if specified.
list ’push’ {filename(s)}: push {filename(s)} to the back of the files list.
list ’filesnum’: display the number of files in the files list.
list ’mark’ [{args}]: mark image file names for stdout printing at exit, with {args} mark the ones matching according to the rules of the ’limit’ command, otherwise the current file.
list ’unmark’ [{args}]: unmark marked image file names, with {args} unmark the ones matching according to the rules of the ’limit’ command, otherwise the current file.
list ’marked’: show which files have been marked so far.
list ’dumpmarked’: dump to stdout the marked files (you will want usually to ’unmarkall’ afterwards).
list ’markall’: mark all the current list files.
list ’unmarkall’: unmark all the marked files.
list ’pushdir’ {dirname}: will push all the files in {dirname}, when matching the regular expression in variable _pushdir_re or, if empty, from constant regular expression ’.(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$’.
list ’pushdirr’ {dirname}: like pushdir, but will also push encountered directory entries recursively.
list ’swap’: will move the current image filename to the first in the list (you’ll have to invoke reload to see the effect).
Of the above commands, several will be temporarily non available for the duration of a background load (enabled by --background-recursive), which will last until _loading_in_background is 0.

load
load: load the image, if not yet loaded (see also ’reload’).
Executes autocommands for events PreLoad and PostLoad.

pan
pan {vsteps}% {hsteps}%: pan the image to {vsteps} percentage steps from the top and {hsteps} percentage steps from left.
pan {vsteps} {hsteps}: pan the image to {vsteps} pixels from the top and {hsteps} pixels from left.
pan {’down’|’up’|’left’|’right’|’ne’|’nw’|’se’|’sw’}[+-] [{steps}[’%’]]: pan the image {steps} pixels in the desired direction.
If the ’%’ specifier is present, {steps} will be treated as a percentage of current screen dimensions.
If {steps} is not specified, the ’_steps’ variable will be used.
If present, the ’_hsteps’ variable will be considered for horizontal panning.
A ’+’ or ’-’ sign at the end of the first argument will make jump to next or prev if border is reached.
If present, the ’_vsteps’ variable will be considered for vertical panning.
The variables may be terminated by the ’%’ specifier.
Executes autocommands for events PrePan and PostPan.

popen
popen {syscmd}: pipe a command, invoking popen(): spawns a shell, invoking ’{syscmd}’ and executing as fim commands the output of ’{syscmd}’.

pread
pread {args}: execute {args} as a shell command and read the output as an image file (using ’popen’).

prefetch
prefetch: prefetch (read into the cache) the two nearby image files (next and previous), for a faster subsequent opening.
Executes autocommands for events PrePrefetch and PostPrefetch.
See also the ’_want_prefetch’ variable.

pwd
pwd: print the current directory name, and updates the ’_pwd’ variable.

quit
quit [{number}]: terminate the program.
If {number} is specified, use it as the program return status.
Note that autocommand ’PostInteractiveCommand’ does not trigger after this command.

recording
recording ’start’: start recording the executed commands.
recording ’stop’: stop recording the executed commands.
recording ’dump’: dump in the console the record buffer.
recording ’execute’: execute the record buffer.
recording ’repeat_last’: repeat the last performed action.

redisplay
redisplay: re-display the current file contents.

reload
reload [{arg}]: load the image into memory.
If {arg} is present, will force reloading, bypassing the cache (see also ’load’).
Executes autocommands for events PreReload and PostReload.

rotate
rotate {number}: rotate the image the specified amount of degrees. If unspecified, by one. If you are interested in orthogonal rotations, see ’_orientation’ and related aliases.
Executes autocommands for events PreScale and PostScale.

scale
scale {[’+’|’-’]{value}[’%’]|’*’{value}|’w’|’h’|’a’|’b’|’+[+-*/]’|[’<’|’>’]|’shadow’}: scale the image according to a scale {value} (e.g.: 0.5,40%,’w’,’h’,’a’,’b’).
If given ’*’ and a value, will multiply the current scale by that value.
If given ’w’, will scale according to the screen width.
If given ’h’, scale to the screen height.
If given ’a’, to the minimum of ’w’ and ’h’.
If given ’b’, like ’a’, provided that the image width exceeds ’w’ or ’h’.
If {value} is a number, will scale relatively to the original image width.
If the number is followed by ’%’, the relative scale will be treated on a percent scale.
If given ’++’(’+-’), will increment (decrement) the ’_magnify_factor’, ’_reduce_factor’ variables by ’_scale_factor_delta’.
If given ’+*’(’+/’), will multiply (divide) the ’_magnify_factor’, ’_reduce_factor’ variables by ’_scale_factor_multiplier’.
If given ’<’ or ’>’, will shrink or magnify image using nearest mipmap (cached pre-scaled version). If given ’shadow’ as a parameter, search a same-named file in one of the directories specified to --load-shadow-dir.
Executes autocommands for events PreScale and PostScale.

scroll
scroll: scroll down the image, going next when hitting the bottom.
scroll ’forward’: scroll the image as we were reading left to right (see ’_scroll_skip_page_fraction’ variable).
Executes autocommands for events PrePan and PostPan.

set
set: returns a list of variables which are set.
set {identifier}: returns the value of variable {identifier}.
set {identifier} {commands}: sets variable {identifier} to value {commands}.

set_commandline_mode
set_commandline_mode: set console mode.

set_interactive_mode
set_interactive_mode: set interactive mode.

sleep
sleep [{number}=1]: sleep for the specified (default 1) number of seconds.

status
status: set the status line to the collation of the given arguments.

stderr
stderr {args}: writes to stderr its arguments {args}.

stdout
stdout {args}: writes to stdout its arguments {args}.

system
system {syscmd}: get the output of executing the {syscmd} system command. Uses the popen() system call. Usually popen invokes "/bin/sh -c {syscmd}". This might not handle a multi-word command; in that case you will have to put it into a script. See ’man popen’ for more.

variables
variables: display the existing variables.

unalias
unalias {identifier} | ’-a’: delete the alias {identifier} or all aliases (use ’-a’, not -a).

unbind
unbind {keysym}: unbind the action associated to a specified {keysym}
If {keysym} is at least two characters long and begins with 0 (zero), the integer number after the 0 will be treated as a raw keycode to bind the specified {keysym} to.
Use the ’_verbose_keys’ variable to discover (display device dependent) raw keys.

while
while(expression){action;}: A conditional cycle construct.
May be interrupted by hitting the ’Esc’ or the ’:’ key.

window
window {args}: this command is disabled.

KEYSYMS REFERENCE

" " "!" """ "#" "$" "%" "&" "’" "(" ")" "*" "+" "," "-" "." "/" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" ":" ";" "<" "=" ">" "?" "@" "A" "Any" "B" "BackSpace" "Backspace" "C" "C-a" "C-b" "C-c" "C-d" "C-e" "C-f" "C-g" "C-h" "C-i" "C-j" "C-k" "C-l" "C-m" "C-n" "C-o" "C-p" "C-q" "C-r" "C-s" "C-t" "C-u" "C-v" "C-w" "C-x" "C-y" "C-z" "D" "Del" "Down" "E" "End" "Enter" "Esc" "F" "F1" "F10" "F11" "F12" "F2" "F3" "F4" "F5" "F6" "F7" "F8" "F9" "G" "H" "Home" "I" "Ins" "J" "K" "L" "Left" "M" "N" "O" "P" "PageDown" "PageUp" "Q" "R" "Right" "S" "T" "Tab" "U" "Up" "V" "W" "X" "Y" "Z" "[" "\" "]" "^" "_" "’" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "{" "|" "}" "~"

AUTOCOMMANDS REFERENCE

Available autocommands are: PreScale, PostScale, PrePan, PostPan, PreRedisplay, PostRedisplay, PreDisplay, PostDisplay, PrePrefetch, PostPrefetch, PreReload, PostReload, PreLoad, PostLoad, PreGoto, PostGoto, PreConfigLoading, PostConfigLoading, PreHardcodedConfigLoading, PostHardcodedConfigLoading, PreUserConfigLoading, PostUserConfigLoading, PreGlobalConfigLoading, PostGlobalConfigLoading, PreInteractiveCommand, PostInteractiveCommand, PreExecutionCycle, PostExecutionCycle, PreExecutionCycleArgs, PreWindow, PostWindow, and they are triggered on actions as suggested by their name.
Those associated to actual commands are mentioned in the associated commands reference.

VARIABLES REFERENCE

If undeclared, a variable will evaluate to 0.

When assigning a variable to a string, use single or double quoting, otherwise it will be treated as a number.

The namespaces in which variables may exist are: current image, global. A namespace is specified by a prefix, which can be: ’i:’, be prepended to the variable name. The global namespace is equivalent to the empty one:’’. The special variable i:* expands to the collation of all the name-value pairs for the current image.

In the following, the [internal] variables are the ones referenced in the source code (not including the hardcoded configuration, which may be inspected and/or invalidated by the user at runtime).

_TERM [out,g:] the environment TERM variable.
__exif_flipped
[out,i:] flipping information, read from the EXIF tags of a given image.
__exif_mirrored
[out,i:] mirroring information, read from the EXIF tags of a given image.
__exif_orientation
[out,i:] orientation information in the same format of _orientation, read from the orientation EXIF tags (i:EXIF_Orientation).
_all_file_loaders
[out,g:] space-separated list of hardcoded file loaders usable with _file_loader.
_archive_files
[in,g:] Regular expression matching filenames to be treated as (multipage) archives. If empty, ".(RAR|ZIP|TAR|TAR.GZ|TGZ|TAR.BZ2|TBZ|TBZ2|CBR|CBZ|LHA|7Z|XAR|ISO)$" will be used. Within each archive, only filenames matching the regular expression in the _pushdir_re variable will be considered for opening.
_autocmd_trace_stack
[in,g:] dump to stdout autocommands (autocmd) stack trace during their execution (for debugging purposes).
_autodesaturate
[in,g:] if 1, will desaturate images by default.
_autoflip
[in,g:] if 1, will flip images by default.
_automirror
[in,g:] if 1, will mirror images by default.
_autonegate
[in,g:] if 1, will negate images by default.
_autotop
[in,g:] if 1, will align to the top freshly loaded images.
_buffered_in_tmpfile
[out,i:] if an image has been temporarily converted and decoded from a temporary file, its name is here.
_cache_control
[in,g:] string for cache control. if it starts with ’m’ mipmaps will be cached; if it starts with ’M’ then not. otherwise defaults will apply.
_cache_status
[out,g:] string with current information on cache status.
_cached_images
[out,g:] the number of images currently cached.
_caption_over_image
[in,g:] if set not to 0, will display a custom comment string specified according to the value of_caption_over_image_fmt; if larger than 1, with black background; if 3, image will be drawn possibly below. It will take at most half of the screen.
_caption_over_image_fmt
[in,g:] custom info format string, displayed in a caption over the image; if unset: i:_comment; otherwise a custom format string specified just as _info_fmt_str.
_command_expansion
[in,g:] if 1, will enable autocompletion (on execution) of alias and command strings.
_comment
[i:,out] the image comment, extracted from the image file (if any).
_console_buffer_free
[out,g:] amount of unused memory in the output console buffer.
_console_buffer_total
[out,g:] amount of memory allocated for the output console buffer.
_console_buffer_used
[out,g:] amount of used memory in the output console buffer.
_console_key
[in,g:] the key binding (an integer variable) for spawning the command line; will have precedence over any other binding.
_console_lines
[out,g:] the number of buffered output console text lines.
_console_offset
[in,out,g:] position of the text beginning in the output console, expressed in lines.
_debug_commands
[in,g:] debugging option string for printing out . if containing ’a’, print out autocmd info; if containing ’c’, print out each command; if containing ’k’, print out each pressed key; if containing ’j’, print interpreter internal steps; if containing ’B’, clear screen and print background loading files; if containing ’C’, print cache activity.
_device_string
[out,g:] the current display device string.
_display_as_binary
[in,g:] will force loading of the specified files as pixelmaps (no image decoding will be performed); if 1, using one bit per pixel; if 24, using 24 bits per pixel; otherwise will load and decode the files as usual.
_display_as_rendered_text
[in,g:] will force loading of the specified files as text files (no image decoding will be performed); if 1; otherwise will load and decode the files as usual.
_display_busy
[in,g:] if 1, will display a message on the status bar when processing.
_display_console
[in,g:] if 1, will display the output console.
_display_status
[in,g:] if 1, will display the status bar.
_display_status_bar
[in,g:] if 1, will display the status bar.
_display_status_fmt
[in,g:] custom info format string, displayed in the lower left corner of the status bar; if unset: full pathname; otherwise a custom format string specified just as _info_fmt_str.
_do_sanity_check
[in,experimental,g:] if 1, will execute a sanity check on startup.
_downscale_huge_at_load
[in,g:] if 1, will downscale automatically huge images at load time.
_exiftool_comment
[out,g:] comment extracted via the exiftool interface; see _use_exiftool.
_fbfont
[out,g:] The current console font file string. If the internal hardcoded font has been used, then its value is "fim://".
_fbfont_as_screen_fraction
[in,g:] The rendered text will be scaled at least to this (integer) fraction of the screen. Disable font autoscaling with -1. (Only enabled if configured with --with-font-magnifying-factor=FACTOR, with FACTOR<1).
_fbfont_magnify_factor
[in,g:] The rendered text will use a font magnified by this (integer) factor. Maximal value is "16". (Only enabled if configured with --with-font-magnifying-factor=FACTOR, with FACTOR<1).
_fbfont_verbosity
[in,g:] if > 0, verbose font loading
_file_load_time
[out,i:] time taken to load the file and decode the image, in seconds.
_file_loader
[in,i:,g:] if not empty, this string will force a file loader (among the ones listed in the -V switch output); [out] i:_file_loader stores the loader of the current image.
_fileindex
[out,g:] the current image numeric index.
_filelistlen
[out,g:] current image list length (number of visible images).
_filename
[out,i:] the current file name string.
_fim_bpp
[out,g:] the bits per pixel count.
_fim_default_config_file_contents
[out,g:] the contents of the default (hardcoded) configuration file (executed after the minimal hardcoded config).
_fim_default_grammar_file_contents
[out,g:] the contents of the default (hardcoded) grammar file.
_fim_scriptout_file
[in,g:] the name of the file to write to when recording sessions.
_fim_version
[out,g:] fim version number; may be used for keeping compatibility of fim scripts across evolving versions.
_hsteps
[in,g:] the default steps, in pixels, when panning images horizontally (overrides steps).
_ignorecase
[in,g:] if 1, will allow for case insensitive regexp-based match in autocommands (autocmd).
_info_fmt_str
[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special ’expando’ sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets; %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set; EXP will be copied verbatim except for contained sequences of the form %:VAR:, which will be expanded to the value of variable i:VAR; this is meant to be used like in e.g. ’%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?’, where the EXIF-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) will be used only if present.
_inhibit_display
[internal,g:] if 1, will inhibit display.
_last_cmd_output
[out,experimental,g:] the last command output.
_last_file_loader
[out,g:] after each image load, _last_file_loader will be set to the last file loader used.
_last_system_output
[out,experimental,g:] the standard output of the last call to the system command.
_lastfileindex
[out,g:] the last visited image numeric index. Useful for jumping back and forth easily between two images with ’goto _lastfileindex’.
_lastgotodirection
[out,g:] the last file goto direction (either string ’+1’ or string ’-1’).
_load_default_etc_fimrc
[in,g:] if 1 at startup, will load the system wide initialization file.
_load_fim_history
[in,g:] if 1 on startup, will load the ~/.fim_history file on startup.
_load_hidden_dirs
[in,g:] if not 1, when pushing directories/files, those whose name begins with a dot (.) will be skipped.
_loading_in_background
[out,g:] 1 if program has been invoked with --background-recursive and still loading in background.
_loop_only_once
[internal,g:] if 1 and doing a --slideshow, do it once.
_lwidth
[in,g:] if>0, will force the output console text width.
_magnify_factor
[in,g:] the image scale multiplier used when magnifying images size.
_max_cached_images
[in,g:] the maximum number of images after which evictions will be forced. Setting this to 0 (no limits) is ok provided _max_cached_memory is set meaningfully.
_max_cached_memory
[in,g:] the maximum amount of memory (in KiB) at which images will be continued being added to the cache. Setting this to 0 (no limit) will lead to a crash (there is no protection currently).
_max_iterated_commands
[g:] the iteration limit for N in "N[commandname]" iterated command invocations.
_min_cached_images
[in,g:] the minimum number of images to keep from eviction; if less than four can lead to inefficiencies: e.g. when jumping between two images, each time an erase and a prefetch of neighboring images would trigger. default value is 4.
_no_default_configuration
[in,g:] if 0, a default, hardcoded configuration will be executed at startup, after the minimal hardcoded one.
_no_external_loader_programs
[in,g:] if 1, no external loading programs will be tried for piping in an unsupported type image file.
_no_rc_file
[in,g:] if 1, the ~/.fimrc file will not be loaded at startup.
_open_offset
[in,optional,g:,i:] offset (specified in bytes) used when opening a file; [out] i:_open_offset will be assigned to images opened at a nonzero offset.
_open_offset_retry
[in,optional,g:] number of adjacent bytes to probe in opening the file.
_orientation
[internal,i:] Orthogonal clockwise rotation (orientation) is controlled by: ’i:_orientation’, ’g:_orientation’ and applied on a per-image basis. In particular, the values of the three variables are summed up and the sum is interpreted as the image orientation. If the sum is 0, no rotation will apply; if it is 1, a single ( 90’) rotation will apply; if it is 2, a double (180’) rotation will apply; if it is 3, a triple (270’) rotation will apply. If the sum is not one of 0,1,2,3, the value of the sum modulo 4 is considered. Therefore, ":i:_orientation=1" and ":i:_orientation=5" are equivalent: they rotate the image one time by 90’.
_pread_cmd
[in,g:] a user-specified shell command emitting an image on stdout, in a format readable by the convert utility. If the current filename matches "^[/A-Za-z0-9_.][/A-Za-z0-9_.-]*$", it will be substituted to any occurrence of ’{}’.
_preferred_rendering_dpi
[in,optional,g:] if >0, pdf, ps, djvu rendering will use this value for a default document dpi (instead of a default value).
_preferred_rendering_width
[in,optional,g:] if >0, bit based rendering will use this value for a default document width (instead of a default value).
_push_checks
[in,experimental,g:] if 1 (default), will check with stat() existence of input files before push’ing them (set this to 0 to speed up loading very long file lists; in these cases a trailing slash (/) will have to be used to tell fim a pathname is a directory). This only works after initialization (thus, after command line files have been push’ed); use --no-stat-push if you wish to set this to 0 at command line files specification.
_push_pushes_dirs
[in,g:] if 1, the push command will also accept and push directories (using pushdir). if 2, will also push hidden files/directories, that is, ones whose names begin with a dot (.).
_pushdir_re
[in] regular expression to match against when pushing files from a directory or an archive. By default this is ".(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$".
_pwd
[out,g:] the current working directory; will be updated at startup and whenever the working directory changes.
_re_search_opts
[in,g:] affects regexp-based searches; if an empty string, defaults will apply; if contains ’i’ (’I’), case insensitive (sensitive) searches will occur; if contains ’b’, will match on basename, if contains ’f’ on full pathname.
_reduce_factor
[in,g:] the image scale multiplier used when reducing images size.
_retry_loader_probe
[in,g:] if 1 and user specified a file loader and this fails, will probe for a different loader.
_rows
[in,g:] if >0, will set the number of displayed text lines in the console.
_save_fim_history
[in,g:] if 1 on exit, will save the ~/.fim_history file on exit.
_scale_factor_delta
[in,g:] value used for incrementing/decrementing the scaling factors.
_scale_factor_multiplier
[in,g:] value used for scaling up/down the scaling factors.
_scale_style
[in,g:] if non empty, this string will be fed to the scale command; see its documentation for possible values.
_screen_height
[out] the screen height.
_screen_width
[out,g:] the screen width.
_scroll_skip_page_fraction
[int,g:] if >1, fraction of page which will be skipped in when scrolling (e.g. ’scrollforward’); if 1, auto chosen; if <1, disabled.
_seek_magic
[optional,g:] will seek a ’magic’ signature in the file after opening it, and will try decoding it starting within the range of that signature (use like this: fim -C ’_seek_magic=MAGIC_STRING;push filename’).
_status_line
[in,g:] if 1, will display the status bar.
_steps
[in,g:] the default steps, in pixels, when panning images.
_sys_rc_file
[in,g:] string with the global configuration file name.
_use_exiftool
[in,g:] if >0 and supported, exiftool will be used to get additional information. if 1, this will be appened to _comment; if 2, will go to _exiftool_comment.
_use_mipmaps
[in,g:] if >0, will use mipmaps to speed up downscaling of images (this has a memory overhead equivalent to one image copy); mipmaps will not be cached. If 2, will use every fourth source pixel instead of averaging (good for photos, not for graphs).
_verbose_errors
[in,g:] if 1, will display on stdout internal errors, while parsing commands.
_verbose_keys
[in,g:] if 1, after each interactive mode key hit, the console will display the hit key raw keycode.
_verbosity
[in,experimental,g:] program verbosity.
_vsteps
[in,g:] the default steps, in pixels, when panning images vertically (overrides steps).
_want_autocenter
[in,g:] if 1, the image will be displayed centered.
_want_exif_orientation
[in,g:] if 1, will reorient images using information from EXIF metadata (and stored in in __exif_orientation, __exif_mirrored, __exif_flipped ).
_want_prefetch
[in,g:] if 1, will prefetch further files just after display of the first file; if 2 (and configured with --enable-cxx11) will load in the background.
_want_sleep_seconds
[in,g:] number of seconds of sleep during slideshow mode.
_want_wm_caption_status
[in,g:] this works only if supported by the display device (currently only SDL). if set to a number that is not 0, will show the status (or command) line in the window manager caption; if set to a non-empty string, will interpret it just as a file info format string (see _info_fmt_str); if empty, will show the program version.
_want_wm_mouse_ctrl
[in,g:] if at least 9 chars long, enable mouse click/movement behaviour when in SDL mode; the 9 chars will correspond to a 3x3 screen clickable grid and the equivalent command keys; clicking middle or right button will toggle on-screen usage info.
angle
[in,out,i:] a floating point number specifying the rotation angle, in degrees.
ascale
[in,out,i:] the asymmetric scaling of the current image.
desaturated
[out,i:] 1, if the image is desaturated.
flipped
[out,i:] 1, if the image is flipped.
fresh
[in,out,i:,experimental] 1 if the image was loaded, before all autocommands (autocmd) execution.
height
[out,i:] the current image original height.
mirrored
[out,i:] 1, if the image is mirrored.
negated
[out,i:] 1, if the image is negated.
page
[out,experimental,g:] the current page.
pages
[out,experimental,i:] the current number of pages of an image.
random
[out] a pseudorandom number.
scale
[in,i:] the scale of the current image.
sheight
[out,i:] the current image scaled height.
swidth
[out,i:] the current image scaled width.
width
[out,i:] the current image original width.

DEFAULT ALIASES REFERENCE

Hardcoded aliases are:

alias "A" "’_autotop=1-_autotop;’"
alias "magnify" "scale ’+’" # magnify the displayed image by the _magnify_factor variable or {args}
alias "next" "goto ’+1’" # go to the next page or picture file
alias "next_file" "goto ’+1f’" # go to the next file in the list
alias "next_page" "goto ’+1p’" # go to the next page in the file
alias "prev" "goto ’-1’" # go to the previous page or picture file
alias "prev_file" "goto ’-1f’" # go to the previous file in the list
alias "prev_page" "goto ’-1p’" # go to the previous page in the file
alias "reduce" "scale ’-’" # reduce the displayed image by _reduce_factor or {args}
alias "scale_factor_decrease" "scale ’+-’" # subtract _scale_factor_delta to the scale factors _reduce_factor and _magnify_factor
alias "scale_factor_grow" "scale ’+*’" # multiply the scale factors _reduce_factor and _magnify_factor by _scale_factor_multiplier
alias "scale_factor_increase" "scale ’++’" # add _scale_factor_delta to the scale factors _reduce_factor and _magnify_factor
alias "scale_factor_shrink" "scale ’+/’" # divide the scale factors _reduce_factor and _magnify_factor by _scale_factor_multiplier

They can be redefined with alias or deleted with the unalias command.
Further default aliases are usually loaded at startup -- see the CONFIGURATION FILE EXAMPLE section below.

COMMAND LINE USAGE EXAMPLES

# jump to the third image:
3;
# jump to first image:
^;
# jump to last image:
$;
# magnify the image two times:
*2;
# scale the image to the 30% of the original:
30%;
# scale the image up by 30%:
+30%;
# scale the image down by 30%:
-30%;
# jump to the next image whose filename matches the ".*jpg" regular expression:
/.*jpg;
# executes the "date" system command
!"date";

CONFIGURATION FILE EXAMPLE

Part of the default configuration comes from the _fim_default_config_file_contents variable, shown here.
One can skip its loading by using the _no_default_configuration variable.

# $LastChangedDate: 2023-03-09 00:38:06 +0100 (Thu, 09 Mar 2023) $
# Contents of the default ’fimrc’ file, hardcoded in the fim executable.
# Read the documentation (man fimrc) to discover how to change this default hardcoded file and how to make your own.
# Note that usually a ~/.fimrc file is read after these options take effect, so you could reset all of this with ease.
# Lines beginning with a pound (#) are ignored by fim (they are treated as comments).
#
# Internal variables.
# Some of these variables influence fim’s behaviour (input variables), some are set by fim (output variables).
# It is wise the input variables are set at the beginning of the file, so the bottom may issue commands correctly affected by them.
if(_cache_control==’’){_cache_control=’m’;}
if(_debug_commands==’’){_debug_commands=’’;}
if(_command_expansion==’’){_command_expansion=1;}
if(_display_status==’’){_display_status=0;}
if(_max_cached_images==’’){_max_cached_images=5;}
if(_min_cached_images==’’){_min_cached_images=4;}
if(_max_cached_memory==’’){_max_cached_memory=81920;}
if(_max_iterated_commands==’’){_max_iterated_commands=100;}
if(_want_prefetch==’’){_want_prefetch=1;}
if(_no_external_loader_programs==’’){_no_external_loader_programs=0;}
if(_scale_style==’’){_scale_style=’b’;}
if(_save_fim_history==’’){_save_fim_history=1;}
if(_load_fim_history==’’){_load_fim_history=1;}
if(_verbose_keys==’’){_verbose_keys=0;}
if(_display_busy==’’){_display_busy=1;}
if(_ignorecase==’’){_ignorecase=1;}
if(_re_search_opts==’’){_re_search_opts=’bi’;}
if(_console_offset==’’){_console_offset=0;}
if(_console_key==’’){_console_key=58;}
if(_display_as_binary==’’){_display_as_binary=0;}
if(_push_checks==’’){_push_checks=1;}
#if(_want_wm_caption_status==’’){_want_wm_caption_status=0;}
if(_want_exif_orientation==’’){_want_exif_orientation=1;}
if(ascale==’’){ascale="1.0";}
if(_use_mipmaps==’’){_use_mipmaps=1;}
if(_downscale_huge_at_load==’’){_downscale_huge_at_load=1;}
if(_scroll_skip_page_fraction==’’){_scroll_skip_page_fraction=0;}
if(_want_wm_mouse_ctrl==’’){_want_wm_mouse_ctrl="’pP+a-=nN";}
#
# External variables (not used internally).
if(allow_round_scroll==’’){allow_round_scroll=0;}
if(console_scroll_n==’’){console_scroll_n=3;}
#
alias "toggleautoflip" "_autoflip=1-_autoflip" "";
alias "toggleautonegate" "_autonegate=1-_autonegate" "";
alias "toggleflip" "i:flipped=1-i:flipped" "toggles flipped property on the current image";
alias "flip" "toggleflip;redisplay" "flip the current image along the horizontal axis";
alias "fliponce" "flip;toggleflip" "flip, but just for one display";
alias "toggleautomirror" "_automirror=1-_automirror" "";
alias "togglemirror" "i:mirrored=1-i:mirrored" "toggles mirrored property on the current image";
alias "mirror" "togglemirror;redisplay" "mirror the image along the vertical axis" "";
alias "mirroronce" "mirror;togglemirror" "mirror, but just for one display";
alias ’toggleLimitMarked’ ’__pre_limit_fileindex=_fileindex;_limit_mode=1-_limit_mode; if(_limit_mode==1){limit "!";} else { limit; } if(_filelistlen<1){_limit_mode=0;limit;goto __pre_limit_fileindex;} i:fresh=1;redisplay; ’ "toggle between limiting file list to the marked files and the full list";
alias "unlimit" "limit" "calling limit with no arguments restores the original list";
# Warning : binding to C-s, C-z and C-c won’t make effect, as these
# codes are get caught by the console driver and will have no effect in fim.
# Moreover, C-z will crash fim and C-c will terminate it.
# Some other combinations (e.g.:C-l) may have similar problems in your console.
bind ’f’ "flip";
bind ’F’ "fliponce";
bind ’m’ "mirror";
bind ’M’ "mirroronce";
bind ’q’ "quit";
bind ’Esc’ "quit";
#bind ’n’ "next_file";
#bind ’n’ "next";
bind ’C-h’ "help";
#bind ’?’ "help"; # assigned to back-search
#bind ’/’ "help"; # assigned to forward-search
bind ’=’ "scale ’100%’";
#bind ’p’ "prev_file";
bind ’Del’ "list ’remove’;reload";
#bind ’s’ "list ’sort’";
bind ’ ’ "scroll ’forward’";
bind ’S’ "toggleDisplayStatus";
bind ’I’ "toggleautonegate";
bind ’i’ "color ’negate’;redisplay";
bind ’g’ "color ’desaturate’;redisplay";
bind ’[’ ’font_reduce;redisplay’;
bind ’]’ ’font_magnify;redisplay’;
bind ’|’ ’toggle_font_auto_scale;redisplay’;
bind ’{’ ’font "prev";redisplay’;
bind ’}’ ’font "next";redisplay’;
bind ’G’ "toggleDesaturate";
bind ’r’ "rotate90";
bind ’R’ "rotate270";
bind ’+’ "magnify";
bind ’a’ "scale ’a’";
bind ’H’ "scale ’H’";
bind ’Tab’ "toggleVerbosity";
bind ’Menu’ "toggleVerbosity";
bind ’v’ "toggleDisplayStatus";
bind ’A’ "A";
bind ’C-m’ "list ’mark’";
bind ’u’ "list ’unmark’";
bind ’Enter’ "list ’mark’;goto _lastgotodirection";
bind ’-’ "reduce";
bind "Up" "pan_up";
bind ’k’ "pan_up";
bind "Right" "pan_right";
bind ’l’ "pan_right";
bind "Down" "pan_down";
bind ’j’ "pan_down";
bind "Left" "pan_left";
bind ’h’ "pan_left";
bind ’t’ "align ’top’";
bind ’C-g’ "system ’fbgrab’ ’fim_’._device_string.’.png’"; # grab a screenshot
#bind ’C-r’ "recording ’start’";
bind ’C-r’ "reload ’’";
bind ’Q’ "recording ’stop’";
bind ’D’ "recording ’dump’";
bind ’E’ "recording ’execute’";
bind ’C-e’ "recording ’execute’";
bind ’C-x’ "recording ’execute’";
bind ’.’ "recording ’repeat_last’";
bind ’’’ "toggleLimitMarked";
alias "toggleVerbosity" "_display_console=1-_display_console;i:fresh=1;redisplay" "";
alias "toggleKeyVerbosity" "_verbose_keys=1-_verbose_keys;redisplay" "";
alias "toggleDesaturate" "_autodesaturate=1-_autodesaturate;redisplay" "";
alias "idempotent_cmd" "goto ’’";
#
# Autocommands examples:
#autocmd "PostInteractiveCommand" "fim.png" "echo ’\nmatched an interactive command on fim.png\n’";
#autocmd "PostDisplay" ".*png" "echo ’this is a png file’";
#autocmd "PostDisplay" ".*jpg" "echo ’this is a jpg file’";
#autocmd "PostDisplay" "" "echo ’\nthis is a file\n’";
#autocmd "PostGoto" "" "set_interactive_mode";
autocmd "PostGoto" "" "reload";
autocmd "PostWindow" "" "i:fresh=1;redisplay;";
autocmd "PreRedisplay" "" "i:_will_display=1";
autocmd "PreRedisplay" "" "if(_scale_style!=’’ && i:fresh){i:fresh=0;scale _scale_style ;i:fresh=0;}";
autocmd "PostRedisplay" "" "i:_will_display=0";
# Display device specific config
alias "aalib_fix_do" "{if(aascale==’’){ascale=’2.0’;}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~’screen’){echo ’screen+aalib?expect binding problems!’}}" "See aalib_fix.";
alias "aalib_fix" "if(_device_string==’aa’){aalib_fix_do;scale ’a’;}" "When using the aalib (ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the ’aascale’ variable for an accurate scaling.";
alias "cacalib_fix_do" "{if(cacascale==’’){ascale=’1.18’;}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~’screen’){echo ’screen+cacalib?expect binding problems!’}}" "See cacalib_fix.";
alias "cacalib_fix" "getenv ’DISPLAY’;if(_device_string==’caca’ && ENV_DISPLAY==’’){cacalib_fix_do;scale ’a’;}" "When using the libcaca (Coloured ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the ’cacascale’ variable for an accurate scaling.";
autocmd "PostReload" "" "aalib_fix";
autocmd "PostLoad" "" "aalib_fix";
autocmd "PostReload" "" "cacalib_fix";
autocmd "PostLoad" "" "cacalib_fix";
alias "refresh" "desc ’reload’;redisplay;" "reloads and displays image description";
bind "F5" "refresh";
bind "F11" "if(_device_string==’sdl’ && !_fullscreen){_old_sw=_screen_width;_old_sh=_screen_height;display ’reinit’ ’mW0:0’;_fullscreen=1;}else if(_device_string==’sdl’ && _old_sw*_old_sh*_fullscreen){display ’reinit’ ’rwm’._old_sw.’:’._old_sh;_fullscreen=0;}" "Toggles full screen. Will show mouse cursor in full screen.";

autocmd "PostReload" "" "i:fresh=1" ;
autocmd "PostScale" "" "if(0==i:_will_display){i:fresh=1;display;}" ;
autocmd "PostPan" "" "{i:fresh=1;display;}" ;
autocmd "PostReload" "" "if(i:fresh){redisplay;}";
autocmd "PostInteractiveCommand" "" "if(i:fresh){display;i:fresh=0;}";
autocmd "PostInteractiveCommand" "" "if(_want_prefetch>0){prefetch;}";
autocmd "PostInteractiveCommand" "" "if(_display_console==0 && i:fresh){redisplay;i:fresh=0;}";
autocmd "PostInteractiveCommand" "" "idempotent_cmd"; # Bug workaround: without it console scroll is broken.

alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep ’1’;}" "goes forward 10 images";
alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep ’1’;}" "goes backward 10 images";
bind ’N’ ’next10’;
bind ’P’ ’prev10’;
bind ’C-n’ "goto ’+//’";
bind ’C-p’ "goto ’-//’";
bind ’C-b’ "goto ’-//’"; # Warning: many configurations cannot detect C-b.
bind ’W’ "display ’resize’" "if supported, resizes the window to match the current image pixels size";
#bind ’C-w’ "scale ’100%’;display ’resize’" "if supported, scales the image to 100% and resizes the window to match its size (if fits)";
bind ’C-w’ "if(_scale_style!=’w’){_scale_style=’w’;scale ’w’;}else{_scale_style=’’;scale ’100%’;}" "scale to width";
alias "endless_slideshow" "while(1){display;sleep ’1’;next;}" "performs an automated slideshow, endlessly";
alias "bookview" "while(1){display;sleep ’2’;scroll ’down’;}" "";
alias "comicview" "while(1){display;sleep ’1’;scroll ’down’;}" "";
alias "read" "while(1){display;sleep ’1’;scroll ’forward’;}" "";
alias "slowread" "while(1){display;sleep ’2’;scroll ’forward’;}" "";
alias "fastread" "while(1){display;scroll ’forward’;}" "proceeds like in a book bug very fast";
alias "pornview" "echo ’press any key repeatedly to terminate’ ;endless_slideshow" "enters an endless slideshow";
autocmd "PreExecutionCycle" "/fbps-" "_display_busy=0;_display_status=0" ;
autocmd "PreExecutionCycle" "" "i:fresh=1;reload";
autocmd "PreExecutionCycle" "/fbps-.*ps001.png" "i:fresh=1;redisplay";
## Example in imposing a file loader to an extension:
#autocmd "PreReload" ".*mtx.gz" "_file_loader=’MatrixMarket’";
#autocmd "PostReload" ".*mtx.gz" "_file_loader=’’";
bind ’*’ "_display_console=0;toggleVerbosity;echo i:*";
bind ’w’ "scale ’w’";
bind ’<’ "rotate10_ccw;display";
bind ’>’ "rotate10;display";
bind ’_’ "_scale_style=’’;scale ’100%’";
bind ’,’ "_display_console=1;echo _last_system_output";
bind ’C-a’ "if(_scale_style!=’a’){_scale_style=’a’;scale ’a’;}else{_scale_style=’’;scale ’100%’;}" "scale to height";
#
alias "pan_nw" "pan ’nw’" "pans the image to the upper left";
alias "pan_ne" "pan ’ne’" "pans the image to the upper right";
alias "pan_se" "pan ’se’" "pans the image to the lower left";
alias "pan_sw" "pan ’sw’" "pans the image to the lower right";
alias "pan_down" "if(_display_console==0){pan ’down’;}else{scd;}" "pans the image down / scrolls console down";
alias "pan_up" "if(_display_console==0){pan ’up’ ;}else{scu;}" "pans the image up / scrolls console up";
alias "pan_left" "pan ’left’" "pans the image left";
alias "pan_right" "pan ’right’" "pans the image right";
alias "diagonal_nw" "pan_nw" "pans the image to the upper left";
alias "diagonal_ne" "pan_ne" "pans the image to the upper right";
alias "diagonal_se" "pan_se" "pans the image to the lower left";
alias "diagonal_sw" "pan_sw" "pans the image to the lower right";
bind ’d’ "diagonal_nw";
bind ’D’ "diagonal_se";
bind ’x’ "diagonal_ne";
bind ’X’ "diagonal_sw";
alias "toggleDisplayStatus" "_display_status=1-_display_status;redisplay" "";
alias "toggleDisplayBusy" "_display_busy=1-_display_busy" "";
alias "sort" "list ’sort’" "sorts the files list ordered";
bind ’o’ "sort";
bind ’b’ "prev";
bind ’B’ "toggleDisplayBusy";
alias "random_slideshow" "while(1){goto random;}" "performs a shuffled slideshow";
alias "rotate90_ccw" "i:_orientation=i:_orientation+3;i:fresh=1;i:fresh=1;redisplay" "rotate 90 degrees counter clockwise";
alias "rotate90_cw" "i:_orientation=i:_orientation+1;i:fresh=1;i:fresh=1;redisplay" "rotate 90 degrees clockwise";
alias "rotate180" "i:_orientation=i:_orientation+2;i:fresh=1;i:fresh=1;redisplay" "rotate 180 degrees";
alias "rotate90" "rotate90_cw;display" "rotate 90 degrees clockwise";
alias "rotate270" "rotate90_ccw;display" "rotate 90 degrees counter clockwise";
alias "rotate10" "rotate ’10’;display" "rotate 10 degrees counter clockwise";
alias "rotate10_ccw" "rotate -10 ;display" "rotate 10 degrees clockwise";

bind ’K’ ’if(_display_console==0){echo i:_filename.": ".i:_comment;toggleVerbosity}else{toggleVerbosity;}’;
bind ’C-k’ ’crop’ # still experimental

alias ’cache’ ’echo _cache_status’ "displays cached images status";
bind ’c’ ’align "center"’;
alias ’widen’ ’i:ascale=i:ascale*"1.1";*1.0’ "widen the current image";
alias ’narrow’ ’i:ascale=i:ascale/"1.1";*1.0’ "narrow the current image";
bind ’y’ "widen" "widen horizontally the image";
bind ’Y’ "narrow" "shrink horizontally the image";
alias ’console_scroll_up’ ’if(_console_offset<_console_lines+console_scroll_n-_rows){_console_offset=_console_offset+console_scroll_n;}’ "scrolls up the virtual console";
alias ’console_scroll_down’ ’if(allow_round_scroll || (_console_offset>=console_scroll_n)){_console_offset=_console_offset-console_scroll_n;}’ "scrolls down the virtual console";
alias ’console_scroll_reset’ ’{_console_offset=0;}’;
alias ’scu’ ’console_scroll_up’ "";
alias ’scd’ ’console_scroll_down’ "";
alias ’scz’ ’console_scroll_reset’ "";
alias ’center’ ’align "center"’;
alias ’left’ ’align "left"’;
alias ’right’ ’align "right"’;
alias ’top’ ’align "top"’;
alias ’bottom’ ’align "bottom"’;
alias "font_magnify_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction-1;}else{_fbfont_as_screen_fraction=_screen_width/100+_screen_height/100;}" "";
alias "font_magnify_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor+1" "";
alias "font_reduce_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction+1;}" "";
alias "font_reduce_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor-1" "";
alias "toggle_font_auto_scale" "if(_fbfont_as_screen_fraction<0){_fbfont_as_screen_fraction=0;echo ’Auto font scaling on.’;}else{_fbfont_as_screen_fraction=-1;echo ’Auto font scaling off.’;}" "toggles between manual and auto font scaling control";
alias ’next_file_dir_same’ "goto ’+/s’;" "go to next file in same dir";
alias ’next_file_dir_other’ "goto ’+/S’;" "go to next file in other dir";
alias ’next_file_dir_up’ "goto ’+/u’;" "go to next file up the dir hierarchy";
alias ’next_file_dir_down’ "goto ’+/d’;" "go to next file down the dir hierarchy";
alias ’next_file_same_basename’ "goto ’+/b’;" "go to next file with same basename";
alias ’prev_file_dir_same’ "goto ’-/s’;" "go to prev file in same dir";
alias ’prev_file_dir_other’ "goto ’-/S’;" "go to prev file in other dir";
alias ’prev_file_dir_up’ "goto ’-/u’;" "go to prev file up the dir hierarchy";
alias ’prev_file_dir_down’ "goto ’-/d’;" "go to prev file down the dir hierarchy";
alias ’prev_file_same_basename’ "goto ’-/b’;" "go to prev file with same basename";
#alias "font_magnify" "if(_fbfont_as_screen_fraction<0) {font_magnify_manual;}else{font_magnify_auto;}" "increase font size (either relative or absolute)";
#alias "font_reduce" "if(_fbfont_as_screen_fraction<0) {font_reduce_manual;} else{font_reduce_auto;}" "increase font size (either relative or absolute)";
alias "font_magnify" "_fbfont_as_screen_fraction=-1;font_magnify_manual" "increase absolute font size and set manual font control";
alias "font_reduce" "_fbfont_as_screen_fraction=-1;font_reduce_manual" "decrease absolute font size and set manual font control";
bind "PageUp" "if(_display_console==0){prev;}else{scu;}";
bind "PageDown" "if(_display_console==0){next;}else{scd;}";
bind "Home" "0;";
bind "End" "$;";
bind "^" "0;";
bind "$" "$;";
#bind "Backspace" "prev"; # console code for C-h and Backspace is the same :-)
bind "’" "goto _lastfileindex";
bind ’"’ "scale ’shadow’;i:fresh=1;redisplay;";
bind ’(’ "goto ’^p’";
bind ’)’ "goto ’$p’";
bind ’Z’ "sleep 1";
_display_status=1; # lower status line
_want_wm_caption_status="fim:%N@%p%%%L[%i/%l]";
_info_fmt_str="%p%% %wx%h%L %i/%l%P %F %T %c"; # lower right line part
#_display_status_fmt="%N:%k"; #
_display_status_fmt="%N%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?%?EXIF_ExposureTime?[%:EXIF_ExposureTime:]?%?EXIF_FNumber?[%:EXIF_FNumber:]?%?EXIF_ApertureValue?[%:EXIF_ApertureValue:]?%?EXIF_ISOSpeedRatings?[ISO%:EXIF_ISOSpeedRatings:]?:%k"; # lower left line part
#_fbfont_as_screen_fraction=-1; # disable auto font scaling
echo "WELCOME: to switch to the command line interface press ’:’";
# More examples:
#alias "plisten" ’popen "nc -l -p 9999 "’ "executes fim commands coming from port 9999 on this computer";
#alias "wlisten" "while(1){sleep;plisten;}" "listen to a pipe, endlessly";
#alias "musicplay" "system ’mpc’ ’play’" "";
#alias "musicpause" "system ’mpc’ ’pause’" "";
#alias "rdjpgcom" ’system "rdjpgcom" i:_filename’;
# offsetscan usage : need a mechanism for popping all images before.
#alias "offsetscan" "while(i:width<1){list ’push’ ’blob.jpg’;stdout _open_offset ;_open_offset=_open_offset+1;reload;}";
#alias "webcam" "pread ’vgrabbj -d /dev/video0’";
#alias "webcam_cycle" "while(1){webcam;reload;sleep 1;}";
# This is a FIM initialization file.
# Without it FIM cannot work like it should.
# Feel free to modify it, but with caution!

NOTES

This manual page could be improved. Certain side effects of commands are not documented. Neither a formal description of the various commands. Interaction of commands and variables is also not completely documented.

BUGS

The fim language shall be more liberal with quoting.

SEE ALSO

fim(1), fimgs(1), regex(1).

AUTHOR

Michele Martone <dezperado _CUT_ autistici _CUT_ org>

COPYRIGHT

See copyright notice in fim(1).


fim-0.6-rc2/doc/fimgs.man.in0000644000175000017500000000436714454353765012545 00000000000000.TH fimgs 1 "(c) 2007-2023 Michele Martone" .SH NAME fimgs - poor man's [http://]PostScript/pdf/dvi/cbr/rar/cbz/zip viewer based on fim .SH SYNOPSIS .B fimgs [ {fimgs-options} ] file [-- [{fim-options}]] .SH DESCRIPTION .B fimgs is a wrapper script which takes a PostScript or pdf or .cbr or .rar or .cbz or .zip or .dvi or any of the above prefixed with http:// or https:// or ssh: as input, renders the pages using ghostscript into a temporary directory and finally calls \fB fim\fP to display them. In case of compressed archives (in ZIP or RAR formats), the images are decompressed into a directory and displayed using \fB fim\fP. In this case, only images contained in the archive will be displayed (no nested archives or pdf's or ps's or dvi's). The temporary directory name will be of the form $TMPDIR/fbps-$$. If the $TMPDIR environment variable is unset, /dev/shm and /var/tmp will be checked for existence and permissions. The $$ above is the script process ID. The script deletes the temporary directory when \fB fim\fP terminates. In order to uncompress RAR archives, fimgs will use 'unrar-nonfree' or 'rar' or 'unrar-free'. In order to uncompress ZIP archives, fimgs will use 'zip'. In order to uncompress BZ2 files, 'bunzip2' will be used, if present. In order to uncompress TAR.GZ or TAR.BZ2 or TAR.XZ archives, fimgs will use 'tar'. In order to fetch http:// or https:// prefixed URLS, 'wget' will be used, if present. In order to fetch ssh: prefixed host:path locations, 'scp' will be used. In case of a CBZ, CBR, PDF, PS, or DVI file, will invoke \fB fim\fP with '--autotop --autowidth'. .SH OPTIONS To pass through options to \fB fim\fP, you may specify them after "--". Default options are '--autozoom'. .B -r {resolution} Specify resolution for the 'gs' -r option (e.g.: 96x96; default 120x120). .TP .B -m Dump a man page for fimgs. .TP .B -p {password} Specify password for the 'gs' -p (password) option. .TP .B -h Will display a help message. .\" Additionally you can specify -l, -xl or -xxl to get the pages .\" rendered with 100, 120 or 150 dpi (default is 75). .SH SEE ALSO fim(1), fimrc(1), gs(1), fbi(1), fbgs(1), bash(1) ,zip(1), rar(1), rar-free(1), unrar-free(1), tar(1), gzip(1) .SH AUTHOR Michele Martone . fim-0.6-rc2/doc/fimgs.man.html0000644000175000017500000001165214503371626013065 00000000000000 fimgs

fimgs

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
SEE ALSO
AUTHOR

NAME

fimgs - poor man’s [http://]PostScript/pdf/dvi/cbr/rar/cbz/zip viewer based on fim

SYNOPSIS

fimgs [ {fimgs-options} ] file [-- [{fim-options}]]

DESCRIPTION

fimgs is a wrapper script which takes a PostScript or pdf or .cbr or .rar or .cbz or .zip or .dvi or any of the above prefixed with http:// or https:// or ssh: as input, renders the pages using ghostscript into a temporary directory and finally calls fim to display them.

In case of compressed archives (in ZIP or RAR formats), the images are decompressed into a directory and displayed using fim. In this case, only images contained in the archive will be displayed (no nested archives or pdf’s or ps’s or dvi’s).

The temporary directory name will be of the form $TMPDIR/fbps-$$. If the $TMPDIR environment variable is unset, /dev/shm and /var/tmp will be checked for existence and permissions. The $$ above is the script process ID. The script deletes the temporary directory when fim terminates.

In order to uncompress RAR archives, fimgs will use ’unrar-nonfree’ or ’rar’ or ’unrar-free’.

In order to uncompress ZIP archives, fimgs will use ’zip’.

In order to uncompress BZ2 files, ’bunzip2’ will be used, if present.

In order to uncompress TAR.GZ or TAR.BZ2 or TAR.XZ archives, fimgs will use ’tar’.

In order to fetch http:// or https:// prefixed URLS, ’wget’ will be used, if present.

In order to fetch ssh: prefixed host:path locations, ’scp’ will be used.

In case of a CBZ, CBR, PDF, PS, or DVI file, will invoke fim with ’--autotop --autowidth’.

OPTIONS

To pass through options to fim, you may specify them after "--".

Default options are ’--autozoom’.

-r {resolution} Specify resolution for the ’gs’ -r option (e.g.: 96x96; default 120x120).

-m

Dump a man page for fimgs.

-p {password}

Specify password for the ’gs’ -p (password) option.

-h

Will display a help message.

SEE ALSO

fim(1), fimrc(1), gs(1), fbi(1), fbgs(1), bash(1) ,zip(1), rar(1), rar-free(1), unrar-free(1), tar(1), gzip(1)

AUTHOR

Michele Martone <dezperado _ GUESS _ autistici.org>.


fim-0.6-rc2/doc/fimrc.man0000644000175000017500000020014314454353765012121 00000000000000.\" .\" $Id$ .\" .TH fimrc 5 "(c) 2011\-2023 Michele Martone" .SH NAME fimrc \- \fB fim \fP configuration file and language reference .SH SYNOPSIS .B ~/.fimrc .fi .B /usr/local/etc/fimrc .fi .B fim \-\-script\-from\-stdin [ {options} ] < {scriptfile} .fi .B fim \-\-execute\-script {scriptfile} [ {options} ] .fi .B fim \-\-execute\-commands {commands} [ {options} ] .fi .B fim \-\-final\-commands {commands} [ {options} ] .fi .B fim \-\-write\-scriptout {scriptfile} [ {options} ] .fi .B fim \-\-write\-scriptout /dev/stdout [ {options} ] .fi .B fim \-\-chars\-press :{commands} [ {options} ] .fi .B fim \-\-chars\-press :{commands} \-\-chars\-press '' [ {options} ] .fi .SH DESCRIPTION This page explains the .B fim language, which is used for the .B fimrc configuration files, {scriptfile}s, or {commands} passed via command line {options}. This language can be used to issue commands (or programs) from the internal program command line accessed interactively through the ":" key (or rather, the key code specified by the "\fB_console_key\fP" variable). One may exit from command line mode by pressing the Enter key on an empty line (a non empty command line would be submitted for execution), or the Esc key (only in SDL mode). The general form of a fim command/program is shown in the next section. .SH FIM LANGUAGE GRAMMAR This section specifies the grammar of the .B fim language. Language elements surrounded by a single quote ("'") are literals. Warning: at the present state, this grammar has conflicts. A future release shall fix them. program: %empty | statement_list statement_list: statement | statement ';' statement_list | non_atomic_statements_block statement_list | statements_block non_atomic_statements_block: '{' statement_list '}' | INTEGER '{' statement_list '}' | conditional_statement statements_block: atomic_statements_block | non_atomic_statements_block conditional_statement: if_statement | loop_statement if_statement: 'if' '(' expression ')' statements_block | 'if' '(' expression ')' statements_block 'else' statements_block loop_statement: 'while' '(' expression ')' statements_block | 'do' statements_block 'while' '(' expression ')' atomic_statements_block: statement ';' | statement ';' ';' | statement ';' ';' ';' statement: '!' arguments | INTEGER ',' INTEGER IDENTIFIER | INTEGER ',' INTEGER IDENTIFIER arguments | INTEGER IDENTIFIER | SLASH_AND_REGEXP | '+' UNQUOTED_FLOAT '%' | '+' QUOTED_FLOAT '%' | '+' INTEGER '%' | '*' UNQUOTED_FLOAT | '*' QUOTED_FLOAT | '*' INTEGER | UNQUOTED_FLOAT '%' | QUOTED_FLOAT '%' | INTEGER '%' | '\-' UNQUOTED_FLOAT '%' | '\-' QUOTED_FLOAT '%' | '\-' INTEGER '%' | INTEGER | '\-' INTEGER | IDENTIFIER | IDENTIFIER FILE_PATH | IDENTIFIER arguments | INTEGER IDENTIFIER arguments | IDENTIFIER '=' expression arguments: expression | expression arguments expression: '(' expression ')' | expression '.' expression | '!' expression | expression '%' expression | expression '+' expression | expression '\-' expression | expression '*' expression | expression '/' expression | expression '<' expression | expression '>' expression | expression '||' expression | expression BOR expression | expression '&&' expression | expression BAND expression | expression '>=' expression | expression '<=' expression | expression '!=' expression | expression '==' expression | expression '=~' expression | '\-' expression | IDENTIFIER | INTEGER | QUOTED_FLOAT | UNQUOTED_FLOAT | STRING A STRING can be either a single quoted string or a double quoted string. A floating point number can be either unquoted (UNQUOTED_FLOAT) or quoted (QUOTED_FLOAT). A QUOTED_FLOAT is a floating point number, either single ("'") or double (""") quoted. An INTEGER shall be an unsigned integer number. An IDENTIFIER shall be one of the valid fim commands (see .B COMMANDS REFERENCE ) or a valid alias. A VARIABLE shall be an already declared or undeclared variable identifier (see .B VARIABLES REFERENCE ) or a valid alias, created using the .B alias command. The "=~" operator treats the right expression as a STRING, and uses it as a regular expression for matching purposes. The SLASH_AND_REGEXP is a slash ("/") followed by a STRING, interpreted as a regular expression. If 'INTEGER , INTEGER IDENTIFIER arguments' is encountered, command IDENTIFIER will be repeated on each file in the interval between the two INTEGERs, and substituting the given file name to any '{}' found in the commands arguments (which must be quoted in order to be treated as strings). See \fR\fIregex\fR(1) for regular expression syntax. The way some one\-line statements are evaluated: .nf : enter command line mode :{number} jump to {number}^th image in the list :^ jump to first image in the list :$ jump to last image in the list :*{factor} scale the image by {factor} :{scale}% scale the image to the desired {scale} :+{scale}% scale the image up to the desired percentage {scale} (relatively to the original) :\-{scale}% scale the image down to the desired percentage {scale} (relatively to the original) /{regexp} entering the pattern {regexp} (with /) makes fim jump to the next image whose filename matches {regexp} /*.png$ entering this pattern (with /) makes fim jump to the next image whose filename ends with 'png' /png a shortcut for /.*png.* 2,4 stdout '{}' print three filenames to standard output. !{syscmd} executes the {syscmd} quoted string as an argument to the "system" fim command. .SH COMMANDS REFERENCE .na .B alias .fi alias [{identifier} [{commands} [{description}]]] .fi Without arguments, lists the current aliases. .fi With one, shows an identifier's assigned command. .fi With two, assigns to an identifier a user defined command or sequence of commands. .fi With three, also assigns a help string. .fi .na .B align .fi align ['bottom'|'top'|'left'|right']: if image larger than drawing area, align one side of the image to the border. .fi align 'center': align equally far from all sides. .fi align 'info': print internal alignment information. .fi .na .B autocmd .fi autocmd {event} {pattern} {commands}: manipulate autocommands (inspired from Vim autocmd's). .fi Without arguments, list autocommands. .fi With arguments, specifies for which type of event and which current file open, which commands to execute. .fi See the default built\-in configuration files for examples. .fi .na .B autocmd_del .fi autocmd_del: specify autocommands to delete. .fi Usage: autocmd_del {event} {pattern} {commands}. .fi .na .B basename .fi basename {filename}: returns the basename of {filename} in the '_last_cmd_output' variable. .fi .na .B bind .fi bind [{keysym} [{commands}]]: bind a keyboard symbol/shortcut {keysym} to {commands}. .fi If {keysym} is at least two characters long and begins with 0 (zero), the integer number after the 0 will be treated as a raw keycode to bind the specified {keysym} to. .fi Use the '_verbose_keys' variable to discover (display device dependent) raw keys. .fi Key binding is dynamical, so you can rebind keys even during program's execution. .fi You can get a list of valid symbols (keysyms) by invoking dump_key_codes or in the man page. .fi .na .B cd .fi cd {path}: change the current directory to {path}. .fi If {path} is a file, use its base directory name. .fi cd '\-' will change to the previous current directory (before the last ':cd {path}' command). .fi .na .B clear .fi clear: clear the virtual console. .fi .na .B commands .fi commands: display the existing commands. .fi .na .B color .fi color [desaturate]: desaturate the displayed image colors. .fi color [negate]: negate the displayed image colors. .fi color [colorblind|c|deuteranopia|d]: simulate a form of the deuteranopia color vision deficiency (cvd). .fi color [protanopia|p]: simulate a form of the protanopia cvd. .fi color [tritanopia|t]: simulate a form of the tritanopia cvd. .fi color [daltonize|D]: if following a cvd specification, will attempt correcting it. .fi color [identity]: populate the image with 'RGB identity' pixels. .fi To get back the original you will have to reload the image. .fi .na .B crop .fi crop: crop image to a centered rectangle, half the width and half the height. .fi crop {p}: crop image to the middle {p} horizontal percent and {p} vertical percent of the image. .fi crop {w} {h}: crop image to the middle {w} horizontal percent and {h} vertical percent of the image. .fi crop {x1} {y1} {x2} {y2}: crop image to the area between the upper left ({x1},{y1}) and lower right ({x2},{y2}) corner. .fi Units are intended as percentage (0 to 100). .fi Note: still experimental functionality. .fi .na .B desc .fi desc 'load' {filename} [{sepchar}]: load description file {filename}, using the optional {sepchar} character as separator. .fi desc 'reload': load once again description files specified at the command line with \-\-load\-image\-descriptions\-file, with respective separators. .fi desc ['\-all'] ['\-append'] ['\-nooverw'] 'save' {filename} [{sepchar}]: save current list descriptions to file {filename}, using the optional {sepchar} character as separator, and if '\-all' is present will save the variables, and if '\-append' is present, will only append, and if '\-nooverw' is present, will not overwrite existing files. .fi See documentation of \-\-load\-image\-descriptions\-file for the format of {filename}. .fi .na .B display .fi display ['reinit' {string}]|'resize' {w} {h}]: display the current file contents. .fi If 'reinit' switch is supplied, the '{string}' specifier will be used to reinitialize (e.g.: change resolution, window system options) the display device. .fi See documentation for the \-\-output\-device command line switch for allowed values of {string}. .fi If 'resize' and no argument, will ask the window manager to size the window like the image. .fi If 'resize' and two arguments, these will be used as width and height of window, to set. .fi .na .B dump_key_codes .fi dump_key_codes: dump the active key codes (unescaped, for inspection purposes). .fi .na .B echo .fi echo {args}: print the {args} on console. .fi .na .B else .fi if(expression){action;}['else'{action;}]: see else. .fi .na .B eval .fi eval {args}: evaluate {args} as commands, executing them. .fi .na .B exec .fi exec {filename(s)}: execute script {filename(s)}. .fi .na .B font .fi font 'scan' [{dirname}]: scan {dirname} or /usr/share/consolefonts looking for fonts in the internal fonts list. .fi font 'load' {filename}: load font {filename}. .fi font 'next'/'prev': load next/previous font in the internal fonts list. .fi font 'info': print current font filename. .fi .na .B getenv .fi getenv {identifier}: create a variable with the same value as the '{identifier}' environment variable, but with an identifier prefixed by 'ENV_'. So e.g. getenv 'DISPLAY' creates 'ENV_DISPLAY'. Nothing is being printed; no variable is created if {identifier} is empty. .fi .na .B goto .fi goto {['+'|'\-']{number}['%']['f'|'p'|'F'|'P']} | {/{regexp}/} | {?{filename}} | {'+//'} | {'+/'|'\-/'}[C] | {{'+'|'\-'}{identifier}['+']}: jump to an image. .fi If {number} is given, and not surrounded by any specifier, will go to image at index {number}. .fi If followed by '%', the effective index will be computed as a percentage to the current available images. .fi If prepended by '\-' or '+', the jump will be relative to the current index. .fi The 'f' specifier asks for the jump to occur within the files (same for 'F', but accelerates if keep pressing). .fi The 'p' specifier asks for the jump to occur in terms of pages, within the current file (same for 'P', but accelerates if keep pressing). .fi If /{regexp}/ is given, will jump to the first image matching the given /{regexp}/ regular expression pattern. .fi If the argument starts with ?, jump to the filename following ?. .fi If given '+//', will jump to the first different image matching the last given regular expression pattern. .fi With '+/'C or '\-/'C will jump to next or previous file according to C: if 's' if same directory, if 'd' if down the directory hierarchy, if 'u' if down the directory hierarchy, if 'b' if same basename, if upper case match is negative, if missing defaults to 'S' (jump to file in different dir). .fi If {identifier|identifier2...}] is encountered after a '+' or '\-' sign, jump to next or previous image having a different value for any corresponding i:{identifier} (a trailing '+' will require a non empty value). .fi Match will occur on both file name and description, possibly loaded via desc or \-\-load\-image\-descriptions\-file; see also '_lastgotodirection' and '_re_search_opts'. .fi You can specify multiple arguments to goto: those after the first triggering a jump will be ignored. .fi Executes autocommands for events PreGoto and PostGoto. Keeping pressed shall accelerate images browsing. .fi .na .B help .fi help [{identifier}]: provide online help, assuming {identifier} is a variable, alias, or command identifier. .fi If {identifier} begins with '/', the search will be on the help contents and a list of matching items will be given instead. .fi A list of commands can be obtained simply invoking 'commands'; a list of aliases with 'alias'; a list of bindings with 'bind'. .fi .na .B if .fi if(expression){action;}['else'{action;}]: see 'else'. .fi .na .B info .fi info: display information about the current file. .fi .na .B limit .fi limit {'\-list'|'\-listall'} 'variable'|['\-further'|'\-merge'|'\-subtract'] [{expression} |{variable} {value}]: A browsable file list filtering function (like limiting in the 'mutt' program). Uses information loaded via \-\-load\-image\-descriptions\-file. .fi If invoked with '\-list'/'\-listall' only, will list the current description variable ids. .fi If invoked with '\-list'/'\-listall' 'id', will list set values for the variable 'id'. .fi If '\-further' is present, will start with the current list; if not, with the full list. .fi If '\-merge' is present, new matches will be merged in the existing list and sorted. .fi If '\-subtract' is present, sort and filter out matches. .fi If {variable} and {values} are provided, limit to files having property {variable} set to {value}. .fi If {expression} is one exclamation point ('!'), will limit to the currently marked files only. .fi If {expression} is '~!' will limit to files with unique basename. .fi if '~=', to files with duplicate basename. .fi if '~^', to the first of the files with duplicate basename. .fi if '~$\:', to the last of the files with duplicate basename. .fi On '~i' [MINIDX][\-][MAXIDX], (each a number possibly followed by a multiplier 'K') will limit on filenames in position MINIDX to MAXIDX. .fi On '~z' will limit to files having the current file's size. .fi on '~z' [MINSIZE][\-][MAXSIZE], (each a number possibly followed by a multiplier among 'k','K','m','M') will limit on filesize within these limits. .fi on '~d' will limit to files having the current file's date +\- one day. .fi on '~d' [MINTIME][\-][MAXTIME], (each the count of seconds since the Epoch (First of Jan. of 1970) or a date as DD/MM/YYYY) will limit on file time (struct stat's 'st_mtime', in seconds) within this interval. .fi For other values of {expression}, limit to files whose description string matches {expression}. .fi Invoked with no arguments, the original browsable files list is restored. .fi .na .B list .fi list: display the files list. .fi list 'random_shuffle': randomly shuffle the file list. .fi list 'reverse': reverse the file list. .fi list 'clear': clear the file list. .fi list 'sort': sort the file list. .fi list 'sort_basename': sort the file list according to base name. .fi list 'sort_comment': sort the file list according to the value of the _comment variable. .fi list 'sort_var' {var}: sort the file list according to the value of the i:{var} variable. .fi list 'vars|variables': list variables in all i:* read from description file. .fi list 'sort_fsize': sort the file list according to file size. .fi list 'sort_mtime': sort the file list according to modification date. .fi list 'pop': remove the current file from the files list, and step back. .fi list 'remove' [{filename(s)}]: remove the current file, or the {filename(s)}, if specified. .fi list 'push' {filename(s)}: push {filename(s)} to the back of the files list. .fi list 'filesnum': display the number of files in the files list. .fi list 'mark' [{args}]: mark image file names for stdout printing at exit, with {args} mark the ones matching according to the rules of the 'limit' command, otherwise the current file. .fi list 'unmark' [{args}]: unmark marked image file names, with {args} unmark the ones matching according to the rules of the 'limit' command, otherwise the current file. .fi list 'marked': show which files have been marked so far. .fi list 'dumpmarked': dump to stdout the marked files (you will want usually to 'unmarkall' afterwards). .fi list 'markall': mark all the current list files. .fi list 'unmarkall': unmark all the marked files. .fi list 'pushdir' {dirname}: will push all the files in {dirname}, when matching the regular expression in variable _pushdir_re or, if empty, from constant regular expression '\.(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$\:'. .fi list 'pushdirr' {dirname}: like pushdir, but will also push encountered directory entries recursively. .fi list 'swap': will move the current image filename to the first in the list (you'll have to invoke reload to see the effect). .fi Of the above commands, several will be temporarily non available for the duration of a background load (enabled by \-\-background\-recursive), which will last until _loading_in_background is 0. .fi .na .B load .fi load: load the image, if not yet loaded (see also 'reload'). .fi Executes autocommands for events PreLoad and PostLoad. .fi .na .B pan .fi pan {vsteps}% {hsteps}%: pan the image to {vsteps} percentage steps from the top and {hsteps} percentage steps from left. .fi pan {vsteps} {hsteps}: pan the image to {vsteps} pixels from the top and {hsteps} pixels from left. .fi pan {'down'|'up'|'left'|'right'|'ne'|'nw'|'se'|'sw'}[+\-] [{steps}['%']]: pan the image {steps} pixels in the desired direction. .fi If the '%' specifier is present, {steps} will be treated as a percentage of current screen dimensions. .fi If {steps} is not specified, the '_steps' variable will be used. .fi If present, the '_hsteps' variable will be considered for horizontal panning. .fi A '+' or '\-' sign at the end of the first argument will make jump to next or prev if border is reached. .fi If present, the '_vsteps' variable will be considered for vertical panning. .fi The variables may be terminated by the '%' specifier. .fi Executes autocommands for events PrePan and PostPan. .fi .na .B popen .fi popen {syscmd}: pipe a command, invoking popen(): spawns a shell, invoking '{syscmd}' and executing as fim commands the output of '{syscmd}'. .fi .na .B pread .fi pread {args}: execute {args} as a shell command and read the output as an image file (using 'popen'). .fi .na .B prefetch .fi prefetch: prefetch (read into the cache) the two nearby image files (next and previous), for a faster subsequent opening. .fi Executes autocommands for events PrePrefetch and PostPrefetch. .fi See also the '_want_prefetch' variable. .fi .na .B pwd .fi pwd: print the current directory name, and updates the '_pwd' variable. .fi .na .B quit .fi quit [{number}]: terminate the program. .fi If {number} is specified, use it as the program return status. .fi Note that autocommand 'PostInteractiveCommand' does not trigger after this command. .fi .na .B recording .fi recording 'start': start recording the executed commands. .fi recording 'stop': stop recording the executed commands. .fi recording 'dump': dump in the console the record buffer. .fi recording 'execute': execute the record buffer. .fi recording 'repeat_last': repeat the last performed action. .fi .na .B redisplay .fi redisplay: re\-display the current file contents. .fi .na .B reload .fi reload [{arg}]: load the image into memory. .fi If {arg} is present, will force reloading, bypassing the cache (see also 'load'). .fi Executes autocommands for events PreReload and PostReload. .fi .na .B rotate .fi rotate {number}: rotate the image the specified amount of degrees. If unspecified, by one. If you are interested in orthogonal rotations, see '_orientation' and related aliases. .fi Executes autocommands for events PreScale and PostScale. .fi .na .B scale .fi scale {['+'|'\-']{value}['%']|'*'{value}|'w'|'h'|'a'|'b'|'+[+\-*/]'|['<'|'>']|'shadow'}: scale the image according to a scale {value} (e.g.: 0.5,40%,'w','h','a','b'). .fi If given '*' and a value, will multiply the current scale by that value. .fi If given 'w', will scale according to the screen width. .fi If given 'h', scale to the screen height. .fi If given 'a', to the minimum of 'w' and 'h'. .fi If given 'b', like 'a', provided that the image width exceeds 'w' or 'h'. .fi If {value} is a number, will scale relatively to the original image width. .fi If the number is followed by '%', the relative scale will be treated on a percent scale. .fi If given '++'('+\-'), will increment (decrement) the '_magnify_factor', '_reduce_factor' variables by '_scale_factor_delta'. .fi If given '+*'('+/'), will multiply (divide) the '_magnify_factor', '_reduce_factor' variables by '_scale_factor_multiplier'. .fi If given '<' or '>', will shrink or magnify image using nearest mipmap (cached pre\-scaled version). If given 'shadow' as a parameter, search a same\-named file in one of the directories specified to \-\-load\-shadow\-dir. .fi Executes autocommands for events PreScale and PostScale. .fi .na .B scroll .fi scroll: scroll down the image, going next when hitting the bottom. .fi scroll 'forward': scroll the image as we were reading left to right (see '_scroll_skip_page_fraction' variable). .fi Executes autocommands for events PrePan and PostPan. .fi .na .B set .fi set: returns a list of variables which are set. .fi set {identifier}: returns the value of variable {identifier}. .fi set {identifier} {commands}: sets variable {identifier} to value {commands}. .fi .na .B set_commandline_mode .fi set_commandline_mode: set console mode. .fi .na .B set_interactive_mode .fi set_interactive_mode: set interactive mode. .fi .na .B sleep .fi sleep [{number}=1]: sleep for the specified (default 1) number of seconds. .fi .na .B status .fi status: set the status line to the collation of the given arguments. .fi .na .B stderr .fi stderr {args}: writes to stderr its arguments {args}. .fi .na .B stdout .fi stdout {args}: writes to stdout its arguments {args}. .fi .na .B system .fi system {syscmd}: get the output of executing the {syscmd} system command. Uses the popen() system call. Usually popen invokes "/bin/sh \-c {syscmd}". This might not handle a multi\-word command; in that case you will have to put it into a script. See 'man popen' for more. .fi .na .B variables .fi variables: display the existing variables. .fi .na .B unalias .fi unalias {identifier} | '\-a': delete the alias {identifier} or all aliases (use '\-a', not \-a). .fi .na .B unbind .fi unbind {keysym}: unbind the action associated to a specified {keysym} .fi If {keysym} is at least two characters long and begins with 0 (zero), the integer number after the 0 will be treated as a raw keycode to bind the specified {keysym} to. .fi Use the '_verbose_keys' variable to discover (display device dependent) raw keys. .fi .na .B while .fi while(expression){action;}: A conditional cycle construct. .fi May be interrupted by hitting the 'Esc' or the ':' key. .fi .na .B window .fi window {args}: this command is disabled. .fi .SH KEYSYMS REFERENCE " " "!" """ "#" "$" "%" "&" "'" "(" ")" "*" "+" "," "\-" "." "/" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" ":" ";" "<" "=" ">" "?" "@" "A" "Any" "B" "BackSpace" "Backspace" "C" "C\-a" "C\-b" "C\-c" "C\-d" "C\-e" "C\-f" "C\-g" "C\-h" "C\-i" "C\-j" "C\-k" "C\-l" "C\-m" "C\-n" "C\-o" "C\-p" "C\-q" "C\-r" "C\-s" "C\-t" "C\-u" "C\-v" "C\-w" "C\-x" "C\-y" "C\-z" "D" "Del" "Down" "E" "End" "Enter" "Esc" "F" "F1" "F10" "F11" "F12" "F2" "F3" "F4" "F5" "F6" "F7" "F8" "F9" "G" "H" "Home" "I" "Ins" "J" "K" "L" "Left" "M" "N" "O" "P" "PageDown" "PageUp" "Q" "R" "Right" "S" "T" "Tab" "U" "Up" "V" "W" "X" "Y" "Z" "[" "\\" "]" "^" "_" "`" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "{" "|" "}" "~" .SH AUTOCOMMANDS REFERENCE Available autocommands are: PreScale, PostScale, PrePan, PostPan, PreRedisplay, PostRedisplay, PreDisplay, PostDisplay, PrePrefetch, PostPrefetch, PreReload, PostReload, PreLoad, PostLoad, PreGoto, PostGoto, PreConfigLoading, PostConfigLoading, PreHardcodedConfigLoading, PostHardcodedConfigLoading, PreUserConfigLoading, PostUserConfigLoading, PreGlobalConfigLoading, PostGlobalConfigLoading, PreInteractiveCommand, PostInteractiveCommand, PreExecutionCycle, PostExecutionCycle, PreExecutionCycleArgs, PreWindow, PostWindow, and they are triggered on actions as suggested by their name. Those associated to actual commands are mentioned in the associated commands reference. .SH VARIABLES REFERENCE If undeclared, a variable will evaluate to 0. When assigning a variable to a string, use single or double quoting, otherwise it will be treated as a number. The namespaces in which variables may exist are: current image, global. A namespace is specified by a prefix, which can be: 'i:', be prepended to the variable name. The global namespace is equivalent to the empty one:''. The special variable i:* expands to the collation of all the name\-value pairs for the current image. In the following, the [internal] variables are the ones referenced in the source code (not including the hardcoded configuration, which may be inspected and/or invalidated by the user at runtime). .na .B _TERM [out,g:] the environment TERM variable. .fi .na .B __exif_flipped [out,i:] flipping information, read from the EXIF tags of a given image. .fi .na .B __exif_mirrored [out,i:] mirroring information, read from the EXIF tags of a given image. .fi .na .B __exif_orientation [out,i:] orientation information in the same format of _orientation, read from the orientation EXIF tags (i:EXIF_Orientation). .fi .na .B _all_file_loaders [out,g:] space\-separated list of hardcoded file loaders usable with _file_loader. .fi .na .B _archive_files [in,g:] Regular expression matching filenames to be treated as (multipage) archives. If empty, "\.(RAR|ZIP|TAR|TAR.GZ|TGZ|TAR.BZ2|TBZ|TBZ2|CBR|CBZ|LHA|7Z|XAR|ISO)$\:" will be used. Within each archive, only filenames matching the regular expression in the _pushdir_re variable will be considered for opening. .fi .na .B _autocmd_trace_stack [in,g:] dump to stdout autocommands (autocmd) stack trace during their execution (for debugging purposes). .fi .na .B _autodesaturate [in,g:] if 1, will desaturate images by default. .fi .na .B _autoflip [in,g:] if 1, will flip images by default. .fi .na .B _automirror [in,g:] if 1, will mirror images by default. .fi .na .B _autonegate [in,g:] if 1, will negate images by default. .fi .na .B _autotop [in,g:] if 1, will align to the top freshly loaded images. .fi .na .B _buffered_in_tmpfile [out,i:] if an image has been temporarily converted and decoded from a temporary file, its name is here. .fi .na .B _cache_control [in,g:] string for cache control. if it starts with 'm' mipmaps will be cached; if it starts with 'M' then not. otherwise defaults will apply. .fi .na .B _cache_status [out,g:] string with current information on cache status. .fi .na .B _cached_images [out,g:] the number of images currently cached. .fi .na .B _caption_over_image [in,g:] if set not to 0, will display a custom comment string specified according to the value of_caption_over_image_fmt; if larger than 1, with black background; if 3, image will be drawn possibly below. It will take at most half of the screen. .fi .na .B _caption_over_image_fmt [in,g:] custom info format string, displayed in a caption over the image; if unset: i:_comment; otherwise a custom format string specified just as _info_fmt_str. .fi .na .B _command_expansion [in,g:] if 1, will enable autocompletion (on execution) of alias and command strings. .fi .na .B _comment [i:,out] the image comment, extracted from the image file (if any). .fi .na .B _console_buffer_free [out,g:] amount of unused memory in the output console buffer. .fi .na .B _console_buffer_total [out,g:] amount of memory allocated for the output console buffer. .fi .na .B _console_buffer_used [out,g:] amount of used memory in the output console buffer. .fi .na .B _console_key [in,g:] the key binding (an integer variable) for spawning the command line; will have precedence over any other binding. .fi .na .B _console_lines [out,g:] the number of buffered output console text lines. .fi .na .B _console_offset [in,out,g:] position of the text beginning in the output console, expressed in lines. .fi .na .B _debug_commands [in,g:] debugging option string for printing out . if containing 'a', print out autocmd info; if containing 'c', print out each command; if containing 'k', print out each pressed key; if containing 'j', print interpreter internal steps; if containing 'B', clear screen and print background loading files; if containing 'C', print cache activity. .fi .na .B _device_string [out,g:] the current display device string. .fi .na .B _display_as_binary [in,g:] will force loading of the specified files as pixelmaps (no image decoding will be performed); if 1, using one bit per pixel; if 24, using 24 bits per pixel; otherwise will load and decode the files as usual. .fi .na .B _display_as_rendered_text [in,g:] will force loading of the specified files as text files (no image decoding will be performed); if 1; otherwise will load and decode the files as usual. .fi .na .B _display_busy [in,g:] if 1, will display a message on the status bar when processing. .fi .na .B _display_console [in,g:] if 1, will display the output console. .fi .na .B _display_status [in,g:] if 1, will display the status bar. .fi .na .B _display_status_bar [in,g:] if 1, will display the status bar. .fi .na .B _display_status_fmt [in,g:] custom info format string, displayed in the lower left corner of the status bar; if unset: full pathname; otherwise a custom format string specified just as _info_fmt_str. .fi .na .B _do_sanity_check [in,experimental,g:] if 1, will execute a sanity check on startup. .fi .na .B _downscale_huge_at_load [in,g:] if 1, will downscale automatically huge images at load time. .fi .na .B _exiftool_comment [out,g:] comment extracted via the exiftool interface; see _use_exiftool. .fi .na .B _fbfont [out,g:] The current console font file string. If the internal hardcoded font has been used, then its value is "fim://". .fi .na .B _fbfont_as_screen_fraction [in,g:] The rendered text will be scaled at least to this (integer) fraction of the screen. Disable font autoscaling with \-1. (Only enabled if configured with \-\-with\-font\-magnifying\-factor=FACTOR, with FACTOR<1). .fi .na .B _fbfont_magnify_factor [in,g:] The rendered text will use a font magnified by this (integer) factor. Maximal value is "16". (Only enabled if configured with \-\-with\-font\-magnifying\-factor=FACTOR, with FACTOR<1). .fi .na .B _fbfont_verbosity [in,g:] if > 0, verbose font loading .fi .na .B _file_load_time [out,i:] time taken to load the file and decode the image, in seconds. .fi .na .B _file_loader [in,i:,g:] if not empty, this string will force a file loader (among the ones listed in the \-V switch output); [out] i:_file_loader stores the loader of the current image. .fi .na .B _fileindex [out,g:] the current image numeric index. .fi .na .B _filelistlen [out,g:] current image list length (number of visible images). .fi .na .B _filename [out,i:] the current file name string. .fi .na .B _fim_bpp [out,g:] the bits per pixel count. .fi .na .B _fim_default_config_file_contents [out,g:] the contents of the default (hardcoded) configuration file (executed after the minimal hardcoded config). .fi .na .B _fim_default_grammar_file_contents [out,g:] the contents of the default (hardcoded) grammar file. .fi .na .B _fim_scriptout_file [in,g:] the name of the file to write to when recording sessions. .fi .na .B _fim_version [out,g:] fim version number; may be used for keeping compatibility of fim scripts across evolving versions. .fi .na .B _hsteps [in,g:] the default steps, in pixels, when panning images horizontally (overrides steps). .fi .na .B _ignorecase [in,g:] if 1, will allow for case insensitive regexp\-based match in autocommands (autocmd). .fi .na .B _info_fmt_str [in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets; %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set; EXP will be copied verbatim except for contained sequences of the form %:VAR:, which will be expanded to the value of variable i:VAR; this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF\-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) will be used only if present. .fi .na .B _inhibit_display [internal,g:] if 1, will inhibit display. .fi .na .B _last_cmd_output [out,experimental,g:] the last command output. .fi .na .B _last_file_loader [out,g:] after each image load, _last_file_loader will be set to the last file loader used. .fi .na .B _last_system_output [out,experimental,g:] the standard output of the last call to the system command. .fi .na .B _lastfileindex [out,g:] the last visited image numeric index. Useful for jumping back and forth easily between two images with 'goto _lastfileindex'. .fi .na .B _lastgotodirection [out,g:] the last file goto direction (either string '+1' or string '\-1'). .fi .na .B _load_default_etc_fimrc [in,g:] if 1 at startup, will load the system wide initialization file. .fi .na .B _load_fim_history [in,g:] if 1 on startup, will load the ~/.fim_history file on startup. .fi .na .B _load_hidden_dirs [in,g:] if not 1, when pushing directories/files, those whose name begins with a dot (.) will be skipped. .fi .na .B _loading_in_background [out,g:] 1 if program has been invoked with \-\-background\-recursive and still loading in background. .fi .na .B _loop_only_once [internal,g:] if 1 and doing a \-\-slideshow, do it once. .fi .na .B _lwidth [in,g:] if>0, will force the output console text width. .fi .na .B _magnify_factor [in,g:] the image scale multiplier used when magnifying images size. .fi .na .B _max_cached_images [in,g:] the maximum number of images after which evictions will be forced. Setting this to 0 (no limits) is ok provided _max_cached_memory is set meaningfully. .fi .na .B _max_cached_memory [in,g:] the maximum amount of memory (in KiB) at which images will be continued being added to the cache. Setting this to 0 (no limit) will lead to a crash (there is no protection currently). .fi .na .B _max_iterated_commands [g:] the iteration limit for N in "N[commandname]" iterated command invocations. .fi .na .B _min_cached_images [in,g:] the minimum number of images to keep from eviction; if less than four can lead to inefficiencies: e.g. when jumping between two images, each time an erase and a prefetch of neighboring images would trigger. default value is 4. .fi .na .B _no_default_configuration [in,g:] if 0, a default, hardcoded configuration will be executed at startup, after the minimal hardcoded one. .fi .na .B _no_external_loader_programs [in,g:] if 1, no external loading programs will be tried for piping in an unsupported type image file. .fi .na .B _no_rc_file [in,g:] if 1, the ~/.fimrc file will not be loaded at startup. .fi .na .B _open_offset [in,optional,g:,i:] offset (specified in bytes) used when opening a file; [out] i:_open_offset will be assigned to images opened at a nonzero offset. .fi .na .B _open_offset_retry [in,optional,g:] number of adjacent bytes to probe in opening the file. .fi .na .B _orientation [internal,i:] Orthogonal clockwise rotation (orientation) is controlled by: 'i:_orientation', 'g:_orientation' and applied on a per\-image basis. In particular, the values of the three variables are summed up and the sum is interpreted as the image orientation. If the sum is 0, no rotation will apply; if it is 1, a single ( 90') rotation will apply; if it is 2, a double (180') rotation will apply; if it is 3, a triple (270') rotation will apply. If the sum is not one of 0,1,2,3, the value of the sum modulo 4 is considered. Therefore, ":i:_orientation=1" and ":i:_orientation=5" are equivalent: they rotate the image one time by 90'. .fi .na .B _pread_cmd [in,g:] a user\-specified shell command emitting an image on stdout, in a format readable by the convert utility. If the current filename matches "^[/A\-Za\-z0\-9_.][/A\-Za\-z0\-9_.\-]*$\:", it will be substituted to any occurrence of '{}'. .fi .na .B _preferred_rendering_dpi [in,optional,g:] if >0, pdf, ps, djvu rendering will use this value for a default document dpi (instead of a default value). .fi .na .B _preferred_rendering_width [in,optional,g:] if >0, bit based rendering will use this value for a default document width (instead of a default value). .fi .na .B _push_checks [in,experimental,g:] if 1 (default), will check with stat() existence of input files before push'ing them (set this to 0 to speed up loading very long file lists; in these cases a trailing slash (/) will have to be used to tell fim a pathname is a directory). This only works after initialization (thus, after command line files have been push'ed); use \-\-no\-stat\-push if you wish to set this to 0 at command line files specification. .fi .na .B _push_pushes_dirs [in,g:] if 1, the push command will also accept and push directories (using pushdir). if 2, will also push hidden files/directories, that is, ones whose names begin with a dot (.). .fi .na .B _pushdir_re [in] regular expression to match against when pushing files from a directory or an archive. By default this is "\.(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$\:". .fi .na .B _pwd [out,g:] the current working directory; will be updated at startup and whenever the working directory changes. .fi .na .B _re_search_opts [in,g:] affects regexp\-based searches; if an empty string, defaults will apply; if contains 'i' ('I'), case insensitive (sensitive) searches will occur; if contains 'b', will match on basename, if contains 'f' on full pathname. .fi .na .B _reduce_factor [in,g:] the image scale multiplier used when reducing images size. .fi .na .B _retry_loader_probe [in,g:] if 1 and user specified a file loader and this fails, will probe for a different loader. .fi .na .B _rows [in,g:] if >0, will set the number of displayed text lines in the console. .fi .na .B _save_fim_history [in,g:] if 1 on exit, will save the ~/.fim_history file on exit. .fi .na .B _scale_factor_delta [in,g:] value used for incrementing/decrementing the scaling factors. .fi .na .B _scale_factor_multiplier [in,g:] value used for scaling up/down the scaling factors. .fi .na .B _scale_style [in,g:] if non empty, this string will be fed to the scale command; see its documentation for possible values. .fi .na .B _screen_height [out] the screen height. .fi .na .B _screen_width [out,g:] the screen width. .fi .na .B _scroll_skip_page_fraction [int,g:] if >1, fraction of page which will be skipped in when scrolling (e.g. 'scrollforward'); if 1, auto chosen; if <1, disabled. .fi .na .B _seek_magic [optional,g:] will seek a 'magic' signature in the file after opening it, and will try decoding it starting within the range of that signature (use like this: fim \-C '_seek_magic=MAGIC_STRING;push filename'). .fi .na .B _status_line [in,g:] if 1, will display the status bar. .fi .na .B _steps [in,g:] the default steps, in pixels, when panning images. .fi .na .B _sys_rc_file [in,g:] string with the global configuration file name. .fi .na .B _use_exiftool [in,g:] if >0 and supported, exiftool will be used to get additional information. if 1, this will be appened to _comment; if 2, will go to _exiftool_comment. .fi .na .B _use_mipmaps [in,g:] if >0, will use mipmaps to speed up downscaling of images (this has a memory overhead equivalent to one image copy); mipmaps will not be cached. If 2, will use every fourth source pixel instead of averaging (good for photos, not for graphs). .fi .na .B _verbose_errors [in,g:] if 1, will display on stdout internal errors, while parsing commands. .fi .na .B _verbose_keys [in,g:] if 1, after each interactive mode key hit, the console will display the hit key raw keycode. .fi .na .B _verbosity [in,experimental,g:] program verbosity. .fi .na .B _vsteps [in,g:] the default steps, in pixels, when panning images vertically (overrides steps). .fi .na .B _want_autocenter [in,g:] if 1, the image will be displayed centered. .fi .na .B _want_exif_orientation [in,g:] if 1, will reorient images using information from EXIF metadata (and stored in in __exif_orientation, __exif_mirrored, __exif_flipped ). .fi .na .B _want_prefetch [in,g:] if 1, will prefetch further files just after display of the first file; if 2 (and configured with \-\-enable\-cxx11) will load in the background. .fi .na .B _want_sleep_seconds [in,g:] number of seconds of sleep during slideshow mode. .fi .na .B _want_wm_caption_status [in,g:] this works only if supported by the display device (currently only SDL). if set to a number that is not 0, will show the status (or command) line in the window manager caption; if set to a non\-empty string, will interpret it just as a file info format string (see _info_fmt_str); if empty, will show the program version. .fi .na .B _want_wm_mouse_ctrl [in,g:] if at least 9 chars long, enable mouse click/movement behaviour when in SDL mode; the 9 chars will correspond to a 3x3 screen clickable grid and the equivalent command keys; clicking middle or right button will toggle on\-screen usage info. .fi .na .B angle [in,out,i:] a floating point number specifying the rotation angle, in degrees. .fi .na .B ascale [in,out,i:] the asymmetric scaling of the current image. .fi .na .B desaturated [out,i:] 1, if the image is desaturated. .fi .na .B flipped [out,i:] 1, if the image is flipped. .fi .na .B fresh [in,out,i:,experimental] 1 if the image was loaded, before all autocommands (autocmd) execution. .fi .na .B height [out,i:] the current image original height. .fi .na .B mirrored [out,i:] 1, if the image is mirrored. .fi .na .B negated [out,i:] 1, if the image is negated. .fi .na .B page [out,experimental,g:] the current page. .fi .na .B pages [out,experimental,i:] the current number of pages of an image. .fi .na .B random [out] a pseudorandom number. .fi .na .B scale [in,i:] the scale of the current image. .fi .na .B sheight [out,i:] the current image scaled height. .fi .na .B swidth [out,i:] the current image scaled width. .fi .na .B width [out,i:] the current image original width. .fi .SH DEFAULT ALIASES REFERENCE Hardcoded aliases are: .fi alias .B "A" "'_autotop=1\-_autotop;'" .fi alias .B "magnify" "scale '+'" # magnify the displayed image by the _magnify_factor variable or {args} .fi alias .B "next" "goto '+1'" # go to the next page or picture file .fi alias .B "next_file" "goto '+1f'" # go to the next file in the list .fi alias .B "next_page" "goto '+1p'" # go to the next page in the file .fi alias .B "prev" "goto '\-1'" # go to the previous page or picture file .fi alias .B "prev_file" "goto '\-1f'" # go to the previous file in the list .fi alias .B "prev_page" "goto '\-1p'" # go to the previous page in the file .fi alias .B "reduce" "scale '\-'" # reduce the displayed image by _reduce_factor or {args} .fi alias .B "scale_factor_decrease" "scale '+\-'" # subtract _scale_factor_delta to the scale factors _reduce_factor and _magnify_factor .fi alias .B "scale_factor_grow" "scale '+*'" # multiply the scale factors _reduce_factor and _magnify_factor by _scale_factor_multiplier .fi alias .B "scale_factor_increase" "scale '++'" # add _scale_factor_delta to the scale factors _reduce_factor and _magnify_factor .fi alias .B "scale_factor_shrink" "scale '+/'" # divide the scale factors _reduce_factor and _magnify_factor by _scale_factor_multiplier .fi .fi They can be redefined with .B alias or deleted with the .B unalias command. .fi Further default aliases are usually loaded at startup \-\- see the CONFIGURATION FILE EXAMPLE section below. .SH COMMAND LINE USAGE EXAMPLES .nf # jump to the third image: 3; # jump to first image: ^; # jump to last image: $; # magnify the image two times: *2; # scale the image to the 30% of the original: 30%; # scale the image up by 30%: +30%; # scale the image down by 30%: \-30%; # jump to the next image whose filename matches the ".*jpg" regular expression: /.*jpg; # executes the "date" system command !"date"; .SH CONFIGURATION FILE EXAMPLE Part of the default configuration comes from the \fB_fim_default_config_file_contents\fP variable, shown here. .nf One can skip its loading by using the \fB_no_default_configuration\fP variable. .nf # $LastChangedDate: 2023\-03\-09 00:38:06 +0100 (Thu, 09 Mar 2023) $ # Contents of the default 'fimrc' file, hardcoded in the fim executable. # Read the documentation (man fimrc) to discover how to change this default hardcoded file and how to make your own. # Note that usually a ~/.fimrc file is read after these options take effect, so you could reset all of this with ease. # Lines beginning with a pound (#) are ignored by fim (they are treated as comments). # # Internal variables. # Some of these variables influence fim's behaviour (input variables), some are set by fim (output variables). # It is wise the input variables are set at the beginning of the file, so the bottom may issue commands correctly affected by them. if(_cache_control==''){_cache_control='m';} if(_debug_commands==''){_debug_commands='';} if(_command_expansion==''){_command_expansion=1;} if(_display_status==''){_display_status=0;} if(_max_cached_images==''){_max_cached_images=5;} if(_min_cached_images==''){_min_cached_images=4;} if(_max_cached_memory==''){_max_cached_memory=81920;} if(_max_iterated_commands==''){_max_iterated_commands=100;} if(_want_prefetch==''){_want_prefetch=1;} if(_no_external_loader_programs==''){_no_external_loader_programs=0;} if(_scale_style==''){_scale_style='b';} if(_save_fim_history==''){_save_fim_history=1;} if(_load_fim_history==''){_load_fim_history=1;} if(_verbose_keys==''){_verbose_keys=0;} if(_display_busy==''){_display_busy=1;} if(_ignorecase==''){_ignorecase=1;} if(_re_search_opts==''){_re_search_opts='bi';} if(_console_offset==''){_console_offset=0;} if(_console_key==''){_console_key=58;} if(_display_as_binary==''){_display_as_binary=0;} if(_push_checks==''){_push_checks=1;} #if(_want_wm_caption_status==''){_want_wm_caption_status=0;} if(_want_exif_orientation==''){_want_exif_orientation=1;} if(ascale==''){ascale="1.0";} if(_use_mipmaps==''){_use_mipmaps=1;} if(_downscale_huge_at_load==''){_downscale_huge_at_load=1;} if(_scroll_skip_page_fraction==''){_scroll_skip_page_fraction=0;} if(_want_wm_mouse_ctrl==''){_want_wm_mouse_ctrl="'pP+a\-=nN";} # # External variables (not used internally). if(allow_round_scroll==''){allow_round_scroll=0;} if(console_scroll_n==''){console_scroll_n=3;} # alias "toggleautoflip" "_autoflip=1\-_autoflip" ""; alias "toggleautonegate" "_autonegate=1\-_autonegate" ""; alias "toggleflip" "i:flipped=1\-i:flipped" "toggles flipped property on the current image"; alias "flip" "toggleflip;redisplay" "flip the current image along the horizontal axis"; alias "fliponce" "flip;toggleflip" "flip, but just for one display"; alias "toggleautomirror" "_automirror=1\-_automirror" ""; alias "togglemirror" "i:mirrored=1\-i:mirrored" "toggles mirrored property on the current image"; alias "mirror" "togglemirror;redisplay" "mirror the image along the vertical axis" ""; alias "mirroronce" "mirror;togglemirror" "mirror, but just for one display"; alias 'toggleLimitMarked' '__pre_limit_fileindex=_fileindex;_limit_mode=1\-_limit_mode; if(_limit_mode==1){limit "!";} else { limit; } if(_filelistlen<1){_limit_mode=0;limit;goto __pre_limit_fileindex;} i:fresh=1;redisplay; ' "toggle between limiting file list to the marked files and the full list"; alias "unlimit" "limit" "calling limit with no arguments restores the original list"; # Warning : binding to C\-s, C\-z and C\-c won't make effect, as these # codes are get caught by the console driver and will have no effect in fim. # Moreover, C\-z will crash fim and C\-c will terminate it. # Some other combinations (e.g.:C\-l) may have similar problems in your console. bind 'f' "flip"; bind 'F' "fliponce"; bind 'm' "mirror"; bind 'M' "mirroronce"; bind 'q' "quit"; bind 'Esc' "quit"; #bind 'n' "next_file"; #bind 'n' "next"; bind 'C\-h' "help"; #bind '?' "help"; # assigned to back\-search #bind '/' "help"; # assigned to forward\-search bind '=' "scale '100%'"; #bind 'p' "prev_file"; bind 'Del' "list 'remove';reload"; #bind 's' "list 'sort'"; bind ' ' "scroll 'forward'"; bind 'S' "toggleDisplayStatus"; bind 'I' "toggleautonegate"; bind 'i' "color 'negate';redisplay"; bind 'g' "color 'desaturate';redisplay"; bind '[' 'font_reduce;redisplay'; bind ']' 'font_magnify;redisplay'; bind '|' 'toggle_font_auto_scale;redisplay'; bind '{' 'font "prev";redisplay'; bind '}' 'font "next";redisplay'; bind 'G' "toggleDesaturate"; bind 'r' "rotate90"; bind 'R' "rotate270"; bind '+' "magnify"; bind 'a' "scale 'a'"; bind 'H' "scale 'H'"; bind 'Tab' "toggleVerbosity"; bind 'Menu' "toggleVerbosity"; bind 'v' "toggleDisplayStatus"; bind 'A' "A"; bind 'C\-m' "list 'mark'"; bind 'u' "list 'unmark'"; bind 'Enter' "list 'mark';goto _lastgotodirection"; bind '\-' "reduce"; bind "Up" "pan_up"; bind 'k' "pan_up"; bind "Right" "pan_right"; bind 'l' "pan_right"; bind "Down" "pan_down"; bind 'j' "pan_down"; bind "Left" "pan_left"; bind 'h' "pan_left"; bind 't' "align 'top'"; bind 'C\-g' "system 'fbgrab' 'fim_'._device_string.'.png'"; # grab a screenshot #bind 'C\-r' "recording 'start'"; bind 'C\-r' "reload ''"; bind 'Q' "recording 'stop'"; bind 'D' "recording 'dump'"; bind 'E' "recording 'execute'"; bind 'C\-e' "recording 'execute'"; bind 'C\-x' "recording 'execute'"; bind '.' "recording 'repeat_last'"; bind '`' "toggleLimitMarked"; alias "toggleVerbosity" "_display_console=1\-_display_console;i:fresh=1;redisplay" ""; alias "toggleKeyVerbosity" "_verbose_keys=1\-_verbose_keys;redisplay" ""; alias "toggleDesaturate" "_autodesaturate=1\-_autodesaturate;redisplay" ""; alias "idempotent_cmd" "goto ''"; # # Autocommands examples: #autocmd "PostInteractiveCommand" "fim.png" "echo '\\nmatched an interactive command on fim.png\\n'"; #autocmd "PostDisplay" ".*png" "echo 'this is a png file'"; #autocmd "PostDisplay" ".*jpg" "echo 'this is a jpg file'"; #autocmd "PostDisplay" "" "echo '\\nthis is a file\\n'"; #autocmd "PostGoto" "" "set_interactive_mode"; autocmd "PostGoto" "" "reload"; autocmd "PostWindow" "" "i:fresh=1;redisplay;"; autocmd "PreRedisplay" "" "i:_will_display=1"; autocmd "PreRedisplay" "" "if(_scale_style!='' && i:fresh){i:fresh=0;scale _scale_style ;i:fresh=0;}"; autocmd "PostRedisplay" "" "i:_will_display=0"; # Display device specific config alias "aalib_fix_do" "{if(aascale==''){ascale='2.0';}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+aalib?expect binding problems!'}}" "See aalib_fix."; alias "aalib_fix" "if(_device_string=='aa'){aalib_fix_do;scale 'a';}" "When using the aalib (ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'aascale' variable for an accurate scaling."; alias "cacalib_fix_do" "{if(cacascale==''){ascale='1.18';}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+cacalib?expect binding problems!'}}" "See cacalib_fix."; alias "cacalib_fix" "getenv 'DISPLAY';if(_device_string=='caca' && ENV_DISPLAY==''){cacalib_fix_do;scale 'a';}" "When using the libcaca (Coloured ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'cacascale' variable for an accurate scaling."; autocmd "PostReload" "" "aalib_fix"; autocmd "PostLoad" "" "aalib_fix"; autocmd "PostReload" "" "cacalib_fix"; autocmd "PostLoad" "" "cacalib_fix"; alias "refresh" "desc 'reload';redisplay;" "reloads and displays image description"; bind "F5" "refresh"; bind "F11" "if(_device_string=='sdl' && !_fullscreen){_old_sw=_screen_width;_old_sh=_screen_height;display 'reinit' 'mW0:0';_fullscreen=1;}else if(_device_string=='sdl' && _old_sw*_old_sh*_fullscreen){display 'reinit' 'rwm'._old_sw.':'._old_sh;_fullscreen=0;}" "Toggles full screen. Will show mouse cursor in full screen."; autocmd "PostReload" "" "i:fresh=1" ; autocmd "PostScale" "" "if(0==i:_will_display){i:fresh=1;display;}" ; autocmd "PostPan" "" "{i:fresh=1;display;}" ; autocmd "PostReload" "" "if(i:fresh){redisplay;}"; autocmd "PostInteractiveCommand" "" "if(i:fresh){display;i:fresh=0;}"; autocmd "PostInteractiveCommand" "" "if(_want_prefetch>0){prefetch;}"; autocmd "PostInteractiveCommand" "" "if(_display_console==0 && i:fresh){redisplay;i:fresh=0;}"; autocmd "PostInteractiveCommand" "" "idempotent_cmd"; # Bug workaround: without it console scroll is broken. alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep '1';}" "goes forward 10 images"; alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep '1';}" "goes backward 10 images"; bind 'N' 'next10'; bind 'P' 'prev10'; bind 'C\-n' "goto '+//'"; bind 'C\-p' "goto '\-//'"; bind 'C\-b' "goto '\-//'"; # Warning: many configurations cannot detect C\-b. bind 'W' "display 'resize'" "if supported, resizes the window to match the current image pixels size"; #bind 'C\-w' "scale '100%';display 'resize'" "if supported, scales the image to 100% and resizes the window to match its size (if fits)"; bind 'C\-w' "if(_scale_style!='w'){_scale_style='w';scale 'w';}else{_scale_style='';scale '100%';}" "scale to width"; alias "endless_slideshow" "while(1){display;sleep '1';next;}" "performs an automated slideshow, endlessly"; alias "bookview" "while(1){display;sleep '2';scroll 'down';}" ""; alias "comicview" "while(1){display;sleep '1';scroll 'down';}" ""; alias "read" "while(1){display;sleep '1';scroll 'forward';}" ""; alias "slowread" "while(1){display;sleep '2';scroll 'forward';}" ""; alias "fastread" "while(1){display;scroll 'forward';}" "proceeds like in a book bug very fast"; alias "pornview" "echo 'press any key repeatedly to terminate' ;endless_slideshow" "enters an endless slideshow"; autocmd "PreExecutionCycle" "/fbps\-" "_display_busy=0;_display_status=0" ; autocmd "PreExecutionCycle" "" "i:fresh=1;reload"; autocmd "PreExecutionCycle" "/fbps\-.*ps001.png" "i:fresh=1;redisplay"; ## Example in imposing a file loader to an extension: #autocmd "PreReload" ".*mtx.gz" "_file_loader='MatrixMarket'"; #autocmd "PostReload" ".*mtx.gz" "_file_loader=''"; bind '*' "_display_console=0;toggleVerbosity;echo i:*"; bind 'w' "scale 'w'"; bind '<' "rotate10_ccw;display"; bind '>' "rotate10;display"; bind '_' "_scale_style='';scale '100%'"; bind ',' "_display_console=1;echo _last_system_output"; bind 'C\-a' "if(_scale_style!='a'){_scale_style='a';scale 'a';}else{_scale_style='';scale '100%';}" "scale to height"; # alias "pan_nw" "pan 'nw'" "pans the image to the upper left"; alias "pan_ne" "pan 'ne'" "pans the image to the upper right"; alias "pan_se" "pan 'se'" "pans the image to the lower left"; alias "pan_sw" "pan 'sw'" "pans the image to the lower right"; alias "pan_down" "if(_display_console==0){pan 'down';}else{scd;}" "pans the image down / scrolls console down"; alias "pan_up" "if(_display_console==0){pan 'up' ;}else{scu;}" "pans the image up / scrolls console up"; alias "pan_left" "pan 'left'" "pans the image left"; alias "pan_right" "pan 'right'" "pans the image right"; alias "diagonal_nw" "pan_nw" "pans the image to the upper left"; alias "diagonal_ne" "pan_ne" "pans the image to the upper right"; alias "diagonal_se" "pan_se" "pans the image to the lower left"; alias "diagonal_sw" "pan_sw" "pans the image to the lower right"; bind 'd' "diagonal_nw"; bind 'D' "diagonal_se"; bind 'x' "diagonal_ne"; bind 'X' "diagonal_sw"; alias "toggleDisplayStatus" "_display_status=1\-_display_status;redisplay" ""; alias "toggleDisplayBusy" "_display_busy=1\-_display_busy" ""; alias "sort" "list 'sort'" "sorts the files list ordered"; bind 'o' "sort"; bind 'b' "prev"; bind 'B' "toggleDisplayBusy"; alias "random_slideshow" "while(1){goto random;}" "performs a shuffled slideshow"; alias "rotate90_ccw" "i:_orientation=i:_orientation+3;i:fresh=1;i:fresh=1;redisplay" "rotate 90 degrees counter clockwise"; alias "rotate90_cw" "i:_orientation=i:_orientation+1;i:fresh=1;i:fresh=1;redisplay" "rotate 90 degrees clockwise"; alias "rotate180" "i:_orientation=i:_orientation+2;i:fresh=1;i:fresh=1;redisplay" "rotate 180 degrees"; alias "rotate90" "rotate90_cw;display" "rotate 90 degrees clockwise"; alias "rotate270" "rotate90_ccw;display" "rotate 90 degrees counter clockwise"; alias "rotate10" "rotate '10';display" "rotate 10 degrees counter clockwise"; alias "rotate10_ccw" "rotate \-10 ;display" "rotate 10 degrees clockwise"; bind 'K' 'if(_display_console==0){echo i:_filename.": ".i:_comment;toggleVerbosity}else{toggleVerbosity;}'; bind 'C\-k' 'crop' # still experimental alias 'cache' 'echo _cache_status' "displays cached images status"; bind 'c' 'align "center"'; alias 'widen' 'i:ascale=i:ascale*"1.1";*1.0' "widen the current image"; alias 'narrow' 'i:ascale=i:ascale/"1.1";*1.0' "narrow the current image"; bind 'y' "widen" "widen horizontally the image"; bind 'Y' "narrow" "shrink horizontally the image"; alias 'console_scroll_up' 'if(_console_offset<_console_lines+console_scroll_n\-_rows){_console_offset=_console_offset+console_scroll_n;}' "scrolls up the virtual console"; alias 'console_scroll_down' 'if(allow_round_scroll || (_console_offset>=console_scroll_n)){_console_offset=_console_offset\-console_scroll_n;}' "scrolls down the virtual console"; alias 'console_scroll_reset' '{_console_offset=0;}'; alias 'scu' 'console_scroll_up' ""; alias 'scd' 'console_scroll_down' ""; alias 'scz' 'console_scroll_reset' ""; alias 'center' 'align "center"'; alias 'left' 'align "left"'; alias 'right' 'align "right"'; alias 'top' 'align "top"'; alias 'bottom' 'align "bottom"'; alias "font_magnify_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction\-1;}else{_fbfont_as_screen_fraction=_screen_width/100+_screen_height/100;}" ""; alias "font_magnify_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor+1" ""; alias "font_reduce_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction+1;}" ""; alias "font_reduce_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor\-1" ""; alias "toggle_font_auto_scale" "if(_fbfont_as_screen_fraction<0){_fbfont_as_screen_fraction=0;echo 'Auto font scaling on.';}else{_fbfont_as_screen_fraction=\-1;echo 'Auto font scaling off.';}" "toggles between manual and auto font scaling control"; alias 'next_file_dir_same' "goto '+/s';" "go to next file in same dir"; alias 'next_file_dir_other' "goto '+/S';" "go to next file in other dir"; alias 'next_file_dir_up' "goto '+/u';" "go to next file up the dir hierarchy"; alias 'next_file_dir_down' "goto '+/d';" "go to next file down the dir hierarchy"; alias 'next_file_same_basename' "goto '+/b';" "go to next file with same basename"; alias 'prev_file_dir_same' "goto '\-/s';" "go to prev file in same dir"; alias 'prev_file_dir_other' "goto '\-/S';" "go to prev file in other dir"; alias 'prev_file_dir_up' "goto '\-/u';" "go to prev file up the dir hierarchy"; alias 'prev_file_dir_down' "goto '\-/d';" "go to prev file down the dir hierarchy"; alias 'prev_file_same_basename' "goto '\-/b';" "go to prev file with same basename"; #alias "font_magnify" "if(_fbfont_as_screen_fraction<0) {font_magnify_manual;}else{font_magnify_auto;}" "increase font size (either relative or absolute)"; #alias "font_reduce" "if(_fbfont_as_screen_fraction<0) {font_reduce_manual;} else{font_reduce_auto;}" "increase font size (either relative or absolute)"; alias "font_magnify" "_fbfont_as_screen_fraction=\-1;font_magnify_manual" "increase absolute font size and set manual font control"; alias "font_reduce" "_fbfont_as_screen_fraction=\-1;font_reduce_manual" "decrease absolute font size and set manual font control"; bind "PageUp" "if(_display_console==0){prev;}else{scu;}"; bind "PageDown" "if(_display_console==0){next;}else{scd;}"; bind "Home" "0;"; bind "End" "$;"; bind "^" "0;"; bind "$" "$;"; #bind "Backspace" "prev"; # console code for C\-h and Backspace is the same :\-) bind "'" "goto _lastfileindex"; bind '"' "scale 'shadow';i:fresh=1;redisplay;"; bind '(' "goto '^p'"; bind ')' "goto '$p'"; bind 'Z' "sleep 1"; _display_status=1; # lower status line _want_wm_caption_status="fim:%N@%p%%%L[%i/%l]"; _info_fmt_str="%p%% %wx%h%L %i/%l%P %F %T %c"; # lower right line part #_display_status_fmt="%N:%k"; # _display_status_fmt="%N%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?%?EXIF_ExposureTime?[%:EXIF_ExposureTime:]?%?EXIF_FNumber?[%:EXIF_FNumber:]?%?EXIF_ApertureValue?[%:EXIF_ApertureValue:]?%?EXIF_ISOSpeedRatings?[ISO%:EXIF_ISOSpeedRatings:]?:%k"; # lower left line part #_fbfont_as_screen_fraction=\-1; # disable auto font scaling echo "WELCOME: to switch to the command line interface press ':'"; # More examples: #alias "plisten" 'popen "nc \-l \-p 9999 "' "executes fim commands coming from port 9999 on this computer"; #alias "wlisten" "while(1){sleep;plisten;}" "listen to a pipe, endlessly"; #alias "musicplay" "system 'mpc' 'play'" ""; #alias "musicpause" "system 'mpc' 'pause'" ""; #alias "rdjpgcom" 'system "rdjpgcom" i:_filename'; # offsetscan usage : need a mechanism for popping all images before. #alias "offsetscan" "while(i:width<1){list 'push' 'blob.jpg';stdout _open_offset ;_open_offset=_open_offset+1;reload;}"; #alias "webcam" "pread 'vgrabbj \-d /dev/video0'"; #alias "webcam_cycle" "while(1){webcam;reload;sleep 1;}"; # This is a FIM initialization file. # Without it FIM cannot work like it should. # Feel free to modify it, but with caution! .SH NOTES This manual page could be improved. Certain side effects of commands are not documented. Neither a formal description of the various commands. Interaction of commands and variables is also not completely documented. .SH BUGS The .B fim language shall be more liberal with quoting. .SH SEE ALSO \fR\fIfim\fR(1), \fR\fIfimgs\fR(1), \fR\fIregex\fR(1). .SH AUTHOR Michele Martone .SH COPYRIGHT See copyright notice in \fR\fIfim\fR(1). fim-0.6-rc2/doc/fim.man.in0000644000175000017500000007764114454353764012217 00000000000000.\" .\" $Id$ .\" .TH FIM 1 "(c) 2007-2023 Michele Martone" .SH NAME fim - \fBF\fPbi (linux \fBf\fPrame\fBb\fPuffer \fBi\fPmageviewer) \fBIM\fPproved, an universal image viewer .SH SYNOPSIS .B fim [{options}] [--] {imagepath} [{imagepaths}] .fi .B fim --output-device {fb|sdl|ca|aa|imlib2|dumb} ... .fi .B ... | fim [{options}] [--] [{imagepaths}] - .fi .B fim [{options}] [--] [{files}] - < {file_name_list_text_file} .fi .B fim --image-from-stdin [{options}] < {imagefile} .fi .B fim --script-from-stdin [{options}] < {scriptfile} .fi .B fim --help[=s|d|l|m] [{help-item} ...] .fi .SH DESCRIPTION .B fim is a `swiss army knife' for displaying image files. It is capable of displaying image files using different graphical devices while offering a uniform look and feel. Key bindings are customizable and specified in an initialization file. Interaction with standard input and output is possible (especially in shell scripts). An internal scripting language specialized for image viewing allows image navigation, scaling, manipulation of internal variables, command aliases, and vim-like autocommands. The internal language can be interacted with via a command line mode capable of autocompletion and history (the readline mode). Further features are display of EXIF tags, JPEG comments, EXIF rotation/orientation, load of "description files", faster load via image caching, command recording, and much more. As a default, .B fim displays the specified file(s) on the detected, most convenient graphical device. This can be with SDL if running under X, an Ascii Art driver (aalib or libcaca) if running behind ssh without X forwarding, or the linux framebuffer device. Graphical file formats BMP, PCX are supported natively, while JPEG, PNG, GIF, TIFF, PPM, PGM, PBM are supported via third party libraries. Further formats are supported via external converters. For XCF (Gimp's) images, will try to use 'xcftopnm'. For FIG vectorial images, will try to use 'fig2dev'. For DIA vectorial images, will try to use 'dia'. For SVG vectorial images, will try to use 'inkscape'. For other formats will try to use ImageMagick's 'convert' executable. The converter is given 15 seconds for the conversion before a timeout. If \fB{imagepath}\fP is a file, its format is guessed not by its name but by its contents. See the \fB_file_loader\fP variable to change this default. If \fB{imagepath}\fP is a directory, therein contained files of supported formats will be loaded. If \fB{imagepath}\fP contains a trailing slash (/), it will be treated as a directory; otherwise this will be checked via \fBstat(2)\fP. To change this default, see description of the \fB_pushdir_re\fP variable and the \fB--no-stat-push\fP and \fB--recursive\fP options. This man page describes .B fim command line options and usage. See man \fR\fIfimrc\fR(5) for a full specification of the .B fim language, commands, keysyms, autocommands, variables, aliases, examples for a configuration file and readline usage samples. .SH USAGE You may invoke .B fim from an interactive shell and control it with the keyboard, as you would do with any image viewer with reasonable key bindings. .B fim is keyboard oriented: there are no user menus or buttons available. If you need some feature or setting which is not accessible from the default keyboard configuration, you probably need a custom configuration or simply need to type a custom command. For these, you can use the internal command and configuration language. See options \fB--read-from-stdin\fP, \fB--script-from-stdin\fP, and \fB--image-from-stdin\fP for more script-oriented usages. The full commands specification is also accessible at runtime using the internal help system (typing :help). .SH OPTIONS Accepted command line \fB{options}\fP: .TP \fB--\fP Treat arguments after \fB--\fP as filenames. Treat arguments before \fB--\fP as command line options if these begin with \fB-\fP, and as filenames otherwise. .TP \fB-a\fP, \fB--autozoom\fP Enable autozoom. \fBfim\fP will automagically pick a reasonable zoom factor when displaying a new image (as in \fBfbi\fP). .TP \fB-b[24|1]\fP, \fB--binary[=24|1]\fP Display contents of binary files (of any filetype) as these were raw 24 or 1 bits per pixel pixelmaps. Image width will not exceed the value of the \fB_preferred_rendering_width\fP variable. Regard this as an easter bunny option. .TP \fB--as-text\fP Display contents of files (of any filetype) as these were text. Image width will not exceed the value of the \fB_preferred_rendering_width\fP variable. Non-printable characters will be displayed as " ". Regard this as another easter bunny option. .TP \fB--cd-and-readdir\fP Step in the directory of the first file to be loaded, push other files from that directory, and jump back to the first file. Useful when invoking from a desktop environment. .TP \fB-c {commands}\fP, \fB--execute-commands {commands}\fP Execute \fBcommands\fP after reading the initialization file, just before entering the interactive mode. No semicolon (\fB;\fP) is required at the end of \fBcommands\fP. Do not forget quoting \fBcommands\fP in a manner suitable to your shell. So -c next is fine as it is. A more complicated example, with quotings: -c '*2;2pan_up;display;while(1){align "bottom";sleep "1" ; align "top"}' (with the single quotes) tells fim to: double the displayed image size, pan twice up, display the image, and finally do an endless loop consisting of bottom and top aligning, alternated. .TP \fB-C {commands}\fP, \fB--execute-commands-early {commands}\fP Similar to the \fB--execute-commands\fP option, but execute \fBcommands\fP earlier, just before reading the initialization file. The special 'early' form \fB=var=val\fP will assign \fBvar\fP to \fBval\fP immediately, before the interpreter is started. For example, -C '\fB_scale_style\fP=" "' starts fim no auto-scaling; the equivalent early form is: -C '=\fB_scale_style\fP= '. .TP \fB-d {framebuffer device}\fP, \fB--device {framebuffer device}\fP Framebuffer device to use. Default is the one your vc is mapped to (as in fbi). .TP \fB--dump-reference-help[=man]\fP Dump to stdout language reference help and quit. .TP \fB--dump-default-fimrc\fP Dump default configuration (the one hardcoded in the fim executable) to standard output and quit. .TP \fB-E {scriptfile}\fP, \fB--execute-script {scriptfile}\fP Execute \fBscriptfile\fP after the default initialization file is read, and before executing \fB--execute-commands\fP commands. .TP \fB-f {fimrc}\fP, \fB--etc-fimrc {fimrc}\fP Specify an alternative system-wide initialization file (default: @sysconfdir@/fimrc), to be read prior to any other configuration file. See also \fB--no-etc-fimrc-file\fP. .TP \fB-F {commands}\fP, \fB--final-commands {commands}\fP Similar to the \fB--execute-commands\fP option, but execute \fBcommands\fP after exiting the interactive mode, just before terminating the program. .TP \fB-h[s|d|l|m]\fP, \fB--help[=s|d|l|m]\fP Print program invocation help, and exit. Depending on the option, output can be: short, descriptive, long from man, or complete man. If further arguments follow, individual help messages will be shown instead. .TP \fB-k {keysym}\fP, \fB--keysym-press {keysym}\fP Execute any command bound (via the bind command) to a specified keysym at startup. A keysym can be prefixed by a repetition count number. You can specify the option multiple times to simulate multiple keystrokes. Presses entered via \fB--keysym-press\fP are processed before presses entered via \fB--chars-press\fP. See man \fR\fIfimrc\fR(5) for a list of keysyms and the use of bind. .TP \fB-K {chars}\fP, \fB--chars-press {chars}\fP Input one or more keyboard characters at program startup (simulate keyboard presses). This option can be specified multiple times. Each additional time (or if the string is empty), a press of Enter (ASCII code 0x0D) key is prepended. Examples: -K '' simulates press of an Enter; -K ':next;' activates the command line and enter "next;" without executing it; -K ":next;" -K "next" executes "next", stays in the command line and enter keys "next"; -K ":next;" -K "" -K "next" executes "next", leaves the command line, and executes in sequence any command bound to keys 'n', 'e', 'x', 't'. Presses entered via \fB--chars-press\fP are processed after presses entered via \fB--keysym-press\fP. .TP \fB-D {filename}\fP, \fB--load-image-descriptions-file {filename}\fP Load image descriptions from file \fBfilename\fP. Each line begins with the basename of an image file, followed by a Tab character (or a different character if specified via \fB--image-descriptions-file-separator\fP), then the description text. The description text is copied into the \fBi:_comment\fP variable of the image at load time, overriding the comment possibly loaded from the file (e.g. JPEG, PNG or TIFF comment). If a '@' followed by and identifier {var} is encountered, and i:{var} is set, its value is substituted here. If "@#" is encountered, the remainder of the description line is ignored. Special comment lines like "#!fim:var=val" lead i:var to be assigned value val (unquoted) at image loading time (cached variable); i:var will not be assigned if var starts with an underscore ('_'). Special comment lines like "#!fim:+=val" add val to current description. Special comment lines like "#!fim:^=val" set val to be the base of each description. Special comment lines like "#!fim:!=" reset all cached variables. Special comment lines like "#!fim:/=dir" prepend dir to each file's basename. Special comment lines like "#!fim:\e=dir" prepend dir to each file's name. Special description text (to be associated to an image) begins with markers: with "#!fim:=", the last description line is reused; with "#!fim:+", what follows is appended to the last description line; with "#!fim:^", what follows is prepended to the last description line; with "#!fim:s/f/t", the last description line will be used after substitution of occurrences of substring f with string t (f and t cannot contain newlines or a '/'). If val is empty that variable is unset. These variables are stored also in an internal index used by the limit command. This option sets \fB_caption_over_image\fP=2, so that a caption is displayed over the image. A description file beginning with "#!fim:desc" can be loaded without specifying this switch. .TP \fB-S {sepchar}\fP, \fB--image-descriptions-file-separator {sepchar}\fP A character to be used as a separator between the filename and the description part of lines specified just before a --load-image-descriptions-file. .TP \fB-i\fP, \fB--image-from-stdin\fP Read one single image from the standard input (the image data, not the filename). May not work with all supported file formats. In the image list, this image takes the special name "". .TP \fB--mark-from-image-descriptions-file {filename}\fP Set those files specified in \fBfilename\fP (see --load-image-descriptions-file for the file format) as marked (see the list command). .TP \fB-m {vmode}\fP, \fB--mode {vmode}\fP Name of the video mode to use video mode (must be listed in /etc/fb.modes). Default is not to change the video mode. In the past, the XF86 config file (/etc/X11/XF86Config) used to contain Modeline information, which could be fed to the modeline2fb perl script (distributed with fbset). On many modern xorg based systems, there is no direct way to obtain a fb.modes file from the xorg.conf file. So instead one could obtain useful fb.modes info by using the (fbmodes (no man page AFAIK)) tool, written by bisqwit. An unsupported mode should make fim exit with failure. But it is possible the kernel could trick fim and set a supported mode automatically, thus ignoring the user set mode. .TP \fB-N\fP, \fB--no-rc-file\fP No personal initialization file will be read (default is ~/.fimrc) at startup. .TP \fB--no-etc-fimrc-file\fP No system-wide initialization file will be read (default is @sysconfdir@/fimrc) at startup. See also \fB--etc-fimrc\fP. .TP \fB--no-internal-config\fP No internal default configuration at startup (uses internal variable \fB_no_default_configuration\fP). Will only provide a minimal working configuration. .TP \fB--no-commandline\fP With internal command line mode disabled. .TP \fB--no-history-save\fP Do not save execution history at finalization (uses internal variable \fB_save_fim_history\fP). .TP \fB--no-history-load\fP Do not load execution history at startup. .TP \fB--no-history\fP Do not load or save execution history at startup. .TP \fB-p\fP, \fB--script-from-stdin\fP Read commands from stdin before entering in interactive mode. .TP \fB-o [fb|sdl|ca|aa|imlib2|dumb]\fP, \fB--output-device [fb|sdl|ca|aa|imlib2|dumb]\fP Will use the specified \fBdevice\fP as fim video output device, overriding automatic checks. The available devices depend on the original configuration/compilation options, so you should get the list of available output devices issuing \fBfim --version\fP. The \fBfb\fP option selects the Linux framebuffer. Presence of option \fBS\fP (e.g. \fBfb=S\fP) makes framebuffer initialization more picky: it will not tolerate running in a screen session. The \fBca\fP option (coloured Ascii Art) can be specified as \fBca\fP\fB[={['w']}] \fP; if supplied, \fB'w'\fP selects windowed mode, provided libcaca is running under X; by default (or with \fB'W'\fP), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable. The \fBaa\fP (monochrome Ascii Art) option can be specified as \fBaa[={['w'|'W']}]\fP; if supplied, \fB'w'\fP selects windowed mode, provided aalib is running under X; by default (or with \fB'W'\fP), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable. Please note that the readline (internal command line) functionality in \fBca\fP and \fBaa\fP modes is limited. The \fBsdl\fP option (graphical windowed mode) may be specified as \fBsdl\:={['w']['m']['r']['h']['W']['M']['R']['H'][width[:height]]['%']}\fP, where \fBwidth\fP and \fBheight\fP are integer numbers specifying the desired resolution (if \fBheight\fP not specified, it takes the value of \fBwidth\fP); the \fB'w'\fP character requests windowed mode (instead of \fB'W'\fP for fullscreen); the \fB'm'\fP character requests mouse pointer display; the \fB'h'\fP character requests help grid map draw (can be repeated for variants); the \fB'r'\fP character requests support for window resize; the \fB'%'\fP character requests to treat \fBwidth\fP and \fBheight\fP as percentage of possible window resolution. The same letters uppercase request explicit negation of the mentioned features. The \fBimlib2\fP option requests imlib2 and is unfinished -- do not use it. The \fBdumb\fP test mode is not interactive. .TP \fB--offset {bytes-offset[{:upper-offset}|{+offset-range}]}\fP Use the specified \fBoffset\fP (in bytes) for opening the specified files. If \fB:upper-offset\fP is specified, further bytes until \fBupper-offset\fP will be probed. If \fB+offset-range\fP is specified instead, that many additional bytes will be probed. Use this option to search damaged file systems for image files. Appending a modifier among K,M,G (case irrelevant) to an offset number changes the unit to be respectively 2^10, 2^20, or 2^30 bytes. .TP \fB--pread-cmd {cmd-filter-pipeline}\fP Specify a shell command with \fB{cmd-filter-pipeline}\fP. If the current filename matches "^[/A-Za-z0-9_.][/A-Za-z0-9_.-]*$", it will be substituted to any occurrence of '{}'. The resulting command output is assumed to be file data, which will be read and displayed. This works by setting the internal \fB_pread_cmd\fP variable (empty by default). .TP \fB-P\fP, \fB--text-reading\fP Enable textreading mode. This has the effect that fim will display images scaled to the width of the screen, and aligned to the top. If the images you are watching are text pages, all you have to do to get the next piece of text is to press space (in the default key configuration, of course). .TP \fB-s {value}\fP, \fB--scroll {value}\fP Set scroll steps for internal variable \fB_steps\fP (default is 20%). .TP \fB--slideshow {number}\fP Interruptible slideshow mode. Wait for \fB{number}\fP of seconds (assigned to the \fB_want_sleep_seconds\fP variable) after each image. Implemented by executing reload; i:fresh=1; while(_fileindex <= _filelistlen-_loop_only_once){sleep _want_sleep_seconds; next;} sleep _want_sleep_seconds; as a first command. Can be interrupted by : or Esc. The other keys will execute accordingly to their function but will not interrupt the slideshow. Like in fbi, this will cycle forever, unless \fB--once\fP is specified. .TP \fB--sanity-check\fP Perform a quick sanity check, just after the initialization, and terminate. .TP \fB-t\fP, \fB--no-framebuffer\fP \fBfim\fP Use an ASCII Art driver. If present, use either of libcaca (coloured), or aalib (monochrome). For more, see (man fimrc), (info aalib) or (apropos caca)). If no ASCII Art driver was enabled at compile time, fim will not display any image at all. .TP \fB-T {terminal}\fP, \fB--vt {terminal}\fP The \fBterminal\fP will be used as virtual terminal device file (as in fbi). See (chvt (1)), (openvt (1)) for more info about this. Use (con2fb (1)) to map a terminal to a framebuffer device. .TP \fB--reverse\fP Reverse files list before browsing (can be combined with the other sorting options). .TP \fB--sort\fP Sort files list before browsing according to full filename. .TP \fB--sort-basename\fP Sort files list before browsing according to file basename's. .TP \fB--sort-mtime\fP Sort files list before browsing according to file modification time. .TP \fB--sort-fsize\fP Sort files list before browsing according to file size. .TP \fB-u\fP, \fB--random\fP Randomly shuffle the files list before browsing (seed depending on time() function). .TP \fB--random-no-seed\fP Pseudo-random shuffle the files list before browsing (no seeding). .TP \fB-v\fP, \fB--verbose\fP Be verbose: show status bar. .TP \fB--verbose-load\fP Load files verbosely (repeat option to increase verbosity). .TP \fB--verbose-font-load\fP Load font verbosely (sets \fB_fbfont_verbosity\fP). .TP \fB--verbose-interpreter\fP Execute interpreter verbosely (Sets immediately \fB_debug_commands\fP="ackC" if specified once, \fB_debug_commands\fP="ackCi" if specified twice). .TP \fB-V\fP, \fB--version\fP Print to stdout program version, compile flags, enabled features, linked libraries information, supported filetypes/file loaders, and then exit. .TP \fB-w\fP, \fB--autowidth\fP Scale the image according to the screen width. .TP \fB-=\fP, \fB--no-auto-scale\fP Do not scale the images after loading (will set '\fB_scale_style\fP=" "';). .TP \fB--autowindow\fP Resize the window size (if supported by the video mode) to the image size. Don't use this with other image scaling options. .TP \fB--no-stat-push\fP Sets \fB_push_checks\fP=0 before initialization, thus disabling file/dir existence checks with stat(2) at push push time (and speeding up startup). .TP \fB-H\fP, \fB--autoheight\fP Scale the image according to the screen height. .TP \fB-W {scriptfile}\fP, \fB--write-scriptout {scriptfile}\fP All the characters that you type are recorded in the file \fB{scriptout}\fP, until you exit \fBfim\fP. This is useful if you want to create a script file to be used with "fim -c" or ":exec" (analogous to Vim's -s and ":source!"). If the \fB{scriptout}\fP file exists, it will be not touched (as in Vim's -w). .TP \fB-L {fileslistfile}\fP, \fB--read-from-file {fileslistfile}\fP Read file list from a file: each line one file to load (similar to \fB--read-from-stdin\fP; use \fB--read-from-stdin-elds\fP to control line breaking). .TP \fB -, \fP\fB--read-from-stdin\fP Read file list from stdin: each line one file to load; use with --read-from-stdin-elds to control line breaking). Note that these the three standard input reading functionalities (-i,-p and -) conflict : if two or more of them occur in fim invocation, fim will exit with an error and warn about the ambiguity. See the section .B INVOCATION EXAMPLES below to read some useful (and unique) ways of employing fim. .TP \fB--read-from-stdin-elds {delimiter-char}\fP Specify an endline delimiter character for breaking lines read via -/--read-from-stdin/--read-from-file (which shall be specified after this). Line text before the delimiter will be treated as names of files to load; the text after will be ignored. This is also useful e.g. to load description files (see --load-image-descriptions-file) as filename list files. Default is the newline character (0x0A); to specify an ASCII NUL byte (0x00) use ''. .TP \fB-A\fP, \fB--autotop\fP Align images to the top border (by setting '\fB_autotop\fP=1' after initialization). .TP \fB-q\fP, \fB--quiet\fP Quiet execution mode. Sets _display_status=0;_display_busy=0;. .TP \fB-r {width:height}\fP, \fB--resolution {width:height}\fP Set resolution specification in pixels. Supported by SDL only. Will be appended to the argument to --output-device. Shorthand value 'fullscreen' will be translated into 'W'. .TP \fB-R[{exp}]\fP, \fB--recursive[={exp}]\fP Push files/directories to the files list recursively. The expression in variable \fB_pushdir_re\fP (default: "\.(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$") lists extensions of filenames which will be loaded in the list. You can overwrite its value by optionally passing an expression \fB{exp}\fP here as argument. If starting with '+' or '|', the expression following will be appended to it. .TP \fB-X\fP, \fB--no-pipe-load\fP Do not load via external converter programs: only use built-in file decoders. .TP \fB-B\fP, \fB--background-recursive\fP Push files/directories to the files list recursively, in background during program execution. Any sorting options will be ignored. Experimental feature, unfinished. .TP \fB--load-shadow-directory {dir}\fP Add \fB{dir}\fP to the shadow directory list. Then 'scale "shadow"' will temporarily substitute the image being displayed with that of the first same-named file located under a shadow directory. Useful to browse low-res images, but still being able to quickly view the hi-res original residing in a shadow directory. This works as intended as long as unique filenames are involved. .TP \fB-/ {pattern}\fP, \fB--/ {pattern}\fP After startup jump to pattern; short for -c '/'. .TP \fB--// {pattern}\fP After startup jump to pattern; as -c '/' but with search on the full path (with \fB_re_search_opts="f"\fP). .TP \fB-1\fP, \fB--once\fP If running --slideshow, loop only once (as in fbi). .SH PROGRAM RETURN STATUS The program return status is 0 on correct operation; 252 on unsupported device specification; 248 on bad input; 255 on a generic error; 42 on a signal-triggered program exit; or a different value in case of an another error. The return status may be controlled by the use of the quit command. .SH COMMON KEYS AND COMMANDS .nf The following keys and commands are hardcoded in the minimal configuration. These are working by default before any config loading, and before the hardcoded config loading (see variable \fB_fim_default_config_file_contents\fP). n goto '+1f' p goto '-1f' + magnify - reduce h pan 'left' l pan 'right' k pan 'up-' j pan 'down+' q quit You can type a number before a command binding to iterate the assigned command: 3k 3pan 'up-' .nf : enter command line mode :{number} jump to {number}^th image in the list :^ jump to first image in the list :$ jump to last image in the list :*{factor} scale the image by {factor} :{scale}% scale the image to the desired {scale} :+{scale}% scale the image up to the desired percentage {scale} (relatively to the original) :-{scale}% scale the image down to the desired percentage {scale} (relatively to the original) /{regexp} entering the pattern {regexp} (with /) makes fim jump to the next image whose filename matches {regexp} /*.png$ entering this pattern (with /) makes fim jump to the next image whose filename ends with 'png' /png a shortcut for /.*png.* 2,4 stdout '{}' print three filenames to standard output. !{syscmd} executes the {syscmd} quoted string as an argument to the "system" fim command. You can visualize all of the default bindings invoking fim --dump-default-fimrc | grep bind . You can visualize all of the default aliases invoking fim --dump-default-fimrc | grep alias . .fi .P The Return vs. Space key thing can be used to create a file list while reviewing the images and use the list for batch processing later on. All of the key bindings are reconfigurable; see the default .B fimrc file for examples on this, or read the complete manual: the FIM.TXT file distributed with fim. .SH AFFECTING ENVIRONMENT VARIABLES .nf FBFONT (just like in fbi) a Linux consolefont font file. If using a gzipped font, the zcat program will be used to uncompress it (via \fBexecvp(3)\fP). If not specified, the following files will be probed and the first existing will be selected: /usr/share/kbd/consolefonts/cp866-8x16.psf.gz /usr/share/consolefonts/Uni3-TerminusBoldVGA14.psf.gz /usr/lib/kbd/consolefonts/lat9-16.psf.gz /usr/share/consolefonts/lat1-16.psf /usr/share/consolefonts/lat1-16.psf.gz /usr/share/consolefonts/lat1-16.psfu.gz /usr/share/kbd/consolefonts/lat1-16.psf /usr/share/kbd/consolefonts/lat1-16.psf.gz /usr/share/kbd/consolefonts/lat1-16.psfu.gz /usr/lib/kbd/consolefonts/lat1-16.psf /usr/lib/kbd/consolefonts/lat1-16.psf.gz /usr/lib/kbd/consolefonts/lat1-16.psfu.gz /lib/kbd/consolefonts/lat1-16.psf /lib/kbd/consolefonts/lat1-16.psf.gz /lib/kbd/consolefonts/lat1-16.psfu.gz /lib/kbd/consolefonts/Lat2-VGA14.psf.gz /lib/kbd/consolefonts/Lat2-VGA16.psf.gz /lib/kbd/consolefonts/Lat2-VGA8.psf.gz /lib/kbd/consolefonts/Uni2-VGA16.psf.gz /usr/share/consolefonts/default8x16.psf.gz /usr/share/consolefonts/default8x9.psf.gz /usr/share/consolefonts/Lat15-Fixed16.psf.gz /usr/share/consolefonts/default.psf.gz fim:// If the special fim:// string is specified, a hardcoded font will be used. FBGAMMA (just like in fbi) gamma correction (applies to dithered 8 bit mode only). Default is 1.0. FRAMEBUFFER (just like in fbi) user set framebuffer device file (applies only to the fb mode). If unset, fim will probe for /dev/fb0. TERM (only in fim) will influence the output device selection algorithm, especially if $TERM=="screen". SSH_TTY if set and no output device specified, give precedence to ca, then aa (if present). DISPLAY If this variable is set, then the sdl driver will be probed by default. .SH COMMON PROBLEMS .B fim needs read-write access to the framebuffer devices (/dev/fbN or /dev/fb/N), i.e you (our your admin) have to make sure fim can open the devices in rw mode. The IMHO most elegant way is to use pam_console (see /etc/security/console.perms) to chown the devices to the user logged in on the console. Another way is to create some group, chown the special files to that group and put the users which are allowed to use the framebuffer device into the group. You can also make the special files world writable, but be aware of the security implications this has. On a private box it might be fine to handle it this way through. If using udev, you can edit: /etc/udev/permissions.d/50-udev.permissions and set these lines like here: # fb devices fb:root:root:0600 fb[0-9]*:root:root:0600 fb/*:root:root:0600 .P .B fim also needs access to the linux console (i.e. /dev/ttyN) for sane console switch handling. That is obviously no problem for console logins, but any kind of a pseudo tty (xterm, ssh, screen, ...) will .B not work. .SH INVOCATION EXAMPLES .B fim --help -R -B .fi # get help for options \fB-R\fP and .B -B .P .P .B fim media/ .fi # load files from the directory .B media/ .P .P .B fim -R media/ --sort .fi # open files found by recursive traversal of directory media, then sorting the list .P .P .B find /mnt/media/ -name *.jpg | fim - .fi # read input files list from standard input .P .P .B find /mnt/media/ -name *.jpg | shuf | fim - .fi # read input files list from standard input, randomly shuffled .P .P .B cat script.fim | fim -p images/* .fi # read a script file .B script.fim from standard input before displaying files in the directory .B images .P .P .B scanimage ... | tee scan.ppm | fim -i .fi # read the image scanned from a flatbed scanner as soon as it is read .P .P .B h5topng -x 1 -y 2 dataset.hdf -o /dev/stdout | fim -i .fi # visualize a slice from an HDF5 dataset file .P .P .B fim * > selection.txt .fi # output the file names marked interactively with the 'list "mark"' command in fim to a file .P .P .B fim * | fim - .fi # output the file names marked with 'm' in fim to a second instance of fim, in which these could be marked again .P .P .B fim -c 'pread "vgrabbj -d /dev/video0 -o png";reload' .fi # display an image grabbed from a webcam .P .P .B fim -o aa -c 'pread "vgrabbj -d /dev/video0 -o png";reload;system "fbgrab" "asciime.png"' .fi .fi # if running in framebuffer mode, will save a png screenshot with an ASCII rendering of an image grabbed from a webcam .P .P .B fim -c 'while(1){pread "vgrabbj -d /dev/video0 -o png";reload;sleep 1;};' .fi # will display a sequence of images grabbed from a webcam; circa 1 per second .P .P .SH NOTES This manual page is neither accurate nor complete. In particular, issues related to driver selection shall be described more accurately. Also the accurate sequence of autocommands execution, variables application is critical to understanding fim, and should be documented. The filename "" is reserved for images read from standard input (view this as a limitation), and thus handling files with such name may incur in limitations. The SDL driver is quite inefficient, for a variety of reasons. In particular, its interaction with the readline library can be problematic (e.g.: when running in sdl mode without a terminal). This shall be fixed. .SH BUGS \fBfim\fP has bugs. Please read the .B BUGS file shipped in the documentation directory to discover the known ones. There are also inconsistencies in the way the internal command line works across the different graphical devices. .SH FILES .TP 15 .B @docdir@ The directory with \fBfim\fP documentation files. .TP 15 .B @sysconfdir@/fimrc The system-wide \fBfim\fP initialization file (executed at startup, after executing the hardcoded configuration). .TP 15 .B ~/.fimrc The personal \fBfim\fP initialization file (executed at startup, after the system-wide initialization file). .TP 15 .B ~/.fim_history File where to load from or save. See (man \fR\fIfimrc\fR(5), man \fR\fIreadline\fR(3)). .TP 15 .B ~/.inputrc If \fBfim\fP is built with GNU readline support, it will be susceptible to chages in the user set ~/.inputrc configuration file contents. For details, see (man \fR\fIreadline\fR(3)). .SH SEE ALSO Other \fBfim\fP man pages: \fR\fIfimgs\fR(1), \fR\fIfimrc\fR(1). .fi Conversion programs: \fR\fIconvert\fR(1), \fR\fIdia\fR(1), \fR\fIxcftopnm\fR(1), \fR\fIfig2dev\fR(1), \fR\fIinkscape\fR(1). .fi Related programs: \fR\fIfbset\fR(1), \fR\fIcon2fb\fR(1), \fR\fIvim\fR(1), \fR\fImutt\fR(1), \fR\fIexiftool\fR(1), \fR\fIexiftags\fR(1), \fR\fIexiftime\fR(1), \fR\fIexifcom\fR(1), \fR\fIfbi\fR(1), \fR\fIfbida\fR(1), \fR\fIfeh\fR(1), \fR\fIfbgrab\fR(1). .fi Related documentation: \fR\fIfbdev\fR(4), \fR\fIvcs\fR(4), \fR\fIfb.modes\fR(8), \fR\fIfbset\fR(8), \fR\fIsetfont\fR(8). .fi .SH AUTHOR .nf Michele Martone is the author of fim, "fbi improved". .fi .SH COPYRIGHT .nf Copyright (C) 2007-2023 Michele Martone (author of fim) .fi Copyright (C) 1999-2004 Gerd Hoffmann is the author of "fbi", upon which .B fim was originally based. .P 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. .P 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. .P You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. fim-0.6-rc2/doc/doctags.c0000644000175000017500000000335014454347341012106 00000000000000/* vim:set ts=4 sw=4: * this program makes a tags file for vim_ref.txt * * Usage: doctags vim_ref.txt vim_win.txt ... >tags * * A tag in this context is an identifier between stars, e.g. *c_files* */ #include #include #include #include #define LINELEN 200 int main(argc, argv) int argc; char **argv; { char line[LINELEN]; char *p1, *p2; char *p; FILE *fd; if (argc <= 1) { fprintf(stderr, "Usage: doctags docfile ... >tags\n"); exit(1); } printf("help-tags\ttags\t1\n"); while (--argc > 0) { ++argv; fd = fopen(argv[0], "r"); if (fd == NULL) { fprintf(stderr, "Unable to open %s for reading\n", argv[0]); continue; } while (fgets(line, LINELEN, fd) != NULL) { p1 = strchr(line, '*'); /* find first '*' */ while (p1 != NULL) { p2 = strchr(p1 + 1, '*'); /* find second '*' */ if (p2 != NULL && p2 > p1 + 1) /* skip "*" and "**" */ { for (p = p1 + 1; p < p2; ++p) if (*p == ' ' || *p == '\t' || *p == '|') break; /* * Only accept a *tag* when it consists of valid * characters, there is white space before it and is * followed by a white character or end-of-line. */ if (p == p2 && (p1 == line || p1[-1] == ' ' || p1[-1] == '\t') && (strchr(" \t\n\r", p[1]) != NULL || p[1] == '\0')) { *p2 = '\0'; ++p1; printf("%s\t%s\t/*", p1, argv[0]); while (*p1) { /* insert backslash before '\\' and '/' */ if (*p1 == '\\' || *p1 == '/') putchar('\\'); putchar(*p1); ++p1; } printf("*\n"); p2 = strchr(p2 + 1, '*'); /* find next '*' */ } } p1 = p2; } } fclose(fd); } return 0; } fim-0.6-rc2/doc/vim2html.pl0000755000175000017500000001105014454347341012414 00000000000000#!/usr/bin/perl # converts vim documentation to simple html # Sirtaj Singh Kang (taj@kde.org) # Sun Feb 24 14:49:17 CET 2002 # slightly modified by dez for using with fim, 20070501, 20160825 use strict; use vars qw/%url $date/; use POSIX qw(strftime); %url = (); $date = strftime("%Y-%m-%d", gmtime($ENV{SOURCE_DATE_EPOCH} || time)); sub maplink { my $tag = shift; if( exists $url{ $tag } ){ return $url{ $tag }; } else { #warn "Unknown hyperlink target: $tag\n"; $tag =~ s/\.TXT//; $tag =~ s//>/g; return "$tag"; } } sub readTagFile { my($tagfile) = @_; my( $tag, $file, $name ); open(TAGS,"$tagfile") || die "can't read tags\n"; while( ) { next unless /^(\S+)\s+(\S+)\s+/; $tag = $1; my $label = $tag; ($file= $2) =~ s/.TXT$/.html/g; $label =~ s/\.TXT//; $url{ $tag } = "".esctext($label).""; } close( TAGS ); } sub esctext { my $text = shift; $text =~ s/&/&/g; $text =~ s//>/g; return $text; } sub escurl { my $url = shift; $url =~ s/"/%22/g; $url =~ s/~/%7E/g; $url =~ s//%3E/g; $url =~ s/=/%20/g; $url =~ s/#/%23/g; $url =~ s/\//%2F/g; return $url; } sub vim2html { my( $infile ) = @_; my( $outfile ); open(IN, "$infile" ) || die "Couldn't read from $infile: $!.\n"; ($outfile = $infile) =~ s:.*/::g; $outfile =~ s/\.TXT$//g; open( OUT, ">$outfile.html" ) || die "Couldn't write to $outfile.html: $!.\n"; my $head = uc( $outfile ); print OUT< VIM: $outfile

$head

EOF

	my $inexample = 0;
	while(  ) {
		chop;
		if ( /^\s*[-=]+\s*$/ ) {
			print OUT "

";
			next;
		}

		# examples
		elsif( /^>$/ || /\s>$/ ) {
			$inexample = 1;
			chop;
		}
		elsif ( $inexample && /^([<\S])/ ) {
			$inexample = 0;
			$_ = $' if $1 eq "<";
		}

		s/\s+$//g;

		# Various vim highlights. note that < and > have already been escaped
		# so that HTML doesn't get screwed up.

		my @out = ();
		#		print "Text: $_\n";
		LOOP:
		foreach my $token ( split /((?:\|[^\|]+\|)|(?:\*[^\*]+\*))/ ) {
			if ( $token =~ /^\|([^\|]+)\|/ ) {
				# link
				push( @out, "|".maplink( $1 )."|" );
				next LOOP;
			}
			elsif ( $token =~ /^\*([^\*]+)\*/ ) {
				# target
				push( @out,
					"\*".esctext($1)."<\/a>\*<\/b>");
				next LOOP;
			}

			$_ = esctext($token);
			s/CTRL-(\w+)/CTRL-$1<\/code>/g;
			# parameter <...>
			s/<(.*?)>/<$1><\/code>/g;

			# parameter {...}
			s/\{([^}]*)\}/{$1}<\/code>/g;

			# parameter [...]
			s/\[(range|line|count|offset|cmd|[-+]?num)\]/\[$1\]<\/code>/g;
			# note
			s/(Note:?)/$1<\/code>/gi;

			# local heading
			s/^(.*)\~$/$1<\/code>/g;
			push( @out, $_ );
		}

		$_ = join( "", @out );

		if( $inexample == 2 ) {
			print OUT "$_\n";
		} else {
			print OUT $_,"\n";
		}

		$inexample = 2 if $inexample == 1;
	}
	print OUT<

Generated by vim2html on $date

EOF } sub usage { die< EOF } sub writeCSS { open( CSS, ">fim-stylesheet.css" ) || die "Couldn't write stylesheet: $!\n"; print CSS<". .TP \fB\-\-mark\-from\-image\-descriptions\-file {filename}\fP Set those files specified in \fBfilename\fP (see \-\-load\-image\-descriptions\-file for the file format) as marked (see the list command). .TP \fB\-m {vmode}\fP, \fB\-\-mode {vmode}\fP Name of the video mode to use video mode (must be listed in /etc/fb.modes). Default is not to change the video mode. In the past, the XF86 config file (/etc/X11/XF86Config) used to contain Modeline information, which could be fed to the modeline2fb perl script (distributed with fbset). On many modern xorg based systems, there is no direct way to obtain a fb.modes file from the xorg.conf file. So instead one could obtain useful fb.modes info by using the (fbmodes (no man page AFAIK)) tool, written by bisqwit. An unsupported mode should make fim exit with failure. But it is possible the kernel could trick fim and set a supported mode automatically, thus ignoring the user set mode. .TP \fB\-N\fP, \fB\-\-no\-rc\-file\fP No personal initialization file will be read (default is ~/.fimrc) at startup. .TP \fB\-\-no\-etc\-fimrc\-file\fP No system\-wide initialization file will be read (default is /usr/local/etc/fimrc) at startup. See also \fB\-\-etc\-fimrc\fP. .TP \fB\-\-no\-internal\-config\fP No internal default configuration at startup (uses internal variable \fB_no_default_configuration\fP). Will only provide a minimal working configuration. .TP \fB\-\-no\-commandline\fP With internal command line mode disabled. .TP \fB\-\-no\-history\-save\fP Do not save execution history at finalization (uses internal variable \fB_save_fim_history\fP). .TP \fB\-\-no\-history\-load\fP Do not load execution history at startup. .TP \fB\-\-no\-history\fP Do not load or save execution history at startup. .TP \fB\-p\fP, \fB\-\-script\-from\-stdin\fP Read commands from stdin before entering in interactive mode. .TP \fB\-o [fb|sdl|ca|aa|imlib2|dumb]\fP, \fB\-\-output\-device [fb|sdl|ca|aa|imlib2|dumb]\fP Will use the specified \fBdevice\fP as fim video output device, overriding automatic checks. The available devices depend on the original configuration/compilation options, so you should get the list of available output devices issuing \fBfim \-\-version\fP. The \fBfb\fP option selects the Linux framebuffer. Presence of option \fBS\fP (e.g. \fBfb=S\fP) makes framebuffer initialization more picky: it will not tolerate running in a screen session. The \fBca\fP option (coloured Ascii Art) can be specified as \fBca\fP\fB[={['w']}] \fP; if supplied, \fB'w'\fP selects windowed mode, provided libcaca is running under X; by default (or with \fB'W'\fP), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable. The \fBaa\fP (monochrome Ascii Art) option can be specified as \fBaa[={['w'|'W']}]\fP; if supplied, \fB'w'\fP selects windowed mode, provided aalib is running under X; by default (or with \fB'W'\fP), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable. Please note that the readline (internal command line) functionality in \fBca\fP and \fBaa\fP modes is limited. The \fBsdl\fP option (graphical windowed mode) may be specified as \fBsdl\:={['w']['m']['r']['h']['W']['M']['R']['H'][width[:height]]['%']}\fP, where \fBwidth\fP and \fBheight\fP are integer numbers specifying the desired resolution (if \fBheight\fP not specified, it takes the value of \fBwidth\fP); the \fB'w'\fP character requests windowed mode (instead of \fB'W'\fP for fullscreen); the \fB'm'\fP character requests mouse pointer display; the \fB'h'\fP character requests help grid map draw (can be repeated for variants); the \fB'r'\fP character requests support for window resize; the \fB'%'\fP character requests to treat \fBwidth\fP and \fBheight\fP as percentage of possible window resolution. The same letters uppercase request explicit negation of the mentioned features. The \fBimlib2\fP option requests imlib2 and is unfinished \-\- do not use it. The \fBdumb\fP test mode is not interactive. .TP \fB\-\-offset {bytes\-offset[{:upper\-offset}|{+offset\-range}]}\fP Use the specified \fBoffset\fP (in bytes) for opening the specified files. If \fB:upper\-offset\fP is specified, further bytes until \fBupper\-offset\fP will be probed. If \fB+offset\-range\fP is specified instead, that many additional bytes will be probed. Use this option to search damaged file systems for image files. Appending a modifier among K,M,G (case irrelevant) to an offset number changes the unit to be respectively 2^10, 2^20, or 2^30 bytes. .TP \fB\-\-pread\-cmd {cmd\-filter\-pipeline}\fP Specify a shell command with \fB{cmd\-filter\-pipeline}\fP. If the current filename matches "^[/A\-Za\-z0\-9_.][/A\-Za\-z0\-9_.\-]*$", it will be substituted to any occurrence of '{}'. The resulting command output is assumed to be file data, which will be read and displayed. This works by setting the internal \fB_pread_cmd\fP variable (empty by default). .TP \fB\-P\fP, \fB\-\-text\-reading\fP Enable textreading mode. This has the effect that fim will display images scaled to the width of the screen, and aligned to the top. If the images you are watching are text pages, all you have to do to get the next piece of text is to press space (in the default key configuration, of course). .TP \fB\-s {value}\fP, \fB\-\-scroll {value}\fP Set scroll steps for internal variable \fB_steps\fP (default is 20%). .TP \fB\-\-slideshow {number}\fP Interruptible slideshow mode. Wait for \fB{number}\fP of seconds (assigned to the \fB_want_sleep_seconds\fP variable) after each image. Implemented by executing reload; i:fresh=1; while(_fileindex <= _filelistlen\-_loop_only_once){sleep _want_sleep_seconds; next;} sleep _want_sleep_seconds; as a first command. Can be interrupted by : or Esc. The other keys will execute accordingly to their function but will not interrupt the slideshow. Like in fbi, this will cycle forever, unless \fB\-\-once\fP is specified. .TP \fB\-\-sanity\-check\fP Perform a quick sanity check, just after the initialization, and terminate. .TP \fB\-t\fP, \fB\-\-no\-framebuffer\fP \fBfim\fP Use an ASCII Art driver. If present, use either of libcaca (coloured), or aalib (monochrome). For more, see (man fimrc), (info aalib) or (apropos caca)). If no ASCII Art driver was enabled at compile time, fim will not display any image at all. .TP \fB\-T {terminal}\fP, \fB\-\-vt {terminal}\fP The \fBterminal\fP will be used as virtual terminal device file (as in fbi). See (chvt (1)), (openvt (1)) for more info about this. Use (con2fb (1)) to map a terminal to a framebuffer device. .TP \fB\-\-reverse\fP Reverse files list before browsing (can be combined with the other sorting options). .TP \fB\-\-sort\fP Sort files list before browsing according to full filename. .TP \fB\-\-sort\-basename\fP Sort files list before browsing according to file basename's. .TP \fB\-\-sort\-mtime\fP Sort files list before browsing according to file modification time. .TP \fB\-\-sort\-fsize\fP Sort files list before browsing according to file size. .TP \fB\-u\fP, \fB\-\-random\fP Randomly shuffle the files list before browsing (seed depending on time() function). .TP \fB\-\-random\-no\-seed\fP Pseudo\-random shuffle the files list before browsing (no seeding). .TP \fB\-v\fP, \fB\-\-verbose\fP Be verbose: show status bar. .TP \fB\-\-verbose\-load\fP Load files verbosely (repeat option to increase verbosity). .TP \fB\-\-verbose\-font\-load\fP Load font verbosely (sets \fB_fbfont_verbosity\fP). .TP \fB\-\-verbose\-interpreter\fP Execute interpreter verbosely (Sets immediately \fB_debug_commands\fP="ackC" if specified once, \fB_debug_commands\fP="ackCi" if specified twice). .TP \fB\-V\fP, \fB\-\-version\fP Print to stdout program version, compile flags, enabled features, linked libraries information, supported filetypes/file loaders, and then exit. .TP \fB\-w\fP, \fB\-\-autowidth\fP Scale the image according to the screen width. .TP \fB\-=\fP, \fB\-\-no\-auto\-scale\fP Do not scale the images after loading (will set '\fB_scale_style\fP=" "';). .TP \fB\-\-autowindow\fP Resize the window size (if supported by the video mode) to the image size. Don't use this with other image scaling options. .TP \fB\-\-no\-stat\-push\fP Sets \fB_push_checks\fP=0 before initialization, thus disabling file/dir existence checks with stat(2) at push push time (and speeding up startup). .TP \fB\-H\fP, \fB\-\-autoheight\fP Scale the image according to the screen height. .TP \fB\-W {scriptfile}\fP, \fB\-\-write\-scriptout {scriptfile}\fP All the characters that you type are recorded in the file \fB{scriptout}\fP, until you exit \fBfim\fP. This is useful if you want to create a script file to be used with "fim \-c" or ":exec" (analogous to Vim's \-s and ":source!"). If the \fB{scriptout}\fP file exists, it will be not touched (as in Vim's \-w). .TP \fB\-L {fileslistfile}\fP, \fB\-\-read\-from\-file {fileslistfile}\fP Read file list from a file: each line one file to load (similar to \fB\-\-read\-from\-stdin\fP; use \fB\-\-read\-from\-stdin\-elds\fP to control line breaking). .TP \fB \-, \fP\fB\-\-read\-from\-stdin\fP Read file list from stdin: each line one file to load; use with \-\-read\-from\-stdin\-elds to control line breaking). Note that these the three standard input reading functionalities (\-i,\-p and \-) conflict : if two or more of them occur in fim invocation, fim will exit with an error and warn about the ambiguity. See the section .B INVOCATION EXAMPLES below to read some useful (and unique) ways of employing fim. .TP \fB\-\-read\-from\-stdin\-elds {delimiter\-char}\fP Specify an endline delimiter character for breaking lines read via \-/\-\-read\-from\-stdin/\-\-read\-from\-file (which shall be specified after this). Line text before the delimiter will be treated as names of files to load; the text after will be ignored. This is also useful e.g. to load description files (see \-\-load\-image\-descriptions\-file) as filename list files. Default is the newline character (0x0A); to specify an ASCII NUL byte (0x00) use ''. .TP \fB\-A\fP, \fB\-\-autotop\fP Align images to the top border (by setting '\fB_autotop\fP=1' after initialization). .TP \fB\-q\fP, \fB\-\-quiet\fP Quiet execution mode. Sets _display_status=0;_display_busy=0;. .TP \fB\-r {width:height}\fP, \fB\-\-resolution {width:height}\fP Set resolution specification in pixels. Supported by SDL only. Will be appended to the argument to \-\-output\-device. Shorthand value 'fullscreen' will be translated into 'W'. .TP \fB\-R[{exp}]\fP, \fB\-\-recursive[={exp}]\fP Push files/directories to the files list recursively. The expression in variable \fB_pushdir_re\fP (default: "\.(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$") lists extensions of filenames which will be loaded in the list. You can overwrite its value by optionally passing an expression \fB{exp}\fP here as argument. If starting with '+' or '|', the expression following will be appended to it. .TP \fB\-X\fP, \fB\-\-no\-pipe\-load\fP Do not load via external converter programs: only use built\-in file decoders. .TP \fB\-B\fP, \fB\-\-background\-recursive\fP Push files/directories to the files list recursively, in background during program execution. Any sorting options will be ignored. Experimental feature, unfinished. .TP \fB\-\-load\-shadow\-directory {dir}\fP Add \fB{dir}\fP to the shadow directory list. Then 'scale "shadow"' will temporarily substitute the image being displayed with that of the first same\-named file located under a shadow directory. Useful to browse low\-res images, but still being able to quickly view the hi\-res original residing in a shadow directory. This works as intended as long as unique filenames are involved. .TP \fB\-/ {pattern}\fP, \fB\-\-/ {pattern}\fP After startup jump to pattern; short for \-c '/'. .TP \fB\-\-// {pattern}\fP After startup jump to pattern; as \-c '/' but with search on the full path (with \fB_re_search_opts="f"\fP). .TP \fB\-1\fP, \fB\-\-once\fP If running \-\-slideshow, loop only once (as in fbi). .SH PROGRAM RETURN STATUS The program return status is 0 on correct operation; 252 on unsupported device specification; 248 on bad input; 255 on a generic error; 42 on a signal\-triggered program exit; or a different value in case of an another error. The return status may be controlled by the use of the quit command. .SH COMMON KEYS AND COMMANDS .nf The following keys and commands are hardcoded in the minimal configuration. These are working by default before any config loading, and before the hardcoded config loading (see variable \fB_fim_default_config_file_contents\fP). n goto '+1f' p goto '\-1f' + magnify \- reduce h pan 'left' l pan 'right' k pan 'up\-' j pan 'down+' q quit You can type a number before a command binding to iterate the assigned command: 3k 3pan 'up\-' .nf : enter command line mode :{number} jump to {number}^th image in the list :^ jump to first image in the list :$ jump to last image in the list :*{factor} scale the image by {factor} :{scale}% scale the image to the desired {scale} :+{scale}% scale the image up to the desired percentage {scale} (relatively to the original) :\-{scale}% scale the image down to the desired percentage {scale} (relatively to the original) /{regexp} entering the pattern {regexp} (with /) makes fim jump to the next image whose filename matches {regexp} /*.png$ entering this pattern (with /) makes fim jump to the next image whose filename ends with 'png' /png a shortcut for /.*png.* 2,4 stdout '{}' print three filenames to standard output. !{syscmd} executes the {syscmd} quoted string as an argument to the "system" fim command. You can visualize all of the default bindings invoking fim \-\-dump\-default\-fimrc | grep bind . You can visualize all of the default aliases invoking fim \-\-dump\-default\-fimrc | grep alias . .fi .P The Return vs. Space key thing can be used to create a file list while reviewing the images and use the list for batch processing later on. All of the key bindings are reconfigurable; see the default .B fimrc file for examples on this, or read the complete manual: the FIM.TXT file distributed with fim. .SH AFFECTING ENVIRONMENT VARIABLES .nf FBFONT (just like in fbi) a Linux consolefont font file. If using a gzipped font, the zcat program will be used to uncompress it (via \fBexecvp(3)\fP). If not specified, the following files will be probed and the first existing will be selected: /usr/share/kbd/consolefonts/cp866\-8x16.psf.gz /usr/share/consolefonts/Uni3\-TerminusBoldVGA14.psf.gz /usr/lib/kbd/consolefonts/lat9\-16.psf.gz /usr/share/consolefonts/lat1\-16.psf /usr/share/consolefonts/lat1\-16.psf.gz /usr/share/consolefonts/lat1\-16.psfu.gz /usr/share/kbd/consolefonts/lat1\-16.psf /usr/share/kbd/consolefonts/lat1\-16.psf.gz /usr/share/kbd/consolefonts/lat1\-16.psfu.gz /usr/lib/kbd/consolefonts/lat1\-16.psf /usr/lib/kbd/consolefonts/lat1\-16.psf.gz /usr/lib/kbd/consolefonts/lat1\-16.psfu.gz /lib/kbd/consolefonts/lat1\-16.psf /lib/kbd/consolefonts/lat1\-16.psf.gz /lib/kbd/consolefonts/lat1\-16.psfu.gz /lib/kbd/consolefonts/Lat2\-VGA14.psf.gz /lib/kbd/consolefonts/Lat2\-VGA16.psf.gz /lib/kbd/consolefonts/Lat2\-VGA8.psf.gz /lib/kbd/consolefonts/Uni2\-VGA16.psf.gz /usr/share/consolefonts/default8x16.psf.gz /usr/share/consolefonts/default8x9.psf.gz /usr/share/consolefonts/Lat15\-Fixed16.psf.gz /usr/share/consolefonts/default.psf.gz fim:// If the special fim:// string is specified, a hardcoded font will be used. FBGAMMA (just like in fbi) gamma correction (applies to dithered 8 bit mode only). Default is 1.0. FRAMEBUFFER (just like in fbi) user set framebuffer device file (applies only to the fb mode). If unset, fim will probe for /dev/fb0. TERM (only in fim) will influence the output device selection algorithm, especially if $TERM=="screen". SSH_TTY if set and no output device specified, give precedence to ca, then aa (if present). DISPLAY If this variable is set, then the sdl driver will be probed by default. .SH COMMON PROBLEMS .B fim needs read\-write access to the framebuffer devices (/dev/fbN or /dev/fb/N), i.e you (our your admin) have to make sure fim can open the devices in rw mode. The IMHO most elegant way is to use pam_console (see /etc/security/console.perms) to chown the devices to the user logged in on the console. Another way is to create some group, chown the special files to that group and put the users which are allowed to use the framebuffer device into the group. You can also make the special files world writable, but be aware of the security implications this has. On a private box it might be fine to handle it this way through. If using udev, you can edit: /etc/udev/permissions.d/50\-udev.permissions and set these lines like here: # fb devices fb:root:root:0600 fb[0\-9]*:root:root:0600 fb/*:root:root:0600 .P .B fim also needs access to the linux console (i.e. /dev/ttyN) for sane console switch handling. That is obviously no problem for console logins, but any kind of a pseudo tty (xterm, ssh, screen, ...) will .B not work. .SH INVOCATION EXAMPLES .B fim \-\-help \-R \-B .fi # get help for options \fB\-R\fP and .B \-B .P .P .B fim media/ .fi # load files from the directory .B media/ .P .P .B fim \-R media/ \-\-sort .fi # open files found by recursive traversal of directory media, then sorting the list .P .P .B find /mnt/media/ \-name *.jpg | fim \- .fi # read input files list from standard input .P .P .B find /mnt/media/ \-name *.jpg | shuf | fim \- .fi # read input files list from standard input, randomly shuffled .P .P .B cat script.fim | fim \-p images/* .fi # read a script file .B script.fim from standard input before displaying files in the directory .B images .P .P .B scanimage ... | tee scan.ppm | fim \-i .fi # read the image scanned from a flatbed scanner as soon as it is read .P .P .B h5topng \-x 1 \-y 2 dataset.hdf \-o /dev/stdout | fim \-i .fi # visualize a slice from an HDF5 dataset file .P .P .B fim * > selection.txt .fi # output the file names marked interactively with the 'list "mark"' command in fim to a file .P .P .B fim * | fim \- .fi # output the file names marked with 'm' in fim to a second instance of fim, in which these could be marked again .P .P .B fim \-c 'pread "vgrabbj \-d /dev/video0 \-o png";reload' .fi # display an image grabbed from a webcam .P .P .B fim \-o aa \-c 'pread "vgrabbj \-d /dev/video0 \-o png";reload;system "fbgrab" "asciime.png"' .fi .fi # if running in framebuffer mode, will save a png screenshot with an ASCII rendering of an image grabbed from a webcam .P .P .B fim \-c 'while(1){pread "vgrabbj \-d /dev/video0 \-o png";reload;sleep 1;};' .fi # will display a sequence of images grabbed from a webcam; circa 1 per second .P .P .SH NOTES This manual page is neither accurate nor complete. In particular, issues related to driver selection shall be described more accurately. Also the accurate sequence of autocommands execution, variables application is critical to understanding fim, and should be documented. The filename "" is reserved for images read from standard input (view this as a limitation), and thus handling files with such name may incur in limitations. The SDL driver is quite inefficient, for a variety of reasons. In particular, its interaction with the readline library can be problematic (e.g.: when running in sdl mode without a terminal). This shall be fixed. .SH BUGS \fBfim\fP has bugs. Please read the .B BUGS file shipped in the documentation directory to discover the known ones. There are also inconsistencies in the way the internal command line works across the different graphical devices. .SH FILES .TP 15 .B /usr/local/share/doc/fim The directory with \fBfim\fP documentation files. .TP 15 .B /usr/local/etc/fimrc The system\-wide \fBfim\fP initialization file (executed at startup, after executing the hardcoded configuration). .TP 15 .B ~/.fimrc The personal \fBfim\fP initialization file (executed at startup, after the system\-wide initialization file). .TP 15 .B ~/.fim_history File where to load from or save. See (man \fR\fIfimrc\fR(5), man \fR\fIreadline\fR(3)). .TP 15 .B ~/.inputrc If \fBfim\fP is built with GNU readline support, it will be susceptible to chages in the user set ~/.inputrc configuration file contents. For details, see (man \fR\fIreadline\fR(3)). .SH SEE ALSO Other \fBfim\fP man pages: \fR\fIfimgs\fR(1), \fR\fIfimrc\fR(1). .fi Conversion programs: \fR\fIconvert\fR(1), \fR\fIdia\fR(1), \fR\fIxcftopnm\fR(1), \fR\fIfig2dev\fR(1), \fR\fIinkscape\fR(1). .fi Related programs: \fR\fIfbset\fR(1), \fR\fIcon2fb\fR(1), \fR\fIvim\fR(1), \fR\fImutt\fR(1), \fR\fIexiftool\fR(1), \fR\fIexiftags\fR(1), \fR\fIexiftime\fR(1), \fR\fIexifcom\fR(1), \fR\fIfbi\fR(1), \fR\fIfbida\fR(1), \fR\fIfeh\fR(1), \fR\fIfbgrab\fR(1). .fi Related documentation: \fR\fIfbdev\fR(4), \fR\fIvcs\fR(4), \fR\fIfb.modes\fR(8), \fR\fIfbset\fR(8), \fR\fIsetfont\fR(8). .fi .SH AUTHOR .nf Michele Martone is the author of fim, "fbi improved". .fi .SH COPYRIGHT .nf Copyright (C) 2007\-2023 Michele Martone (author of fim) .fi Copyright (C) 1999\-2004 Gerd Hoffmann is the author of "fbi", upon which .B fim was originally based. .P 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. .P 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. .P You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301 USA. fim-0.6-rc2/doc/fimrc.man.in0000644000175000017500000017754714454353764012552 00000000000000.\" .\" $Id$ .\" .TH fimrc 5 "(c) 2011-2023 Michele Martone" .SH NAME fimrc - \fB fim \fP configuration file and language reference .SH SYNOPSIS .B ~/.fimrc .fi .B @sysconfdir@/fimrc .fi .B fim --script-from-stdin [ {options} ] < {scriptfile} .fi .B fim --execute-script {scriptfile} [ {options} ] .fi .B fim --execute-commands {commands} [ {options} ] .fi .B fim --final-commands {commands} [ {options} ] .fi .B fim --write-scriptout {scriptfile} [ {options} ] .fi .B fim --write-scriptout /dev/stdout [ {options} ] .fi .B fim --chars-press :{commands} [ {options} ] .fi .B fim --chars-press :{commands} --chars-press '' [ {options} ] .fi .SH DESCRIPTION This page explains the .B fim language, which is used for the .B fimrc configuration files, {scriptfile}s, or {commands} passed via command line {options}. This language can be used to issue commands (or programs) from the internal program command line accessed interactively through the ":" key (or rather, the key code specified by the "\fB_console_key\fP" variable). One may exit from command line mode by pressing the Enter key on an empty line (a non empty command line would be submitted for execution), or the Esc key (only in SDL mode). The general form of a fim command/program is shown in the next section. .SH FIM LANGUAGE GRAMMAR This section specifies the grammar of the .B fim language. Language elements surrounded by a single quote ("'") are literals. Warning: at the present state, this grammar has conflicts. A future release shall fix them. program: %empty | statement_list statement_list: statement | statement ';' statement_list | non_atomic_statements_block statement_list | statements_block non_atomic_statements_block: '{' statement_list '}' | INTEGER '{' statement_list '}' | conditional_statement statements_block: atomic_statements_block | non_atomic_statements_block conditional_statement: if_statement | loop_statement if_statement: 'if' '(' expression ')' statements_block | 'if' '(' expression ')' statements_block 'else' statements_block loop_statement: 'while' '(' expression ')' statements_block | 'do' statements_block 'while' '(' expression ')' atomic_statements_block: statement ';' | statement ';' ';' | statement ';' ';' ';' statement: '!' arguments | INTEGER ',' INTEGER IDENTIFIER | INTEGER ',' INTEGER IDENTIFIER arguments | INTEGER IDENTIFIER | SLASH_AND_REGEXP | '+' UNQUOTED_FLOAT '%' | '+' QUOTED_FLOAT '%' | '+' INTEGER '%' | '*' UNQUOTED_FLOAT | '*' QUOTED_FLOAT | '*' INTEGER | UNQUOTED_FLOAT '%' | QUOTED_FLOAT '%' | INTEGER '%' | '-' UNQUOTED_FLOAT '%' | '-' QUOTED_FLOAT '%' | '-' INTEGER '%' | INTEGER | '-' INTEGER | IDENTIFIER | IDENTIFIER FILE_PATH | IDENTIFIER arguments | INTEGER IDENTIFIER arguments | IDENTIFIER '=' expression arguments: expression | expression arguments expression: '(' expression ')' | expression '.' expression | '!' expression | expression '%' expression | expression '+' expression | expression '-' expression | expression '*' expression | expression '/' expression | expression '<' expression | expression '>' expression | expression '||' expression | expression BOR expression | expression '&&' expression | expression BAND expression | expression '>=' expression | expression '<=' expression | expression '!=' expression | expression '==' expression | expression '=~' expression | '-' expression | IDENTIFIER | INTEGER | QUOTED_FLOAT | UNQUOTED_FLOAT | STRING A STRING can be either a single quoted string or a double quoted string. A floating point number can be either unquoted (UNQUOTED_FLOAT) or quoted (QUOTED_FLOAT). A QUOTED_FLOAT is a floating point number, either single ("'") or double (""") quoted. An INTEGER shall be an unsigned integer number. An IDENTIFIER shall be one of the valid fim commands (see .B COMMANDS REFERENCE ) or a valid alias. A VARIABLE shall be an already declared or undeclared variable identifier (see .B VARIABLES REFERENCE ) or a valid alias, created using the .B alias command. The "=~" operator treats the right expression as a STRING, and uses it as a regular expression for matching purposes. The SLASH_AND_REGEXP is a slash ("/") followed by a STRING, interpreted as a regular expression. If 'INTEGER , INTEGER IDENTIFIER arguments' is encountered, command IDENTIFIER will be repeated on each file in the interval between the two INTEGERs, and substituting the given file name to any '{}' found in the commands arguments (which must be quoted in order to be treated as strings). See \fR\fIregex\fR(1) for regular expression syntax. The way some one-line statements are evaluated: .nf : enter command line mode :{number} jump to {number}^th image in the list :^ jump to first image in the list :$ jump to last image in the list :*{factor} scale the image by {factor} :{scale}% scale the image to the desired {scale} :+{scale}% scale the image up to the desired percentage {scale} (relatively to the original) :-{scale}% scale the image down to the desired percentage {scale} (relatively to the original) /{regexp} entering the pattern {regexp} (with /) makes fim jump to the next image whose filename matches {regexp} /*.png$ entering this pattern (with /) makes fim jump to the next image whose filename ends with 'png' /png a shortcut for /.*png.* 2,4 stdout '{}' print three filenames to standard output. !{syscmd} executes the {syscmd} quoted string as an argument to the "system" fim command. .SH COMMANDS REFERENCE .na .B alias .fi alias [{identifier} [{commands} [{description}]]] .fi Without arguments, lists the current aliases. .fi With one, shows an identifier's assigned command. .fi With two, assigns to an identifier a user defined command or sequence of commands. .fi With three, also assigns a help string. .fi .na .B align .fi align ['bottom'|'top'|'left'|right']: if image larger than drawing area, align one side of the image to the border. .fi align 'center': align equally far from all sides. .fi align 'info': print internal alignment information. .fi .na .B autocmd .fi autocmd {event} {pattern} {commands}: manipulate autocommands (inspired from Vim autocmd's). .fi Without arguments, list autocommands. .fi With arguments, specifies for which type of event and which current file open, which commands to execute. .fi See the default built-in configuration files for examples. .fi .na .B autocmd_del .fi autocmd_del: specify autocommands to delete. .fi Usage: autocmd_del {event} {pattern} {commands}. .fi .na .B basename .fi basename {filename}: returns the basename of {filename} in the '_last_cmd_output' variable. .fi .na .B bind .fi bind [{keysym} [{commands}]]: bind a keyboard symbol/shortcut {keysym} to {commands}. .fi If {keysym} is at least two characters long and begins with 0 (zero), the integer number after the 0 will be treated as a raw keycode to bind the specified {keysym} to. .fi Use the '_verbose_keys' variable to discover (display device dependent) raw keys. .fi Key binding is dynamical, so you can rebind keys even during program's execution. .fi You can get a list of valid symbols (keysyms) by invoking dump_key_codes or in the man page. .fi .na .B cd .fi cd {path}: change the current directory to {path}. .fi If {path} is a file, use its base directory name. .fi cd '-' will change to the previous current directory (before the last ':cd {path}' command). .fi .na .B clear .fi clear: clear the virtual console. .fi .na .B commands .fi commands: display the existing commands. .fi .na .B color .fi color [desaturate]: desaturate the displayed image colors. .fi color [negate]: negate the displayed image colors. .fi color [colorblind|c|deuteranopia|d]: simulate a form of the deuteranopia color vision deficiency (cvd). .fi color [protanopia|p]: simulate a form of the protanopia cvd. .fi color [tritanopia|t]: simulate a form of the tritanopia cvd. .fi color [daltonize|D]: if following a cvd specification, will attempt correcting it. .fi color [identity]: populate the image with 'RGB identity' pixels. .fi To get back the original you will have to reload the image. .fi .na .B crop .fi crop: crop image to a centered rectangle, half the width and half the height. .fi crop {p}: crop image to the middle {p} horizontal percent and {p} vertical percent of the image. .fi crop {w} {h}: crop image to the middle {w} horizontal percent and {h} vertical percent of the image. .fi crop {x1} {y1} {x2} {y2}: crop image to the area between the upper left ({x1},{y1}) and lower right ({x2},{y2}) corner. .fi Units are intended as percentage (0 to 100). .fi Note: still experimental functionality. .fi .na .B desc .fi desc 'load' {filename} [{sepchar}]: load description file {filename}, using the optional {sepchar} character as separator. .fi desc 'reload': load once again description files specified at the command line with --load-image-descriptions-file, with respective separators. .fi desc ['-all'] ['-append'] ['-nooverw'] 'save' {filename} [{sepchar}]: save current list descriptions to file {filename}, using the optional {sepchar} character as separator, and if '-all' is present will save the variables, and if '-append' is present, will only append, and if '-nooverw' is present, will not overwrite existing files. .fi See documentation of --load-image-descriptions-file for the format of {filename}. .fi .na .B display .fi display ['reinit' {string}]|'resize' {w} {h}]: display the current file contents. .fi If 'reinit' switch is supplied, the '{string}' specifier will be used to reinitialize (e.g.: change resolution, window system options) the display device. .fi See documentation for the --output-device command line switch for allowed values of {string}. .fi If 'resize' and no argument, will ask the window manager to size the window like the image. .fi If 'resize' and two arguments, these will be used as width and height of window, to set. .fi .na .B dump_key_codes .fi dump_key_codes: dump the active key codes (unescaped, for inspection purposes). .fi .na .B echo .fi echo {args}: print the {args} on console. .fi .na .B else .fi if(expression){action;}['else'{action;}]: see else. .fi .na .B eval .fi eval {args}: evaluate {args} as commands, executing them. .fi .na .B exec .fi exec {filename(s)}: execute script {filename(s)}. .fi .na .B font .fi font 'scan' [{dirname}]: scan {dirname} or /usr/share/consolefonts looking for fonts in the internal fonts list. .fi font 'load' {filename}: load font {filename}. .fi font 'next'/'prev': load next/previous font in the internal fonts list. .fi font 'info': print current font filename. .fi .na .B getenv .fi getenv {identifier}: create a variable with the same value as the '{identifier}' environment variable, but with an identifier prefixed by 'ENV_'. So e.g. getenv 'DISPLAY' creates 'ENV_DISPLAY'. Nothing is being printed; no variable is created if {identifier} is empty. .fi .na .B goto .fi goto {['+'|'-']{number}['%']['f'|'p'|'F'|'P']} | {/{regexp}/} | {?{filename}} | {'+//'} | {'+/'|'-/'}[C] | {{'+'|'-'}{identifier}['+']}: jump to an image. .fi If {number} is given, and not surrounded by any specifier, will go to image at index {number}. .fi If followed by '%', the effective index will be computed as a percentage to the current available images. .fi If prepended by '-' or '+', the jump will be relative to the current index. .fi The 'f' specifier asks for the jump to occur within the files (same for 'F', but accelerates if keep pressing). .fi The 'p' specifier asks for the jump to occur in terms of pages, within the current file (same for 'P', but accelerates if keep pressing). .fi If /{regexp}/ is given, will jump to the first image matching the given /{regexp}/ regular expression pattern. .fi If the argument starts with ?, jump to the filename following ?. .fi If given '+//', will jump to the first different image matching the last given regular expression pattern. .fi With '+/'C or '-/'C will jump to next or previous file according to C: if 's' if same directory, if 'd' if down the directory hierarchy, if 'u' if down the directory hierarchy, if 'b' if same basename, if upper case match is negative, if missing defaults to 'S' (jump to file in different dir). .fi If {identifier|identifier2...}] is encountered after a '+' or '-' sign, jump to next or previous image having a different value for any corresponding i:{identifier} (a trailing '+' will require a non empty value). .fi Match will occur on both file name and description, possibly loaded via desc or --load-image-descriptions-file; see also '_lastgotodirection' and '_re_search_opts'. .fi You can specify multiple arguments to goto: those after the first triggering a jump will be ignored. .fi Executes autocommands for events PreGoto and PostGoto. Keeping pressed shall accelerate images browsing. .fi .na .B help .fi help [{identifier}]: provide online help, assuming {identifier} is a variable, alias, or command identifier. .fi If {identifier} begins with '/', the search will be on the help contents and a list of matching items will be given instead. .fi A list of commands can be obtained simply invoking 'commands'; a list of aliases with 'alias'; a list of bindings with 'bind'. .fi .na .B if .fi if(expression){action;}['else'{action;}]: see 'else'. .fi .na .B info .fi info: display information about the current file. .fi .na .B limit .fi limit {'-list'|'-listall'} 'variable'|['-further'|'-merge'|'-subtract'] [{expression} |{variable} {value}]: A browsable file list filtering function (like limiting in the 'mutt' program). Uses information loaded via --load-image-descriptions-file. .fi If invoked with '-list'/'-listall' only, will list the current description variable ids. .fi If invoked with '-list'/'-listall' 'id', will list set values for the variable 'id'. .fi If '-further' is present, will start with the current list; if not, with the full list. .fi If '-merge' is present, new matches will be merged in the existing list and sorted. .fi If '-subtract' is present, sort and filter out matches. .fi If {variable} and {values} are provided, limit to files having property {variable} set to {value}. .fi If {expression} is one exclamation point ('!'), will limit to the currently marked files only. .fi If {expression} is '~!' will limit to files with unique basename. .fi if '~=', to files with duplicate basename. .fi if '~^', to the first of the files with duplicate basename. .fi if '~$\:', to the last of the files with duplicate basename. .fi On '~i' [MINIDX][-][MAXIDX], (each a number possibly followed by a multiplier 'K') will limit on filenames in position MINIDX to MAXIDX. .fi On '~z' will limit to files having the current file's size. .fi on '~z' [MINSIZE][-][MAXSIZE], (each a number possibly followed by a multiplier among 'k','K','m','M') will limit on filesize within these limits. .fi on '~d' will limit to files having the current file's date +- one day. .fi on '~d' [MINTIME][-][MAXTIME], (each the count of seconds since the Epoch (First of Jan. of 1970) or a date as DD/MM/YYYY) will limit on file time (struct stat's 'st_mtime', in seconds) within this interval. .fi For other values of {expression}, limit to files whose description string matches {expression}. .fi Invoked with no arguments, the original browsable files list is restored. .fi .na .B list .fi list: display the files list. .fi list 'random_shuffle': randomly shuffle the file list. .fi list 'reverse': reverse the file list. .fi list 'clear': clear the file list. .fi list 'sort': sort the file list. .fi list 'sort_basename': sort the file list according to base name. .fi list 'sort_comment': sort the file list according to the value of the _comment variable. .fi list 'sort_var' {var}: sort the file list according to the value of the i:{var} variable. .fi list 'vars|variables': list variables in all i:* read from description file. .fi list 'sort_fsize': sort the file list according to file size. .fi list 'sort_mtime': sort the file list according to modification date. .fi list 'pop': remove the current file from the files list, and step back. .fi list 'remove' [{filename(s)}]: remove the current file, or the {filename(s)}, if specified. .fi list 'push' {filename(s)}: push {filename(s)} to the back of the files list. .fi list 'filesnum': display the number of files in the files list. .fi list 'mark' [{args}]: mark image file names for stdout printing at exit, with {args} mark the ones matching according to the rules of the 'limit' command, otherwise the current file. .fi list 'unmark' [{args}]: unmark marked image file names, with {args} unmark the ones matching according to the rules of the 'limit' command, otherwise the current file. .fi list 'marked': show which files have been marked so far. .fi list 'dumpmarked': dump to stdout the marked files (you will want usually to 'unmarkall' afterwards). .fi list 'markall': mark all the current list files. .fi list 'unmarkall': unmark all the marked files. .fi list 'pushdir' {dirname}: will push all the files in {dirname}, when matching the regular expression in variable _pushdir_re or, if empty, from constant regular expression '\.(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$\:'. .fi list 'pushdirr' {dirname}: like pushdir, but will also push encountered directory entries recursively. .fi list 'swap': will move the current image filename to the first in the list (you'll have to invoke reload to see the effect). .fi Of the above commands, several will be temporarily non available for the duration of a background load (enabled by --background-recursive), which will last until _loading_in_background is 0. .fi .na .B load .fi load: load the image, if not yet loaded (see also 'reload'). .fi Executes autocommands for events PreLoad and PostLoad. .fi .na .B pan .fi pan {vsteps}% {hsteps}%: pan the image to {vsteps} percentage steps from the top and {hsteps} percentage steps from left. .fi pan {vsteps} {hsteps}: pan the image to {vsteps} pixels from the top and {hsteps} pixels from left. .fi pan {'down'|'up'|'left'|'right'|'ne'|'nw'|'se'|'sw'}[+-] [{steps}['%']]: pan the image {steps} pixels in the desired direction. .fi If the '%' specifier is present, {steps} will be treated as a percentage of current screen dimensions. .fi If {steps} is not specified, the '_steps' variable will be used. .fi If present, the '_hsteps' variable will be considered for horizontal panning. .fi A '+' or '-' sign at the end of the first argument will make jump to next or prev if border is reached. .fi If present, the '_vsteps' variable will be considered for vertical panning. .fi The variables may be terminated by the '%' specifier. .fi Executes autocommands for events PrePan and PostPan. .fi .na .B popen .fi popen {syscmd}: pipe a command, invoking popen(): spawns a shell, invoking '{syscmd}' and executing as fim commands the output of '{syscmd}'. .fi .na .B pread .fi pread {args}: execute {args} as a shell command and read the output as an image file (using 'popen'). .fi .na .B prefetch .fi prefetch: prefetch (read into the cache) the two nearby image files (next and previous), for a faster subsequent opening. .fi Executes autocommands for events PrePrefetch and PostPrefetch. .fi See also the '_want_prefetch' variable. .fi .na .B pwd .fi pwd: print the current directory name, and updates the '_pwd' variable. .fi .na .B quit .fi quit [{number}]: terminate the program. .fi If {number} is specified, use it as the program return status. .fi Note that autocommand 'PostInteractiveCommand' does not trigger after this command. .fi .na .B recording .fi recording 'start': start recording the executed commands. .fi recording 'stop': stop recording the executed commands. .fi recording 'dump': dump in the console the record buffer. .fi recording 'execute': execute the record buffer. .fi recording 'repeat_last': repeat the last performed action. .fi .na .B redisplay .fi redisplay: re-display the current file contents. .fi .na .B reload .fi reload [{arg}]: load the image into memory. .fi If {arg} is present, will force reloading, bypassing the cache (see also 'load'). .fi Executes autocommands for events PreReload and PostReload. .fi .na .B rotate .fi rotate {number}: rotate the image the specified amount of degrees. If unspecified, by one. If you are interested in orthogonal rotations, see '_orientation' and related aliases. .fi Executes autocommands for events PreScale and PostScale. .fi .na .B scale .fi scale {['+'|'-']{value}['%']|'*'{value}|'w'|'h'|'a'|'b'|'+[+-*/]'|['<'|'>']|'shadow'}: scale the image according to a scale {value} (e.g.: 0.5,40%,'w','h','a','b'). .fi If given '*' and a value, will multiply the current scale by that value. .fi If given 'w', will scale according to the screen width. .fi If given 'h', scale to the screen height. .fi If given 'a', to the minimum of 'w' and 'h'. .fi If given 'b', like 'a', provided that the image width exceeds 'w' or 'h'. .fi If {value} is a number, will scale relatively to the original image width. .fi If the number is followed by '%', the relative scale will be treated on a percent scale. .fi If given '++'('+-'), will increment (decrement) the '_magnify_factor', '_reduce_factor' variables by '_scale_factor_delta'. .fi If given '+*'('+/'), will multiply (divide) the '_magnify_factor', '_reduce_factor' variables by '_scale_factor_multiplier'. .fi If given '<' or '>', will shrink or magnify image using nearest mipmap (cached pre-scaled version). If given 'shadow' as a parameter, search a same-named file in one of the directories specified to --load-shadow-dir. .fi Executes autocommands for events PreScale and PostScale. .fi .na .B scroll .fi scroll: scroll down the image, going next when hitting the bottom. .fi scroll 'forward': scroll the image as we were reading left to right (see '_scroll_skip_page_fraction' variable). .fi Executes autocommands for events PrePan and PostPan. .fi .na .B set .fi set: returns a list of variables which are set. .fi set {identifier}: returns the value of variable {identifier}. .fi set {identifier} {commands}: sets variable {identifier} to value {commands}. .fi .na .B set_commandline_mode .fi set_commandline_mode: set console mode. .fi .na .B set_interactive_mode .fi set_interactive_mode: set interactive mode. .fi .na .B sleep .fi sleep [{number}=1]: sleep for the specified (default 1) number of seconds. .fi .na .B status .fi status: set the status line to the collation of the given arguments. .fi .na .B stderr .fi stderr {args}: writes to stderr its arguments {args}. .fi .na .B stdout .fi stdout {args}: writes to stdout its arguments {args}. .fi .na .B system .fi system {syscmd}: get the output of executing the {syscmd} system command. Uses the popen() system call. Usually popen invokes "/bin/sh -c {syscmd}". This might not handle a multi-word command; in that case you will have to put it into a script. See 'man popen' for more. .fi .na .B variables .fi variables: display the existing variables. .fi .na .B unalias .fi unalias {identifier} | '-a': delete the alias {identifier} or all aliases (use '-a', not -a). .fi .na .B unbind .fi unbind {keysym}: unbind the action associated to a specified {keysym} .fi If {keysym} is at least two characters long and begins with 0 (zero), the integer number after the 0 will be treated as a raw keycode to bind the specified {keysym} to. .fi Use the '_verbose_keys' variable to discover (display device dependent) raw keys. .fi .na .B while .fi while(expression){action;}: A conditional cycle construct. .fi May be interrupted by hitting the 'Esc' or the ':' key. .fi .na .B window .fi window {args}: this command is disabled. .fi .SH KEYSYMS REFERENCE " " "!" """ "#" "$" "%" "&" "'" "(" ")" "*" "+" "," "-" "." "/" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" ":" ";" "<" "=" ">" "?" "@" "A" "Any" "B" "BackSpace" "Backspace" "C" "C-a" "C-b" "C-c" "C-d" "C-e" "C-f" "C-g" "C-h" "C-i" "C-j" "C-k" "C-l" "C-m" "C-n" "C-o" "C-p" "C-q" "C-r" "C-s" "C-t" "C-u" "C-v" "C-w" "C-x" "C-y" "C-z" "D" "Del" "Down" "E" "End" "Enter" "Esc" "F" "F1" "F10" "F11" "F12" "F2" "F3" "F4" "F5" "F6" "F7" "F8" "F9" "G" "H" "Home" "I" "Ins" "J" "K" "L" "Left" "M" "N" "O" "P" "PageDown" "PageUp" "Q" "R" "Right" "S" "T" "Tab" "U" "Up" "V" "W" "X" "Y" "Z" "[" "\\" "]" "^" "_" "`" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "{" "|" "}" "~" .SH AUTOCOMMANDS REFERENCE Available autocommands are: PreScale, PostScale, PrePan, PostPan, PreRedisplay, PostRedisplay, PreDisplay, PostDisplay, PrePrefetch, PostPrefetch, PreReload, PostReload, PreLoad, PostLoad, PreGoto, PostGoto, PreConfigLoading, PostConfigLoading, PreHardcodedConfigLoading, PostHardcodedConfigLoading, PreUserConfigLoading, PostUserConfigLoading, PreGlobalConfigLoading, PostGlobalConfigLoading, PreInteractiveCommand, PostInteractiveCommand, PreExecutionCycle, PostExecutionCycle, PreExecutionCycleArgs, PreWindow, PostWindow, and they are triggered on actions as suggested by their name. Those associated to actual commands are mentioned in the associated commands reference. .SH VARIABLES REFERENCE If undeclared, a variable will evaluate to 0. When assigning a variable to a string, use single or double quoting, otherwise it will be treated as a number. The namespaces in which variables may exist are: current image, global. A namespace is specified by a prefix, which can be: 'i:', be prepended to the variable name. The global namespace is equivalent to the empty one:''. The special variable i:* expands to the collation of all the name-value pairs for the current image. In the following, the [internal] variables are the ones referenced in the source code (not including the hardcoded configuration, which may be inspected and/or invalidated by the user at runtime). .na .B _TERM [out,g:] the environment TERM variable. .fi .na .B __exif_flipped [out,i:] flipping information, read from the EXIF tags of a given image. .fi .na .B __exif_mirrored [out,i:] mirroring information, read from the EXIF tags of a given image. .fi .na .B __exif_orientation [out,i:] orientation information in the same format of _orientation, read from the orientation EXIF tags (i:EXIF_Orientation). .fi .na .B _all_file_loaders [out,g:] space-separated list of hardcoded file loaders usable with _file_loader. .fi .na .B _archive_files [in,g:] Regular expression matching filenames to be treated as (multipage) archives. If empty, "\.(RAR|ZIP|TAR|TAR.GZ|TGZ|TAR.BZ2|TBZ|TBZ2|CBR|CBZ|LHA|7Z|XAR|ISO)$\:" will be used. Within each archive, only filenames matching the regular expression in the _pushdir_re variable will be considered for opening. .fi .na .B _autocmd_trace_stack [in,g:] dump to stdout autocommands (autocmd) stack trace during their execution (for debugging purposes). .fi .na .B _autodesaturate [in,g:] if 1, will desaturate images by default. .fi .na .B _autoflip [in,g:] if 1, will flip images by default. .fi .na .B _automirror [in,g:] if 1, will mirror images by default. .fi .na .B _autonegate [in,g:] if 1, will negate images by default. .fi .na .B _autotop [in,g:] if 1, will align to the top freshly loaded images. .fi .na .B _buffered_in_tmpfile [out,i:] if an image has been temporarily converted and decoded from a temporary file, its name is here. .fi .na .B _cache_control [in,g:] string for cache control. if it starts with 'm' mipmaps will be cached; if it starts with 'M' then not. otherwise defaults will apply. .fi .na .B _cache_status [out,g:] string with current information on cache status. .fi .na .B _cached_images [out,g:] the number of images currently cached. .fi .na .B _caption_over_image [in,g:] if set not to 0, will display a custom comment string specified according to the value of_caption_over_image_fmt; if larger than 1, with black background; if 3, image will be drawn possibly below. It will take at most half of the screen. .fi .na .B _caption_over_image_fmt [in,g:] custom info format string, displayed in a caption over the image; if unset: i:_comment; otherwise a custom format string specified just as _info_fmt_str. .fi .na .B _command_expansion [in,g:] if 1, will enable autocompletion (on execution) of alias and command strings. .fi .na .B _comment [i:,out] the image comment, extracted from the image file (if any). .fi .na .B _console_buffer_free [out,g:] amount of unused memory in the output console buffer. .fi .na .B _console_buffer_total [out,g:] amount of memory allocated for the output console buffer. .fi .na .B _console_buffer_used [out,g:] amount of used memory in the output console buffer. .fi .na .B _console_key [in,g:] the key binding (an integer variable) for spawning the command line; will have precedence over any other binding. .fi .na .B _console_lines [out,g:] the number of buffered output console text lines. .fi .na .B _console_offset [in,out,g:] position of the text beginning in the output console, expressed in lines. .fi .na .B _debug_commands [in,g:] debugging option string for printing out . if containing 'a', print out autocmd info; if containing 'c', print out each command; if containing 'k', print out each pressed key; if containing 'j', print interpreter internal steps; if containing 'B', clear screen and print background loading files; if containing 'C', print cache activity. .fi .na .B _device_string [out,g:] the current display device string. .fi .na .B _display_as_binary [in,g:] will force loading of the specified files as pixelmaps (no image decoding will be performed); if 1, using one bit per pixel; if 24, using 24 bits per pixel; otherwise will load and decode the files as usual. .fi .na .B _display_as_rendered_text [in,g:] will force loading of the specified files as text files (no image decoding will be performed); if 1; otherwise will load and decode the files as usual. .fi .na .B _display_busy [in,g:] if 1, will display a message on the status bar when processing. .fi .na .B _display_console [in,g:] if 1, will display the output console. .fi .na .B _display_status [in,g:] if 1, will display the status bar. .fi .na .B _display_status_bar [in,g:] if 1, will display the status bar. .fi .na .B _display_status_fmt [in,g:] custom info format string, displayed in the lower left corner of the status bar; if unset: full pathname; otherwise a custom format string specified just as _info_fmt_str. .fi .na .B _do_sanity_check [in,experimental,g:] if 1, will execute a sanity check on startup. .fi .na .B _downscale_huge_at_load [in,g:] if 1, will downscale automatically huge images at load time. .fi .na .B _exiftool_comment [out,g:] comment extracted via the exiftool interface; see _use_exiftool. .fi .na .B _fbfont [out,g:] The current console font file string. If the internal hardcoded font has been used, then its value is "fim://". .fi .na .B _fbfont_as_screen_fraction [in,g:] The rendered text will be scaled at least to this (integer) fraction of the screen. Disable font autoscaling with -1. (Only enabled if configured with --with-font-magnifying-factor=FACTOR, with FACTOR<1). .fi .na .B _fbfont_magnify_factor [in,g:] The rendered text will use a font magnified by this (integer) factor. Maximal value is "16". (Only enabled if configured with --with-font-magnifying-factor=FACTOR, with FACTOR<1). .fi .na .B _fbfont_verbosity [in,g:] if > 0, verbose font loading .fi .na .B _file_load_time [out,i:] time taken to load the file and decode the image, in seconds. .fi .na .B _file_loader [in,i:,g:] if not empty, this string will force a file loader (among the ones listed in the -V switch output); [out] i:_file_loader stores the loader of the current image. .fi .na .B _fileindex [out,g:] the current image numeric index. .fi .na .B _filelistlen [out,g:] current image list length (number of visible images). .fi .na .B _filename [out,i:] the current file name string. .fi .na .B _fim_bpp [out,g:] the bits per pixel count. .fi .na .B _fim_default_config_file_contents [out,g:] the contents of the default (hardcoded) configuration file (executed after the minimal hardcoded config). .fi .na .B _fim_default_grammar_file_contents [out,g:] the contents of the default (hardcoded) grammar file. .fi .na .B _fim_scriptout_file [in,g:] the name of the file to write to when recording sessions. .fi .na .B _fim_version [out,g:] fim version number; may be used for keeping compatibility of fim scripts across evolving versions. .fi .na .B _hsteps [in,g:] the default steps, in pixels, when panning images horizontally (overrides steps). .fi .na .B _ignorecase [in,g:] if 1, will allow for case insensitive regexp-based match in autocommands (autocmd). .fi .na .B _info_fmt_str [in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets; %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set; EXP will be copied verbatim except for contained sequences of the form %:VAR:, which will be expanded to the value of variable i:VAR; this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) will be used only if present. .fi .na .B _inhibit_display [internal,g:] if 1, will inhibit display. .fi .na .B _last_cmd_output [out,experimental,g:] the last command output. .fi .na .B _last_file_loader [out,g:] after each image load, _last_file_loader will be set to the last file loader used. .fi .na .B _last_system_output [out,experimental,g:] the standard output of the last call to the system command. .fi .na .B _lastfileindex [out,g:] the last visited image numeric index. Useful for jumping back and forth easily between two images with 'goto _lastfileindex'. .fi .na .B _lastgotodirection [out,g:] the last file goto direction (either string '+1' or string '-1'). .fi .na .B _load_default_etc_fimrc [in,g:] if 1 at startup, will load the system wide initialization file. .fi .na .B _load_fim_history [in,g:] if 1 on startup, will load the ~/.fim_history file on startup. .fi .na .B _load_hidden_dirs [in,g:] if not 1, when pushing directories/files, those whose name begins with a dot (.) will be skipped. .fi .na .B _loading_in_background [out,g:] 1 if program has been invoked with --background-recursive and still loading in background. .fi .na .B _loop_only_once [internal,g:] if 1 and doing a --slideshow, do it once. .fi .na .B _lwidth [in,g:] if>0, will force the output console text width. .fi .na .B _magnify_factor [in,g:] the image scale multiplier used when magnifying images size. .fi .na .B _max_cached_images [in,g:] the maximum number of images after which evictions will be forced. Setting this to 0 (no limits) is ok provided _max_cached_memory is set meaningfully. .fi .na .B _max_cached_memory [in,g:] the maximum amount of memory (in KiB) at which images will be continued being added to the cache. Setting this to 0 (no limit) will lead to a crash (there is no protection currently). .fi .na .B _max_iterated_commands [g:] the iteration limit for N in "N[commandname]" iterated command invocations. .fi .na .B _min_cached_images [in,g:] the minimum number of images to keep from eviction; if less than four can lead to inefficiencies: e.g. when jumping between two images, each time an erase and a prefetch of neighboring images would trigger. default value is 4. .fi .na .B _no_default_configuration [in,g:] if 0, a default, hardcoded configuration will be executed at startup, after the minimal hardcoded one. .fi .na .B _no_external_loader_programs [in,g:] if 1, no external loading programs will be tried for piping in an unsupported type image file. .fi .na .B _no_rc_file [in,g:] if 1, the ~/.fimrc file will not be loaded at startup. .fi .na .B _open_offset [in,optional,g:,i:] offset (specified in bytes) used when opening a file; [out] i:_open_offset will be assigned to images opened at a nonzero offset. .fi .na .B _open_offset_retry [in,optional,g:] number of adjacent bytes to probe in opening the file. .fi .na .B _orientation [internal,i:] Orthogonal clockwise rotation (orientation) is controlled by: 'i:_orientation', 'g:_orientation' and applied on a per-image basis. In particular, the values of the three variables are summed up and the sum is interpreted as the image orientation. If the sum is 0, no rotation will apply; if it is 1, a single ( 90') rotation will apply; if it is 2, a double (180') rotation will apply; if it is 3, a triple (270') rotation will apply. If the sum is not one of 0,1,2,3, the value of the sum modulo 4 is considered. Therefore, ":i:_orientation=1" and ":i:_orientation=5" are equivalent: they rotate the image one time by 90'. .fi .na .B _pread_cmd [in,g:] a user-specified shell command emitting an image on stdout, in a format readable by the convert utility. If the current filename matches "^[/A-Za-z0-9_.][/A-Za-z0-9_.-]*$\:", it will be substituted to any occurrence of '{}'. .fi .na .B _preferred_rendering_dpi [in,optional,g:] if >0, pdf, ps, djvu rendering will use this value for a default document dpi (instead of a default value). .fi .na .B _preferred_rendering_width [in,optional,g:] if >0, bit based rendering will use this value for a default document width (instead of a default value). .fi .na .B _push_checks [in,experimental,g:] if 1 (default), will check with stat() existence of input files before push'ing them (set this to 0 to speed up loading very long file lists; in these cases a trailing slash (/) will have to be used to tell fim a pathname is a directory). This only works after initialization (thus, after command line files have been push'ed); use --no-stat-push if you wish to set this to 0 at command line files specification. .fi .na .B _push_pushes_dirs [in,g:] if 1, the push command will also accept and push directories (using pushdir). if 2, will also push hidden files/directories, that is, ones whose names begin with a dot (.). .fi .na .B _pushdir_re [in] regular expression to match against when pushing files from a directory or an archive. By default this is "\.(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$\:". .fi .na .B _pwd [out,g:] the current working directory; will be updated at startup and whenever the working directory changes. .fi .na .B _re_search_opts [in,g:] affects regexp-based searches; if an empty string, defaults will apply; if contains 'i' ('I'), case insensitive (sensitive) searches will occur; if contains 'b', will match on basename, if contains 'f' on full pathname. .fi .na .B _reduce_factor [in,g:] the image scale multiplier used when reducing images size. .fi .na .B _retry_loader_probe [in,g:] if 1 and user specified a file loader and this fails, will probe for a different loader. .fi .na .B _rows [in,g:] if >0, will set the number of displayed text lines in the console. .fi .na .B _save_fim_history [in,g:] if 1 on exit, will save the ~/.fim_history file on exit. .fi .na .B _scale_factor_delta [in,g:] value used for incrementing/decrementing the scaling factors. .fi .na .B _scale_factor_multiplier [in,g:] value used for scaling up/down the scaling factors. .fi .na .B _scale_style [in,g:] if non empty, this string will be fed to the scale command; see its documentation for possible values. .fi .na .B _screen_height [out] the screen height. .fi .na .B _screen_width [out,g:] the screen width. .fi .na .B _scroll_skip_page_fraction [int,g:] if >1, fraction of page which will be skipped in when scrolling (e.g. 'scrollforward'); if 1, auto chosen; if <1, disabled. .fi .na .B _seek_magic [optional,g:] will seek a 'magic' signature in the file after opening it, and will try decoding it starting within the range of that signature (use like this: fim -C '_seek_magic=MAGIC_STRING;push filename'). .fi .na .B _status_line [in,g:] if 1, will display the status bar. .fi .na .B _steps [in,g:] the default steps, in pixels, when panning images. .fi .na .B _sys_rc_file [in,g:] string with the global configuration file name. .fi .na .B _use_exiftool [in,g:] if >0 and supported, exiftool will be used to get additional information. if 1, this will be appened to _comment; if 2, will go to _exiftool_comment. .fi .na .B _use_mipmaps [in,g:] if >0, will use mipmaps to speed up downscaling of images (this has a memory overhead equivalent to one image copy); mipmaps will not be cached. If 2, will use every fourth source pixel instead of averaging (good for photos, not for graphs). .fi .na .B _verbose_errors [in,g:] if 1, will display on stdout internal errors, while parsing commands. .fi .na .B _verbose_keys [in,g:] if 1, after each interactive mode key hit, the console will display the hit key raw keycode. .fi .na .B _verbosity [in,experimental,g:] program verbosity. .fi .na .B _vsteps [in,g:] the default steps, in pixels, when panning images vertically (overrides steps). .fi .na .B _want_autocenter [in,g:] if 1, the image will be displayed centered. .fi .na .B _want_exif_orientation [in,g:] if 1, will reorient images using information from EXIF metadata (and stored in in __exif_orientation, __exif_mirrored, __exif_flipped ). .fi .na .B _want_prefetch [in,g:] if 1, will prefetch further files just after display of the first file; if 2 (and configured with --enable-cxx11) will load in the background. .fi .na .B _want_sleep_seconds [in,g:] number of seconds of sleep during slideshow mode. .fi .na .B _want_wm_caption_status [in,g:] this works only if supported by the display device (currently only SDL). if set to a number that is not 0, will show the status (or command) line in the window manager caption; if set to a non-empty string, will interpret it just as a file info format string (see _info_fmt_str); if empty, will show the program version. .fi .na .B _want_wm_mouse_ctrl [in,g:] if at least 9 chars long, enable mouse click/movement behaviour when in SDL mode; the 9 chars will correspond to a 3x3 screen clickable grid and the equivalent command keys; clicking middle or right button will toggle on-screen usage info. .fi .na .B angle [in,out,i:] a floating point number specifying the rotation angle, in degrees. .fi .na .B ascale [in,out,i:] the asymmetric scaling of the current image. .fi .na .B desaturated [out,i:] 1, if the image is desaturated. .fi .na .B flipped [out,i:] 1, if the image is flipped. .fi .na .B fresh [in,out,i:,experimental] 1 if the image was loaded, before all autocommands (autocmd) execution. .fi .na .B height [out,i:] the current image original height. .fi .na .B mirrored [out,i:] 1, if the image is mirrored. .fi .na .B negated [out,i:] 1, if the image is negated. .fi .na .B page [out,experimental,g:] the current page. .fi .na .B pages [out,experimental,i:] the current number of pages of an image. .fi .na .B random [out] a pseudorandom number. .fi .na .B scale [in,i:] the scale of the current image. .fi .na .B sheight [out,i:] the current image scaled height. .fi .na .B swidth [out,i:] the current image scaled width. .fi .na .B width [out,i:] the current image original width. .fi .SH DEFAULT ALIASES REFERENCE Hardcoded aliases are: .fi alias .B "A" "'_autotop=1-_autotop;'" .fi alias .B "magnify" "scale '+'" # magnify the displayed image by the _magnify_factor variable or {args} .fi alias .B "next" "goto '+1'" # go to the next page or picture file .fi alias .B "next_file" "goto '+1f'" # go to the next file in the list .fi alias .B "next_page" "goto '+1p'" # go to the next page in the file .fi alias .B "prev" "goto '-1'" # go to the previous page or picture file .fi alias .B "prev_file" "goto '-1f'" # go to the previous file in the list .fi alias .B "prev_page" "goto '-1p'" # go to the previous page in the file .fi alias .B "reduce" "scale '-'" # reduce the displayed image by _reduce_factor or {args} .fi alias .B "scale_factor_decrease" "scale '+-'" # subtract _scale_factor_delta to the scale factors _reduce_factor and _magnify_factor .fi alias .B "scale_factor_grow" "scale '+*'" # multiply the scale factors _reduce_factor and _magnify_factor by _scale_factor_multiplier .fi alias .B "scale_factor_increase" "scale '++'" # add _scale_factor_delta to the scale factors _reduce_factor and _magnify_factor .fi alias .B "scale_factor_shrink" "scale '+/'" # divide the scale factors _reduce_factor and _magnify_factor by _scale_factor_multiplier .fi .fi They can be redefined with .B alias or deleted with the .B unalias command. .fi Further default aliases are usually loaded at startup -- see the CONFIGURATION FILE EXAMPLE section below. .SH COMMAND LINE USAGE EXAMPLES .nf # jump to the third image: 3; # jump to first image: ^; # jump to last image: $; # magnify the image two times: *2; # scale the image to the 30% of the original: 30%; # scale the image up by 30%: +30%; # scale the image down by 30%: -30%; # jump to the next image whose filename matches the ".*jpg" regular expression: /.*jpg; # executes the "date" system command !"date"; .SH CONFIGURATION FILE EXAMPLE Part of the default configuration comes from the \fB_fim_default_config_file_contents\fP variable, shown here. .nf One can skip its loading by using the \fB_no_default_configuration\fP variable. .nf # $LastChangedDate: 2023-03-09 00:38:06 +0100 (Thu, 09 Mar 2023) $ # Contents of the default 'fimrc' file, hardcoded in the fim executable. # Read the documentation (man fimrc) to discover how to change this default hardcoded file and how to make your own. # Note that usually a ~/.fimrc file is read after these options take effect, so you could reset all of this with ease. # Lines beginning with a pound (#) are ignored by fim (they are treated as comments). # # Internal variables. # Some of these variables influence fim's behaviour (input variables), some are set by fim (output variables). # It is wise the input variables are set at the beginning of the file, so the bottom may issue commands correctly affected by them. if(_cache_control==''){_cache_control='m';} if(_debug_commands==''){_debug_commands='';} if(_command_expansion==''){_command_expansion=1;} if(_display_status==''){_display_status=0;} if(_max_cached_images==''){_max_cached_images=5;} if(_min_cached_images==''){_min_cached_images=4;} if(_max_cached_memory==''){_max_cached_memory=81920;} if(_max_iterated_commands==''){_max_iterated_commands=100;} if(_want_prefetch==''){_want_prefetch=1;} if(_no_external_loader_programs==''){_no_external_loader_programs=0;} if(_scale_style==''){_scale_style='b';} if(_save_fim_history==''){_save_fim_history=1;} if(_load_fim_history==''){_load_fim_history=1;} if(_verbose_keys==''){_verbose_keys=0;} if(_display_busy==''){_display_busy=1;} if(_ignorecase==''){_ignorecase=1;} if(_re_search_opts==''){_re_search_opts='bi';} if(_console_offset==''){_console_offset=0;} if(_console_key==''){_console_key=58;} if(_display_as_binary==''){_display_as_binary=0;} if(_push_checks==''){_push_checks=1;} #if(_want_wm_caption_status==''){_want_wm_caption_status=0;} if(_want_exif_orientation==''){_want_exif_orientation=1;} if(ascale==''){ascale="1.0";} if(_use_mipmaps==''){_use_mipmaps=1;} if(_downscale_huge_at_load==''){_downscale_huge_at_load=1;} if(_scroll_skip_page_fraction==''){_scroll_skip_page_fraction=0;} if(_want_wm_mouse_ctrl==''){_want_wm_mouse_ctrl="'pP+a-=nN";} # # External variables (not used internally). if(allow_round_scroll==''){allow_round_scroll=0;} if(console_scroll_n==''){console_scroll_n=3;} # alias "toggleautoflip" "_autoflip=1-_autoflip" ""; alias "toggleautonegate" "_autonegate=1-_autonegate" ""; alias "toggleflip" "i:flipped=1-i:flipped" "toggles flipped property on the current image"; alias "flip" "toggleflip;redisplay" "flip the current image along the horizontal axis"; alias "fliponce" "flip;toggleflip" "flip, but just for one display"; alias "toggleautomirror" "_automirror=1-_automirror" ""; alias "togglemirror" "i:mirrored=1-i:mirrored" "toggles mirrored property on the current image"; alias "mirror" "togglemirror;redisplay" "mirror the image along the vertical axis" ""; alias "mirroronce" "mirror;togglemirror" "mirror, but just for one display"; alias 'toggleLimitMarked' '__pre_limit_fileindex=_fileindex;_limit_mode=1-_limit_mode; if(_limit_mode==1){limit "!";} else { limit; } if(_filelistlen<1){_limit_mode=0;limit;goto __pre_limit_fileindex;} i:fresh=1;redisplay; ' "toggle between limiting file list to the marked files and the full list"; alias "unlimit" "limit" "calling limit with no arguments restores the original list"; # Warning : binding to C-s, C-z and C-c won't make effect, as these # codes are get caught by the console driver and will have no effect in fim. # Moreover, C-z will crash fim and C-c will terminate it. # Some other combinations (e.g.:C-l) may have similar problems in your console. bind 'f' "flip"; bind 'F' "fliponce"; bind 'm' "mirror"; bind 'M' "mirroronce"; bind 'q' "quit"; bind 'Esc' "quit"; #bind 'n' "next_file"; #bind 'n' "next"; bind 'C-h' "help"; #bind '?' "help"; # assigned to back-search #bind '/' "help"; # assigned to forward-search bind '=' "scale '100%'"; #bind 'p' "prev_file"; bind 'Del' "list 'remove';reload"; #bind 's' "list 'sort'"; bind ' ' "scroll 'forward'"; bind 'S' "toggleDisplayStatus"; bind 'I' "toggleautonegate"; bind 'i' "color 'negate';redisplay"; bind 'g' "color 'desaturate';redisplay"; bind '[' 'font_reduce;redisplay'; bind ']' 'font_magnify;redisplay'; bind '|' 'toggle_font_auto_scale;redisplay'; bind '{' 'font "prev";redisplay'; bind '}' 'font "next";redisplay'; bind 'G' "toggleDesaturate"; bind 'r' "rotate90"; bind 'R' "rotate270"; bind '+' "magnify"; bind 'a' "scale 'a'"; bind 'H' "scale 'H'"; bind 'Tab' "toggleVerbosity"; bind 'Menu' "toggleVerbosity"; bind 'v' "toggleDisplayStatus"; bind 'A' "A"; bind 'C-m' "list 'mark'"; bind 'u' "list 'unmark'"; bind 'Enter' "list 'mark';goto _lastgotodirection"; bind '-' "reduce"; bind "Up" "pan_up"; bind 'k' "pan_up"; bind "Right" "pan_right"; bind 'l' "pan_right"; bind "Down" "pan_down"; bind 'j' "pan_down"; bind "Left" "pan_left"; bind 'h' "pan_left"; bind 't' "align 'top'"; bind 'C-g' "system 'fbgrab' 'fim_'._device_string.'.png'"; # grab a screenshot #bind 'C-r' "recording 'start'"; bind 'C-r' "reload ''"; bind 'Q' "recording 'stop'"; bind 'D' "recording 'dump'"; bind 'E' "recording 'execute'"; bind 'C-e' "recording 'execute'"; bind 'C-x' "recording 'execute'"; bind '.' "recording 'repeat_last'"; bind '`' "toggleLimitMarked"; alias "toggleVerbosity" "_display_console=1-_display_console;i:fresh=1;redisplay" ""; alias "toggleKeyVerbosity" "_verbose_keys=1-_verbose_keys;redisplay" ""; alias "toggleDesaturate" "_autodesaturate=1-_autodesaturate;redisplay" ""; alias "idempotent_cmd" "goto ''"; # # Autocommands examples: #autocmd "PostInteractiveCommand" "fim.png" "echo '\\nmatched an interactive command on fim.png\\n'"; #autocmd "PostDisplay" ".*png" "echo 'this is a png file'"; #autocmd "PostDisplay" ".*jpg" "echo 'this is a jpg file'"; #autocmd "PostDisplay" "" "echo '\\nthis is a file\\n'"; #autocmd "PostGoto" "" "set_interactive_mode"; autocmd "PostGoto" "" "reload"; autocmd "PostWindow" "" "i:fresh=1;redisplay;"; autocmd "PreRedisplay" "" "i:_will_display=1"; autocmd "PreRedisplay" "" "if(_scale_style!='' && i:fresh){i:fresh=0;scale _scale_style ;i:fresh=0;}"; autocmd "PostRedisplay" "" "i:_will_display=0"; # Display device specific config alias "aalib_fix_do" "{if(aascale==''){ascale='2.0';}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+aalib?expect binding problems!'}}" "See aalib_fix."; alias "aalib_fix" "if(_device_string=='aa'){aalib_fix_do;scale 'a';}" "When using the aalib (ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'aascale' variable for an accurate scaling."; alias "cacalib_fix_do" "{if(cacascale==''){ascale='1.18';}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+cacalib?expect binding problems!'}}" "See cacalib_fix."; alias "cacalib_fix" "getenv 'DISPLAY';if(_device_string=='caca' && ENV_DISPLAY==''){cacalib_fix_do;scale 'a';}" "When using the libcaca (Coloured ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'cacascale' variable for an accurate scaling."; autocmd "PostReload" "" "aalib_fix"; autocmd "PostLoad" "" "aalib_fix"; autocmd "PostReload" "" "cacalib_fix"; autocmd "PostLoad" "" "cacalib_fix"; alias "refresh" "desc 'reload';redisplay;" "reloads and displays image description"; bind "F5" "refresh"; bind "F11" "if(_device_string=='sdl' && !_fullscreen){_old_sw=_screen_width;_old_sh=_screen_height;display 'reinit' 'mW0:0';_fullscreen=1;}else if(_device_string=='sdl' && _old_sw*_old_sh*_fullscreen){display 'reinit' 'rwm'._old_sw.':'._old_sh;_fullscreen=0;}" "Toggles full screen. Will show mouse cursor in full screen."; autocmd "PostReload" "" "i:fresh=1" ; autocmd "PostScale" "" "if(0==i:_will_display){i:fresh=1;display;}" ; autocmd "PostPan" "" "{i:fresh=1;display;}" ; autocmd "PostReload" "" "if(i:fresh){redisplay;}"; autocmd "PostInteractiveCommand" "" "if(i:fresh){display;i:fresh=0;}"; autocmd "PostInteractiveCommand" "" "if(_want_prefetch>0){prefetch;}"; autocmd "PostInteractiveCommand" "" "if(_display_console==0 && i:fresh){redisplay;i:fresh=0;}"; autocmd "PostInteractiveCommand" "" "idempotent_cmd"; # Bug workaround: without it console scroll is broken. alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep '1';}" "goes forward 10 images"; alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep '1';}" "goes backward 10 images"; bind 'N' 'next10'; bind 'P' 'prev10'; bind 'C-n' "goto '+//'"; bind 'C-p' "goto '-//'"; bind 'C-b' "goto '-//'"; # Warning: many configurations cannot detect C-b. bind 'W' "display 'resize'" "if supported, resizes the window to match the current image pixels size"; #bind 'C-w' "scale '100%';display 'resize'" "if supported, scales the image to 100% and resizes the window to match its size (if fits)"; bind 'C-w' "if(_scale_style!='w'){_scale_style='w';scale 'w';}else{_scale_style='';scale '100%';}" "scale to width"; alias "endless_slideshow" "while(1){display;sleep '1';next;}" "performs an automated slideshow, endlessly"; alias "bookview" "while(1){display;sleep '2';scroll 'down';}" ""; alias "comicview" "while(1){display;sleep '1';scroll 'down';}" ""; alias "read" "while(1){display;sleep '1';scroll 'forward';}" ""; alias "slowread" "while(1){display;sleep '2';scroll 'forward';}" ""; alias "fastread" "while(1){display;scroll 'forward';}" "proceeds like in a book bug very fast"; alias "pornview" "echo 'press any key repeatedly to terminate' ;endless_slideshow" "enters an endless slideshow"; autocmd "PreExecutionCycle" "/fbps-" "_display_busy=0;_display_status=0" ; autocmd "PreExecutionCycle" "" "i:fresh=1;reload"; autocmd "PreExecutionCycle" "/fbps-.*ps001.png" "i:fresh=1;redisplay"; ## Example in imposing a file loader to an extension: #autocmd "PreReload" ".*mtx.gz" "_file_loader='MatrixMarket'"; #autocmd "PostReload" ".*mtx.gz" "_file_loader=''"; bind '*' "_display_console=0;toggleVerbosity;echo i:*"; bind 'w' "scale 'w'"; bind '<' "rotate10_ccw;display"; bind '>' "rotate10;display"; bind '_' "_scale_style='';scale '100%'"; bind ',' "_display_console=1;echo _last_system_output"; bind 'C-a' "if(_scale_style!='a'){_scale_style='a';scale 'a';}else{_scale_style='';scale '100%';}" "scale to height"; # alias "pan_nw" "pan 'nw'" "pans the image to the upper left"; alias "pan_ne" "pan 'ne'" "pans the image to the upper right"; alias "pan_se" "pan 'se'" "pans the image to the lower left"; alias "pan_sw" "pan 'sw'" "pans the image to the lower right"; alias "pan_down" "if(_display_console==0){pan 'down';}else{scd;}" "pans the image down / scrolls console down"; alias "pan_up" "if(_display_console==0){pan 'up' ;}else{scu;}" "pans the image up / scrolls console up"; alias "pan_left" "pan 'left'" "pans the image left"; alias "pan_right" "pan 'right'" "pans the image right"; alias "diagonal_nw" "pan_nw" "pans the image to the upper left"; alias "diagonal_ne" "pan_ne" "pans the image to the upper right"; alias "diagonal_se" "pan_se" "pans the image to the lower left"; alias "diagonal_sw" "pan_sw" "pans the image to the lower right"; bind 'd' "diagonal_nw"; bind 'D' "diagonal_se"; bind 'x' "diagonal_ne"; bind 'X' "diagonal_sw"; alias "toggleDisplayStatus" "_display_status=1-_display_status;redisplay" ""; alias "toggleDisplayBusy" "_display_busy=1-_display_busy" ""; alias "sort" "list 'sort'" "sorts the files list ordered"; bind 'o' "sort"; bind 'b' "prev"; bind 'B' "toggleDisplayBusy"; alias "random_slideshow" "while(1){goto random;}" "performs a shuffled slideshow"; alias "rotate90_ccw" "i:_orientation=i:_orientation+3;i:fresh=1;i:fresh=1;redisplay" "rotate 90 degrees counter clockwise"; alias "rotate90_cw" "i:_orientation=i:_orientation+1;i:fresh=1;i:fresh=1;redisplay" "rotate 90 degrees clockwise"; alias "rotate180" "i:_orientation=i:_orientation+2;i:fresh=1;i:fresh=1;redisplay" "rotate 180 degrees"; alias "rotate90" "rotate90_cw;display" "rotate 90 degrees clockwise"; alias "rotate270" "rotate90_ccw;display" "rotate 90 degrees counter clockwise"; alias "rotate10" "rotate '10';display" "rotate 10 degrees counter clockwise"; alias "rotate10_ccw" "rotate -10 ;display" "rotate 10 degrees clockwise"; bind 'K' 'if(_display_console==0){echo i:_filename.": ".i:_comment;toggleVerbosity}else{toggleVerbosity;}'; bind 'C-k' 'crop' # still experimental alias 'cache' 'echo _cache_status' "displays cached images status"; bind 'c' 'align "center"'; alias 'widen' 'i:ascale=i:ascale*"1.1";*1.0' "widen the current image"; alias 'narrow' 'i:ascale=i:ascale/"1.1";*1.0' "narrow the current image"; bind 'y' "widen" "widen horizontally the image"; bind 'Y' "narrow" "shrink horizontally the image"; alias 'console_scroll_up' 'if(_console_offset<_console_lines+console_scroll_n-_rows){_console_offset=_console_offset+console_scroll_n;}' "scrolls up the virtual console"; alias 'console_scroll_down' 'if(allow_round_scroll || (_console_offset>=console_scroll_n)){_console_offset=_console_offset-console_scroll_n;}' "scrolls down the virtual console"; alias 'console_scroll_reset' '{_console_offset=0;}'; alias 'scu' 'console_scroll_up' ""; alias 'scd' 'console_scroll_down' ""; alias 'scz' 'console_scroll_reset' ""; alias 'center' 'align "center"'; alias 'left' 'align "left"'; alias 'right' 'align "right"'; alias 'top' 'align "top"'; alias 'bottom' 'align "bottom"'; alias "font_magnify_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction-1;}else{_fbfont_as_screen_fraction=_screen_width/100+_screen_height/100;}" ""; alias "font_magnify_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor+1" ""; alias "font_reduce_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction+1;}" ""; alias "font_reduce_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor-1" ""; alias "toggle_font_auto_scale" "if(_fbfont_as_screen_fraction<0){_fbfont_as_screen_fraction=0;echo 'Auto font scaling on.';}else{_fbfont_as_screen_fraction=-1;echo 'Auto font scaling off.';}" "toggles between manual and auto font scaling control"; alias 'next_file_dir_same' "goto '+/s';" "go to next file in same dir"; alias 'next_file_dir_other' "goto '+/S';" "go to next file in other dir"; alias 'next_file_dir_up' "goto '+/u';" "go to next file up the dir hierarchy"; alias 'next_file_dir_down' "goto '+/d';" "go to next file down the dir hierarchy"; alias 'next_file_same_basename' "goto '+/b';" "go to next file with same basename"; alias 'prev_file_dir_same' "goto '-/s';" "go to prev file in same dir"; alias 'prev_file_dir_other' "goto '-/S';" "go to prev file in other dir"; alias 'prev_file_dir_up' "goto '-/u';" "go to prev file up the dir hierarchy"; alias 'prev_file_dir_down' "goto '-/d';" "go to prev file down the dir hierarchy"; alias 'prev_file_same_basename' "goto '-/b';" "go to prev file with same basename"; #alias "font_magnify" "if(_fbfont_as_screen_fraction<0) {font_magnify_manual;}else{font_magnify_auto;}" "increase font size (either relative or absolute)"; #alias "font_reduce" "if(_fbfont_as_screen_fraction<0) {font_reduce_manual;} else{font_reduce_auto;}" "increase font size (either relative or absolute)"; alias "font_magnify" "_fbfont_as_screen_fraction=-1;font_magnify_manual" "increase absolute font size and set manual font control"; alias "font_reduce" "_fbfont_as_screen_fraction=-1;font_reduce_manual" "decrease absolute font size and set manual font control"; bind "PageUp" "if(_display_console==0){prev;}else{scu;}"; bind "PageDown" "if(_display_console==0){next;}else{scd;}"; bind "Home" "0;"; bind "End" "$;"; bind "^" "0;"; bind "$" "$;"; #bind "Backspace" "prev"; # console code for C-h and Backspace is the same :-) bind "'" "goto _lastfileindex"; bind '"' "scale 'shadow';i:fresh=1;redisplay;"; bind '(' "goto '^p'"; bind ')' "goto '$p'"; bind 'Z' "sleep 1"; _display_status=1; # lower status line _want_wm_caption_status="fim:%N@%p%%%L[%i/%l]"; _info_fmt_str="%p%% %wx%h%L %i/%l%P %F %T %c"; # lower right line part #_display_status_fmt="%N:%k"; # _display_status_fmt="%N%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?%?EXIF_ExposureTime?[%:EXIF_ExposureTime:]?%?EXIF_FNumber?[%:EXIF_FNumber:]?%?EXIF_ApertureValue?[%:EXIF_ApertureValue:]?%?EXIF_ISOSpeedRatings?[ISO%:EXIF_ISOSpeedRatings:]?:%k"; # lower left line part #_fbfont_as_screen_fraction=-1; # disable auto font scaling echo "WELCOME: to switch to the command line interface press ':'"; # More examples: #alias "plisten" 'popen "nc -l -p 9999 "' "executes fim commands coming from port 9999 on this computer"; #alias "wlisten" "while(1){sleep;plisten;}" "listen to a pipe, endlessly"; #alias "musicplay" "system 'mpc' 'play'" ""; #alias "musicpause" "system 'mpc' 'pause'" ""; #alias "rdjpgcom" 'system "rdjpgcom" i:_filename'; # offsetscan usage : need a mechanism for popping all images before. #alias "offsetscan" "while(i:width<1){list 'push' 'blob.jpg';stdout _open_offset ;_open_offset=_open_offset+1;reload;}"; #alias "webcam" "pread 'vgrabbj -d /dev/video0'"; #alias "webcam_cycle" "while(1){webcam;reload;sleep 1;}"; # This is a FIM initialization file. # Without it FIM cannot work like it should. # Feel free to modify it, but with caution! .SH NOTES This manual page could be improved. Certain side effects of commands are not documented. Neither a formal description of the various commands. Interaction of commands and variables is also not completely documented. .SH BUGS The .B fim language shall be more liberal with quoting. .SH SEE ALSO \fR\fIfim\fR(1), \fR\fIfimgs\fR(1), \fR\fIregex\fR(1). .SH AUTHOR Michele Martone .SH COPYRIGHT See copyright notice in \fR\fIfim\fR(1). fim-0.6-rc2/doc/Makefile.am0000644000175000017500000000337314454347341012357 00000000000000# $LastChangedDate: 2023-04-05 02:04:35 +0200 (Wed, 05 Apr 2023) $ # HTMLDOCS= if WITH_PERL HTMLDOCS+=FIM.html endif if WITH_MAN2HTML if WITH_PERL HTMLDOCS+=fim.man.html fimgs.man.html fimrc.man.html endif endif CLEANFILES= doctags$(EXEEXT) *.o tags $(HTMLDOCS) EXTRA_DIST = FIM.TXT fim.man doctags.c fim-stylesheet.css ./vim2html.pl fimgs.man fimrc.man fim.man.in fimgs.man.in fimrc.man.in #MAN2HTML=man2html MAN2HTML=$(MAN) --html=cat MAN2HTMLS = sed 's/−/-/g' MAN2TXT=$(MAN) --ascii # when having e.g. a minimal groff installation man1_MANS = fim.man fimgs.man man5_MANS = fimrc.man # html stuff is installed in the documentation directories, too htmldir = $(docdir) dist_html_DATA = $(HTMLDOCS) dist_doc_DATA = FIM.TXT .PHONY: all all: $(HTMLDOCS) $(EXTRA_DIST) FIM.html fim-stylesheet.css: doctags$(EXEEXT) FIM.TXT ./doctags$(EXEEXT) $(srcdir)/FIM.TXT > tags ; $(srcdir)/vim2html.pl tags $(srcdir)/FIM.TXT fim.man: make doc/fim.man -C $(abs_top_builddir)/ fim.man.html: fim.man $(MAN2HTML) ./$< | $(MAN2HTMLS) > $@ if test ! -s $@ ; then $(MAN2TXT) ./$< > $<.txt && $(srcdir)/vim2html.pl tags $<.txt && mv $<.txt.html $@ ; fi fimrc.man: make doc/fimrc.man -C $(abs_top_builddir)/ fimrc.man.html: fimrc.man $(MAN2HTML) ./$< | $(MAN2HTMLS) > $@ if test ! -s $@ ; then $(MAN2TXT) ./$< > $<.txt && $(srcdir)/vim2html.pl tags $<.txt && mv $<.txt.html $@ ; fi fimgs.man: make doc/fimgs.man -C $(abs_top_builddir)/ fimgs.man.html: fimgs.man $(MAN2HTML) ./$< | $(MAN2HTMLS) > $@ if test ! -s $@ ; then $(MAN2TXT) ./$< > $<.txt && $(srcdir)/vim2html.pl tags $<.txt && mv $<.txt.html $@ ; fi doctags$(EXEEXT): doctags.c $(CC) -o $@ $< #clean: # $(RM) -f doctags.o doctags$(EXEEXT) FIM.html tags fim-stylesheet.css fim.man.html fimgs.man.html fim-0.6-rc2/doc/fimgs.man0000644000175000017500000000442314454353765012131 00000000000000.TH fimgs 1 "(c) 2007\-2023 Michele Martone" .SH NAME fimgs \- poor man's [http://]PostScript/pdf/dvi/cbr/rar/cbz/zip viewer based on fim .SH SYNOPSIS .B fimgs [ {fimgs\-options} ] file [\-\- [{fim\-options}]] .SH DESCRIPTION .B fimgs is a wrapper script which takes a PostScript or pdf or .cbr or .rar or .cbz or .zip or .dvi or any of the above prefixed with http:// or https:// or ssh: as input, renders the pages using ghostscript into a temporary directory and finally calls \fB fim\fP to display them. In case of compressed archives (in ZIP or RAR formats), the images are decompressed into a directory and displayed using \fB fim\fP. In this case, only images contained in the archive will be displayed (no nested archives or pdf's or ps's or dvi's). The temporary directory name will be of the form $TMPDIR/fbps\-$$. If the $TMPDIR environment variable is unset, /dev/shm and /var/tmp will be checked for existence and permissions. The $$ above is the script process ID. The script deletes the temporary directory when \fB fim\fP terminates. In order to uncompress RAR archives, fimgs will use 'unrar\-nonfree' or 'rar' or 'unrar\-free'. In order to uncompress ZIP archives, fimgs will use 'zip'. In order to uncompress BZ2 files, 'bunzip2' will be used, if present. In order to uncompress TAR.GZ or TAR.BZ2 or TAR.XZ archives, fimgs will use 'tar'. In order to fetch http:// or https:// prefixed URLS, 'wget' will be used, if present. In order to fetch ssh: prefixed host:path locations, 'scp' will be used. In case of a CBZ, CBR, PDF, PS, or DVI file, will invoke \fB fim\fP with '\-\-autotop \-\-autowidth'. .SH OPTIONS To pass through options to \fB fim\fP, you may specify them after "\-\-". Default options are '\-\-autozoom'. .B \-r {resolution} Specify resolution for the 'gs' \-r option (e.g.: 96x96; default 120x120). .TP .B \-m Dump a man page for fimgs. .TP .B \-p {password} Specify password for the 'gs' \-p (password) option. .TP .B \-h Will display a help message. .\" Additionally you can specify \-l, \-xl or \-xxl to get the pages .\" rendered with 100, 120 or 150 dpi (default is 75). .SH SEE ALSO fim(1), fimrc(1), gs(1), fbi(1), fbgs(1), bash(1) ,zip(1), rar(1), rar\-free(1), unrar\-free(1), tar(1), gzip(1) .SH AUTHOR Michele Martone . fim-0.6-rc2/doc/fim-stylesheet.css0000644000175000017500000000136414503371626013773 00000000000000body { background-color: white; color: black;} :link { color: rgb(0,137,139); } :visited { color: rgb(0,100,100); background-color: white; /* should be inherit */ } :active { color: rgb(0,200,200); background-color: white; /* should be inherit */ } B.vimtag { color : rgb(250,0,250); } h1, h2 { color: rgb(82,80,82); text-align: center; } h3, h4, h5, h6 { color: rgb(82,80,82); } .headline { color: rgb(0,137,139); } .header { color: rgb(164, 32, 246); } .section { color: rgb(164, 32, 246); } .keystroke { color: rgb(106, 89, 205); } .vim { } .example { color: rgb(0, 0, 255); } .option { } .notvi { } .special { color: rgb(106, 89, 205); } .note { color: blue; background-color: yellow; } .sub {} .badlink { color: rgb(0,37,39); } fim-0.6-rc2/aclocal.m40000644000175000017500000015103714503403453011407 00000000000000# generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29) 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]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' 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.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.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-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR fim-0.6-rc2/ChangeLog0000644000175000017500000112702014454347340011324 000000000000002018-01-28 22:33 dezperado * [r1576] README, TODO: general refresh of TODO and README. 2018-01-28 22:32 dezperado * [r1575] Makefile.am: fix to broken tests-all rule in Makefile.am. 2018-01-28 17:14 dezperado * [r1574] doc/fim.man.in, doc/fimrc.man.in, src/fim.h: copyright year set to 2018 2018-01-28 17:13 dezperado * [r1573] src/SDLDevice.cpp: embryonal code for showing mouse/alignment position graphically in sdl 2018-01-28 16:42 dezperado * [r1572] src/SDLDevice.cpp: fix: x and y were swapped in a mouse based scroll check. 2018-01-28 15:00 dezperado * [r1571] NEWS, src/Browser.cpp, src/Browser.h, src/fim.h: Command 'list' 'sort_var' 'var' to sort file list according to values of 'i:var'. 2018-01-28 14:38 dezperado * [r1570] NEWS, src/Browser.cpp, src/fim.h: Command 'list' 'sort_comment' to sort file list according to 'i:_comment' value. 2018-01-28 13:37 dezperado * [r1569] ChangeLog, Makefile.am: using 'svn2cl -i' instead of 'svn2cl' 2018-01-28 13:24 dezperado * [r1568] NEWS, doc/fim.man.in, src/fim.cpp, src/fim.h: Documented expansion of @variables and @# comments in read descriptions. 2018-01-28 12:56 dezperado * [r1567] NEWS, src/Image.h: Lonely '@' in description text will be preserved. 2018-01-28 11:34 dezperado * [r1566] ChangeLog, src/testdir/test19.ok, src/testdir/test20.ok: new switch and fimrc required tests update. 2018-01-28 11:12 dezperado * [r1565] ChangeLog, doc/fim.man.in, doc/fimgs.man.in, doc/fimrc.man.in: man page rebuild and ChangeLog update. 2018-01-28 10:58 dezperado * [r1564] NEWS, src/FontServer.cpp, src/fim.cpp: Added an --verbose-font-load switch to set _fbfont_verbosity=1. 2018-01-28 10:50 dezperado * [r1563] NEWS, src/FontServer.cpp, src/fim.h, src/help.cpp: New variable '_fbfont_verbosity' sets verbose font loading. 2018-01-28 10:26 dezperado * [r1562] src/FontServer.cpp: on the way of making font loading more verbose 2018-01-25 22:59 dezperado * [r1561] NEWS, src/fim.cpp: fix: short options -b, -h, (and in trunk also -R) were not getting optional argument (e.g. -b1). 2018-01-25 10:58 dezperado * [r1560] src/fim.cpp: got rid of spurious '/:' after 'B' in optstring. 2018-01-21 16:19 dezperado * [r1559] NEWS, src/fimrc: Key combination C-r now assigned to "reload ''". 2018-01-21 15:53 dezperado * [r1558] src/Browser.cpp, src/CommandConsole.cpp, src/FramebufferDevice.cpp, src/Image.cpp, src/common.cpp, src/fim.h: Will build and work without stat.h (not passing all tests though). 2018-01-09 23:17 dezperado * [r1557] src/fimgs: fimgs will check for fim presence after processing eventual '-m'. this fixes broken `make'. in branches 0.3 0.4 0.5 trunk. 2018-01-09 22:51 dezperado * [r1556] doc/Makefile.am: subdir doc/ was missing a goal producing the man pages at `make' 2018-01-09 21:49 dezperado * [r1555] NEWS, src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffGif.cpp, src/FbiStuffJasPer.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffLoader.h, src/FbiStuffMagick.cpp, src/FbiStuffMatrixMarket.cpp, src/FbiStuffPcx.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffPs.cpp, src/FbiStuffText.cpp, src/FbiStuffTiff.cpp, src/FbiStuffUFRaw.cpp, src/FbiStuffXyz.cpp: fix: symbol from fbi sources clashed with gcc-6 onwards, breaking compilation. update for 0.3, 0.4, 0.5, trunk. 2018-01-09 20:51 dezperado * [r1554] src/Browser.cpp: C++11 builds will use std::shuffle/std::mt19937 instead of std::random_shuffle. 2018-01-07 01:24 dezperado * [r1553] src/Browser.cpp, src/fim.h: goto on changed variable value, for any variable in a group. shall update man page. 2017-12-18 21:41 dezperado * [r1552] src/testdir/test19.ok, src/testdir/test20.ok: whoops: forgot to update testdir after recent changes in fimrc. 2017-12-18 20:44 dezperado * [r1551] Makefile.am: fix: change r1529 used grepping on 'jpg' instead of on 'jpeg' in `make tests'. 2017-12-17 12:37 dezperado * [r1550] NEWS: in 0.5 as well, failed enlarge shall not lead to inconsistent image state; message in case. 2017-12-17 12:25 dezperado * [r1549] NEWS, src/FbiStuff.cpp: a message will be emitted when failing allocation at enlarge. 2017-12-17 12:23 dezperado * [r1548] src/fim_stream.cpp, src/fim_stream.h: unsigned int overload for fim_stream (fim::cout), and preprocessor displacement. 2017-12-17 01:33 dezperado * [r1547] src/fim_wrappers.h: zero'ing the pointer after free() wrapper: this makes execution of FbiStuff::scale_image to be more robust. 2017-12-17 01:07 dezperado * [r1546] src/FbiStuff.cpp: if using --verbose-load, FbiStuff::scale_image will display a failure mesage to stdout in case of failed alloc. 2017-12-10 23:13 dezperado * [r1545] Makefile.am, doc/Makefile.am, doc/fim.man, doc/fim.man.in, doc/fimgs.man, doc/fimgs.man.in, doc/fimrc.man, doc/fimrc.man.in, src/fim.h: not keeping track of man pages, but only their *.in counterparts. 2017-12-10 21:43 dezperado * [r1544] NEWS, src/fimrc: key combination C-w assigned to setting auto-scaling to width. 2017-12-10 21:23 dezperado * [r1543] NEWS, src/SDLDevice.cpp, src/fim.h: smoother scroll of large images. 2017-12-05 23:23 dezperado * [r1542] src/SDLDevice.cpp, src/Viewport.cpp, src/Viewport.h: templated the internals of Viewport::pan_to 2017-11-26 10:42 dezperado * [r1541] NEWS, doc/fim.man, doc/fimrc.man, src/fim.cpp: documented the ssh variable probing in man page. 2017-11-26 10:40 dezperado * [r1540] NEWS, src/fim.cpp, src/fim.h: if SSH_TTY set and no output device specified, will give precedence to aalib. 2017-11-26 10:07 dezperado * [r1539] NEWS, src/FbiStuffText.cpp: bugfix: in --as-text will avoid repeated reload of file. (in 0.4, 0.5, trunk) 2017-11-26 08:36 dezperado * [r1538] doc/fim.man, src/CommandConsole-init.cpp, src/FbiStuffText.cpp, src/fim.cpp, src/fim.h: documented the replacement for non-printable characters. 2017-11-26 08:19 dezperado * [r1537] doc/fim.man, src/fim.cpp: Mention of _preferred_rendering_width in --as-text documentation. 2017-11-18 09:53 dezperado * [r1536] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/fim.h: added a 'list markall' command. 2017-10-25 22:24 dezperado * [r1535] src/fim.cpp: fix: duplicate removal was off when random shuffle on. now is also on. 2017-10-25 22:20 dezperado * [r1534] src/fim.cpp: fix: -u option was broken, in that duplicate check would later sort over again. 2017-10-15 19:36 dezperado * [r1533] src/FbiStuff.cpp: Comments cleanup and one duplicate printout removal in FbiStuff.cpp. 2017-10-15 19:11 dezperado * [r1532] src/FbiStuff.cpp, src/fim.h: Changed the FIM_MSG_WAIT_PIPING macro to accept a parameter. 2017-10-15 10:28 dezperado * [r1531] doc/fimrc.man, src/CommandConsole-help.cpp: documentation fix for QUOTED_FLOAT / UNQUOTED_FLOAT. 2017-10-15 10:18 dezperado * [r1530] src/testdir/test12.in, src/testdir/test12.ok, src/testdir/test14.in, src/testdir/test22.in, src/testdir/test22.ok, src/testdir/test3.in, src/testdir/test3.ok, src/testdir/test7.in, src/testdir/test7.ok, src/testdir/test8.in, src/testdir/test8.ok: Polished a bit a few tests. 2017-10-15 10:17 dezperado * [r1529] Makefile.am: jpeg support is now a requisite of `make tests' (now will fail before failing in testdir). 2017-10-13 21:12 dezperado * [r1528] scripts/tests/font.sh: Added the -b switch to the font tests. 2017-10-13 21:09 dezperado * [r1527] Makefile.am, src/testdir/Makefile, src/testdir/test20.ok: Using the -X option in the tests. 2017-10-13 20:35 dezperado * [r1526] NEWS, src/FontServer.cpp: Hardcoded font (if configured in) will serve as fallback font. 2017-10-10 22:55 dezperado * [r1525] src/fim.h: FIM_WANT_PIC_CMTS_RELOAD shall depend on C++11 being on. 2017-10-10 22:47 dezperado * [r1524] NEWS, doc/fim.man, src/fim.cpp, src/fim.h: Added an --no-pipe-load/-X switch, to work as _no_external_loader_programs=1; 2017-10-10 22:11 dezperado * [r1523] Makefile.am, README: `make tests' goal now requires png and gif support explicitly. 2017-10-10 22:06 dezperado * [r1522] src/FbiStuff.cpp: Fix in 0.4, 0.5, trunk: 'convert' conversion message had duplicated 'through'. 2017-10-10 21:42 dezperado * [r1521] configure.ac: Certain sdl-config (e.g. opensuse for libsdl-1.2.15) ship without --static-libs switch. The configure will detect an error value and retry with --libs. 2017-10-07 17:24 dezperado * [r1520] src/Browser.cpp, src/Browser.h, src/FramebufferDevice.h, src/grammar.h: Revisions r1513 and r1518 had broken the pre-C++11 version --- fix. 2017-10-07 17:01 dezperado * [r1519] src/FramebufferDevice.cpp, src/FramebufferDevice.h: Got rid of obsolete commented-out FramebufferDevice::status_screen(). 2017-10-07 16:58 dezperado * [r1518] src/FramebufferDevice.cpp, src/FramebufferDevice.h: In Framebuffer: fb_mem_offset_ is now ptrdiff_t; deleted a few C casts ; comments cleanup. 2017-10-07 16:44 dezperado * [r1517] src/FramebufferDevice.cpp: Deleted old commented unfinished code for FIM_WANTS_DOUBLE_BUFFERING. 2017-10-07 16:41 dezperado * [r1516] src/FramebufferDevice.cpp, src/FramebufferDevice.h: FramebufferDevice::fb_setmode will not return error when not necessary. 2017-10-07 16:22 dezperado * [r1515] src/FramebufferDevice.cpp: Fix of long standing harmless silly defect in FramebufferDevice::fb_memset. Comments. 2017-10-07 15:51 dezperado * [r1514] src/DebugConsole.cpp, src/DisplayDevice.cpp, src/FbiStuffBmp.cpp, src/FramebufferDevice.cpp: replaced most of calls to fim_memset with calls to std::fill_n. 2017-10-07 15:14 dezperado * [r1513] src/Browser.cpp, src/Browser.h: Modernizing flist_t further. 2017-10-07 13:34 dezperado * [r1512] src/testdir/test17.in, src/testdir/test17.ok: Improved testing of "list" command (test 17) . 2017-10-07 13:14 dezperado * [r1511] src/Browser.cpp, src/grammar.h: fix: Browser::_clear_list was not updating _filelistlen. 2017-10-07 12:45 dezperado * [r1510] src/Browser.cpp: fix: 'list "filesnum"' was not returning output. 2017-10-07 11:32 dezperado * [r1509] src/Browser.cpp, src/Browser.h: Most of flist_t is in Browser.cpp now. 2017-10-07 10:56 dezperado * [r1508] src/Browser.cpp, src/Browser.h: will use flist_t::size_type. 2017-10-07 10:14 dezperado * [r1507] AUTHORS, NEWS, src/Browser.cpp, src/Namespace.h: Adjusted an ambiguous use of std::string. Comments. 2017-10-01 19:40 dezperado * [r1506] NEWS, src/Image.h: expansion of @# comments in read descriptions. 2017-09-30 23:48 dezperado * [r1505] src/Browser.cpp: Number of min different values for a group displayed is customatizable (numeric arg to 'list "vars"'). 2017-09-30 23:07 dezperado * [r1504] NEWS, src/Browser.cpp: fix to "list 'vars'": to-string conversion from size_t did not give what required. 2017-09-30 22:56 dezperado * [r1503] NEWS, src/Browser.cpp, src/Image.h, src/Namespace.h, src/common.cpp, src/common.h: description variables beginning with '_' will not go into i:. 2017-09-30 21:38 dezperado * [r1502] NEWS, src/Browser.cpp, src/Namespace.h: list 'vars' will list differing description variables. 2017-09-30 19:27 dezperado * [r1501] NEWS, src/SDLDevice.cpp: The 'menu key' in SDL mode will show a temporary mouse click actions menu. 2017-09-30 15:06 dezperado * [r1500] doc/fim.man, doc/fimrc.man, src/fim.h: My response to fim bug report #109387 ("Consider clarifying the ! (run system command) in documentation"). 2017-09-30 10:48 dezperado * [r1499] NEWS, src/Image.h, src/fim.h: Expansion of @variables in read descriptions. 2017-09-10 18:31 dezperado * [r1498] src/FbiStuff.cpp, src/fim.h: In C++14 mode, using the [[deprecate]] attribute where appropriate. 2017-09-10 18:11 dezperado * [r1497] src/fim.h: In-class member initializers for ViewportState in C++11 mode. 2017-09-10 18:05 dezperado * [r1496] src/Image.h, src/fim.h: Got rid of a spurious Image constructor. 2017-09-10 16:09 dezperado * [r1495] src/fim.h: Using the [[fallthrough]] in C++17 mode (not C++11 actually...) 2017-09-10 15:40 dezperado * [r1494] src/DummyDisplayDevice.h, src/Viewport.cpp: Bugfix to the failing test introduced in the last commit (with bug introduced just after r1481). 2017-09-10 15:38 dezperado * [r1493] Makefile.am: In a `make tests' test that used to pass until r1481 or so. 2017-09-10 12:53 dezperado * [r1492] src/AADevice.cpp, src/AADevice.h, src/Cache.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/FimWindow.h, src/FontServer.h, src/Image.h, src/fim.cpp, src/fim.h: Deactivated AADevice::format_console() in favour of DisplayDevice::format_console(), now virtual final. More classes declared as final. 2017-09-10 09:13 dezperado * [r1491] NEWS, src/Image.h: A second fix to description file reading: was needlessly skipping a character. 2017-09-10 09:11 dezperado * [r1490] NEWS, src/Image.h: bugfix: description file reading could crash due to wrong check. 2017-09-07 12:44 dezperado * [r1489] src/fim.cpp, src/fim.h: In C++11 mode, using the [[fallthrough]] attribute where appropriate. 2017-09-07 10:26 dezperado * [r1488] src/CommandConsole.cpp, src/fim.cpp, src/fim.h: In C++11 mode, using the [[noreturn]] attribute for non-returning functions. 2017-09-07 09:12 dezperado * [r1487] src/CommandConsole.cpp: When in C++14, using std::this_thread::sleep_for instead of usleep(). 2017-08-19 14:24 dezperado * [r1486] src/CACADevice.cpp: Whoops: r1481 broke build; fix. 2017-08-19 12:28 dezperado * [r1485] NEWS, doc/fimrc.man, src/Viewport.cpp, src/Viewport.h, src/fim.h, src/help.cpp: Caption of _caption_over_image will take at most half of the screen. 2017-08-19 11:52 dezperado * [r1484] NEWS, doc/fimrc.man, src/Viewport.cpp, src/fim.h, src/help.cpp: If _caption_over_image=3, image will be possibly drawn below the caption. 2017-08-19 11:39 dezperado * [r1483] src/Viewport.cpp, src/Viewport.h: Introduced Viewport::pixelable_height() to express the height destined to image only. 2017-08-19 10:18 dezperado * [r1482] src/Viewport.cpp, src/Viewport.h: Viewport::viewport_height() will not substract status line height now. 2017-08-19 09:38 dezperado * [r1481] src/AADevice.cpp, src/AADevice.h, src/CACADevice.cpp, src/CACADevice.h, src/DisplayDevice.h: introduced DisplayDevice::font_height() 2017-08-19 09:08 dezperado * [r1480] NEWS, doc/fimrc.man, src/fimrc: The 'v' and 'S' keys will redraw as well. 2017-08-19 08:34 dezperado * [r1479] src/Viewport.cpp, src/Viewport.h: Mechanisms for rescaling after comment displayed on top (inactive). 2017-08-15 21:22 dezperado * [r1478] NEWS, src/CommandConsole.cpp: Description line can be of any length. 2017-08-13 23:41 dezperado * [r1477] NEWS, src/CommandConsole.cpp, src/fim.h: Description line can be of any length, and individual component substrings length limit is larger now. 2017-08-13 14:14 dezperado * [r1476] src/CommandConsole.cpp: In trunk and 0.5: bugfix: expando mechanism crashed on long comment strings. 2017-07-29 09:04 dezperado * [r1475] src/fim.cpp: To ease reproducible builds (0.5 and trunk): build __DATE__ won't be printed by -V anymore. See r1039 all except this change were implemented, following Alexis Bienvenüe's patch from Debian bug #820932. 2017-07-29 08:39 dezperado * [r1474] NEWS, configure.ac, doc/fim.man, doc/fimrc.man, src/fim.h: New configure option, defaulting to: --enable-paths-in-man: Generate man pages with configure specified paths (e.g. sysconfdir, docdir). 2017-07-24 22:49 dezperado * [r1473] src/Command.cpp, src/Command.h, src/CommandConsole-init.cpp: Making the constructor of Command a member function template, so to write one constructor instead of three. Removed a few useless constructor invocations when instantiating Command in a CommandConsole call. 2017-07-24 22:28 dezperado * [r1472] src/Command.cpp, src/Command.h: Making Command code cleaner by the use of std::function and std::bind (C++11 mode). 2017-07-24 21:45 dezperado * [r1471] src/CACADevice.cpp, src/Command.cpp, src/Command.h, src/Image.cpp: A bit of cleanup in Command. Removed an unused variable in CACADevice. Changed new invocation style in one point. 2017-07-23 22:56 dezperado * [r1470] doc/fimrc.man, src/CommandConsole-help.cpp, src/CommandConsole-init.cpp, src/fim.h, src/fimrc: Documented autocommands and rewrote last man fimrc section. 2017-07-23 21:51 dezperado * [r1469] doc/fimrc.man, src/fim.h: Documented command 'rotate'. 2017-07-23 21:39 dezperado * [r1468] NEWS, src/fim.cpp: fix: -s switch was broken in 0.4, 0.5, trunk. 2017-07-23 21:23 dezperado * [r1467] doc/fim.man, src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole-var.cpp, src/CommandConsole.cpp, src/Image.cpp, src/Image.h, src/Viewport.cpp, src/fim.cpp, src/testdir/test19.ok, src/yacc.ypp: Got rid of useless Image::c_page() and Browser::c_page() and Image::gray_negate(). Comments cleanup. 2017-07-23 12:56 dezperado * [r1466] doc/fimrc.man, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/fim.h: Tidying up documentation of commands further, especially punctuation and quoting. 2017-07-23 11:15 dezperado * [r1465] doc/fim.man, doc/fimrc.man, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/fim.cpp, src/fim.h, src/help.cpp: Documentation improvement fixes: adding newlines to command help strings, introduced preprocessors symbols for a few switches. 2017-07-23 11:11 dezperado * [r1464] src/CommandConsole-help.cpp: CommandConsole::get_commands_reference() will add a ".fi\n" after each command doc newline, so to have a newline in the man page as well. 2017-07-23 11:04 dezperado * [r1463] src/Arg.cpp: fix: Arg would not compile in C++03. 2017-07-23 08:17 dezperado * [r1462] src/Arg.cpp, src/Arg.h, src/fim.h, src/fim_string.cpp, src/fim_string.h, src/help.cpp: Another pass of doc strings cleanup. 2017-07-23 07:51 dezperado * [r1461] doc/fim.man, doc/fimrc.man, src/fim.h, src/help.cpp: Ensuring each variable description sentence ends with a dot. 2017-07-23 07:45 dezperado * [r1460] doc/fimrc.man, src/fim.h, src/help.cpp: Doc typo fix (again in 0.5 and trunk). 2017-07-23 07:38 dezperado * [r1459] doc/fimrc.man, src/CommandConsole-help.cpp: Doc typo fix. 2017-07-22 21:42 dezperado * [r1458] src/Browser.cpp, src/Cache.cpp, src/Cache.h, src/CommandConsole.cpp, src/FimWindow.cpp, src/FimWindow.h, src/Image.h, src/Viewport.cpp, src/Viewport.h: Pruning usage of getImage() further. 2017-07-22 20:38 dezperado * [r1457] src/Browser.cpp, src/Cache.cpp, src/testdir/Makefile, src/testdir/test22.in, src/testdir/test22.ok: In a test for the "reload ''" syntax. 2017-07-22 20:10 dezperado * [r1456] src/Browser.cpp, src/Image.cpp, src/Image.h: fix: 'reload' was not fully effective; now it should. 2017-07-22 19:52 dezperado * [r1455] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/Cache.h, src/Viewport.cpp, src/Viewport.h: Cache::freeCachedImage() has now a flag for asking forced file deletion. 2017-07-22 19:02 dezperado * [r1454] src/Browser.cpp, src/Browser.h, src/FimWindow.cpp, src/FimWindow.h, src/Viewport.cpp, src/Viewport.h: Moved glue code for color manipulation, image rotation, page goto and image scaling from Browser into Viewport. So Browser does no Image* manipulation now. 2017-07-22 18:02 dezperado * [r1453] src/Browser.cpp, src/FimWindow.cpp, src/FimWindow.h, src/Image.cpp, src/Image.h, src/Viewport.cpp, src/Viewport.h: Making further small functions const or preferring invoking const. 2017-07-22 17:04 dezperado * [r1452] src/DebugConsole.h, src/Namespace.h: All data members of MiniConsole are now private, and Namespace does not declare friends anymore. 2017-07-22 16:27 dezperado * [r1451] src/CommandConsole.cpp, src/DisplayDevice.cpp, src/FramebufferDevice.cpp: Moved the original fbi framebuffer console switch redrawing invocation of redisplay() into the main loop. 2017-07-22 15:48 dezperado * [r1450] src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DebugConsole.h: Eliminated friend access rights for CommandConsole in MiniConsole. 2017-07-22 14:12 dezperado * [r1449] src/CommandConsole-var.cpp, src/CommandConsole.h, src/Namespace.cpp, src/Namespace.h, src/Var.cpp, src/Var.h: Made the getVariable() functions return const. Makde Var::find() const. 2017-07-22 13:49 dezperado * [r1448] doc/fim.man, doc/fimrc.man, src/fim.cpp: Doc example fix for branches 0.4 0.5 and trunk for option -c. 2017-07-22 13:18 dezperado * [r1447] NEWS, doc/fim.man, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.cpp: If no semicolon (;) terminating -C argument, one will be appended. 2017-07-22 12:08 dezperado * [r1446] NEWS, doc/fim.man, doc/fimrc.man, src/Cache.cpp, src/fim.h, src/help.cpp: Added option 'C' to _debug_commands, so to have extra verbose cache output. 2017-07-22 11:37 dezperado * [r1445] src/Cache.cpp: Preparing the ground for user-verbosity of Cache via FIM_CACHE_DEBUG. 2017-07-22 11:34 dezperado * [r1444] src/Namespace.cpp, src/Namespace.h: Added Namespace::getGlobalVariable(). 2017-07-22 09:51 dezperado * [r1443] src/Browser.cpp, src/Image.cpp, src/Image.h, src/SDLDevice.cpp, src/Viewport.cpp, src/Viewport.h: Cleanup of Viewport internals and client code. 2017-07-21 22:59 dezperado * [r1442] src/DisplayDevice.cpp, src/DisplayDevice.h, src/Viewport.cpp: Moved Viewport::fs_multiline_puts() into DisplayDevice::fs_multiline_puts(). 2017-07-21 22:50 dezperado * [r1441] src/CommandConsole-init.cpp, src/CommandConsole.h, src/FimWindow.cpp, src/FimWindow.h, src/Namespace.cpp, src/Namespace.h, src/Viewport.cpp, src/Viewport.h: Broken friend access of Viewport into CommandConsole. Among required changes, was adding Namespace::isSetGlobalVar(). 2017-07-21 22:21 dezperado * [r1440] src/testdir/test19.ok, src/testdir/test20.ok: Adjustment of tests 19 and 20 to last commit. 2017-07-21 21:39 dezperado * [r1439] doc/fimrc.man, src/CommandConsole-cmd.cpp, src/DebugConsole.h, src/fimrc: Changed defaults for j and k: now if in console mode will scroll console. 2017-07-21 21:02 dezperado * [r1438] src/CommandConsole.cpp: A fix to CommandConsole::getInfoCustom: 1435 lessed 'i' expando value (current file index) by -1. 2017-07-21 20:52 dezperado * [r1437] src/DebugConsole.cpp: Cleaned up MiniConsole::do_dump a bit. 2017-07-21 14:55 dezperado * [r1436] src/Command.h, src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h: The CommandConsole will keep a vector of Command objects, not anymore pointers to such. Along the way, make some member functions const. 2017-07-21 12:55 dezperado * [r1435] src/Browser.h, src/CommandConsole.cpp: Cleanup of CommandConsole::getInfoCustom(). 2017-07-21 12:32 dezperado * [r1434] src/Namespace.cpp, src/Namespace.h: Cleaned up a bit comments/look of Namespace. 2017-07-21 12:31 dezperado * [r1433] src/CommandConsole.cpp: Cleaned up and recommented a bit CommandConsole::command_generator. 2017-07-21 10:54 dezperado * [r1432] src/FbiStuff.cpp, src/FbiStuff.h, src/FramebufferDevice.cpp, src/Image.cpp: Corrected fbi_img_pixel_count() and added fbi_img_pixel_bytes(). 2017-07-21 10:31 dezperado * [r1431] src/CommandConsole.cpp, src/Image.cpp, src/Image.h: Added six const accessor functions to Image:: so that could remove the friend access specifier introduced in last commit. 2017-07-21 09:46 dezperado * [r1430] src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/Image.cpp, src/Image.h, src/Viewport.cpp: moved Image::getInfoCustom() to CommandConsole::getInfoCustom(). 2017-07-21 08:43 dezperado * [r1429] src/CommandConsole.cpp: CommandConsole::Namespace::rnsp_ now non NULL. 2017-07-20 14:45 dezperado * [r1428] src/CommandConsole.cpp: Restrictung use of std::map<..>::erase(..iterator..) to C++11 mode only. 2017-07-20 14:38 dezperado * [r1427] src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/Image.h, src/Namespace.cpp, src/Var.h, src/testdir/test19.ok: General minor cleanup of CommandConsole. Cleaning up a few old-style casts in several files. Updated the test case 19 to reflect change of last commit (which changed amount of traffic on debug console). 2017-07-20 13:44 dezperado * [r1426] src/CommandConsole.cpp: Return message when binding was wrong (always 'reassigned'). Corrected. 2017-07-20 09:29 dezperado * [r1425] src/Image.h: Wrote a small wrapper in VNamespace so that can avoid a friend declaration. 2017-07-20 09:28 dezperado * [r1424] configure.ac: unmarked the 'seek magic signatures' as unrecommended, in the configure script. 2017-07-20 09:03 dezperado * [r1423] src/AADevice.h, src/Browser.h, src/CACADevice.h, src/Cache.h, src/Command.h, src/CommandConsole.h, src/DebugConsole.h, src/DummyDisplayDevice.h, src/FbiStuff.h, src/FramebufferDevice.h, src/Image.h, src/Imlib2Device.h, src/SDLDevice.h, src/Var.h, src/Viewport.h, src/fim.h, src/fim_string.h: When compiling for C++11, using the final specifier on the many non-base classes. 2017-07-20 08:40 dezperado * [r1422] src/FramebufferDevice.cpp, src/FramebufferDevice.h: Tightened members access specifiers of FramebufferDevice. 2017-07-19 23:28 dezperado * [r1421] src/Browser.h, src/Cache.h, src/Command.h, src/FimWindow.h, src/Image.h, src/Namespace.h, src/Viewport.h, src/fim_string.h: Declared as explicit a number of constructors of larger classes. 2017-07-19 22:09 dezperado * [r1420] src/CommandConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/FbiStuff.cpp, src/FbiStuff.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/fim.h: Got rid of need for friend access of FbiStuff into CommandConsole. 2017-07-19 21:39 dezperado * [r1419] src/CommandConsole.h, src/fim.h: Oops: fix: last commit forgot this change in fim.h. 2017-07-19 21:17 dezperado * [r1418] src/CommandConsole.cpp, src/CommandConsole.h, src/FbiStuff.cpp: CommandConsole::switch_if_needed() breaks the need for access of FbiStuff to the display device. 2017-07-19 21:00 dezperado * [r1417] NEWS, configure.ac, src/FbiStuff.cpp: framebuffer console switch off while loading: configure with the --enable-framebuffer-switch-while-loading switch to have it back. 2017-07-19 20:33 dezperado * [r1416] src/FbiStuff.cpp: Enclosed two accesses to quite internal DisplayDevice stuff in two macros. Eliminated one DisplayDevice pointer check: we assume loading images after CommandConsole (and components) initialization. 2017-07-19 13:46 dezperado * [r1415] configure.ac: In all branches: removed old leftover declaring missing PNG support misleadingly. 2017-07-19 13:25 dezperado * [r1414] src/Browser.cpp, src/fim_interpreter.cpp, src/fim_string.cpp, src/fim_string.h: Building with -pedantic-errors on g++-6.1 was broken. To fix this, avoiding a macro redefinition, and added an operator overload for fim::string. 2017-07-19 12:03 dezperado * [r1413] NEWS, configure.ac: fix: configure would fail on --disable-aa and absent aalib. 2017-07-19 10:42 dezperado * [r1408] src/Image.h: Debian's g++-6.3.0 seems less permissive than Ubuntu's g++-5.4.0 wrt Image's Namespace access mode in CommandConsole::rns(), so reverting back to public inheritance for now. r1407 was a typo (private instead of public) 2017-07-17 23:18 dezperado * [r1407] src/Image.h: Debian's g++-6.3.0 seems less permissive than Ubuntu's g++-5.4.0 wrt Image's Namespace access mode in CommandConsole::rns(), so reverting back to public inheritance for now. 2017-07-17 11:05 dezperado * [r1406] src/Image.cpp, src/Image.h, src/Viewport.cpp, src/testdir/test20.in, src/testdir/test20.ok: Tidying up Image and logic of access/modify to its variables. 2017-07-17 08:45 dezperado * [r1405] src/Viewport.cpp: Viewport used to make two read access to (non-existent) v: variables. Not anymore. 2017-07-17 08:40 dezperado * [r1404] src/Image.cpp: Image used to make three read access to (non-existent) v: variables. Not anymore. 2017-07-16 23:03 dezperado * [r1403] NEWS, configure.ac: Configure changes: --enable-seek-magic is now default; displaying values of YACC LEX CXX CXXFLAGS LIBS prefix; declaring as influential variables: LIBTIFF LIBGIF LIBJPEG LIBPS LIBDJVU LIBPOPPLER. 2017-07-16 22:06 dezperado * [r1402] src/Browser.cpp, src/Image.cpp, src/Image.h, src/Viewport.cpp: Cleaned up class Image: access permissions, data/function members. 2017-07-16 19:50 dezperado * [r1401] src/Makefile.am, src/Viewport.cpp, src/Viewport.h: Tightened a bit access permissions in class Viewport. 2017-07-16 16:05 dezperado * [r1400] src/testdir/test20.in, src/testdir/test20.ok: It seems like test 20 needed an update. Given also a few new test lines. 2017-07-16 15:48 dezperado * [r1399] src/CommandConsole-cmd.cpp: fix: a few commits ago had broken comparison on empty return value fim::string. 2017-07-16 15:26 dezperado * [r1398] doc/fimrc.man, src/fimrc, src/testdir/test19.ok, src/testdir/test20.ok: Since console key codes alias Backspace and C-h, giving up one for the Help message in the console. 2017-07-16 14:37 dezperado * [r1397] src/testdir/test20.ok: Update of test case to previous two commits. 2017-07-16 14:33 dezperado * [r1396] NEWS, src/CommandConsole-cmd.cpp, src/fim.cpp: Command 'help' will give multiple answers if matching. Adjusted --help message description. 2017-07-16 14:17 dezperado * [r1395] NEWS, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/defaultConfiguration.cpp: Command 'help' will also consider key bindings. 2017-07-16 13:15 dezperado * [r1394] src/testdir/test20.in, src/testdir/test20.ok: Test 20 will query 'bind' as well now. 2017-07-16 11:40 dezperado * [r1393] src/fim.cpp: fim --help now reminds about --help {help-item} syntax. 2017-07-16 11:24 dezperado * [r1392] src/testdir/Makefile, src/testdir/test21.in, src/testdir/test21.ok: In a test for command 'basename'. 2017-07-16 11:20 dezperado * [r1391] doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/fim.h, src/help.cpp, src/testdir/Makefile, src/testdir/test20.in, src/testdir/test20.ok: Introduced variable '_last_cmd_output'. Command 'basename' uses '_last_cmd_output' now. New test for '_last_cmd_output' and 'help' (test20). 2017-07-16 10:15 dezperado * [r1390] src/fim.cpp: fix: help '-' was broken. 2017-07-16 10:05 dezperado * [r1389] NEWS, doc/fim.man, src/CommandConsole-cmd.cpp, src/CommandConsole.h, src/fim.cpp, src/fim.h: If further arguments follow switch --help, individual help messages will be shown. 2017-07-16 09:40 dezperado * [r1388] src/fim.cpp: A trunk specific fix: e.g. "help '--cmd'" was broken, in that an int was being printed out; solved with a cast to char. Avoiding a C style cast and pretty-adjusted a printout in the same function. 2017-07-16 00:43 dezperado * [r1387] src/testdir/Makefile, src/testdir/test10.in, src/testdir/test11.in, src/testdir/test12.in, src/testdir/test14.in, src/testdir/test15.in, src/testdir/test16.in, src/testdir/test17.in, src/testdir/test18.in: `make tests' will display first line of each test*.in file on failed test. Updated each *.in file to have an info comment. 2017-07-16 00:29 dezperado * [r1386] src/testdir/Makefile, src/testdir/test19.in, src/testdir/test19.ok: A minimal first test for the console mechanism. 2017-07-15 22:14 dezperado * [r1385] src/Browser.cpp, src/Browser.h: The Browser::push* member functions are a bit more efficient now. 2017-07-15 21:47 dezperado * [r1384] src/Browser.cpp, src/Browser.h: Will spare one stat() call at recursive files pushing. 2017-07-15 21:01 dezperado * [r1383] src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp: Browser::push() -> Browser::push_path() 2017-07-15 19:21 dezperado * [r1382] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.h: Command 'goto' accepts multiple arguments; those after the first triggering a jump will be ignored. 2017-07-15 18:17 dezperado * [r1381] NEWS, doc/fimrc.man, src/fimrc: Aliases for the 'goto' syntax just introduced. 2017-07-15 18:08 dezperado * [r1380] NEWS, doc/fimrc.man, src/Browser.cpp, src/fim.h: Command goto {'-/'|'+/'}[C] will jump to a file based on C (either of sdubSDUB, default 'S'). 2017-07-15 14:48 dezperado * [r1379] NEWS, doc/fimrc.man, src/Browser.cpp, src/fim.h: Command goto {'-/'|'+/'} will jump to next or previous file in a different directory. 2017-07-15 12:55 dezperado * [r1378] src/DebugConsole.h, src/Namespace.cpp: A change (r1298) in the NameSpace setGlobalVariable was wrong (broke DebugConsole's PageUp/PageDown scroll mechanism). Fixed now. 2017-07-15 10:35 dezperado * [r1377] src/CommandConsole-cmd.cpp: User friendlier messages from 'recording' command. 2017-07-15 10:25 dezperado * [r1376] doc/fimrc.man: Doc update from last commit. 2017-07-15 10:16 dezperado * [r1375] doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.cpp, src/fim.h, src/fimrc: Got rid of scrolldown and scrollforward, and moved into 'scroll' and 'scroll "forward"'. 2017-07-15 09:38 dezperado * [r1374] src/Browser.cpp, src/Browser.h: Got rid of obsolete Browser::fcmd_reduce and Browser::fcmd_magnify. 2017-07-14 23:21 dezperado * [r1373] src/Browser.cpp, src/CommandConsole.h: Cleaning up Browser.cpp a bit, mostly from obsolete comments. 2017-07-14 22:26 dezperado * [r1372] src/CommandConsole.cpp: Deleting obsolete comments and updating them, in CommandConsole. 2017-07-14 21:54 dezperado * [r1371] src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/CommandConsole.h, src/grammar.h: Browser::fcmd_redisplay() -> CommandConsole::fcmd_redisplay() 2017-07-14 21:42 dezperado * [r1370] src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/CommandConsole.h: Browser::fcmd_display() -> CommandConsole::fcmd_display() 2017-07-14 21:30 dezperado * [r1369] src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/CommandConsole.h: Cleaning up a bit around the *display* functions across Browser and CommandConsole. 2017-07-14 20:31 dezperado * [r1368] src/CommandConsole.cpp: Cleaned up a bit CommandConsole::record_action() 2017-07-14 20:13 dezperado * [r1367] src/CommandConsole-cmd.cpp, src/CommandConsole.h: The recording commands give some info on the console now. 2017-07-14 19:46 dezperado * [r1366] NEWS, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h: fix: 'recording' command was non functioning properly. applied fix to 0.4, 0.5, trunk. 2017-07-14 15:03 dezperado * [r1365] NEWS, src/CommandConsole-cmd.cpp, src/grammar.h: fix: will not pop back last if calling recording 'stop' outside of recording mode. fix: won't clear recorded list if calling recording 'start' multiple times. 2017-07-14 14:37 dezperado * [r1364] src/CommandConsole.cpp: CommandConsole::execute_internal() will return quit()'s results. CommandConsole::quit() will disable interactive loop variable. 2017-07-14 14:13 dezperado * [r1363] NEWS, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/fim.cpp, src/fim.h, src/help.cpp: If _debug_commands contains 'B', clear screen and print background loading files. 2017-07-14 13:35 dezperado * [r1362] src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h: Assigning a help message in CommandConsole::bind() itself. 2017-07-14 12:47 dezperado * [r1361] src/fim.h: Using static_cast instead of old-style casts in a few int/float scaling macros. 2017-07-14 12:32 dezperado * [r1360] src/Arg.cpp, src/Arg.h, src/CommandConsole-cmd.cpp, src/fim.h, src/fim_string.h, src/fim_types.h: Moved definition of args_t and a few free functions acting on args_t into Arg.h / Arg.cpp. 2017-07-14 12:14 dezperado * [r1359] NEWS, src/fim.cpp, src/fim.h: Specifying more than once any of -p -i - will issue a warning. 2017-07-14 12:01 dezperado * [r1358] doc/fim.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/fim.cpp, src/fim.h: Small improvements in error checks/propagation, documentation messages. 2017-07-14 11:09 dezperado * [r1357] src/fim.cpp, src/fim.h: A warning will be displayed if --sort-fsize or --sort-mtime invoked. 2017-07-14 10:45 dezperado * [r1356] doc/fimrc.man, src/fim.cpp, src/fim.h, src/help.cpp: Doc fix for _scale_style. 2017-07-14 10:42 dezperado * [r1355] doc/fim.man, src/CommandConsole-init.cpp, src/fim.cpp, src/fim.h: Fixed a few error and help messages and comments. 2017-07-14 09:51 dezperado * [r1354] src/CommandConsole.cpp, src/CommandConsole.h, src/common.cpp, src/common.h: fix: _debug_commands='k' was printing only first char of keysym; now the other chars as well. Added a fim_key_escape(). 2017-07-13 21:34 dezperado * [r1353] src/fim_interpreter.cpp: The verbose interpreter mode will indent with spaces according to the execution stack depth. 2017-07-13 21:03 dezperado * [r1352] doc/fim.man, src/fim.cpp, src/fim.h: Extra interpreter verbosity achievable by specifying --verbose-interpreter twice. 2017-07-13 20:55 dezperado * [r1351] NEWS, doc/fimrc.man, src/fim.h, src/fim_interpreter.cpp, src/help.cpp: _debug_commands now accepts 'i' to display internal interpreter steps. 2017-07-13 20:46 dezperado * [r1350] src/fim_interpreter.cpp: Cleaning up interpreter a further bit and improving the (compile time disabled) debug output. 2017-07-13 18:17 dezperado * [r1349] src/common.cpp: pick_word() used not to close() file descriptor: fixed. Generalized a bit the inners of fim_rand(). 2017-07-13 17:05 dezperado * [r1348] src/fim_interpreter.cpp: Got rid of obsolete code and casts from the fim interpreter. 2017-07-13 16:30 dezperado * [r1347] src/CommandConsole-init.cpp: Using std::static_assert for a few compile time type tests. 2017-07-13 15:40 dezperado * [r1346] src/fim.h: Whoops: last commit was broken; fix. 2017-07-13 15:21 dezperado * [r1345] src/DebugConsole.h, src/FbiStuff.cpp, src/fim.cpp, src/fim.h, src/fim_interpreter.cpp, src/help.cpp: Removed a few dead comments or code. Renamed a few preprocessor symbols. Moved a few vars initializations. 2017-07-13 14:51 dezperado * [r1344] src/fim_interpreter.cpp: Abandoning old-style casts for C++ style reinterpret_cast in vscon(). 2017-07-13 14:26 dezperado * [r1343] src/CommandConsole.cpp, src/fim.h: Improved readability of CommandConsole by moving most long help strings in a separate place. 2017-07-13 13:27 dezperado * [r1342] src/CommandConsole.cpp, src/common.cpp, src/common.h: Commented the unused trhex function. Removed the fim_cmd_id constructor on Command() constructors. comment typo fix. 2017-07-13 13:10 dezperado * [r1341] src/Browser.cpp, src/CommandConsole-help.cpp, src/Image.cpp, src/fim.cpp: Slimming string concatenation with std::ostringstream. 2017-07-13 10:18 dezperado * [r1340] src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/Viewport.cpp, src/common.cpp, src/common.h: CommandConsole::fcmd_cd's static variable is now CommandConsole::oldcwd_; Moved some functionality to fim_getcwd(). CommandConsole::fcmd_basename's static variable is not static anymore. Sparing a few further fim_string::c_str() calls. 2017-07-12 22:55 dezperado * [r1339] src/Browser.cpp, src/Cache.cpp, src/Command.h, src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/FimWindow.cpp, src/FimWindow.h, src/Image.cpp, src/Image.h, src/fim.h, src/fim_interpreter.cpp, src/fim_string.cpp, src/grammar.h: substituting many occurrences of std::vector with more appropriate typedef args_t. thanks to user-defined conversion to const char*, not invoking fim::string::c_str() anymore in many cases. Command's data members are private now. comparison operators in Command now work on references. 2017-07-12 21:00 dezperado * [r1338] doc/fimrc.man, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/fim.h: Improved documentation of commands a bit, and updated man fimrc consequently. 2017-07-12 20:16 dezperado * [r1337] doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp: Better documented the internal `basename' command and changed its internals from POSIX's basename() to fim_basename_of. 2017-07-11 10:14 dezperado * [r1336] src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/Image.h, src/Namespace.cpp, src/Var.cpp: Constructing even more strings using std::ostringstream. 2017-07-10 23:19 dezperado * [r1335] NEWS, doc/fim.man, doc/fimrc.man, src/CommandConsole.cpp, src/fim.h, src/help.cpp: --verbose-interpreter can accept all of "ack" letters now ('k' stays for keys). 2017-07-10 22:51 dezperado * [r1334] NEWS, doc/fim.man, src/CommandConsole.cpp, src/fim.cpp, src/fim.h, src/fim_string.cpp, src/testdir/test14.ok: New switch --verbose-interpreter to execute interpreter verbosely by setting adequately _debug_commands. 2017-07-10 22:33 dezperado * [r1333] NEWS, src/common.cpp, src/grammar.h, src/lex.lex, src/testdir/test18.ok: Strings specified within single quotes will have single quotes escaped, just as double quotes. 2017-07-10 22:07 dezperado * [r1332] src/testdir/test18.ok: Whoops: last commit's test18.ok had to look like this one. 2017-07-10 21:59 dezperado * [r1331] src/testdir/Makefile, src/testdir/test18.in, src/testdir/test18.ok: In a new test for the string escaping mechanism. 2017-07-10 17:41 dezperado * [r1330] NEWS, doc/fimrc.man, src/CommandConsole.cpp, src/Var.h, src/fim.h, src/fimrc, src/help.cpp, src/testdir/test14.in, src/testdir/test15.in: Variable '_debug_commands' is now a string. Added a Var::find() member function to look for single chars in such variables. 2017-07-10 12:25 dezperado * [r1329] configure.ac, src/common.cpp, src/fim_types.h: A helper macro to avoid repeated sizeof's to determine fim_int size: 2017-07-10 12:04 dezperado * [r1328] src/Arg.cpp, src/Arg.h, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h: Got rid of near-useless class Arg. 2017-07-10 10:50 dezperado * [r1327] src/Var.h: In Var::getInt of trunk and 0.5: using fim_atoi instead of atoi. 2017-07-10 10:32 dezperado * [r1325] NEWS, src/FbiStuff.cpp, src/fim.cpp: Internal type for --offset is now everywhere fim_int. 2017-07-10 09:43 dezperado * [r1324] src/CommandConsole.cpp, src/FbiStuff.cpp, src/fim.cpp, src/grammar.h: Uniformed the identifiers names in the two files handling --offset . Comments cleanup. 2017-07-09 23:34 dezperado * [r1323] NEWS, src/FbiStuff.cpp: fix: in --offset mode, avoiding probing for external loader programs. 2017-07-09 22:00 dezperado * [r1321] NEWS, src/FbiStuff.cpp, src/fim.h, src/help.cpp: Heavy fixes to _seek_magic (first serious fixes since r247). 2017-07-09 19:56 dezperado * [r1320] src/FbiStuff.cpp, src/fim.cpp: Rationalized a bit the temporaries handling on --verbose-loading and --offset options. Adjusted a bit the --verbose-loading messages. 2017-07-09 19:18 dezperado * [r1319] NEWS, doc/fim.man, src/fim.cpp: --verbose-load option for verbose file loading. 2017-07-09 19:07 dezperado * [r1318] src/FbiStuff.cpp, src/fim.h: Further messages for verbose mode file load. 2017-07-09 17:41 dezperado * [r1317] NEWS, doc/fim.man, doc/fimrc.man, src/FbiStuff.cpp, src/fim.h, src/grammar.h, src/help.cpp: -C '_seek_magic=..' will now probe whole range of specified signature. 2017-07-09 17:10 dezperado * [r1316] NEWS, src/fim.h: in trunk and 0.5 branch: fix in _seek_magic documentation (-C, not -c). 2017-07-09 17:03 dezperado * [r1315] src/fim.cpp: In 0.5 and trunk: adjust of --offset option documentation string. 2017-07-09 15:41 dezperado * [r1314] NEWS, src/fim.cpp: In trunk and branch 0.5, dating to r795: bugfix: --offset option was ignoring lower bytes-offset. 2017-07-09 14:18 dezperado * [r1313] src/CommandConsole.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/fim_types.h: Avoiding a few unnecessary signed/unsigned conversions/comparisons. Fixed a misleading indentation. 2017-07-09 13:39 dezperado * [r1312] NEWS, src/FbiStuffPs.cpp: in all branches: fix: a check was missing in the PS decoder when reading from stdin. 2017-07-09 12:54 dezperado * [r1311] src/Browser.cpp, src/Cache.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/Image.cpp: Not giving raw strings (.c_str()) anymore to setVariable/setGlobalVariable. 2017-07-09 11:58 dezperado * [r1310] src/Browser.h, src/Viewport.h: Reverting changes of r1308 wrt Browser and Viewport: inheritance public again (not yet ready for protected Namespace inheritance). 2017-07-09 09:40 dezperado * [r1309] src/Cache.cpp: Improving readability of Cache by using std::ostringstream; 2017-07-09 09:29 dezperado * [r1308] src/Browser.h, src/Cache.h, src/Viewport.h: Restricted Namespace inheritance access specifiers: in Browser to protected, in Cache to private, in Viewport to protected. 2017-07-08 23:25 dezperado * [r1307] src/CommandConsole.cpp, src/DebugConsole.cpp: fix: had forgotten to reformat console after font rescale. Replaced min with FIM_MIN in MiniConsole. 2017-07-08 23:05 dezperado * [r1306] src/Cache.h: Build fix: revisions 1293-1305 were including only, which builds only since C++11. 2017-07-08 22:24 dezperado * [r1305] src/AADevice.cpp, src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/SDLDevice.cpp, src/Var.h, src/fim.h, src/yacc.ypp: Substituted FIM_CNS_KEY_NULL with FIM_SYM_NULL_KEY. Deleted lots of obsolete code and comments. Slimming string concatenation with std::ostringstream. Changed a bit definition of Var. In the yacc.ypp using C++ standard includes (). 2017-07-08 18:48 dezperado * [r1304] src/DisplayDevice.cpp, src/DisplayDevice.h: Cleaning up DisplayDevice code a bit, mostly out of old comments. 2017-07-08 18:18 dezperado * [r1303] src/Image.cpp: Commented back a printout accidentally uncommented. 2017-07-08 18:17 dezperado * [r1302] src/CommandConsole-var.cpp, src/CommandConsole.h, src/Namespace.cpp, src/Namespace.h: Each of the setVariable and setGlobalVariable member functions in Namespace and CommandConsole will return the source value just in the given type. 2017-07-08 16:18 dezperado * [r1301] src/Var.h: Cleaned up a bit in class Var. Now Var::set returns not zero but the value. 2017-07-08 12:42 dezperado * [r1300] src/Browser.cpp, src/Viewport.cpp, src/fim.h: Slimmer code for ViewportState store/restore. 2017-07-08 12:30 dezperado * [r1299] src/Browser.cpp, src/Cache.cpp, src/Image.h, src/Viewport.cpp, src/Viewport.h, src/fim.h: Cleaning up Viewport interface and implementation a bit. 2017-07-08 11:30 dezperado * [r1298] src/Browser.cpp, src/Cache.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp: Further removing (fim_int) conversion operator when invoking setGlobalVariable member functions. 2017-07-08 11:16 dezperado * [r1297] src/AADevice.cpp, src/AADevice.h, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/DisplayDevice.cpp, src/DisplayDevice.h: On DisplayDevice and hierarchhy: init_console -> format_console. 2017-07-08 11:11 dezperado * [r1296] src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/Image.cpp, src/Image.h, src/Namespace.h, src/Viewport.cpp: Got rid of an image->setVariable() in CommandConsole, and further related changes. 2017-07-07 23:17 dezperado * [r1295] src/Image.cpp, src/Image.h, src/Viewport.cpp: Added a Image::set_auto_props to avoid setGlobalVariable("i:".. -like statements in Viewport. 2017-07-07 22:53 dezperado * [r1294] src/Image.cpp, src/Image.h, src/Namespace.h, src/Viewport.cpp: With some exceptions, restricting access specification of set* member functions of Namespace(). 2017-07-07 21:19 dezperado * [r1293] src/Cache.h, src/FbiStuff.cpp, src/FbiStuff.h, src/FontServer.h, src/FramebufferDevice.h, src/Viewport.cpp, src/fim.h, src/fim_plugin.cpp: Using C++ styled include headers for standard library (). 2017-07-07 20:18 dezperado * [r1292] src/Cache.cpp, src/Image.cpp, src/Viewport.cpp: Using fim_int to take variables from getVariable(... . 2017-07-07 20:11 dezperado * [r1291] src/Image.cpp: In Image, abandoned setGlobalVariable("i:".. in favour of setVariable(... 2017-07-07 19:46 dezperado * [r1290] src/Image.cpp, src/Image.h: Image::is_mirrored and Image::is_flipped return now bool. 2017-07-07 17:09 dezperado * [r1289] src/Image.cpp: Using std::for_each for Image::fim_negate_rgb when in C++11 mode. With a commented parallel version for C++17 (using std::execution::parallel_policy). 2017-07-07 16:32 dezperado * [r1288] src/AADevice.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/FbiStuff.cpp, src/Image.cpp, src/SDLDevice.cpp, src/defaultConfiguration.cpp, src/fim.cpp: Removing (fim_int) conversion operator when invoking the various setVariable / setGlobalVariable member functions, now offering int and unsigned int overloads. 2017-07-07 16:30 dezperado * [r1287] src/CommandConsole-var.cpp, src/CommandConsole.h, src/Namespace.cpp, src/Namespace.h: Further overloads of setVariable for (unsigned int). 2017-07-07 15:34 dezperado * [r1286] src/CommandConsole-var.cpp, src/CommandConsole.h, src/Namespace.cpp, src/Namespace.h: Added plain int overloads of setVariable (both Namespace and CommandConsole versions) for the case fim_int is not int. 2017-07-07 14:53 dezperado * [r1285] src/Image.cpp, src/Image.h: Got rid of Image::prev_page(), Image::next_page(), added Image::have_page(). 2017-07-07 14:33 dezperado * [r1284] src/FbiStuff.cpp, src/Image.cpp, src/fim.h: Cleaned up FbiStuff::rotate_image a bit. 2017-07-07 13:19 dezperado * [r1283] src/fim_string.cpp, src/fim_string.h: Trimming further dead code from fim::string. 2017-07-07 13:12 dezperado * [r1282] src/fim_string.cpp, src/fim_string.h: Removed dead code of old fim::string. 2017-07-07 13:07 dezperado * [r1281] src/Browser.cpp: Browser::fcmd_scale won't ignore error codes originating from Image's scaling functions. 2017-07-07 12:45 dezperado * [r1280] src/Image.cpp, src/Image.h: Got rid of Image::ms_ (trivial to compute). 2017-07-07 12:40 dezperado * [r1279] src/Image.cpp, src/Image.h, src/SDLDevice.cpp, src/fim_string.cpp: Comments fix. Now Image::negate,Image::identity,Image::desaturate returning an error code. 2017-07-07 12:04 dezperado * [r1278] src/Image.cpp, src/Image.h: Every invocation of do_scale_rotate now propagates error value. 2017-07-07 11:40 dezperado * [r1277] src/FbiStuff.cpp: Removed a few useless casts on fim_pm_alloc return. 2017-07-07 11:36 dezperado * [r1276] src/FbiStuff.cpp, src/FbiStuff.h, src/FramebufferDevice.cpp, src/Image.cpp: Introduced fbi_img_pixel_count(). 2017-07-07 11:10 dezperado * [r1275] src/Image.cpp, src/fim_types.h: a new typedef for pixel count quantities; using it for a bunch of image manipulating static functions. 2017-07-07 11:01 dezperado * [r1274] src/AADevice.cpp, src/SDLDevice.cpp, src/fim.h: introduced FIM_CNS_KEY_NULL: null key value for fim_key_t. 2017-07-07 10:50 dezperado * [r1273] src/Browser.cpp, src/Image.cpp, src/Image.h, src/Viewport.cpp: Cleaning up Image: renamed members (also public ones), deleted obsolete comments. 2017-07-07 09:39 dezperado * [r1272] TODO, src/Image.h, src/Viewport.cpp: Added Image::get_ida_image() and made img_ private. 2017-07-07 09:21 dezperado * [r1271] src/AADevice.cpp, src/AADevice.h, src/CACADevice.cpp, src/CACADevice.h, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Imlib2Device.cpp, src/Imlib2Device.h, src/SDLDevice.cpp, src/SDLDevice.h: All the *display* member functions of the *DisplayDevice* classes now take the ida_image_img pointer argument with the const qualifier. 2017-07-07 08:12 dezperado * [r1270] src/Cache.cpp, src/Image.cpp, src/Image.h: Got rid of Image::getClone() 2017-07-06 14:02 dezperado * [r1269] src/fim.h: When in C++14 mode, will use small templated functions instead of current FIM_MIN and FIM_MAX preprocessor acros. 2017-07-06 11:56 dezperado * [r1268] src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/FbiStuffJpeg.cpp, src/FontServer.cpp, src/Imlib2Device.cpp, src/Makefile.am, src/SDLDevice.cpp, src/Viewport.cpp, src/common.cpp, src/examples.h, src/fim_plugin.cpp, src/grammar.h: Substituting "const fim_char_t *" with "const fim_char_t * const" where appropriate. 2017-06-21 23:21 dezperado * [r1267] src/fim_stream.cpp: Small fix for when using fim_stream in an isolated environment (FIM_INDEPENDENT_NAMESPACE). 2017-06-21 23:10 dezperado * [r1266] src/Namespace.cpp: revision 1095 changed signature of Namespace's operator<<(std::ostream os, const Namespace& ns) by removing reference to first argument. Fix. 2017-06-17 12:44 dezperado * [r1265] doc/FIM.TXT, src/fimgs: Replaced argument to rm: -fRd with -fR in branches 0.3, 0.4, 0.5 and trunk. 2017-06-17 00:17 dezperado * [r1258] NEWS, configure.ac: fix for 0.4, 0.5, trunk: configure will use always `sdl-config --static-lib` instead of --libs in non-static-only cases. 2017-06-07 21:37 dezperado * [r1255] src/CommandConsole-cmd.cpp, src/fim.h: Functionality to bind all keys to a specific command. For now off by default. 2017-05-29 10:00 dezperado * [r1254] src/fim_interpreter.cpp: fix: Inclusion of was missing from fim_interpreter.cpp --- forgot it in r1120. 2017-04-22 14:22 dezperado * [r1253] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h, src/fimrc: Command 'pan' accepts '-' and '+' to jump to prev/next file if border is reached. 2017-04-22 13:34 dezperado * [r1252] src/Viewport.cpp, src/Viewport.h: Viewport's pan_* functions return 'false' when stuck. 2017-04-22 08:09 dezperado * [r1251] doc/fimrc.man, src/fimrc: in a default alias "refresh" for "desc 'reload';redisplay;" and binding "F5". 2017-04-18 21:18 dezperado * [r1250] doc/fimrc.man, src/Makefile.am, src/fimrc: The built-in fimrc is slimmer now: fewer lines and no useless semicolons at commands specification's end. 2017-04-18 17:45 dezperado * [r1249] doc/fimrc.man, src/Makefile.am, src/fimrc: src/fimrc lines beginning with three pound signs '###' will not go in the documentation. 2017-04-18 17:13 dezperado * [r1248] NEWS, doc/fimrc.man, src/fimrc: Will show mouse cursor in full screen (SDL mode). 2017-04-18 13:23 dezperado * [r1247] NEWS, src/SDLDevice.cpp: Better positioning of the on-screen mouse control grid. 2017-04-18 09:25 dezperado * [r1246] NEWS, src/SDLDevice.cpp, src/SDLDevice.h: Boxed version of fill_rect for better visibility of overlay grid. 2017-04-18 09:11 dezperado * [r1245] src/SDLDevice.cpp: Removed reference to SDLDevice::fill_rect() bug in SDLDevice::draw_help_map. 2017-04-18 09:08 dezperado * [r1244] src/SDLDevice.cpp: Solved the defect in SDLDevice::fill_rect(..) (x coords were begin and end, not first and last). 2017-04-17 21:58 dezperado * [r1243] src/SDLDevice.cpp: Commented a verbose printout. Adjusting a bit use of fill_rect. 2017-04-17 20:55 dezperado * [r1242] NEWS, doc/fimrc.man, src/SDLDevice.cpp, src/fim.h, src/fimrc, src/help.cpp: The _want_wm_mouse_ctrl variable is now a string, and its contents will represent the customizable, clickable 3x3 on-screen keys grid. 2017-04-17 20:33 dezperado * [r1241] NEWS, doc/fimrc.man, src/SDLDevice.cpp, src/fim.h, src/help.cpp: The "_want_wm_mouse_ctrl=1" option has now three toggle states controlled by the right mouse button. The third one, just introduced, is a gentler version of the 3x3 grid info from the last commits: just eight ticks around the screen. 2017-04-17 20:05 dezperado * [r1240] NEWS, src/DisplayDevice.cpp, src/DisplayDevice.h, src/SDLDevice.cpp: Still on the '_want_wm_mouse_ctrl=1': bindings are now saved once in a local string constant. 2017-04-17 19:43 dezperado * [r1239] src/SDLDevice.cpp: prefixed the static variable draw_help_map_ with 'fim_'. 2017-04-17 19:32 dezperado * [r1238] NEWS, src/SDLDevice.cpp: Changed the key bindings 3x3 grid for "_want_wm_mouse_ctrl=1". 2017-04-17 19:05 dezperado * [r1237] src/SDLDevice.cpp: Changed binding of middle image mouse area from '=' to 'a' (_want_wm_mouse_ctrl=1 case). 2017-04-17 19:01 dezperado * [r1236] NEWS, doc/fimrc.man, src/SDLDevice.cpp, src/fim.h, src/help.cpp: In SDL mode: clicking the middle button will display usage info if _want_wm_mouse_ctrl==1. 2017-04-17 17:40 dezperado * [r1235] NEWS, src/SDLDevice.cpp: fix: mouse movement under SDL used to trigger unnecessary screen redraws. (was using redisplay() instead of display()). 2017-04-17 16:47 dezperado * [r1234] doc/fimrc.man, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.h, src/help.cpp: If _want_wm_mouse_ctrl==1, middle mouse click will display a help map. 2017-04-17 15:17 dezperado * [r1233] NEWS, doc/fimrc.man, src/SDLDevice.cpp, src/fim.h, src/fimrc, src/help.cpp: Variable "_want_wm_mouse_ctrl" will control mouse click/movement behaviour in SDL mode. 2017-04-17 13:13 dezperado * [r1232] NEWS, doc/fimrc.man, src/fim.h, src/help.cpp: Updated 'experimental' from certain variables doc string. NEWS typo fix. 2017-04-17 13:10 dezperado * [r1231] NEWS, doc/fimrc.man, src/Cache.cpp, src/fim.h, src/fimrc, src/help.cpp: Introduced variable _min_cached_images: the minimum number of images to keep from eviction. If less than four can lead to inefficiencies: e.g. when jumping between two images, each time an erase and a prefetch of neighboring images would trigger. Before this change, 'fim a.jpg b.jpg c.jpg -k n -k p -c quit' could be entering in that phase with e.g. three images. 2017-04-17 12:54 dezperado * [r1230] NEWS, src/Cache.cpp: fix: lastly used image will be erased at last, after eventually prefetched images. 2017-04-17 12:04 dezperado * [r1229] src/FbiStuff.cpp: Fix: moved a misplaced FIM_PR in FbiStuff::read_image(). 2017-04-17 11:52 dezperado * [r1228] NEWS, doc/fim.man, src/CommandConsole.cpp, src/fim.cpp: Keysym of -k switch can be prefixed by a repetition count number now. 2017-04-17 11:49 dezperado * [r1227] src/CommandConsole.cpp: fix: the -k switch used to incorrectly handling digits; impeding this now. 2017-04-17 10:50 dezperado * [r1226] NEWS, doc/fimrc.man, src/CommandConsole.cpp: Autocommand "PostInteractiveCommand" does not trigger anymore after "quit" command. 2017-04-16 21:13 dezperado * [r1225] README, TODO, debian/control, distros/debian/control, src/Viewport.cpp: Jargon check n correction round: 'frame buffer' -> 'framebuffer' around. TODO file update trim. 2017-04-16 19:11 dezperado * [r1224] NEWS, src/FbiStuff.cpp, src/Var.h, src/fim.h, src/fim_stream.cpp: Using raw string literals in a few a bit backslash-intensive strings. Many more shall follow once we break backcompatibility with C++03. A few comments forgotten in a few files during last commits. 2017-04-16 18:31 dezperado * [r1223] NEWS, doc/fimrc.man, src/Browser.cpp, src/fim.h, src/fimrc, src/help.cpp: Introduced variable to govern tolerance of 'scrollforward': _scroll_skip_page_fraction. 2017-04-16 18:12 dezperado * [r1222] src/Browser.cpp, src/Browser.h, src/CommandConsole-help.cpp, src/CommandConsole-var.cpp, src/CommandConsole.cpp: Uniformization: renamed Browser::c_image() and Browser::image() into Browser::c_getImage() and Browser::getImage(). 2017-04-16 17:43 dezperado * [r1221] NEWS, src/Var.h, src/common.cpp, src/common.h, src/fim_stream.cpp, src/fim_string.cpp: Wrote a fim_snprintf_fim_int function to confine some -pedantic-errors unfriendly code. NEWS update from last commit. 2017-04-16 17:19 dezperado * [r1220] README, configure.ac, src/fimrc: configure doc line typo fix. Alias "unlimit" will reset the limited list. README note about GPG key. 2017-04-16 14:45 dezperado * [r1219] NEWS, README, configure.ac: NEWS file: reordering by importance the improvements for upcoming 0.6. Removed section 8.2 of the README. A note in the configure. 2017-04-16 13:09 dezperado * [r1218] doc/fim.man, src/fim.cpp: Mentioned the image format detection mechanism in man page preamble (with reference to _file_loader). Apostrophes in -A switch documentation line. 2017-04-16 12:53 dezperado * [r1217] NEWS, doc/fim.man, src/fim.cpp, src/fim.h: -r {width:height} / --resolution {width:height} will behave as expected in SDL mode. 2017-04-16 12:17 dezperado * [r1216] doc/fim.man, src/fim.cpp: -A/--autotop help fix. 2017-04-16 12:04 dezperado * [r1215] NEWS, doc/fimrc.man, src/FbiStuff.cpp, src/fim.h, src/fimrc, src/help.cpp: if variable _downscale_huge_at_load is 1 (default now), will downscale automatically huge images at load time. 2017-04-16 09:10 dezperado * [r1214] doc/fim.man, src/fim.cpp: Mentioned that -k/--keysym-press press can be repeated. 2017-04-15 22:31 dezperado * [r1213] NEWS, doc/fimrc.man, src/CommandConsole.cpp: A few corrections to CommandConsole::fcmd_font. Rebuilt man fimrc. 2017-04-15 21:49 dezperado * [r1212] src/CommandConsole.cpp: r1210 had broken C++98 build: fix. 2017-04-15 21:42 dezperado * [r1211] NEWS, doc/fimrc.man, src/fimrc: Changed a bit definitions of font_magnify and font_reduce: these will switch manual font size control (more immediate feel). 2017-04-15 21:29 dezperado * [r1210] NEWS, doc/fimrc.man, src/CommandConsole.cpp, src/FontServer.cpp, src/FontServer.h, src/fim.h, src/fimrc: new experimental command 'font' to control displayed font and scan font directories. 2017-04-15 20:05 dezperado * [r1209] src/CommandConsole.cpp, src/CommandConsole.h, src/FontServer.cpp, src/fim.h: Added an experimental "font" command (not active at the moment) to scan directories and load entire lists of fonts, then cycle through them. 2017-04-15 14:03 dezperado * [r1208] NEWS, src/FramebufferDevice.h: In trunk and branches 0.3, 0.4, 0.5: bugfix: on certain framebuffer configurations part of the screen would not be redrawn. Usage of FB_MEM_LINE_OFFSET was incorrect: now using fb_fix_.line_length (now in FB_MEM_LINE_LENGTH). This encompasses the eventual mismatch and makes clear_line() invocations in FramebufferDevice::svga_display_image_new () appear in the correct position. 2017-04-14 22:39 dezperado * [r1207] NEWS: In last commit forgot to update NEWS. Doing this now. 2017-04-14 22:23 dezperado * [r1206] NEWS, configure.ac, src/FbiStuff.cpp: configure --with-tmpfile will specify a new temporary directory. Using tempnam() instead. 2017-04-14 21:35 dezperado * [r1205] NEWS, src/fim.h, src/help.cpp: FIM_VID_FILE_BUFFERED_FROM contained a trailing dot from r1202. 2017-04-14 21:05 dezperado * [r1204] NEWS, src/FbiStuff.cpp: In 0.3, 0.4, 0.5, and trunk, bugfix: conversion from external program was vulnerable to failure due to missing check. (fim_execlp used to return without waitpid()) 2017-04-14 17:32 dezperado * [r1203] src/FbiStuff.cpp: whoops: variable tpfn was being declared under the wrong preprocessor conditional. 2017-04-14 17:29 dezperado * [r1202] NEWS, doc/fimrc.man, src/FbiStuff.cpp, src/fim.h, src/help.cpp: if an image has been decoded from a temporary file, its name is in i:_buffered_in_tmpfile. 2017-04-14 16:45 dezperado * [r1201] src/FbiStuff.cpp: Wrote a fim_tempnam() function, will have to phase out hardcoded temporary file names eventually. 2017-04-14 16:22 dezperado * [r1200] NEWS, src/FbiStuff.cpp: will consider magic number " --without-gui --export-png . 2017-04-14 15:04 dezperado * [r1199] NEWS, doc/fimrc.man, src/fimrc: Introduced "font_reduce" and "font_magnify" aliases and bound to '[' ']' keys. Introduced "toggle_font_auto_scale" alias and bound to '|' key. 2017-04-14 13:09 dezperado * [r1198] NEWS, doc/fimrc.man, src/CommandConsole.cpp, src/DisplayDevice.cpp, src/DisplayDevice.h, src/fim.h, src/help.cpp: If _fbfont_as_screen_fraction>0, font will be scaled to exceed 1/_fbfont_as_screen_fraction of both width and height. If _fbfont_as_screen_fraction<0, font scaling will be fixed. 2017-04-14 11:41 dezperado * [r1197] NEWS, src/Browser.cpp, src/Viewport.cpp, src/Viewport.h: Introduced a tolerance to make onBottom() onRight() onLeft() onTop() trigger earlier. If scrollable border less than 1/16 of screen, 'scrollforward' will skip it. 2017-04-14 11:10 dezperado * [r1196] NEWS, doc/fimgs.man, doc/fimrc.man, src/fimgs: In case of CBZ,CBR,PDF,PS,DVI file, fimgs will use '--autotop --autowidth'. 2017-04-14 10:43 dezperado * [r1195] NEWS, src/fimgs: fimgs script will probe for unrar-nonfree/rar/unrar-free (in this order). 2017-04-14 10:29 dezperado * [r1194] src/AADevice.cpp, src/AADevice.h, src/CACADevice.cpp, src/CACADevice.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Imlib2Device.cpp, src/Imlib2Device.h, src/SDLDevice.cpp, src/SDLDevice.h: DisplayDevice::get_chars_per_line() and DisplayDevice::get_chars_per_column() now return fim_coo_t. And so in AADevice, CACADevice, DummyDisplayDevice, FramebufferDevice, Imlib2Device, SDLDevice. 2017-04-14 10:20 dezperado * [r1193] src/AADevice.h, src/CACADevice.h, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.h, src/Imlib2Device.cpp, src/Imlib2Device.h, src/SDLDevice.h: DisplayDevice::get_bpp() is now const. And so for AADevice, CACADevice, DummyDisplayDevice, FramebufferDevice, Imlib2Device, SDLDevice. 2017-04-14 10:17 dezperado * [r1192] src/AADevice.cpp, src/AADevice.h, src/CACADevice.cpp, src/CACADevice.h, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Imlib2Device.cpp, src/Imlib2Device.h, src/SDLDevice.cpp, src/SDLDevice.h: DisplayDevice::get_chars_per_line() and DisplayDevice::get_chars_per_column() are now const. And so for AADevice, CACADevice, DummyDisplayDevice, FramebufferDevice, Imlib2Device, SDLDevice. 2017-04-14 10:10 dezperado * [r1191] src/AADevice.cpp, src/AADevice.h, src/CACADevice.cpp, src/CACADevice.h, src/Imlib2Device.h, src/SDLDevice.h: txt_height() and txt_width() are now const in AADevice, CACADevice, Imlib2Device, SDLDevice. 2017-04-14 09:57 dezperado * [r1190] src/AADevice.cpp, src/AADevice.h, src/CACADevice.cpp, src/CACADevice.h, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.h, src/Imlib2Device.cpp, src/Imlib2Device.h, src/SDLDevice.cpp, src/SDLDevice.h: DisplayDevice::height() and DisplayDevice::width() are now const. And so for AADevice, CACADevice, DummyDisplayDevice, FramebufferDevice, Imlib2Device, SDLDevice. 2017-04-14 09:26 dezperado * [r1189] src/CommandConsole.cpp, src/CommandConsole.h: Moved code into new CommandConsole::update_font_size(). 2017-04-14 08:46 dezperado * [r1188] configure.ac, doc/fimrc.man, src/fim.h: Added --enable-c++17 and FIM_USE_CXX17 (assuming (__cplusplus> 201707L) to suffice). 2017-04-14 08:21 dezperado * [r1187] NEWS, configure.ac: New default is configure --font-magnifying-factor=0 2017-04-13 18:35 dezperado * [r1186] src/AADevice.cpp, src/FbiStuffDjvu.cpp, src/SDLDevice.cpp, src/Viewport.cpp: The newly introduced FIM_INT_SCALE_FRAC macro was not being used correctly in a few cases; fixing with a static_cast. 2017-04-12 07:50 dezperado * [r1185] src/AADevice.cpp, src/Browser.cpp, src/FbiStuff.cpp, src/FbiStuffDjvu.cpp, src/Image.cpp, src/Viewport.cpp, src/fim.h: Introduced the FIM_INT_SCALE_FRAC macro for the division involing integer to floating-point conversion for scaling purposes. 2017-04-10 12:16 dezperado * [r1184] NEWS, src/FbiStuff.cpp, src/fim.h: Will resize huge images not to exceed too much screen size. 2017-04-09 21:14 dezperado * [r1183] src/Cache.h: avoiding a premature return in PACA::asyncPrefetch(). 2017-04-09 20:52 dezperado * [r1182] src/Browser.cpp, src/Viewport.cpp, src/fim.h: deleted Viewport::setState and Viewport::getState in favour of of ViewportState::store and ViewportState::restore, inherited by Viewport. 2017-04-09 14:11 dezperado * [r1181] NEWS, src/FbiStuffGif.cpp: In branches 0.4 0.5 and trunk: fix: gif error handling could have led to NULL pointer usage. 2017-04-09 14:05 dezperado * [r1180] src/CommandConsole-cmd.cpp, src/FbiStuffDjvu.cpp, src/SDLDevice.cpp, src/b2ba.c, src/fim.cpp: Getting rid of a few unused variables and including an unincluded header. 2017-04-09 13:44 dezperado * [r1179] src/Browser.cpp: Small fix: avoiding an ambiguity in a conditional for FIM_WANT_VAR_GOTO. 2017-04-09 13:39 dezperado * [r1178] src/Image.cpp: In branches 0.5 and trunk, abandoned %a sscanf code in favour of %m, avoiding ambiguity and warnings. 2017-04-09 12:42 dezperado * [r1177] src/Image.cpp, src/Image.h: In branches 0.4 0.5 and trunk got rid of unused Image::scale_increment. In branches 0.5 and trunk Image::setscale Image::scale_multiply scaling now only when supplied argument has a meaningful value. 2017-04-09 12:13 dezperado * [r1176] src/Browser.cpp: In Browser::goto_image_internal, avoiding using a negative index in FIM_WANT_VAR_GOTO handling. 2017-04-09 11:37 dezperado * [r1175] src/FbiStuffLoader.h: Fix: last commit (1174) deleted accidentally a comment slash, breaking build. 2017-04-09 11:01 dezperado * [r1174] src/FbiStuff.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffLoader.h, src/Image.cpp, src/fim.h: Typo fix in 0.5 and trunk: s/EXPERIMEMTAL/EXPERIMENTAL/g 2017-04-09 10:51 dezperado * [r1173] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/FbiStuff.cpp, src/Image.cpp, src/common.cpp: Suppressing some -Wall warnings by adjusting a few conversions, parentheses, initializations. 2017-04-09 09:21 dezperado * [r1172] configure.ac: In branch 0.5 and trunk corrected a wrong configure message about missing libjasper. 2017-04-09 09:17 dezperado * [r1171] src/CommandConsole-var.cpp, src/Viewport.cpp, src/fim.h: Deactivate FIM_IMG_NAKED_PTRS on C++11 or more. 2017-04-09 08:25 dezperado * [r1170] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/Cache.h, src/CommandConsole-var.cpp, src/FimWindow.cpp, src/FimWindow.h, src/Viewport.cpp, src/Viewport.h: Moved dummy_img_ out of Cache, into fim::fim_dummy_img. Had to change a few definitions along the way.. 2017-04-08 17:08 dezperado * [r1169] src/Viewport.cpp, src/Viewport.h: A few new functions for Viewport from existing snippets. 2017-04-08 12:47 dezperado * [r1168] configure.ac, src/Browser.cpp, src/Cache.cpp, src/Viewport.cpp: Got rid of the FIM_BUGGED_CACHE flag. Fixed a bug introduced in 1166 (insufficient deletion of cached data (pointers were not deleted)). 2017-04-08 09:46 dezperado * [r1167] src/CommandConsole-var.cpp: Avoiding a few dirty casts in CommandConsole's variable managing code. 2017-04-08 08:33 dezperado * [r1166] src/Cache.cpp, src/Cache.h: Got rid of Cache::is_in_cache and Cache::free_all. 2017-04-08 08:04 dezperado * [r1165] src/Cache.cpp, src/Cache.h: in Cache: lru_t now maps cache_key_y (not ImagePtr) to fim_time_t. 2017-04-07 20:52 dezperado * [r1164] src/Browser.cpp, src/CommandConsole.cpp, src/fim.h, src/help-acm.cpp: Introduced FIM_AUTOCMD_EXEC_PRE/FIM_AUTOCMD_EXEC_POST to compact the code a bit.. 2017-04-07 17:26 dezperado * [r1163] src/Browser.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-var.cpp, src/CommandConsole.cpp, src/FbiStuff.cpp, src/FbiStuffXyz.cpp, src/Image.cpp, src/SDLDevice.cpp, src/fim.cpp, src/fim_interpreter.cpp, src/fim_string.cpp: Tidying up the code further in several places through the use of declarations in conditions. 2017-04-07 13:25 dezperado * [r1162] src/Cache.cpp: double fix: in Cache, was returning value -1 where false had to. 2017-04-07 13:09 dezperado * [r1161] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/Cache.h, src/FimWindow.h: Cleaning the Cache class code a bit. Introducing use of FIM_NULL further. 2017-04-07 07:29 dezperado * [r1160] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-var.cpp, src/Image.cpp, src/Image.h, src/Viewport.cpp, src/fim.h: Slowly phasing out of naked pointers for Image (introduced FIM_IMG_NAKED_PTRS). 2017-04-06 18:31 dezperado * [r1159] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/Cache.h, src/CommandConsole-cmd.cpp, src/CommandConsole-var.cpp, src/FbiStuffMagick.cpp, src/FimWindow.cpp, src/FimWindow.h, src/Image.cpp, src/Image.h, src/Viewport.cpp, src/Viewport.h, src/fim_plugin.cpp: Substituted almost every 'Image*' with a typedef/alias 'ImagePtr'. 2017-04-06 14:49 dezperado * [r1158] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/Cache.h, src/FbiStuffMagick.cpp, src/FimWindow.cpp, src/FimWindow.h, src/Image.cpp, src/Image.h, src/Viewport.h: Image *\* -> Image* 2017-04-05 15:31 dezperado * [r1157] src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp: In C++11, use std::unique_ptr as Browser::default_image_. 2017-04-01 16:40 dezperado * [r1156] NEWS, doc/fimrc.man, src/Browser.cpp, src/FbiStuff.cpp, src/Image.cpp, src/Image.h, src/fim.h: scale '<'/scale '>' will shrink/magnify the image using cached mipmaps. 2017-04-01 16:31 dezperado * [r1155] NEWS, src/FbiStuff.cpp: fix: the largest mipmap was not always being used. (trunk and 0.5-rc3) 2017-04-01 10:17 dezperado * [r1154] NEWS, doc/fimgs.man, src/fimgs: fimgs script will probe for unrar-free/rar/unrar-nonfree. fimgs man page updated. 2017-04-01 09:13 dezperado * [r1153] TODO, doc/fimgs.man, src/Image.cpp, src/fimgs: fimgs will probe /dev/shm for temporary files. changed a %k expando specifier comment. 2017-04-01 08:22 dezperado * [r1152] TODO, src/Image.cpp, src/Image.h: Cleaned Image::getInfoCustom a bit. 2017-04-01 07:49 dezperado * [r1151] TODO, src/Image.cpp, src/Image.h: Moved inner ugly rotation code into a separate Image member function. 2017-04-01 07:29 dezperado * [r1150] configure.ac, src/Image.cpp, src/Image.h: Mutated an ugly block of code into Image::fetchExifToolInfo(). 2017-03-11 23:35 dezperado * [r1149] NEWS, doc/fimrc.man, src/Viewport.cpp, src/fim.h, src/help.cpp: Added a '_caption_over_image_fmt' variable to customize overlay string contents. 2017-03-11 22:34 dezperado * [r1148] NEWS, doc/fimrc.man, src/Browser.cpp, src/fim.h: The `goto {+|-}identifier[+]' syntax now accepts a trailing `+' to signify nonempty value requirement. 2017-03-11 18:53 dezperado * [r1147] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/fim.h: Added a `goto [+|-]identifier' syntax to jump to next file having a different value of i:identifier. In rebuilding man fimrc, the if/else update propagated in the man file. 2017-03-11 11:23 dezperado * [r1146] Makefile.am: Makefile update with two rules: devhelp (developer help) and uptrunk (upload trunk tarball). 2017-03-11 10:25 dezperado * [r1145] NEWS, configure.ac: In Savannah bug #47588 (https://savannah.nongnu.org/bugs/?47588, credits to "Paul") it was pointed out that configure script was misleadingly complaining about missing readline, when really curses/ncurses was missing. Fixing this by putting detection of curses/ncurses elsewhere and giving a less misleading message. 2017-03-10 20:51 dezperado * [r1144] NEWS, src/Makefile.am, src/lex.lex: Feedback (savannah bug #47728) suggests that -fl is not necessary here (where option noyywrap is being activated). Checked also in flex-2.6 manual. Thanks go to stasheck dot fora at gmail com. Removing LEXLIB from fim_LDADD in trunk and branch 0.5. 2017-03-10 18:52 dezperado * [r1143] NEWS, src/FbiStuffPpm.cpp: fix: support for PPM files with 2 bytes per sample. (thanks to Zythyr for noticing the problem) 2017-03-06 23:48 dezperado * [r1142] src/fim_interpreter.cpp: Using C++11's "emplace_back" in one situation where it could speed up the code a tiny little bit. 2017-03-06 23:19 dezperado * [r1141] src/fim_wrappers.h: fim_malloc & similar wrappers to the header will now use std:: prefixed version (std::malloc). 2017-03-06 23:08 dezperado * [r1140] src/FbiStuff.cpp, src/FbiStuff.h, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffFbtools.cpp, src/FbiStuffGif.cpp, src/FbiStuffJasPer.cpp, src/FbiStuffLoader.cpp, src/FbiStuffPcx.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffText.cpp, src/FbiStuffTiff.cpp, src/FbiStuffUFRaw.cpp, src/FbiStuffXyz.cpp, src/FontServer.h, src/common.cpp, src/fim.h, src/fim_plugin.cpp: #include -> #include 2017-03-05 01:22 dezperado * [r1139] src/Browser.cpp, src/fim.h: in a FIM_WANT_PROGRESS_RECURSIVE_LOADING option (inactive) and future code to print a line when loading recursively directories in background (for future use). 2017-03-03 21:31 dezperado * [r1138] src/CommandConsole.cpp, src/Image.h, src/fimrc: Comments to console_scroll_down and console_scroll_up in the fimrc. Compacted a few iterator invocations in the Commandconsole. Using C++11 iterators cbegin()/cend() and auto. 2017-02-05 14:26 dezperado * [r1137] src/Browser.h: copy_from_bitset is now const and in C++11 mode uses cbegin()/cend() as well as emplace_back(). 2016-12-06 16:09 dezperado * [r1136] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp: limit '-set_union' will merge current limited list with the new one. doc fixes and moved some list managing code into flist_t implementation. 2016-12-05 22:24 dezperado * [r1135] NEWS, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp: limit '-merge' will merge current limited list with the new one. 2016-12-04 23:29 dezperado * [r1134] NEWS, src/Browser.h, src/CommandConsole-cmd.cpp, src/fim.h: brought "desc 'reload'" also to non-C++11 builds. 2016-12-04 17:16 dezperado * [r1133] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.h, src/CommandConsole-cmd.cpp, src/fim.cpp, src/fim.h: desc 'reload' loads once again description files specified at the command line with --load-image-descriptions-file (TODO: c++11 only for now). 2016-12-02 16:20 dezperado * [r1132] doc/fim.man, doc/fimrc.man, src/fim.h, src/help.cpp: In trunk and 0.5: fixed doc string of _info_fmt_str w.r.t. the EXIF_DateTimeOriginal example. 2016-11-27 20:46 dezperado * [r1131] NEWS, src/Browser.cpp, src/Browser.h, src/Image.h, src/fim.cpp: Won't check for duplicates on command line specified files unless sorting is requested. 2016-11-27 20:09 dezperado * [r1130] NEWS, src/Browser.cpp, src/Browser.h, src/fim.cpp: Won't check for duplicates on command line specified files. 2016-11-27 18:45 dezperado * [r1129] doc/fimrc.man, src/CommandConsole.cpp, src/Image.h: Typo fix in `limit' documentation. A few indentation steps + placeholder code in descriptions reading code. 2016-11-27 18:31 dezperado * [r1128] NEWS, src/Browser.h: `limit' optimization from r1127: was broken for non-C++11; fix. 2016-11-27 18:28 dezperado * [r1127] NEWS, src/Browser.cpp, src/Browser.h: Optimization: using the new flist_t::copy_from_bitset to speed up `limit'. 2016-11-27 16:50 dezperado * [r1126] Makefile.am, NEWS: Added a stand-alone `make ltests' goal to test fim' language only. 2016-11-27 16:38 dezperado * [r1125] src/CommandConsole-cmd.cpp, src/CommandConsole-var.cpp: Fix to incorrect using of at(), without previous lenght check. Used to break `make tests' 2016-11-27 12:42 dezperado * [r1124] NEWS, configure.ac: Fix to configure script regex_t check: was unnecessarily broken (both 0.5 and trunk). 2016-11-03 07:32 dezperado * [r1123] src/b2ba.c: This commit applies to 0.5-rc3 and trunk the patch https://anonscm.debian.org/git/collab-maint/fim.git/commit/?id=1a203628a9435209d21e067a651f2fbe3e4a9586 from Rafael Laboissiere, which has description "Description: Make the code robust to the system's endianness The code in src/b2ba.c was producing different results according to the system being little or big-endian. Indeed, the variable "byte" used for storing the value obtained by the read function must be exactly one-byte long, otherwise the printf command will output a "wrong" representation of the value in big-endian system (for instance "0x36000000" instead iof "0x36"). This wrong representation yielded compilation errors with g++ v6 in big-endian sytems when file + default_font_byte_array.h was included in FontServer.cpp." and solves Debian Bug#841471. 2016-11-02 21:17 dezperado * [r1122] src/Makefile.am: This commit applies to 0.5-rc3 and trunk the patch https://anonscm.debian.org/git/collab-maint/fim.git/commit/?id=9601783e07e8a8fe51402b255b300edb702e8dbb from Rafael Laboissiere, which has description "In src/Makefile.am, the rule for building yacc.tab.cpp contains also the target file yacc.tab.hpp. In cases where make is parellelized (for instance, by calling "make -j4"), this rule may cause nasty problems because it may be called twice, one with "-o yacc.tab.cpp" and the other with "-o yacc.tab.hpp", which yields a corrupt yacc.tab.hpp file. (See, for instance, this build log on armel: https://buildd.debian.org/status/fetch.php?pkg=fim&arch=armel&ver=0.5~rc2-2&stamp=1477910045). This patch makes yacc.tab.hpp a dependency of yacc.tab.cc, which seems to fix the problem." and fixes Debian Bug#842751. 2016-10-10 13:22 dezperado * [r1121] THANKS: Typo fix (e->a): Thanks go to Martin Klaiber for having made this emerge, as well as pointed out -P problems and framebuffer mode flickering. 2016-10-10 13:11 dezperado * [r1120] THANKS, src/FbiStuff.cpp: Including the header for va_list, va_arg, va_start, va_end, which was missing! Thanks go to Martin Kleiber for having made this emerge, as well as pointed out -P problems and framebuffer mode flickering. 2016-10-10 13:09 dezperado * [r1119] src/FramebufferDevice.cpp: Deactivating a clear_rect() which might have fixed a few cases where a clear screen seems missing, but also introduced flickering --- this has to be fixed differently than enabling this as done in r882. 2016-10-08 15:19 dezperado * [r1118] src/Cache.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-var.cpp: Adapted to compile with -pedantic-errors under Debian's g++ 4.7.2-5. 2016-10-08 14:32 dezperado * [r1117] src/CommandConsole-cmd.cpp, src/CommandConsole.cpp: Two changes to build under -std=c++11 -pedantic-errors in gcc-5.4.0. 2016-10-08 14:19 dezperado * [r1116] doc/fim.man, doc/fimrc.man, src/fim.h, src/help.cpp: Update to _filelistlen documentation. 2016-10-08 12:48 dezperado * [r1115] Makefile.am, media/numbers, media/numbers/0.gif, media/numbers/1.gif, media/numbers/2.gif, media/numbers/3.gif, media/numbers/4.gif, media/numbers/5.gif, media/numbers/6.gif, media/numbers/7.gif, media/numbers/8.gif, media/numbers/9.gif, src/testdir/Makefile, src/testdir/test17.in, src/testdir/test17.ok: Added in a list/limit commands test case (test17). Added also 10 gif files in media/numbers/ (0.gif to 9.gif) to serve test17. Adjusted the root Makefile to include in the dist also media/multipage. 2016-10-08 12:37 dezperado * [r1114] src/Browser.cpp, src/Browser.h: flist_t::erase_at_bitset was buggy in CXX11 mode: fix. 2016-09-30 23:55 dezperado * [r1113] NEWS, doc/fim.man, doc/fimrc.man, src/Image.cpp, src/SDLDevice.cpp, src/Viewport.cpp, src/fim.cpp: Fix to the -P/--text-reading switch (seems to be broken in version 0.5). 2016-09-30 21:22 dezperado * [r1112] NEWS, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/FbiStuff.cpp, src/FbiStuff.h, src/Image.cpp, src/Image.h, src/fim.h, src/grammar.h: "color 'identity'": populate the image with 'RGB identity' pixels. 2016-09-30 16:17 dezperado * [r1111] NEWS, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/Image.cpp, src/Image.h, src/fimrc, src/grammar.h: Now "color CVS" (CVS among 'protanopia', 'deuteranopia', 'tritanopia', 'p', 'd', 't') simulates a color vision deficiency. Adding 'daltonize' applies a tentative color correction. "color 'colorblind'" is short for "color 'deuteranopia'" (bound to key '['). Key ']' bound to "color 'colorblind' 'daltonize'". Introduced a pixel intensity floating point type alias (fim_pif_t). 2016-09-30 15:32 dezperado * [r1110] NEWS, doc/fimrc.man, src/Image.cpp: In the few past commits, forgot to update man page; also fixed an incorrectness in L,M,S computing in fim_simulate_cvd(). 2016-09-30 08:00 dezperado * [r1109] NEWS, src/Image.cpp: Roundoff filtering in the colorblind filter. 2016-09-30 07:39 dezperado * [r1108] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/Image.cpp, src/fim.h, src/fimrc: Removed commands 'negate' and 'desaturate'; use new command "color": "color 'negate'" and "color 'desaturate'". "color 'colorblind'" will simulate a Color Vision Deficiency. Bound to key 'J'. 2016-09-29 23:41 dezperado * [r1107] NEWS, src/Image.cpp, src/Image.h: Initiated code for simulating Color Vision Deficiency (using resources from http://www.daltonize.org). 2016-09-22 21:19 dezperado * [r1106] src/AADevice.h, src/FramebufferDevice.h, src/SDLDevice.h, src/fim.h: Declaring the overriding member functions of DisplayDevice as override. 2016-09-21 00:24 dezperado * [r1105] NEWS, src/AADevice.cpp, src/Cache.cpp, src/Cache.h, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/DisplayDevice.cpp, src/FbiStuffJasPer.cpp, src/FimWindow.cpp, src/FontServer.cpp, src/SDLDevice.cpp, src/common.cpp, src/fim.cpp, src/fim.h, src/fim_plugin.cpp, src/fim_string.cpp: If using C++11, will mark a number of "const" variables as "constexpr" instead (via FIM_CONSTEXPR). Changed DisplayDevice::get_bresults_string and DisplayDevice::quickbench a bit (twice the redraws now). NEWS file correction. 2016-09-20 21:58 dezperado * [r1104] NEWS, src/fim.cpp, src/fim.h: Language standard level (and a few features) will be enabled and set from the value of the predefined __cplusplus macro. 2016-09-20 21:36 dezperado * [r1103] src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.h: If using C++11, will mark a number of functions (not all the relevant ones, so far) as "noexcept". 2016-09-19 21:08 dezperado * [r1102] src/Var.h: Whoops: in the previous commit forgot to call std::string's shrink_to_fit on c++11 only ! fix. 2016-09-19 21:05 dezperado * [r1101] src/Image.h, src/Namespace.h, src/Var.h: It seems like one can gain back around 10% of memory from strings between capacity() and size() via the use of shrink_to_fit() (C++11 only). 2016-09-19 19:56 dezperado * [r1100] src/AADevice.cpp, src/AADevice.h, src/Arg.h, src/Browser.cpp, src/Browser.h, src/CACADevice.h, src/Cache.h, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DebugConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FimWindow.cpp, src/FimWindow.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Image.cpp, src/Image.h, src/Imlib2Device.cpp, src/Imlib2Device.h, src/Namespace.h, src/SDLDevice.cpp, src/SDLDevice.h, src/Var.cpp, src/Var.h, src/Viewport.cpp, src/Viewport.h, src/common.cpp, src/common.h, src/fim.cpp, src/fim.h, src/fim_interpreter.cpp, src/fim_string.cpp, src/fim_string.h: Enforcing the reference '&' just right of the type (no spaces inbetween), and one space before the identifier. for w in nodeType string MiniConsole key_type FimWindow port stream Var MiniConsole CommandConsole Image fim_fn_t fid_t Cache Arg args_t fim_bitset_t Browser ; do sed -i s/$w' & */'$w'\& /g' src/*cpp src/*.h done sed -i 's/-20.. Miche/-2016 Miche/g' `svn diff | grep Index | cut -d \ -f 2 ` 2016-09-19 17:17 dezperado * [r1099] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/Image.cpp, src/fim.cpp, src/fim_string.cpp: Improving the style of a few expressions, saving a few ctor's, nothing relevant. 2016-09-19 00:19 dezperado * [r1098] src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/FimWindow.cpp, src/FimWindow.h, src/fim.h: Introduced typedef / type alias fim_cxr for fim::string in return arguments from fcmd_* member functions (not their internals y et so far). The variable limiting message is now more informative. 2016-09-18 23:06 dezperado * [r1097] NEWS, src/fim.cpp: If compiled without --enable-c++11, -B / --background-recursive will behave as -R. 2016-09-18 22:51 dezperado * [r1096] doc/fim.man, src/Command.h, src/CommandConsole.cpp, src/CommandConsole.h: sed -i 's/fim_cls_id/fim_cls/g' src/*.h src/*.cpp 2016-09-18 22:49 dezperado * [r1095] src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/CommandConsole.h, src/Image.cpp, src/Image.h, src/Namespace.cpp, src/Namespace.h, src/fim.h: Widening the use of the fim_fn_t typedef / type alias. 2016-09-18 21:58 dezperado * [r1094] src/Command.h, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/FimWindow.cpp, src/Namespace.cpp, src/Namespace.h: Introduced two typedefs / aliases for fim::string: fim_cmd_id (command id) and fim_cls_id (command line statement). Began their diffusion in the code. 2016-09-18 20:15 dezperado * [r1093] src/CommandConsole-var.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/Namespace.cpp, src/Namespace.h, src/Var.h: Abandoning fim::string in favour of fim_var_id for fim::Namespace-related fim language variable identifiers. 2016-09-18 18:49 dezperado * [r1092] src/Browser.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/fim.cpp: Tidying up CommandConsole::get_reference_manual. Removed useless spurious "using" declarations from fim.cpp. A few shorter usage forms in Browser.cpp and CommandConsole-cmd.cpp. 2016-09-18 16:52 dezperado * [r1091] src/Browser.cpp, src/CommandConsole-var.cpp, src/CommandConsole.cpp, src/Var.cpp, src/Viewport.cpp, src/defaultConfiguration.cpp: Using braced initializers (C++11) in a few places where this clarifies the code. 2016-09-18 10:32 dezperado * [r1090] configure.ac, src/fim.h: The configure will now set a FIM_USE_CXX_STD with a language standard level (instead of FIM_USE_CXX11 and FIM_USE_CXX14). 2016-09-18 09:53 dezperado * [r1089] src/fim_string.cpp, src/fim_string.h: Moved current code up, dead code down in fim's string sources. 2016-09-18 09:39 dezperado * [r1088] src/fim_string.cpp: Switching to use std::to_string instead of snprintf() when in C++-11 mode. 2016-09-18 08:56 dezperado * [r1087] src/DebugConsole.cpp, src/DebugConsole.h: Revision r1085 had broke C++11 build: forgot to delete now useless DebugConsole copy constructor body. 2016-09-18 08:47 dezperado * [r1086] src/Arg.h, src/Browser.h, src/Cache.h, src/Image.cpp, src/Image.h, src/Var.h, src/Viewport.cpp, src/Viewport.h, src/fim_string.cpp, src/fim_string.h: Switching to the convention of using 'rhs' for the argument of assignment operators (operator=) and copy constructors. 2016-09-17 22:55 dezperado * [r1085] src/Browser.h, src/Cache.h, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.h: When in C++11, delete'ing a few "operator=" and copy constructor member functions among Browser, Cache, CommandConsole, DebugConsole. 2016-09-17 22:46 dezperado * [r1084] configure.ac, src/common.cpp: Experimental flag to enable C++14 constructs. Return type inference could be useful in a few places; this is just an example reminder about it. 2016-09-17 21:44 dezperado * [r1083] src/Cache.h, src/Image.h, src/Namespace.h, src/fim_types.h: When compiling as C++11, replacing typedefs with alias declarations. This leaves the code ready for templatization, supported by alias declarations, and when adopting C++14 in the future, even transformations as std::remove_const::type, std::remove_reference::type, std::add_lvalue_reference::type, will be usable. 2016-09-16 11:27 dezperado * [r1082] src/DisplayDevice.cpp: Ooops: removing spurious comment leftover. 2016-09-16 11:27 dezperado * [r1081] configure.ac, doc/fim.man, src/Browser.cpp, src/DisplayDevice.cpp, src/fim.cpp: A configure check and a placeholder for getdate(). A few entries in the man page. Type correctness for read()'s ssize_t. 2016-09-16 09:02 dezperado * [r1080] src/Browser.cpp, src/CommandConsole.cpp, src/Viewport.cpp: A few cleaner practices when dealing with strings coming from temporary string's obtained from Var's. 2016-09-15 23:58 dezperado * [r1079] NEWS, doc/fim.man, src/Browser.cpp, src/Image.cpp, src/Image.h, src/fim.cpp: Introduced a "#!fim:/=dir" special description line to specify dir prepended to basename. Introduced a "#!fim:\=dir" special description line to specify dir prepended to filepath. 2016-09-15 21:48 dezperado * [r1078] NEWS, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/Image.h, src/Namespace.h: limit '-list' will list existing variables identifiers as set via 'desc'. limit '-list' 'id' will list existing values for instances of variable 'id' as set via 'desc'. 2016-09-15 18:12 dezperado * [r1077] src/Browser.cpp, src/CommandConsole-var.cpp, src/CommandConsole.h, src/Image.h, src/Namespace.cpp, src/Namespace.h, src/Var.h, src/fim_string.h: Added a few overloads and methods to Var and Namespace in order to be able to avoid the many .c_str()'s in the code. 2016-09-15 16:20 dezperado * [r1076] NEWS, src/Browser.cpp, src/Browser.h, src/CommandConsole-var.cpp, src/DebugConsole.cpp, src/DisplayDevice.cpp, src/FbiStuff.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffText.cpp, src/FimWindow.cpp, src/FramebufferDevice.cpp, src/Image.cpp, src/common.cpp, src/fim.cpp, src/fim_string.cpp: Misc fixes of minor things causing compile warnings (mostly in trunk, a few in 0.5). 2016-09-15 16:03 dezperado * [r1075] NEWS, src/Image.cpp: fix: was likely using uninitialized data in Image(). applying to 0.4, 0.5, trunk. 2016-09-15 15:26 dezperado * [r1074] NEWS, src/FbiStuffPcx.cpp: fix: a few more checks when reading PCX files (in both 0.5 branch and trunk). 2016-09-15 15:21 dezperado * [r1073] NEWS, src/AADevice.cpp: bugfix: a function in AADevice was missing return value (in both 0.5 and trunk). 2016-09-14 14:29 dezperado * [r1072] NEWS, doc/fimrc.man, src/Image.cpp, src/fim.h, src/help.cpp: Documented the %k expando for _info_fmt_str (like in the previous commit fixing %k, also in both trunk and 0.5 branch). 2016-09-14 14:14 dezperado * [r1071] NEWS, src/Image.cpp: bugfix: avoiding data corruption when handling the %k expando. 2016-09-13 22:37 dezperado * [r1070] NEWS, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp: No-argument versions of ~z and ~d: on '~z' will limit to files having the current file's size; on '~d' will limit to files having the current file's date +- one day. 2016-09-13 21:45 dezperado * [r1069] NEWS, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp: Added "DD/MM/YYYY" as a date specification format to "~d" "[MINTIME][-][MAXTIME]". Related doc fixes. 2016-09-13 19:34 dezperado * [r1068] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp: Added limiting on list indices: "limit '~i' MINIDX[-MAXIDX]". 2016-09-13 17:14 dezperado * [r1067] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp: Limiting / marking based on stat() info: time and size: "limit '~z' MINSIZE[-MAXSIZE]", with MINSIZE and MAXSIZE numbers with eventually K or M, will act according to filesize. "limit '~d' MINTIME[-MAXTIME]", with MINTIME and MAXTIME numbers, will act according to file modify date. 2016-09-13 14:46 dezperado * [r1066] src/Browser.cpp, src/Browser.h, src/common.cpp: Small improvements: error diagnostics of write_to_file, diagnostics of do_filter_cmd, avoiding compilation warnings due to a few unused variables or labels. 2016-09-13 08:40 dezperado * [r1065] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/fim.h: Now "limit '-refine' ..." will make 'limit' act on the current list, rather than on the full anew. 2016-09-13 07:50 dezperado * [r1064] src/Browser.cpp, src/Browser.h: Using a few C++11 and other constructs to improve code readability in Browser. 2016-09-12 21:40 dezperado * [r1063] NEWS, src/Browser.cpp, src/Browser.h: Command "list 'mark' {args}" accepts now exactly what "limit {args}" does. 2016-09-12 20:42 dezperado * [r1062] NEWS, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp: '~1' -> '~^' in limit's documentation "if with '~^', to the first of the files with duplicate basename". 2016-09-12 20:37 dezperado * [r1061] src/Browser.cpp, src/Browser.h: Introduced a class fim_bitset_t:public std::vector to deal with selections/limiting/etc in a cleaner way. Introducing this into Browser::do_filter. Further functions to be impacted soon. 2016-09-12 14:51 dezperado * [r1060] src/Browser.cpp, src/Browser.h, src/CommandConsole-init.cpp, src/DisplayDevice.cpp: Making Browser also extend Benchmarkable and its benchmark being invoked by --sanity-check. Minimal changes in DisplayDevice and CommandConsole benchmark code messages. 2016-09-12 14:01 dezperado * [r1059] NEWS, doc/fim.man, src/fim.cpp: Doc fix: stating that --sanity-check terminates the program, rather than continuing. 2016-09-12 13:54 dezperado * [r1058] src/Browser.cpp, src/Browser.h: A few little amendments to flist_t. 2016-09-12 13:39 dezperado * [r1057] src/Browser.cpp, src/Browser.h: Moved a data member: Browser::cf_ -> flist_t::cf_. 2016-09-12 08:00 dezperado * [r1056] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp: New criteria for the "limit" command: If invoked with '~!' will restrict to files with unique basename. If with '~=', to files with duplicate basename; if with '~1', to the first of the files with duplicate basename; if with '~$', to the last of the files with duplicate basename. 2016-09-11 20:20 dezperado * [r1055] src/SDLDevice.cpp: Fix: The FIM_SDL_INPUT_DEBUG (off by default) was casting to *fim_int rather than to *fim_key_t. This is wrong since 0.5, where the two types can be much different. 2016-09-03 14:17 dezperado * [r1054] doc/fimrc.man, src/fimrc: Example in imposing a file loader to an extension (with MatrixMarket to *.mtx.gz). 2016-09-03 14:11 dezperado * [r1053] NEWS, doc/fimrc.man, src/CommandConsole-init.cpp, src/FbiStuffLoader.cpp, src/FbiStuffLoader.h, src/fim.h, src/help.cpp: Added variable _all_file_loaders: space-separated list of hardcoded file loaders usable with _file_loader. 2016-09-03 13:43 dezperado * [r1052] NEWS, doc/fim.man, src/fim.cpp: A refinement to the previous commit: now optional -R/--recursive[=arg] argument, overwrites (if set) or appends to (if beginning with + or |) the "_pushdir_re" variable (recursed filename extensions). 2016-09-02 15:47 dezperado * [r1051] NEWS, doc/fim.man, src/fim.cpp: Optional -R/--recursive[=arg] argument, overwrites "_pushdir_re" variable (recursed filename extensions). 2016-08-31 22:35 dezperado * [r1050] NEWS, src/fim.h: Documented presence of 'desc' "-nooverw" "-append" for "desc save"'.. 2016-08-31 22:25 dezperado * [r1049] src/CommandConsole-cmd.cpp: in a few new tests. 2016-08-31 21:57 dezperado * [r1048] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/fim.h: 'desc "-append" "save"' will work in append mode. 2016-08-31 21:47 dezperado * [r1047] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/fim.h: 'desc "-all" "save"' will save also all descriptions file variables. 2016-08-31 21:02 dezperado * [r1046] NEWS, doc/fim.man, src/fim.cpp: Documenting in the man page and NEWS file the "#!fim:^=" and "#!fim:+=" special description lines. 2016-08-31 20:54 dezperado * [r1045] doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/Image.h, src/fim.cpp: Introduced a "#!fim:!=" special description line to reset all variables of the cached namespace. Using it in the yet not active "desc 'save'" subcase. 2016-08-31 19:53 dezperado * [r1044] NEWS, src/Browser.cpp, src/Namespace.cpp, src/Namespace.h: functionality to save also all descriptions file variables; still non active by default. 2016-08-31 15:53 dezperado * [r1043] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/Image.h, src/common.cpp, src/common.h, src/fim.h: 'desc "save"' functionality to save descriptions file data from the currently browsable images list. Revamped append_to_file and renamed to write_to_file. Consequent Man/doc page update. 2016-08-25 21:12 dezperado * [r1042] src/Image.cpp, src/Image.h: Two comments and a () -> (void) 2016-08-25 20:59 dezperado * [r1041] src/FbiStuffJpeg.cpp: Using a new FIM_JPEGLIB_TRUE instead of FIM_FBI_TRUE in FbiStuffJpeg.cpp to make sure that jpeglib.h's routines get the right '1' as 'boolean'. 2016-08-25 09:24 dezperado * [r1040] Makefile.am, TODO: In all branches and trunk: sed -i s/EF1258B8/0xE0E669C8EF1258B8/g trunk/Makefile.am trunk/TODO branches/*/Makefile.am branches/*/TODO 2016-08-24 23:31 dezperado * [r1039] NEWS, doc/vim2html.pl, src/Makefile.am: To ease reproducible builds: imposing LC_ALL=C to $(YACC) and $(SORT), vim2html.pl reads SOURCE_DATE_EPOCH. Applies to trunk and 0.5-rc3. Following Alexis Bienvenüe's recommendation attached as a patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820932 Only one recommendation of him has not been implemented yet: removal of __DATE__ use) and left for later. 2016-08-24 23:05 dezperado * [r1038] NEWS, configure.ac, src/FbiStuffPcx.cpp: fix: when stdint.h is available use uint8_t, uint16_t, uint32_t instead of non-portable __u8, __u16, __u32. pertains branches/0.5 and trunk. 2016-08-24 22:34 dezperado * [r1037] NEWS, src/FbiStuffPcx.cpp: fix: ./configure --disable-pcx was not properly disabling PCX format support. this pertains branches/0.5 and trunk. 2016-08-24 22:20 dezperado * [r1036] NEWS, src/FramebufferDevice.h: fix: compilation was broken without framebuffer (FIM_WITH_NO_FRAMEBUFFER) because of dependency in FbiStuffJpeg.cpp; this pertains branches/0.5 and trunk. 2016-06-04 14:18 dezperado * [r1035] NEWS, doc/fim.man, src/Browser.cpp, src/Browser.h, src/fim.cpp, src/fim.h: Introduced --mark-from-image-descriptions-file: read file names from a description file and use them to mark current list files. 2016-05-31 20:19 dezperado * [r1034] doc/FIM.TXT: s/_prefetch/_want_prefetch/g in branches-0.3 and trunk, in the FIM.TXT file. 2016-05-31 20:00 dezperado * [r1033] doc/fim.man, doc/fimrc.man, src/fim.h: 'list' help message adjustment, in both fim-0.5-rc3 and trunk. 2016-05-10 08:40 dezperado * [r1032] src/fim_wrappers.h: Comment about bzero (legacy since POSIX.2001 and deprecated since POSIX.2004). 2016-03-17 23:10 dezperado * [r1031] doc/fim.man, doc/fimrc.man, src/fimrc: adjusting the '*' binding: will display the console in any case now. 2016-03-17 23:00 dezperado * [r1030] NEWS, src/Image.h, src/common.cpp, src/common.h: fix: introduced alphanumeric restriction in the shebang variables (must begin with underscore or alphabetic, continue with underscore or alphanumeric). 2016-03-14 10:17 dezperado * [r1029] src/CommandConsole-init.cpp: fix: compilation was broke without FIM_WITH_LIBSDL configured in. in trunk and branches/0.5. 2016-03-06 14:30 dezperado * [r1028] NEWS, src/defaultConfiguration.cpp: Oops: forgot a "+1" in r1025. bugfix. (trunk and branches/0.5) 2016-03-06 13:54 dezperado * [r1027] NEWS, doc/fim.man, src/fimrc: Keys '(' and ')' are now bound respectively to "goto '^p'" and "goto '$p'"; that is jump to first or last page (of a multipage document). 2016-03-06 13:44 dezperado * [r1026] NEWS, doc/fim.man, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole.cpp: Available symkeys are now documented in a section of man fimrc. 2016-03-06 13:32 dezperado * [r1025] NEWS, doc/fim.man, doc/fimrc.man, src/defaultConfiguration.cpp: fix: cleaned up the internal keysyms initialization code. (in both trunk and 0.5-rc3). 2016-03-06 12:10 dezperado * [r1024] src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole.h: Changed the signature of CommandConsole::do_dump_key_codes to support multiple output modes. 2016-03-06 11:29 dezperado * [r1023] NEWS, doc/fim.man, doc/fimrc.man, src/fim.cpp, src/fim.h: documentation consistency fix: command line option --sort-mtime was annotated/documented as --sort-mdate in several places (same with "list 'sort_mtime'"). 2016-03-06 11:20 dezperado * [r1022] src/CommandConsole-cmd.cpp: invoking CommandConsole::kstr_to_key from fim::string CommandConsole::fcmd_bind. 2016-03-06 11:12 dezperado * [r1021] NEWS, doc/fim.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.cpp, src/fim.h: added switch --keysym-press to execute simulated press of keysym at startup. 2016-03-06 10:03 dezperado * [r1020] NEWS, doc/fim.man, doc/fimrc.man, src/fim.cpp: Documented command line switches -/ and --// . 2016-03-05 00:25 dezperado * [r1019] NEWS, configure.ac, src/Browser.cpp, src/Browser.h: configure check and (for now, off) preliminary support for the Linux calls glob, fnmatch, wordexp. 2016-03-01 18:10 dezperado * [r1018] NEWS, doc/fim.man, doc/fimrc.man, src/fim.cpp, src/fim.h: Added command line switch -/ as short for -c / . Added command line switch --// as short for -c / with _re_search_opts='f' . 2016-03-01 18:09 dezperado * [r1017] src/Browser.cpp: Fix: with _re_search_opts='f' the in-descriptions search was broken, now it's fine. In the long run need a uniform decision on whether comments are to be accessed by full path or basename. Fix applies both of (unreleased) 0.5-rc3 and 0.6-trunk. 2016-03-01 17:41 dezperado * [r1016] src/common.cpp, src/common.h: fim_shell_arg_escape has arg not to quote, optionally. 2016-02-29 23:44 dezperado * [r1015] NEWS, doc/fimrc.man, src/Browser.cpp, src/fim.h: will emit a status message when limiting long lists. reference to the _lastgotodirection and _re_search_opts variables for the goto command. 2016-02-29 22:57 dezperado * [r1014] NEWS, doc/fimrc.man, src/fimrc: Default key for 'scrollforward' is now space (' ') instead of 's'. 2016-02-28 11:13 dezperado * [r1013] NEWS, src/Image.h, src/fim.h: Introduced context prepend/append shebang syntax "#!fim:^=" and "#!fim:+=" in description files. 2016-02-27 12:48 dezperado * [r1011] NEWS, doc/fimrc.man, src/FimWindow.cpp, src/fim.h: fix: removed obsolete documentation for the "window" command, now (actually, since a long while) disabled. 2016-02-27 11:26 dezperado * [r1010] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/fim.h: introduced the 'list "swap"' command. 2016-02-27 11:02 dezperado * [r1009] NEWS, src/CommandConsole.cpp, src/CommandConsole.h: bugfix: repeating "recording 'repeat_last'" (default '.' key) by prepending a number now works. applies to both 0.5 and trunk. 2016-02-27 09:54 dezperado * [r1008] NEWS, configure.ac, doc/fim.man, src/common.cpp, src/common.h, src/fim.cpp, src/fim.h: Switch --read-from-stdin-elds accepts now the ASCII NUL as well (via ''). Relying on getdelim (for fim_getline): configure check for it. fim_getline has a fourth argument --- the delimiter. The delimiter is now a character, not anymore a string. Dox update. Thanks to Christian Kalkhoff for suggesting support for a ASCII NUL line terminator. 2016-02-25 23:50 dezperado * [r1007] NEWS, src/fim.cpp: switch -V (--version) will print out libspectre version info. 2016-02-25 23:41 dezperado * [r1006] NEWS, doc/fim.man, doc/fimrc.man, src/FbiStuffLoader.cpp, src/FbiStuffLoader.h, src/fim.cpp: switch -V (--version) will print to stdout (not anymore to stderr). dox rebuild. 2016-02-25 23:09 dezperado * [r1005] src/CommandConsole-help.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/FbiStuff.cpp, src/FimWindow.h: Further "method" -> "member function" corrections (in the C++ standard there is no such a thing as "method"...). 2016-02-24 17:58 dezperado * [r1004] NEWS, src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h: Introduced 'list "dumpmarked"' and 'list "unmarkall"' commands, as well as CommandConsole::marked_files_clear(). 2016-02-24 17:34 dezperado * [r1003] NEWS, doc/fim.man, src/fim.cpp: The -B switch is now short for --background-recursive. Docs update. 2016-02-24 17:27 dezperado * [r1002] NEWS, doc/fim.man, src/fim.cpp: The -S switch is now short for --image-descriptions-file-separator (not anymore for --sanity-check). Doc update. 2016-02-24 17:18 dezperado * [r1001] NEWS, doc/FIM.TXT, doc/fim.man, src/fim.cpp: The -D switch is now short for --load-image-descriptions-file (not anymore for --dump-default-fimrc). 2016-02-24 17:06 dezperado * [r1000] NEWS, doc/fim.man, src/fim.cpp: The -L option will be an alias for --read-from-file. with doc update. 2016-02-24 16:59 dezperado * [r999] NEWS, doc/fim.man, doc/fimrc.man, src/fim.cpp: Introduced --read-from-file switch: read an image list from file (just as the - switch). With doc update. 2016-02-24 16:35 dezperado * [r998] src/fim.cpp: In a fim_load_filelist function; for now it is used to load an images list from stdin. 2016-02-18 21:56 dezperado * [r997] configure.ac: configure will autodetect and turn aalib on by default. (now in trunk as in 0.5 one commit ago) 2016-02-16 14:34 dezperado * [r995] debian/watch: corrected the debian/watch file by removing the old "http://code.autistici.org/svn/fim/" entry. 2016-02-16 11:08 dezperado * [r994] src/fim_interpreter.h: svn ps svn:keywords LastChangedDate src/fim_interpreter.h 2016-02-15 23:50 dezperado * [r993] src/fim.h: Corrected the contents of the FIM_DDN_VARS_IN symbol (in 0.5-rc2 and trunk). 2016-02-15 23:36 dezperado * [r992] src/CommandConsole-init.cpp, src/fim.h: Will emit more precise diagnostics on unsupported device string. (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814673) In both trunk and 0.5-rc2 2016-02-15 23:19 dezperado * [r991] src/CommandConsole-init.cpp: Will emit a specific message if the specified output device has been disabled at buil time. (trunk and 0.5). 2016-02-14 19:33 dezperado * [r990] configure.ac, src/fim.h: Adjusted the configure script to better tolerate missing `svnversion` and set the SVN_REVISION and SVN_REVISION_NUMBER symbols consequently. Also removed the (int) cast before FIM_REVISION_NUMBER. This applies to both the trunk and 0.5 branches. 2016-02-13 17:13 dezperado * [r989] src/fim_interpreter.cpp, src/fim_interpreter.h, src/yacc.ypp: Moved part of the implementation of yacc.ypp into fim_interpreter.cpp. 2016-02-13 16:27 dezperado * [r988] src/Makefile.am, src/yacc.ypp: Makefile and including file adjustments to the previous two commits (interpreter.cpp -> fim_interpreter.cpp, interpreter.h -> fim_interpreter.h). 2016-02-13 16:24 dezperado * [r987] src/fim_interpreter.h, src/interpreter.h: svn mv svn+ssh://dezperado@svn.savannah.nongnu.org/fbi-improved/trunk/src/interpreter.h svn+ssh://dezperado@svn.savannah.nongnu.org/fbi-improved/trunk/src/fim_interpreter.h 2016-02-13 16:23 dezperado * [r986] src/fim_interpreter.cpp, src/interpreter.cpp: svn mv svn+ssh://dezperado@svn.savannah.nongnu.org/fbi-improved/trunk/src/interpreter.cpp svn+ssh://dezperado@svn.savannah.nongnu.org/fbi-improved/trunk/src/fim_interpreter.cpp 2016-02-13 16:15 dezperado * [r985] src/fim_types.h, src/interpreter.cpp, src/interpreter.h, src/yacc.ypp: Introducing macros to simplify/reoder the interpreter and parser code. Adding in an 'interpreter.h' file for this purpose. 2016-02-11 17:35 dezperado * [r984] src/interpreter.cpp: (further) first steps in generalising the interpreter code. 2016-02-10 23:26 dezperado * [r983] src/interpreter.cpp: first steps in generalising the interpreter code. 2016-02-10 23:11 dezperado * [r982] src/interpreter.cpp: introduced the FIM_NO_BREAK and FIM_OPRND macros to make the code slimmer. replacing plain 'int' occurrences with 'fim_int' where necessary. 2016-02-10 22:49 dezperado * [r981] src/interpreter.cpp, src/lex.h: Cleaning up the interpreter code a little bit. 2016-02-04 22:46 dezperado * [r980] doc/fimrc.man, src/CommandConsole-help.cpp, src/Var.cpp: Correcting the man pages in terms of roff consistency: disabling output-line adjusting and inserting zero-width break point on long hardcoded regexps. This will avoid the errors encountered when man --html=cat (man 2.6.2). Advancing version to 0.5-rc1 to 0.5-rc2. Change applies to trunk and 0.5-rc2 2016-02-04 18:53 dezperado * [r979] debian/control, doc/fim.man, doc/fimrc.man, src/fimrc: Addressing lintian diagnostics: I: fim: spelling-error-in-manpage usr/share/man/man5/fimrc.5.gz catched caught W: fim: description-synopsis-starts-with-article 2016-02-04 17:19 dezperado * [r978] debian/control: Adjusted the debian/control text a bit. 2016-02-04 16:58 dezperado * [r977] debian/control: Updated the debian/control text and removed typos. 2016-02-04 16:45 dezperado * [r976] debian/changelog, debian/control, debian/copyright, debian/rules: replaced the old debian/* files with the ones kindly provided by Gianfranco Costamagna. 2016-02-04 15:27 dezperado * [r975] doc/fim.man, src/fim.cpp: HDF5 dataset visualization example (with h5topng) using fim in man fim. 2016-02-02 22:48 dezperado * [r974] src/Namespace.cpp, src/Namespace.h: :%s/FIM_INDIPENDENT_NAMESPACE/FIM_INDEPENDENT_NAMESPACE/g 2016-02-02 18:29 dezperado * [r973] NEWS, doc/fim.man, doc/fimrc.man, src/fim.cpp: --recursive-background -> --background-recursive 2016-02-02 18:17 dezperado * [r972] src/Image.cpp: Got rid of obsolete FIM_WANT_BACKGROUND_LOAD code sections in src/Image.cpp. 2016-02-02 18:00 dezperado * [r971] NEWS, doc/fim.man, doc/fimrc.man, src/Cache.cpp, src/fim.h, src/fimrc, src/help.cpp: introduced new variable _cache_control to control the cache mechanism. now caching of mipmaps on by default; can be turned off with _cache_control. 2016-02-01 22:14 dezperado * [r970] src/Image.cpp, src/Image.h: Image::shred is out of the destructor now. 2016-01-31 00:12 dezperado * [r969] doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/fim.h, src/help.cpp: During the background loading the (new) _loading_in_background variable will be set to 1. dox update. 2016-01-30 23:21 dezperado * [r968] src/CommandConsole.cpp: In r965:966 accidentally introducing an erase of the in-load filenames. fix. 2016-01-30 22:08 dezperado * [r967] src/CommandConsole.h: Oops: spurious 'static' keyword in previous commit. 2016-01-30 22:02 dezperado * [r966] src/CommandConsole.cpp, src/CommandConsole.h: background loader thread and file names pointers vector are now private members of CommandConsole. 2016-01-30 21:50 dezperado * [r965] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/fim.h, src/help.cpp: if _push_pushes_dirs is 2, will also push hidden files and directories; that is, ones whose names begin with a dot (.). docs update. 2016-01-30 21:07 dezperado * [r964] NEWS, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.h: Implemented synchronization (thread join) at program termination with --recursive-background. 2016-01-30 20:44 dezperado * [r963] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.cpp: If configure'ing with --enable-c++11, the --recursive-background switch will load images in the background recursively, allowing viewing in the order they appear. So far synchronization during loading and at program termination are missing. 2016-01-30 15:39 dezperado * [r962] Makefile.am: `make help` message update. 2016-01-30 15:13 dezperado * [r961] NEWS, configure.ac, src/Browser.cpp: renamed configure switch --enable-cxx11 to --enable-c++11. got rid of a spurious print message. 2016-01-30 14:56 dezperado * [r960] src/CommandConsole.cpp: Using a cleaner way to set g:_rows (and avoiding crashes in -t /-o aa mode). 2016-01-30 14:22 dezperado * [r959] src/Makefile.am: fix: enabled concurrent make, e.g.: make -j 4. 2016-01-30 13:59 dezperado * [r958] doc/fim.man, doc/fimrc.man, src/fimrc: bug workaround: had no console scroll if no command executed on PostInteractiveCommand. 2016-01-30 12:18 dezperado * [r957] src/Browser.cpp, src/SDLDevice.h: Bugfix: in r950 was using getIntVariable instead of getGlobalIntVariable. This used to break post-scroll console refresh. 2016-01-30 02:06 dezperado * [r956] src/Cache.cpp, src/FbiStuff.cpp, src/Image.cpp, src/fim.h: simplifying the FbiStuff::fim_mipmaps_compute(fimg_,&mm_) contained checks. 2016-01-29 17:53 dezperado * [r955] NEWS, doc/fim.man, doc/fimrc.man, src/Image.cpp, src/fim.h, src/help.cpp: new variable i:_file_load_time will store the time taken to load the file and decode the image. 2016-01-29 16:23 dezperado * [r954] configure.ac, doc/fim.man, doc/fimrc.man, src/common.cpp: fix: some systems don't have sys_errlist: using strerror there. 2016-01-29 16:15 dezperado * [r953] NEWS, doc/fimrc.man, src/FbiStuff.cpp, src/fim.h, src/help.cpp: _use_mipmaps=2 will compute the mipmaps faster, using every fourth source pixel. This can be a good solution for photographs. 2016-01-29 09:06 dezperado * [r952] src/FbiStuff.cpp: bugfix: off-bounds reads in the new mipmap code. 2016-01-28 23:37 dezperado * [r951] src/Image.h: fixed an error "cannot convert 'std::basic_istream' to 'bool' in initialization" from (std::getline(ls,ds,nl)) when compiling with -std=c++11 and g++-5.3. 2016-01-28 17:21 dezperado * [r950] doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/fim.h, src/help.cpp: if _want_prefetch is 2 (and configured with --enable-cxx11) will load in the background. changed Browser::last_src_dir_ from int to fim_int. dox update. 2016-01-28 16:42 dezperado * [r949] src/Cache.cpp, src/FbiStuff.cpp, src/FbiStuff.h, src/Image.cpp, src/Image.h, src/fim.h: sed -i s/FIM_WANT_EXPERIMENTAL_MIPMAPS/FIM_WANT_MIPMAPS/g `grep FIM_WANT_EXPERIMENTAL_MIPMAPS src/*h src/*cpp -l` 2016-01-28 16:38 dezperado * [r948] NEWS, src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/Cache.h, src/Viewport.cpp, src/fim.h: If configure'ing with --enable-cxx11, background image loading will be available. Early version: need to handle failed loads and a controlling variable. 2016-01-28 16:36 dezperado * [r947] NEWS, src/FbiStuff.cpp: mipmap computing (controlled by _use_mipmaps) is now faster. 2016-01-25 16:54 dezperado * [r946] doc/fimrc.man, src/fim.h, src/help.cpp: Man page fix. 2016-01-25 16:51 dezperado * [r945] NEWS, src/FontServer.h, src/SDLDevice.cpp: Oops: last commit had bug with --with-font-magnifying-factor=FACTOR and negative FACTOR. fix. 2016-01-25 16:33 dezperado * [r944] NEWS, configure.ac, doc/fimrc.man, src/CommandConsole.cpp, src/FontServer.cpp, src/FontServer.h, src/FramebufferDevice.cpp, src/SDLDevice.cpp, src/fim.h, src/help.cpp: Run time control of the font magnifying factor, either at build time with --with-font-magnifying-factor=FACTOR or at runtime when FACTOR is<1 and a factor is specified with the _fbfont_magnify_factor variable. Overall default is 1. 2016-01-25 08:30 dezperado * [r943] src/FramebufferDevice.cpp: Ooops: typo fix. 2016-01-22 16:12 dezperado * [r942] NEWS, configure.ac, src/FontServer.h, src/FramebufferDevice.cpp, src/fim.h: The new --with-font-magnifying-factor=FACTOR option will render text magnified by (hardcoded) FACTOR times. Useful with very high resolutions and small fonts. 2016-01-21 21:20 dezperado * [r941] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.h, src/CommandConsole.cpp, src/CommandConsole.h, src/FbiStuff.cpp, src/fim.h: Description files beginning with "#!fim:desc" (whatever extension) can now be detected and loaded as they were normal image files (FIXME: undocumented). 2016-01-21 21:12 dezperado * [r940] NEWS, src/common.cpp: fix: no zlib.h build time dependency (this will be reintroduced in the future). 2016-01-21 21:00 dezperado * [r939] configure.ac: At the end of the configure will display yes/no whether libexif is in. Also added 'uncompressed' next to 'psf' to clarify a configure switch option. 2016-01-21 20:28 dezperado * [r938] NEWS, configure.ac: Commented in the configure about the ghost-feature (or non feature) behind --enable-unicode. 2016-01-21 20:12 dezperado * [r937] NEWS, doc/fim.man, src/fim.cpp, src/fim.h: Corrected the quiet mode (-q) to be quieter. 2016-01-20 17:23 dezperado * [r936] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.h, src/fim.cpp: Added a --reverse option to reverse files list before browsing. According documentation updates. 2016-01-20 17:03 dezperado * [r934] src/Browser.cpp: Using pass by const reference in the operator() member functions of the sort predicates. 2016-01-20 16:32 dezperado * [r933] Makefile.am, NEWS, doc/fim.man, src/Browser.cpp, src/Browser.h, src/fim.cpp, src/fim.h: Added --sort-mtime to sort file list according to modification time. Added --sort-fsize to sort file list according to file size. To list command added subcommand 'sort_mtime' to sort file list according to modification time. To list command added subcommand 'sort_fsize' to sort file list according to file size. These changes required introduction of two new classes: 'flist_t' and 'fle_t'. Makefile.am fix (# comment used to break autogen.sh). 2016-01-19 21:24 dezperado * [r932] doc/fimrc.man, src/fimrc: assigned the '*' key to displaying all the image variables, with "toggleVerbosity;echo i:*". 2016-01-19 00:22 dezperado * [r931] NEWS, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/fim.h, src/fimrc, src/help.cpp: key Enter will now mark and then go forward or back according to _lastgotodirection. 2016-01-18 10:33 dezperado * [r930] Makefile.am, NEWS, var/Makefile: 0.5 NEWS cleanup and minor www oriented Makefile changes. 2016-01-18 08:58 dezperado * [r929] VERSION, configure.ac: labeling the branch version as 0.5-rc0 and the trunk version as 0.6 trunk. 2016-01-18 07:47 dezperado * [r927] VERSION, configure.ac, doc/fim.man, src/fim.cpp: Let this be a first candidate for 0.5-rc0. 2016-01-18 07:24 dezperado * [r926] NEWS, doc/fim.man, doc/fimrc.man, src/fim.h, src/help.cpp: renamed internal variable i:_comment_over_image to i:_caption_over_image . 2016-01-17 21:14 dezperado * [r925] NEWS, doc/fimrc.man, src/CommandConsole.cpp, src/fim.h, src/fimrc: renamed the internal _want_caption_status variable to _want_wm_caption_status. 2016-01-17 21:07 dezperado * [r924] NEWS, doc/fimrc.man, src/fim.h, src/help.cpp: changed value of FIM_CNS_ARCHIVE_RE a bit. minor documentation strings adjustments. 2016-01-14 23:00 dezperado * [r923] doc/fim.man, doc/fimrc.man, src/CommandConsole-help.cpp, src/fim.cpp, var/index.html.in: Renaming a few sections names in the man pages and added fimgs mention in fimrc man page. WWW page update. 2016-01-14 20:28 dezperado * [r922] Makefile.am: Absence of the 'ulimit' BASH shell builtin won't crash `make tests'. 2016-01-13 21:54 dezperado * [r921] doc/fimrc.man, src/fimrc: Small adjustment to the toggleLimitMarked alias: it won't reset the current file index anymore. 2016-01-13 21:44 dezperado * [r920] NEWS, doc/fimrc.man, src/fimrc: the '`' key is bound to toggle limit'ing to the marked files list. 2016-01-13 20:52 dezperado * [r919] NEWS, doc/fim.man, src/fim.cpp, src/fim.h: --load-image-descriptions-file will set _comment_over_image=2 (which can be overridden via the ~/.fimrc). 2016-01-13 18:14 dezperado * [r918] NEWS, doc/fim.man, src/Image.h, src/fim.cpp: Introduced and documented the new "filename #!fim:s/f/t" syntax. 2016-01-13 17:50 dezperado * [r917] src/fim_string.cpp: Bug fix: std::basic_string::substr() second parameter pos was being used wrongly in fim::string::substitute. 2016-01-12 23:05 dezperado * [r916] doc/fim.man, doc/fimrc.man, src/CommandConsole.cpp, src/fim.cpp, src/fim.h, var/index.html.in: Fix to documentation mention of --image-descriptions-file-separator. Fixes to documentation; among this, alphabetical reordering of entries visible in man fimrc. Documentation note about usage of converters with fim's stdin feature in the HTML. 2016-01-12 22:25 dezperado * [r915] src/Image.h: Will propagate the i:variables namespace also on an empty commentary string (but after the Tab). 2016-01-12 17:49 dezperado * [r914] src/DebugConsole.cpp, src/DisplayDevice.cpp, src/FontServer.h, src/SDLDevice.cpp, src/Viewport.cpp, src/fim.h: Introduced the FIM_FONT_MAGNIFY_FACTOR variable with a preliminary magnified font rendering mechanism. As a side effect, this shall slow down builds compiled without inlining the new three member functions in fs_font and FSXCharInfo. This feature is not active at the moment, though. 2016-01-11 22:31 dezperado * [r913] var/Makefile, var/index.html.in, var/www/fim.css: Adjusted a bit the headings in the CSS file. Wrote a "VI/VIM-like feel in FIM" minitutorial for the web page. 2016-01-07 20:12 dezperado * [r912] NEWS, doc/fim.man, src/Image.h, src/fim.cpp: Introduced and documented the new "filename #!fim+comment" and "filename #!fim^comment" syntax. 2016-01-07 19:39 dezperado * [r911] NEWS, doc/fim.man, src/Image.h, src/fim.cpp, src/fim.h: Introduced (and documented) special "#!fim:=" syntax to use last comment when reading the descriptions file. 2015-12-29 17:43 dezperado * [r910] var/Makefile, var/index.html.in, var/www/fim.css: Wrote a minitutorial about using fim with mutt. 2015-12-29 16:53 dezperado * [r909] src/FbiStuff.cpp, src/Image.cpp, src/common.cpp, src/fim.cpp: fim_fread_tmpfile will print an errno-indexed error out of sys_errlist if necessary. Wrote stub brackets for handling file loading related errors. Will complain with a warning (but nothing more) when attempting loading an empty file from stdin. 2015-12-29 14:27 dezperado * [r908] src/Cache.cpp: Bugfix. Revision r905 brought a memory leak to src/Cache.cpp, one could see it e.g. with src/fim --as-text README . 2015-12-29 14:04 dezperado * [r907] NEWS, doc/fim.man, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/fim.cpp: --binary=1/--binary=24 will not pad tiny renderings to _preferred_rendering_width pixels (with doc update). Small fix to src/FbiStuffBit24.cpp and src/FbiStuffBit1.cpp: using a long (instead of uint32) to get values from ftell(). 2015-12-29 13:00 dezperado * [r906] src/Browser.cpp, src/FbiStuffBit24.cpp: Bug fix to FbiStuffBit24.cpp: file size was not being used. Using .erase(... .begin()) to remove the first of many args in Browser.cpp. 2015-12-29 11:58 dezperado * [r905] configure.ac, src/Cache.cpp: Minor fixes in the Cache.cpp file. A better ./configure time warning against using unrecommended options when building fim for a distro. 2015-12-28 14:33 dezperado * [r904] src/Browser.cpp: Will synchronize g:_filelistlen after each execution of the limit command. 2015-12-28 13:55 dezperado * [r903] NEWS, src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h, var/index.html.in: Application of "list 'mark'/'unmark'" will display count of marked/unmarked entries in the console. NEWS mention of the "list 'mark'/'unmark'" features. Typo fix in the www page. 2015-12-28 13:42 dezperado * [r902] doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h: Now "list 'mark'" and "list 'unmark'" can take arguments just like "limit". Bug fix in CommandConsole::markCurrentFile, introduced CommandConsole::markFile(). Renamed enum RemoveMode -> enum MatchMode and added enum FilterAction. Changed heavily Browser::do_remove -> Browser::do_filter. Doc update. 2015-12-27 11:06 dezperado * [r901] doc/fim.man, src/fim.cpp, var/index.html.in, var/www/fim.css: man / www / html page update. 2015-12-20 19:40 dezperado * [r900] NEWS, README, doc/fim.man, doc/fimrc.man, src/fim.cpp, src/fim.h, src/help.cpp, var/Makefile, var/index.html.in, var/www/fim.css: Adjusted the command/switches comments a bit. The THANKS file will be expanded in the main HTML page. Reordered the NEWS file and ignoring its #-beginning lines when redirecting to the HTML file. Compacted the CSS file. 2015-12-20 13:53 dezperado * [r899] src/Viewport.cpp: Fix to a missing check that would crash e.g. './src/fim -o dumb media/'. 2015-12-20 11:24 dezperado * [r898] doc/Makefile.am, scripts/Makefile.am, scripts/maintenance/htmlbody.awk, var/Makefile, var/index.html.in, var/www/fim.css: In the generated HTML man files will substitute − for -. Adding the HTML man file body contents verbatim in the www page (using an extraction script for this). CSS adjustments. 2015-12-20 09:27 dezperado * [r897] NEWS, src/Image.h, var/Makefile, var/index.html.in, var/www/fim.css: Webpage update: moved the tutorial section up, improved the CSS by making it slimmer; more abbreviations. Minor NEWS adjustment. Removed a spurious printout from Image.h. 2015-12-19 23:16 dezperado * [r896] var/Makefile, var/index.html.in, var/www/fim.css: Smaller copies of the screenshots on the top page. 2015-12-19 22:46 dezperado * [r895] var/Makefile, var/index.html.in, var/www/fim.css: Wrote a FIM tutorial in the main www index page. 2015-12-19 11:03 dezperado * [r894] src/fim.h, src/fim_types.h: If using C++11, the FIM_ENUM_BASE macro will set the enum-base attribute of a number of enums to specify a type explicitly. 2015-12-19 10:37 dezperado * [r893] configure.ac: Default shall be no C++11 construct assumed. 2015-12-19 10:31 dezperado * [r892] configure.ac, src/fim_types.h: Introduced the --enable-cxx11 configure switch to switch to using C++11 constructs. As of now, this will use nullptr instead of NULL for FIM_NULL. 2015-12-19 01:09 dezperado * [r891] src/Browser.cpp, src/fim.h, src/fim_types.h: Moved the definition of FIM_NULL to a different file. The Browser class had a non-C++11 compliang line: fix. 2015-12-19 00:58 dezperado * [r890] src/Browser.h, src/Command.h, src/CommandConsole.h, src/DebugConsole.h, src/FbiStuff.h, src/FimWindow.h, src/FontServer.h, src/FramebufferDevice.h, src/Image.h, src/Namespace.h, src/fim.h, src/fim_string.h: Continued with using FIM_NULL: sed -i 's/\/FIM_NULL/g' Browser.h CommandConsole.h Command.h DebugConsole.h FbiStuff.h fim.h fim_string.h FimWindow.h FontServer.h FramebufferDevice.h Image.h Namespace.h. 2015-12-19 00:44 dezperado * [r889] src/AADevice.cpp, src/Browser.cpp, src/CACADevice.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole-var.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp, src/DisplayDevice.cpp, src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffGif.cpp, src/FbiStuffJasPer.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffLoader.cpp, src/FbiStuffMagick.cpp, src/FbiStuffMatrixMarket.cpp, src/FbiStuffPcx.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffPs.cpp, src/FbiStuffText.cpp, src/FbiStuffTiff.cpp, src/FbiStuffUFRaw.cpp, src/FbiStuffXyz.cpp, src/FimWindow.cpp, src/FontServer.cpp, src/FramebufferDevice.cpp, src/Image.cpp, src/Imlib2Device.cpp, src/SDLDevice.cpp, src/Viewport.cpp, src/common.cpp, src/fim.cpp, src/fim.h, src/fim_plugin.cpp, src/fim_string.cpp, src/interpreter.cpp, src/readline.cpp: Introduced FIM_NULL in fim.h and in *.cpp files. Then: sed -i 's/\/FIM_NULL/g' AADevice.cpp Browser.cpp CACADevice.cpp CACADevice.cpp CommandConsole-cmd.cpp CommandConsole.cpp CommandConsole-init.cpp CommandConsole-var.cpp common.cpp DebugConsole.cpp DisplayDevice.cpp FbiStuffBit1.cpp FbiStuffBit24.cpp FbiStuffBmp.cpp FbiStuff.cpp FbiStuffDjvu.cpp FbiStuffGif.cpp FbiStuffJasPer.cpp FbiStuffJpeg.cpp FbiStuffJpeg.cpp FbiStuffLoader.cpp FbiStuffMagick.cpp FbiStuffMatrixMarket.cpp FbiStuffPcx.cpp FbiStuffPdf.cpp FbiStuffPng.cpp FbiStuffPpm.cpp FbiStuffPs.cpp FbiStuffText.cpp FbiStuffTiff.cpp FbiStuffUFRaw.cpp FbiStuffXyz.cpp fim.cpp fim_string.cpp FimWindow.cpp FontServer.cpp fim_plugin.cpp FramebufferDevice.cpp Image.cpp Imlib2Device.cpp interpreter.cpp readline.cpp SDLDevice.cpp Viewport.cpp 2015-12-18 23:54 dezperado * [r888] src/fim.cpp: Oops: had forgot this in r884. 2015-12-18 23:45 dezperado * [r887] doc/fim.man, src/Image.h, src/Namespace.cpp, src/Namespace.h: Alloswing variables unsetting ("#!fim:var=" syntax). 2015-12-18 23:10 dezperado * [r886] src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h: Got rid of unmarkCurrentFile(): extended markCurrentFile() for that. 2015-12-18 08:45 dezperado * [r885] src/Browser.h: Oops: forgot to commit this file in r883. 2015-12-17 23:07 dezperado * [r884] src/Browser.cpp: Oops: forgot two output lines in the code, commenting them. 2015-12-17 23:01 dezperado * [r883] NEWS, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h: Special syntax ('!') to the limiting feature in order to allow limiting to marked files. 2015-12-17 22:09 dezperado * [r882] NEWS, src/FramebufferDevice.cpp: Differently from the other DisplayDevice classes, FramebufferDevice::display was not calling clear_rect() to clear the screen. So this is a bugfix: in some situations fim -o fb was not clearing the screen before drawing the image. 2015-12-14 22:54 dezperado * [r881] src/Image.cpp, src/common.cpp, src/common.h, src/fim.h, src/help.cpp: Introduced a call to getrusage and its usability via the %R string info formatting code. Help update as well. 2015-12-14 22:25 dezperado * [r880] src/Cache.cpp, src/Cache.h: bug fix: non cacheable() Image's will not be leaking in the prefetch case, as until now. 2015-12-14 21:46 dezperado * [r879] src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffJasPer.cpp, src/FbiStuffMatrixMarket.cpp, src/FbiStuffXyz.cpp: Bug fix: a few further decoders (binary=1,binary=24,MatrixMarket,JasPer, and the example Xyz) were not setting the i->npages to 1 as they should have instead. 2015-12-14 21:38 dezperado * [r878] src/FbiStuffPcx.cpp: Bug fix: pcx_init was not setting i->npages = 1 as it should. Consequently it was being treated as uncacheable by Cache. 2015-12-14 16:38 dezperado * [r877] src/Image.cpp, src/Image.h: The FIM_WANT_EXPERIMENTAL_MIPMAPS=0 case build was broken: fixed. 2015-12-13 23:37 dezperado * [r876] src/interpreter.cpp: Minimal adjustments of a debug Var print. Comments for coming changes. 2015-12-13 23:31 dezperado * [r875] src/Var.h: Fix: The half-baked adoption of 'explicit' in r838 broke test11. will reintegrate 'explicit' constructors more systematically in the future. 2015-12-13 21:41 dezperado * [r874] src/CommandConsole.h: Comments about the friend classes of CommandConsole. 2015-12-13 21:13 dezperado * [r873] src/AADevice.cpp, src/AADevice.h, src/CommandConsole.cpp, src/CommandConsole.h, src/readline.cpp: Commit r871 broke the non-aa device (used to crash after using : to enter in the console mode). Found a better alternative. 2015-12-13 20:51 dezperado * [r872] src/CommandConsole-init.cpp, src/CommandConsole.h, src/Image.cpp: Removed friend dependency of Image on CommandConsole. 2015-12-13 20:25 dezperado * [r871] src/AADevice.cpp, src/AADevice.h, src/CommandConsole.h, src/readline.cpp: Modified the AA internals in order for fim_rl_sdl_aa_getc_hook() not to require anymore access to CommandConsole::displaydevice_->get_input() . 2015-12-13 19:58 dezperado * [r870] src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.cpp, src/FbiStuff.cpp, src/Viewport.cpp: Taking measures with the intention of making CommandConsole::displaydevice_ private. 2015-12-13 19:05 dezperado * [r869] src/Browser.cpp: After successful limiting will reload the current image and not emit any message. 2015-12-13 18:48 dezperado * [r868] src/DisplayDevice.h, src/FimWindow.cpp, src/FimWindow.h, src/FramebufferDevice.cpp, src/Image.h, src/Viewport.cpp, src/Viewport.h: A step into rationalizing the use of redraw_: moving it (again) from FimWindow to Viewport. 2015-12-13 16:37 dezperado * [r867] src/Viewport.cpp, src/Viewport.h: Viewport has const reference to Rect now. 2015-12-13 16:35 dezperado * [r866] src/FimWindow.cpp, src/FimWindow.h, src/Viewport.cpp, src/Viewport.h: class Viewport uses now Rect instead of FimWindow. 2015-12-13 15:59 dezperado * [r865] src/Viewport.cpp, src/Viewport.h: Viewport uses FimWindow::corners_ directly now. 2015-12-13 15:47 dezperado * [r864] src/FimWindow.cpp, src/FimWindow.h, src/Viewport.cpp: transferred to Rect a few member functions of FimWindow and making (temporarily) FimWindow::corners_ public. 2015-12-13 15:36 dezperado * [r863] src/FimWindow.cpp, src/FimWindow.h: Prepending an underscore (_) to the member variables of Rect. 2015-12-13 15:22 dezperado * [r862] src/FimWindow.cpp: Removed a few now unnecessary checks. 2015-12-13 12:55 dezperado * [r861] src/Namespace.cpp: Oops: Namespace::assign_ns was missing the return statement. 2015-12-13 12:54 dezperado * [r860] src/DisplayDevice.h, src/FimWindow.cpp, src/FimWindow.h, src/Image.cpp, src/Image.h, src/Viewport.cpp, src/Viewport.h: Using a cleaner method to keep track of the need to redraw, avoiding the public DisplayDevice::redraw_. 2015-12-13 10:59 dezperado * [r859] src/CommandConsole.h: CommandConsole::window_ is private now. 2015-12-13 10:44 dezperado * [r858] src/CommandConsole.h: got rid of the friend declaration of class FbiStuff for class CommandConsole. 2015-12-13 10:31 dezperado * [r857] src/Image.cpp, src/Image.h, src/Viewport.cpp: got rid of the friend declaration of class Viewport for class Image. 2015-12-13 09:52 dezperado * [r856] src/Image.cpp, src/Namespace.cpp, src/Namespace.h: Added a 'variables assignment' member function: Namespace::assign_ns. 2015-12-12 11:20 dezperado * [r855] src/CommandConsole.cpp, src/fim.cpp, src/fim.h: Introduced the FIM_OSW_LOAD_IMG_DSC_FILE symbol to replace several "load-image-descriptions-file" occurrences. 2015-12-12 11:13 dezperado * [r854] doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.cpp, src/fim.h: Documented, polished and enabled the limit browser file list function ('limit'). Updated the documentation of --load-image-descriptions-file accordingly. man pages updated as well. 2015-12-10 23:17 dezperado * [r853] src/Browser.cpp: Oops: an assignment was meant here. Fixing. 2015-12-10 23:08 dezperado * [r852] src/Browser.cpp, src/Browser.h: introduced options to Browser::do_remove which are readily used by Browser::fcmd_limit. 2015-12-09 23:35 dezperado * [r851] src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.h: In first changes in implementing a limiting mechanism for the browser file list (so far this is off via FIM_WANT_PIC_LBFL=0). 2015-12-09 22:57 dezperado * [r850] src/Browser.cpp, src/Browser.h: Updated the Browser::do_remove member function to accept optional parameters 'partial' ad 'negative' (defaults false and false). 2015-12-09 22:21 dezperado * [r849] NEWS, src/Browser.cpp: bugfix in Browser::do_remove ("list 'remove'" internals). 2015-12-09 07:54 dezperado * [r848] NEWS, doc/fim.man, src/Image.cpp, src/Image.h, src/Namespace.h, src/fim.cpp, src/fim.h: load variables description namespace from file ("#!fim:var=value" forms). 2015-11-25 00:19 dezperado * [r847] README.FIRST: Update (after 7 years!) of the README.FIRST file. 2015-11-24 09:12 dezperado * [r846] README: Mention to `sh autogen.sh' was missing in the README. 2015-11-08 18:42 dezperado * [r845] src/AADevice.cpp, src/Browser.cpp, src/CACADevice.cpp, src/Cache.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/FbiStuffPng.cpp, src/FimWindow.cpp, src/FimWindow.h, src/FramebufferDevice.cpp, src/Image.cpp, src/Image.h, src/Viewport.h, src/common.cpp: Comments wording correction: "method" -> "member function". 2015-11-08 18:22 dezperado * [r844] src/AADevice.cpp, src/AADevice.h, src/Viewport.cpp: made AADevice::clear_rect_ a template member function. 2015-11-08 17:53 dezperado * [r843] src/Imlib2Device.cpp, src/SDLDevice.cpp, src/Viewport.cpp, src/fim.h: Introduced the FIM_CNS_WHITE and FIM_CNS_BLACK constants. 2015-11-08 17:51 dezperado * [r842] src/Viewport.cpp: Ooops: in the last commit one #endif was misplaced. Fix. 2015-11-08 17:45 dezperado * [r841] src/Browser.h, src/Viewport.cpp, src/fim.h: Introduced a file browser progress line functionality (off from the build at the moment). 2015-11-08 17:26 dezperado * [r840] src/AADevice.h, src/CACADevice.h, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.h: fill_rect() is now a requirement of each DisplayDevice, although at the moment is bogus except for SDLDevice. 2015-11-05 17:56 dezperado * [r839] src/Browser.h, src/CommandConsole.cpp, src/FimWindow.cpp, src/Viewport.cpp: Corrected a few comments. 2015-11-05 16:56 dezperado * [r838] src/Var.h: All of the Var constructors were converting constructors. Using the 'explicit' keyword to disable copy-initialization during assignment to three of these constructors. 2015-04-19 11:13 dezperado * [r837] var/index.html.in: www page update. 2015-04-18 21:45 dezperado * [r836] var/Makefile, var/index.html.in, var/www/fim.css: small update to the webpage: changed the screenshots and a new comment in. 2015-04-18 19:37 dezperado * [r835] doc/fimrc.man, src/CommandConsole-help.cpp, src/fim.cpp, src/fim.h: introduced FIM_CNS_LCY /* latest copyright year */. introduced an alias "rotate180". 2015-04-18 19:28 dezperado * [r834] src/Cache.cpp, src/Cache.h, src/CommandConsole-cmd.cpp, src/Image.cpp, src/Image.h, src/SDLDevice.cpp, src/fim.h: in a Image::desc_update function; using this, can update the comments by reloading them. this fim.h revision should have been commited in the last change. upsi. no-change in a SDLDevice method. 2015-04-18 19:25 dezperado * [r833] doc/fimrc.man, src/Viewport.cpp, src/Viewport.h, src/fimrc, src/help.cpp: added a Viewport::fs_ml_puts method for the multiline text overlay printout. if _comment_over_image>1, the comment will have a black background. 2015-04-16 08:01 dezperado * [r832] var/index.html.in: signature file link was wrong on www. fix. 2015-03-15 11:06 dezperado * [r831] src/Image.h: typo fix to the FIM_ROT_R_C enum char definition. 2015-03-01 10:49 dezperado * [r830] NEWS, src/CommandConsole.cpp: bugfix: in trunk and branches/0.4: the read pipe() descriptors were not being closed. 2015-03-01 09:50 dezperado * [r829] src/Viewport.cpp: inner check preventing the _comment_over_image pixels invading off-screen memory (partial fix). 2015-02-15 19:21 dezperado * [r828] src/CommandConsole.cpp, src/Viewport.cpp: there was one cast to (fim_int) in excess: got rid of it, as it caused pollution of the steps_ variable. 2015-02-14 13:10 dezperado * [r827] src/Browser.cpp, src/fim.h, src/testdir/Makefile, src/testdir/test7.in: test8 used to break on extra *.png files in media/ : Makefile fix for this. test7 used to break because of the "goto" not being capped to 100%. 2015-02-13 19:23 dezperado * [r825] src/testdir/test10.in, src/testdir/test10.ok, src/testdir/test13.in, src/testdir/test13.ok, src/testdir/test7.in: updated the test suite behind `make tests' to the recent changes. 2015-02-13 15:58 dezperado * [r822] debian/control, debian/copyright: ran wrap-and-sort in trunk and 0.4. 2015-02-13 14:15 dezperado * [r820] NEWS, README, debian/control: update of further details in NEWS, README, and debian/control files. 2015-02-13 13:59 dezperado * [r819] debian/control: update of debian/control description files; rc-3 notice in the 0.4 branch. 2015-02-12 23:24 dezperado * [r818] src/CommandConsole-var.cpp, src/Namespace.cpp, src/Var.h, src/interpreter.cpp: got rid of Var(int) i favur got rid of Var(bpplb) 2015-02-12 18:10 dezperado * [r817] src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole-var.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/common.cpp, src/common.h, src/defaultConfiguration.cpp: got rid also of CommandConsole::setVariable(...int). 2015-02-12 17:27 dezperado * [r816] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/DebugConsole.cpp, src/Image.cpp, src/Image.h, src/Namespace.cpp, src/Namespace.h, src/Viewport.cpp, src/fim_types.h: got rid of Namespace::setVariable(..int) and Namespace::setGlobalVariable(..int). 2015-02-12 17:06 dezperado * [r815] src/Namespace.cpp, src/Namespace.h: obsolete Namespace comments cleanup. 2015-02-12 11:12 dezperado * [r814] doc/fimrc.man, src/Namespace.cpp, src/fimrc: minimal change to the inner fimrc: moved rotation/orientation/mirror next to size/scale info. 2015-02-12 11:09 dezperado * [r813] src/CommandConsole-var.cpp, src/CommandConsole.h: simplifying the CommandConsole variable read/modify methods. 2015-02-12 11:07 dezperado * [r812] src/Image.cpp, src/Image.h: using exif-based rotation enum values. 2015-02-12 11:06 dezperado * [r811] src/Viewport.cpp: small bugfix: Viewport was accessing a Namespace variable of itself. this is forbidden now. shall enforce this better. 2015-02-11 20:15 dezperado * [r809] src/CommandConsole-var.cpp: repaired the buggy g: namespace access. 2015-02-11 19:03 dezperado * [r808] NEWS, doc/fimrc.man, src/CommandConsole-help.cpp, src/Viewport.cpp, src/fim.h, src/help.cpp, src/lex.lex: put aside the v: b: and w: namespaces until they make more sense. annotated i:/g: for each variable. 2015-02-11 18:28 dezperado * [r807] NEWS, doc/fimrc.man, src/Image.cpp, src/fim.h, src/help.cpp: got rid of i:pagecount for i:pages. a first indication of the validity domain for the variables (still a long long way to go ...). 2015-02-11 18:13 dezperado * [r806] NEWS, doc/fimrc.man, src/fim.h, src/help.cpp: removed the 'internal,' specifier to the internal variables: it is now obsolete. 2015-02-11 17:59 dezperado * [r805] NEWS, doc/fimrc.man, src/Image.cpp, src/fim.h, src/help.cpp: introduced helper variables: __exif_orientation, __exif_mirrored, __exif_flipped 2015-02-11 17:05 dezperado * [r804] src/FbiStuff.cpp, src/Image.cpp, src/common.cpp: conversions fixes. 2015-02-11 16:51 dezperado * [r803] src/AADevice.cpp, src/Arg.cpp, src/Arg.h, src/Browser.cpp, src/FbiStuff.cpp, src/FbiStuff.h, src/Var.h, src/common.cpp, src/common.h, src/fim.cpp, src/fim.h, src/fim_string.cpp, src/fim_types.h, src/interpreter.cpp, src/lex.h, src/lex.lex, src/yacc.ypp: further changes to allow freedom in the choice of fim_int. 2015-02-11 16:42 dezperado * [r802] configure.ac: the last version of the configure was incomplete: fix. 2015-02-11 07:49 dezperado * [r801] src/fim_stream.cpp, src/fim_string.cpp: avoiding a few unwanted forced conversions with a compile-time-optimizable switch. 2015-02-11 07:43 dezperado * [r800] configure.ac, src/AADevice.cpp, src/CommandConsole-var.cpp, src/CommandConsole.h, src/Namespace.cpp, src/Namespace.h, src/SDLDevice.cpp, src/Var.h, src/fim.cpp, src/fim.h, src/fim_stream.cpp, src/fim_stream.h, src/fim_string.cpp, src/fim_string.h, src/fim_types.h: preparing the code for the option of using 64 bit integers in the internal int representation. 2015-02-10 22:59 dezperado * [r799] doc/fimrc.man, src/FbiStuff.cpp, src/Image.cpp, src/Image.h, src/fim.h, src/fimrc, src/help.cpp: the internal rotation values will proceed clockwise now (instead of counter-clockwise). documented this detail. 2015-02-08 00:26 dezperado * [r798] src/Image.cpp, src/Image.h, src/Viewport.cpp, src/fim.h: added Image::is_flipped and Image::is_mirrored. 2015-02-07 22:37 dezperado * [r797] src/Image.cpp: The Bottom-right EXIF orientation case was being handled wrongly: fix. 2015-02-07 15:13 dezperado * [r796] NEWS, doc/fimrc.man, src/FbiStuff.cpp, src/fim.h, src/help.cpp: if an image has been opened with an offset, i:_open_offset will be set accordingly 2015-02-07 14:58 dezperado * [r795] NEWS, doc/fim.man, doc/fimrc.man, src/FbiStuff.cpp, src/fim.cpp, src/fim.h, src/help.cpp: --offset accepts a range now (using the new _open_offset_retry variable). 2015-02-07 14:12 dezperado * [r794] src/FbiStuff.cpp: find_regexp_offset had a bug, thus neutralizing the _seek_magic=.. mechanism. fix. 2015-02-07 13:08 dezperado * [r793] doc/fim.man, src/fim.cpp, src/fim.h: documentation fixes (mostly adding a dot to each command option description sentences). 2015-02-07 12:48 dezperado * [r792] src/fim.h: In r789 cut accidentally a line fraction of documentation. Reintegrating it. 2015-02-07 12:39 dezperado * [r791] NEWS, src/CommandConsole-cmd.cpp, src/fim.cpp, src/fim.h: the 'help' command will search also in fim command options (r791*) 2015-02-07 11:17 dezperado * [r790] NEWS, doc/fim.man, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h: 'descload' -> 'desc "load"'. 2015-02-07 00:02 dezperado * [r789] debian/changelog, debian/compat, debian/control, debian/copyright, debian/dirs, debian/files, debian/fim.substvars, debian/menu.ex, debian/rules, debian/substvars, debian/watch, src/fim.h: adapted the debian/* files to be (mostly) like the ones in 0.4. -- D trunk/debian/menu.ex M trunk/debian/control D trunk/debian/dirs D trunk/debian/files M trunk/debian/compat D trunk/debian/fim.substvars M trunk/debian/watch M trunk/debian/changelog M trunk/debian/copyright M trunk/debian/rules D trunk/debian/substvars M trunk/src/fim.h 2015-02-06 00:47 dezperado * [r788] doc/fim.man, src/FontServer.cpp: set a different font as first one in the font search list (a nice bold one: Uni3-TerminusBoldVGA14.psf.gz). 2015-02-05 23:32 dezperado * [r787] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/Image.cpp, src/Image.h: before this revision opening a non existent file with --no-stat-push would segfault; not now. 2015-02-05 21:50 dezperado * [r786] configure.ac: in the configure, renamed: --enable-recursive-dirs to --enable-recursive-pushdir and --enable-read-dirs to --enable-pushdir 2015-02-05 21:40 dezperado * [r785] NEWS, doc/fim.man, doc/fimrc.man, src/AADevice.cpp, src/fim.cpp, src/fim.h, src/fimrc, src/help.cpp: renamed the internalvariable _preload_checks to _push_checks. comment fix in AADevice.cpp. 2015-02-05 21:19 dezperado * [r784] NEWS, doc/fimrc.man, src/FbiStuff.cpp, src/fim.h, src/help.cpp: i:_file loader will store the used loader string. 2015-02-05 20:41 dezperado * [r783] src/Image.cpp: a clone constructor of Image was not initializing one member properly, leading to e.g. empty results in getGlobalIntVariable: fix. 2015-02-05 18:57 dezperado * [r782] NEWS, doc/fimrc.man, src/fimrc: key Del bound to pop the current image from the list. 2015-02-05 18:56 dezperado * [r781] src/Browser.cpp: fix to the "list 'pop'" command. 2015-02-05 18:15 dezperado * [r780] NEWS, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h: added list 'marked' to show the list of marked files. 2015-02-05 17:52 dezperado * [r779] doc/fim.man, doc/fimrc.man, src/fim.cpp: documentation mention of zcat to uncompress the font file. minor doc adjustments. 2015-02-05 17:39 dezperado * [r778] NEWS, doc/fim.man, doc/fimrc.man, src/Viewport.h, src/defaultConfiguration.cpp, src/fim.cpp, src/fimrc: changed default bindings of n/p (will cycle on file only), PageUp,PageDown (files and pages). bound the Menu key (just as Tab). doc fixes. 2015-02-05 17:32 dezperado * [r777] src/CommandConsole-cmd.cpp, src/CommandConsole.cpp: changed slightly the diagnostic message of bind-related commands (now it will display the keysym as well). 2015-02-05 17:16 dezperado * [r776] src/SDLDevice.cpp, src/fim.h: Listing explicitly the keycodes for events SDLK_BACKSPACE SDLK_TAB SDLK_RETURN SDLK_PAUSE SDLK_INSERT SDLK_DELETE SDLK_MENU. Handling of Backspace was broken and that of Insert and that of the Menu key is now new in SDL mode. 2015-02-05 17:06 dezperado * [r775] NEWS, src/Viewport.cpp: extension of the recent (772) patch to the mouse based pan. 2015-02-05 07:51 dezperado * [r774] configure.ac: --enable-hardcoded-font (hardcoded font) is now default in configure. 2015-02-04 21:22 dezperado * [r773] src/Browser.cpp: bugfix: back search with '?' was ignoring actual argument and using the cached one (last regexp..). 2015-02-04 20:47 dezperado * [r772] NEWS, src/Viewport.cpp, src/Viewport.h: mirror/flip is now being applied with respect to the viewport borders. 2015-02-02 21:53 dezperado * [r771] doc/fimrc.man, src/fim.h, src/fimrc, src/help.cpp: the default _want_caption_status value now contains also %L. 2015-02-02 21:53 dezperado * [r770] src/Image.cpp: changed the %L specifier to contain also orientation information. 2015-02-02 21:38 dezperado * [r769] NEWS, doc/fimrc.man, src/Image.cpp, src/fim.h, src/fimrc, src/help.cpp: if _want_exif_orientation is set, images will be reoriented according to EXIF metadata. 2015-02-02 18:56 dezperado * [r768] README, doc/fimrc.man, src/fim.h, src/help.cpp: documentation fixes (~/fim_history -> ~/.fim_history). and in trunk, README adjustment. 2015-02-02 18:48 dezperado * [r767] NEWS, doc/fimrc.man, src/FontServer.cpp, src/fim.h, src/help.cpp: the _fbfont variable will contain the current console font file string. 2015-02-02 18:10 dezperado * [r766] src/Image.cpp: If ascale is set and rotating orthogonally, image proportions shall now be preserved during rotation. 2015-02-01 11:01 dezperado * [r765] src/CommandConsole.cpp: unused variables warnings fix. 2015-02-01 10:18 dezperado * [r763] src/CommandConsole.cpp: changes to the command repeat feature limit: using min between upper limit and value as a limit (not mod()), a message will be displayed on exceeding of _max_iterated_commands, and a check to avoid negative repeat values. 2015-02-01 09:44 dezperado * [r762] doc/fim.man, doc/fimrc.man, src/fim.cpp, src/fim.h: Documented with examples the repeat command feature. 2015-01-31 23:23 dezperado * [r761] src/FbiStuff.cpp: equipping FbiStuff::fim_mipmaps_compute to NULL src arguments. 2015-01-31 22:31 dezperado * [r760] src/Browser.cpp, src/Cache.cpp, src/Cache.h, src/FbiStuff.cpp, src/Image.cpp: early adaptations to browse multiple multi-page documents (still inefficient and clumsy). 2015-01-31 16:25 dezperado * [r759] BUGS, src/AADevice.cpp, src/CommandConsole-init.cpp, src/SDLDevice.cpp: barely relevant fix to AADevice::get_input. aalib PageUp/PageDown problems note. 2015-01-31 15:07 dezperado * [r758] src/Browser.cpp: since a few commits, Browser::fcmd_list was returning the wrong argument. fix. 2015-01-31 15:01 dezperado * [r757] src/Browser.cpp, src/Cache.cpp, src/FbiStuff.cpp, src/Image.cpp: on multipage, rotating list on pages if moving outwards from extremal pages. commented shred lines in the img destructor. 2015-01-31 12:11 dezperado * [r756] doc/fimrc.man, src/Browser.cpp, src/Cache.cpp, src/Cache.h, src/FbiStuff.cpp, src/Image.cpp, src/Image.h, src/fim.h, src/help.cpp: extended the inspection printout macros to Image and the FbiStuff. working to get Image::load not depend on current page. added an i:pages variable. 2015-01-31 09:24 dezperado * [r755] src/Browser.cpp: oops: one thing was missing from Browser::find_file_index. 2015-01-31 09:19 dezperado * [r754] src/Browser.cpp, src/Browser.h: Browser::present and Browser::find_file_index are now const. 2015-01-31 09:06 dezperado * [r753] src/Browser.cpp: in a diagnostic printout for the Browser class, like for Cache. 2015-01-30 21:57 dezperado * [r752] doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h: will update caption even if status bar display is off. 2015-01-30 20:45 dezperado * [r751] src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/Image.cpp: now on Browser::display_status takes one argument only. 2015-01-30 20:30 dezperado * [r750] src/fim.h, src/fimrc: removed wrong documentation reference to XWD format (part of fbida, not in fim). typo fix in trunk. 2015-01-30 20:15 dezperado * [r749] src/fim.cpp, src/fim.h: in two new documentation helper macros: FIM_MAN_fR and FIM_MAN_fB. 2015-01-30 08:03 dezperado * [r748] doc/fim.man, src/fim.cpp, src/fim.h: man page dox fixes 2015-01-29 21:03 dezperado * [r747] doc/fim.man, doc/fimrc.man, src/fim.cpp, src/fim.h: doc fixes for 'list'. 2015-01-27 22:08 dezperado * [r746] NEWS, configure.ac, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.cpp, src/fim.h: -R/--recursive switch to turn on recursive push of command line specified directories. added a 'list "pushdirr"' command, working like "pushdir" but recursive. configure script default won't disable the recursive push anymore. 2015-01-27 01:19 dezperado * [r745] NEWS, doc/fimrc.man, src/FbiStuff.cpp, src/fim.h, src/help.cpp: added a _archive_files variable to specify which file names specify archives. 2015-01-26 22:33 dezperado * [r744] NEWS, doc/fimrc.man, src/grammar.h, src/yacc.ypp: added a ':- INTEGER' syntax, so one can specify the file in the list counting from the end. 2015-01-26 17:58 dezperado * [r743] doc/fim.man, src/fim.cpp: doc fix. 2015-01-25 18:06 dezperado * [r742] Makefile.am, doc/fim.man, doc/fimgs.man, doc/fimrc.man, src/Cache.cpp: oops: forgot a diagnostic printout in the cache mechanisms. now it's off. in a trick to substitute -'s with \-'s in the man files (for lintian...). 2015-01-25 17:44 dezperado * [r739] src/Cache.cpp, src/Image.cpp, src/Image.h: multipage support seems back to life (introduced 'uncacheable' images). tested ith djvu. 2015-01-25 16:18 dezperado * [r738] src/Image.cpp, src/Image.h: moved the mipmap related methods definitions of Image to the cpp file. 2015-01-25 16:13 dezperado * [r737] configure.ac: unrecommended features will be annotated in the configure script output. 2015-01-25 14:56 dezperado * [r736] doc/fimrc.man, src/Cache.cpp, src/Image.cpp, src/Image.h, src/fim.h, src/help.cpp: the mipmaps won't be cached. 2015-01-25 14:02 dezperado * [r735] src/fim.cpp: avoiding narrowing conversion of the numerical getopt() codes associated to --dump-reference-help and --offset by choosing smaller numbers. 2015-01-25 13:52 dezperado * [r734] doc/fimrc.man, src/fim.h: Readjusted a documentation string becaue of a lamentation of `man --html=cat': ":374: warning [p 1, 53.7i]: cannot adjust line :374: warning [p 1, 53.8i]: cannot adjust line" 2015-01-25 13:22 dezperado * [r733] NEWS, src/Image.cpp: the %C expando will also display cached images count. 2015-01-25 13:21 dezperado * [r732] doc/fimrc.man, src/Cache.cpp, src/Cache.h, src/fim.h, src/fim_string.cpp, src/fim_string.h, src/help.cpp: housekeeping of the cache mechanism and better reporting. dox fixes. 2015-01-24 22:04 dezperado * [r731] src/CommandConsole-cmd.cpp: extendend the search domain of the 'help "/.."' syntax. 2015-01-24 21:05 dezperado * [r730] doc/fimrc.man, src/CommandConsole.cpp, src/FbiStuff.cpp, src/Image.cpp: extended desaturation and colors invert to mipmap as well. desaturation document fix. 2015-01-24 20:39 dezperado * [r729] NEWS, doc/fimrc.man, src/FbiStuff.cpp, src/FbiStuff.h, src/Image.cpp, src/fim.h, src/fimrc, src/help.cpp: _use_mipmaps=1 is now default and will be enough to use mipmaps in downscaling. code tidyness, documentation fixes. 2015-01-24 16:41 dezperado * [r728] configure.ac: --enable-custom-status-bar is now implied default. 2015-01-24 16:27 dezperado * [r727] NEWS, README, configure.ac: libexif autodetection by default in the configure. doc notes. 2015-01-24 15:52 dezperado * [r726] NEWS, configure.ac, doc/fimrc.man, src/fim.h, src/fimrc, src/help.cpp: properly documenting _want_caption_status, _display_status_fmt, and _info_fmt_str. the configure will declare whether libexif has been configured in. 2015-01-24 14:17 dezperado * [r725] src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h: bind commands will now be recorded in the internal documentation database. 2015-01-24 13:11 dezperado * [r724] NEWS, doc/fimrc.man, src/CommandConsole-help.cpp, src/Namespace.cpp, src/fim.h, src/lex.lex: special variable i:* expanding to all the variable name/value pairs of an image 2015-01-24 13:09 dezperado * [r723] src/FbiStuffJpeg.cpp: will read all the EXIF tags present in a file iterating through them. 2015-01-24 11:04 dezperado * [r722] src/SDLDevice.cpp, src/SDLDevice.h: on window manager resize will update the variables to be read by the text console. 2015-01-24 11:02 dezperado * [r721] src/DebugConsole.cpp: it seems like r602 without the present patch introduced a bug impeding MiniConsole access to global variables.. 2015-01-24 09:21 dezperado * [r720] NEWS, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/fim.h: the 'help' command will search in help items if argument starts with /. 2015-01-23 23:09 dezperado * [r718] BUGS, NEWS, README, doc/fim.man, doc/fimrc.man, src/AADevice.cpp, src/Browser.cpp, src/CommandConsole.cpp, src/FbiStuffGif.cpp, src/Image.cpp, src/fim.cpp, src/fim.h, src/help.cpp: improving the documentation: NEWS, README, internal help and man pages. 2015-01-23 18:32 dezperado * [r717] src/FbiStuffGif.cpp: Adapted the gif decoder to build with: giflib-4.1.6, giflib-4.2.3, giflib-5.0.0, giflib-5.1.1 (their APIs differ). 2015-01-23 18:16 dezperado * [r716] src/FbiStuffJpeg.cpp, src/FramebufferDevice.cpp, src/FramebufferDevice.h: prepending FIM_FBI_ to two simple old macros for TRUE and FALSE. 2015-01-22 22:09 dezperado * [r715] doc/fimrc.man, src/fim.h: documentation update of 'scale' command, now with mention of the '*{value}' syntax (last commit here). 2015-01-22 21:49 dezperado * [r713] BUGS, src/Browser.cpp: fixed a bug in which the syntax of relative scaling (e.g.; '*1.2') was being ignored by 'scale'. added mention of bugfix from r688 to BUGS. 2015-01-22 07:58 dezperado * [r712] src/Image.cpp: fortifying Image::getInfoCustom. 2015-01-21 01:03 dezperado * [r706] src/Image.cpp: accidentally the last commit introduced trigraphs --- got rid of that. wrote a warning note for Image::getInfoCustom's quality. 2015-01-21 00:52 dezperado * [r705] src/FbiStuffJpeg.cpp, src/Image.cpp: changed the format of the conditional expando for _display_status_fmt. added four further EXIF tags being extracted and making it into image variables. 2015-01-20 22:59 dezperado * [r704] ChangeLog: ChangeLog update. 2015-01-20 08:03 dezperado * [r703] NEWS, doc/fim.man, src/fim.cpp: added a --autowindow switch to adapt window size to picture size. 2015-01-19 22:02 dezperado * [r702] src/Browser.cpp: enforcing reorientation after before scaling. 2015-01-19 20:21 dezperado * [r701] src/Browser.cpp, src/SDLDevice.cpp: on "display 'resize'", will space for status line only if status line verbosity is on. 2015-01-19 19:58 dezperado * [r700] src/SDLDevice.cpp: setting also resizeable window and mouse pointer active as default for SDL. 2015-01-19 19:34 dezperado * [r699] src/SDLDevice.cpp, src/fimrc: added a missing check after the SDL window resize. 2015-01-19 19:01 dezperado * [r698] NEWS, src/Browser.cpp, src/CommandConsole.cpp, src/SDLDevice.cpp, src/fimrc: added a "display 'resize'" to resize the SDL window. default SDL mode is windowed now. default 'C-w' key will resize the SDL window to the original image size. default 'W' key will resize the SDL window to the image size. if unspecified, the initial window size will be half of the screen. 2015-01-19 00:27 dezperado * [r697] NEWS, TODO, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/Image.cpp, src/fim.cpp: --load-image-descriptions-file will override the comment eventually directly read from the file. 2015-01-18 23:45 dezperado * [r696] NEWS, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.h, src/fimrc: when repeating searching with repeat_last, will use last direction. '?' key is now assigned to backward search. default 'C-p' key is now assigned to repeat last backward search. 2015-01-18 12:37 dezperado * [r694] src/readline.cpp: directing the output stream of readline to /dev/null: it seems like for some reason rl_erase_empty_line emits a newline after e.g.: ":". 2015-01-18 11:53 dezperado * [r693] src/CommandConsole.cpp, src/SDLDevice.cpp: when dumping selected filenames will not emit the first newline to stdout anymore, but to stderr instead. 2015-01-18 11:39 dezperado * [r692] src/Makefile.am, src/SDLDevice.cpp, src/default_icon_byte_array.h: will display a (hardcoded) icon when running in SDL mode. 2015-01-18 09:31 dezperado * [r691] src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h: avoiding command console buffer pollution after a search. 2015-01-18 00:58 dezperado * [r690] NEWS, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h: Added the 'descload' command. 2015-01-17 14:47 dezperado * [r688] NEWS, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/readline.cpp, src/readline.h: overwriting rl_instream with a bogus stream for the situations when no stdin causes readline() to fail (e.g.: invoking fim from an X menu). 2015-01-17 13:28 dezperado * [r687] src/CommandConsole.cpp: when attempting entering in command line mode with no stdin (e.g. fim < /dev/null), instead of cowardly exiting the program, just displaying a message. 2015-01-17 11:27 dezperado * [r686] configure.ac, doc/fimrc.man, src/CACADevice.cpp, src/CACADevice.h: resuscicated the partial libcaca driver based device to compile. before making it working, shall migrate to the 1.0 interface. 2015-01-17 10:02 dezperado * [r685] NEWS, src/fimrc: key r is bound to 'rotate90', key R to 'rotate270', both in trunk and 0.4. 2015-01-17 09:22 dezperado * [r684] src/help.cpp: had forgotten one (this) line of text in the previous commit. 2015-01-17 09:21 dezperado * [r683] NEWS, doc/fimrc.man, src/Viewport.cpp, src/fim.h: added a _comment_over_image variable and the capability of displaying comment/description text over the image. 2015-01-17 08:53 dezperado * [r682] NEWS, doc/fim.man, src/Image.h, src/fim.cpp: Added a --image-descriptions-file-separator option to specify an arbitrary separator character to --load-image-descriptions-file. 2015-01-13 23:10 dezperado * [r681] doc/fim.man, src/Image.h, src/fim.cpp: added a --read-from-stdin-elds option to allow endline delimiters specification in the filenames text. --load-image-descriptions-file will now associate to basename. corresponding documentation updates. 2015-01-13 22:13 dezperado * [r680] src/fim.cpp: replacing read_one_file_from_stdin with an enum. 2014-12-11 00:10 dezperado * [r679] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/fim.cpp, src/fim.h, src/help.cpp: introduced --no-stat-push, which sets _preload_checks=0 before files push'ing. 2014-12-09 21:41 dezperado * [r678] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/common.cpp, src/common.h, src/fim.cpp, src/fim.h, src/fimrc, src/help.cpp: stat() checking of files on load can be disabled with _preload_checks. commented out the still unused append_to_file function. terminal clear term code (commented) for future use. 2014-12-07 17:55 dezperado * [r677] src/Image.cpp: In a check to prevent the ? expando from working in case of empty variable. 2014-12-07 14:16 dezperado * [r676] NEWS, src/Image.cpp, src/fim.h: introduced special image variable expandos. 2014-12-07 13:17 dezperado * [r675] src/FbiStuff.cpp, src/FbiStuff.h, src/FbiStuffJpeg.cpp, src/FbiStuffLoader.h, src/Image.cpp, src/fim.h: EXIF tags will make it into the Image's Namespace. 2014-12-06 13:48 dezperado * [r674] NEWS, src/Browser.cpp: a rudimentary mechanism for search (and jump) on image descriptions. 2014-12-06 13:10 dezperado * [r673] doc/fim.man, src/CommandConsole.h, src/fim.cpp: In the man file will not indent anymore the long options. 2014-12-06 12:58 dezperado * [r672] NEWS, doc/fim.man, src/CommandConsole.cpp, src/CommandConsole.h, src/Image.cpp, src/Image.h, src/fim.cpp, src/fim.h: Implemented an experimental --load-image-descriptions-file function. 2014-12-04 18:46 dezperado * [r671] NEWS, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h, src/fimrc, src/help.cpp: introduced _re_search_opts to allow regexp searches on basename (default) or full pathname. 2014-12-04 18:34 dezperado * [r670] src/common.cpp: using strrchr in fim_basename_of(). 2014-12-03 22:22 dezperado * [r669] NEWS, doc/fim.man, src/Browser.cpp, src/Browser.h, src/fim.cpp: added --sort program switch; then --sort-basename and its internal "sort 'b'". 2014-11-30 18:19 dezperado * [r668] README, var/Makefile, var/index.html.in: update of the www stuff 2014-11-30 16:46 dezperado * [r667] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/fim.h, src/fimrc, src/help.cpp: jump back and forth from the last viewed image with the ' key and the _lastfileindex variable. 2014-11-30 12:03 dezperado * [r666] NEWS, README, THANKS, TODO, configure.ac, src/FbiStuffPcx.cpp, src/Makefile.am: Now supporting PCX files reading thanks to code contributed by Mohammed Isam. 2014-11-30 11:21 dezperado * [r665] NEWS, TODO, configure.ac, src/FbiStuff.cpp: made the configure output a little more informative/readable/compact. added .tar.gz to the (sic!) hardcoded libarchive handled extensions. 2014-11-30 10:29 dezperado * [r664] NEWS, TODO, configure.ac, src/FbiStuffBmp.cpp, src/Makefile.am: introduced the ability to disable BMP file support with --disable-bmp. 2014-11-30 00:44 dezperado * [r663] configure.ac, src/FbiStuffXyz.cpp: Added a --enable-xyz switch to enable the bogus xyz sample format decoder. 2014-11-29 14:37 dezperado * [r662] src/FbiStuffJasPer.cpp: svn ps svn:keywords LastChangedDate src/FbiStuffJasPer.cpp 2014-11-29 14:35 dezperado * [r661] src/FbiStuffJasPer.cpp: ooops: removed a hardcoded '#define FIM_WITH_LIBJASPER 1'. 2014-11-29 14:14 dezperado * [r660] NEWS, TODO, configure.ac, src/FbiStuffJasPer.cpp, src/Makefile.am: A first, experimental JPEG-2000 support via JasPer. 2014-11-29 14:09 dezperado * [r659] src/FbiStuffXyz.cpp: Got rid of a risky conversion in FbiStuffXyz.cpp. 2014-11-29 00:04 dezperado * [r658] TODO, src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/FbiStuff.cpp, src/Image.cpp, src/Viewport.cpp, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h, src/readline.cpp: enabled the code to be compiled with -std=gnu++11. 2014-11-28 22:49 dezperado * [r657] TODO, src/CommandConsole.cpp, src/FbiStuffJpeg.cpp, src/Image.cpp: Using snprintf instead of sprintf in accepting the 'desc' string. Thinking about the future of JPEG/EXIF and background loaders. 2014-11-27 19:45 dezperado * [r656] src/Image.cpp: Fixing a segfault case. 2014-11-27 09:34 dezperado * [r655] doc/fimrc.man, src/fim.h, src/fimrc, src/help.cpp: yesterday forgot to version this change of defaults. C-k binding (comments display) and a nice (nicer than %v) _want_caption_status are now the default. 2014-11-26 20:28 dezperado * [r654] doc/fimrc.man, src/Image.cpp, src/fim.h: added two variables (_use_exiftool,_exiftool_comment) that respectively control and use exiftool's capabilities. 2014-11-26 20:17 dezperado * [r653] TODO, configure.ac, src/Image.cpp: added an exiftool interface, which can be activated via --enable-exiftool and updates the _comment variable with output from exiftool. 2014-11-25 22:55 dezperado * [r652] src/Image.cpp: Builds without FIM_WANT_CUSTOM_INFO_STATUS_BAR set were broken. Fix. 2014-11-24 10:13 dezperado * [r651] src/Browser.cpp, src/fim.h, src/help.cpp: _display_status_fmt is now a customizable format string. 2014-11-23 02:50 dezperado * [r650] src/Image.cpp: the last commit used to show a quantity to be zero in the format string function. fix. 2014-11-23 01:53 dezperado * [r649] src/FbiStuffJpeg.cpp: A few changes in the (non active) libexif code. 2014-11-23 01:52 dezperado * [r648] TODO, doc/fimrc.man, src/Image.cpp, src/fim.h, src/fimrc, src/help.cpp: Now the caption as well can be set to a custom format string. 2014-11-23 01:28 dezperado * [r647] TODO, src/CommandConsole.cpp, src/Image.cpp, src/Image.h, src/help.cpp: generalized a bit the custom info string mechanism and enabling it for the window caption. 2014-11-23 01:25 dezperado * [r646] src/Image.cpp, src/Image.h: made a few Image accessors const. 2014-11-23 00:17 dezperado * [r645] doc/fimrc.man, src/CommandConsole.cpp, src/Namespace.cpp, src/Namespace.h, src/fim.h: FIM_VID_WANT_CAPTION_STATUS now allows specification of a custom fixed string. 2014-11-22 22:45 dezperado * [r644] src/Browser.cpp, src/fim.h, src/help.cpp: introduced an experimental FIM_VID_DISPLAY_STATUS_FMT variable. 2014-11-22 22:25 dezperado * [r643] src/Browser.cpp, src/common.cpp, src/common.h, src/fim.h: an internal experimental switch for optionally displaying basename of displayed filenames (instead of full path) in the status bar. 2014-11-20 11:45 dezperado * [r642] TODO, doc/FIM.TXT: Added mention to FbiStuffXyz.cpp to the FAQ. 2014-11-19 22:53 dezperado * [r641] TODO, src/FbiStuffXyz.cpp, src/Makefile.am: A working sample file format decoder example (disabled). 2014-11-19 22:49 dezperado * [r640] src/FbiStuffXyz.cpp: Introducing a sample file format decoder source, FbiStuffXyz.cpp . 2014-11-17 18:50 dezperado * [r639] src/Image.cpp: for some weird reason the scaling routine used to display a notice about prefetching... got rid of this. 2014-11-17 18:47 dezperado * [r638] src/Image.cpp: an ugly way to force the proper status display after prefetch after load. 2014-11-17 18:22 dezperado * [r637] src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffGif.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffMatrixMarket.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffPs.cpp, src/FbiStuffText.cpp, src/FbiStuffTiff.cpp, src/FbiStuffUFRaw.cpp, src/FontServer.cpp, src/fim_wrappers.h: may have improved alignment properties (towards this end fim_calloc still needs a revamp) of a few allocatable structs, with changes like e.g.: - h = (struct jpeg_state *)fim_calloc(sizeof(*h),1); + h = (struct jpeg_state *)fim_calloc(1,sizeof(*h)); 2014-11-17 18:05 dezperado * [r636] src/CommandConsole.cpp, src/FramebufferDevice.cpp, src/common.cpp, src/fim_wrappers.h: introduced a handy macro 'fim_stralloc'. 2014-11-17 08:03 dezperado * [r635] src/SDLDevice.cpp: four SDL hardcoded bindings for mouse wheel and extra buttons. 2014-11-16 22:16 dezperado * [r634] TODO, src/CommandConsole.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffPng.cpp, src/Image.cpp: added (in a rather quick, incomplete and dirty way) a way to display JPEG (and, not anymore the laconical "Exif" reminder) and PNG comments, via the %k specifier for _info_fmt_str. 2014-11-16 22:13 dezperado * [r633] README, configure.ac, doc/FIM.TXT, scripts/maintenance/cron-rsync.sh.in: First commit on the Savannah SVN repository. Changes to accommodate transition from http://code.autistici.org/svn/fim/trunk/ to http://svn.savannah.nongnu.org/svn/fbi-improved/ 2014-09-24 23:23 dezperado * [r632] NEWS, configure.ac: the configure script use to advertise a non-existent `make fim' target. eliminated this. (missing target noticed by Arturo Rinaldi). 2014-09-14 19:04 dezperado * [r631] NEWS, src/SDLDevice.cpp, src/Viewport.cpp, src/Viewport.h, src/fim.h: wrote a mouse-driven image panning functionality for sdl (non active by default). bugfix to Viewport::pan_left and Viewport::pan_right. 2014-09-01 17:41 dezperado * [r629] TODO, src/fim.cpp: Updated the mention to _scale_style=' ' in branches/0.4 . 2014-09-01 17:24 dezperado * [r628] TODO, doc/fim.man, doc/fimrc.man, src/fim.cpp: fixed documentation note about _scale_style and changed the hardcoded default memory cache occupation limit. 2014-08-31 10:44 dezperado * [r627] NEWS, src/Cache.cpp, src/fim.h: The viewport info / position cache will now be freed slightly independently from images; after the triggering of a (for now) hardcoded cache size limit threshold. 2014-08-31 01:14 dezperado * [r626] TODO, src/Cache.cpp, src/fim.h, src/fimrc, src/help.cpp: Effectively activated the max cached memory (_max_cached_memory) cache eviction mechanism. 2014-08-30 12:43 dezperado * [r625] src/FbiStuffMagick.cpp, src/Viewport.cpp, src/fim.cpp: Fix to when a single, non-decodeable file is (unsuccessfully) attempted to be loaded. Extended (or rather, resuscitated) the workaround for libGraphicsMagick failing in rendering txt files. 2014-08-30 08:31 dezperado * [r624] src/Browser.cpp, src/Cache.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp, src/DebugConsole.h, src/FimWindow.cpp, src/Namespace.h, src/SDLDevice.cpp, src/Viewport.cpp, src/fim.h: Adjusting to respect the proper classes members initialization order. 2014-08-29 23:47 dezperado * [r623] NEWS, TODO, src/Browser.cpp, src/Cache.cpp, src/Cache.h, src/Viewport.cpp, src/Viewport.h, src/fim.h: Implemented a first, rudimentary 'viewport' cache. 2014-08-29 21:42 dezperado * [r622] src/Browser.cpp: Small readability fixes of Browser methods code. 2014-08-29 20:50 dezperado * [r621] Makefile.am, THANKS, configure.ac, doc/Makefile.am, scripts/Makefile.am, scripts/tests/font.sh, src/Makefile.am: Adapted the trunk to the last two revisions of 0.4. Removed a couple of spurious lines from a script in 0.4. 2014-07-23 20:30 dezperado * [r618] src/Makefile.am: Better notation in the Makefile.am. 2014-04-08 07:18 dezperado * [r614] src/FbiStuff.cpp: avoiding using a pipe with libarchive. 2014-04-07 22:43 dezperado * [r613] configure.ac, src/FbiStuff.cpp: preliminary, unfinished toy interfacing with libarchive. 2014-04-05 20:35 dezperado * [r612] configure.ac, src/FbiStuff.cpp, src/FbiStuffUFRaw.cpp: initial experimental support for decoding files with ufraw. 2013-12-12 20:43 dezperado * [r611] src/Browser.cpp: ghost patch for proof-of-concept testing of sort-by-date possibility. 2013-12-12 20:15 dezperado * [r610] NEWS, TODO, configure.ac: changed librsb library detection. 2013-11-07 22:37 dezperado * [r609] TODO, src/AADevice.cpp, src/CommandConsole.cpp, src/FramebufferDevice.cpp, src/fim.h: fixes for build broken --disable-scripting. however, `make tests' fails so more is needed. 2013-11-07 21:57 dezperado * [r608] TODO, doc/fimrc.man, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h, src/help.cpp: cleaning up a little CommandConsole internals. 2013-11-07 20:27 dezperado * [r607] src/Browser.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/FimWindow.cpp, src/fim.h: introduced macro "FIM_AUTOCMD_EXEC autocmd_exec", active only if FIM_AUTOCMDS is defined (thus saving much #ifdef/#endif code). 2013-11-07 19:55 dezperado * [r606] TODO, src/Browser.cpp, src/Browser.h: introduced backward regexp based search for regexp_goto. got rid of regexp_goto_next (merged in regexp_goto). 2013-11-06 20:52 dezperado * [r605] NEWS, src/FbiStuff.cpp, src/fim_types.h: with gcc, declaring the scaling functions pointers as __restrict__'ed, resulting in a slightly (e.g. I see 10% here) faster scaling code. 2013-11-06 18:33 dezperado * [r604] src/AADevice.cpp, src/AADevice.h, src/Arg.cpp, src/Arg.h, src/Benchmarkable.h, src/Browser.h, src/CACADevice.cpp, src/CACADevice.h, src/Cache.h, src/Command.h, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DebugConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FimWindow.cpp, src/FimWindow.h, src/FramebufferDevice.h, src/Image.cpp, src/Image.h, src/Imlib2Device.h, src/Namespace.h, src/SDLDevice.h, src/Var.h, src/Viewport.cpp, src/Viewport.h, src/fim_string.cpp, src/fim_string.h: (except for FramebufferDevice) moving a lot of method definitions from the header to the respective cpp file. () -> (void) in the headers method declarations. 2013-11-06 17:43 dezperado * [r603] src/Namespace.cpp, src/Namespace.h, src/Var.cpp, src/Var.h, src/grammar.h: easing printout of Var and Namespace instances. added an option to Namespace's get variables method. 2013-11-02 22:35 dezperado * [r602] src/Namespace.cpp, src/Namespace.h: introduced a preprocessor symbol (for now undefined) to disable CommandConsole existence requirement in Namespace... 2013-11-01 18:01 dezperado * [r601] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/DebugConsole.h, src/FimWindow.cpp, src/Image.cpp, src/Namespace.cpp, src/Namespace.h, src/Viewport.cpp, src/fim.h: working to decouple Namespace from CommandConsole. 2013-11-01 16:43 dezperado * [r600] TODO, src/CommandConsole-var.cpp, src/CommandConsole.h, src/Makefile.am, src/Namespace.cpp, src/Namespace.h: CommandConsole now extends Namespace. moved Namespace.cpp's CommandConsole:: stuff to new CommandConsole-var.cpp. and of course, "svn ps svn:keywords LastChangedDate src/CommandConsole-var.cpp" 2013-11-01 15:18 dezperado * [r599] configure.ac, src/FontServer.cpp, src/FontServer.h, src/FramebufferDevice.h: :%s/FIM_X_DISPLAY_MISSING/FIM_USE_X11_FONTS/g (inverted preprocessor conditionals consequently) 2013-11-01 15:13 dezperado * [r598] src/Makefile.am, src/common.cpp, src/fim.h, src/fim_string.cpp, src/fim_string.h, src/string.cpp, src/string.h: string.h -> fim_string.h string.cpp -> fim_string.cpp 2013-11-01 15:07 dezperado * [r597] src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/Var.cpp, src/Var.h, src/fim.cpp: moved the help db-related methods of Var to separate functions. 2013-10-30 17:17 dezperado * [r596] src/AADevice.cpp, src/Browser.cpp, src/CACADevice.cpp, src/Cache.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp, src/DisplayDevice.cpp, src/FbiStuff.cpp, src/FbiStuffLoader.cpp, src/FbiStuffMagick.cpp, src/FbiStuffPs.cpp, src/FimWindow.cpp, src/FontServer.cpp, src/FramebufferDevice.cpp, src/Image.cpp, src/Imlib2Device.cpp, src/Namespace.cpp, src/SDLDevice.cpp, src/Var.cpp, src/Viewport.cpp, src/common.cpp, src/fim.cpp, src/readline.cpp, src/string.cpp: sed -i 's/() *$/(void)/g' *.cpp sed -i 's/() *const *$/(void)const/g' *.cpp and some fixes where that was not correct. 2013-10-30 17:08 dezperado * [r595] src/AADevice.h, src/Browser.h, src/CACADevice.h, src/Cache.h, src/CommandConsole.h, src/DebugConsole.h, src/DisplayDevice.h, src/FbiStuff.h, src/FbiStuffLoader.h, src/FimWindow.h, src/FontServer.h, src/FramebufferDevice.h, src/Image.h, src/Imlib2Device.h, src/SDLDevice.h, src/Viewport.h, src/common.h, src/readline.h, src/string.h: petty substitution of '();' with '(void);' in method/function declarations/definitions in *.h files. 2013-10-30 16:59 dezperado * [r594] NEWS, src/AADevice.cpp, src/AADevice.h, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Imlib2Device.cpp, src/Imlib2Device.h, src/SDLDevice.cpp, src/SDLDevice.h, src/Viewport.cpp: the status bar will not always cover image space. 2013-10-30 16:06 dezperado * [r593] doc/fim.man, src/fim.cpp: removed an obsolete documentation line. 2013-10-26 13:18 dezperado * [r592] src/FbiStuff.cpp: allocating pixelmaps through the newly introduced fim_pm_alloc (I forgot this file in last commit). 2013-10-26 13:17 dezperado * [r591] src/Image.cpp, src/common.cpp, src/common.h: allocating pixelmaps through the newly introduced fim_pm_alloc. 2013-10-26 10:34 dezperado * [r590] src/FbiStuffPng.cpp: fix to the png code according to new versions: assuming no definition (only declaration) of png_structp. tested with PNG_LIBPNG_VER 10249 and 10606. 2013-10-26 09:47 dezperado * [r589] NEWS, TODO, src/FbiStuffGif.cpp: the previous fix to FbiStuffGif.cpp was insufficient: this should be (tested with 5.0.5 and 4.1); trunk and 0.4 branch. update to NEWS. 2013-10-25 16:04 dezperado * [r588] src/FbiStuffGif.cpp: a change to fix effects of removal of PrintGifError since giflib-4.2, still keeping backward compatibility. 2013-10-22 17:25 dezperado * [r587] src/FbiStuff.cpp, src/SDLDevice.cpp, src/fim.h: bypassing a possible bug in sdl image display when invoking SDL_UpperBlit with extra large images (0.4 branch, trunk). readability changes in trunk. byte_size of mipmap type correction in trunk. 2013-10-20 19:02 dezperado * [r586] doc/fimrc.man, src/fimrc: commented the window-related aliases in the default fimrc. added a binding of 'H' to to-image-height scaling. 2013-10-20 18:30 dezperado * [r585] src/Browser.cpp, src/Viewport.cpp, src/Viewport.h, src/fimrc: beefed the align functionality by enbling left/right and adding left,right,top,bottom,center default aliases, as well as binding 'c' to the center alignment. 2013-10-20 17:56 dezperado * [r584] doc/fimrc.man, src/Browser.cpp, src/Image.cpp, src/Viewport.cpp, src/Viewport.h, src/fim.h, src/help.cpp: enabled image centering on redisplay (this may be a problem so it shall be reviewed). added %c specifier for centering information. 2013-10-20 15:45 dezperado * [r583] src/Browser.cpp, src/Cache.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp, src/FimWindow.cpp, src/Image.cpp, src/Imlib2Device.cpp, src/Viewport.cpp, src/fim.cpp, src/fimrc, src/lex.lex: introduced default key bindings for ^ and $. apart from this, only readability changes. 2013-10-20 15:04 dezperado * [r581] src/Browser.cpp, src/common.h, src/fim.h, src/lex.lex: fixed a bug (repeated input of '$' line leading to hopping images back). 2013-10-19 21:11 dezperado * [r580] doc/fimrc.man, src/Image.cpp, src/fim.h, src/help.cpp: added %m specifier for getting mipmap mem info. 2013-10-19 20:33 dezperado * [r579] NEWS, src/Cache.cpp, src/FbiStuff.cpp, src/FbiStuff.h, src/FbiStuffMatrixMarket.cpp, src/Image.cpp, src/Image.h, src/fim.h, src/help.cpp: completed and activated mip map mechanism. 2013-10-19 12:19 dezperado * [r578] src/FbiStuff.cpp, src/FbiStuff.h, src/FbiStuffLoader.h: declaring as const the arguments of many pixel manipulating functions. 2013-10-19 11:19 dezperado * [r577] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/Cache.h, src/Image.cpp, src/Image.h, src/Viewport.cpp, src/fim.h: introduced commandConsole.browser_.cache_.dummy_img_ . 2013-10-19 08:23 dezperado * [r576] src/Browser.cpp, src/Browser.h, src/Viewport.cpp, src/fim.h: petty optimizations; code readability changes; in browser/vieweport. 2013-10-19 06:53 dezperado * [r575] src/Image.cpp, src/Image.h: an enum to express rotation values. 2013-10-18 22:29 dezperado * [r574] configure.ac, src/CommandConsole.cpp, src/Image.cpp, src/Image.h, src/common.cpp, src/common.h, src/fim.h: formatting changes + return pruning + conditional GB/PG support in fim_snprintf_XB. 2013-10-18 21:46 dezperado * [r573] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/Cache.h, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DebugConsole.h, src/FimWindow.cpp, src/FimWindow.h, src/Image.cpp, src/Image.h, src/Namespace.h, src/Viewport.cpp, src/Viewport.h, src/fim.h, src/help.cpp: introduced %C and %T specifiers to get memory usage info. 2013-10-15 16:41 dezperado * [r572] VERSION, configure.ac, src/Browser.cpp, src/Cache.cpp, src/FramebufferDevice.cpp, src/Namespace.cpp: mostly code readability measures and extra 'return' statements pruning. 2013-10-14 21:08 dezperado * [r571] NEWS, README, configure.ac, src/AADevice.cpp, src/Browser.cpp, src/Cache.cpp, src/CommandConsole.cpp, src/DisplayDevice.cpp, src/FbiStuff.cpp, src/FramebufferDevice.cpp, src/Namespace.cpp, src/SDLDevice.cpp, src/fim.cpp: cleaning up the code; mainly making it more readable. 2013-10-12 16:54 dezperado * [r569] INSTALL, README, configure.ac, scripts/maintenance/yacc2grammar.awk, src/Makefile.am, src/b2ba.c, src/fim.cpp, src/fimgs: modest README update, with Debian install info. removed INSTALL file. corrected some dates/version information. Imlib2 configure reporting and makefile fixes. adapting an awk script to mawk (we were using only gawk, until now). 2013-10-12 14:31 dezperado * [r568] configure.ac: updating configure.ac for autoconf-2.69. 2013-10-11 15:44 dezperado * [r565] ChangeLog, NEWS, doc/fimrc.man, src/fim.h, src/help.cpp: better documentation string for the status bar format string. changelog update. 2013-10-10 22:15 dezperado * [r564] src/FbiStuffText.cpp, src/Image.cpp: fixing the 0-byte corner case in the --as-text rendering mode; refining the memory/file occupation s tatus bar text printing code to display either B,KB,MB, or GB alongside with the number. 2013-10-10 18:52 dezperado * [r563] README: restoring README tainted in last commit. 2013-10-10 18:43 dezperado * [r562] README, configure.ac, doc/fim.man, doc/fimrc.man, src/FbiStuff.cpp, src/FbiStuffText.cpp, src/FontServer.cpp, src/FontServer.h, src/Makefile.am, src/fim.cpp, src/fim.h, src/help.cpp: implemented a for-fun --as-text mode; that is, rendering printable text of files (almost) as in a text file viewer. 2013-10-10 16:39 dezperado * [r561] TODO, configure.ac, src/Image.cpp, src/fim.h, src/help.cpp: introduced the --enable-custom-status-bar configure option to enable printf-like customizable status bar info. 2013-10-09 22:42 dezperado * [r560] TODO, doc/fim.man, src/CommandConsole.cpp, src/Imlib2Device.cpp, src/fim.h: leftovers of some tests for future work. 2013-10-09 22:37 dezperado * [r559] src/FbiStuffPdf.cpp, src/testdir/test7.in: minor modifications for my poppler-0.24 installatio. change to a test case: I'm unsure whether this is correct. 2013-09-02 18:56 dezperado * [r558] src/AADevice.cpp, src/Cache.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/FbiStuffBmp.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffPdf.cpp, src/fim.cpp: comment changes. 2013-07-11 12:58 dezperado * [r557] src/FramebufferDevice.h: fixed a bug in which in 16 bit mode lines and text were displayed in the wrong colour (one byte was being written to pixel memory instead of two). 2013-07-04 21:07 dezperado * [r556] src/AADevice.h, src/Arg.h, src/Benchmarkable.h, src/Browser.h, src/CACADevice.h, src/Cache.h, src/Command.h, src/CommandConsole.h, src/DebugConsole.h, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FbiStuff.h, src/FbiStuffFbtools.h, src/FbiStuffList.h, src/FbiStuffLoader.h, src/FimWindow.h, src/FontServer.h, src/FramebufferDevice.h, src/Image.h, src/Imlib2Device.h, src/Namespace.h, src/SDLDevice.cpp, src/SDLDevice.h, src/Var.h, src/Viewport.cpp, src/Viewport.h, src/common.h, src/fim.h, src/fim_limits.h, src/fim_plugin.h, src/fim_stream.h, src/fim_types.h, src/fim_wrappers.h, src/lex.h, src/readline.cpp, src/readline.h, src/string.cpp, src/string.h: putting commented preprocessor symbol information after every #endif and #else, for the remaining *.cpp and *.h files, third round. 2013-07-04 19:56 dezperado * [r555] src/DebugConsole.cpp, src/DisplayDevice.cpp, src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffFbtools.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffLoader.cpp, src/FbiStuffMagick.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffTiff.cpp, src/FimWindow.cpp, src/FontServer.cpp, src/FramebufferDevice.cpp, src/Image.cpp, src/Imlib2Device.cpp, src/Makefile.am, src/Namespace.cpp, src/fim.cpp, src/fim_plugin.cpp, src/interpreter.cpp: putting commented preprocessor symbol information after every #endif and #else, for many *.cpp files, second round. 2013-07-04 17:38 dezperado * [r554] src/AADevice.cpp, src/Browser.cpp, src/CACADevice.cpp, src/Cache.cpp, src/Command.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/common.cpp: putting commented preprocessor symbol information after every #endif and #else, for each [ABCc]*cpp file. 2013-07-04 09:28 dezperado * [r553] NEWS, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/fim.cpp: using seeding before random shuffling. differentiating --random from --random-no-seed. 2013-06-20 11:23 dezperado * [r552] src/Browser.cpp: restoring Browser.cpp: previous commit's change was unintented. 2013-06-20 11:21 dezperado * [r551] src/Browser.cpp, src/FbiStuff.cpp, src/FbiStuffBmp.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/Image.cpp, src/common.cpp, src/common.h, src/fim.h, src/help.cpp: first changes towards the integration of zlib, for reading transparently gz-compressed files. 2013-05-20 10:28 dezperado * [r550] NEWS, TODO, src/AADevice.cpp, src/AADevice.h, src/Browser.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/common.cpp: formatting/readability oriented code changes. 2013-05-11 13:28 dezperado * [r549] src/CommandConsole.cpp, src/Image.cpp, src/fim.h, src/help.cpp: implemented a custom image info string functionality (off by default). 2013-05-01 20:40 dezperado * [r548] TODO, src/Image.cpp, src/Image.h, src/fim.h: first sketch of support for image file size and memory occupation display (off by default). 2013-04-27 07:50 dezperado * [r547] src/Browser.cpp, src/SDLDevice.cpp, src/fim.h: just readability changes. 2013-04-26 22:38 dezperado * [r546] TODO, src/CommandConsole.cpp, src/DisplayDevice.cpp: just readability changes. 2013-04-09 17:09 dezperado * [r545] src/DisplayDevice.cpp: Added Brian Murray's suggested patch to use sleep() when !isatty(stdin) in DisplayDevice::catchInteractiveCommand. 2013-04-07 20:43 dezperado * [r544] src/AADevice.cpp, src/Browser.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/FbiStuff.cpp, src/FbiStuffBit24.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffPdf.cpp, src/FimWindow.cpp, src/FontServer.cpp, src/Image.cpp, src/Imlib2Device.cpp, src/SDLDevice.cpp, src/Viewport.cpp, src/common.cpp, src/fim.h, src/interpreter.cpp, src/readline.cpp, src/string.cpp: several minor language standard adherence fixes. in two cases, fixed if-if-else branch ambiguities. in one case, preventing an uninitialized variable from being used. 2013-03-31 17:31 dezperado * [r543] ChangeLog, NEWS, configure.ac, src/FbiStuffPdf.cpp: patch for POPPLER_VERSION_MINOR>=22. updating to NEWS and ChangeLog. 2013-03-22 23:05 dezperado * [r538] doc/fim.man, src/AADevice.cpp, src/AADevice.h, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/fim.cpp: extended the AADevice as well to get reinit options. 2013-03-22 20:08 dezperado * [r537] configure.ac, distros/Makefile.am, src/FbiStuffMatrixMarket.cpp, src/FramebufferDevice.cpp: fix to wrong rule in makefile. update of configure.ac librsb-related doc string, and matrix rendering code. comment typo fix. 2012-12-26 15:13 dezperado * [r536] src/FbiStuffMatrixMarket.cpp, src/fimgs: adapting to the new rsb.h interface. added 'shopt -s nocasematch' to fimgs. 2012-12-25 00:33 dezperado * [r535] src/FbiStuffMatrixMarket.cpp: updated way of invoking rsb_util_get_matrix_dimensions 2012-08-10 23:51 dezperado * [r534] Makefile.am, TODO, configure.ac, src/FbiStuffJpeg.cpp: slightly better jpeglib errors handling. configure typo fix. TODO notes. using 'ulimit' from within Makefile testing. 2012-08-04 12:02 dezperado * [r533] doc/fimrc.man, src/Image.cpp: trunk: less stringent rules in inner desaturate() and negate() options in Image class. man page update. 2012-08-04 11:38 dezperado * [r532] TODO, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/Image.cpp, src/Image.h, src/Viewport.cpp, src/fim.h, src/fimrc, src/help.cpp: trunk: introduced a 'desaturate' command, and implemented bindings for image desaturation and negation. 2012-07-21 12:30 dezperado * [r531] src/FbiStuffPs.cpp: in the ps decoder, inverted r and b channels. 2012-07-18 20:30 dezperado * [r530] BUGS, INSTALL.TXT, README, TODO, configure.ac, debian/control, distros/fedora/fim.spec, doc/fim.man, src/fim.cpp, src/fimrc, var/index.html.in: implementing Justin B Rye's (debian Bug#679622) suggestions about english for documentation and metadata. 2012-07-18 18:44 dezperado * [r529] TODO, src/FbiStuffPdf.cpp: trunk: minimal hack to allow build with poppler 0.20.2 (that is, update to new poppler's API (though it's difficult to compile-time chck whether using an older poppler version because of missing appropriate preprocessor symbols)). 2012-03-08 11:54 dezperado * [r528] doc/fim.man, src/fim.h: trunk: the imlib2 device was not in the list of the ones available in the man page and help output. 2012-03-02 14:19 dezperado * [r527] src/FbiStuff.cpp, src/common.cpp, src/common.h: trunk: empty regular files will not be given graphicsmagick as a loader (this shall be fixed in version 1.3.13 of graphicsmagick) 2012-02-11 00:27 dezperado * [r526] configure.ac, scripts/Makefile.am: trunk: adding the font.sh script to the list of distributed files. configure modification to allow (cut-down) static builds. 2012-02-10 23:47 dezperado * [r525] Makefile.am, TODO, scripts/tests/version.sh, src/testdir/Makefile: trunk: adjusted some error reporting printout. 2012-02-10 23:41 dezperado * [r524] Makefile.am, scripts/tests/font.sh: trunk: adding a script for testing (basics) of font handling. 2012-01-29 16:08 dezperado * [r523] TODO, src/FbiStuff.cpp: notes in the TODO. when scaling to 1, will use copy instead of scaling. 2011-12-17 17:36 dezperado * [r522] src/FbiStuffMatrixMarket.cpp: trunk: changed the call to librsb responsible for matrix rendering (adapted to the new API). 2011-11-06 10:22 dezperado * [r521] configure.ac: configure fix: better `svnversion` parsing, and some more commentary to a configure option. 2011-11-06 09:19 dezperado * [r520] src/FontServer.cpp: added /usr/lib/kbd/consolefonts/lat9-16.psf.gz to the list of default fonts. 2011-11-05 22:07 dezperado * [r519] doc/fim.man: man page update according to last commit. 2011-11-05 21:56 dezperado * [r518] configure.ac, src/FontServer.cpp, src/Makefile.am, src/fim.h: configure options to specify a custom font to hardcode ar build time (--custom-hardcoded-consolefont), or a custom font to check for as first in the fonts list (--default-consolefont). 2011-11-04 16:29 dezperado * [r517] Makefile.am, NEWS, README, configure.ac, doc/fim.man, src/FontServer.cpp, src/Makefile.am, src/b2ba.c, src/default_font_byte_array.h, src/fim.cpp, src/fim.h, var/fonts, var/fonts/Lat15-Terminus16.psf: added a new, valuable feature: that of a hardcoded font file. this enables font display on non-Linux or non-consolefonts-equipped setups. added the appropriate copyright notice for the font file (in the README). 2011-11-01 12:33 dezperado * [r516] src/FontServer.cpp: on bad magic numbers found, the console font loading mechanism did not probe the remaining fonts in the supplied list. fixed this. 2011-10-04 22:23 dezperado * [r515] src/Imlib2Device.cpp: the imlib2 stub code does not hand loops now while reporting input. 2011-10-04 22:13 dezperado * [r514] src/CommandConsole-init.cpp, src/Imlib2Device.cpp, src/Imlib2Device.h: enabling basic fullscreen mode to the imlib2 device. 2011-10-03 20:56 dezperado * [r513] src/Imlib2Device.cpp, src/fim.h: the imlib2/X input system recognize most of the useful keys. preventing from updating the caption (since the status line is active by default, for now) in imlib2 mode. 2011-10-02 19:53 dezperado * [r512] src/CommandConsole-init.cpp, src/Imlib2Device.cpp, src/Imlib2Device.h, src/fim.cpp, src/fim.h, src/readline.cpp: the imlib2 fim visualization device is not yet complete, but has its main features working. 2011-10-02 19:30 dezperado * [r511] src/SDLDevice.cpp: typo fix to the previous commit. 2011-10-02 19:23 dezperado * [r510] src/SDLDevice.cpp: minifix to the fill_rect function of SDL. 2011-10-01 10:28 dezperado * [r509] src/Imlib2Device.cpp, src/Imlib2Device.h: actually, the previous commit did not contain the Imlib2Device (so, it won't build, either). 2011-10-01 10:24 dezperado * [r508] configure.ac, src/CommandConsole-init.cpp, src/FontServer.cpp, src/FontServer.h, src/FramebufferDevice.h, src/SDLDevice.cpp, src/fim.cpp, src/fim.h: configure fixes for imlib. empty (stub) source files for an imlib-based display device. corrected using a symbolic return value in the sdl device code. renamed X_DISPLAY_MISSING to FIM_X_DISPLAY_MISSING, as it clashes with non-fim X code. 2011-10-01 10:10 dezperado * [r507] src/AADevice.cpp, src/Command.h, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/FimWindow.cpp, src/FimWindow.h, src/Makefile.am, src/Viewport.cpp, src/Viewport.h, src/Window.cpp, src/Window.h, src/fim.h: renaming Window to FimWindow (also sources). 2011-10-01 08:46 dezperado * [r506] configure.ac: adapted the configure script to recognize imlib2. 2011-09-24 08:56 dezperado * [r505] TODO, src/FbiStuff.cpp, src/common.cpp: update (or let's say, fix) to the is_file function. in some mipmap computing code (still inactive, though). TODO massive update. 2011-09-21 21:22 dezperado * [r504] src/FbiStuff.cpp, src/Makefile.am, src/fim.h, src/fim_plugin.cpp, src/fim_plugin.h: writing an embryonic version of what shall be a plugin interface for fim, featuring an opencv-based example. 2011-09-18 18:58 dezperado * [r503] doc/fim.man, doc/fimrc.man, src/CommandConsole-help.cpp, src/FbiStuffFbtools.cpp, src/fim.cpp, src/fim.h: doc fixes: documented signal-triggered return code; man pages references are now underlined, in the fim/fimrc man pages. 2011-09-18 16:27 dezperado * [r502] src/SDLDevice.cpp: using function SDL_UpperBlit in SDL driver's common, unmirrored, unflipped display case. 2011-09-17 22:20 dezperado * [r501] src/CommandConsole-help.cpp, src/common.cpp, src/common.h, src/fim.cpp: slight code changes for reducing total code size. 2011-09-17 21:17 dezperado * [r500] TODO, scripts/Makefile.am, scripts/maintenance/configure-minimal.sh, scripts/maintenance/configure-only-fb-mini.sh, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/fim.cpp: in two new configure wrapper scripts; one for a minimal build, another for a fb-only one. fixes to work well with the fimrc disabled (it was handled wrong). fixes to not compile the bitmap rendering code at all, if deselected. misc (related) compilation fixes. 2011-09-17 20:15 dezperado * [r499] configure.ac, scripts/maintenance/configure-live.sh, src/CommandConsole.cpp: added a configure option to disable fim_history file load/save. updated the live configure wrapper script. 2011-09-17 09:55 dezperado * [r498] src/FbiStuffMatrixMarket.cpp: fix to the matrix market decoder: detecting invalid (negative) matrix sizes. still need a memory exhaustion prevention check. 2011-09-12 23:40 dezperado * [r497] src/FbiStuffMagick.cpp: circumventing libgraphicsmagick's bug #3408130: NULL pointer referencing while loading an empty *.txt/*.text file. 2011-09-10 14:04 dezperado * [r496] src/AADevice.cpp, src/AADevice.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fim_types.h: more strictness and typedef based diversification of different integer types. 2011-09-10 13:28 dezperado * [r495] src/AADevice.cpp, src/AADevice.h, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/FramebufferDevice.cpp, src/Image.cpp, src/SDLDevice.cpp, src/SDLDevice.h, src/Viewport.cpp, src/Window.cpp, src/fim.h, src/fim_stream.cpp, src/fim_stream.h, src/fim_types.h: extending the use of fim_err_t, fim_int, and introduced an enum for redraw states and an int typedef. 2011-09-10 12:48 dezperado * [r494] src/DebugConsole.cpp, src/DebugConsole.h: enforcing use of fim_err_t in the DebugConsole class. 2011-09-10 10:47 dezperado * [r493] src/AADevice.cpp, src/Browser.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp, src/FbiStuffBmp.cpp, src/FbiStuffDjvu.cpp, src/FramebufferDevice.cpp, src/SDLDevice.cpp, src/common.cpp, src/fim.cpp, src/yacc.ypp: :%s/char/fim_char_t/gc in more files. 2011-09-10 10:38 dezperado * [r492] src/CACADevice.h, src/DisplayDevice.cpp, src/FontServer.cpp, src/defaultConfiguration.cpp, src/examples.h, src/fim.cpp, src/fim.h, src/fim_stream.cpp, src/fim_stream.h, src/lex.h, src/lex.lex, src/readline.cpp, src/string.cpp, src/string.h: :%s/char/fim_char_t/gc in more files. 2011-09-10 10:23 dezperado * [r491] src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.h, src/FbiStuffList.h, src/FontServer.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Makefile.am, src/Var.h, src/Viewport.cpp, src/Viewport.h, src/grammar.h, src/readline.h: enforcing the use of fim_char_t in further source files. 2011-09-10 10:04 dezperado * [r490] src/FbiStuff.cpp, src/FbiStuff.h, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffGif.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffLoader.h, src/FbiStuffMagick.cpp, src/FbiStuffMatrixMarket.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffPs.cpp, src/FbiStuffTiff.cpp, src/Image.cpp, src/Image.h: enforcing the use of fim_char_t in the image decoder sources. changed the decoder init function pointer signature to const char. 2011-09-10 09:39 dezperado * [r489] src/DebugConsole.cpp, src/DebugConsole.h, src/FbiStuffBit1.cpp, src/FbiStuffBmp.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffGif.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffLoader.cpp, src/FbiStuffLoader.h, src/FbiStuffMatrixMarket.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPpm.cpp, src/FbiStuffPs.cpp, src/FbiStuffTiff.cpp, src/FontServer.h, src/FramebufferDevice.cpp, src/Image.cpp, src/fim_stream.cpp, src/fim_stream.h, src/readline.cpp: :%s/unsigned char/fim_byte_t/gc in more files. 2011-09-10 09:17 dezperado * [r488] src/FbiStuff.cpp, src/FbiStuff.h, src/common.cpp: :%s/\/fim_char_t/gc :%s/unsigned char/fim_byte_t/gc in FbiStuff.{h,cpp} and some type change in internal buffers in common.c. 2011-09-10 09:03 dezperado * [r487] src/common.cpp, src/common.h, src/fim_types.h: :%s/\/fim_char_t/gc :%s/unsigned char/fim_byte_t/gc in common.{h,cpp} fim_.*_t are no more in namespace fim (for now). 2011-09-09 20:40 dezperado * [r486] src/AADevice.cpp, src/AADevice.h, src/FontServer.cpp, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h: enforcing more type strictness, especially in drawing devices code. 2011-09-09 20:14 dezperado * [r485] src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/Namespace.cpp, src/Namespace.h, src/fim.cpp, src/fim_types.h: enforcing more type strictness, especially in Namespace & co. 2011-09-09 19:54 dezperado * [r484] src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.cpp, src/interpreter.cpp, src/readline.cpp, src/readline.h: enforcing type safety, especially for fim_int, fim_char_t. 2011-09-04 14:02 dezperado * [r483] configure.ac, src/FbiStuff.cpp, src/common.cpp, src/common.h, src/fim.h, src/fim_types.h: implementing an alternate file buffering method, based on fmemopen (not activating it yet, though). configure check for fmemopen. 2011-09-04 13:49 dezperado * [r482] src/fim.cpp: in the previous commit forgot a conditional check, leading to an infinite read wait for an image in stdin. 2011-09-04 13:44 dezperado * [r481] src/fim.cpp: the file load from stdin is postponed after config loading, now. 2011-09-04 11:01 dezperado * [r480] doc/fimrc.man, src/FbiStuff.cpp, src/fim.h, src/help.cpp: in a new user variable to have more information over the file load process. 2011-09-04 10:31 dezperado * [r479] NEWS, src/Var.h, src/grammar.h: in the last commit, forgot to add the NEWS and the Var.h modifications. 2011-09-04 10:27 dezperado * [r478] doc/fim.man, doc/fimrc.man, src/Var.cpp, src/fim.cpp, src/interpreter.cpp, src/lex.lex, src/testdir/test1.in, src/testdir/test1.ok, src/yacc.ypp: language modifications: implemented bitwise OR and AND (| and &) operators. documentation fix (backtick to tick). bitwise OR/AND test case in. 2011-09-01 19:28 dezperado * [r477] doc/fim.man, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.cpp, src/fim.h, src/fim_types.h: introduced a separate type for program error codes, documenting them in the man page, and using them in the code. 2011-08-31 23:17 dezperado * [r476] doc/fim.man, doc/fimrc.man, src/CommandConsole.cpp, src/fim.cpp: documenting the return status code of the program. slight update to the 'quit' command documentation. 2011-08-31 22:55 dezperado * [r475] src/SDLDevice.cpp, src/testdir/Makefile, src/testdir/test15.in, src/testdir/test16.in, src/testdir/test16.ok: in a new (rather brittle) test for testing the dir load capability. some more verbosity for the sdl code. 2011-08-28 12:43 dezperado * [r474] src/AADevice.cpp, src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffMagick.cpp, src/FramebufferDevice.cpp, src/Makefile.am, src/SDLDevice.cpp, src/fim.h, src/fim_wrappers.h: bzero -> fim_bzero in all sources. introduced a header file with wrappers to bzero & co. set some missing svn ps. 2011-08-28 11:55 dezperado * [r473] src/Browser.cpp, src/FbiStuffMagick.cpp: some more error handling with the graphicsmagick file loader. a bit of more potential efficiency when pushing files. 2011-08-28 01:23 dezperado * [r472] src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/FbiStuff.cpp, src/Image.cpp: mainly cosmetics (macro preprocessor symbols instead of constants) & related changes. 2011-08-28 00:54 dezperado * [r471] src/Benchmarkable.h, src/CommandConsole-init.cpp, src/CommandConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/Makefile.am, src/common.cpp, src/fim.h, src/fim_types.h, src/string.cpp, src/string.h: generalized the per-object benchmarking code by introducing a specialized interface. 2011-08-27 13:35 dezperado * [r470] src/FbiStuff.cpp, src/fim.h, src/help.cpp: introduced a user-accessible variable to get the last loaded image loader string. 2011-08-21 11:17 dezperado * [r469] Makefile.am, configure.ac, doc/fim.man, doc/fimrc.man, src/fim.cpp, src/fim.h, src/help.cpp: documentation oriented fixes: the previous revision did not compile well. now using environment variables substitution in the Makefile while generating man pages. 2011-08-21 10:24 dezperado * [r468] configure.ac, doc/fim.man, src/fim.cpp, src/fim.h: miscellaneous documentation fixes, especially with constant strings. 2011-08-20 10:17 dezperado * [r467] src/DebugConsole.cpp, src/FbiStuffBmp.cpp, src/FramebufferDevice.cpp, src/SDLDevice.cpp, src/fim_types.h: substituting memset with fim_memset. removed a duplicate typedef from a header file. substituting numerical constants with a symbolic macro for a char buffer size. 2011-08-20 10:04 dezperado * [r466] src/CACADevice.cpp, src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffFbtools.cpp, src/FbiStuffGif.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffLoader.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffTiff.cpp, src/FontServer.cpp, src/FramebufferDevice.cpp, src/SDLDevice.cpp, src/fim.h, src/fim_limits.h, src/string.cpp: substituting memset(x,0,y) calls with fim_bzero(x,y) calls (boiling down to memset(x,0,y)). 2011-08-20 09:44 dezperado * [r465] TODO, VERSION, src/DisplayDevice.cpp, src/FbiStuff.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffPdf.cpp, src/FbiStuffTiff.cpp, src/FramebufferDevice.cpp, src/Makefile.am, src/fim.h, src/fim_limits.h, src/fim_types.h, src/readline.cpp, src/string.cpp: moved basic type definitions to a separate header file. added an include file with type inquiry macros. substituted several numerical constants with preprocessor symbols. added fim_types.h to the Makefile.am (it was missing, by accident). 2011-08-20 08:44 dezperado * [r464] configure.ac, src/FbiStuff.cpp, src/fim.h: loader string specification can be disabled at build time, now. 2011-08-20 08:32 dezperado * [r463] configure.ac, src/FbiStuff.cpp, src/fim.cpp, src/fim.h: the raw bits rendering feature is compile time optional now. 2011-08-20 08:15 dezperado * [r462] src/FbiStuff.cpp: some temporary code for a future full probing file loader. moved an image converting loop to a separate function. 2011-08-18 07:43 dezperado * [r461] TODO, src/FbiStuff.cpp: bugfix: the only zero-mlen-signature loader took precedence; now it does not anymore. 2011-08-17 22:30 dezperado * [r460] TODO, doc/fimrc.man, src/FbiStuff.cpp, src/FbiStuffList.h, src/FbiStuffLoader.cpp, src/FbiStuffLoader.h, src/fim.cpp, src/fim.h, src/help.cpp: introduced a variable to force a particular file loader. -V output will list available file loaders. dox update. 2011-08-17 22:20 dezperado * [r459] src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffMatrixMarket.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffTiff.cpp: renamed the file loader constant strings, so each loader has a unique name now, without spaces in it. code readability fix in FbiStuffPng.cpp. 2011-08-17 22:16 dezperado * [r458] src/FbiStuffGif.cpp: opening gifs from stdin seems to cause DGifOpenFileHandle=NULL: an extra check for this case. 2011-08-17 17:50 dezperado * [r457] configure.ac, src/FbiStuffMagick.cpp, src/Makefile.am, src/fim_types.h: a first interfacing to the GraphicsMagick library (for loading files). 2011-08-11 22:11 dezperado * [r455] ChangeLog, doc/Makefile.am: specified the right fimrc man section in Makefile.am. 2011-08-11 21:57 dezperado * [r454] ChangeLog, doc/fimrc.man: updated fimrc.man. ChangeLog update. 2011-08-11 21:28 dezperado * [r453] BUGS, README, TODO, VERSION, scripts/Makefile.am, src/Browser.cpp, src/Browser.h, src/CommandConsole-help.cpp: setting VERSION again to 0.3-beta. added the 'list clear' command. man fimrc goes to man section 5, not 1. including the yacc -> grammar script and header file. README update (thanks Marco). notes 2011-07-12 09:14 dezperado * [r452] doc/fimrc.man, src/fim.h, src/readline.cpp: the previous fix was flawed, too, so we restrict the Esc based approach to sdl only. 2011-07-12 08:44 dezperado * [r451] doc/fimrc.man, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/fim.h, src/readline.cpp, src/readline.h: workaround to the ESC inconvenience in non-sdl mode: one may press the ESC key twice (introduced a trivial state machine). 2011-07-12 07:59 dezperado * [r450] THANKS, TODO, doc/fimrc.man, src/CommandConsole-help.cpp, src/fimrc, src/readline.cpp: the previos esc-exits-readline change introduced a problem: in framebuffer mode, arrows (among others) are emitted as sequence of keys, the first of which is the ESC char. therefore the arrows did emit an ESC key, exiting the command line. fixing limiting the esc-exits-readline do SDL mode only. a real fix would encompass a state machine and interpretation of sequences of input chars, but this is a major feature. changed the order in the THANKS file. docs update. minor fimrc changes. 2011-07-11 09:30 dezperado * [r449] doc/fimrc.man, src/CommandConsole-help.cpp, src/readline.cpp: re-enabling windowed mode x11 input by using native aalib input routines. doc fixes 2011-07-11 09:24 dezperado * [r448] ChangeLog, TODO, doc/fimrc.man, src/CommandConsole-help.cpp, src/fim.h, src/readline.cpp: the Esc key will now both clear and terminate command line mode. 2011-07-11 00:14 dezperado * [r447] doc/fimrc.man, src/Browser.cpp, src/Viewport.cpp, src/Viewport.h, src/fim.cpp, src/fim.h, src/fimrc: added a further scaling style: 'b', scaling like 'a' when image is bigger than screen size. invoking fim with no options will display a very short, two lines help message. 2011-07-10 23:21 dezperado * [r446] Makefile.am, TODO, src/SDLDevice.cpp, src/fim.h: makefile fix. space binding works again. 2011-07-10 12:39 dezperado * [r445] ChangeLog, Makefile.am, NEWS, configure.ac, doc/Makefile.am, src/Makefile.am: some comments fixes in makefiles and documentation. changelog/news update. 2011-07-10 11:09 dezperado * [r444] Makefile.am, configure.ac, doc/Makefile.am, doc/fimrc.man, src/Makefile.am: introducing variables for external utilities's path used in the makefiles, and configure checks to detect the proper path. 2011-07-10 10:26 dezperado * [r443] src/Makefile.am: a horrible hack to bypass the isatty redeclaration in flex, using sed. 2011-07-09 17:45 dezperado * [r442] src/DisplayDevice.h, src/Makefile.am, src/lex.lex: trying to bypass the flex isatty bug. 2011-07-06 00:03 dezperado * [r441] src/Image.cpp: bypassing a certain error condition throwing an exception on failed image cloning; instead, setting the image invalid flag. 2011-07-05 21:12 dezperado * [r440] doc/fimrc.man, src/CommandConsole.cpp, src/DisplayDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.h, src/fimrc, src/help.cpp: in a hack to allow control of window caption (and display there the command/status line). 2011-07-02 08:33 dezperado * [r439] ChangeLog, doc/Makefile.am, var/index.html.in: www page update. doc (man -> html) generation fix in the makefile. 2011-07-02 08:01 dezperado * [r438] doc/fimrc.man, src/CommandConsole.cpp, src/CommandConsole.h, src/SDLDevice.cpp, src/defaultConfiguration.cpp: updating the symbol keys table also after sdl initialization. 2011-07-02 00:20 dezperado * [r437] ChangeLog, README, TODO, VERSION, configure.ac, doc/FIM.TXT, src/CommandConsole.cpp, src/FramebufferDevice.cpp, src/Makefile.am, src/fim.cpp, src/fim.h, src/fimrc, src/interpreter.cpp, src/readline.cpp, var/Makefile, var/index.html.in: updated VERSION. by default, trying to avoid floating point exceptions. verbose keys will prefix 0x to hex key dump. indenting ifdefs and removed a double include in src/FramebufferDevice.cpp. with cd-and-readdir, will exit on empty dir. fix to avoid unwanted readline-triggered echoing in sdl mode. some new default bindings. hardcoded fimrc will accept backslashes (although the language has still some problems with them). changelog update. doc fix. 2011-06-29 14:19 dezperado * [r436] TODO, doc/fimrc.man, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPs.cpp, src/fim.h, src/help.cpp: introduced two variables to control djvu,pdf,ps rendering dpi as well as bit-based image width. 2011-06-28 09:41 dezperado * [r435] TODO, src/Browser.cpp, src/fim.h, src/testdir/test8.in, src/testdir/test8.ok: enriched the 'goto' test case. fixes to 'goto'. 2011-06-22 12:06 dezperado * [r434] TODO, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/CommandConsole.cpp, src/Image.cpp, src/Image.h, src/fim.h, src/fimrc, src/help.cpp, src/testdir/test7.in, src/testdir/test7.ok: a horrible, untellable hack to make the cache and multipage features look as they both work together. 2011-06-21 22:08 dezperado * [r433] doc/fimrc.man, src/fimrc: typo fix: the default fimrc had an outdated 'repeat_last' binding. p.s.: the previous commit adopted the usage of command tokens for the --cd-and-readdir option. 2011-06-21 21:37 dezperado * [r432] TODO, doc/fim.man, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/SDLDevice.cpp, src/fim.cpp, src/readline.cpp: restricting terminal control to the framebuffer driver only. replacing the quit() from inside the interactive loop with a much more elegant goto. irrelevant code and dox fixes. 2011-06-21 11:26 dezperado * [r431] NEWS, doc/fimrc.man, src/AADevice.cpp, src/SDLDevice.cpp, src/fimrc: fix: sdl did not reinitialize mouse cursor display on reinit. fix: sdl did not handle CTRL + key in a correct manner. fix: sdl/aa did not update the screen size variables on resize. fix: the fullscreen toggle key commands are collapsed in a single one (F11) 2011-06-21 10:32 dezperado * [r430] TODO, doc/fimrc.man, src/AADevice.cpp, src/AADevice.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fimrc, src/readline.cpp: in sdl mode, consulting the 'best available' video mode when resizing to 0 0. introduced wait-based input mode in sdl (no more pollingb). enabled F1..F12 keys in sdl. introduced handy key bindings for toggle fullscreen sdl. 2011-06-21 08:38 dezperado * [r429] TODO, doc/fim.man, src/CommandConsole.cpp, src/SDLDevice.cpp, src/fim.cpp: added a --no-commandline command switch. implemented redisplaying (so, rescaling) on window resize. 2011-06-20 16:09 dezperado * [r428] TODO, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/common.cpp, src/common.h, src/fim.cpp, src/fim.h: added a --cd-and-readdir option. added a basedir command. 2011-06-20 13:11 dezperado * [r427] TODO, src/fim.h, src/fimrc: unified _device_string to the command line switch strings. 2011-06-20 13:07 dezperado * [r426] NEWS, TODO, configure.ac, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/CommandConsole-cmd.cpp, src/Makefile.am, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h, src/help.cpp: enabling loading of files from a supplied directory. change to che 'cd' command: now it will support change to a file's dir. 2011-06-19 14:50 dezperado * [r425] TODO, src/readline.cpp: bugfix: readline hooks for option-furnished sdl specification did not activate. 2011-06-19 14:21 dezperado * [r424] TODO, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.cpp: allowing command line triggered display reinit. doc fixes. a bugfix in the man dumping code. 2011-06-18 09:14 dezperado * [r423] TODO, doc/fim.man, src/AADevice.cpp, src/CommandConsole-init.cpp, src/DebugConsole.cpp, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.cpp: fixing oddities (output console not showing up) related to resizing, in aa and sdl modes (enforcing a minimal size). doc fixes. 2011-06-18 01:16 dezperado * [r422] TODO, src/AADevice.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp, src/SDLDevice.cpp: adapted both the sdl and aa modes to support any window size (aa will revert on zero, though). 2011-06-17 23:17 dezperado * [r421] TODO, src/AADevice.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/SDLDevice.cpp: taking the common code subset in aa/sdl's resizing code in a separate routine. 2011-06-17 20:44 dezperado * [r420] TODO, src/AADevice.cpp: inserted some (deactivated) code using aa facilities for character proportion detection (but aa fails guessing). notes. 2011-06-17 20:28 dezperado * [r419] TODO, src/AADevice.cpp, src/AADevice.h, src/DisplayDevice.cpp: utterly horrible hack allowing the window resize in aalib windowed mode. 2011-06-17 19:44 dezperado * [r418] doc/fim.man, src/CommandConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/Window.cpp, src/Window.h, src/fim.cpp, src/fim.h: utterly horrible hack allowing the window resize in SDL windowed mode. 2011-06-16 11:42 dezperado * [r417] Makefile.am, TODO, doc/Makefile.am, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/Viewport.cpp, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h, src/fimgs, src/help.cpp: forcing some variables to have some strict values to be effective. reactivated and documented some debug variables. documented several internal variables. cleaning up the minimal hardcoded config file. added an USAGE section in man fim. misc automake and doc fixes. TODO file re-sorting and cleanup. 2011-06-16 00:54 dezperado * [r416] TODO, doc/fimrc.man, src/CommandConsole-help.cpp, src/Makefile.am, src/examples.h, src/fim.h, src/help-acm.cpp, src/help.cpp: adding three auto-generated files. automake fixes. doc fixes: documenting the existing autocommands. 2011-06-15 17:23 dezperado * [r415] TODO, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/common.cpp, src/common.h, src/fim.h, src/yacc.ypp: got rid of fcmd_scale_multiply, fcmd_scale_increment, fcmd_scale_factor_grow, fcmd_scale_factor_increase, fcmd_scale_factor_decrease, fcmd_scale_factor_shrink. renamed set_console_mode to set_commandline_mode. heavy fixes to the 'scale' implementation (impacting the parser) 2011-06-15 11:46 dezperado * [r414] TODO, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp, src/defaultConfiguration.cpp, src/fim.h: inhibited a number of obsolete scale commands, and replacing them with aliases. doc update. 2011-06-15 11:09 dezperado * [r413] TODO, src/Browser.cpp, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h: enriching the 'scale' command parser, in this way obsoleting some scale factors manipulating commands. 2011-06-15 10:07 dezperado * [r412] doc/fimrc.man, src/CommandConsole.cpp, src/fim.h: commands are now listed in sorted order, in the man page. 2011-06-15 09:49 dezperado * [r411] Makefile.am, TODO, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/CommandConsole.h, src/Image.cpp, src/defaultConfiguration.cpp, src/fim.h: renamed the internal alias command. deleted obsolete *next* machinery. documentation updates for the goto command. some new preprocessor macros for aliases. documenting hardcoded aliases. a test case for the status returning quit. 2011-06-14 22:53 dezperado * [r410] TODO, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h, src/testdir/test1.in, src/testdir/test13.in, src/testdir/test3.in, src/testdir/test4.in, src/testdir/test5.in, src/testdir/test6.in, src/testdir/test6.ok, src/testdir/test7.in: removed the 'return' command. functionality now absolved by 'quit' 2011-06-14 22:08 dezperado * [r409] TODO, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h, src/fimrc: making aliases out of the next_picture, prev_picture, next_image, prev_image commands. 2011-06-14 21:31 dezperado * [r408] src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/defaultConfiguration.cpp, src/fim.h, src/fimrc, src/testdir/test14.ok: shortening definition, but still preserving operation of 'next'/'prev' commands (now hardcoded aliases). 2011-06-14 20:46 dezperado * [r407] TODO, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/Image.cpp, src/Image.h, src/fim.h, src/fimrc, src/testdir/test8.in: empowering an inner "goto" function. fimrc fix. 2011-06-13 11:31 dezperado * [r406] TODO, src/SDLDevice.cpp: bugfix to the sdl resolution specification reading mechanism: it used to lead to segfaults with bad specification strings. 2011-06-13 11:02 dezperado * [r405] TODO, configure.ac, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp, src/FbiStuff.cpp, src/Var.h, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h, src/fimrc: introducing stricter value requirements on of some on-off integer variables. introduced a FIM_VID_VERSION variable. introduced a FIM_WANT_HISTORY preprocessor switch for history load/save. introduce a fim_int typedef, to be extended in use. introduced --no-history-save,--no-history-load,--no-history command switches. --version will print out the readline library version. yacc/bison checks (with no implication) in the configure. added a --no-auto-scale switch. doc fixes and TODO cleanup. 2011-06-13 00:56 dezperado * [r404] Makefile.am, TODO, doc/fim.man, doc/fimrc.man, src/CommandConsole.cpp, src/CommandConsole.h, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h: introduced the --no-internal-config switch. coherence fixes to a manual section listing common keys. 2011-06-12 23:41 dezperado * [r403] VERSION, doc/fim.man, src/AADevice.cpp, src/AADevice.h, src/CACADevice.cpp, src/CACADevice.h, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h: batch identifier change: key_bindings -> sym_keys; inverse_key_bindings -> key_syms. doc fixes. 2011-06-12 22:59 dezperado * [r402] TODO, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/common.cpp, src/common.h, src/fim.h, src/fimrc, src/readline.cpp, src/readline.h, src/yacc.ypp: regexp_goto,regexp_goto_next commands are now collapsed in the goto command. renamed last_regex to last_regexp_. 2011-06-12 19:55 dezperado * [r401] TODO, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h, src/fimrc: collapsed the files,mark,unmark commands as subcommands of the list command. 2011-06-12 19:30 dezperado * [r400] TODO, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.h, src/fimrc: collapsed align_top,align_bottom to the single align command. 2011-06-12 18:57 dezperado * [r399] TODO, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.cpp, src/fim.h, src/fimrc: collapsed the *recording* commands into a single 'recording' command. 2011-06-12 18:01 dezperado * [r398] TODO, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.h, src/fimrc, src/testdir/test13.in: collapsed the pop,push,remove commands into the list command 2011-06-12 17:12 dezperado * [r397] TODO, src/Browser.cpp, src/Browser.h, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/Window.cpp, src/Window.h: prepending with 'fcmd_' all the remaining command routine identifiers. 2011-06-12 16:47 dezperado * [r396] src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h: prepending all fim command routines names with 'fcmd_', for the CommandConsole class. 2011-06-12 16:04 dezperado * [r395] TODO, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h: renamed execute(char*,bool,bool) to execute_internal(char*,flags), for a more flexible execution specification. 2011-06-12 15:16 dezperado * [r394] TODO, src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/FbiStuff.cpp, src/Image.cpp, src/Var.cpp, src/common.cpp, src/fim.cpp, src/string.cpp: enforcing the use of the FIM_CNS_EMPTY_STRING macro instead of the "" constant. 2011-06-12 15:04 dezperado * [r393] TODO, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.h, src/fimrc: collapsed the random_shuffle, sort, and reverse commands as subcommands of the list command. dox fixes. 2011-06-12 14:25 dezperado * [r392] TODO, doc/fim.man, doc/fimrc.man, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/fim.cpp, src/fim.h, src/fimrc: introduced a variable for the control of autocompletion. doc typo fix. 2011-06-12 12:40 dezperado * [r391] TODO, doc/fim.man, doc/fimrc.man, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h, src/fim_stream.cpp, src/fim_stream.h, src/fimrc, src/testdir/test13.in, src/testdir/test7.in, src/testdir/test8.in: no more aliases defined by fim defaults before any config. prepended with _ even more internal variables, and commented them more. adapted the tests suite consequently. some more support for other streams in the fim_stream class. doc fixes. 2011-06-12 00:07 dezperado * [r390] src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.h: enforcing FIM_WANT_SINGLE_PAN_COMMAND by removing redundant, dead code. 2011-06-11 23:57 dezperado * [r389] doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.h: removing FIM_WANT_SINGLE_SCALE_COMMAND and enforcing a single scaling command. doc fixes. 2011-06-11 23:49 dezperado * [r388] TODO, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/fim.h, src/fimrc: removed the double 'info' command registration. documented the 'set' command. fimrc fixes. 2011-06-11 23:07 dezperado * [r387] TODO, doc/fimrc.man, src/defaultConfiguration.cpp, src/fim.h, src/fimrc: prepending an underscore (_) to a number of internal variables. 2011-06-11 21:42 dezperado * [r386] TODO, doc/fim.man, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.cpp, src/fim.h, src/fimrc: added a -C (--execute-commands-early) switch for adding commands to execute before any config. renamed by prepending with underscore some fim variables. fixed a critical bug in the 'return' command (used to segfault). now on, the fimrc will set (internal) variables only if not already set. doc/notes update. 2011-06-10 21:33 dezperado * [r385] Makefile.am, doc/fimgs.man, scripts/maintenance/buildbot-master.cfg.sample, src/fimgs: an update to the fimgs script and man file. update to the buildbot master config file (doing 'make clean' now). makefile fix. 2011-06-10 18:45 dezperado * [r384] TODO, doc/fim.man, doc/fimrc.man, src/CommandConsole.cpp, src/defaultConfiguration.cpp, src/fim.h, src/fimrc: doc fixes for the pan command. the pan aliases are now declared in the fimrc. some obsolete variables are now undeclared and ready for removal. cleanup in the fimrc. documented the --autoheight fim command option (added in the previous commit). documented the _scale_style variable. 2011-06-10 18:07 dezperado * [r383] src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h, src/fimrc: the hardcoded fimrc (and the code) will now use a single variable for the user preferred scaling option. renamed some other variable, some cleanup in the fimrc. 2011-06-10 17:11 dezperado * [r382] TODO, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.h, src/testdir/Makefile, src/testdir/test14.ok: gracefully replaced three commands with three aliases and some more interpretation of scaling specifiers. 2011-06-10 13:40 dezperado * [r381] TODO, doc/fim.man, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/Viewport.cpp, src/Viewport.h, src/fim.cpp, src/fim.h, src/fimrc: the new panning code is active by default now. updated the scroll* commands to use the new panning code. disabled the aalib fix: it seems obsolete, now. some key rebindings. 2011-06-10 12:34 dezperado * [r380] TODO, doc/fimrc.man, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Viewport.cpp, src/Viewport.h, src/fim.h: introduced a single panning function, interpreting the % specifier. 2011-06-09 19:20 dezperado * [r379] TODO, doc/fimrc.man, src/Browser.cpp, src/CommandConsole.cpp: implemented the % specifier interpretation in the goto command. 2011-06-09 13:45 dezperado * [r378] TODO, configure.ac, doc/fim.man, doc/fimgs.man, src/fim.cpp: minor doc fixes: the config line will be displayed in --version; stdin handling docs. 2011-06-03 09:06 dezperado * [r377] BUGS, NEWS, VERSION, src/CommandConsole.cpp, src/CommandConsole.h, src/Window.cpp, src/Window.h: fixed the missing command replacing in addCommand. temporarily disabling the internal windowing splitting. 2011-06-02 18:28 dezperado * [r376] BUGS, ChangeLog, Makefile.am, NEWS, README, VERSION, doc/FIM.TXT, doc/Makefile.am, doc/fim.man, doc/fimrc.man, src/fim.cpp, src/fim.h, var/Makefile, var/index.html.in, var/www/fim.css: massive documentation update: www page/scripts, man pages, FIM.TXT, ChangeLog, etc. 2011-06-02 12:23 dezperado * [r375] configure.ac, src/FbiStuffPdf.cpp, src/fim.cpp, src/fimrc: implemented a hack for viewing (one-page) pdf files from stdin (poppler needs seekable files (with filenames)) on /proc-equipped systems. some doc typo fixes. 2011-06-01 23:33 dezperado * [r374] README, TODO, configure.ac, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/Image.cpp, src/fim.cpp: enabling back the 'pread' command, which reads images from a piped descriptor. docfixes. 2011-06-01 21:33 dezperado * [r373] TODO, src/FramebufferDevice.cpp, src/FramebufferDevice.h: fix to a serious bug: 32 bit framebuffer mode used to segfault on 64 bit builds. 2011-05-31 22:43 dezperado * [r372] TODO, doc/fim.man, doc/fimrc.man, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.cpp, src/fim.h: implemented a trivial slideshow command switch. doc fies. 2011-05-31 22:07 dezperado * [r371] README, TODO, src/FramebufferDevice.cpp, src/FramebufferDevice.h: removed a spurios class member, thus eliminating an useless compilation warning. 2011-05-30 00:31 dezperado * [r370] TODO, configure.ac, doc/FIM.TXT, doc/fim.man, src/fim.cpp: documentation oriented updates. 2011-05-29 23:32 dezperado * [r369] Makefile.am, configure.ac, doc/fim.man, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/FbiStuff.cpp, src/fim.cpp, src/fim.h, src/fimrc, src/testdir/Makefile: honouring /etc/fimrc loading. cd implies pwd and update of the PWD variable. introduced new autocommands. updating the no-configuration command switches (an applying in the test suite). the hardcoded config now comes first, before the /etc/fimrc file. the ~/.fimrc config file now comes after /etc/fimrc. avoiding double loading of the hardcoded config. fixed the getopt string: the 'f:' option was missing. added a --no-etc-rc-file switch. corrected the semantics of the -f option. checking for failure after the lexer allocation. doc update. configure update, in the matrix marked switch handling. 2011-05-29 13:01 dezperado * [r368] TODO, doc/fim.man, doc/fimrc.man, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/FbiStuff.cpp, src/fim.cpp, src/fim.h: set up a autocommand keywords, to correctly handle command line options which imply autocommands (e.g.: --offset). 2011-05-29 11:38 dezperado * [r367] TODO, doc/fim.man, src/DisplayDevice.cpp, src/FontServer.cpp, src/FontServer.h, src/FramebufferDevice.cpp, src/fim.cpp, src/fim.h: the SDL driver will now be fully affected by font selection mechanism, just as the framebuffer driver does. auto-documenting the font search path. doc/man fixes. 2011-05-28 12:48 dezperado * [r366] configure.ac, src/FbiStuffMatrixMarket.cpp: the matrix market renderer is active again (if `configure`d). 2011-05-28 11:50 dezperado * [r365] TODO, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/Makefile.am, src/fim.h, src/fimrc: fixed the bound keys dumpout problem. added functionality to allow binding commands to raw keys. 2011-05-28 09:57 dezperado * [r364] TODO, doc/fimrc.man, src/FbiStuff.cpp, src/Image.cpp, src/fim.h, src/fimrc: introduced a variable, so the user may turn off external decoding of an unknown image file by piping it through an external program. 2011-05-28 09:30 dezperado * [r363] TODO, configure.ac, doc/fimrc.man, scripts/Makefile.am, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/FbiStuffFbtools.cpp, src/FramebufferDevice.cpp, src/fim.h, src/fimrc: small makefile (distributing some more files) and configure (checking for some headers) fixes. added an 'unmark' command. 2011-05-23 18:39 dezperado * [r362] doc/fim.man, doc/fimrc.man, src/CommandConsole-help.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/fim.cpp, src/fim.h: set up a hack for producing man documention for the "window" command. the -V version string will print also versions of jpg,png,gif libraries, as declared in their headers. doc updates. 2011-05-23 12:51 dezperado * [r361] AUTHORS, BUGS, COPYING, ChangeLog, autogen.sh, configure.ac, debian/watch, doc/FIM.TXT, doc/Makefile.am, doc/Makefile.old, doc/doctags.c, doc/fim.man, doc/fimgs.man, doc/fimrc.man, doc/vim2html.pl, scripts/benchmark.sh, src/AADevice.cpp, src/AADevice.h, src/Arg.cpp, src/Arg.h, src/Browser.cpp, src/Browser.h, src/CACADevice.cpp, src/CACADevice.h, src/Cache.cpp, src/Cache.h, src/Command.cpp, src/Command.h, src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DebugConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FbiStuff.cpp, src/FbiStuff.h, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffFbtools.cpp, src/FbiStuffFbtools.h, src/FbiStuffGif.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffList.h, src/FbiStuffLoader.cpp, src/FbiStuffLoader.h, src/FbiStuffMatrixMarket.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffPs.cpp, src/FbiStuffTiff.cpp, src/FontServer.cpp, src/FontServer.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Image.cpp, src/Image.h, src/Namespace.cpp, src/Namespace.h, src/SDLDevice.cpp, src/SDLDevice.h, src/Var.cpp, src/Var.h, src/Viewport.cpp, src/Viewport.h, src/Window.cpp, src/Window.h, src/common.cpp, src/common.h, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h, src/fim_stream.cpp, src/fim_stream.h, src/grammar.h, src/interpreter.cpp, src/lex.h, src/readline.cpp, src/readline.h, src/string.cpp, src/string.h: substituting svn property LastChangedDate with property Id. 2011-05-23 11:46 dezperado * [r360] TODO, doc/fim.man, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/fim.cpp, src/fim.h: fixing many documentation strings, also using preprocessor substring symbols. man update. 2011-05-22 22:47 dezperado * [r359] TODO, doc/fimrc.man, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/fim.h: making variables accessible from within the help system. 2011-05-22 17:56 dezperado * [r358] src/CommandConsole.cpp, src/Namespace.cpp, src/Namespace.h, src/fim.h, src/readline.cpp, src/string.h: enabling autocompletion of individual namespace-prefixed variables. std::string -> fim::string constructor compatibility. 2011-05-22 14:39 dezperado * [r357] TODO, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/common.cpp, src/common.h, src/readline.cpp, src/readline.h: the autocompletion mechanism won't autocomplete strings with filename proposals unless double quoted. on the other hand, a double quote will be proposed for autocompletion, when autocompleting the empty string. 2011-05-22 13:35 dezperado * [r356] src/string.cpp: bugfix to the regexp substitution function. 2011-05-17 16:48 dezperado * [r355] BUGS, TODO, doc/fim.man, doc/fimrc.man, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/fim.cpp, src/fimrc: documenting fim commands. adding the default hardcoded fimrc inline in fimrc.man. updated the short fim description in fim.man. 2011-05-17 15:53 dezperado * [r354] src/fimrc, src/testdir/test12.in, src/testdir/test7.in: fix to the failing tests: the test cases had to be updated to use a now renamed variable. 2011-05-17 15:34 dezperado * [r353] Makefile.am, TODO, doc/fim.man, doc/fimrc.man, scripts/example, scripts/example/oneline.fim, src/CommandConsole-help.cpp, src/CommandConsole-init.cpp, src/Makefile.am, src/fim.cpp, src/fim.h, src/grammar.h: documenting the internal variables. misc documentation fixes. seems like a bug was introduced, inducing test 7 to fail. shall fix this soon. 2011-05-17 13:17 dezperado * [r352] doc/fimrc.man, src/CommandConsole-help.cpp, src/yacc.ypp: did some swaps in the grammar specification, in order to make grammar documentation more understandable. doc updates. 2011-05-17 12:59 dezperado * [r351] configure.ac, doc/fimrc.man, src/CommandConsole-help.cpp, src/Makefile.am, src/lex.lex, src/yacc.ypp: renamed a number of grammar elements to be more understandable in plain english. more textual descriptions of the fim language. 2011-05-17 09:49 dezperado * [r350] doc/fimrc.man, scripts/maintenance/yacc2grammar.awk, scripts/maintenance/yacc2grammar.h, src/CommandConsole-help.cpp, src/Makefile.am, src/fim.cpp: set up a dirty hack to document the fim grammar in fimrc.man. 2011-05-16 13:16 dezperado * [r349] src/CommandConsole-init.cpp: smarter error reporting on failed video device initialization. 2011-05-16 13:08 dezperado * [r348] TODO, doc/fim.man, src/CommandConsole-init.cpp, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.cpp, src/fim.h: enabling case insensitive device string specification. allowing the user to specify mouse hide/show in sdl mode. doc updates. 2011-05-16 12:16 dezperado * [r347] TODO, configure.ac, doc/fim.man, src/FbiStuff.cpp, src/SDLDevice.cpp, src/fim.cpp, src/fim.h: using more macro constants in the man generation code. the SDL driver will print program version in the window title. doc/notes fixes. 2011-05-15 20:53 dezperado * [r346] doc/FIM.TXT, doc/fim.man, src/Cache.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.cpp, src/fim.h: added an extension for specifying resolution in sdl mode. added some support for debugging in the cache code. support for the quit button in windowed sdl mode. docs update. 2011-05-15 17:53 dezperado * [r345] src/CommandConsole.cpp, src/SDLDevice.cpp: enabling key repeat in sdl mode. fixing interruption of iterated commands in sdl mode. 2011-05-15 13:17 dezperado * [r344] src/CommandConsole.cpp, src/fim.h, src/yacc.ypp: fix to the expression parsing code: forgot to include the unquoted float as a case. using symbols for commands in the yacc.ypp file. 2011-05-15 12:38 dezperado * [r343] TODO, src/lex.lex, src/yacc.ypp: fixed the broken [+-*]{number} syntax. 2011-05-15 11:21 dezperado * [r342] src/fim.cpp, src/fim.h, src/fim_stream.cpp, src/fim_stream.h, src/readline.cpp: avoiding the redeclaration of a fim_stream in each source file. on the way of enhancing fim_stream by adding state to it. 2011-05-15 10:20 dezperado * [r341] TODO, src/CommandConsole.cpp, src/fim.h: fix to a problem occurring in sdl mode when iterating commands. 2011-05-14 22:17 dezperado * [r340] src/common.cpp, src/string.cpp: fix to the regexp-based substitution code (it had a severe bug). fix to the escaping code (for /bin/sh) when handling the apostrophe. 2011-05-11 13:17 dezperado * [r339] src/DisplayDevice.cpp: the console rows variable will now affect also the console background clearing code. 2011-05-11 12:50 dezperado * [r338] src/CommandConsole-cmd.cpp, src/common.cpp, src/common.h: in a basic shell escaping of strings passed to popen(). 2011-05-09 00:47 dezperado * [r337] configure.ac: in an initial configure switch to ease static compilation. 2011-05-08 00:26 dezperado * [r336] doc/fimrc.man, src/CommandConsole-help.cpp, src/fim.cpp, src/fim.h: typo fix in the manual generation code; using more defined constants now. 2011-05-08 00:21 dezperado * [r335] src/CommandConsole-init.cpp: typo fix for the no-scripting case. 2011-05-07 23:53 dezperado * [r334] Makefile.am, doc/fim.man, src/CommandConsole-help.cpp: in a makefile rule for regenerating both the fim/fimrc man pages. updated doc/fim.man accordingly. 2011-05-07 23:46 dezperado * [r333] src/fim.cpp: fim is now able to print its own man page with complete and up-to-date information. 2011-05-07 22:52 dezperado * [r332] src/fim.cpp, src/fim.h, src/string.cpp, src/string.h: fim is now able to print its own man page with almost complete information. added a from-char constructor to our string class. 2011-05-07 20:21 dezperado * [r331] TODO, src/Browser.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/Image.cpp, src/Namespace.cpp, src/Window.cpp, src/fim.cpp, src/fim.h: instead of "", returning FIM_CNS_EMPTY_RESULT in many string returning functions. 2011-05-07 19:33 dezperado * [r330] src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffGif.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffLoader.cpp, src/FbiStuffLoader.h, src/FbiStuffMatrixMarket.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffPs.cpp, src/FbiStuffTiff.cpp, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/fim.cpp, src/fim.h: prepended 'fim_' to some global labels. using fim_char_t in place of unsigned char in a number of places. 2011-05-07 15:50 dezperado * [r329] TODO, doc/fim.man, doc/fimrc.man, src/Browser.h, src/CommandConsole-help.cpp, src/fim.cpp, src/fim.h: the random shuffle switch will now trigger right after filelist loading. the default -h mode is now 'short'; added a --help=d (descriptive) mode for the short info version. 2011-05-07 14:52 dezperado * [r328] TODO, doc/Makefile.am, doc/fim.man, doc/fimrc.man, src/CommandConsole-help.cpp: man pages update. in a new man page: fimrc.man, which is auto-generated. 2011-05-07 14:21 dezperado * [r327] doc/FIM.TXT, src/CommandConsole.cpp, src/FramebufferDevice.cpp, src/fim.cpp, src/fim.h, src/fimrc: introducing some more symbols for built-in commands. renamed bottom_align and top_align respectively to align_bottom and align_top. 2011-05-07 13:34 dezperado * [r326] src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/fim.cpp, src/fim.h: implemented "reverse" and "shuffle" commands. enabled the -u/--random switch. 2011-05-07 13:14 dezperado * [r325] src/CommandConsole-cmd.cpp, src/CommandConsole-help.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/Makefile.am, src/Var.cpp, src/Var.h, src/fim.cpp, src/fim.h: introducing troff output with the --dump-reference-help=man switch. moving help-related dumping methods to a separate file. 2011-05-07 12:16 dezperado * [r324] TODO, src/fim.cpp: introducing self-documented fim command switches. 2011-05-07 00:01 dezperado * [r323] src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/Image.cpp, src/Image.h, src/fim.h: some further fix with proper type declarations. 2011-05-06 23:14 dezperado * [r322] src/Viewport.cpp, src/Viewport.h, src/Window.cpp, src/Window.h: introducing the use of specific types further in classes Viewport, Window. 2011-05-06 17:51 dezperado * [r321] src/Image.cpp, src/Image.h, src/Viewport.cpp, src/Viewport.h, src/Window.cpp, src/fim.h: introducing the use of specific types in classes Image, Viewport, Window. 2011-05-06 17:06 dezperado * [r320] src/FramebufferDevice.cpp, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.h: bugfix: signed values were read where unsigned were needed. privatized some members of the SDLDevice class. fim_coo_t is signed again now (for no particular reason, though). 2011-05-06 16:17 dezperado * [r319] src/AADevice.cpp, src/AADevice.h, src/CACADevice.cpp, src/CACADevice.h, src/DebugConsole.cpp, src/DebugConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.h: adopting usage of fim_char_t and fim_err_t in more methods of DisplayDevice classes. 2011-05-06 14:45 dezperado * [r318] src/AADevice.cpp, src/AADevice.h, src/CACADevice.cpp, src/CACADevice.h, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp, src/DebugConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FontServer.cpp, src/FontServer.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.h: adopting usage of fim_char_t and fim_err_t in a number of DisplayDevice classes methods. 2011-05-06 13:24 dezperado * [r317] TODO, configure.ac, src/CommandConsole.cpp, src/FbiStuff.cpp, src/FontServer.cpp, src/FramebufferDevice.cpp, src/SDLDevice.cpp, src/common.cpp, src/common.h, src/fim.cpp, src/fim.h, src/lex.lex: introduced fim_perror, and reacting to errno status. 2011-05-03 16:39 dezperado * [r316] TODO, src/DebugConsole.cpp, src/fimrc: scrolling the console won't cycle around. 2011-05-03 16:13 dezperado * [r315] TODO, src/CommandConsole.cpp, src/Namespace.cpp, src/fim.cpp, src/fim.h, src/interpreter.cpp: introducing and using FIM_SYM_ENDL and some other symbols. 2011-05-03 15:49 dezperado * [r314] src/CommandConsole-cmd.cpp, src/DisplayDevice.cpp, src/Namespace.cpp, src/Viewport.cpp, src/fim.cpp: fix to the previous commit. 2011-05-03 15:24 dezperado * [r313] src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/defaultConfiguration.cpp: enforcing the new member variable name rule in class CommandConsole. 2011-05-03 15:01 dezperado * [r312] src/Command.h, src/CommandConsole.cpp: enforcing the new member variable name rule in class Command. 2011-05-03 14:48 dezperado * [r311] src/Arg.h, src/Cache.cpp, src/Cache.h, src/CommandConsole.cpp: enforcing the new member variable name rule in class Var. comments in Cache.cpp/Cache.h. 2011-05-03 14:45 dezperado * [r310] src/Cache.cpp, src/Cache.h: enforcing the new member variable name rule in class Cache. 2011-05-03 14:41 dezperado * [r309] src/DebugConsole.cpp, src/DebugConsole.h, src/FramebufferDevice.cpp: enforcing the new member variable name rule in class DebugConsole. 2011-05-03 14:29 dezperado * [r308] src/SDLDevice.cpp, src/SDLDevice.h: enforcing the new member variable name rule in class SDLDevice. 2011-05-03 14:18 dezperado * [r307] src/AADevice.cpp, src/AADevice.h: enforcing the new member variable name rule in class AADevice. 2011-05-03 14:05 dezperado * [r306] src/FramebufferDevice.cpp, src/FramebufferDevice.h: enforcing the new member variable name rule in class FramebufferDevice. 2011-05-03 13:24 dezperado * [r305] src/AADevice.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DisplayDevice.cpp, src/DisplayDevice.h, src/FbiStuff.cpp, src/FbiStuffLoader.h, src/FontServer.cpp, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Image.cpp, src/SDLDevice.cpp, src/SDLDevice.h, src/Viewport.cpp, src/Window.cpp: enforcing the new member variable name rule in class DisplayDevice and nearby. 2011-05-03 12:44 dezperado * [r304] src/Window.cpp, src/Window.h: enforcing the new member variable name rule in class Window. 2011-05-03 12:31 dezperado * [r303] src/Image.cpp, src/Image.h, src/Viewport.cpp: enforcing the new member variable name rule in class Image. 2011-05-03 12:10 dezperado * [r302] src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DisplayDevice.cpp, src/FbiStuff.cpp, src/Image.cpp, src/Viewport.cpp, src/Viewport.h, src/Window.cpp, src/readline.cpp: enforcing the new member variable name rule in classes Viewport and partially for CommandConsole. 2011-05-03 11:49 dezperado * [r301] src/Browser.cpp, src/Browser.h, src/Viewport.cpp, src/fim.cpp: enforcing the new member variable name rule in class Browser. 2011-05-03 11:29 dezperado * [r300] src/CommandConsole.cpp, src/CommandConsole.h, src/Namespace.cpp, src/Namespace.h: enforcing the new member variable name rule in classes Namespace and partially for CommandConsole. 2011-05-03 11:06 dezperado * [r299] TODO, src/Browser.cpp, src/CommandConsole.cpp, src/Image.cpp, src/Namespace.cpp, src/Namespace.h, src/Viewport.cpp, src/Window.cpp, src/fim.h: the help will now include a variables list comprehending scoped variables. 2011-05-01 14:40 dezperado * [r298] src/CommandConsole-cmd.cpp, src/fim.h: an internal variable will hold the output of each system() execution. 2011-05-01 13:46 dezperado * [r297] src/DebugConsole.cpp, src/fim.h, src/fimrc: the first logged output console line is a specific banner, now. when the output console is active, PageUp/PageDown keys will scroll it, instead of advancing images (fimrc fix for this). 2011-05-01 11:25 dezperado * [r296] configure.ac, scripts/maintenance/configure-noscripting.sh, src/AADevice.cpp, src/AADevice.h, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DebugConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h: in a configure switch for enabling/disabling the output console feature. 2011-05-01 00:46 dezperado * [r295] src/AADevice.h, src/DisplayDevice.h, src/SDLDevice.cpp, src/SDLDevice.h: fixing some signatures. did not solve the ctrl-p problem in sdl. 2011-04-30 22:49 dezperado * [r294] src/SDLDevice.cpp, src/fim.h: in sdl mode, set up an experimental functionality of n/b/q keys triggered by left/right/middle mouse keys. 2011-04-30 21:07 dezperado * [r293] src/AADevice.cpp, src/AADevice.h, src/DebugConsole.cpp, src/SDLDevice.cpp, src/SDLDevice.h: bugfix: the sdl/aa get_input function had a wrong signature, resulting in using the wrong input function when in sdl/aa mode. 2011-04-30 17:19 dezperado * [r292] configure.ac, scripts/maintenance/configure-noscripting.sh, src/CommandConsole-cmd.cpp, src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.cpp, src/fim.h: in a configure switch for disabling scripting (--disable-scripting). disabling even more code for this case (still not functional). 2011-04-30 16:50 dezperado * [r291] configure.ac, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h: in a configure switch for enabling/disabling the mark-and-dump feature. 2011-04-30 16:22 dezperado * [r290] scripts/maintenance/configure-noscripting.sh, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/fim.h: in a script for the configure/build of fim with scripting disabled. fixing codes for segfault in this case. the code is not fully functional in this way, though. 2011-04-30 11:53 dezperado * [r289] scripts/maintenance/configure-live.sh, scripts/maintenance/live-test.sh: two maintenance scripts to configure, build, and test fim for live systems. 2011-04-30 11:40 dezperado * [r288] TODO, src/FbiStuffJpeg.cpp, src/fimrc: some ongoing work on exif support (not active now, though). 2011-04-16 14:02 dezperado * [r287] src/FramebufferDevice.cpp: fix for the cases when using the framebuffer and the fix line length value does not coincide with the length of the current line. 2011-04-16 13:06 dezperado * [r286] TODO, doc/FIM.TXT, doc/fim.man, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp, src/DummyDisplayDevice.h, src/Image.cpp, src/fim.h: introduced the FIM_WANT_MILDLY_VERBOSE_DUMB_CONSOLE and FIM_WANT_OVERLY_VERBOSE_DUMB_CONSOLE inner features and dumb console fixes. 'system' fim command will execute a single popen() invocation, now. setting the i:filename inner variable. documentation fixes and notes. 2011-01-29 02:41 dezperado * [r285] src/Browser.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp, src/FbiStuffBit24.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffMatrixMarket.cpp, src/FbiStuffPpm.cpp, src/FbiStuffTiff.cpp, src/FramebufferDevice.cpp, src/Image.cpp, src/Namespace.cpp, src/Namespace.h, src/common.cpp, src/defaultConfiguration.cpp, src/fim.h, src/fim_stream.cpp: producing more symbols for handling strings and constants, and applying throughout the code, again. introducing some "goto" instead of returning too often. fixed some duplicate return case. removed an old, useless array allocation in the tiff driver. 2011-01-28 20:09 dezperado * [r284] src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/common.cpp, src/defaultConfiguration.cpp, src/fim.h: producing more symbols for handling strings and constants, and applying throughout the code. 2011-01-26 18:33 dezperado * [r283] src/Browser.cpp, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/Namespace.cpp: using the autocommand tokens, language keywords, and constants throughout the code. 2011-01-26 18:31 dezperado * [r282] configure.ac, src/fim.h: configure: fix of a wrong check (for libexif). the fim.h now lists tokens, constants, values for many autocommands, variables, key names, etc. 2010-12-11 14:44 dezperado * [r281] src/FbiStuffPng.cpp: using png_set_expand_gray_1_2_4_to_8 if PNG_LIBPNG_VER>=10209, instead of png_set_gray_1_2_4_to_8. thanks to mark g. for pointing our the related compilation problem. 2010-11-01 12:57 dezperado * [r280] src/CommandConsole-init.cpp, src/CommandConsole.cpp, src/Image.cpp, src/Makefile.am, src/fimrc: bugfix to the previous possible NULL pointer in Image.cpp. moved the default fimrc inclusion to a new file, for faster build-and-fix cycles. setting the third field of alias declarations (help string) in the fimrc. 2010-10-31 17:24 dezperado * [r279] src/FbiStuffJpeg.cpp, src/FbiStuffLoader.cpp, src/Image.cpp, src/fim.h: now on, the i:comment variable will get set if a comment field is found in an image file. 2010-10-30 14:26 dezperado * [r278] configure.ac, src/FbiStuffJpeg.cpp: detecting libexif in the configure, and waking up some exif-reading routine. 2010-10-07 16:18 dezperado * [r277] TODO, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/CommandConsole.h: fixed the bug/flaw noticed by Jakub Wilk. bug description: "fim shows "H - Help" in the status line. However, as far as I can see, the H key is not bound to anything.". in Debian, nkown as Bug#599337. removed a smiley from a help message. 2010-01-31 13:07 dezperado * [r276] src/Command.h, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.h, src/readline.cpp: applying the use of the typedef keyword in place of int's, whenever possible. 2010-01-21 02:11 dezperado * [r274] src/DebugConsole.cpp: George Danchev's patch for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=564233. damn strchr. 2009-12-21 17:26 dezperado * [r273] configure.ac, src/CommandConsole.cpp, src/FontServer.cpp, src/fim.h: added a configure switch for --enable-scan-consolefonts. fixed a typo in FontServer.cpp from the previous commit. s/_POSIX_PATH_MAX/FIM_PATH_MAX 2009-12-21 17:10 dezperado * [r272] TODO, configure.ac, src/Browser.cpp, src/Browser.h, src/FontServer.cpp, src/common.cpp, src/common.h, src/fim.h: in a mechanism for consolefont search. 2009-12-13 00:03 dezperado * [r271] configure.ac, debian/control, debian/fim.substvars, debian/substvars, src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffGif.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffPs.cpp, src/FbiStuffTiff.cpp: commented static initializers, as they are an invalid construct for -pedantic switch, with g++-4.4. 2009-12-09 00:19 dezperado * [r270] src/readline.cpp: when pressing TAB after typing something at the prompt, the console will print some suggestions. 2009-12-08 23:45 dezperado * [r269] src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/DebugConsole.cpp, src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffGif.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffLoader.cpp, src/FbiStuffMatrixMarket.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffPs.cpp, src/FbiStuffTiff.cpp, src/FontServer.cpp, src/FramebufferDevice.cpp, src/common.cpp, src/fim.cpp, src/fim.h, src/lex.lex, src/readline.cpp, src/string.h, src/yacc.ypp: s/calloc/fim_calloc s/malloc/fim_malloc s/free/fim_free some day we may decide to wrap more around these symbols. 2009-12-08 23:05 dezperado * [r268] BUGS, INSTALL, TODO, src/DebugConsole.cpp, src/DebugConsole.h, src/FbiStuffMatrixMarket.cpp, src/SDLDevice.cpp, src/fimgs: fimgs will get files with https:// and ssh: schema. a compiler happiness fix. mentioned a xfig bug (not impacting on fim :-), and TODO. 2009-10-15 19:34 dezperado * [r267] src/FramebufferDevice.cpp: typo 2009-10-15 17:32 dezperado * [r266] BUGS, TODO, doc/fim.man, src/FramebufferDevice.cpp: fixed what it seemed a bad off-boundaries array write. doc fixes. 16 bpp blue bug reported. 2009-10-14 21:05 dezperado * [r265] BUGS, Makefile.am, README, TODO, config.h.in, configure.ac, doc/FIM.TXT, doc/fim.man, scripts/tests/version.sh, src/fim.cpp: a new (hopefully temporary) testing script. supported input file formats dumped with --version. doc updates and fixes. man page fixes. removed config.h.in from svn. 2009-10-10 23:09 dezperado * [r264] src/FramebufferDevice.cpp: minipatch for systems with no PAGE_MASK in standard headers. 2009-10-10 11:57 dezperado * [r263] TODO, config.h.in, src/CommandConsole-cmd.cpp, src/CommandConsole.cpp, src/Makefile.am: split a piece of CommandConsole.cpp - this file is way too big for compilation on PDA's. 2009-10-10 09:24 dezperado * [r262] BUGS, src/SDLDevice.cpp: lame programming error in the previous commit 2009-10-09 00:17 dezperado * [r261] BUGS, src/SDLDevice.cpp: 8,16,24,32 bit support for SDL driver. 2009-10-08 17:53 dezperado * [r260] BUGS, THANKS, src/CommandConsole.cpp, src/DisplayDevice.cpp, src/FontServer.cpp, src/FramebufferDevice.cpp, src/fim.cpp, src/fim.h: in a THANKS file (finally!). small fixes. 2009-10-07 15:08 dezperado * [r259] configure.ac, src/Image.cpp, src/Image.h, src/fim.h: configure fix. introducing some typedef's. 2009-10-06 07:11 dezperado * [r258] NEWS, TODO, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/Image.cpp, src/Image.h, src/Viewport.cpp, src/fim.h, src/fimrc: introduced the experimental 'negate' feature, to view ebooks with less monitor power (white on black) 2009-09-29 17:42 dezperado * [r257] TODO, src/fimgs: the scriptfimgs needs some adjustment. 2009-08-30 10:15 dezperado * [r256] doc/fim.man, src/CommandConsole.cpp, src/DisplayDevice.cpp, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/fim.cpp, src/fim.h: in a -S option for sanity-check. 2009-08-20 14:18 dezperado * [r255] TODO, config.h.in, configure.ac, src/CommandConsole.cpp, src/DisplayDevice.cpp, src/DisplayDevice.h, src/FbiStuffMatrixMarket.cpp, src/fim.cpp: in a minibenchmark. configure fixes. notes. shorter svn revision info. 2009-06-13 18:51 dezperado * [r253] BUGS, TODO, debian/changelog, debian/menu.ex, src/AADevice.cpp, src/AADevice.h, src/readline.cpp: this version is currently under review at http://ftp-master.debian.org/ 2009-05-31 21:07 dezperado * [r252] TODO, scripts/maintenance/mkfimbuildbots.sh, src/CommandConsole.cpp, src/FbiStuffMatrixMarket.cpp, src/string.h, src/testdir/test9.in: fixing borderline cases. unalias "-a" added. safe NULL string construction. 2009-05-30 21:55 dezperado * [r251] scripts/maintenance/buildbot-master.cfg.sample, scripts/maintenance/mkfimbuildbots.sh: in a script for buildbot slaves creation on a compile farm. in a sample buildbot master config file. 2009-05-30 21:20 dezperado * [r250] TODO, configure.ac, src/FbiStuffMatrixMarket.cpp, src/Makefile.am: it is possible to view matrix market files (experimentally) 2009-05-27 17:30 dezperado * [r249] TODO, src/testdir/Makefile: the tests shall perform under the dumb interface now. 2009-05-25 00:13 dezperado * [r248] TODO, doc/FIM.TXT, src/AADevice.cpp, src/FbiStuff.cpp, src/Viewport.cpp, src/testdir/test12.in, src/testdir/test14.in, src/testdir/test7.in, src/testdir/test7.ok: fixing fim integrity testing with aalib and dumb (for compile farms). 2009-05-20 22:04 dezperado * [r247] TODO, config.h.in, configure.ac, doc/fim.man, src/Browser.cpp, src/CommandConsole.cpp, src/FbiStuff.cpp, src/FbiStuffJpeg.cpp, src/Image.cpp, src/Image.h, src/common.cpp, src/common.h, src/fim.cpp, src/fim.h, src/fimrc, src/lex.lex: fim will read block devices, too. corrected some preprocessor checks. in FIM_VID_OPEN_OFFSET and FIM_VID_SEEK_MAGIC variables for seeking files prior to probing/opening them. hex interpretation in strings now. --offset option in. fixes in the jpeg loader. fim_atof did not manage negative numbers. now it does. some unused functions in. 2009-04-28 22:15 dezperado * [r246] Makefile.am, var/Makefile: makefile fixes for site and info uploading. 2009-04-28 21:28 dezperado * [r245] configure.ac, doc/Makefile.am, src/FbiStuffFbtools.cpp, src/FbiStuffList.h, src/FbiStuffLoader.cpp, src/Var.cpp, src/string.cpp: fixes in the configure script. fixes in the code, for portability. 2009-04-26 14:34 dezperado * [r244] TODO, config.h.in, configure.ac, src/FontServer.cpp, src/Makefile.am: cleaning up the Makefile.am file. added some console fonts for ubuntu 10. 2009-04-19 11:22 dezperado * [r243] Makefile.am, README, TODO, src/CommandConsole.cpp, src/CommandConsole.h, src/Makefile.am, src/fim.cpp, src/testdir/Makefile, src/testdir/test15.in, src/testdir/test15.ok, var/Makefile, var/www/fim-shot-aa-mini.png, var/www/fim-shot-aa.png, var/www/fim-shot-fb-mini.png, var/www/fim-shot-fb.png: in four web page screenshots. in a recording test stub. many small fixes. 2009-04-18 21:09 dezperado * [r242] src/Command.h, src/CommandConsole.cpp, src/Makefile.am, src/fim.h, src/fimrc, src/testdir/Makefile, src/testdir/test14.in, src/testdir/test14.ok: two fim internals debugging variables in. a new test in. fixing console displaying control. 2009-04-18 15:16 dezperado * [r241] TODO, src/CommandConsole.cpp, src/CommandConsole.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/fim.cpp, src/fim.h: almost nothing 2009-04-17 16:22 dezperado * [r240] configure.ac: sam's configure suggestions 2009-04-12 20:38 dezperado * [r239] TODO, config.h.in, configure.ac, src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/FbiStuffFbtools.cpp, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Makefile.am, src/common.cpp, src/common.h, src/fim.cpp, src/fim.h, src/yacc.ypp: tweaks to build the beast on darwin and bsd 2009-04-04 13:33 dezperado * [r238] TODO, src/CommandConsole.cpp: fix with dummy device 2009-04-04 09:29 dezperado * [r237] Makefile.am, TODO, configure.ac, src/Makefile.am, src/testsuite, src/testsuite/config, src/testsuite/config/unix.exp, src/testsuite/fim.test, src/testsuite/fim.test/fim.exp: in stubs for dejagnu 2009-04-03 22:26 dezperado * [r236] BUGS, README, TODO, src/AADevice.cpp, src/AADevice.h, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/readline.cpp: improved the aalib input 2009-04-01 11:37 dezperado * [r235] src/AADevice.cpp, src/CommandConsole.cpp: fixes. 2009-04-01 07:58 dezperado * [r234] TODO, src/AADevice.cpp, src/AADevice.h, src/CommandConsole.cpp, src/readline.cpp: putting in fim aa native input, (although aa interface is somewhat poor compared to sdl) 2009-03-31 21:39 dezperado * [r233] src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/FbiStuffFbtools.cpp, src/FramebufferDevice.cpp, src/Var.h, src/common.cpp, src/string.h, src/testdir/Makefile, src/testdir/test12.in, src/testdir/test12.ok, src/testdir/test13.in, src/testdir/test13.ok: asymmetric scaling test in. browser test in. enforcing "C" locale now (so, preventing locale-related bugs). failed device initializations won't block the terminal echo state. 2009-03-29 17:32 dezperado * [r232] BUGS, src/Cache.cpp, src/Cache.h, src/CommandConsole.cpp, src/Window.cpp: finalization fixes: the tests perform with no memory leak at all. 2009-03-29 15:36 dezperado * [r231] src/AADevice.cpp, src/AADevice.h, src/CommandConsole.cpp, src/DisplayDevice.cpp, src/DisplayDevice.h, src/FramebufferDevice.cpp, src/SDLDevice.cpp, src/fim.cpp, src/string.cpp: got rid of some more small memory leaks. 2009-03-29 13:48 dezperado * [r230] BUGS, TODO, src/AADevice.cpp, src/AADevice.h, src/CommandConsole.cpp, src/CommandConsole.h, src/FbiStuffJpeg.cpp, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Var.h, src/Window.cpp, src/Window.h, src/fim.cpp, src/interpreter.cpp, src/lex.h, src/testdir/Makefile, src/yacc.ypp: fixed memory leak in legacy fbi code (font handling). fixed memory leak in parser code. fixing other small memory leaks (initalization/finalization related) 2009-03-28 15:31 dezperado * [r229] src/Browser.cpp, src/CommandConsole.h, src/FramebufferDevice.cpp, src/Namespace.cpp, src/Namespace.h, src/Var.h, src/Viewport.cpp, src/common.cpp, src/common.h, src/fim.cpp, src/interpreter.cpp, src/lex.lex, src/testdir/Makefile, src/testdir/test10.in, src/testdir/test10.ok, src/testdir/test11.in, src/testdir/test11.ok, src/testdir/test2.in, src/testdir/test2.ok, src/testdir/test3.in, src/testdir/test3.ok, src/testdir/test4.in, src/testdir/test7.in, src/testdir/test9.in, src/testdir/test9.ok: debugging the guts of fim's language. implemented the gcd and babylonian sqrt as test programs. replaced atof with a locale clean function. 2009-03-26 21:48 dezperado * [r228] src/CommandConsole.cpp, src/CommandConsole.h, src/Namespace.cpp, src/Namespace.h, src/Var.h, src/interpreter.cpp, src/testdir/Makefile, src/testdir/test9.in, src/testdir/test9.ok: debugging the language core with the radioactive rabbit : IT WORKS! 2009-03-25 22:09 dezperado * [r227] README, src/testdir/Makefile, src/testdir/test8.in, src/testdir/test8.ok: in a new image viewer info and a new test script. 2009-03-18 10:51 dezperado * [r226] Makefile.am, README, TODO, src/testdir/Makefile, src/testdir/test8.in, src/testdir/test8.ok: in a new test for file browsing. 2009-03-18 00:24 dezperado * [r225] src/Image.cpp, src/testdir/test7.in, src/testdir/test7.ok: in a new small test. tried pork and oink. urgh! 2009-03-06 00:12 dezperado * [r224] README, TODO, config.h.in, configure.ac, debian/README.Debian, debian/control, debian/copyright, debian/fim.doc-base.EX, debian/postinst.ex, debian/postrm.ex, debian/preinst.ex, debian/prerm.ex, debian/watch, debian/watch.ex, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffDjvu.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPs.cpp, src/SDLDevice.cpp, src/fim.cpp: debinizing fixes. 2009-02-27 20:54 dezperado * [r223] debian/.control.swo, debian/.rules.swo: ups 2009-02-27 20:53 dezperado * [r222] TODO, debian, debian/.control.swo, debian/.rules.swo, debian/README.Debian, debian/changelog, debian/compat, debian/control, debian/copyright, debian/dirs, debian/docs, debian/files, debian/fim.doc-base.EX, debian/fim.substvars, debian/menu.ex, debian/postinst.ex, debian/postrm.ex, debian/preinst.ex, debian/prerm.ex, debian/rules, debian/substvars, debian/watch.ex: debianizing 2009-02-26 21:23 dezperado * [r221] TODO, configure.ac, scripts/maintenance/cron-build.sh.in, scripts/maintenance/cron-rsync.sh.in, scripts/maintenance/cron-svndump.pl.in, scripts/maintenance/remote-build.sh.in, src/CommandConsole.cpp, src/fim.h, src/testdir/Makefile: in some maintenance backup scripts. in two new variables and a failing test. 2009-02-25 02:47 dezperado * [r220] Makefile.am, VERSION, configure.ac, doc/Makefile.am, doc/fim.man, doc/fimgs.man, src/fim.cpp: debianizing fim through lintian. 2009-02-22 23:12 dezperado * [r219] src/FontServer.cpp, src/FramebufferDevice.cpp: fixed legacy fbi missing malloc checks 2009-02-22 22:56 dezperado * [r218] TODO, configure.ac: pentium4 optimization at configure time. 2009-02-22 21:40 dezperado * [r217] BUGS, src/Browser.cpp, var/index.html.in: solved the FILE NONFILE prev loop bug. 2009-02-21 23:39 dezperado * [r216] BUGS, scripts/maintenance/configure-brute-check.sh, src/Browser.h, src/CommandConsole.cpp, src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffPng.cpp, src/FramebufferDevice.cpp, src/Image.cpp, src/Makefile.am, src/Var.cpp, src/Var.h, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h, src/interpreter.cpp: fixes for pedantic and obscure ./configure setups compilation. enriched the --dump-reference-help output with a variables description.. 2009-02-21 14:59 dezperado * [r215] scripts/Makefile.am: typo 2009-02-21 14:56 dezperado * [r214] BUGS, README, configure.ac, doc/FIM.TXT, scripts/Makefile.am, scripts/maintenance/configure-brute-check.sh, src/Browser.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.cpp, src/FbiStuff.cpp, src/FbiStuffFbtools.cpp, src/Namespace.cpp, src/Viewport.cpp, src/common.cpp, src/common.h, src/fim.cpp: in a script to brute-check the ./configure script. documented. fied nonwindowed fim for compilation. 2009-02-21 01:15 dezperado * [r213] BUGS, Makefile.am, NEWS, README, TODO, scripts/Makefile.am, scripts/utilities/screenshot.sh, src/AADevice.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/FbiStuff.cpp, src/FbiStuff.h, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FontServer.cpp, src/Makefile.am, src/Var.h, src/fim.cpp, src/fim.h, var/Makefile, var/index.html.in, var/www/fim.css: started working on the --dump-reference-help switch. replaced popen with execlp calls when opening files (solves a fbi vuln.). fixed typos in macro names. replaced stat calls with fseek. fixed aa driver wrong textual console line width. introduced a shell script for coordinated reference fim screenshots. restyled the fim web page. 2009-02-18 00:42 dezperado * [r212] var/Makefile, var/index.html.in, var/www, var/www/fim.css: pedantry 2009-02-18 00:14 dezperado * [r211] ChangeLog, Makefile.am, NEWS, TODO, VERSION, distros/Makefile.am, doc/Makefile.am, doc/fim.man, src/FbiStuff.cpp, var, var/Makefile, var/index.html.in: changelog mangling, fim website generation and update machinery. 2009-02-15 17:53 dezperado * [r210] src/Browser.cpp, src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/FbiStuffBmp.cpp, src/FbiStuffGif.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffLoader.cpp, src/FbiStuffPng.cpp, src/FbiStuffPpm.cpp, src/FbiStuffTiff.cpp, src/FontServer.cpp, src/FramebufferDevice.cpp: A safing malloc and calloc's raid in FbiStuff*pp. 2009-02-15 16:56 dezperado * [r209] BUGS, TODO, media/multipage, media/multipage/Makefile, media/multipage/sample.tex, src/Browser.cpp, src/Cache.cpp, src/CommandConsole.cpp, src/DisplayDevice.cpp, src/FbiStuffPpm.cpp, src/Image.cpp, src/Image.h, src/fim.cpp, src/string.cpp, src/string.h: fixed some 64 bit related issues. added multipage test documents. new bug identified (unsolved). solved a multipage browsing related bug. 2009-02-13 21:07 dezperado * [r208] src/Browser.cpp, src/Cache.cpp, src/CommandConsole.cpp, src/FramebufferDevice.cpp, src/Image.cpp, src/Viewport.cpp, src/Window.cpp, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h: massive replace of strings with preprocessor symbols for fim language variables identifiers. soon documentation for each variable will be declared along with its symbol definition. 2009-02-13 20:16 dezperado * [r207] src/CommandConsole.cpp, src/common.cpp: fixes 2009-02-13 00:52 dezperado * [r206] INSTALL, INSTALL.TXT, Makefile.am, README, TODO, config.h.in, configure.ac, doc/fim.man, scripts/maintenance/remote-build.sh.in, src/AADevice.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.h, src/FbiStuff.cpp, src/FbiStuffGif.cpp, src/FontServer.cpp, src/FontServer.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/common.cpp, src/common.h, src/fim.cpp, src/fim.h: Cleaned up some fim vars access. introduced fim_getenv, and constantized some dangerous char* legacy pointers. introduced the simple remote-build.sh script. the non standard INSTALL file was replaced by the GNU INSTALL. 2009-01-21 12:38 dezperado * [r205] distros/gentoo/media-gfx/fim/fim-0.3-beta.ebuild, doc/Makefile.am: manhtml will not be absolutely necessary to build docs.. 2009-01-14 14:39 dezperado * [r204] TODO, src/defaultConfiguration.cpp: swapped PageDown and PageUp key codes for the framebuffer/console driver. 2009-01-10 11:13 dezperado * [r203] Makefile.am, README, TODO, configure.ac, scripts/tests/sanity.fim, src/AADevice.h, src/Arg.h, src/Browser.cpp, src/Browser.h, src/CACADevice.h, src/Cache.h, src/Command.h, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DebugConsole.h, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FbiStuff.cpp, src/FbiStuff.h, src/FbiStuffFbtools.cpp, src/FbiStuffFbtools.h, src/FbiStuffList.h, src/FbiStuffLoader.h, src/FbiStuffPdf.cpp, src/FontServer.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Image.cpp, src/Image.h, src/Namespace.h, src/SDLDevice.cpp, src/SDLDevice.h, src/Var.h, src/Viewport.h, src/Window.h, src/common.h, src/fim.cpp, src/fim.h, src/fim_stream.h, src/fimrc, src/string.h, src/testdir, src/testdir/Makefile, src/testdir/test1.in, src/testdir/test1.ok, src/testdir/test2.in, src/testdir/test2.ok, src/testdir/test3.in, src/testdir/test3.ok, src/testdir/test4.in, src/testdir/test4.ok, src/testdir/test5.in, src/testdir/test5.ok, src/testdir/test6.in, src/testdir/test6.ok: Introduced vim-like language testing. Renamed a bunch of preprocessor symbols. 2009-01-04 00:11 dezperado * [r202] TODO, src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/FbiStuffPdf.cpp, src/Image.cpp, src/Image.h, src/fimrc: A little smarter multipage document browsing. Fixed rgb swap in pdf renderer. 2009-01-03 23:42 dezperado * [r201] doc/fim.man, src/FbiStuff.cpp, src/FbiStuffBit1.cpp, src/FbiStuffBit24.cpp, src/Makefile.am, src/fim.cpp, src/fim.h: Adapted the --binary option switch to let the user specify 1 pixel per bit binary file display. 2009-01-03 14:45 dezperado * [r200] TODO, doc/fim.man, src/Browser.cpp, src/FbiStuff.cpp, src/FbiStuffBit24.cpp, src/Makefile.am, src/fim.cpp, src/fim.h: Added the -b (--binary) option to view as a 24 bpp pixelmap any input file. Trimmed two extra _ in Browser.cpp. 2009-01-03 13:13 dezperado * [r199] src/Browser.cpp, src/Cache.cpp: images filenames failing prefetching wil be removed from the image list now. the prefetch is autocommand-capable 2009-01-01 16:34 dezperado * [r198] INSTALL, README, config.h.in, configure.ac, src/FbiStuffDjvu.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPs.cpp, src/SDLDevice.cpp, src/common.cpp, src/fim.h, src/readline.cpp: introduced a hack to make work arrow keys in the sdl/readline driver. doc fixes. 2008-12-30 17:10 dezperado * [r197] NEWS, README, TODO: docs update 2008-12-30 16:57 dezperado * [r196] src/FbiStuffDjvu.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPs.cpp: inhibited stdin multipage document reading (for libraries intrinsic inabilities to handle this, and the need of a workaround). 2008-12-30 16:37 dezperado * [r195] src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/Cache.h, src/CommandConsole.cpp, src/CommandConsole.h, src/Image.cpp, src/Viewport.cpp, src/fim.cpp, src/fim.h, src/fimrc: fixes for cache behaviour and prefetching. 2008-12-30 01:47 dezperado * [r194] TODO, src/AADevice.h, src/Arg.cpp, src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/Cache.h, src/Command.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DebugConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FbiStuff.cpp, src/FbiStuffTiff.cpp, src/FontServer.cpp, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Image.cpp, src/Image.h, src/SDLDevice.cpp, src/SDLDevice.h, src/Viewport.cpp, src/Viewport.h, src/Window.cpp, src/defaultConfiguration.cpp, src/fim.cpp, src/fim.h, src/string.cpp: pushing code cleanup and fixes : trimmed out some troublesome extern declarators (not all, though). 2008-12-28 16:58 dezperado * [r193] TODO, src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DisplayDevice.cpp, src/FontServer.cpp, src/FontServer.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/SDLDevice.cpp, src/fim.h: housekeeping, -pedantic fixes. 2008-12-27 15:01 dezperado * [r192] TODO, config.h.in, configure.ac, src/AADevice.h, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FbiStuff.cpp, src/FbiStuffFbtools.cpp, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Image.cpp, src/Image.h, src/SDLDevice.cpp, src/SDLDevice.h, src/Viewport.cpp, src/Window.cpp, src/fim.cpp, src/fim.h, src/readline.cpp: now, with --disable-framebuffer fim will work without framebuffer support. 2008-12-27 00:07 dezperado * [r191] src/CommandConsole.cpp, src/DebugConsole.cpp, src/DisplayDevice.cpp, src/DisplayDevice.h, src/Image.cpp, src/SDLDevice.cpp, src/SDLDevice.h, src/common.cpp, src/common.h: wiser way of rendering the console under SDL. .fim_history mode will be set to 0600 on creation. 2008-12-25 18:10 dezperado * [r190] src/Browser.cpp, src/Browser.h, src/CommandConsole.cpp, src/FbiStuff.cpp, src/FbiStuff.h, src/FbiStuffDjvu.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPs.cpp, src/Image.cpp, src/Image.h: introduced next-page and prev-page commands, to view multipage djvu, pdf, ps documents. 2008-12-25 15:30 dezperado * [r189] configure.ac, src/FbiStuffDjvu.cpp, src/FbiStuffPdf.cpp, src/FbiStuffPs.cpp: correctness fixes for the djvu, pdf, ps prototypal drivers. 2008-12-25 12:17 dezperado * [r188] INSTALL, config.h.in, configure.ac, src/FbiStuff.cpp, src/FbiStuffPs.cpp: Implemented a first form of PS file format support (single-paged). 2008-12-24 18:23 dezperado * [r187] config.h.in, configure.ac, src/FbiStuff.cpp, src/FbiStuffPdf.cpp, src/Makefile.am: Implemented a first form of PDF file format support (single-paged). 2008-12-24 12:04 dezperado * [r186] INSTALL, README, TODO: doc comments 2008-12-24 00:55 dezperado * [r185] config.h.in, configure.ac: forgot this stuff in the last commit.. 2008-12-24 00:55 dezperado * [r184] src/FbiStuffDjvu.cpp, src/Makefile.am: Implemented a first form of Dejavu file format support (single-paged). 2008-12-21 21:58 dezperado * [r183] scripts/maintenance/cron-build.sh.in: ...bashism! 2008-12-21 21:39 dezperado * [r182] scripts/maintenance/cron-build.sh.in: updated the crontab export-build-and-mail script 2008-12-21 18:13 dezperado * [r181] TODO, src/AADevice.cpp, src/AADevice.h, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.cpp, src/FramebufferDevice.cpp, src/SDLDevice.cpp, src/fimrc: fixed the console echo problems. implemented saving/loading of a ~/.fim_history file. 2008-12-21 17:02 dezperado * [r180] src/AADevice.cpp, src/AADevice.h, src/FbiStuff.cpp, src/FbiStuffBmp.cpp, src/FbiStuffFbtools.cpp, src/FbiStuffGif.cpp, src/FbiStuffJpeg.cpp, src/FbiStuffPng.cpp, src/FbiStuffTiff.cpp, src/fim.h: s/printf/FIM_FBI_PRINTF/g in ex fbi stuff. 2008-12-21 16:40 dezperado * [r179] src/AADevice.cpp, src/AADevice.h, src/CommandConsole.cpp, src/DisplayDevice.cpp, src/common.cpp, src/fim.cpp, src/fim.h, src/fim_stream.cpp: no more need for g_fim_no_framebuffer global variable. 2008-12-21 15:43 dezperado * [r178] NEWS, src/AADevice.cpp, src/AADevice.h, src/DebugConsole.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fimrc: set up the console for the aa driver, too. sadly, there are problems with aalib console under screen. 2008-12-21 13:40 dezperado * [r177] src/CommandConsole.cpp, src/CommandConsole.h, src/DebugConsole.cpp, src/DebugConsole.h, src/DisplayDevice.cpp, src/fimrc: the console is capable of scrolling, now. 2008-12-21 11:10 dezperado * [r176] src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.cpp, src/SDLDevice.cpp, src/fimrc: typos in SDLDevice.cpp. retouched the loop prevention stack machinery. improved the fimrc. 2008-12-21 09:20 dezperado * [r175] TODO, src/Browser.cpp, src/CommandConsole.cpp, src/FbiStuff.cpp, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/SDLDevice.cpp, src/fim.cpp, src/interpreter.cpp, src/string.cpp, src/string.h: switched to size_t where needed; wall and pedantic fixes; 2008-12-20 18:25 dezperado * [r174] src/fim.cpp: workaround for a stdin file list reading bug (i did not understnd why, sincerely). 2008-12-18 01:18 dezperado * [r173] doc/FIM.TXT, src/CommandConsole.cpp, src/CommandConsole.h, src/fimrc: Added the autocmd_trace_stack debug method; optimized the default fimrc ; documented the system integration of fim. 2008-11-10 00:01 dezperado * [r172] scripts/Makefile.am, scripts/rc/fimrc.lazy, src/CommandConsole.cpp, src/CommandConsole.h, src/FramebufferDevice.cpp, src/Image.cpp, src/Image.h, src/Viewport.cpp, src/Viewport.h, src/fim.cpp, src/fim.h, src/fimrc: Added the 'stdout' fim command. Introduced a 'lazy' fimrc example configuration file. Now the fimrc's are dist-archived, too. 2008-11-09 19:52 dezperado * [r171] configure.ac, src/Browser.cpp, src/Browser.h, src/Cache.cpp, src/CommandConsole.cpp, src/Image.cpp, src/Viewport.cpp: cache is back into the game 2008-11-02 21:49 dezperado * [r170] src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.cpp: autocmd_del command in. 2008-10-19 12:58 dezperado * [r169] TODO, scripts/maintenance/cron-build.sh.in, scripts/rc, scripts/rc/fimrc.eog, scripts/rc/fimrc.gqview, scripts/rc/fimrc.kuickshow, src/DisplayDevice.cpp, src/SDLDevice.cpp, src/defaultConfiguration.cpp, src/fimrc: Added the scripts/rc/ directory to store fim configuration file to emulate other image viewers. Renamed First and Last key names to End and Home. 2008-10-19 09:54 dezperado * [r168] src/AADevice.cpp, src/AADevice.h, src/CommandConsole.cpp, src/DisplayDevice.cpp, src/DisplayDevice.h: console fixup for aa 2008-10-19 09:38 dezperado * [r167] src/AADevice.h, src/CommandConsole.cpp, src/DebugConsole.cpp, src/DisplayDevice.cpp, src/DisplayDevice.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/Makefile.am, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.cpp: Console and display devices code reorganization. Some more sdl bpp independence. CXXFLAGS is part of --version output now. 2008-10-19 07:42 dezperado * [r166] src/SDLDevice.cpp, src/SDLDevice.h: Corrected the behaviour of SDLDevice::catchInteractiveCommand() (caused pipe overflow before). 2008-10-19 07:38 dezperado * [r165] FAQ.TXT, src/CommandConsole.cpp, src/fim.cpp, src/fim.h, src/readline.cpp: Some adjustments of device selection and initialization code. 2008-10-18 15:11 dezperado * [r164] BUGS, README, TODO, src/AADevice.h, src/CACADevice.h, src/DebugConsole.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/SDLDevice.cpp, src/fim.cpp: The debug console was convinced to work, too. With a dirty hack in fim.cpp. It's time for a cleanup of output device probing/selection/initialization code. 2008-10-18 13:49 dezperado * [r163] BUGS, src/SDLDevice.h: fixed a missing mandatory return value in an inherited function, causing randomly neverending loops. 2008-10-18 13:36 dezperado * [r162] BUGS, src/AADevice.cpp, src/AADevice.h, src/CACADevice.cpp, src/CACADevice.h, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/DummyDisplayDevice.h, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.h, src/readline.cpp: SDL : support for arrows and control key, and some dirty hacks with the readline keymaps in order to support meta (alt) bindings. 2008-10-12 23:24 dezperado * [r161] src/CommandConsole.cpp, src/SDLDevice.cpp, src/SDLDevice.h, src/readline.cpp: readline integration with the SDL driver 2008-10-12 21:05 dezperado * [r160] src/DisplayDevice.cpp, src/DisplayDevice.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h: The Linux consolefont is rendered under the SDL driver too, now. 2008-10-12 17:50 dezperado * [r159] src/FontServer.cpp, src/FontServer.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h: FontServer::fs_render_fb -> FramebufferDevice::fs_render_fb 2008-10-12 17:37 dezperado * [r158] src/CommandConsole.cpp, src/SDLDevice.cpp: Fixed a x+screen null pointer, swapped r and b in sdl code. 2008-10-05 20:00 dezperado * [r157] doc/fim.man, src/AADevice.cpp, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/FramebufferDevice.cpp, src/FramebufferDevice.h, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.cpp: Worked further on the SDL support, added the -o (--output-device) program switch to select the output device among the supported ones. Updated the man page accordingly. 2008-10-04 19:26 dezperado * [r156] INSTALL, README: Small doc updates with mention about the pv picture viewer. 2008-10-04 17:27 dezperado * [r155] config.h.in, configure.ac, src/CommandConsole.cpp, src/CommandConsole.h, src/DisplayDevice.cpp, src/DisplayDevice.h, src/Makefile.am, src/SDLDevice.cpp, src/SDLDevice.h, src/fim.h: A primordial and incomplete SDL (X) support is in now. 2008-09-30 13:58 dezperado * [r151] doc/FIM.TXT: updated some doc with the trunk info 2008-09-30 13:53 dezperado * [r150] ., AUTHORS, BUGS, COPYING, ChangeLog, FAQ.TXT, INSTALL, Makefile.am, Makefile.old, NEWS, README, README.FIRST, TODO, VERSION, autogen.sh, config.h.in, configure.ac, depcomp, distros, doc, media, scripts, src: created a 'trunk' directory, after all. fim-0.6-rc2/README.md0000644000175000017500000004533714503371627011042 00000000000000 FIM - Fbi IMproved README document. -------------------------------------------------------------------------------- - [ 1 Overview](#1overview) - [ 2 Description](#2description) - [ 3 Features, comparison to other image viewers](#3features-comparison-to-other-image-viewers) - [ 4 Build, test, example](#4build-test-example) - [ 5 Run time requirements](#5run-time-requirements) - [ 6 Original Idea](#6original-idea) - [ 7 Notes for patch writers](#7notes-for-patch-writers) - [ 8 Availability in Linux distributions](#8availability-in-linux-distributions) - [ 9 License](#9license) - [ 10 Contacts, mailing lists, URLs](#10contacts-mailing-lists-urls) ##
[ 1 Overview](#1overview) ## -------------------------------------------------------------------------------- FIM (Fbi IMproved) is a highly customizable and scriptable image viewer targeted at the users who are comfortable with software like the Vim text editor or the Mutt mail user agent, or keyboard oriented, full screen programs. FIM aims to be a "Swiss Army knife" for viewing images. FIM is multidevice: it has X support (via the SDL library), it supports ASCII art output (via the aalib and libcaca libraries), and because it derives from the Fbi image viewer (by Gerd Hoffmann), it can display images in the Linux framebuffer console, too. FIM is free software, distributed under the terms of the GPL software license. ## [ 2 Description](#2description) ## -------------------------------------------------------------------------------- FIM invocation is documented in `man fim` (/#man_fim). The FIM language (syntax, commands, variables, key bindings) is documented in `man fimrc` (/#man_fimrc). FIM offers many ways for scaling, orienting, listing or rearranging the ordering of images. FIM is capable of regular expressions based (on filename) vim-like autocommands, comment-based search and filtering, display of EXIF tags, customizable command lines, and use a custom font (from console fonts). FIM offers GNU `readline` command line autocompletion and history, completely customizable key bindings, internal/external scriptability (through return codes, standard input/output, commands given at invocation time, and an initialization file), internal filename-based image search, and more. Each documentation item is accessible via the internal `help` command. ## [ 3 Features, comparison to other image viewers](#3features-comparison-to-other-image-viewers) ## -------------------------------------------------------------------------------- Features: * modes: interactive (default), and command line * lots of the functionality is scripted in an internal domain specific language * on-screen debug and information console in command mode * per-image variables (e.g.: `i:var="value"`) * regular expression filename search (`/*.png`) and view * command line history (enter the console with `':'`, then use arrows) * command line Tab-based command autocompletion (thanks to the GNU readline) * command line history file save/load support (`~/.fim_history`) * key-action bindings, with Shift (uppercase and Control ('C-') key combinations * simple `if/while` scriptability, with integer/float/string variables and arithmetic evaluation * command aliases support (macros) * event autocommands (styled after Vim's `autocmd` ) * regular expressions on filenames to enrich autocommand behaviour * image descriptions display ('expando' sequences) * regular expressions on image descriptions * configuration (initialization) file support (`~/.fimrc`) * usable built-in default configuration * wrapper script (`fimgs`) to convert pdf,ps,eps,dvi,cbr(rar),cbz(zip),tar,tar.gz,tgz,http://... contents into images that can be displayed * embedded piping through `convert`,`inkscape`,`xcftopnm`,`dia`... to visualize further file formats * view a Matrix Market file rendering via librsb * index-based `goto` styled after Vim (`:`) * image search with regular expressions on filenames (`goto` command) * other stuff usual for an image viewer (`scale`, `pan,` etc..) * other stuff unusual for an image viewer (setting scale factor, auto width scale, auto height scale, marking of 'interesting' files, sorting of files in the list, recording/replaying of sessions, repeat last action ) * image flip, mirror, rotation, stretch (asymmetric scaling) * command iteration (with the `[n]` syntax * external script file execution * system call support * image cache and mipmaps * image prefetch * pipe commands from an input program * many features could be enabled or disabled at compile time editing the Makefile * run under screen or ssh * read files list via standard input * read image file via standard input * read commands script via standard input * support for SDLlib (Simple Directmedia Layer) (`-o sdl`) (X!) * support for AAlib (ASCII Art rendering) (`-o aa`) * support for libcaca (Colour ASCII Art rendering) (`-o ca`) * experimental (incomplete, discouraged) support for Imlib2 (`-o imlib2`) (X!) * experimental support for file formats: PDF, PS, DJVU * view any file as a binary/RGB pixelmap * view any file as (rendered) text * open files at a specified byte offset * image list limiting (temporary list shrinking) * comments / captions / description files * search and reordering based on descriptions and internal variables * decode files based on magic number (contents), not file extension * recursive load from directory * sort files list on file name, file size or name date * text font control (selection of size and consolefont) * dump list of selected images to `stdout` * jump between last two images repeatedly with one key The next table is a comparison (very outdated...) of popular image viewers available on Linux, focusing on FIM-like free software ones. | Program: |kuickshow|eog|xz|gv|fbi|FIM|GQview|dfbsee|pv|qiv| |--------------------------------|-----|---|--|--|---|---|------|------|--|---| |status:(a)lpha/(m)ature | m | m | m| | a | m| m | |m | m | |X=X,f=framebuffer,s=SVGA,a=ascii| X | X |Xs| X| f |fXa| X | ? |f | X | |linux specific | | | ?| | * | *| | |* | ? | |key rebindings | * | | | | | *| * | | | ? | |external scriptability | | | | | ~ | *| | | | ? | |internal scriptability | | | | | | *| | | | ? | |internal scriptability | | | | | | *| | | | ? | |printing support | * | * | ?| | | | * | | | ? | |slideshow | * | * | | | * | *| * | |* | * | |caching | * | ? | | | | *| * | | | ? | |preview browser | * | | | | | | * | | | ? | |EXIF tag display | * | | | | * | *| * | | | ? | |internal windowing | | | | | | X| | | | ? | |internal image search | | | | | | *| | | | ? | |external image search | | | | | | | * | | | ? | |'pan views' ('rich' views) | | | | | | | * | | | ? | |system interaction | * | | | | | *| * | | | ? | |system interaction safe | * | | | | | | | | | ? | |remote commands | | | | | | | * | | | ? | |saves last folder | * | | | | | | * | | | ? | |runs under screen | | | | | | *| | | | ? | |standard input interaction | | | | | | *| | | | ? | |rotation | * | ? | ?| | ? | *| ? | ? |* | * | |history | | | | | | *| | | | | |multi-device | | | | | | *| | | | | |mirroring | | | | | | *| | | | * | |description files | | | | | | *| | | | | Other nice command line picture viewers: pv (http://www.trashmail.net/pv/), zgv, feh, sxiv, mirage... ______________________________________________________________________________ ## [ 4 Build, test, example](#4build-test-example) ## -------------------------------------------------------------------------------- Requirements are: * the GNU readline library ( https://www.gnu.org/software/readline/ ) * GNU flex (NOT any lex ) ( https://www.gnu.org/software/flex/ ) (some systems need also 'libfl-dev' to find `FlexLexer.h`) * GNU bison (NOT any yacc) ( https://www.gnu.org/software/bison/) * the GCC ( GNU Compiler Collection ) ( http://gcc.gnu.org/ ) or clang ( https://clang.llvm.org/ ) * and optionally: * libsdl-1.2 ( http://libsdl.org/ ) * libsdl-2.0 ( http://libsdl.org/ ) * libexif ( https://libexif.github.io/ ) * libjpeg ( http://www.ijg.org/ ) * libpng ( http://www.libpng.org/ ) * giflib ( http://sourceforge.net/projects/giflib/ ) * libtiff ( http://www.libtiff.org/ ) * libdjvulibre ( https://djvu.sourceforge.net/ ) * ... Libraries originally required by Fbi-1.31 but not by FIM: libFS, libCURL, libLIRC Usually, building and installing FIM proceeds like: ./configure --help # get options you may pass to configure ./configure make make test sudo make install If you wish to run `./configure` again with different options, it is recommended to `make clean` before that. -------------------------------------------------------------------------------- ## [ 4.1 Test](#41test) ## # run fim in interactive mode (press q to quit) make test # run the test suite make tests You can also run separately parts of `make tests`: # run only -o fbdev tests (if disabled, fail) make fbtests # run only -o sdl tests (if disabled, fail) make sdltests # run only -o aa tests (if disabled, fail) make aatests # run only -o ca tests (if disabled, fail) make cacatests -------------------------------------------------------------------------------- ## [ 4.2 Example on Debian](#42example-on-debian) ## sudo apt-get install subversion sudo apt-get install flex libfl-dev bison sudo apt-get install automake autoconf libtool # to generate configure, etc sudo apt-get install pkg-config # to generate configure sudo apt-get install libreadline-dev libexif-dev sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev sudo apt-get install libsdl2-dev libaa1-dev libcaca-dev # experimental, not recommended: sudo apt-get install libpoppler-dev libdjvulibre-dev libspectre-dev sudo apt-get install libarchive-dev svn co http://svn.savannah.nongnu.org/svn/fbi-improved/trunk/ fim cd fim autoreconf -i ./configure --enable-aa --enable-caca --enable-sdl make sudo make install ## [ 5 Run time requirements](#5run-time-requirements) ## -------------------------------------------------------------------------------- * Linux (not sure if it is necessary for it to be an x86; i think not) * The framebuffer device ( e.g.: `/dev/fb0` or `/dev/fb/0` ) enabled in the kernel ( and usually found in `"/usr/src/linux/Documentation/fb"` in the kernel source code tree ). * unless disabled, FIM will create a history (`~/.fim_history`) file in the `${HOME}` directory when leaving (so it assumes ${HOME} to exist) * shared library files for e.g.: libpng, libjpeg, libgif, libtiff, libreadline, libexif, ... ## [ 6 Original Idea](#6original-idea) ## -------------------------------------------------------------------------------- FIM derives from the wonderful fbi-1.31, written by Gerd Hoffmann/Knorr: ( Fbi can be obtained at https://www.kraxel.org/blog/linux/fbida/ ). It all started in 2005, developing a small 'vim-like fbi patch', and following features to enrich Fbi with a command line and more customizations. FIM is a significant reorganization and expansion of the Fbi code, and aims at obtaining the most scriptable and configurable image viewer ever. ## [ 7 Notes for patch writers](#7notes-for-patch-writers) ## -------------------------------------------------------------------------------- To run, FIM requires a Linux box with X, or the framebuffer device enabled in the kernel, and some popular image file decoding libraries. Information about the framebuffer can be found under the directory "./Documentation/fb" inside the kernel tree (usually "/usr/src/linux/Documentation/fb" ). The file decoding libraries are listed in an earlier section. Tested and working with library SDL-1.2.12 through SDL-1.2.15. Experimental support for SDL-2.0. From the original Fbi README, it reads that Gerd himself built FBI hacking "a svgalib PhotoCD viewer", so regard this software as a big, dirty code potpourri :) . For the sake of completeness, FIM started as a fork of version 1.31 of fbi, available from http://dl.bytesex.org/releases/fbida/fbi_1.31.tar.gz . Useful documents I've read and consulted during the coding of Fim, and useful for hacking it: * Thomas Niemann's tutorial to yacc & lex * The yacc & lex HOWTO * GNU readline manual * Ray Lischner, STL Pocket Reference, O'Reilly, 2004 * Herbert Schildt "C++ - Complete Reference" Third Edition, Osborne McGraw-Hill, 1999 * http://www.gnu.org/software/m4/manual/ * http://www.gnu.org/software/autoconf/manual/ * http://www.gnu.org/software/automake/manual/ * http://www.gnu.org/software/make/manual/ * http://www.gnu.org/software/bash/manual/ * http://www.gnu.org/software/bison/manual/ * http://cppreference.com/ * `man console_codes` * `man fb.modes` * `man fbi` * `man console_ioctl` * `man resizecons` Further useful documents: * `vim -c ':help'` * `man 3 history` * `man readline` * http://www.gnu.org/prep/standards/ Useful URLs: * http://www.tldp.org/HOWTO/Framebuffer-HOWTO.html and mirrors * http://www.linux.org/docs/ldp/howto/Framebuffer-HOWTO.html * http://www.pluto.it/files/ildp/HOWTO/Framebuffer-HOWTO/Framebuffer-HOWTO.html and * http://bisqwit.iki.fi/source/fbmodes.html * http://asm.sourceforge.net/articles/fb.html * http://www.linuxjournal.com/article/2783 Platforms tested in the past versions (fim-0.3...): * 2.6.25-2-686 Linux Kernel, GCC-4.3.1, flex 2.5.35, bison 2.3, Debian Lenny, x86 * 2.6.17 Linux Kernel, GCC-3.4.6, gentoo, x86 * 2.6.17 Linux Kernel, GCC-4.1.1, gentoo, x86 * 2.6.17 Linux Kernel, GCC-3.3.6, flex 2.5.4, bison 1.875d, gentoo, x86 * 2.6.17 Linux Kernel, GCC-3.3.6, flex 2.5.4, bison 2.2 , gentoo, x86 * 2.6.17 Linux Kernel, GCC-3.3.6, flex 2.5.33,bison 2.2 , gentoo, x86 * 2.6.19 Linux Kernel, GCC-4.1.1, flex 2.5.33,bison 2.2 , gentoo, powerpc * other ones, but non documented here. If you intend to write patches or contribute to the code, be sure of reading all of the documentation and _write me an email first_ (I will give you some advice). -------------------------------------------------------------------------------- ## [ 7.1 Hacking, maintenance guidelines](#71hacking-maintenance-guidelines) ## If you hack FIM in an interesting way, consider submitting your changes as a patch. * If you introduce support for a new file format: `fim -V` should list the your new format, too (so you should update it). * Same for a new output device. * FIM should continue passing the tests after your patch, and your patch should be robust, too. Consider writing a new test case. ## [ 8 Availability in Linux distributions](#8availability-in-linux-distributions) ## -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ## [ 8.1 Debian, Ubuntu](#81debian-ubuntu) ## You should find fim in Debian and Ubuntu, and install it with: sudo apt-get install fim But beware: the deb packages may be outdated. In order to build from repository, you are advised to install packages from the following (overly complete) list: autoconf autoconf-archive autoheader automake autotools-dev bison ctags flex groff g++ libaa1-dev libcaca-dev libdjvulibre-dev libgif4 libgif-dev libjpeg-dev libncurses5-dev libpng-dev libpoppler-cpp-dev libpoppler-dev libreadline-dev libsdl2-dev libspectre-dev libtiff-dev libtool m4 make svn txt2html libexif-dev The above list was valid on a Debian Jessie installation; it's possible that these packages names change with time. ## [ 9 License](#9license) ## -------------------------------------------------------------------------------- FIM is free software, and is licensed under the GPLv2 or later. FIM has been written by Michele Martone. FIM started as a fork of fbi-1.31 by Gerd Hoffmann, which is "GPLv2 or later". FIM uses the PCX reading code contributed by Mohammed Isam. FIM also uses a regex.c file from the GNU Regular Expressions library, distributed on http://directory.fsf.org/regex.html, in the version shipped with the Mutt mail user agent ( http://www.mutt.org ). It also uses scripts shipped with the Vim text editor (http://www.vim.org), which is licensed compatibly with the GPL. The FIM source code package includes the Lat15-Terminus16.psf file, originally from the GPL licensed Terminus Font package, version 4.30 authored by Dimitar Toshkov Zhekov. ## [ 10 Contacts, mailing lists, URLs](#10contacts-mailing-lists-urls) ## -------------------------------------------------------------------------------- FIM is (C) 2007-2023 Michele Martone. Email: "dezperado_FOobAr_autistici_Baz_org", just care replacing _FOobAr_ with a '@' and _Baz_ with a '.'. GPG Key: 0xE0E669C8EF1258B8 If it is for a bug report or installation help, be sure of reading the documentation and the BUGS file first. FIM is not perfect: a number of weaknesses are summarized in the man pages, the TODO file, and the BUGS file. Homepage : https://www.nongnu.org/fbi-improved/ Savannah Page: http://savannah.nongnu.org/projects/fbi-improved/ Announcements: http://freecode.com/projects/fbi-improved/ Mailing List : http://savannah.nongnu.org/mail/?group=fbi-improved (or http://lists.nongnu.org/mailman/listinfo/fbi-improved-devel) Releases : http://download.savannah.nongnu.org/releases/fbi-improved Repository : http://svn.savannah.nongnu.org/svn/fbi-improved Off. Mirror : http://www.autistici.org/dezperado/fim/ ChangeLog : http://svn.savannah.nongnu.org/svn/fbi-improved/trunk/ChangeLog Bugs (official) : http://savannah.nongnu.org/bugs/?group=fbi-improved fim-0.6-rc2/config.h.in0000644000175000017500000003116114454353442011574 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* custom CXXFLAGS */ #undef CXXFLAGS /* Enable pdf support. */ #undef ENABLE_PDF /* program to use for shell commands */ #undef EXECSHELL /* */ #undef FBI_AUTHOR /* */ #undef FBI_AUTHOR_NAME /* Allows the user to specify a file loader */ #undef FIM_ALLOW_LOADER_STRING_SPECIFICATION /* */ #undef FIM_AUTHOR /* */ #undef FIM_AUTHOR_EMAIL /* */ #undef FIM_AUTHOR_NAME /* */ #undef FIM_AUTOCMDS /* */ #undef FIM_AUTOSKIP_FAILED /* */ #undef FIM_BIG_ENDIAN /* */ #undef FIM_BOZ_PATCH /* */ #undef FIM_CACHE_DEBUG /* */ #undef FIM_CHECK_DUPLICATES /* */ #undef FIM_CHECK_FILE_EXISTENCE /* */ #undef FIM_COMMAND_AUTOCOMPLETION /* */ #undef FIM_CONFIGURATION /* */ #undef FIM_DEFAULT_CONFIG /* */ #undef FIM_DEFAULT_CONFIGURATION /* */ #undef FIM_DEFAULT_CONSOLEFONT /* */ #undef FIM_DEFAULT_KEY_CONFIG /* */ #undef FIM_EXPERIMENTAL_ROTATION /* */ #undef FIM_HANDLE_GIF /* */ #undef FIM_HANDLE_TIFF /* */ #undef FIM_HAS_TIMEOUT /* */ #undef FIM_ITERATED_COMMANDS /* */ #undef FIM_KEEP_BROKEN_CONSOLE /* */ #undef FIM_LINUX_CONSOLEFONTS_DIR_SCAN /* */ #undef FIM_NAMESPACES /* */ #undef FIM_NOFB /* */ #undef FIM_NOFIMRC /* */ #undef FIM_NOHISTORY /* */ #undef FIM_PATHS_IN_MAN /* */ #undef FIM_PIPE_IMAGE_READ /* */ #undef FIM_RANDOM /* */ #undef FIM_READ_DIRS /* */ #undef FIM_READ_STDIN /* */ #undef FIM_READ_STDIN_IMAGE /* */ #undef FIM_RECORDING /* */ #undef FIM_RECURSIVE_DIRS /* */ #undef FIM_REMOVE_FAILED /* */ #undef FIM_SKIP_KNOWN_FILETYPES /* */ #undef FIM_SMART_COMPLETION /* */ #undef FIM_SWITCH_FIXUP /* */ #undef FIM_TMP_FILENAME /* */ #undef FIM_TRY_CONVERT /* */ #undef FIM_TRY_DIA /* */ #undef FIM_TRY_INKSCAPE /* */ #undef FIM_TRY_XCFTOPNM /* */ #undef FIM_TRY_XFIG /* */ #undef FIM_USE_DESIGNATED_INITIALIZERS /* */ #undef FIM_USE_READLINE /* */ #undef FIM_USE_ZCAT /* */ #undef FIM_VERSION /* */ #undef FIM_WANTS_SLOW_RESIZE /* */ #undef FIM_WANT_CUSTOM_INFO_STATUS_BAR /* If defined, exiftool will be used to get additional file information (EXPERIMENTAL). */ #undef FIM_WANT_EXIFTOOL /* */ #undef FIM_WANT_FB_CONSOLE_SWITCH_WHILE_LOADING /* Fim will be capable of marking files while viewing and outputting their names on exit. */ #undef FIM_WANT_FILENAME_MARK_AND_DUMP /* */ #undef FIM_WANT_FONT_MAGNIFY_FACTOR /* Enable a hardcoded font in the executable. */ #undef FIM_WANT_HARDCODED_FONT /* Internals shall use 64 bit integers. */ #undef FIM_WANT_LONG_INT /* Scripting. (enabled by default) */ #undef FIM_WANT_NOSCRIPTING /* Output console. (enabled by default) */ #undef FIM_WANT_NO_OUTPUT_CONSOLE /* Enables raw bits rendering */ #undef FIM_WANT_RAW_BITS_RENDERING /* */ #undef FIM_WANT_SEEK_MAGIC /* */ #undef FIM_WANT_STATIC_BINARY /* Enables text rendering */ #undef FIM_WANT_TEXT_RENDERING /* Fim windowing support */ #undef FIM_WINDOWS /* */ #undef FIM_WITH_AALIB /* Defined, if (EXPERIMENTAL, INCOMPLETE) libarchive support is enabled */ #undef FIM_WITH_ARCHIVE /* BMP file support. */ #undef FIM_WITH_BMP /* */ #undef FIM_WITH_DEBUG /* */ #undef FIM_WITH_LIBCACA /* */ #undef FIM_WITH_LIBEXIF /* We have libImlib */ #undef FIM_WITH_LIBIMLIB2 /* */ #undef FIM_WITH_LIBJASPER /* Defined, if libpng support is enabled */ #undef FIM_WITH_LIBPNG /* Defined if libsdl support is enabled, and set to 1 or 2. */ #undef FIM_WITH_LIBSDL /* Defined if sample bogus 'xyz' loader support is enabled. */ #undef FIM_WITH_LIBXYZ /* Defined when framebuffer device support is turned off. */ #undef FIM_WITH_NO_FRAMEBUFFER /* PCX file support. */ #undef FIM_WITH_PCX /* Defined, if UFRaw support is enabled */ #undef FIM_WITH_UFRAW /* Define to 1 if you have the `bcmp' function. */ #undef HAVE_BCMP /* Define to 1 if you have the `bcopy' function. */ #undef HAVE_BCOPY /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO /* Define to 1 if you have the header file. */ #undef HAVE_CLIMITS /* Define to 1 if you have the header file. */ #undef HAVE_CSTDIO /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the `drand48' function. */ #undef HAVE_DRAND48 /* If present, fgetln() will be used as a replacement for getline(). (on BSD) */ #undef HAVE_FGETLN /* Define to 1 if you have the `fileno' function. */ #undef HAVE_FILENO /* Define to 1 if you have the header file. */ #undef HAVE_FILESYSTEM /* We have FlexLexer.h */ #undef HAVE_FLEXLEXER_H /* Define to 1 if you have the `fmemopen' function. */ #undef HAVE_FMEMOPEN /* Define to 1 if you have the header file. */ #undef HAVE_FNMATCH_H /* Define to 1 if you have the header file. */ #undef HAVE_FONTCONFIG_FCFREETYPE_H /* Define to 1 if you have the header file. */ #undef HAVE_FONTCONFIG_FONTCONFIG_H /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO /* If present, will be used for stdin reading. (on GNU) */ #undef HAVE_GETDELIM /* If present, the getenv function allows fim to read environment variables. */ #undef HAVE_GETENV /* If present, will be used for stdin reading. (on GNU) */ #undef HAVE_GETLINE /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Should live when _GNU_SOURCE, but it could be not the case. */ #undef HAVE_GET_CURRENT_DIR_NAME /* Define to 1 if you have the header file. */ #undef HAVE_GLOB_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_IOCTL_H /* Define to 1 if you have the `curses' library (-lcurses). */ #undef HAVE_LIBCURSES /* We have libdjvulibre */ #undef HAVE_LIBDJVU /* Define to 1 if you have the `fl' library (-lfl). */ #undef HAVE_LIBFL /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H /* We have libGraphicsMagick */ #undef HAVE_LIBGRAPHICSMAGICK /* We have libjpeg */ #undef HAVE_LIBJPEG /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `ncurses' library (-lncurses). */ #undef HAVE_LIBNCURSES /* We have libpoppler (Warning: the API could still break! (as of v.0.8.7--0.24.1)) */ #undef HAVE_LIBPOPPLER /* We have libspectre */ #undef HAVE_LIBSPECTRE /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_FB_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_KD_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_VT_H /* */ #undef HAVE_MATRIX_MARKET_DECODER /* Define to 1 if you have the `memcmp' function. */ #undef HAVE_MEMCMP /* Have memmem */ #undef HAVE_MEMMEM /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* We have pipe() */ #undef HAVE_PIPE /* Define to 1 if you have the `rand' function. */ #undef HAVE_RAND /* Define to 1 if you have the `random' function. */ #undef HAVE_RANDOM /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP /* We have */ #undef HAVE_REGEX /* We have regex.h */ #undef HAVE_REGEX_H /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcpy' function. */ #undef HAVE_STRCPY /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncmp' function. */ #undef HAVE_STRNCMP /* Have sync */ #undef HAVE_SYNC /* Define to 1 if you have the header file. */ #undef HAVE_SYSEXITS_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* We have sys/ioctl.h */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H /* We have sys/select.h */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_USER_H /* We have sys/wait.h */ #undef HAVE_SYS_WAIT_H /* We have termios.h */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_UNIX_H /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the header file. */ #undef HAVE_WORDEXP_H /* We have _regex.h */ #undef HAVE__REGEX_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `int *', as computed by sizeof. */ #undef SIZEOF_INT_P /* The size of `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T /* The size of `size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* SVN REVISION */ #undef SVN_REVISION /* SVN REVISION NUMBER */ #undef SVN_REVISION_NUMBER /* Define if you want to use the included (GNU) regex.c. */ #undef USE_GNU_REGEX /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif fim-0.6-rc2/README0000644000175000017500000004506514460043144010431 00000000000000-==============================================================================- FIM - Fbi IMproved README document. ================================================================================ - 1 Overview - 2 Description - 3 Features, comparison to other image viewers - 4 Build, test, example - 5 Run time requirements - 6 Original Idea - 7 Notes for patch writers - 8 Availability in Linux distributions - 9 License - 10 Contacts, mailing lists, URLs -==============================================================================- 1 Overview ================================================================================ FIM (Fbi IMproved) is a highly customizable and scriptable image viewer targeted at the users who are comfortable with software like the Vim text editor or the Mutt mail user agent, or keyboard oriented, full screen programs. FIM aims to be a "Swiss Army knife" for viewing images. FIM is multidevice: it has X support (via the SDL library), it supports ASCII art output (via the aalib and libcaca libraries), and because it derives from the Fbi image viewer (by Gerd Hoffmann), it can display images in the Linux framebuffer console, too. FIM is free software, distributed under the terms of the GPL software license. -==============================================================================- 2 Description ================================================================================ FIM invocation is documented in `man fim` (doc/fim.man.html). The FIM language (syntax, commands, variables, key bindings) is documented in `man fimrc` (doc/fimrc.man.html). FIM offers many ways for scaling, orienting, listing or rearranging the ordering of images. FIM is capable of regular expressions based (on filename) vim-like autocommands, comment-based search and filtering, display of EXIF tags, customizable command lines, and use a custom font (from console fonts). FIM offers GNU `readline` command line autocompletion and history, completely customizable key bindings, internal/external scriptability (through return codes, standard input/output, commands given at invocation time, and an initialization file), internal filename-based image search, and more. Each documentation item is accessible via the internal `help` command. -==============================================================================- 3 Features, comparison to other image viewers ================================================================================ Features: * modes: interactive (default), and command line * lots of the functionality is scripted in an internal domain specific language * on-screen debug and information console in command mode * per-image variables (e.g.: `i:var="value"`) * regular expression filename search (`/*.png`) and view * command line history (enter the console with `':'`, then use arrows) * command line Tab-based command autocompletion (thanks to the GNU readline) * command line history file save/load support (`~/.fim_history`) * key-action bindings, with Shift (uppercase and Control ('C-') key combinations * simple `if/while` scriptability, with integer/float/string variables and arithmetic evaluation * command aliases support (macros) * event autocommands (styled after Vim's `autocmd` ) * regular expressions on filenames to enrich autocommand behaviour * image descriptions display ('expando' sequences) * regular expressions on image descriptions * configuration (initialization) file support (`~/.fimrc`) * usable built-in default configuration * wrapper script (`fimgs`) to convert pdf,ps,eps,dvi,cbr(rar),cbz(zip),tar,tar.gz,tgz,http://... contents into images that can be displayed * embedded piping through `convert`,`inkscape`,`xcftopnm`,`dia`... to visualize further file formats * view a Matrix Market file rendering via librsb * index-based `goto` styled after Vim (`:`) * image search with regular expressions on filenames (`goto` command) * other stuff usual for an image viewer (`scale`, `pan,` etc..) * other stuff unusual for an image viewer (setting scale factor, auto width scale, auto height scale, marking of 'interesting' files, sorting of files in the list, recording/replaying of sessions, repeat last action ) * image flip, mirror, rotation, stretch (asymmetric scaling) * command iteration (with the `[n]` syntax * external script file execution * system call support * image cache and mipmaps * image prefetch * pipe commands from an input program * many features could be enabled or disabled at compile time editing the Makefile * run under screen or ssh * read files list via standard input * read image file via standard input * read commands script via standard input * support for SDLlib (Simple Directmedia Layer) (`-o sdl`) (X!) * support for AAlib (ASCII Art rendering) (`-o aa`) * support for libcaca (Colour ASCII Art rendering) (`-o ca`) * experimental (incomplete, discouraged) support for Imlib2 (`-o imlib2`) (X!) * experimental support for file formats: PDF, PS, DJVU * view any file as a binary/RGB pixelmap * view any file as (rendered) text * open files at a specified byte offset * image list limiting (temporary list shrinking) * comments / captions / description files * search and reordering based on descriptions and internal variables * decode files based on magic number (contents), not file extension * recursive load from directory * sort files list on file name, file size or name date * text font control (selection of size and consolefont) * dump list of selected images to `stdout` * jump between last two images repeatedly with one key The next table is a comparison (very outdated...) of popular image viewers available on Linux, focusing on FIM-like free software ones. | Program: |kuickshow|eog|xz|gv|fbi|FIM|GQview|dfbsee|pv|qiv| |--------------------------------|-----|---|--|--|---|---|------|------|--|---| |status:(a)lpha/(m)ature | m | m | m| | a | m| m | |m | m | |X=X,f=framebuffer,s=SVGA,a=ascii| X | X |Xs| X| f |fXa| X | ? |f | X | |linux specific | | | ?| | * | *| | |* | ? | |key rebindings | * | | | | | *| * | | | ? | |external scriptability | | | | | ~ | *| | | | ? | |internal scriptability | | | | | | *| | | | ? | |internal scriptability | | | | | | *| | | | ? | |printing support | * | * | ?| | | | * | | | ? | |slideshow | * | * | | | * | *| * | |* | * | |caching | * | ? | | | | *| * | | | ? | |preview browser | * | | | | | | * | | | ? | |EXIF tag display | * | | | | * | *| * | | | ? | |internal windowing | | | | | | X| | | | ? | |internal image search | | | | | | *| | | | ? | |external image search | | | | | | | * | | | ? | |'pan views' ('rich' views) | | | | | | | * | | | ? | |system interaction | * | | | | | *| * | | | ? | |system interaction safe | * | | | | | | | | | ? | |remote commands | | | | | | | * | | | ? | |saves last folder | * | | | | | | * | | | ? | |runs under screen | | | | | | *| | | | ? | |standard input interaction | | | | | | *| | | | ? | |rotation | * | ? | ?| | ? | *| ? | ? |* | * | |history | | | | | | *| | | | | |multi-device | | | | | | *| | | | | |mirroring | | | | | | *| | | | * | |description files | | | | | | *| | | | | Other nice command line picture viewers: pv (http://www.trashmail.net/pv/), zgv, feh, sxiv, mirage... ______________________________________________________________________________ -==============================================================================- 4 Build, test, example ================================================================================ Requirements are: * the GNU readline library ( https://www.gnu.org/software/readline/ ) * GNU flex (NOT any lex ) ( https://www.gnu.org/software/flex/ ) (some systems need also 'libfl-dev' to find `FlexLexer.h`) * GNU bison (NOT any yacc) ( https://www.gnu.org/software/bison/) * the GCC ( GNU Compiler Collection ) ( http://gcc.gnu.org/ ) or clang ( https://clang.llvm.org/ ) * and optionally: * libsdl-1.2 ( http://libsdl.org/ ) * libsdl-2.0 ( http://libsdl.org/ ) * libexif ( https://libexif.github.io/ ) * libjpeg ( http://www.ijg.org/ ) * libpng ( http://www.libpng.org/ ) * giflib ( http://sourceforge.net/projects/giflib/ ) * libtiff ( http://www.libtiff.org/ ) * libdjvulibre ( https://djvu.sourceforge.net/ ) * ... Libraries originally required by Fbi-1.31 but not by FIM: libFS, libCURL, libLIRC Usually, building and installing FIM proceeds like: ./configure --help # get options you may pass to configure ./configure make make test sudo make install If you wish to run `./configure` again with different options, it is recommended to `make clean` before that. -------------------------------------------------------------------------------- 4.1 Test # run fim in interactive mode (press q to quit) make test # run the test suite make tests You can also run separately parts of `make tests`: # run only -o fbdev tests (if disabled, fail) make fbtests # run only -o sdl tests (if disabled, fail) make sdltests # run only -o aa tests (if disabled, fail) make aatests # run only -o ca tests (if disabled, fail) make cacatests -------------------------------------------------------------------------------- 4.2 Example on Debian sudo apt-get install subversion sudo apt-get install flex libfl-dev bison sudo apt-get install automake autoconf libtool # to generate configure, etc sudo apt-get install pkg-config # to generate configure sudo apt-get install libreadline-dev libexif-dev sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev sudo apt-get install libsdl2-dev libaa1-dev libcaca-dev # experimental, not recommended: sudo apt-get install libpoppler-dev libdjvulibre-dev libspectre-dev sudo apt-get install libarchive-dev svn co http://svn.savannah.nongnu.org/svn/fbi-improved/trunk/ fim cd fim autoreconf -i ./configure --enable-aa --enable-caca --enable-sdl make sudo make install -==============================================================================- 5 Run time requirements ================================================================================ * Linux (not sure if it is necessary for it to be an x86; i think not) * The framebuffer device ( e.g.: `/dev/fb0` or `/dev/fb/0` ) enabled in the kernel ( and usually found in `"/usr/src/linux/Documentation/fb"` in the kernel source code tree ). * unless disabled, FIM will create a history (`~/.fim_history`) file in the `${HOME}` directory when leaving (so it assumes ${HOME} to exist) * shared library files for e.g.: libpng, libjpeg, libgif, libtiff, libreadline, libexif, ... -==============================================================================- 6 Original Idea ================================================================================ FIM derives from the wonderful fbi-1.31, written by Gerd Hoffmann/Knorr: ( Fbi can be obtained at https://www.kraxel.org/blog/linux/fbida/ ). It all started in 2005, developing a small 'vim-like fbi patch', and following features to enrich Fbi with a command line and more customizations. FIM is a significant reorganization and expansion of the Fbi code, and aims at obtaining the most scriptable and configurable image viewer ever. -==============================================================================- 7 Notes for patch writers ================================================================================ To run, FIM requires a Linux box with X, or the framebuffer device enabled in the kernel, and some popular image file decoding libraries. Information about the framebuffer can be found under the directory "./Documentation/fb" inside the kernel tree (usually "/usr/src/linux/Documentation/fb" ). The file decoding libraries are listed in an earlier section. Tested and working with library SDL-1.2.12 through SDL-1.2.15. Experimental support for SDL-2.0. From the original Fbi README, it reads that Gerd himself built FBI hacking "a svgalib PhotoCD viewer", so regard this software as a big, dirty code potpourri :) . For the sake of completeness, FIM started as a fork of version 1.31 of fbi, available from http://dl.bytesex.org/releases/fbida/fbi_1.31.tar.gz . Useful documents I've read and consulted during the coding of Fim, and useful for hacking it: * Thomas Niemann's tutorial to yacc & lex * The yacc & lex HOWTO * GNU readline manual * Ray Lischner, STL Pocket Reference, O'Reilly, 2004 * Herbert Schildt "C++ - Complete Reference" Third Edition, Osborne McGraw-Hill, 1999 * http://www.gnu.org/software/m4/manual/ * http://www.gnu.org/software/autoconf/manual/ * http://www.gnu.org/software/automake/manual/ * http://www.gnu.org/software/make/manual/ * http://www.gnu.org/software/bash/manual/ * http://www.gnu.org/software/bison/manual/ * http://cppreference.com/ * `man console_codes` * `man fb.modes` * `man fbi` * `man console_ioctl` * `man resizecons` Further useful documents: * `vim -c ':help'` * `man 3 history` * `man readline` * http://www.gnu.org/prep/standards/ Useful URLs: * http://www.tldp.org/HOWTO/Framebuffer-HOWTO.html and mirrors * http://www.linux.org/docs/ldp/howto/Framebuffer-HOWTO.html * http://www.pluto.it/files/ildp/HOWTO/Framebuffer-HOWTO/Framebuffer-HOWTO.html and * http://bisqwit.iki.fi/source/fbmodes.html * http://asm.sourceforge.net/articles/fb.html * http://www.linuxjournal.com/article/2783 Platforms tested in the past versions (fim-0.3...): * 2.6.25-2-686 Linux Kernel, GCC-4.3.1, flex 2.5.35, bison 2.3, Debian Lenny, x86 * 2.6.17 Linux Kernel, GCC-3.4.6, gentoo, x86 * 2.6.17 Linux Kernel, GCC-4.1.1, gentoo, x86 * 2.6.17 Linux Kernel, GCC-3.3.6, flex 2.5.4, bison 1.875d, gentoo, x86 * 2.6.17 Linux Kernel, GCC-3.3.6, flex 2.5.4, bison 2.2 , gentoo, x86 * 2.6.17 Linux Kernel, GCC-3.3.6, flex 2.5.33,bison 2.2 , gentoo, x86 * 2.6.19 Linux Kernel, GCC-4.1.1, flex 2.5.33,bison 2.2 , gentoo, powerpc * other ones, but non documented here. If you intend to write patches or contribute to the code, be sure of reading all of the documentation and _write me an email first_ (I will give you some advice). -------------------------------------------------------------------------------- 7.1 Hacking, maintenance guidelines If you hack FIM in an interesting way, consider submitting your changes as a patch. * If you introduce support for a new file format: `fim -V` should list the your new format, too (so you should update it). * Same for a new output device. * FIM should continue passing the tests after your patch, and your patch should be robust, too. Consider writing a new test case. -==============================================================================- 8 Availability in Linux distributions ================================================================================ -------------------------------------------------------------------------------- 8.1 Debian, Ubuntu You should find fim in Debian and Ubuntu, and install it with: sudo apt-get install fim But beware: the deb packages may be outdated. In order to build from repository, you are advised to install packages from the following (overly complete) list: autoconf autoconf-archive autoheader automake autotools-dev bison ctags flex groff g++ libaa1-dev libcaca-dev libdjvulibre-dev libgif4 libgif-dev libjpeg-dev libncurses5-dev libpng-dev libpoppler-cpp-dev libpoppler-dev libreadline-dev libsdl2-dev libspectre-dev libtiff-dev libtool m4 make svn txt2html libexif-dev The above list was valid on a Debian Jessie installation; it's possible that these packages names change with time. -==============================================================================- 9 License ================================================================================ FIM is free software, and is licensed under the GPLv2 or later. FIM has been written by Michele Martone. FIM started as a fork of fbi-1.31 by Gerd Hoffmann, which is "GPLv2 or later". FIM uses the PCX reading code contributed by Mohammed Isam. FIM also uses a regex.c file from the GNU Regular Expressions library, distributed on http://directory.fsf.org/regex.html, in the version shipped with the Mutt mail user agent ( http://www.mutt.org ). It also uses scripts shipped with the Vim text editor (http://www.vim.org), which is licensed compatibly with the GPL. The FIM source code package includes the Lat15-Terminus16.psf file, originally from the GPL licensed Terminus Font package, version 4.30 authored by Dimitar Toshkov Zhekov. -==============================================================================- 10 Contacts, mailing lists, URLs ================================================================================ FIM is (C) 2007-2023 Michele Martone. Email: "dezperado_FOobAr_autistici_Baz_org", just care replacing _FOobAr_ with a '@' and _Baz_ with a '.'. GPG Key: 0xE0E669C8EF1258B8 If it is for a bug report or installation help, be sure of reading the documentation and the BUGS file first. FIM is not perfect: a number of weaknesses are summarized in the man pages, the TODO file, and the BUGS file. Homepage : https://www.nongnu.org/fbi-improved/ Savannah Page: http://savannah.nongnu.org/projects/fbi-improved/ Announcements: http://freecode.com/projects/fbi-improved/ Mailing List : http://savannah.nongnu.org/mail/?group=fbi-improved (or http://lists.nongnu.org/mailman/listinfo/fbi-improved-devel) Releases : http://download.savannah.nongnu.org/releases/fbi-improved Repository : http://svn.savannah.nongnu.org/svn/fbi-improved Off. Mirror : http://www.autistici.org/dezperado/fim/ ChangeLog : http://svn.savannah.nongnu.org/svn/fbi-improved/trunk/ChangeLog Bugs (official) : http://savannah.nongnu.org/bugs/?group=fbi-improved $Id: README 1985 2023-07-25 22:02:12Z dezperado $ vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=markdown:norl: fim-0.6-rc2/NEWS.in0000644000175000017500000010544114503373174010657 00000000000000 FIM NEWS -- history of main user-visible changes in FIM. Version 0.6-rc2 * File dropping support in SDL2 mode and more responsive readline mode. Version 0.6-rc1 * Experimental support for SDL2. Version 0.6-rc0 A summary of major improvements: * Colour ASCII-Art output via libcaca, selected with -o ca * better mechanism to determine best output device * font magnification by integer factors, good for higher resolutions * runtime font selection * new options to commands "scale", "goto", "limit", "list", ... * 'limit' view to relevant image files based on properties (like in 'mutt') * pass key presses to be automated at startup with -k and -K options * pretty free from memory leaks * -X switch inhibits custom external converters * new powerful subcommand "list 'mark'" * new command-line switches (--sort..) to sort the initial files list * use mipmaps for faster scaling * open files from a files list with -L * load image description files with -D * background recursive scan and load of files with -B * search files at startup based on description with -/ and --// * new verbosity and debug options * better error handling when encountering corrupt files * fast in-place switch to high-res file via --load-shadow-directory * improvements in -o aa (Ascii Art output device with aalib) * more options for window size selection in -o sdl * Keys F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12 now usable with 'bind' In detail, in no particular order: # (r1979-r1985) * Experimental support for SDL2. # (1981) * More responsive readline mode. # (r1971) * Switch --resolution 'fullscreen' appends 'W' if in SDL mode. # (r1970) * If a "matrix market" file is loaded, its rows, columns and nnz are image variables, too. # (r1956) * Introduce special 'early' form -C =var=val where variable var is assigned to unquoted and non-interpreted value val immediately. # (r1952) * Fix: --cd-and-readdir was not jumping back to first file. # (r1937) * Fix: --device option not ignored anymore. # (r1932) * Rename --no-etc-rc-file switch to --no-etc-fimrc-file . # (r1921) * fimgs: bunzip2, wget, and xz are now optional. # (r1918) * Bugfix: fimgs to properly remove temporary directory after loading downloaded files. # (r1903) * Misc small improvements in documentation text output and reporting (no cursor in post-search output line; misc messages). * Key 'Z' now assigned to 'sleep 1'. # (r1910) * Key 'Del' now assigned to 'list "remove"'. # (r1900) * Add -= as short form of the --no-auto-scale option. # (r1898-r1901) * Experimental: add command "crop", also activated after selecting the area by holding Shift and clicking with left mouse button (if running with -o sdl). # (r1890) * Add command "pan 'vsteps%' 'hsteps%'" and "'pan 'vsteps' 'hsteps'". # (r1880) * Keys F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12 are now usable with 'bind' with modes -o aa, -o ca, -o dumb. # (r1878) * Fix for -o sdl: when flipped or mirrored, it used to draw a smaller box by mistake. # (r1876) * Only filenames matching "^[/A-Za-z0-9_.][/A-Za-z0-9_.-]*$" can occur in a conversion command involving an external program. # (r1875) * --pread-cmd=command substitutes any occurrence of '{}' in command with the actual filename, executes the result and reads an image from its stdout. # (r1834) * -o fb=S will not tolerate running under screen. # (r1832) * Bugfix in --script-from-stdin now prevents possible crashes. # (r1816) * Removed configure options --enable-c++11 -- use CXXFLAGS instead. # (r1784,r1801) * Bugfix: 'autocmd_del' with no arguments would crash. # (r1781) * Bugfix: autocommand "PostHardcodedConfigLoading" now triggers even if --disable-fimrc . # (r1771-r1773,r1776-r1777,r1781,r1783-r1785,r1789,r1792-r1796,r1803-r1806,r1808-r1809,r1813-r1815,r1818,r1822-r1823,r1827,r1831-r1836,r1839-r1973) * Internals: considerably expanded 'make tests'. # (r1770,r1772) * Add command 'stderr', similar to 'stdout'. # (r1739,TODO) * This is the last FIM version supporting the C++03 standard. # (r1731,r1965) * Refresh configure and Makefile templates. # (r1729) * Build fixes for the MinGW environment. # (r1752,r1838) * man fim: improve manual contents (on ~/.fim_history, individual options, wording, etc.). # (r1727) * man fimrc: added a section with default aliases, # (r1724,r1738) * Where appropriate, 'make tests' uses 'timeout' to prevent possible hangs. # (r1718-r1720,r1726,r1777-r1780,r1903) * Switch -K aka --chars-press simulates input of characters at startup. # (r1709,r1710) * Fix: slideshow function (e.g. `fim --slideshow=5 media/`) will now cycle forever, unless --once/-1 option specified (as in fbi). # (r1707,r1711) * Fix: after 'quit' no command shall execute anymore (unless in -F). # (r1705,r1759-r1760) * With SDL one can specify window size as percentage of allowed size (-o sdl=w55%), or draw a help grid map (-o sdl=h). # (r1700) * With SDL (-o sdl), center window by default. # (r1693) * Fix: now pressing keys "1n1n" will not execute 'n' 11 times, but twice. # (r1689) * configure --enable-debug is a developer option now. # (r1679-r1688,r1721-r1722,r1753-r1758,r1760,r1772,r1788,1797-1799,r1802,r1836) * libcaca (-o ca) mode is now complete and is the default ASCII Art mode. # (r1677,r1678,r1725) * Slideshow function (e.g `fim --slideshow=5 *.jpg`) now more responsive. # (r1662) * Arrow keys are now working in aalib (-o aa). # (r1649) * Bugfix with aalib (-o aa): don't truncate long lines. # (r1641,r1911) * Avoid memory leak in language parser. # (r1644-r1646) * Avoid console buffer memory corruption. # (r1626) * Eliminate a memory leak from file loading code. # (r1625,r1637,r1657,r1658,r1661,r1665,r1666,1968) * Eliminate memory leaks in PNG, JPG, TIFF, EXIF, and font decoding code. # (r1624,r1650) * Fix possibly broken `make -j` in rebuilding fimgs.man and fimrc.man. # (r1623) * Correct configure script check for regcomp() -- could lead to false negatives. # (r1621) * Don't break build on missing 'gs'. # (r1616,r1659,r1660,r1667,r1762,r1839) * Experimental: use --load-shadow-directory to add a "shadow directory". Then 'scale "shadow"' (bound to key '"') will substitute the current displayed image with that of the first same-named file located under a shadow directory. # (r1615) * When loading a directory, regular expression from default "_pushdir_re" variable now matches filenames with .webp extension. # (r1613) * Fix: `fim -c '/'` was broken. # (r1605,r1803) * Add " INTEGER , INTEGER IDENTIFIER arguments" syntax to repeat a command on each file in the interval and substitute its name to '{}' in the arguments to an iterated command IDENTIFIER. # (r1599--r1602,r1945) * If a key is bound to e.g. 'goto "+1F"', keep pressing it to accelerate (not if e.g. "+1f"). # (r1594) * Internal fix: piping from external commands was using 0 instead of 'WNOHANG', leading to hanging. # (r1585) * Internal fix: error handling was missing. # (r1584) * fimgs now to handle tar.xz archives. # (r1583,r1966) * Reload automatically image on file change. # (r1571) * Command 'list' 'sort_var' 'var' to sort file list according to values of 'i:var'. # (r1570) * Command 'list' 'sort_comment' to sort file list according to 'i:_comment' value. # (r1564) * Add a --verbose-font-load switch to set '_fbfont_verbosity=1'. # (r1563) * Variable '_fbfont_verbosity' sets verbose font loading. # (r1561) * Fix: short options -b, -h, -R were not getting optional argument (e.g. -b1). # (r1559) * Key combination C-r now assigned to "reload ''". # (r1555) * Fix: symbol from fbi sources clashed with gcc-6 onwards, breaking compilation. # (r1544) * Key combination C-w assigned to setting auto-scaling to width. # (r1543) * Smoother scroll of large images. # (r1540,r1541,r1741) * If SSH_TTY set and no output device specified, give precedence to aalib, then libcaca. # (r1539) * Bugfix: in --as-text will avoid repeated reload of file. # (r1526) * Hardcoded font (if configured in) will serve as fallback font. # (r1523) * Add a --no-pipe-load / -X switch to _no_external_loader_programs=1; # (r1503) * Description variables beginning with '_' will not go into i: . # (r1502,r1504,r1580) * List variables in all i:* read from description file with "list 'vars|variables'". # (r1499,r1506,r1567,r1568) * Expansion of @variables and @# comments from description files. # (r1501) * The menu key in SDL mode shows a temporary mouse click actions menu. # (r1490,r1491) * Bugfix: description file reading was crashing due to wrong check. # (r1485) * Caption text of "_caption_over_image" takes at most half of the screen. # (r1484) * If _caption_over_image=3, image is possibly drawn below the caption. # (r1480) * The 'v' and 'S' keys now cause a redraw. # (r1477,r1478) * The description line can be of any length. # (r1474) * New configure option, defaulting to: --enable-paths-in-man; it generates man pages with configure specified paths (e.g. sysconfdir, docdir). # (r1468) * Fix: -s switch was broken. # (r1447) * Add a semicolon (;) to -C arguments if not present already. # (r1417) * Framebuffer console switch off while loading: configure with the --enable-framebuffer-switch-while-loading switch to have it back. # (r1413) * Fix: configure would fail on --disable-aa and absent aalib. # (r1403) * Now configure has --enable-seek-magic by default. And is more verbose. # (r1395,r1396) * Command 'help' also shows key bindings, and give multiple answers if matching. # (r1389,r1818,r1823,r1846) * For each word following switch --help, an individual help message is shown. # (r1382) * Command 'goto' accepts multiple arguments; evaluating them until the first one triggering a jump. # (r1379,r1380) * Command goto {'-/'|'+/'}[C] jumps to a file based on character C (default 'S'). If C is 's', to prev/next file with same directory name. If C is 'd', to prev/next file with directory name down the same hierarchy. If C is 'u', to prev/next file with directory name up the same hierarchy. If C is 'b', to prev/next file with same basename. If C is as above but uppercase, to the prev/next file not matching the criteria. # (r1381) * Accordingly, aliases 'next_file_dir_same', 'next_file_dir_other', 'next_file_dir_up', 'next_file_dir_down', 'next_file_same_basename', 'prev_file_dir_same', 'prev_file_dir_other', 'prev_file_dir_up' 'prev_file_dir_down' 'prev_file_same_basename'. # (r1366) * Fix: 'recording' command was not functioning properly. # (r1365) * Fix: don't pop back last command if "recording 'stop'" executed outside of recording mode. * Fix: won't clear recorded list if calling recording 'start' multiple times. # (r1359) * Specifying more than once any of -p -i - causes a warning. # (r1334,r1335,r1346) * New switch --verbose-interpreter to execute interpreter verbosely by setting adequately _debug_commands='ackC'. # (r1331,r1333) * Strings specified within single quotes have single quotes escaped, just as double quotes. So that e.g.: '\'hello\'' equals "'hello'" and "\"hello\"" equals '"hello"'. # (r1330,r1351,r1363) * Variable '_debug_commands' is now a string with several verbosity options. # (r1323,r1325,r1801) * Fix: misc fixes for --offset, e.g. avoiding probing for external loader programs. # (r1319,r1966) * Add --verbose-load option for verbose file loading. # (r1317,r1321) * -C '_seek_magic=..' probes whole range of specified signature when loading a file. # (r1316) * Fix in _seek_magic documentation. # (r1913) * Option --offset accepts numbers suffixed by one of K, M, and G for respectively kibi-, mebi-, and gibi- (2^10, 2^20 and 2^30) units. # (r1314) * Bugfix: --offset option was ignoring lower bytes-offset. # (r1312) * Fix: a check was missing in the PS decoder when reading from stdin. # (r1253) * Command 'pan' accepts '-' and '+' to jump to prev/next file if border is reached. # (r1210-r1213,r1847,r1854) * Command 'font' controls displayed font and scans font directories. * Keys '{' and '}' cycle through available consolefonts. # (r1187) * Variable _fbfont_magnify_factor scales text font at runtime. # (r1198) * Variable _fbfont_as_screen_fraction; if >0, font is scaled to exceed 1/_fbfont_as_screen_fraction of both width and height. If _fbfont_as_screen_fraction<0, font scaling is fixed. # (r1199) * Keys '[' and ']' bound to new aliases "font_reduce" and "font_magnify". * Key '|' bound to new alias "toggle_font_auto_scale". # (r1217) * Switch -r {width:height} / --resolution {width:height} behaves as expected in SDL mode. # (r1184,r1215) * Variable _downscale_huge_at_load, if 1 (default), downscale automatically huge images at load time. To avoid loading images exceeding too much screen size. # (r1202,r1205) * Variable i:_buffered_in_tmpfile stores temporary decoding image filename, if any. # (r1200) * Internally load SVG files by invoking inkscape --without-gui --export-png . A file beginning with "1; 1/16 if 1, no tolerance if <1. # (r1233,r1236,r1238,r1240,r1241,r1242,r1246,r1247) * Variable "_want_wm_mouse_ctrl" controls mouse click/movement behaviour in SDL mode. # (r1231) * Variable "_min_cached_images" is the minimum number of images to keep from eviction. # (r1156) * Commands scale '<' / scale '>' shrinks/magnifies the image using cached mipmaps. # (r1248) * By default, show mouse cursor in full screen SDL mode. # (r1226) * Autocommand "PostInteractiveCommand" does not trigger anymore after 'quit' command. # (r1196) * In case of a CBZ,CBR,PDF,PS,DVI file, the fimgs script now uses '--autotop --autowidth'. # (r1153,1154,1195) * The fimgs script now probes for unrar-nonfree/rar/unrar-free (in this order). # (r1149) * Customize overlay text via variable '_caption_over_image_fmt'. # (r1147,r1148) * Command syntax 'goto {+|-}identifier[+]' (new) jumps to next file having a different value of i:identifier, also empty if without trailing `+'. # (r1136) * Command "limit '-set_union'" merges current limited list with the new one. # (r1135) * Command "limit '-merge'" merges current limited list with the new one. # (r1133,r1134) * Command "desc 'reload'" loads once again description files specified at the command line with --load-image-descriptions-file. # (r1130,r1131) * FIM only checks for filename duplicates if a sorting option is specified. # (r1126) # * Makefile: add a stand-alone 'make ltests' goal to test fim's language only. # (r1113) * Switch -P/--text-reading fixed. Seems to be broken in version 0.5. # (r1108) * Command "color": "color 'negate'" and "color 'desaturate'" introduced. * Commands 'negate' and 'desaturate' deleted. # (r1107-r1011) * Command "color CVS" (CVS among 'protanopia', 'deuteranopia', 'tritanopia', 'p', 'd', 't') simulates a color vision deficiency; adding 'daltonize' applies a tentative color correction; "color 'colorblind'" is short for "color 'deuteranopia'". # (r1112) * Command "color 'identity'": populate the image with 'RGB identity' pixels. # (r1104) # * Language standard level (and a few features) enabled and set from the value of the predefined __cplusplus C++ macro. # (r1079,r1809) * Introduce a "#!fim:/=dir" special description line to specify directory prepended to basename. * Introduce a "#!fim:\=dir" special description line to specify directory prepended to filepath. # (r1072) # * Documented the %k expando for _info_fmt_str. # (r1127,r1128) # * Optimized further the 'limit' command. # (r1078) * Command limit '-list' lists existing variables identifiers as set via 'desc' * Command limit '-list' 'id' lists existing values for instances of variable 'id' as set via 'desc' # (r1068) * Command "limit '~i' MINIDX[-MAXIDX]", with MINIDX and MAXIDX numbers (possibly with K as x 1000 multiplier) restricts filenames list to the specified interval. # (r1070) * Command "limit '~d'", limits to files having exact current file's modify date +- one day. # (r1067) * Command "limit '~z'" limits to files having same file size as the current. * Command "limit '~z' MINSIZE[-MAXSIZE]", with MINSIZE and MAXSIZE numbers with possibly K (x 1024) or M (x 1024 1024) multipliers, limits according to file size. * Command "limit '~d' MINTIME[-MAXTIME]", with MINTIME and MAXTIME numbers, limits files list according to file modify date (expressed as seconds since the epoch, see 'man 2 time'). # (r1069) * Command "limit '~d' MINDATE[-MINDATE]", with MINDATE and MAXDATE dates as in DD/MM/YYYY, and after 1900. # (r1065) * Command "limit '-further' ..." makes 'limit' act on the current list, rather than on the full anew. # (r1056,r1062) * Command "limit" uses new criteria: If invoked with '~!' it restricts to files with unique basename. If with '~=', to files with duplicate basename; if with '~^', to the first of the files with duplicate basename; if with '~$', to the last of the files with duplicate basename. # (r1220) * Alias "unlimit" resets the limited list. # (r1053) * Add variable '_all_file_loaders': a space-separated list of hardcoded file loaders usable with '_file_loader'. # (r1051,r1052) * Switch -R/--recursive[=arg] has now an optional argument; overwrites (if set) or appends to (if beginning with + or |) the "_pushdir_re" variable (recursed filename extensions). # (r1046) * Introduce a "#!fim:+=" special description line to append to cached description. * Introduce a "#!fim:^=" special description line to prepend to cached description. # (r1045) * Introduce a "#!fim:!=" special description line to reset all variables of the cached namespace. # (r1043) * Command 'desc "save"' functionality to save descriptions file data from the currently browsable images list. # (r1048) * Command 'desc "-append" "save"' works in append mode. # (r1044,r1047) * Command 'desc "-all" "save"' saves also all descriptions file variables. # (r1048) * Command 'desc "-nooverw" "save"' does not force overwrite. # (r1039, also in branches/0.5) * To ease reproducible builds: imposing LC_ALL=C to $(YACC) and $(SORT), vim2html.pl reads SOURCE_DATE_EPOCH # (r1035,r1762) * New switch --mark-from-image-descriptions-file: read file names from a description file and use them to mark current list files. # (r1030,r1809) * Introduced alphanumeric restriction in the descriptions shebang variables: must begin with underscore or alphabetic, continue with underscore or alphanumeric. # (r1027) * Keys '(' and ')' are now bound respectively to "goto '^p'" and "goto '$p'"; that is jump to first or last page. # (r1026) * Available symkeys are now documented in a section of man fimrc. # (r1019) # TODO: not yet active # * Support for glob fnmatch wordexp... # (r1021,r1228) * Switch -k --keysym-press to simulate press of keysym at startup. Keysym can be prefixed by a repetition count number. # (r1018,r1761,r1785) * New switch -/ as short form of of -c /. * New switch --// as short form of of -c / with _re_search_opts='f'. # (r1015) # * Will emit a status message when limiting long lists. # (r1014) * Tehe space key (' ') is now assigned to 'scrollforward' (earlier was 's'). # (r1013) * Introduced context prepend/append shebang syntax "#!fim:^=" and "#!fim:+=" in description files. # (r1008,r1795-1796) * Switch --read-from-stdin-elds supports now the ASCII NUL terminator (via ''). # (r1007) # * Switch -V (--version) prints out libspectre version info. # (r1006) * Switch -V (--version) prints to stdout (not anymore to stderr). # (r1003) * The -B switch is now shorthand for --background-recursive. # (r1097) * If compiled in pre-C++11 flags, -B / --background-recursive behaves as -R. # (r1002) * Switch -S is now short form of --image-descriptions-file-separator (not anymore for --sanity-check). # (r1001) * Switch -D is now short form of --load-image-descriptions-file (not anymore for --dump-default-fimrc). # (r999,r1000) * Switch -L/--read-from-file: read an image list from file (similarly to the - switch). # (r971) # * New variable "_cache_control" to control the cache mechanism. * Now caching of mipmaps is on by default; can be turned off with new variable '_cache_control'. # (r965) * Variable "_push_pushes_dirs"; if it is 2, also push hidden files and directories; that is, ones whose names begin with a dot (.). # (r942) * configure --with-font-magnifying-factor=FACTOR controls text magnification by an integer factor. If FACTOR is positive, this value is hardcoded and cannot be changed at runtime. # (r945) If FACTOR is negative, -FACTOR is default, but can be changed at runtime. If FACTOR is 0 (default) a default of 1 applies, and can be changed at runtime. This option is meant to be used on configurations with high resolutions and small consolefonts. # (r1206,r1207) * configure --with-tmpfile specifies a new temporary directory. # (r1145) * configure tries to detect curses/ncurses. # (r1235) * Fix: mouse movement under SDL used to trigger unnecessary screen redraws. # (r1230) * Fix: the last used image is to be evicted from the cache as last, after possibly prefetched images. # (r1124) * Fix: in configure script, the regex_t check was unnecessarily broken. # (r1037, also in branches/0.5) * Fix: ./configure --disable-pcx was not properly disabling PCX format support # (r963) * With C++11 flags, --background-recursive loads images in the background recursively (experimental, unfinished). # (TODO: not completely finished) # (r948) # * configure --enable-c++11 enables background image loading. # (r961) # * Rename configure switch --enable-cxx11 to --enable-c++11 . # (r955) * Use variable "i:_file_load_time" to store the time taken to load the file and decode the image. # (r952) * Use variable "_use_mipmaps=2" to compute the mipmaps faster, using every fourth source pixel. This can be a good solution for speeding up large photographs scaling. # (r947) # * Mipmap computing (controlled by _use_mipmaps) is now faster. # (r941,1804) * Description files beginning with "#!fim:desc" (of whatever extension) can now be loaded as they were normal image files. # (r936) * Add switch --reverse to reverse the file list. # (r933) * Add switch --sort-mtime to sort file list according to modification time. * Add switch --sort-fsize to sort file list according to file size. * Command "list 'sort_mtime'" to sort file list according to modification time. * Command "list 'sort_fsize'" to sort file list according to file size. # (r1063) * Command "list 'mark' {args}" accepts now exactly what "limit {args}" does. # (r1535) * Command syntax 'list "markall"' introduced. # (r1004) * Command syntax 'list "dumpmarked"' and 'list "unmarkall"' introduced. # (r1010) * Command 'list "swap"' introduced. # (r931) * New '_lastgotodirection' variable, with the last file goto direction. * Key 'Enter' now marks and goes forward or back according to variable '_lastgotodirection'. # (r1076) # * Misc fixes of minor things causing compile warnings. # (r1155) * Fix: the largest mipmap was not always being used. # (r1144) * Fix: -lfl linkage is not really necessary: removed it. # (r1143) * Fix: support for PPM files with 2 bytes per sample. # (r1074) * Fix: a few more checks when reading PCX files. # (r1059) * Fix: documented that switch --sanity-check terminates the program, rather than continuing. # (r1038, also in branches/0.5) * Fix: when stdint.h is available use uint8_t, uint16_t, uint32_t instead of non-portable __u8, __u16, __u32 # (r1036, also in branches/0.5) * Fix: compilation was broken without framebuffer (FIM_WITH_NO_FRAMEBUFFER) # (r1025,r1028) * Fix: cleaned up the internal keysyms initialization code. # (r1011) * Fix: removed obsolete documentation for the "window" command, now disabled. # (r1181,r1865) * Bugfix: improve GIF error handling. # (r1075) # * Bugfix: was likely using uninitialized data in Image(). # (r1208) * Bugfix: on certain framebuffer configurations part of the screen was not being redrawn. # (r1204) * Bugfix: conversion from external program was vulnerable to failure due to a missing check. # (r1073) # * Bugfix: a function in AADevice (fim_aa_get_input) was missing return value. # (r1071) * Bugfix: avoiding data corruption when handling %k expando. # (r1009) * Bugfix: repeating "recording 'repeat_last'" (default '.' key) by prepending a number now works. * Fix: configure uses `sdl-config --static-lib`. Version 0.5 # (r746*) * -R / --recursive switch to turn on recursive push of command line specified directories # (r669*) * added --sort and --sort-basename to sort the images list * introduced mipmap mechanism (_use_mipmaps) for faster display/scaling of images # (r644,r651*) (undocumented) r676) * status bar customizable with _display_status_fmt and _info_fmt_str, which can be controlled by the use of special image variable specifiers ('expandos'): "%T" expando to get (and display) total memory used by the program "%C" expando to get (and display) file/memory usage by image cache "%M" expando to get (and display) memory used by the current (displayed) image "%c" expando to get (and display) centering information "%m" expando to get (and display) current image mipmap occupation information "%k" expando to get (and display) current image i:_comment value "%?PRE?VAR?POST?" expando to get (and display) "PRE".i:VAR."POST" ... # (r674*) * search (and jump) on image descriptions via 'goto' and key '/' # (r696) * when repeating search with 'repeat_last', will use last direction * '?' key is now assigned to backward search (goto '-//') * default 'C-p' key is now assigned to repeat last backward search (goto '-//') # (r623) * image cache will remember alignment within viewport # (r667*) * jump back and forth from the last viewed image with the ' (single quote aka apostrophe) key and the _lastfileindex variable # (r672*) * added --load-image-descriptions-file (equivalent to 'desc' 'load') to populate the i:_comment values of each loaded image file and set _caption_over_image=2 # (r682*) (with it added also --image-descriptions-file-separator) # (689*,790*) * added the 'desc "load"' command to load a textual files comments description file # (r851-r879): * introduced a 'limit' command, with comment, file name, or marked file criteria # (r920): * the '`' key is bound to toggle limit'ing to the marked files list # (r902) * introduced 'list "mark"' and 'list "unmark"' subcommands styled as 'limit' * load i:_comment and i:var from description file, with forms: "filename comment" (to i:_comment), "#!fim:var=value" (to set i:var=value on all all the files following) "#!fim:var=" (to unset i:var=value on all all the files following) "filename #!fim:=" (to i:_comment from the value read last) "filename #!fim:+comment" (similar, but will append the new comment) "filename #!fim:^comment" (similar, but will prepend the new comment) "filename #!fim:s/f/t" (similar, but replace string f with string t) # (r654*) # (r675*) * EXIF tags will be read with libexif and become i:EXIF_-prefixed variables # (r769!,805*) * if _want_exif_orientation is set, images will be reoriented according to EXIF metadata (i:__exif_orientation, i:__exif_mirrored, i:__exif_flipped). # (r791*) * the 'help' command will search also in fim command options * will optionally use C++11 constructs with ./configure --enable-cxx11 (no user level impact) * scaling image code faster (thanks to __restrict__ pointers) # (r648*) * customizable SDL window caption line with _want_wm_caption_status # (r664*) * BMP format support is now optional # (r666*) * PCX format support (optional) # (r671*) * changed meaning of variable _ignorecase: now it affects autocommands # (r671*) * introduced variable _re_search_opts affecting regexp-based search * default key 'r' is bound to 'rotate90', key 'R' to 'rotate270' * can be invoked without stdin; e.g. from an X menu * added "display 'resize'" to resize the SDL window, optionally to the image size # (r698) (not mentioned in the docs) * default SDL mode is windowed now # (r698) * by default, the 'C-w' key will resize the SDL window to the original image size # (r698) * by default, the 'W' key will resize the SDL window to the image size, # (r703) and added an --autowindow switch to adapt window size to picture size * the 'help' command will search in help items if argument starts with / # (r724) * special variable i:* expanding to all the variable name/value pairs of the current image # (experimental; r665) * opening image files in archives (e.g. CBZ,CBR,RAR,TAR,TGZ,TBZ,7Z,ISO,...) with libarchive (experimental) # (r660) * JPEG-2000 file support via JasPer (experimental) # (r744*) * added a ':- INTEGER' syntax, so one can specify the file in the list counting from the end # (r745*) * added an _archive_files variable to specify which file name types specify archives # (r746*) * added a 'list "pushdirr"' command, working like "pushdir" but recursively # (r767*) * the _fbfont variable will contain the current console font file string # (r772,r775*) * mirror/flip are now being applied with respect to the viewport borders # (r678) * stat() checking of files on load can be disabled with _push_checks # (r679) * added --no-stat-push to set _push_checks=0 before initialization # (r683) * added the _caption_over_image variable (which is 0 unless --load-image-descriptions-file) # (r776*) * 'Pause' and 'Menu' keys are now available in SDL (-o sdl) mode # (r780*) * added 'list' 'marked' to show the list of marked files # (r782*) * key 'Del' bound to pop (delete) the current image from the list # (r784*) * i:_file loader will store the used loader string # (EXPERIMENTAL,r795*) * switch --offset accepts a range now (using the new _open_offset_retry variable) # (EXPERIMENTAL,r796*) * if an image has been opened with an offset, i:_open_offset will be set accordingly # (r806*) * variable i:pagecount is now replaced by i:pages # (r807*) * put aside (disabled) the v: b: and w: namespaces until they make more sense # * improved the 'align' command # (r104) # * viewport info cache size * panning on mouse movement in SDL mode * `make fim' goal has been deleted # (r848) * changed librsb library detection: now it's e.g.: LIBS="`librsb-config --ldflags --extra_libs` " CXXFLAGS="`librsb-config --cflags` "\ ./configure --enable-matrices-rendering # (r882) * bugfix: in some situations fim -o fb was not clearing the screen before drawing the image # (r849) * bugfix in the "list 'remove'" internals # (r907) * --binary=1/--binary=24 will not pad tiny renderings to _preferred_rendering_width pixels # (r937) (-rc1) * fix: corrected the quiet mode (-q) to be quieter # (r940) (-rc1) * fix: no zlib.h build time dependency (this will be reintroduced in the future) Version 0.4 * changed --random semantics and introduced --random-no-seed switch * customizable status bar file info string * introduced --as-text to render printable bytes as text * key r is bound to 'rotate90', key R to 'rotate270' * bug fixes for the g: namespace, SDL/X mode, "list 'pop'" command, the --offset option, 'ascale' and rotation, documentation. Version 0.4-beta * interface to the GraphicsMagic library (more graphics formats supported) * introduced bitwise AND and OR operators * support for rendering "matrix market" numerical matrix files (with librsb) * X mode not anymore default in aalib, available at option * libjpeg usage fixes * libpng usage fixes (support for PNG_LIBPNG_VER>=10209) * documentation improvements (e.g.: fim man page is auto-generated) * "imlib2" X-based output device support * "sdl" output device improvements (fullscreen/mouse/windowed options, I/O, ..) * more default consolefont options (e.g.: hardcoded consolefonts support) * configure option to disable the fim history file * improvements to scale, goto, other commands * improved directories reading * introduced --no-commandline, --no-internal-config switches * aggregated some commands for clarity * output console can be disabled at configure time * important fbdev bug fixes * autocompletion of variable identifiers Version 0.3 * minor strchr compilation problem on some systems * better consolefonts support * much better SDL support (different color modes) * 'negate' feature * -S, or 'sanity-check' switch [changed meaning in v0.6] Version 0.3-beta-prerelease * auto-generated documentation: more consistency * grammar specification, in man fimrc * internal commands,variables,autocommands reference man page, in man fimrc * better internal help mechanisms * more control (resolution change,windowed mode) in experimental sdl mode * new commands (pread,reverse,shuffle,...) * (temporarily) disabled internal windows splitting * pushing files from a directory * several minor and major bugfixes Version 0.3-beta * full support for AAlib (Ascii Art rendering) (-o aa) * experimental support for SDLlib (Simple Directmedia Layer) (-o sdl) (X!) * experimental PDF, PS, DJVU file support * history file support (~/.fim_history) * seamless caching and prefetching integration * viewing of any type files as bitmaps (unset bits black, set bits white) * viewing of any type files as pixmaps (as RGB triples) * framebuffer driver now can be disabled at compile time * colors inversion: saves a significant fraction of power when viewing documents Version 0.3-alpha * experimental support for AAlib (Ascii Art rendering) (-t) * reading image files (-i) and scripts (-p) from stdin * runs on the powerpc architecure * rewritten from scratch the debug console, now buffered and with scrolling * achieved speedup in magnifying pictures * achieved speedup in displaying dithered images * smarter quoting rules (looser quote checking) when "push"ing files * dumping to file execution logs as executable scripts (-W/--write-scriptout) * implemented regular expressions matching operator (=~) * new default key bindings for split windows control * could be compiled with no readline library (--disable-readline) Version 0.2 * internal windowing (with splitting, resizing, swapping) support * .xcf, .fig, .dia, .svg files now viewable via wrapper calls * introduced interactive command iteration ( in the [n] form ) * fim will try to run under screen and over ssh now * custom framebuffer device, fonts and gamma are supported * enriched compile-time options via the ./configure script * vim-styled variable scoping g:,i:,v:,w: (local variables) * eradicated some bugs * introduced new variables, commands Version 0.2-alpha * first windowing functionalities * bugs and subtle flaws handling * introduced new variables, commands Version 0.1 * regular expressions for filtering the viewed image list * vim-like autocommands * command line autocompletion * command line history * completely customizable key bindings * external/internal scriptability fim-0.6-rc2/FAQ.TXT0000644000175000017500000000066114454347340010562 00000000000000 $Id: FAQ.TXT 165 2008-10-19 07:38:08Z dezperado $ Please consult the full FAQ section in the FIM.TXT file. Information about framebuffer is primarily in the man page, and the manual ( in the doc directory ). Information about the installation process is in the INSTALL file. Information about usage and much, much more is in doc/FIM.TXT Information about bugs and bug reporting is in the BUGS file and in the doc/FIM.TXT file. fim-0.6-rc2/scripts/0000755000175000017500000000000014503655327011320 500000000000000fim-0.6-rc2/scripts/utilities/0000755000175000017500000000000014503655327013333 500000000000000fim-0.6-rc2/scripts/utilities/screenshot.sh0000644000175000017500000000167614454347340015774 00000000000000#!/bin/sh # # $Id: screenshot.sh 213 2009-02-21 01:15:08Z dezperado $ # this script invokes fim to perform a screenshot of itself # # needs: fbgrab, convert, aa-enabled fim FIM=src/fim BFCMD="alias \"toggleVerbosity\" \"_display_console=1-_display_console;i:fresh=1;\"; toggleVerbosity; load; echo \"we type \\\"help\\\":\"; help; echo \"we type \\\"commands\\\":\"; commands; redisplay; split; window 'down'; vsplit; auto_width_scale; auto_width_scale; display; redisplay; window 'right'; auto_height_scale; rotate '34'; redisplay; " EFCMD='!"fbgrab fim-shot-aa.png";quit;' $FIM -o aa -c "$BFCMD$EFCMD" media/*png EFCMD='!"fbgrab fim-shot-fb.png";quit;' $FIM -v -c "$BFCMD$EFCMD" media/*png # let's see #$FIM fim-shot-fb.png fim-shot-aa.png # fim-shot-fb.png SZ='400x300' CA="-depth 3 -resize $SZ" convert fim-shot-aa.png $CA fim-shot-aa-mini.png convert fim-shot-fb.png $CA fim-shot-fb-mini.png $FIM fim-shot-aa-mini.png fim-shot-fb-mini.png fim-0.6-rc2/scripts/utilities/fimscan.sh0000755000175000017500000000372614454347340015240 00000000000000#!/bin/sh # This sample scripts shows the use of fim for assisted batch scanning in a X free environment. function die() { echo " [!] : " $@ ; exit 1 ; } function info() { echo " [*] : " $@ ; } function askn() { local c ; c='' ; info $@ ; read c ; if test "$c" != "y" -a "$c" != "Y" ; then return -1 ; fi ; return 0 ; } function asky() { local c ; c='' ; info $@ ; read c ; if test "$c" != "n" -a "$c" != "N" ; then return 0 ; fi ; return -1 ; } function askexit() { asky "are you sure you want to exit [Y/n]?" || return 0 ; info "ok. exiting now..." ; exit ; } [[ $1 != "" ]] && { info "this is a sample script using fim and scanimage... invoke it without arguments please." ; exit ; } shopt -s expand_aliases || die "no aliases ? you should update your bash shell.." scanimage --version 2>&1 > /dev/null || die "no scanimage ?" GEOMETRY=' -l0mm -t0mm -x210mm -y300mm' LODEPTH='--depth 1' HIDEPTH='--depth 32' HIRES='--resolution 200' LORES='--resolution 20' FORMAT='--format=tiff' FORMAT= alias scan.a4='scanimage $GEOMETRY $HIDEPTH $HIRES $FORMAT' alias scan.lo='scanimage $GEOMETRY $LODEPTH $LORES $FORMAT' alias scan='scan.a4' alias filter_bugged_scanimage_pnm="grep -v 'scanimage.*backend'" DIR="${TMPDIR-/var/tmp}/fbscan-$$" TF=$DIR/scan.fim.tmp # we must have write permissions in that directory mkdir -p $DIR || exit 1 # we want that directory clean after this script execution, no matter what happens trap "rm -rf $DIR" EXIT i=1; FN=`printf "scan-%004d.pnm" "$i"` while ! askn "do you to wish start scanning ? we begin with $FN [y/N]" ; do askexit ; done for ((i=1;i<100;i+=0)) do info "scanning $FN..." scan.lo | filter_bugged_scanimage_pnm | fim -i -c 'bind "y" "return 0;";bind "n" "return -1;";status "press y to scan this image in high resolution. press n otherwise."' && scan.hi > $FN if test "$?" = "0" ; then ((++i)) ; fi FN=`printf "scan-%004d.pnm" "$i"` while ! askn "do you wish to continue scanning ? we continue with $FN [y/N]" ; do askexit ; done done fim-0.6-rc2/scripts/maintenance/0000755000175000017500000000000014503655327013602 500000000000000fim-0.6-rc2/scripts/maintenance/yacc2grammar.awk0000755000175000017500000000042214454347340016575 00000000000000#!/usr/bin/awk -f # # This program prints out the Grammar section of a yacc.output file. # BEGIN { sp=0 } /program:/ { sp=sp+1; } /^Grammar/ { sp=sp+1; } /^Terminals/ { sp=sp+1; } #/.*/ { if(sp==3){ print; } } /.*/ { if(sp==3){ gsub("^[ \t]*[0-9][0-9]*","\t"); print; } } fim-0.6-rc2/scripts/maintenance/configure-live.sh0000755000175000017500000000032414454347340016774 00000000000000#!/bin/sh # Configure fim for a live system (that is, reading no configuration file at all, and writing out no history). ./configure --disable-fimrc --disable-history $@ || exit make || exit make tests || exit fim-0.6-rc2/scripts/maintenance/htmlbody.awk0000755000175000017500000000030014454347340016042 00000000000000#!/usr/bin/awk -f # # This program extracts the body of an HTML file. # BEGIN { sp=0 } /^.\/\/ { sp=sp+1; } /.*/ { if(sp==1){ gsub("−","-"); print; } } /^.\/ { sp=sp+1; } fim-0.6-rc2/scripts/maintenance/configure-brute-check.sh0000755000175000017500000000121514454347340020231 00000000000000#!/bin/sh # this script brute-check for ./configure --enable.. and ./configure --disable.. options C=./configure CH="$C --help=short" FAILED="" OK="" #CXXFLAGS="-O0" CXXFLAGS="-pedantic -Wall" trap ' p "OK : $OK"; p "FAILED : $FAILED"; p "ALL : $ALL"' EXIT err() { echo "[!] $@" ; exit -1; } p() { echo "[*] $@" ; } $CH || err "problems with $C" ALL=$( for W in disable enable ; do for S in `./configure --help=short | grep $W | grep -v "$W-[A-Z]" | sed 's/^\s*//g;s/\s\+.*//g'` ; do echo -n " $S" done done ) for S in $ALL do { $C $S && make clean && make CXXFLAGS=$CXXFLAGS && { OK="$OK $S" ; } } || { FAILED="$FAILED $S" ; } done fim-0.6-rc2/scripts/maintenance/cron-rsync.sh.in0000644000175000017500000000153014454347340016555 00000000000000#!/bin/sh # # $Id: cron-rsync.sh.in 633 2014-11-16 22:13:14Z dezperado $ # # This script is intended to work on machines which I administer which are connected to the # internet and which can take backups of fim, nightly and gently. # # It should be run as a cron sheduled job: # # e.g.: # @daily /usr/bin/rsync -avz dezperado@code.autistici.org:/svn/fim/ /home/dez/backup/fim # # @daily cron-rsync.sh # @daily FIM_BACKUPDIR=/var/backups/fim cron-rsync.sh # @weekly FIM_REPUSER=antani FIM_BACKUPDIR=/var/backups/fim /usr/local/bin/cron-rsync.sh R=${FIM_REPURL:="http://@FIM_SVN_REPOSITORY@"}; U=${FIM_REPUSER:="dezperado"} BP=${FIM_BACKUPDIR:="/backups/fim"} R=`echo $R | sed s/^http:..//g` RSYNC="/usr/bin/rsync -avz" C="$RSYNC $U@$R $BP" echo "ok, let's backup using command $C" echo $C || echo "failed backup : $C" fim-0.6-rc2/scripts/maintenance/cron-svndump.pl.in0000644000175000017500000000161114454347340017114 00000000000000#!/usr/bin/perl # # $Id: cron-svndump.pl.in 221 2009-02-26 21:23:28Z dezperado $ # # A dirty script to backup via 'svnadmin dump' the fim repository. # I know this could be rewritten as a one liner. use POSIX qw(strftime); $R="@FIM_SVN_REPOSITORY@"; ($D,$H,@PA)=split(/:\/\/|\//,$R) or die "failed splitting of $R!\n"; $P="/".join("/",@PA),"\n"; $U="dezperado"; $C="ssh $U\@$H svnadmin dump $P"; print STDERR $C."\n"; $D=`$C` or die "failed while $C ..\n" ; #$D=""; $DF="~/fim-svn-dump"; open(FD,"+>",$DF) or die ; #write(FD,$D); print FD $D; close(FD); # we should need a better check .. if( -z $DF or ! -f $DF ){ die "error while writing $FD! : refusing to continue\n";} $WD=strftime "%a", localtime; print STDERR "wrote successfully to $DF\n"; $NF="$DF-$WD"; print STDERR "will now rename $DF to $NF\n"; rename $DF,$NF or die "error renaming $DF to $NF\n"; print STDERR "ok, backup successful!\n"; fim-0.6-rc2/scripts/maintenance/remote-build.sh.in0000644000175000017500000000140414454347340017050 00000000000000#!/bin/bash # $Id: remote-build.sh.in 221 2009-02-26 21:23:28Z dezperado $ # This script is intended to test interactively a fim build on a remote machine. # It should be run interactively while build and fixing. FD=@PACKAGE@-@VERSION@ DF=$FD.tar.gz UH= RD= alias fail="exit -1" alias if_err='[ $? == 0 ] || ' [ -z "$FD" ] && { fail; } [ -z "$UH" -a -z "$1" ] && { echo -e "usage: $0 user@host [directory]\n $DF will be copied and built there via ssh\n" ; fail ; } [ -z "$UH" -a -n "$1" ] && { UH=$1 ; } [ -z "$RD" -a -n "$2" ] && { RD=$2 ; } MS="fim build FAILURE report" make dist [ -f "$DF" ] || { fail; } if_err fail scp $DF $UH:$RD if_err fail ssh $UH "cd $RD && tar xzf $DF && cd $FD && ./configure && make" if_err fail ssh $UH "rm -fR $RD/$FD" if_err fail fim-0.6-rc2/scripts/maintenance/cron-build.sh.in0000755000175000017500000000510414454347340016522 00000000000000#!/bin/bash # This script is intended to work on machines connected through the # internet to the fim subversion repository and willing to export/build # and report in case of errors. # It should be run as a cron sheduled job. # You should set the FA (From Address), TA (To Address), and SH (Smtp Host) environment variables ... #FA=user@host #TA=user@host #SH=smtp.host.tld FIM_SVN_REPOSITORY=@FIM_SVN_REPOSITORY@ TMPDIR=/tmp/ MS="fim build FAILURE report" alias if_err='[ $? == 0 ] || ' alias mail_stuff="mutt -F /dev/null -a autogen.log -a env.log -a make.log -a config.log -s $SUB $TA -e 'set from=$FA;set sendmail=\"msmtp -f $FA --host=$SH\"' < fim.log" alias check='if_err { svn info $REP >> fim.log ; mail_stuff ; }' alias fail="return -1" einfo() { echo -- "[!]" $@ ; } info() { echo -- "[*]" $@ ; } die() { einfo $@ ; exit -1; } get_fim() { if test $HOSTNAME = chip ; then cp -fR /home/dez/fim/ . else #svn co $FIM_SVN_REPOSITORY svn --force export $FIM_SVN_REPOSITORY fi } autogen_error() { # here should go automatic reporting of the failing configure.ac ... einfo "please see the autogen.log file" } configure_error() { # here should go automatic reporting of the failing configure/config.log ... einfo "please see the config.log file" } make_error() { # here should go automatic reporting of the failing make ... einfo "please see the $MAKELOG file" } date_ymd() { date +%Y%m%d ; } build_fim() { CONFIGURE_OPTIONS="$1" MAKELOG="make.`date_ymd`.log" AUTOGENLOG="autogen.`date_ymd`.log" LOG="fim.log" SUB="[fim automated build] FAILURE on $HOSTNAME" touch $MAKELOG || fail touch $AUTOGENLOG || fail rm -f $LOG || fail touch $LOG || fail ln $MAKELOG make.log ln $AUTOGENLOG autogen.log check sh autogen.sh 2>&1 | tee $AUTOGENLOG check #|| autogen_error "error generating initial fim scripts" ./configure $CONFIGURE_OPTIONS check #|| configure_error "error configuring fim" make clean 2>&1 | tee $MAKELOG check #|| make_error "error in making clean fim" make 2>&1 | tee $MAKELOG check SUB="[fim automated build] success on $HOSTNAME" mail_stuff #|| make_error "error making fim" } [ -z "$FIM_SVN_REPOSITORY" ] && die "no fim repository specified ?" [ -z "$TMPDIR" ] && die "no temporary directory specified ?" true cd $TMPDIR if_err die "error stepping in $TMPDIR" get_fim if_err die "error getting fim sources" cd fim/trunk if_err die "error getting environment" env > env.log if_err die "error stepping in fim directory" build_fim if_err die "error building fim" build_fim --enable-sdl --enable-aalib if_err die "error building fim" fim-0.6-rc2/scripts/maintenance/configure-minimal.sh0000755000175000017500000000056714454347340017474 00000000000000#!/bin/sh set -e set -x # Configure fim with minimal features allowing it to run in the framebuffer ./configure --disable-sdl --disable-fimrc --disable-history --disable-readline \ --disable-xfig --disable-xcftopnm --disable-xfig --disable-convert \ --disable-stdin-image-reading --disable-ps --disable-djvu \ --disable-raw-bits-rendering "$@" make make tests fim-0.6-rc2/scripts/maintenance/yacc2grammar.h0000644000175000017500000000046614454347340016247 00000000000000/* This file translates some lex/yacc symbol labels in a literal form. */ #define SYSTEM '|' #define NOT '!' #define GE '>=' #define LE '<=' #define EQ '==' #define REGEXP_MATCH '=~' #define NE '!=' #define AND '&&' #define OR '||' #define WHILE 'while' #define IF 'if' #define ELSE 'else' #define DO 'do' fim-0.6-rc2/scripts/maintenance/configure-only-fb-mini.sh0000755000175000017500000000020214454347340020330 00000000000000#!/bin/sh # Configure fim with minimal features, with no X ./configure --disable-sdl $@ || exit make || exit make tests || exit fim-0.6-rc2/scripts/maintenance/configure-noscripting.sh0000755000175000017500000000040014454347340020367 00000000000000#!/bin/sh # configure fim with scripting disabled (still incomplete, though) ./configure --disable-readline --disable-system --disable-autocommands --disable-windows --disable-scripting --disable-output-console $@ || exit make || exit make tests || exit fim-0.6-rc2/scripts/Makefile.in0000644000175000017500000004720114503403454013301 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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 = : 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 = depcomp = am__maybe_remake_depfiles = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPECT = @EXPECT@ FIM_CONFIGURATION = @FIM_CONFIGURATION@ FIM_CUSTOM_HARDCODED_CONSOLEFONT = @FIM_CUSTOM_HARDCODED_CONSOLEFONT@ FIM_DEFS = @FIM_DEFS@ FIM_LIBS = @FIM_LIBS@ FIM_LIB_OBJECTS = @FIM_LIB_OBJECTS@ FIM_SVN_REPOSITORY = @FIM_SVN_REPOSITORY@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ HAVE_AWK = @HAVE_AWK@ HAVE_BISON = @HAVE_BISON@ HAVE_CAT = @HAVE_CAT@ HAVE_CPP = @HAVE_CPP@ HAVE_ECHO = @HAVE_ECHO@ HAVE_FLEX = @HAVE_FLEX@ HAVE_GREP = @HAVE_GREP@ HAVE_MAN = @HAVE_MAN@ HAVE_RM = @HAVE_RM@ HAVE_SED = @HAVE_SED@ HAVE_SORT = @HAVE_SORT@ HAVE_TIMEOUT = @HAVE_TIMEOUT@ HAVE_VALGRIND = @HAVE_VALGRIND@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBAA_CONFIG = @LIBAA_CONFIG@ LIBCACA_CONFIG = @LIBCACA_CONFIG@ LIBDJVU = @LIBDJVU@ LIBGIF = @LIBGIF@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBPOPPLER = @LIBPOPPLER@ LIBPS = @LIBPS@ LIBS = @LIBS@ LIBSDL2_CONFIG = @LIBSDL2_CONFIG@ LIBSDL_CONFIG = @LIBSDL_CONFIG@ LIBTIFF = @LIBTIFF@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN = @MAN@ 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@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POPPLER_CFLAGS = @POPPLER_CFLAGS@ POPPLER_LIBS = @POPPLER_LIBS@ RANLIB = @RANLIB@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHELLCHECK = @SHELLCHECK@ SORT = @SORT@ STRIP = @STRIP@ SVN_REVISION = @SVN_REVISION@ SVN_REVISION_NUMBER = @SVN_REVISION_NUMBER@ TIMEOUT_LARGE = @TIMEOUT_LARGE@ TIMEOUT_SMALL = @TIMEOUT_SMALL@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ 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@ ac_ct_CXX = @ac_ct_CXX@ 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@ fim_cv_version = @fim_cv_version@ have_convert = @have_convert@ have_dia = @have_dia@ have_gs = @have_gs@ have_inkscape = @have_inkscape@ have_xcftopnm = @have_xcftopnm@ have_xfig = @have_xfig@ have_zcat = @have_zcat@ 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@ subdir = scripts AUTOMAKE_OPTIONS = nostdinc no-dependencies SUBDIRS = EXTRA_DIST = \ $(srcdir)/tests/sanity.fim \ $(srcdir)/tests/maxlenscript.fim \ $(srcdir)/tests/version.sh \ $(srcdir)/tests/font.sh \ $(srcdir)/tests/spawn_and_quit.exp \ $(srcdir)/example/oneline.fim \ $(srcdir)/example/quit_23.fim \ $(srcdir)/example/set_var.fim \ $(srcdir)/rc/fimrc.eog \ $(srcdir)/rc/fimrc.gqview \ $(srcdir)/rc/fimrc.kuickshow \ $(srcdir)/rc/fimrc.lazy \ $(srcdir)/utilities/screenshot.sh \ $(srcdir)/maintenance/configure-*.sh \ $(srcdir)/maintenance/yacc2grammar.h \ $(srcdir)/maintenance/yacc2grammar.awk \ $(srcdir)/maintenance/htmlbody.awk \ $(srcdir)/utilities/fimscan.sh all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu scripts/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic 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 .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: fim-0.6-rc2/scripts/tests/0000755000175000017500000000000014503655327012462 500000000000000fim-0.6-rc2/scripts/tests/font.sh0000755000175000017500000000261514454347340013711 00000000000000#!/bin/sh # tests font functionality in fim # this script shall work whatever its configure options (even if fim was compiled 'dumb') f=src/fim if test x != "$top_srcdir"; then true ; else top_srcdir=./ ; fi ff="$top_srcdir/media/fim.png media/icon_smile.gif" fa="-b -c quit $ff " fv="-V " fq="$FIMNORCOPTS" fail() { echo "[!] $@"; exit -1; } resign() { echo "[~] $@"; exit 0; } succeed() { echo "[*] $@"; exit 0; } which grep || fail "we don't go anywhere without grep in our pocket" g="`which grep` -i" export FBFONT='' e='s/^.*://g' POD='\(sdl\|fb\|imlib2\)' $f $fv 2>&1 | $g -i 'supported output devices.*:' | $g "$POD"|| resign "missing a pixel oriented driver (as one of $POD)" $f $fv 2>&1 | $g 'supported file formats:' | $g '\(png\|gif\)' | resign "missing adequate file format support" if test x"$SSH_TTY" = x"" ; then export FBFONT=/dev/null if $f $fq $fa -o dumb ; then fail "$f $fa does not fail as it should on wrong font file" ; else echo "$f $fq $fa correctly recognizes an invalid FBFONT variable and exits" ; fi else echo "Skipping FBFONT=/dev/null because seems we're running under ssh" ; fi export FBFONT=$top_srcdir/var/fonts/Lat15-Terminus16.psf if ! $f $fq $fa -o dumb ; then fail "$f $fq $fa fails, but it should not, as a correct font was provided" ; else echo "$f $fq $fa correctly recognizes a valid font file" ; fi succeed "Font environment variables check PASSED" exit 0 fim-0.6-rc2/scripts/tests/maxlenscript.fim0000644000175000017500000017777714454347340015640 00000000000000# adding one byte to this script will prevent fim from executing it (somewhere in fim there is a hidden 65535 byte limit..). return 0; fim-0.6-rc2/scripts/tests/spawn_and_quit.exp0000644000175000017500000000016714454347340016136 00000000000000#!/usr/bin/expect -- set timeout 1 eval spawn -noecho [ lrange $argv 0 end ] send q # interact # would break fbtests fim-0.6-rc2/scripts/tests/sanity.fim0000755000175000017500000001047614454347340014417 00000000000000#!/usr/local/bin/fim -E # $Id: sanity.fim 203 2009-01-10 11:13:17Z dezperado $ # this script is going to be replaced, or regenerated, from the tests contained in src/testdir. #!/usr/local/bin/fim -t -E #!/usr/local/bin/fim --no-framebuffer -E #!/usr/bin/env fim -E # # This script tests the Fim language correctness. # It is used during Fim maintenance, debugging, and developement. # # Fim should execute this script and return 0 if all tests pass. # if ( 1 ) { echo "if construct seems working"; } else { echo "if construct seems not working"; } if ( 0 ) { echo "if construct seems not working"; } else { echo "if construct seems working"; } if ( 0 == 0 ) { echo "equality works"; } else { echo "equality does not work"; return -1; } if ( 0 != 1 ) { echo "disequality works"; } else { echo "disequality does not work"; return -1; } if ( 40 == 50-10 ) { echo "basic integer arithmetics works"; } else { echo "basic integer arithmetics does not work"; return -1; } if ( 41 != 50-10 ) { echo "basic integer arithmetics works"; } else { echo "basic integer arithmetics does not work"; return -1; } iv=1; if ( iv ) { echo "integer variables work"; } else { echo "integer variables don't work"; return -1; } iv=0; if ( !iv ) { echo "integer variables work"; } else { echo "integer variables don't work"; return -1; } if ( !!iv ) { echo "integer variables don't work"; return -1; } else { echo "integer variables work"; } if ( !!!iv ) { echo "integer variables work"; } else { echo "integer variables don't work"; return -1; } if ( iv == 0 ) { echo "integer variables work"; } else { echo "integer variables don't work"; return -1; } if ( iv == 3*iv-2*iv ) { echo "integer variables work"; } else { echo "integer variables don't work"; return -1; } if ( iv != 3*iv-2*iv ) { echo "integer variables don't work"; return -1; } else { echo "integer variables work"; } if ( iv != iv ) { echo "integer variables don't work"; return -1; } else { echo "integer variables work"; } # Like in Vim, the following form is not correct for an arithmetic assignment: # fv=2.0; # The next one is the correct one: fv="2.0"; if ( fv ) { echo "float variables work"; } else { echo "float variables don't work"; return -1; } if ( !fv ) { echo "float variables don't work"; return -1; } else { echo "float variables work"; } if ( !!fv ) { echo "float variables work"; } else { echo "float variables don't work"; return -1; } if ( !!!fv ) { echo "float variables don't work"; return -1; } else { echo "float variables work"; } if ( fv == "0.0" ) { echo "float variables don't work"; return -1; } else { echo "float variables work"; } if ( ! ( fv != "0.0" ) ) { echo "float variables don't work"; return -1; } else { echo "float variables work"; } if ( !!! ( fv != "0.0" ) ) { echo "float variables don't work"; return -1; } else { echo "float variables work"; } if ( !! ( fv == "0.0" ) ) { echo "float variables don't work"; return -1; } else { echo "float variables work"; } if ( fv == "2.0" ) { echo "float variables work"; } else { echo "float variables don't work"; return -1; } if ( fv != "3.0" ) { echo "float variables work"; } else { echo "float variables don't work"; return -1; } echo "tab works"; echo "newline works"; if ( 1==1 ) { echo "multiline" " and multiarg constructs ". "work" } else { return -1; } if( "aba"."a"=="a"."ba"."a" ){echo "string collation works";} else {echo "string collation does not work"; return -1;} if( "aba"!="a"."sba"."a" ){echo "string collation works";} else {echo "string collation does not work"; return -1;} if( "aba"=~"a.*a" ){echo "regular expressions work";} else {echo "regular expressions does not work"; return -1;} if( !("aba"=~"a.*a") ) {echo "single negations on regular expressions does not work"; return -1;} else {echo "single negations on regular expressions work";} # the following doesn't work in fim 0.3. if( !(!("aba"=~"a.*a")) ){echo "double negations on regular expressions work";} else {echo "double negations on regular expressions does not work"; } a=1; {a=5} if( a==5 ){echo "{command} constructs work";} else {echo "{command} constructs don't work";} {a=10;} if( a==10 ){echo "{command;} constructs work";} else {echo "{command;} constructs don't work";} #the following does not work #{a=20;;} if( a==20 ){echo "{command;;} constructs work";} else {echo "{command;;} constructs don't work";} rc=0; return rc; fim-0.6-rc2/scripts/tests/version.sh0000755000175000017500000000117014454347340014423 00000000000000#!/bin/sh # tests the -V switch in fim # TODO : should be integrated in the vim-like test suite. f=src/fim fail() { echo "[!] $@"; exit -1; } succeed() { echo "[*] $@"; exit 0; } which grep || fail "we don't go anywhere without grep in our pocket" g="`which grep` -i" # -V should return 0 $f -V 2>&1 > /dev/null || fail "$f -V returns an incorrect code" e='s/^.*://g' for s in 'supported output devices' 'supported file formats' do $f -V 2>&1 | $g "$s" || fail "need the $s info message!" [ -z "`$f -V 2>&1 | $g \"$s\" | sed \"$e\"`" ] && fail "no $s ?" done succeed "Version string check based test PASSED" exit 0 fim-0.6-rc2/scripts/example/0000755000175000017500000000000014503655327012753 500000000000000fim-0.6-rc2/scripts/example/quit_23.fim0000644000175000017500000000001014454347340014643 00000000000000quit 23 fim-0.6-rc2/scripts/example/oneline.fim0000644000175000017500000000056514454347340015025 00000000000000# jump to the third image: 3; # jump to first image: ^; # jump to last image: $; # magnify the image two times: *2; # scale the image to the 30% of the original: 30%; # scale the image up by 30%: +30%; # scale the image down by 30%: -30%; # jump to the next image whose filename matches the ".*jpg" regular expression: /.*jpg; # executes the "date" system command !"date"; fim-0.6-rc2/scripts/example/set_var.fim0000644000175000017500000000002214454347340015023 00000000000000variable="value"; fim-0.6-rc2/scripts/rc/0000755000175000017500000000000014503655327011724 500000000000000fim-0.6-rc2/scripts/rc/fimrc.eog0000644000175000017500000000055114454347340013437 00000000000000# eog like configuration file for fim # copy this file to ~/.fimrc to have eog keyboard shortcuts in fim # NOTE: it is not complete bind "PageUp" "prev;"; bind "PageDown" "next;"; bind "Home" "0;"; bind "End" "$;"; # rotate by 90 degrees : # bind 'r' ... bind 'C-0' "100%;"; bind 'C-+' "magnify"; bind 'C--' "reduce"; bind '+' "magnify"; bind '-' "reduce"; fim-0.6-rc2/scripts/rc/fimrc.gqview0000644000175000017500000001151414454347340014170 00000000000000# gqview like configuration file for fim, according to http://gqview.sourceforge.net/docs/11_2_keyboard_shortcuts.html # copy this file to ~/.fimrc to have gqview keyboard shortcuts in fim # NOTE: it is not complete # Image Navigation # PageDown Left Click on image view Mouse Wheel down (*) Change to next image. bind "PageUp" "next;"; # PageUp Middle Click on image view Mouse Wheel up (*) Change to previous image. bind "PageDown" "prev;"; # Home Change to first image. bind "Home" "0;"; # End Change to last image. bind "End" "$;"; # Image panning (image has keyboard focus) # Arrow Keys Left Drag on image view [Shift] + Mouse Wheel (*) Pan image. bind "Up" "panup"; bind "Right" "panright"; bind "Down" "pandown"; bind "Left" "panleft"; # [Shift] + Arrow Keys Pan Image faster. # [Control] + Arrow Keys Pan to respective edge of image. # SpaceBar Change to next image. bind "Space" "next"; # Backspace Change to previous image. bind "Backspace" "prev"; # File Menu # [Control] + N New Window # C Open a new empty collection window. # O Display open collection dialog. # F3 Open new search window. # D Open new Find Duplicates window. # [Shift] + P Open print dialog. # [Control] + F Create new folder in current path. # [Control] + C Copy selected images, opens destination selection dialog. # [Control] + M Move selected images, opens destination selection dialog. # [Control] + R Rename selected images, opens rename dialog. # [Control] + D [Delete] Delete selected images. # [Control] + W Close window, GQview exits when last window is closed. # [Control] + Q Quit GQview. bind('C-q',"quit"); # Edit Menu # [Control] + 1 ... 0 Run external edit command on selected images. # [Control] + A Select all images. # [Control] + [Shift] + A Unselect all images. # [Control] + P Open image properties window. # [Control] + O Open GQview preferences window. # ] Rotate image clockwise 90 degrees. # [ Rotate image counterclockwise 90 degree. # [Shift] + R Rotate image 180 degrees. # [Shift] + M Flip image horizontally (mirror). # [Shift] + F Flip image vertically. # View Menu # +, = [Control] + Mouse Wheel up Zoom image in. # - [Control + Mouse Wheel down Zoom image out. # Z Reset zoom to original size (1:1). bind 'z' "auto_scale;"; # X Fit image to window size. # W Zoom image to fit window width. bind 'w' "auto_width_scale"; # H Zoom image to fit window height. bind 'h' "auto_height_scale"; # 1 Set zoom to 1:1 bind '1' "100%;"; # 2 Set zoom to 2:1 bind '2' "200%;"; # 3 Set zoom to 3:1 bind '3' "300%;"; # 4 Set zoom to 4:1 bind '4' "400%;"; # 7 Set zoom to 1:4 bind '7' "25%;"; # 8 Set zoom to 1:3 bind '8' "33%;"; # 9 Set zoom to 1:2 bind '9' "50%;"; # T Toggle display of thumbnails when in list view. # [Control] + L Display file list as detailed list view. # [Control] + I Display file list as icon view. # [Control] + T Toggle folder display between list and tree views. # R Refresh file list. # L Toggle floating of file display. # [Control] + H Toggle hiding of file display. # [Control] + E Toggle EXIF sidebar. # [Control] + S Toggle Sort Manager sidebar. # [Control] + K Toggle Keywords sidebar. # F V Toggle full screen. # I Toggle information overlay in full screen. # S Toggle slideshow. # P Toggle pause of slideshow. # Help Menu # F1 Open User Manual in browser. # Collection Window # Arrow Keys Move selection. # [Shift] + Arrow Keys Select multiple images. # [Control] + Arrow Keys Move focus without changing selection. # [SpaceBar] Select only image with focus. # [Control] + [SpaceBar] Toggle selection of image with focus. # [Home] Move focus to first image. # [End] Move focus to last image. # [Control] + A Select all images. # [Control] + [Shift] + A Unselect all images. # [Delete] Remove selected image from collection, does not delete image from disk. # [Control] + L Add images from main window's file list. # [Control] + T Toggle display of icon filenames. # N Sort collection by name. # D Sort collection by file date. # B Sort collection by file size. # P Sort collection by file path. # I Sort collection by natural numerical order. # [Enter] View image with focus in main window. # V View image with focus in new window. # [Control] + 1 ... 0 Run external edit command on selected images. # S Save collection. # [Control] + S Save collection as, opens destination dialog. # A Append to collection, opens append dialog. # [Control] + C Copy selected images, opens destination selection dialog. # [Control] + M Move selected images, opens destination selection dialog. # [Control] + R Rename selected images, opens rename dialog. # [Control] + D Delete selected images. # [Control] + P Open image properties window. # [Control] + W Close collection window. # Find Duplicates Window (same as Collection Window above, with the following additions) # 1 Select group 1 duplicates. # 2 Select group 2 duplicates. # C Open new collection window and add selected images. fim-0.6-rc2/scripts/rc/fimrc.kuickshow0000644000175000017500000000053714454347340014700 00000000000000# kuickshow like configuration file for fim # copy this file to ~/.fimrc to have kuickshow keyboard shortcuts in fim # NOTE: it is not complete bind "PageUp" "prev;"; bind "PageDown" "next;"; bind 'o' "100%;"; bind 'w' "auto_width_scale"; bind '+' "magnify"; bind '-' "reduce"; # missing : flipping and rotation, gamma, contrast, file editing ... fim-0.6-rc2/scripts/rc/fimrc.lazy0000644000175000017500000000154214454347340013645 00000000000000# this is a sample fim configuration file (fimrc) # # this fimrc provides an example of simple and light lazy bound configuration autocmd_del "" "" ""; autocmd "PostGoto" "" "load;"; autocmd "PostNext" "" "load;"; autocmd "PostPrev" "" "load;"; autocmd "PostLoad" "" "aalib_fix;"; autocmd "PostLoad" ".*/fbps-.*" "{auto_width_scale;;}"; autocmd "PostLoad" "" "if(autowidth){auto_width_scale;}"; autocmd "PostLoad" "" "if(v:auto_scale_v ){auto_scale;}"; autocmd "PostLoad" "" "if(auto_width_v ){auto_scale_width ;}"; autocmd "PostLoad" "" "if(auto_height_v){auto_scale_height;}"; autocmd "PostInteractiveCommand" "" "display;"; autocmd "PreExecutionCycle" "/fbps-" "_display_busy=0;_display_status=0;" ; autocmd "PreExecutionCycle" "" "reload;"; autocmd "PreExecutionCycle" "" "redisplay;"; bind 'n' "next;"; bind 'p' "prev;"; bind 'b' "prev;"; fim-0.6-rc2/scripts/Makefile.am0000644000175000017500000000127414454347340013276 00000000000000subdir = scripts AUTOMAKE_OPTIONS = nostdinc no-dependencies SUBDIRS = EXTRA_DIST= \ $(srcdir)/tests/sanity.fim \ $(srcdir)/tests/maxlenscript.fim \ $(srcdir)/tests/version.sh \ $(srcdir)/tests/font.sh \ $(srcdir)/tests/spawn_and_quit.exp \ $(srcdir)/example/oneline.fim \ $(srcdir)/example/quit_23.fim \ $(srcdir)/example/set_var.fim \ $(srcdir)/rc/fimrc.eog \ $(srcdir)/rc/fimrc.gqview \ $(srcdir)/rc/fimrc.kuickshow \ $(srcdir)/rc/fimrc.lazy \ $(srcdir)/utilities/screenshot.sh \ $(srcdir)/maintenance/configure-*.sh \ $(srcdir)/maintenance/yacc2grammar.h \ $(srcdir)/maintenance/yacc2grammar.awk \ $(srcdir)/maintenance/htmlbody.awk \ $(srcdir)/utilities/fimscan.sh fim-0.6-rc2/media/0000755000175000017500000000000014503655326010707 500000000000000fim-0.6-rc2/media/special/0000755000175000017500000000000014503655326012327 500000000000000fim-0.6-rc2/media/special/0_rgba.tiff0000644000175000017500000000045414454347340014255 00000000000000II*&€8ðƒAáPh,‡B¢0è$F€€ )>?ìR…ëQ€Ãõ¨ÍÌLÍÌL€ÍÌLÂõ7 +‡ fim-0.6-rc2/media/special/0_interlaced.gif0000644000175000017500000000006714454347340015271 00000000000000GIF89aðÿÿÿ!ù,@D~`¡ëš‚Œ>ok;fim-0.6-rc2/media/special/postscript.eps0000644000175000017500000000112214454347340015165 00000000000000%!PS-Adobe-3.0 EPSF-3.0 %%Creator: hand-written %%Title: a postscript demo file for FIM %%CreationDate: 20180907 %%DocumentData: Clean7Bit %%Origin: 0 0 %%BoundingBox: 0 0 512 512 %%LanguageLevel: 1 %%Pages: 1 %%Page: 1 1 % /N {newpath} bind def /M {moveto} bind def%absolute /R {rlineto} bind def%relative /C {closepath} bind def /SRGB {setrgbcolor} bind def /SLW {setlinewidth} bind def /RED { 1.0 0.7 0.7} bind def % 0 0 moveto % x=0 y=0 is bottom left N 0 512 M 256 0 R 0 -256 R -256 0 R C RED SRGB 1 SLW fill N +256 +256 M +246 +30 R +10 -256 R -286 +50 R C 0.4 1.0 0.4 SRGB 1 SLW fill fim-0.6-rc2/media/special/truncated_bad.jpg.bin0000644000175000017500000000000614454347340016312 00000000000000ÿØÿîfim-0.6-rc2/media/special/0.webp0000644000175000017500000000016214454347340013263 00000000000000RIFFjWEBPVP8 ^p*4%¤°Ÿð—f¶ÎéWÀþ ûx/¥ÿhô7¨ÿ¸þ7úsè†þ¹‰J’çÿ¾ þh¸»̘7}Jþ›ß‰å%|:ÿ âÊÏT'Õ@fim-0.6-rc2/media/special/numbers_pcx.tar0000644000175000017500000005000014454347340015276 00000000000000media/numbers_pcx/0000755000175000017500000000000014316301574013362 5ustar usergroupmedia/numbers_pcx/1.pcx0000644000175000017500000000161114316301574014235 0ustar usergroup ÿÿÿ8x< ÿÿÿmedia/numbers_pcx/3.pcx0000644000175000017500000000161314316301574014241 0ustar usergroup ÿÿÿ|ÁÆ<ÁÆ| ÿÿÿmedia/numbers_pcx/5.pcx0000644000175000017500000000161614316301574014246 0ustar usergroup ÿÿÿÁþÁÀÁÀÁüÁü ÿÿÿmedia/numbers_pcx/2.pcx0000644000175000017500000000161314316301574014240 0ustar usergroup ÿÿÿ|ÁÆ 0`Áþ ÿÿÿmedia/numbers_pcx/6.pcx0000644000175000017500000000161614316301574014247 0ustar usergroup ÿÿÿ|ÁÆÁÀÁüÁÆÁÆ| ÿÿÿmedia/numbers_pcx/9.pcx0000644000175000017500000000161414316301574014250 0ustar usergroup ÿÿÿ|ÁÆÁÆ~ÁÆ| ÿÿÿmedia/numbers_pcx/7.pcx0000644000175000017500000000161214316301574014244 0ustar usergroup ÿÿÿÁþ 0`` ÿÿÿmedia/numbers_pcx/4.pcx0000644000175000017500000000161214316301574014241 0ustar usergroup ÿÿÿ6fÁþ ÿÿÿmedia/numbers_pcx/8.pcx0000644000175000017500000000161514316301574014250 0ustar usergroup ÿÿÿ|ÁÆÁÆ|ÁÆÁÆ| ÿÿÿmedia/numbers_pcx/0.pcx0000644000175000017500000000161614316301574014241 0ustar usergroup ÿÿÿ|ÁÆÁÆÁÆÁÆÁÆ| ÿÿÿfim-0.6-rc2/media/special/loadable.desc0000644000175000017500000000013114454347340014644 00000000000000#!fim:desc #!fim:prime=yes 1.pcx uno 2.pcx due 3.pcx tre #!fim:prime=no 4.pcx 44 0.pcx 0 fim-0.6-rc2/media/special/truncated_bad.png.bin0000644000175000017500000000001714454347340016320 00000000000000‰PNG  IHDfim-0.6-rc2/media/special/0_16bps_msb.tiff0000644000175000017500000000047614454347340015142 00000000000000MM*8€÷ü À hLÃÀØT!Š@âÑ8Ä1‡Fá±(.?þQë…€¨õÃLÌÍLÌÍ€LÌÍõ 7 ‡+ fim-0.6-rc2/media/special/images.desc0000644000175000017500000000011614454347340014351 00000000000000#!fim:prime=yes 1.pcx uno 2.pcx due 3.pcx tre #!fim:prime=no 4.pcx 44 0.pcx 0 fim-0.6-rc2/media/special/modifiers.desc0000644000175000017500000000057014454347340015071 00000000000000# TODO: missing test for /= #!fim:/= # TODO: missing test for \= #!fim:\= #!fim:common=s 0.pcx comment@common 1.pcx #!fim:^pre_ 2.pcx comment 3.pcx #!fim:+_post 4.pcx komment 5.pcx #!fim:s/t/tar #!fim:+=_POST 6.pcx comment #!fim:^=PRE_ 7.pcx #!fim:=comment #!fim:^= #!fim:!= 8.pcx comment #!fim:+= #!fim:common= 9.pcx comment@@@common@5_@#@ignore #!fim:,= # intentionally bad fim-0.6-rc2/media/special/matrix.mtx0000644000175000017500000000020614454347340014302 00000000000000%%MatrixMarket matrix coordinate real symmetric % A Matrix of order 2, with 2 rows, 2 columns, and 2 nonzeroes. % 2 2 2 1 1 11 2 2 22 fim-0.6-rc2/media/special/ciao.fig0000755000175000017500000000016314454347340013653 00000000000000#FIG 3.2 Landscape Center Inches A4 100.00 Single -2 1200 2 4 0 0 50 -1 0 27 0.0000 4 270 915 2850 2175 ciao!!\001 fim-0.6-rc2/media/special/0_8bit.pcx.bin0000644000175000017500000000044214454347340014616 00000000000000 ÁÿÅÂÿÁÿÅÂÿÁÿÅÂÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÂÃÿÂÁÿÁÿÅÂÿÁÿÅÂÿÁÿÅÂÿÈÿÈÿÈÿfim-0.6-rc2/media/special/numbers_pcx.tar.xz0000644000175000017500000000063014454347340015742 00000000000000ý7zXZæÖ´F!t/å£àOÿW]6™HµÕ8Ÿ§¥§PŸM&)nïB§ ·¤D¿~Œç_ÖWº@0ŽM÷ý¥G›Ðñ0D|ö‡ó]Á©ê‡5Ž.~K¢€xê´<HŠ¿DKÅAº âúÞlt¨ÞØ0©IܪZpø/`«Il17ðÀaFÊ¥Éĉ’dºjÓîÓù~™ÈãÄß/êÄM?·%‹r jŒ0·v1]m|ð5º·ÿBãn´Éü|ý у¯ Ø]º†xä¼w:SXï•„­YUtl'DZ“OdŽÛùÝžaÅi»”¿É{X›Q½ÿõÛh¤±ƒÒ@Hê]¥B,½b¹œ‹Û sÿ)‚–úЋÌgËyRv“YõÉæàéùÆ9|µN”"—«@ nê»xI¼RkR§¬ž>•vpÆôw¤*…ž]¥hitIÔ¯ãáÿ?jÈý·kj+†2죟6ëj¦0äó€ 6©±ÄgûYZfim-0.6-rc2/media/special/0_gray.tiff0000644000175000017500000000033014454347340014275 00000000000000II**€à ƒA `\* „C!1„6ƒÁc@ !)=fim-0.6-rc2/media/special/icon_smile_gif_at_7.bin0000644000175000017500000000026514454347340016623 00000000000000offset GIF89a³ÿêEEEÿÎÿÉÿ´þÿþ“ÿýÿÿÿÿÿÇ333ÿÿëÿå!ù,[ÐIjØU¦ÎpœƒLA''ð¦«v˜qj Ÿ?‚*pÆ‚…Ê!Ç’Ó¢ X<+Ùk»®YAb<všÁ Á5ÓXj‚\þ øÂ0òÔ&;fim-0.6-rc2/media/special/images.list0000644000175000017500000000002214454347340014402 000000000000001.pcx 0.pcx ?.pcx fim-0.6-rc2/media/special/numbers_pcx.tar.bz20000644000175000017500000000065314454347340016003 00000000000000BZh91AY&SYƒ.g>ÿ„ï•A@ÿä!ÿ¯ÞGa ÀÜÖw-nT)êa¤ÍLz‰4Ó4 ¡¦54H˜” ¨6¦€4P¡‰PÚh6„Q²‚¤ª2ˆ4È24ÓÔ¤k#QäZ‹ˆöFþbÒ(xRbH7QBBÄR/¢‘ýò[“{ª§L%Œ‰fÇ5„ ¥ÂZÉlmÊ ÖÂl*¤‡DŠH7‘H¤r£¥QqÉçrì_ÇhKP¯q#B3á’9TÏmLÊH‰‚=0QDøqN¦Õ,‰4 >"žñšÄÙ:!H)J‘¯–‡%&(@IÔŒTƒ M%&):•°’%5&¤ök56”º´ "EDƒ aJв¤Ô¾ Jš‚uÒE/R‚’BUBòRõ,â’µOµ.SÕÕ"¥U>T……>”™ì¥=tuò¦’Ì~˜)B“)p—©‚µ,SõH©2“ s)Jœ*N§Ÿ‚vBž)ˆi-ž‰ýsËÚ%;‹öÞX…éTšDZT‹¹"œ(HAÈ3€fim-0.6-rc2/media/special/0_truncated_bad.gif.bin0000644000175000017500000000002314454347340016515 00000000000000GIF87a€ÿÿÿfim-0.6-rc2/media/special/0_monochrome_white_polarity.tiff0000644000175000017500000000026414454347340020632 00000000000000II*€ Ç08 ÿ   )fim-0.6-rc2/media/special/collated.list0000644000175000017500000000002214454347340014724 000000000000001.pcx!0.pcx!?.pcx fim-0.6-rc2/media/special/0_gray.png0000644000175000017500000000041014454347340014130 00000000000000‰PNG  IHDRìtƒ&gAMA± üa cHRMz&€„ú€èu0ê`:˜pœºQ<bKGDª#2tIMEæ ' æ¼IDAT×c¨a8‡5 +–×:Û·$%tEXtdate:create2022-11-20T23:49:26+00:00uèFÇ%tEXtdate:modify2022-11-20T23:49:26+00:00µþ{IEND®B`‚fim-0.6-rc2/media/special/numbers_pcx.tar.gz0000644000175000017500000000064614454347340015730 00000000000000‹Z–cíÚßJÃ0Çñî 2¼î•ô \Ò&鄽‹›:Å‹êèìbølæfO56Sÿ€x˜0VÎ øûš›m-¾ íêéÝãdð´¨o¦Íüzv»$SAem;êʪŸã·D›R»Ri[™Dé²tE’Ûîo…ZÌ_&Mž‡qÚüõ¹‡æy1ã¸!^5™}Î^£`g̾ù×Në_óoŠÒ&¹êô.öøçóvÒëµãi8¾ìv»~ |½wÄõ³á2˲QÒ?øÂp,ÚÿR ÿ%é¿Ñè?éþ¯ü:¥~½Â ÀŽöß ôßÑþ;ôŸƒtÿýÖ¿…c“¦~ƒ%€íÇþ_¡ÿ¤ûßîÿûjì·ˆ?;ÚÇþ¿Bÿ9DÐÿvûÎxÀöÿJ ÿ†ôßbÿÏ"†þ¯_ñ@í%Ðÿ‚îÿ úÏAºÿ~›ö35£þühÿMýÇÿXH÷ÿüÂ݇5 EÿøÑþúoñüGˆtÿ?žÿ¬ðø@í¿Šãý/öÿ,¢èÿç Cï³]ùPfim-0.6-rc2/media/special/dir.desc0000644000175000017500000000015414454347340013664 00000000000000#!fim:desc #!fim:/=media/numbers_pcx/ 1.pcx uno #!fim:\=/mnt 2.pcx due #!fim:/=media/numbers_pcx/ 3.pcx tre fim-0.6-rc2/media/icon_smile.gif0000644000175000017500000000025614454347340013441 00000000000000GIF89aóÿêEEEÿÎÿÉÿ´þÿþ“ÿýÿÿÿÿÿÇ333ÿÿëÿå!ù,[ÐIjØU¦ÎpœƒLA''ð¦«v˜qj Ÿ?‚*pÆ‚…Ê!Ç’Ó¢ X<+Ùk»®YAb<všÁ Á5ÓXj‚\þ øÂ0òÔ&;fim-0.6-rc2/media/image.jpg0000644000175000017500000000413014454347340012410 00000000000000ÿØÿàJFIFddÿìDuckyÿîAdobedÀÿÛ„$$-##-*#""#*8000008B;;;;;;BBBBBBBBBBBBBBBBBBBBBBBBBBBBB##1##1@1''1@B@<0<@BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBÿÀð@"ÿÄi!1QAa"!1AQÿÚ ?ø»nQš_h晨9¦jNiš€šf 晨9¦jNiš€šf 晨9¦jNiš€šf 晨9¦jNiš€šf 晨9¦jNje¹U3ØÚ} ÏhLöö„ßh3Ú=}¡7ÚLö„Ï`_hMö€=¡3ØÚ} ÏhLöö„ßhÀxÔñE°”¢ƒD”d5ÆQÆf51? 2ãüG øUb™í¯ øM&JŒ¯´4×NVþ-ò«øÏäcƒ² ±—ž-0Œ"œN-8ÓŠUŒða§Œ*Fx8µ“>‘aHω…ÑTW&¹[ŒN³ú”¢¸Nà¶ K¬0¼‚+„Xº,Qlˆ”È`ƒ ER¦&’*-"p™YiTÉäN¾À³ÃK­´ùÑYá ~V§âQ†èùBuBŒx­5_m1袘FñN ¬x“Vœr™¦R¬S o¯õÑà š”Ž;]wY·ñMÿç¶ÿåªÏ.dÍrß_ù¶ó*Úôm!Öë+0‰2×n¼+Œ%X¥žL-IŠàÇ…© E5×7ÃK®#N¾¾37ÝFÌÕ̘Êà 0qZ‘ž 4⌊ñF,ÉH ¶Ä©Á"üVšf•buׯQum…lbµ`“Êür™¥ÊÔ¯]Êxa¾ÚùG ÍXÂꎟ—ê/QV9®´š·ù§‰MÇ5ëµ:õaÓÅ? ·˜µ#›ä|ÿ×Tèý^tÏâ88\¯ÆÏ㳇á&é¾uǯ]Ù§ÅÕ‰N)Hå8OÍÓÆ'„J±ËÁ<·®_géº#UÉz5¿Âôk޾à´˜á¿óOåW^‹6óéßÀù¯Zœã“hÇxìߪÏ.mâæ³¸ÎFÚi˜ËXí×\L.êcžõá6ö-§]¾Y­¹~H½UÝó>gDǃºõÃçŽ\sFšêèùDüÓ¢0⎎‘ŽKÍ<¶‘3_%#[¦¹8IüuMuÏ•®º±ON;"8çÓ¶õË3…>IW×ço£ãúêáøŸéÒÇ?Òkù­4N—œetˆà߉4J±ÏÁ3©Ó4O•ÍzT½.Î(à´®O8×WÌá‚•ËÆ§tq8ÂjŸœ­þkM šæù&õÉ<ºR¦k’õÃâé½háaUÏz«=úfÞä®ì+uZ;ÿžOSºÙíÝb·Y}µÑZëʺ5Ö_ ü§óÂÚécWš§uibÕÆ6"6Ú2žÌU¤EÕ¶³ø¿R¹.¦7­©ã“ÊÜ*ÒyZ:î¾VÓ«•ÿ3Mb.øñý%¾”Û_ã+¥­}˜JÖcGËjß f´Çãþ«z¶ŽŒ-!G,ëÞÿÏùî=ùo®«à©ºãºÝ|U¤tm¬¾Ùüçêæ£>ÜaÅnYq86ÄZkã;\ÜœEl°ã„´ºœQY˜_‰Äâ›i *0º3ºáÕb—\£Xæã“äß‚f å½u]|Uº)\ØEÖWEÑ[¡G&Ó ¬òíÛ«.môºÜVóFÝZgÍiÅNºÞVµÏYñEÓ.ŒV¸î–"g.««;ª7šì¾UÃ[ª0ÃX¦ 4š'ŽTšœWÀ‚¸LJpÉ•¸§ˆž˜_ Ú‹ˆ¨Ê-DˆÜZUåREäqo œj£Y¬E¶ëÇ™éL/®Øi6V77q³ÙŽÅSŠÔgÅk„`Ø®Ýr¥Ð\Ö|N-f«M2¬8§ƒk¦ëVêÝR«ŸŠ.­®ªØ+Ÿn¹'ˆuß î¬ö˜\ú†åŲ¾®¤žÚiÙbk^*Þ´Ë•¢i•ÓuÉà j–¹kyªaZ›PËyˆÁI‘lŒé‚á[P´ˆÚ©bõJéžáiâœ"ÔH¶"p1ª‹a$ÂÒ*#&VÂ8ªxU)À çõy®U±Yé¬ÖwçøÒj¶›ÿ‹M£W÷4º³ÛVÊØ&k'–!–ÙÝTº¶Ê”\cb.¹ib¨Ó“·¦Ï3ʺWe™so¥ÖçøßÎþÓZÒVµÖ®¦cÑÙkb–9iŒê.µ[«.¸ªÐš¯5 T[TN¡ƒdE0alT§¢¸L‹a8BøFBØ0*•[W±[¬W)›#f4›­ÉŽåk;ó‹ÚŠ€©QS´S6\-!b¸iƒˆ2Â.­x˜R¹6ëÇ£_n»¦T½MQÿÙfim-0.6-rc2/media/numbers/0000755000175000017500000000000014503655326012362 500000000000000fim-0.6-rc2/media/numbers/8.gif0000644000175000017500000000006014454347340013133 00000000000000GIF87a€ÿÿÿ,D~`¡ëš‚Œ¾‡bÛ ;fim-0.6-rc2/media/numbers/4.gif0000644000175000017500000000006014454347340013127 00000000000000GIF87a€ÿÿÿ,„y˜qª˜­­én¼¦;fim-0.6-rc2/media/numbers/7.gif0000644000175000017500000000005614454347340013137 00000000000000GIF87a€ÿÿÿ, Œ k«í K‘V‡];fim-0.6-rc2/media/numbers/2.gif0000644000175000017500000000005714454347340013133 00000000000000GIF87a€ÿÿÿ,D~`¡Û^T“2‰ÐÛ;fim-0.6-rc2/media/numbers/5.gif0000644000175000017500000000005714454347340013136 00000000000000GIF87a€ÿÿÿ,Œ`À½ÍЃ*Ñ%-m;fim-0.6-rc2/media/numbers/1.gif0000644000175000017500000000005614454347340013131 00000000000000GIF87a€ÿÿÿ, „¦˜ËêàiIF¥);fim-0.6-rc2/media/numbers/3.gif0000644000175000017500000000006014454347340013126 00000000000000GIF87a€ÿÿÿ,D~`¡ÛbO²èªµ;fim-0.6-rc2/media/numbers/0.gif0000644000175000017500000000005714454347340013131 00000000000000GIF87a€ÿÿÿ,D~`¡ëšdÒU‰jÛ;fim-0.6-rc2/media/numbers/9.gif0000644000175000017500000000006014454347340013134 00000000000000GIF87a€ÿÿÿ,D~`¡ëšb ²ø&­µ;fim-0.6-rc2/media/numbers/6.gif0000644000175000017500000000005714454347340013137 00000000000000GIF87a€ÿÿÿ,D~`¡ë­ŠŒ¾'+„;fim-0.6-rc2/media/numbers_pcx/0000755000175000017500000000000014503655326013234 500000000000000fim-0.6-rc2/media/numbers_pcx/1.pcx0000644000175000017500000000161114454347340014026 00000000000000 ÿÿÿ8x< ÿÿÿfim-0.6-rc2/media/numbers_pcx/3.pcx0000644000175000017500000000161314454347340014032 00000000000000 ÿÿÿ|ÁÆ<ÁÆ| ÿÿÿfim-0.6-rc2/media/numbers_pcx/5.pcx0000644000175000017500000000161614454347340014037 00000000000000 ÿÿÿÁþÁÀÁÀÁüÁü ÿÿÿfim-0.6-rc2/media/numbers_pcx/2.pcx0000644000175000017500000000161314454347340014031 00000000000000 ÿÿÿ|ÁÆ 0`Áþ ÿÿÿfim-0.6-rc2/media/numbers_pcx/6.pcx0000644000175000017500000000161614454347340014040 00000000000000 ÿÿÿ|ÁÆÁÀÁüÁÆÁÆ| ÿÿÿfim-0.6-rc2/media/numbers_pcx/9.pcx0000644000175000017500000000161414454347340014041 00000000000000 ÿÿÿ|ÁÆÁÆ~ÁÆ| ÿÿÿfim-0.6-rc2/media/numbers_pcx/7.pcx0000644000175000017500000000161214454347340014035 00000000000000 ÿÿÿÁþ 0`` ÿÿÿfim-0.6-rc2/media/numbers_pcx/4.pcx0000644000175000017500000000161214454347340014032 00000000000000 ÿÿÿ6fÁþ ÿÿÿfim-0.6-rc2/media/numbers_pcx/8.pcx0000644000175000017500000000161514454347340014041 00000000000000 ÿÿÿ|ÁÆÁÆ|ÁÆÁÆ| ÿÿÿfim-0.6-rc2/media/numbers_pcx/0.pcx0000644000175000017500000000161614454347340014032 00000000000000 ÿÿÿ|ÁÆÁÆÁÆÁÆÁÆ| ÿÿÿfim-0.6-rc2/media/image.png0000644000175000017500000000512614454347340012422 00000000000000‰PNG  IHDR¤d]›õbKGD?oÔ©Lø pHYs.#.#x¥?vtIMEÖ  *0Û™jâtEXtCommentCreated with The GIMPïd%n ºIDATxÚíVUÇ?ï ®€+Y (#¥A¦¨8ä( bhÍXf…h“SfÖ8eiY™NÖXæXÑ„…•µ ’¦TXˆæ´Ãê‚âÝ B–»î¾§?žg‡eÛeï{ïyß{îÞç3ó Ü÷ì¹÷|ïs~=çy Î9z0˜|8 Šá“×€`Pžg 9VÖGš‚¡]-å/òh!?eb Žà§ÀÙyäkÿ`E¹¨Í› ßem,€/åM/Y»ÍeÀ¨< ²ÓÚ÷p‚26"G*eQ+Í+Dß¶µIMiÞa6í›u>ÿÙ¤&=AîîFN2®ñPž£¼CQ¯øü7`„¯­Ãd‹¯Yg±ÿÑÙóý<§ÝÓnϳóm@]cÖÐh-ãå3AFáß€ß ‡’š‡„j’õ†2×?O‚Ü|F…X²Ç›vC&ärà“„±Àlä\÷"ûÍíö茴gÙ»€Ï™P¹\gφ„ ×Ùã2B¤a˜ Àö² #=AޱÇ<¹Zní_´#Tã¨ËÍÀÌe®ïä+¿šwOrž; %®›Ü›€Ÿ§ÜÛÍ®JXÆ©ÀÑEàõˆ]^c€‚ŒêàÚŠx´‡F3~½ßÌNéŠÀ H€­$ÔŠD;Ú¼`ƒ®ŽxݦžË ð:r^ÜÇÌöÚ”¬ä9H¼%/3ô"ðl„ Cõ hGa׿öÛ–{pF ÷ðeO/‚ö‰–Òì׎ŸÖí8í­;þ΋‘5½jZÉiÀtOeí‹ÈÙàC7/ŽN5èÔÙÝ¡^¨¦€‰Î’}YïYTwmòjümkÖû‹Ú˜}5j øa{‰?‚ä ìkv}“ŽCå~àOe Fv@ª±÷=˜ë©¬àVé¸Ã9WpÎ-rÎuº”ôߊzMÈŸ‘ι=ê¿Ï9÷ՌԲsn«óÃ>çÜ;+\ß‚sn‰§úv:ç®ì*»{6Ø"²Z>G^…ÄaÌJ–†AÀTàLµè$[¹¨ß¯cõaÊúBºR‡äü’°œ®ìÆ®aK¡—îFzL~,v'a7p¿©Bõü!p¥‡ñÿ7€ovC›sEX<©K7ë–s$rB´Œæ{X]˜¯‚t=— Œ°xq˜Hnâƒè“p]®ºø(}dºµ.;\F ùsf&(ã1ìôT§ á¨'ã\1Ù,d¸ìBâhÞ Œ3eøÉ(;øI1nëOŒ&Èði®H(ÊéÈÆÀ;b~ÿpdh âî÷åšI„XòÖegƒ!*ªé -î"àNÄKª¿†?BEtÎþã.¶—ÔzK# RM™ád$çЄåìþüYK|¹›8‡#³NW1Öy¨w½ Ò™ µpó3Tç7€wÍ£ÌÆÃß#[ÑçV–#Fdöhþž¡ú..÷ &ÈlQŠ:9€Vä8¬ r€óhF깞'=MÙ£‘0Sœôä©8_2Af=d#’ñ &È|ÐN62`¼d‚Ì[2PÇNd~h ¼~Î,¤%d~xý Àhd~x[êx” 2IîñS jMù`(ÙHTpŒ 2¼5îø¬ÊL2Aæƒ)i·SMù`vFê9ž¡¦MÙbp^Fêzxœºš ³Å$‰RV˜_®ÆìLMv¨žNñXf 9÷ÒÙͪñίI’ô˜ rà±XèA,[€ÈéÄs¨EË«ŸÓ gÐò£þX£¢,™ ' žâI–{š‘ೋ‘£°Q˜„d »(á‹p5ðäÀ`4ðp‚®Ú!†/'~&Š ‘˜“#c~¿ø Zf›Ôd˜±ÀC Åxp1ÉÒ¢,EâòÄ ZUƒ øl–Ö,dØÝôJbnÁ)÷!Q#:<Õi°\w’s;’J¤Í™&©e— ŒÍHH”ÍëU¾¯–.. ô½œJ´.;&·yî>£²F-¥¶› Óe¿§1_=ðxJ÷Pnð4ãn0A¦Ï²„ßo®òØmÆa’!6ñ°ÃÆÓ§V­ÛÄßmÞ <À}Ô k‰qË›“ÌB¦ÏNmÄr·ú€³#Úe_x•Û}oæ;Ma°9¿²Œþ}·×ëõë»vàÄabU„{é@|>gÏ€íe‡È‰ˆwöT$ÊY'üó`µ6ôî ÜGIS7Yk­C\êö!éìžEòz©þôÌTÝv ¦IEND®B`‚fim-0.6-rc2/media/fim.png0000644000175000017500000002017314454347340012112 00000000000000‰PNG  IHDR¤¼/C\ pHYs  šœtIME×08ˆitEXtCommentCreated with The GIMPïd%nñIDATxÚíÝùw”åÝøñ›,„°ƒ,3“ BÀDÁ•¢V\Pk­ÖBQ{Nÿ¯ ¥Å£ܱ) H€@B¶ÙIÙ¾?øœo7­rݳäõúíyÚrÝsçÊ{®³0jpp0(tEn vb vb vb vbˆ€Øˆ€Øˆ€ØˆÀ”ÆÃ5j”Ÿå”¿_=›•;¿©×É;±;±;±;±Ä@ìÄ@ìÄ@ìÄ@ìÄ;±;±;±;±;@ìÄ@ìÄ@ìâRâ Ùàà ›Nvb vb vbˆ€Øˆ€Øˆ€Øˆ€Øˆ vb vb vb vb v€Øˆ€Øˆ€Øˆ€Øˆ€Øb vb vb vb vbˆ€Øˆ€Øˆ€Øˆ€Øˆ vb vb vb vb v€Øˆ€Øˆ€Øˆ€Øˆ€Øb vb vb vb v€Ø¹€Øˆ€Øˆ€Øˆ€Øˆ0²•¸C6jÔ(7!ÁÁA7';±;@ìÄ@ìÄ@ìÄ@ìÄ@ì±;±;±;±;±Ä@ìÄ@ìÄ@ìÄ@ìÄ;±ÈO%nÁ º àd vb vb v€Øˆ€Øˆ€Øˆ€Øˆ€Øb vb vb vb vbˆ€Øˆ€Øˆ€Øˆ€Øˆ vb vb vb vb v€Øˆ€Øˆ€Øˆ€Øˆ€Øb vb vb vb vbˆ€Øˆ€Øˆ€Øˆ€Øˆ vb vb vb vbˆ[ˆ€Øˆ€Øˆ€Øˆ€Øb vb vb vb vbˆ€Øˆ€Øˆ€Øˆ€Øˆ vb vb vb vb v€Øˆ€Øˆ€Øˆ€Øˆ€Øb vb vb vb vbˆ€Øˆ€Øˆ€ØˆÀµ588è.Nvb vb vb vbˆ€Øˆ€Øˆ€Øˆ€Øˆ vb vb vb vb v€Øˆ€Øˆ€Øˆ€Øˆ€Øb vb vb vb vbˆ€Øˆ€Øˆ€Øˆ€Øˆ vb vb vb vb v€Øˆ€Øˆ€Øˆ€Øˆ€Øb vb vb vb v€Øˆ€Øˆ€Øˆ€Øˆ€Øb v9hT^Y¸p¡}–×þøÇ?æ×–ó#ûán æcìòë‚÷ïß?þ|»-uuu%‰‹/æÑ5çã/µ“]xùå—Ý„<µeË–ü*NvÙ4sæÌööö’’.ï,Y²äã?ίkv²s²Ëš“'O¾óÎ;îCÞinnþä“OܱÃ$[àÖ®]ë”dŒ5Æþ<£Gîìì¼á†ì¹<kkk[ZZòñÊýøœì²æêÕ«6lpòÈG}”¥CìL²ü<úÓŸÜc¬1vˆ¾úê«[n¹Å¶Ë}.\H&“]]]y:€û :Ù9,pM6oÞœ§¥ÃÉ.'̘1£££Ãîrß½÷Þ»sçÎ<½x';'»ìûöÛo·mÛæ>ä¸#GŽäoé;“,~FÆXclŒJKK;::¦OŸnóå¦þþþêêêÎÎÎü}ÆX'»œÐÛÛë w¹lûöíy]:Ä.‡xÃclá±ßÛ»wïí·ßnÿåš³gÏ&“Éžžž¼~ÆX';‡;~ÂÆó½t8Ùå–iÓ¦uvv–––Ú‚9eáÂ…_~ùe¾? ';'»rúôé·ÞzË}È)(€Ò!v&Y~‚—&Œ±ÆØ JJJÚÛÛgΜi悾¾¾ŠŠŠo¿ý¶‹1ÖÉ.ç~»Ö¯_ï>äˆmÛ¶Fé»\´víZ7Á ‹1¶ÀÇØïíÙ³çÎ;ï´³ëÔ©S½½½…ñpŒ±Nvü°õë×Lép²ËQS§NM§Ó£G¶³è–[nÙ¿Á<';'»\tæÌ™7ß|Ó}È¢/¿ü²J‡Ø™dqÿ±ÆØ¬*..nooO$¶cüzzzR©Ô™3g éAcìrTÿ+¯¼â>dÅ›o¾Y`¥CìršŽ™a1Æþû½Ý»w/Z´ÈŽŒSggguuu=.c¬“Ãÿfݺu…W:œì®KYYYèïtœ2eJ:.++³)cÓÐÐÐØØ˜ï;ÇÉÎÉn8=õÔS¡—8{öì믿îVÇæóÏ?]º(Šž~úi·ZìòÉK/½d’-0ñ¼4ÏÎÁ;lúúúªªªÒétÐUŠ‹‹[[[S©”}Zwww"‘¸páBÐUR©TkkkII‰1ÖÉ.o¯Zµ*ô*ýýýëÖ­s·cðÚk¯….]E«V­*..v·ìòéd788ØØØØÐÐz¡úúúC‡Ù—¡=òÈ#|ðAèU:T__Ÿ•íêGìdw]ºûî»C¯ÒØØ¸k×.w;¨'N|øá‡¡W¹çž{êëëÝm±ËKñüe³÷ô‡¶víÚÎ>^š0ÆæëEÑùóç“Édwwwе&Mš”ÉdÆŒcwúQÖÕÕ?~<è*åååétzÒ¤IYÜ®8Ù]W†žyæ™Ð«œ?~ëÖ­îv Ÿ~úièÒEQôì³Ï~_:Ä._ýá0Éæµxîm<ûclÀ¹````Ö¬YmmmaŸ‚ŠŠNœ8QYYiƒ¯K—.%‰Ë—/]¥ªªª¥¥¥¨¨(ëÛ'»ëÊÐêÕ«C¯200à w!lÞ¼9té¢(Z³fÍÿ/Nvùz²‹¢¨©©iîܹ¡Wœ7oÞáÇmÐáuß}÷}öÙg¡Wijjš3gNŽlWœì†®®®nñâÅ¡W9räÈßþö7w{xCéî»ï¾-b—ß|/@>Šç~z{1¶pÆØ(Š.^¼˜H$ººº‚.:qâÄL&S^^n›^¿x^Y7n\&“?~|NmWœì†n„ K—. ½Ê… ^}õUw{X¼ÿþû¡KEÑÒ¥Kÿ£tˆIÖ$+ß^‡1vˆsÁàà`mmmKKKØç¢¢¢æææêêj;õzœ;w.™L^¹r%è*³gÏ>vìØoNc¬“]ž?KŒµf͚Ы ¬]»ÖݾN›6m ]º(ŠÖ¬YSÿî“ÝH?ÙEQÔÜÜøà–±+¾ ÷ùä?ÆØa˜ ._¾œH$.]ºtõ &d2™±cÇÚ¯?Weee&“ÉâÈëdWÆ·lٲЫ\¼xqË–-îö¼óÎ;¡KEѲeË<‰IÖ$k†Å›ÿcì÷æÎúÓÿñb?æôéÓ©Tª··7è*sçÎ=räHmW';†.†÷ÍzÃÝϵaÆХ‹|jÂÉnDìÚÚÚfÍš500ô~ì úü˜Ûo¿}ß¾}a ×ðÒNvNv…£ªªêᇽJssó'Ÿ|ân_£}ûö….]E<òˆoÏ;“ìðó½×Î'ÿ1Æ™ º»»“Éäùóçƒ^Æ~]ÿíêÕ«©Tê»ï¾ ºÊäÉ“ÓéôOþ ¿ÆX'»‚R^^¾|ùòЫ\¾|ù¯ý«»ý“Þzë­Ð¥‹¢hùòåþ-s±‰ây³•I6wî’·×cGâû½†††ÆÆÆÐ½©©©¶¶ÖÞý1™L¦ªªª¯¯/è* ß|óM^oW';†.ž7Ü9Üýo¯¼òJèÒE^šp²á'»ÎÎÎêêêþþþ SSSÓÜÜì w?榛n:tèPÐ%Š‹‹ÛÚڒɤ““Ý•J¥}ôÑЫœ8qâ£>r·ÐîÝ»C—.Š¢_ÿú××X:Ä®`ù^€ìòÒÆØ˜æ‚žžžT*uæÌ™ ×3vìØL&3aÂ;ø_]¹r%™Lž;w.è*S§NM§Ó£G.€íêdÇЕ••­X±"ô*]]]›7ov·ÿÃÖ­[C—.Š¢^xáÚK‡Ø²x^§3ÉfëžxÖkŒý§ 8p ôU=z´®®Î&þ^{{{MMMèïžY°`Á×_]`ÛÕÉŽ\ò÷†»µvíÚÐ¥s¬s²s²ûO'Ož¬¬¬ ýÖÖªªª–––¢"ÏXQË÷E—””ttt̘1ÃÉÎÉŽÿ3sæÌÇ<ô*mmm|ð»EÑŽ;bø§ÄŸx≟[:ÄÎ$k’N^šÀ›µ¹ ··7•J>}:è…•——g2™‰'ŽäMÏ¿Þ;}úôŽŽŽÒÒÒ‚Ü®Nv ]iié‹/¾z•îîîM›6ð[½eË–Ð¥‹¢èÅ_Bé»Á7ÜÒ ë#bÆXcìÿÃ?pEÑáÇçÍ›72wðñãÇëêêBoãÛo¿}ïÞ½¿]ìÈõãÀHþ4ÅË/¿Ãï¶c““ÝOˆç¥¯¨¨hmmo¸œ={ö‰'‚®2zôèÎÎÎn¸ÁÉÎÉŽ5mÚ´'Ÿ|2ô*Û·o·÷Ã? ]º(Šž|òÉ!—±3ÉšdóæQ›a±ÆØkÒ××WUU•Éd‚^á˜1cÒéôäÉ“GÎÞ½páB"‘èîîºJ"‘hoo/..!ÛÕÉŽ¡+))Y¹reèU®\¹2ÒÞp·iӦХ‹¢hÕªU×S:Ändñ w!ÄóC3ÆcžE‹}ñÅ¡¯ó›o¾ihh ÷ðáÃõõõ¡WY´hÑîÝ»Gàvu²#×#çÓ>ù“]Ž>Už={6™Löôô½ÎT*ÕÚÚZðÇÔßß_]]ÝÙÙt•ázÍÇÉÎÉnd™2eÊÓO?z•ÎÎÎ÷Þ{¯àoæ{コtQ=ýôÓ#êÕm±cØø^€üzŒÞ^gŒ5Æ}øª©©éèèz©eeeétzÊ”)…ºeÏœ9“J¥Bÿ…@eeå‰'†åxÆX'»§¸¸xÕªU¡WéééÙ¸qc߯7†.]E«V­ò{8Ù9Ù ]té¢(Z½zuümÂÉ®Ÿ*;VWWú²ï¸ãŽ/¿ü²0vê‚ 8z_555ÕÖÖÚ®Nv ›9sæÜÿý¡WÙ»wïþýû àvíÙ³'té¢(ºÿþû‡½tˆ^¦È¹Gᥠc¬16È\péÒ¥D"qùòå W>cÆŒŽŽŽ¼~Ã]OOO2™<{ölÐUÆŸÉdÆg»:Ù1ü¿]K—. ½Ê·ß~»mÛ¶¼¾Qo¼ñFèÒEQ´téÒ¥Cìˆ"ßp—K3¬ˆc±ç‚ÁÁÁºººãǽøÒÒÒŽŽŽéÓ§çãíè訮®ºJmmmSSS }eŒu²#5jÔš5kB¯ÒÛÛ»aÆ<½EëÖ­ ]º(Š^zé%o¯s²s² ûTyâĉٳg‡þ)Üzë­ûöíËÇ Z__øðáÐÛ©¥¥¥ººÚvu²# ššš%K–„^嫯¾ÊÇØíܹ3té¢(z衇•±ãŸ|Ã]v¯ÙKÆXclLsAWWW2™¼páBЇ0mÚ´ÎÎÎÒÒÒ|ù)Çs[&Nœ˜ÉdÊËËmW';‚;vì²eËB¯rúôé·ß~;nË«¯¾ºtQ-_¾ô*ß}÷Ý›o¾™³7aóæÍ¡KEÑŠ+â)b‡Iö‡ùˆÆØ‘2Ü|óÍß|óMÐ%JJJÚÚÚ‰D®ýd=:oÞ¼îp ÿ|1ÖÉŽŸÏî^yå•|ì>5“ÝzªÌd2•••ýýý…tº¹555ííívªu²s²ã‡%‰Ç{,ô*üâ‹/rêoß¾=té¢(zì±Çrp~GìL²åÚ÷øÇa1ÆŽ¸¹àêÕ«©Tê»ï¾ ºÊ”)SÒét޼ãܹs‰D¢§§'è*Yy¡1ÖÉŽ5zôè+V„^åìÙ³o¼ñFŽ<ä?ÿùÏ¡KEÑ /¼³ï¦FìF¨‘ö]íÞ^‡1väηÞzkèo()..nmmM¥RÙýé8q¢²²2ÎÇõüãŽ;îˆáîíÙ³ÇvÅÉ.Äð—ëëÖ­‹ùqyi';O•ÿæÌ™3ÉdòêÕ«AW™7oÞáÇc{Pñ|ÙAYYYggçÔ©SmWœìòÀÔ©SŸzê©Ð«9rdçα=¨7ß|3té¢(zê©§²[:ÄŽŸ§ð¾áÎGÄ0Æš ~@UUU:ºÊĉ3™Lyyy臓N§«ªªBõ|2™lkk+..¶]q²ËÅÅÅ1¼áîÂ… ¯½öZ ç•W^ ]º(ŠV­Z•õÒádç©òg;tèÐM7Ýz•‡~øý÷ß½JCCCccc w¬¾¾ÞvÅÉ.Ï444,Z´(ô*}ôQ[[[Ð%víÚCéîºë®\(bÇPÄ󆻵k×]"žOMx{ÆØ<ž Î;—L&¯\¹t•ººº£Gúû»»“Éäùóçƒ>„1cÆd2™I“&Ù®8Ùå¥É“'?óÌ3¡WijjÚ±cG ?|ëÖ­¡KEѳÏ>›#¥CìÈéé,ܤé#bcÍ×d`` ¦¦¦½½=è*&LÈd2cÇŽÞ?¶­­mÖ¬YA/¾ªªª¥¥¥¨¨ÈvÅÉ.Ÿ`EE«W¯½ÊÅ‹·lÙ2ììÚµkC—.Š¢Õ«WçNép²óT9tG7o^èU–,Yòá‡ïŸYWWwìØ±îO]]튓]Þ›;wî½÷Þz•?þ¸¥¥eÿÀO?ý4†Ò-^¼8§J‡Øq]bø|ûàààð¾áÎ'ÿ1Æš ~¶ .$“É®®® «ÔÖÖ655 ËݾtéR"‘¸|ùrÐ ;vl&“™0a‚í*mNvbâĉÏ=÷\èUŽ?þ駟˵eË–Ð¥‹¢èùçŸÏµÒ!v\¯xÞJ6\³§·×aŒ5 ý’jkk‡÷5„ÿ6nܸL&3~üøëùCŽ;6wîÜÐ÷pÖ¬YÇoØ®NvÿŠá w—/_¾þ7ܽüòË1üú­Y³&K‡“§ÊaÐÜÜúè£!ü7mÚºtQ-[¶,gK‡Ø1lâù€ÔоáÎGÄ0Æš †óÚæÎú3öCø$VcccCCCè‡ôKämW';rëw)†£MWW×æÍ›ëp²óT™M­­­³gÏý½˜‹/¾ö›¢¿¿¿ªª*N‡}®.*jii©ªª²]ìœìF„êêê‡z(ô*Ÿ}öYSSÓ5þ—ß}÷ÝÐ¥‹¢èá‡ÎñÒ!väå4wí/S˜a1Æš ‚èîîN$.\}„lnnþÉáá»ï¾K¥RW¯^ z1“&MJ§Óååå¶«1ÖÉn)//_¾|yèUZ[[¯å¦Ø¸qcèÒEQ´|ùòÜ/bÇðËo¸ó1Œ±æ‚°êëë>ú™Éd&Nœøcÿ…¯¾úê¶Ûn‹á‘:tÈv5Æ:ÙP1ü…}ww÷_þò—¬ë¼4“݈~ªìè訮®ý†»{î¹gçÎ?øõööVTTœ:u*è·¶¶¦R)ÛÕÉÎÉn„ª¨¨xôÑGC¯òùçŸ9räÿ£·ß~;té¢(zôÑGó¥tˆ¡Äó×ö?ö†;/M`Œ5Ĥ§§'™Lž={6è*•••'Nœø7Üté¢(Z±bE•±# l}tÌë°cÍq›?þÁƒƒ.1f̘t:=yòäïÿÏ/¾øbÑ¢E1<®ýû÷Û®ÆX';â;þ\¹reÓ¦MŽu8ÙyªÌ¦x^+¸ë®»víÚEQOOO"‘8wî\ÐåJJJÚÛÛgΜi»:Ù9ÙñfΜùØc…^e÷îÝQ½þúë¡KEÑo~ó›¼+bGpq~/€·×aŒ5dMooo*•:}útÐUR©ÔÎ;kkkCFmÚ´i¥¥¥¶«1ÖÉŽSZZú /„^¥³³sÍš5¡KEÑ‹/¾˜¥ÃÉÎSeöíÛwûí·ÆNÝ·oß­·Þš—¿c¶«“¡ÝvÛmyˆB} ˆ¡Æ_ê{ic¬¹à'œ>}:•Jõööæï---íììœ6mZ¾þŽÙ®NvÄ`Ú´i¿ýíoóú!<ùä“ù[:ÄŽøäûG¬|D c¬¹àšôõõUVVžþ5¿—&0Æš ~¶³gÏ&“Éžžž|¹à²²²t:=eÊ”¼ÿ³]ìˆÓ”)Sžzê©<ºà§Ÿ~ºJ‡Ø‘ùõ¡+Ãk.¢þþþêêêÎÎÎÜ¿ÔT*ÕÚÚZ\\\¿c¶«“1+..^µjU^\êêÕ« £t8ÙyªÌŽÆÆÆ†††¼¸Îo¼±@~ÇlW';âW__÷ÝwçøEÞsÏ=S:ÄŽ¬Éý¿ø÷ÒÆXsÁ08þ|2™ìîîÎÍË+//Ïd2'N,œß1ÛÕÉŽ¬˜4iÒ³Ï>›³—÷ÜsÏRé;²)—?†å#bcÍÃf```Ö¬Ymmm¹vaÕÕÕÍÍÍEEõl»:Ù‘½ŸzQÑêÕ«sðÂV¯^]`¥ÃÉÎSe–555Í;7¯jΜ9…ö;f»:Ù‘Euuu‹/ΩKºï¾û ¯tˆÙ—kogóö:Œ±æ‚ .]º”H$._¾œ 3nܸL&3~üøü³]ìÈ®ñãÇ?ÿüó9r1K—.-ÈÒ!v˜ͰcÍ1>®9sæ477g÷2jkk›ššâÿ±Ú®NvŒ˜çºQ£Ö¬Y“õËX³fM¡–';O•¹¢¥¥¥¶¶6‹pÔ¨QÍÍÍ555üŒb»:Ù‘}³fÍzðÁ³xK–,)àÒ!väì~öÞ'ÿ1Æš bÒÕÕ•H$.^¼ÿÒ&LÈd2cÇŽ-äß1ÛÕÉŽ1vìØeË–eeéeË–vép²óTɈù³]ìÄ@ìÄ@ì±;±;±;±;±Ä@ìÄ@ìÄ@ìÄ@ìÄ;±;±;±;±;@ìÄ@ìÄ@ìÄ@ìÄ@ì±;±;±;±;±Ä@ìÄ@ìÄ Qƒƒƒîàd vb vb vb vÀöÿ€hfš¿—ÐIEND®B`‚fim-0.6-rc2/media/multipage/0000755000175000017500000000000014503655326012676 500000000000000fim-0.6-rc2/media/multipage/Makefile0000644000175000017500000000070414454347340014256 00000000000000MULTIPAGESAMPLE=sample all: $(MULTIPAGESAMPLE).pdf $(MULTIPAGESAMPLE).dvi $(MULTIPAGESAMPLE).ps $(MULTIPAGESAMPLE).djvu $(MULTIPAGESAMPLE).pdf: $(MULTIPAGESAMPLE).dvi $(MULTIPAGESAMPLE).ps: $(MULTIPAGESAMPLE).dvi dvips $< $(MULTIPAGESAMPLE).dvi: $(MULTIPAGESAMPLE).tex tex $< $(MULTIPAGESAMPLE).djvu: $(MULTIPAGESAMPLE).pdf pdf2djvu $< > $@ $(MULTIPAGESAMPLE).pdf: $(MULTIPAGESAMPLE).dvi dvipdf $< clean: rm -f *.log *.dvi *.pdf *.djvu *.ps fim-0.6-rc2/media/multipage/sample.tex0000644000175000017500000000137214454347340014623 00000000000000\input colordvi \magnification=\magstep4 \font\ss=rphvr at 10pt \font\ss=cmss10 scaled 1100 \ss \parindent=0pt \special{! /landplus90 true store} \special{papersize=11in,8.5in} \hsize=9 true in \vsize=6.5 true in % for a bulleted item \def \gli {\par\hskip .4in \Green{$\bullet$}\hskip .1 in \textBlack} \def \rli {\par\hskip .4in \Red{$\bullet$}\hskip .1 in \textBlack} \def \bli {\par\hskip .4in \Blue{$\bullet$}\hskip .1 in \textBlack} \def \topic #1{\par\textRed\centerline {#1}\textBlack} \def \nextslide{\medskip\eject} \def \tit{A simple multipage file} \topic{\tit: page 1/3} \gli a green bullet \rli a red bullet \bli a blue bullet \nextslide \topic{\tit: page 2/3} an empty page \nextslide \topic{\tit: page 3/3} an empty page, again \nextslide \bye fim-0.6-rc2/Makefile.am0000644000175000017500000024774114454357130011620 00000000000000# $Id: Makefile.am 1979 2023-07-14 23:46:31Z dezperado $ # no-dependencies was due to problems with conditional sources # nostdinc disables the standard -I. include which breaks a correct string.h include AUTOMAKE_OPTIONS = nostdinc no-dependencies # dejagnu SUBDIRS = src doc distros scripts dist_doc_DATA=$(top_srcdir)/README $(top_srcdir)/README.FIRST $(top_srcdir)/TODO $(top_srcdir)/VERSION $(top_srcdir)/BUGS $(top_srcdir)/FAQ.TXT $(top_srcdir)/AUTHORS $(top_srcdir)/ChangeLog $(top_srcdir)/NEWS.in $(top_srcdir)/NEWS $(top_srcdir)/README.md # no INSTALL INSTALL.TXT is necessary in rules EXTRA_DIST= COPYING \ Makefile.am configure.ac configure \ aclocal.m4 config.h.in \ autogen.sh \ $(top_srcdir)/media/image.jpg \ $(top_srcdir)/media/image.png \ $(top_srcdir)/media/fim.png \ $(top_srcdir)/media/icon_smile.gif \ $(top_srcdir)/media/numbers/0.gif \ $(top_srcdir)/media/numbers/1.gif \ $(top_srcdir)/media/numbers/2.gif \ $(top_srcdir)/media/numbers/3.gif \ $(top_srcdir)/media/numbers/4.gif \ $(top_srcdir)/media/numbers/5.gif \ $(top_srcdir)/media/numbers/6.gif \ $(top_srcdir)/media/numbers/7.gif \ $(top_srcdir)/media/numbers/8.gif \ $(top_srcdir)/media/numbers/9.gif \ $(top_srcdir)/media/numbers_pcx/0.pcx \ $(top_srcdir)/media/numbers_pcx/1.pcx \ $(top_srcdir)/media/numbers_pcx/2.pcx \ $(top_srcdir)/media/numbers_pcx/3.pcx \ $(top_srcdir)/media/numbers_pcx/4.pcx \ $(top_srcdir)/media/numbers_pcx/5.pcx \ $(top_srcdir)/media/numbers_pcx/6.pcx \ $(top_srcdir)/media/numbers_pcx/7.pcx \ $(top_srcdir)/media/numbers_pcx/8.pcx \ $(top_srcdir)/media/numbers_pcx/9.pcx \ $(top_srcdir)/media/multipage/sample.tex \ $(top_srcdir)/media/multipage/Makefile \ $(top_srcdir)/media/special/icon_smile_gif_at_7.bin \ $(top_srcdir)/media/special/images.desc \ $(top_srcdir)/media/special/modifiers.desc \ $(top_srcdir)/media/special/postscript.eps \ $(top_srcdir)/media/special/images.list \ $(top_srcdir)/media/special/dir.desc \ $(top_srcdir)/media/special/collated.list \ $(top_srcdir)/media/special/loadable.desc \ $(top_srcdir)/media/special/0_8bit.pcx.bin \ $(top_srcdir)/media/special/0_gray.tiff \ $(top_srcdir)/media/special/0_rgba.tiff \ $(top_srcdir)/media/special/0_monochrome_white_polarity.tiff \ $(top_srcdir)/media/special/0_16bps_msb.tiff \ $(top_srcdir)/media/special/0_interlaced.gif \ $(top_srcdir)/media/special/0_truncated_bad.gif.bin \ $(top_srcdir)/media/special/0.webp \ $(top_srcdir)/media/special/truncated_bad.png.bin \ $(top_srcdir)/media/special/truncated_bad.jpg.bin \ $(top_srcdir)/media/special/0_gray.png \ $(top_srcdir)/media/special/numbers_pcx.tar \ $(top_srcdir)/media/special/numbers_pcx.tar.bz2 \ $(top_srcdir)/media/special/numbers_pcx.tar.gz \ $(top_srcdir)/media/special/numbers_pcx.tar.xz \ $(top_srcdir)/media/special/ciao.fig \ $(top_srcdir)/media/special/matrix.mtx \ $(top_srcdir)/var/fonts/Lat15-Terminus16.psf \ depcomp missing install-sh FIM_EXE=./src/fim$(EXEEXT) FIMGS_EXE=PATH=./src/:$(PATH) $(abs_srcdir)/src/fimgs # mhmhmhm # CLEANFILES = autom4te.cache srcdir = src # still unfinished .PHONY: signed-tgzdist signed-tgzdist: dist gpg -sbv -u 0xE0E669C8EF1258B8 $(distdir).tar.gz ls -l $(distdir).tar.gz $(distdir).tar.gz.sig # still unfinished .PHONY: signed-dist signed-dist: dist make dist-bzip2 && gpg -sbv -u 0xE0E669C8EF1258B8 $(distdir).tar.bz2 ls -l $(distdir).tar.bz2 $(distdir).tar.bz2.sig gpg -sbv -u 0xE0E669C8EF1258B8 $(distdir).tar.gz ls -l $(distdir).tar.gz $(distdir).tar.gz.sig #%.sig: % # gpg -sbv -u 0xE0E669C8EF1258B8 $@ $< # gpg -sbav -u 0xE0E669C8EF1258B8 $@ $< CXX11TEST=test ` $(FIM_EXE) -V | grep standard | head -1 | tr -d -c '[:digit:]'` -gt 200301 FIMNORCOPTS= --no-rc-file --no-etc-fimrc-file --no-history FIMSCLTSTOPTS=-C '_downscale_huge_at_load=-1;_magnify_factor=2;_reduce_factor=2;' --no-auto-scale -o dumb -q FIMVIDEOTESTOPTS=-K ']]].[[fmfmwsk--++hhlltW' -K ':quit' --chars-press '' # --chars-press -K NO_ASAN=ASAN_OPTIONS=detect_leaks=0 if ENABLE_CACA FIM_USE_ASCII_ART_DEFAULT=ca else if ENABLE_AA FIM_USE_ASCII_ART_DEFAULT=aa endif endif .PHONY: fbtests fbtests: all if WITH_EXPECT $(TIMEOUT_SMALL) \ $(EXPECT) $(top_srcdir)/scripts/tests/spawn_and_quit.exp $(FIM_EXE) $(FIMNORCOPTS) -o fb $(top_srcdir)/media/ endif $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS) FRAMEBUFFER="/dev/non-existing-framebuffer-device" \ $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS); test $$? = 1 # invalid FRAMEBUFFER device is detected as error FRAMEBUFFER="/dev/non-existing-framebuffer-device" \ $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS) |& grep open.*No.such # invalid FRAMEBUFFER is verbose $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS) --device "/dev/non-existing-framebuffer-device"; test $$? = 1 # invalid --device option detected as error $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS) --device "/dev/non-existing-framebuffer-device" |& grep open.*No.such # invalid FRAMEBUFFER is verbose $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb $(FIMVIDEOTESTOPTS) |& grep -v Inappropriate # good device works fine if test "$(TERM)" != screen.linux && which screen; then \ test `screen -q $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb=S $(FIMVIDEOTESTOPTS) -c 'stdout "fail"' | wc -l` = 0; \ fi # screen does not propagate commands's return code, therefore the stdout-based trick if test "$(TERM)" = screen.linux ; then \ $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o fb=S $(FIMVIDEOTESTOPTS); test $$? = 255; \ fi if FIM_WANT_HARDCODED_CONSOLEFONT test `$(FIM_EXE) $(FIMNORCOPTS) -o fb $(top_srcdir)/media/ --verbose-font-load -c 'font "info"; quit' | wc -l` -ge 4 # font verbosity minimum else test `$(FIM_EXE) $(FIMNORCOPTS) -o fb $(top_srcdir)/media/ --verbose-font-load -c 'font "info"; quit' | wc -l` -ge 3 # font verbosity minimum endif $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit !(_fbfont_as_screen_fraction=~"[0-9]")' # must be a number (0 if off); more tests needed $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit !(_fbfont_magnify_factor=~"[0-9]")' # must be a number (0 if off); more tests needed .PHONY: aatests aatests: all if WITH_EXPECT $(NO_ASAN) $(TIMEOUT_SMALL) \ $(EXPECT) $(top_srcdir)/scripts/tests/spawn_and_quit.exp $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ endif $(NO_ASAN) $(TIMEOUT_LARGE) $(FIM_EXE) $(FIMNORCOPTS) -o aa --sanity-check | grep 's 98 b 1 1 1 c 99' # differently than -o dumb, this stresses DebugConsole's grow() mechanism $(NO_ASAN) $(FIM_EXE) $(top_srcdir)/media/ -t -c 'console_scroll_up;console_scroll_down;console_scroll_reset;quit' # placeholder for a better test $(NO_ASAN) $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o aa $(FIMVIDEOTESTOPTS) if test -n "$(DISPLAY)"; then \ $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o aa=w $(FIMVIDEOTESTOPTS); \ fi if WANT_READLINE if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o aa=w -C '_debug_commands="k"' -K:quit -K '' | grep pressed.key; fi # readline mode key verbosity endif test "`SSH_TTY=1 $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -c 'stderr _device_string' -kq 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # test "`(unset SSH_TTY; $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # test "`( SSH_TTY= $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # # extras for readline and caption related: if WANT_READLINE $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -K :$$'\t'ne$$'\t'$$'\t' -K '' -Kq # completion_display_matches_hook $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -K :$$'\t'n=x$$'\t'$$'\t' -K '' -Kq # cover completion of variables echo q | $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -K : # cover fim_rl_getc $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -C '_caption_over_image=3;_caption_over_image_fmt="fim:%M";_display_status=1;display' -kn -kq # cover Viewport::extra_top_height endif $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -K :$$'\t' -Kq | grep WELCOME 2>&1 | cat > /dev/null # cover what happens hitting Tab in console mode .PHONY: cacatests cacatests: all if WITH_EXPECT $(NO_ASAN) $(TIMEOUT_SMALL) \ $(EXPECT) $(top_srcdir)/scripts/tests/spawn_and_quit.exp $(FIM_EXE) $(FIMNORCOPTS) -o ca $(top_srcdir)/media/ endif $(NO_ASAN) $(TIMEOUT_SMALL) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o caca $(FIMVIDEOTESTOPTS) # added caca falls back to ca if test -n "$(DISPLAY)"; then \ $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o ca=w $(FIMVIDEOTESTOPTS); \ fi if WANT_READLINE if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o ca=w -C '_debug_commands="k"' -K:quit -K '' | grep pressed.key; fi # readline mode key verbosity endif test "`SSH_TTY=1 $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -c 'stderr _device_string' -kq 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # test "`(unset SSH_TTY; $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # test "`( SSH_TTY= $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # .PHONY: sdltests sdltests: all $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=h --version | grep 'SDL[2]\?' $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=h $(FIMVIDEOTESTOPTS); $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=hhMR20:10% -K $$'\t' -c 'while(0){1;}quit;' ; # cover: draw help grid, unlock, input poll, misc $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=0:-1 ; test $$? = 252 if FIM_WANT_HARDCODED_CONSOLEFONT $(NO_ASAN) FBFONT= \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl -c quit # TODO: this is only a coverage test $(NO_ASAN) FBFONT=fim:// \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl -c quit # TODO: this is only a coverage test endif .PHONY: imlib2tests imlib2tests: all $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2 $(FIMVIDEOTESTOPTS); $(NO_ASAN) $(TIMEOUT_LARGE) \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2=20:10% -K $$'\t' -c 'while(0){1;}quit;' ; # cover: draw help grid, unlock, input poll, misc # $(NO_ASAN) $(TIMEOUT_LARGE) \ # $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2=0:-1 ; test $$? = 252 $(NO_ASAN) FBFONT= \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2 -c quit # TODO: this is only a coverage test $(NO_ASAN) FBFONT=fim:// \ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2 -c quit # TODO: this is only a coverage test # this rule is deprecated, too: testing should be performed with 'make tests' (FIXME) .PHONY: sanity-check sanity-check: all if HAVE_RUNNABLE_TESTS @$(FIM_EXE) $(FIMNORCOPTS) -E $(top_srcdir)/scripts/tests/sanity.fim -t else @echo "you are cross-compiling, so can't run tests..." endif .PHONY: check check: tests SNTZ = |tr -d -c '0-9A-Za-z_./:-' .PHONY: devtests devtests: all if WITH_SHELLCHECK $(SHELLCHECK) -e SC2235,SC1117,SC2230,SC2086,SC2006,SC2001 $(top_srcdir)/src/fimgs endif ! grep '^#' NEWS ! grep -n '^[^ ].\{107,\}' doc/FIM.TXT ! grep -n '^[^ ].\{83,\}' README ! grep -n '^[^ ].\{175,\}' README.md test `grep '[^=]==[^=]' $(top_srcdir)/configure.ac | grep -v ^dnl | wc -l` = 0 # look out for bashisms if grep -q PKG_CHECK_MODULES configure.ac; then ! grep -q PKG_CHECK_MODULES configure; fi test `grep '[^=]==[^=]' $(top_srcdir)/src/fimgs | wc -l` = 0 # look out for more bashisms test `grep 'test.* == ' $(top_srcdir)/Makefile.am | wc -l` = 1 # tolerate == on this line only test `grep 'SNTZ.*wc' $(top_srcdir)/Makefile.am | wc -l` = 1 # tolerate SNTZ.*wc on this line only ! grep -n '^[^ ].\{83,\}' README ! grep '\<'$(USER)'\>' doc/*man* # against namespace leaks ! grep '\.o\>' $(top_srcdir)/src/Makefile.am ! grep '\' $(top_srcdir)/src/Makefile.am if WITH_PERL test -s doc/FIM.html if WITH_MAN2HTML test -s doc/fimgs.man.html -a -s doc/fim.man.html -a -s doc/fimrc.man.html endif endif if HAVE_RUNNABLE_TESTS if ENABLE_GIF $(FIMGS_EXE) ssh:$$(hostname):$(abs_top_srcdir)/media/numbers/0.gif -- $(FIMNORCOPTS) -o dumb -K q $(FIMGS_EXE) ssh:$$(hostname):$(abs_top_srcdir)/media/numbers/u.gif -- $(FIMNORCOPTS) -o dumb -K q; test $$? = 255 export TMPDIR=`pwd`/tmpdir && $(FIMGS_EXE) ssh:$$(hostname):$(abs_top_srcdir)/media/numbers/0.gif -- $(FIMNORCOPTS) -o dumb -K q && test "`ls $$TMPDIR`" = "" endif if HAVE_VALGRIND if ! ldd $(FIM_EXE) | grep libasan.so.5; then \ make clean -C src/testdir ; \ VALGRIND='valgrind --tool=memcheck --leak-check=yes --num-callers=15 --exit-on-first-error=yes --error-exitcode=255' \ make ltests; \ fi endif endif # this is the official way of testing fim .PHONY: tests tests: all ! ( echo $(abs_top_srcdir) | grep '[\\ :"'"'"']' ) # reject unreasonable base directory names if HAVE_RUNNABLE_TESTS ulimit -c unlimited || true ulimit -v 32000 || true ulimit -t 1000 || true $(TIMEOUT_LARGE) $(FIM_EXE) $(FIMNORCOPTS) -o dumb --sanity-check $(TIMEOUT_LARGE) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'stdout random ; quit 0;' # make sure no leak from 'random' $(TIMEOUT_LARGE) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'quit !(randomm == 0 && ( random != 0 || random != 0 || random != 0));' # hope to get three non-zeros $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c '_display_status_fmt="fim:%M%n%R%m%C%v"' --verbose-interpreter --verbose-interpreter -kn -kq # cover modifiers and interpreter wc0=` $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -kq |wc -l`; \ wc1=`$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -kq --verbose-load|wc -l`; \ wc2=`$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -kq --verbose-load --verbose-load|wc -l`; \ test $$wc0 -lt $$wc1 -a $$wc1 -lt $$wc2 # ensure at least two levels of load verbosity # if ENABLE_PCX test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~="; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.1 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/../media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~="; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.2 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~^"; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.1 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/../media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~^"; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.1 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/../media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~$$"; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.1 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/../media/numbers_pcx/1.pcx -c 'a=_filelistlen;limit "~!"; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.0 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/../media/numbers_pcx/2.pcx -c 'a=_filelistlen;limit "~!"; list;b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 2.2 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "~i" "4"; b=_filelistlen; limit "~i" "4-4"; c=_filelistlen; limit "~i" "4-5"; d=_filelistlen; stdout a.".".b.".".c.".".d;quit' $(SNTZ)` = 10.1.1.2 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "~z" "0-900"; b=_filelistlen; limit "~z" "0-909"; c=_filelistlen; stdout a.".".b.".".c;quit'` = 10.0.7 # needs stat test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "!"; b=_filelistlen; stdout a.".".b;quit' $(SNTZ)` = 10.0 # needs stat test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "~d" "01/01/1970-01/01/2007"; b=_filelistlen; limit "~d" "01/01/2007-19/01/2038"; c=_filelistlen; stdout a.".".b.".".c;quit' $(SNTZ)` = 10.0.10 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "prime" "yes"; b=_filelistlen; limit "prime" "no" ; c=_filelistlen; limit "prime" "zzz" ; d=_filelistlen; stdout a.".".b.".".c.".".d;quit' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc $(SNTZ)` = 10.3.2.0 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_filelistlen;limit "uno"; b=_filelistlen;limit "due"; c=_filelistlen; limit "boh"; d=_filelistlen; stdout a.".".b.".".c.".".d;quit' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc $(SNTZ)` = 10.1.1.0 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'limit "-list";stdout _last_cmd_output;limit "-listall";stdout _last_cmd_output; quit;' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc | grep there.are.*variable > /dev/null # TODO: need better test here $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'limit "-list" "prime";stdout _last_cmd_output;limit "-listall" "prime";stdout _last_cmd_output; quit;' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc | grep there.are.*value > /dev/null # TODO: need better test here $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_8bit.pcx.bin -C 'stdout "Unsupported PCX file test.."' -c 'quit !(i:width==0)' # named so to not break dir-loading tests endif if ENABLE_PCX $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/0.pcx; quit !(i:_comment=="comments")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/1.pcx; quit !(i:_comment=="pre_comments")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/2.pcx; quit !(i:_comment=="comment")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/3.pcx; quit !(i:_comment=="comment_post")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/4.pcx; quit !(i:_comment=="komment")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/5.pcx; quit !(i:_comment=="kommentar")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/6.pcx; quit !(i:_comment=="comment_POST")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/7.pcx; quit !(i:_comment=="PRE_comment_POST")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/7.pcx; quit !(i:common=="s")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/8.pcx; quit !(i:_comment=="comment_POST")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/8.pcx; quit !(i:common=="")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/9.pcx; quit !(i:common=="")' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file media/special/modifiers.desc -c '/9.pcx; quit !(i:_comment=="comment@@@common@5_")' endif if ENABLE_PCX if ENABLE_PNG $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "-/5/";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.8.12 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "-/B";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.12.12 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+/b";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.0.12 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+/B";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.2.12 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+/s";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.2.12 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+/d";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.3.12 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png $(top_srcdir)/media/fim.png $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+/u";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' | grep 0.0.0.12 endif $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort";a=_fileindex; goto;b=_fileindex; goto "+50%";c=_fileindex; stdout a.".".b.".".c."."._filelistlen;quit' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c 'list "sort"; a=_fileindex; goto "+prime"; b=_fileindex;goto "+prime"; c=_fileindex; goto "+prime"; d=_fileindex; goto "+prime"; e=_fileindex; stdout a.".".b.".".c.".".d.".".e; quit' | grep 0.2.5.6.1 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -C 'bind "n" "goto \"+1f\"";' -Knnnq -F 'quit !(_fileindex==4);' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -C 'bind "n" "goto \"+1F\"";' -Knnnq -F 'quit !(_fileindex==8);' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c 'list "sort_fsize"; goto 0; reload; stdout i:_filename; quit' | grep 1.pcx endif if ENABLE_PCX $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort"; list;l1=_last_cmd_output;list "random_shuffle";list;l2=_last_cmd_output;if(l1==l2)quit 255; quit' $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort"; next;f=i:_filename;list "swap"; reload;if(f==i:_filename)quit 255; quit' $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx $(top_srcdir)/media/numbers_pcx/*.pcx --sort -c 'list "pop"; if(_filelistlen!= 9) quit 255;quit' $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "pop"; if(_filelistlen!=19) quit 255;quit' $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/numbers_pcx/2.pcx --reverse -c 'quit!(i:_filename=~"2.pcx")' $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/1.pcx $(top_srcdir)/media/numbers_pcx/2.pcx -c 'quit (i:_filename=~"2.pcx")' $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "remove"; quit' $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'next;list "pop";reload;quit !(i:_filename == "$(top_srcdir)/media/numbers_pcx/0.pcx")' $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'next;list "remove";reload;quit !(i:_filename == "$(top_srcdir)/media/numbers_pcx/2.pcx")' test `$(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -k n -k Del -k q -F 'stdout i:_filename' $(SNTZ)` = "$(top_srcdir)/media/numbers_pcx/2.pcx" $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'a=1' -c 'a=a+1;' -c 'quit (1-(a==2))' endif if WANT_RECURSIVE_DIRS $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'cd "$(top_srcdir)/media/"' -c 'stdout _pwd;l=_filelistlen;list "pushdir" _pwd;stdout l;if(l==_filelistlen)quit 255; quit' $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'cd "$(top_srcdir)/media/"' -c 'stdout _pwd;l=_filelistlen;list "pushdirr" _pwd;stdout l;if(l==_filelistlen)quit 255; quit' $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'cd "$(top_srcdir)/media/"' -c 'stdout _pwd;l=_filelistlen;list "pushdir" ;stdout l;if(l==_filelistlen)quit 255; quit' $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'cd "$(top_srcdir)/media/"' -c 'stdout _pwd;l=_filelistlen;list "pushdirr" ;stdout l;if(l==_filelistlen)quit 255; quit' if ENABLE_PNG if ENABLE_PCX if ENABLE_JPEG $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir "$(top_srcdir)/media/image.jpg" -c 'quit 2' -kq; test $$? = 2 # --cd-and-readdir respects scripting $(FIM_EXE) $(FIMNORCOPTS) -o dumb "$(top_srcdir)/media/" -c ' quit 2' -kq; test $$? = 2 # no heading semicolons: good $(FIM_EXE) $(FIMNORCOPTS) -o dumb "$(top_srcdir)/media/" -c ';quit 2' -kq; test $$? = 0 # heading semicolons: bad (FIXME in the long run) $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir "$(top_srcdir)/media/image.jpg" -c 'quit 2' -kq; test $$? = 2 # --cd-and-readdir respects scripting $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'if(_pwd=="$(abs_builddir)")quit 1; quit' # check that cd is effective test "`$(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'stdout _pwd;quit'`" = `cd $(abs_top_srcdir)/media; pwd;` # check that cd is effective, again (yes, redundant) $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'if (_filelistlen<=1)quit 1;quit' # check that dir files are pushed $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'if (_filelistlen>20)quit 1;quit' # too many files means recursive push $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'l0=_filelistlen; list "pushdir" "."; l1=_filelistlen; if(l0!=l1)quit 1; quit' # pushdir must be idempotent $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'l0=_filelistlen; list "pushdirr" "."; l1=_filelistlen; if(l0==l1)quit 1; quit' # pushdir and pushdirr must differ $(FIM_EXE) $(FIMNORCOPTS) -o dumb --cd-and-readdir $(abs_top_srcdir)/media/image.jpg -c 'if(i:_filename=~"image.jpg")quit 0; quit 1' # --cd-and-readdir does jumps to loaded file endif endif endif endif if ENABLE_RAW_BITS_RENDERING $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit !(_all_file_loaders=~"Text")' # shall reflect supported file formats $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ --as-text -c quit test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ --as-text -c 'stdout _last_file_loader;quit' $(SNTZ)` = Text # mostly coverage test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ --binary=1 -c 'stdout _last_file_loader;quit' $(SNTZ)` = Bit1 # mostly coverage test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ --binary=24 -c 'stdout _last_file_loader;quit' $(SNTZ)` = Bit24 # mostly coverage if WANT_READ_STDIN_IMAGE test `echo -n U | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin --binary=1 -c 'magnify;stdout i:height."."._last_file_loader;quit' $(SNTZ)` = 1.Bit1 # coverage of tiny case; TODO: remove necessity of magnify test `echo -n U | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin --binary=24 -c 'magnify;stdout i:height."."._last_file_loader;quit' $(SNTZ)` = 1.Bit24 # coverage of tiny case; TODO: remove necessity of magnify test `echo $(abs_srcdir)/media | $(FIM_EXE) $(FIMNORCOPTS) -o dumb - --binary=23 -c 'magnify;stdout _last_file_loader;quit' $(SNTZ)` = Bit24 # coverage of - and fallback to 24 endif endif $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -c 'window;stdout _last_cmd_output;quit;' grep disabled > /dev/null test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ --dump-reference-help | wc -l $(SNTZ)` -gt 100 test `$(FIM_EXE) $(FIMNORCOPTS) --help=m | wc -c $(SNTZ)` -gt 28000 # man dump test `$(FIM_EXE) $(FIMNORCOPTS) --help=m | grep fB | wc -l $(SNTZ)` -gt 40 # lots of troff test `$(FIM_EXE) $(FIMNORCOPTS) --help=l | grep fB | wc -l $(SNTZ)` -eq 0 # no troff left (hopefully) test `$(FIM_EXE) $(FIMNORCOPTS) --NON-existent-OPTIONNN | wc -l $(SNTZ)` -gt 70 # help function $(FIM_EXE) $(FIMNORCOPTS) --NON-existent-OPTIONNN; test $$? = 240 # help function failing if ENABLE_BMP if which convert; then \ convert $(top_srcdir)/media/icon_smile.gif -monochrome $(top_srcdir)/media/icon_smile.bmp && \ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp && \ if which ppmtobmp ; then \ convert $(top_srcdir)/media/icon_smile.gif ppm:- | ppmtobmp -bpp 8 > $(top_srcdir)/media/icon_smile.bmp && \ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp && \ convert $(top_srcdir)/media/icon_smile.gif ppm:- | ppmtobmp -bpp 4 > $(top_srcdir)/media/icon_smile.bmp && \ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp ; \ fi && \ convert $(top_srcdir)/media/icon_smile.gif -depth 8 -alpha Disassociate $(top_srcdir)/media/icon_smile.bmp && \ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp; \ fi endif if which convert; then \ convert $(top_srcdir)/media/icon_smile.gif -depth 8 $(top_srcdir)/media/icon_smile.ppm && \ sed -i 's/P6$$/P6\n# comment/g' $(top_srcdir)/media/icon_smile.ppm && \ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.ppm -c 'stdout _last_file_loader;quit' $(SNTZ)` = ppm && rm -f $(top_srcdir)/media/icon_smile.ppm && \ convert $(top_srcdir)/media/icon_smile.gif -depth 16 $(top_srcdir)/media/icon_smile.ppm && \ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.ppm -c 'stdout _last_file_loader;quit' $(SNTZ)` = ppm && rm -f $(top_srcdir)/media/icon_smile.ppm && \ convert $(top_srcdir)/media/icon_smile.gif -depth 8 $(top_srcdir)/media/icon_smile.pgm && \ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.pgm -c 'stdout _last_file_loader;quit' $(SNTZ)` = pgm && rm -f $(top_srcdir)/media/icon_smile.pgm; \ convert $(top_srcdir)/media/icon_smile.gif -depth 16 $(top_srcdir)/media/icon_smile.pgm && \ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.pgm -c 'stdout _last_file_loader;quit' $(SNTZ)` = pgm && rm -f $(top_srcdir)/media/icon_smile.pgm; \ fi # cover-test FbiStuffPpm.cpp if WITH_XFIG test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/ciao.fig -c 'stdout _last_file_loader;quit' $(SNTZ)` = ppm # else test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/ciao.fig -c 'stdout _last_file_loader;quit' $(SNTZ)` = 0 # endif if WITH_LIBGRAPHICSMAGICK test `$(FIM_EXE) $(FIMNORCOPTS) -X -o dumb $(top_srcdir)/media/special/0.webp -c 'stdout _last_file_loader;quit' $(SNTZ)` = libGraphicsMagick else if WITH_CONVERT test `$(FIM_EXE) $(FIMNORCOPTS) -X -o dumb $(top_srcdir)/media/special/0.webp -c 'stdout _last_file_loader;quit' $(SNTZ)` = 0 # assuming no other decoders exists, -X stops external converters if which convert && convert identify -list format | grep -i webp; then test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0.webp -c 'stdout _last_file_loader;quit' $(SNTZ)` = ppm ; fi # note: this would pass also with old pipe mechanism -- tiny file endif endif if WITH_CONVERT if ENABLE_JPEG if which convert && convert identify -list format | grep -i ppm; then $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_downscale_huge_at_load=-1' $(top_srcdir)/media/image.jpg --pread-cmd='convert {} -background black -flop -fill white -pointsize 3 label:"mirrored {}" -gravity Center -append ppm:-' -c 'quit !(i:width==320)' ; fi # pointsize need to be small or text will exceed 320 pixels if which convert && convert identify -list format | grep -i ppm; then $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_downscale_huge_at_load=-1' $(top_srcdir)/media/image.jpg --pread-cmd='convert {} -rotate 90 -append ppm:-' -c 'quit !(i:width==240)' ; fi if which convert && convert identify -list format | grep -i ppm; then cp $(top_srcdir)/media/image.jpg -- -image.jpg && $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_downscale_huge_at_load=-1' --pread-cmd='convert {} -rotate 90 -append ppm:-' -c 'quit !(i:width==320)' -- -image.jpg && rm -- -image.jpg ; fi endif endif if ENABLE_PCX $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '=_pushdir_re=.(PNG)' $(top_srcdir)/media/numbers_pcx/ -kq; test $$? = 248 # _pushdir_re assignment is effective $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '=_pushdir_re=.(PCX)' $(top_srcdir)/media/numbers_pcx/ -kq # _pushdir_re assignment is effective $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_pushdir_re=".(PNG)"' $(top_srcdir)/media/numbers_pcx/ -kq # _pushdir_re assignment comes late and is not effective test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c '2,4 stdout "{}";q' | wc -l` = 3 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c '3;list "mark";6;list "mark"; 1,2 stdout "marked {}";q' | grep 'marked.*[01].pcx' | wc -l` = 2 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c '3;list "mark";6;list "mark"; toggleLimitMarked;1,2 stdout "marked {}";q' | grep 'marked.*[25].pcx' | wc -l` = 2 cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-file ../special/images.list -c 'if(_filelistlen!=2)quit 255; quit' if WANT_READ_STDIN_IMAGE cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin-elds '!' --read-from-file ../special/images.list -c 'if(_filelistlen!=0)quit 255; quit' cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin-elds '!' --read-from-file ../special/collated.list -c 'if(_filelistlen!=2)quit 255; quit' $(TIMEOUT_SMALL) $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-file ../special/collated-NON-EXISTING.list ; test $$? = 248 cat $(top_srcdir)/media/numbers_pcx/1.pcx | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin -c 'quit !(i:width>0 && i:height>0)' echo | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin -kq echo | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin ; test $$? = 248 echo $(top_srcdir)/media/numbers_pcx/* | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin --read-from-stdin-elds ' ' -c 'quit !(_filelistlen==9)' echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin ; test $$? = 33 echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin -Kq ; test $$? = 33 echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin -kq ; test $$? = 33 echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin -C 'quit 22' ; test $$? = 22 echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin -c 'quit 22' ; test $$? = 22 echo 'quit 33' | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --script-from-stdin -F 'quit 22' ; test $$? = 22 endif if ENABLE_ARCHIVE tar czf archive.tgz $(top_srcdir)/media/numbers_pcx/ && $(TIMEOUT_SMALL) $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb archive.tgz -c 'stdout i:pages." pages";if(i:pages==1)quit 255;quit' && rm -f archive.tgz echo 'not an archive' > archive.tgz; $(TIMEOUT_SMALL) $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb archive.tgz -c 'stdout i:pages." pages";if(i:pages!=0)quit 255;quit' && rm -f archive.tgz endif if WANT_READ_STDIN_IMAGE $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'pread "cat $(top_srcdir)/media/numbers_pcx/1.pcx"; reload' -c 'quit !(i:width>0 && i:height>0)' endif $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'cd "$(abs_srcdir)/media/numbers_pcx/1.pcx"; pwd;d1=_last_cmd_output; cd "-"; pwd;d2=_last_cmd_output; cd "$(abs_srcdir)/media/numbers_pcx/";pwd;d3=_last_cmd_output; if(d1!=d3||d1==d2)quit 1;quit' $(SNTZ) # check that "cd file" works $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_file_loader="ppm"' $(top_srcdir)/media/numbers_pcx/1.pcx -c 'stdout i:width; stdout (i:width!=0 && i:height!=0);quit' $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_file_loader="pcx"' $(top_srcdir)/media/numbers_pcx/1.pcx -c 'stdout i:width; stdout (i:width==0 && i:height==0);quit' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --mark-from-image-descriptions-file $(top_srcdir)/media/special/images.desc -c 'l=_filelistlen;toggleLimitMarked;if(_filelistlen!=l/2)quit 255; quit' $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-descriptions-file-separator $$'\t' $(top_srcdir)/media/special/loadable.desc $(top_srcdir)/media/numbers_pcx/ -c '/2.pcx;if(i:_comment=~"due")quit;quit 255' $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-descriptions-file-separator '?' $(top_srcdir)/media/special/loadable.desc $(top_srcdir)/media/numbers_pcx/ -c '/2.pcx;if(i:_comment=~"due")quit 255;quit' $(FIM_EXE) $(FIMNORCOPTS) -o dumb -C 'cd "$(top_srcdir)"' $(top_srcdir)/media/special/dir.desc -c 'quit !(_filelistlen==2)' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --image-descriptions-file-separator $$'\t' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/2.pcx;if(i:_comment=~"due")quit;quit 255' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --image-descriptions-file-separator '?' --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/2.pcx;if(i:_comment=~"due")quit 255;quit' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/1.pcx;if(i:prime=="no")quit 255;quit;' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/4.pcx;if(i:prime=="yes")quit 255;quit;' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/2.pcx;if(i:_comment!="due")quit 255;quit;' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/4.pcx;quit (i:_comment)'; test $$? = 44 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c '/0.pcx;quit (i:_comment)' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c 'list "vars"; if(! _last_cmd_output =~ "vals.*files") quit 255;;quit;' rm -f "tmp.desc"; # in view of append test $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -c 'desc "load" "$(top_srcdir)/media/special/images.desc"; desc "reload" "$(top_srcdir)/media/special/images.desc"; desc "-nooverw" "save" "tmp.desc"; quit;' && test `wc -w < tmp.desc` = 15 && rm tmp.desc # need proper 'reload' test $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -c 'desc "load" "$(top_srcdir)/media/special/images.desc" "\t"; desc "reload" "$(top_srcdir)/media/special/images.desc" "\t"; desc "-nooverw" "save" "tmp.desc" "X"; quit;' && test `grep X tmp.desc | wc -w` = 10 # need proper 'load' with separator test $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -c 'desc "load" "$(top_srcdir)/media/special/images.desc" "\t"; desc "reload" "$(top_srcdir)/media/special/images.desc" "\t"; desc "-append" "save" "tmp.desc" "X"; quit;' && test `grep X tmp.desc | wc -w` = 20 && rm tmp.desc # need proper 'load' with separator test if WANT_RECURSIVE_DIRS if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-shadow-directory $(top_srcdir)/media/../ -c 'scale "shadow"; if (_last_cmd_output =~ "image substituted")quit 0; else quit 255;'; fi if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-shadow-directory $(top_srcdir)/var/ -c 'scale "shadow"; if (_last_cmd_output =~ "image substituted")quit 0; else quit 255;'; test $$? = 255; fi endif $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -k n -k q -K n -K n -K q -F 'stdout _fileindex;if(_fileindex!=2){quit 255}quit' # -k executes before -K $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -K n -K q -k n -k n -k q -F 'stdout _fileindex;if(_fileindex!=3){quit 255}quit' # -k executes before -K $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -k n -K n -K n -k q -K q -F 'stdout _fileindex;if(_fileindex!=2){quit 255}quit' # -k executes before -K $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -K n -k n -k n -K q -k q -F 'stdout _fileindex;if(_fileindex!=3){quit 255}quit' # -k executes before -K $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -/ media/numbers_pcx/4.pcx -c 'stdout _fileindex;if(_fileindex!=0){quit 255}quit' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -/ 4.pcx -c 'stdout _fileindex;if(_fileindex!=5){quit 255}quit' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* --/ media/numbers_pcx/4.pcx -c 'stdout _fileindex;if(_fileindex!=0){quit 255}quit' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* --/ 4.pcx -c 'stdout _fileindex;if(_fileindex!=5){quit 255}quit' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* --// media/numbers_pcx/4.___ -c 'stdout _fileindex;if(_fileindex!=0){quit 255}quit' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* --// media/numbers_pcx/4.pcx -c 'stdout _fileindex;if(_fileindex!=5){quit 255}quit' endif if ENABLE_JPEG if WANT_READ_STDIN_IMAGE test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'stdout i:width.i:height; eval "quit"' -i < $(top_srcdir)/media/image.jpg $(SNTZ) | tail -1` != "00" # mostly coverage endif $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.jpg -C '_downscale_huge_at_load=-1' -= -c 'pan "0%" "100%"' -cq # pan_to; TODO: test properly $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.jpg -C '_downscale_huge_at_load=-1' -K++++ -c 'flip;mirror;pan_left;pan_right;pan_up;pan_down;pan_ne;pan_sw;pan_se;pan_nw "100%"' -c 'popen "echo quit"' # mostly coverage endif $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o non-existing-reverting-to-dumb-without-error -Kq if ENABLE_GIF test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 2:6 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 000 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 2:7 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 2:1K $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 2+4 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 000 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 2+5 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 0 $(top_srcdir)/media/icon_smile.gif -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 6 $(top_srcdir)/media/icon_smile.gif -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 000 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 6:1000 $(top_srcdir)/media/icon_smile.gif -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' | grep -v Reading $(SNTZ)` = 000 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 7 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 6 $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 000 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_seek_magic="gif"' $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' | tr -d '\n' | tr ' ' _ $(SNTZ)` = 000 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -C '_seek_magic="GIF"' $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 8 -C '_seek_magic="GIF"' $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 000 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb --offset 6 -C '_seek_magic="GIF"' $(top_srcdir)/media/special/icon_smile_gif_at_7.bin -c 'stdout (i:width!=0).(i:height!=0)._last_file_loader;quit' $(SNTZ)` = 11'libungif' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_interlaced.gif -c 'quit !(i:width!=0)' # interlaced gif $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_truncated_bad.gif.bin -c 'quit !(i:width==0)' # deliberately invalid gif endif if ENABLE_MATRIX_MARKET_DECODER test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/matrix.mtx -c 'stdout i:rows.i:columns.i:nnz._last_file_loader;quit' $(SNTZ)` = 222MatrixMarket; endif test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c '_max_cached_images=1;stdout _fileindex;quit;' --no-stat-push a/b.png c/d.png e/f.png $(SNTZ)` = 1 if ENABLE_JPEG if ENABLE_PCX $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/[0-4].pcx $(top_srcdir)/media/special/truncated_bad.jpg.bin $(top_srcdir)/media/numbers_pcx/[5-9].pcx -Knnnnnq -F 'if(_fileindex!=6)quit 6;quit' # fim handles broken jpeg files graciously endif endif if ENABLE_PNG $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/truncated_bad.png.bin -c 'quit'; test $$? = 134 # deliberately invalid png: reminder that need start to use png_set_error_fn $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_gray.png -c 'quit'; # just coverage so far endif $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit' --slideshow 0 -1 # if this does not hang is good if which timeout; then \ timeout 2 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit' --slideshow 0 ; R=$$?; \ if which reset ; then reset; fi; \ test $$R = 124; \ fi; $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit 0; quit 1;' -F 'quit 2; quit 3'; test "$$?" = 2 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -C 'quit 0; quit 1;' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit 0; quit 1;' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit 3'; test "$$?" = 3 $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit 2' -F 'quit 0; quit 1;' for r in 0 1 2 254 255 ; do $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c "quit $$r" || test $$? = $$r ; done ; for r in 0 1 2 254 255 ; do $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -C "quit $$r" || test $$? = $$r ; done ; for r in 0 1 2 254 255 ; do $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'quit' -F "quit $$r" || test $$? = $$r ; done ; if ENABLE_SDL if ENABLE_PCX if test -n "$(DISPLAY)"; then \ $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl --resolution w $(top_srcdir)/media/numbers_pcx/ -R -q -a -c 'display "reinit" "w200:200"' -c 'quit (i:swidth!=_screen_height) || (i:swidth!=_screen_width)'; # pcx needs no library\ fi if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl=17x17 -A $(top_srcdir)/media/numbers_pcx/1.pcx -q -c 'quit !(_autotop==1)'; fi # --autotop if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl=17x17 -P $(top_srcdir)/media/numbers_pcx/1.pcx -q -c 'quit (_autotop!=1) || (i:swidth!=_screen_width)'; fi # --text-reading if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl=17x17 $(top_srcdir)/media/numbers_pcx/1.pcx -q -c 'quit (_autotop!=1) || (i:swidth!=_screen_width)'; test $$? = 1; fi # --text-reading if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl=17:16 -q -P $(top_srcdir)/media/numbers_pcx/?.pcx -c 'align "info";a1=_last_cmd_output; scroll "forward";align "info";a2=_last_cmd_output; next; align "info";a3= _last_cmd_output; goto _lastfileindex; align "info";a4=_last_cmd_output; quit !(a1==a3 && a2==a4 && a1!=a2)' -kq ; fi # --text-reading if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o sdl=17:16 -q $(top_srcdir)/media/numbers_pcx/?.pcx -c 'align "info";a1=_last_cmd_output; scroll "forward";align "info";a2=_last_cmd_output; next; align "info";a3= _last_cmd_output; goto _lastfileindex; align "info";a4=_last_cmd_output; quit !(a1==a3 && a2==a4 && a1==a2)' -kq ; fi # --text-reading endif endif if ENABLE_GIF $(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep gif $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/icon_smile.gif -c 'rotate 10' -c quit test "`$(FIM_EXE) $(FIMNORCOPTS) -o dumb -R $(top_srcdir)/media/numbers/ -k 1 -k n -k 1 -k n -k q -F 'stdout _fileindex' $(SNTZ)`" = 3 # 3 and not 11 # note: need only supported files along the path to pass endif top_srcdir=$(top_srcdir) FIMNORCOPTS="$(FIMNORCOPTS)" $(SHELL) $(top_srcdir)/scripts/tests/version.sh top_srcdir=$(top_srcdir) FIMNORCOPTS="$(FIMNORCOPTS)" $(SHELL) $(top_srcdir)/scripts/tests/font.sh $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'font; font "load" "non_existing"; font "next"; font "scan"; font "info"; font "prev"; quit'; true; # TODO: test more than tis mere coverage (btw, this one leaks, and in debug or asan mode fails) -- FIXME) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media -c '_caption_over_image=3;display;quit;' $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -c 'quit;' $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X --execute-script $(top_srcdir)/scripts/example/oneline.fim -c quit $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -X --execute-script $(top_srcdir)/scripts/example/quit_23.fim -kq; test $$? = 23; # quit in script possible if WANT_DEFAULT_FIMRC $(FIM_EXE) --no-history --no-rc-file $(top_srcdir)/media/ -o dumb -X --etc-fimrc $(top_srcdir)/scripts/example/quit_23.fim -kq; test $$? = 23; # quit at init possible test `$(FIM_EXE) --no-history --no-rc-file $(top_srcdir)/media/ -o dumb -X --etc-fimrc $(top_srcdir)/scripts/example/set_var.fim -c 'stdout variable;quit' $(SNTZ)` = value # note: --no-rc-file and --etc-fimrc are incompatible else $(FIM_EXE) --no-history --no-rc-file $(top_srcdir)/media/ -o dumb -X --etc-fimrc $(top_srcdir)/scripts/example/quit_23.fim -kq; # etc-fimrc quietly ignored endif test `$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -X --etc-fimrc $(top_srcdir)/scripts/example/set_var.fim -c 'stdout variable;quit' $(SNTZ)` = '0' # note: --no-rc-file and --etc-fimrc are incompatible $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -X --no-internal-config -c 'width;quit !(i:width == 0)' if WANT_READLINE $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb --no-commandline -K ':quit 10' # quits at second char rm -f record.fim; $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -W record.fim -K ':quit 10' -K ''; grep -q quit.10 record.fim && rm record.fim endif if ENABLE_HISTORY $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb --no-history --no-history-load --no-history-save -kq # FIXME: bogus test rm -f .fim_history && HOME=`pwd` $(FIM_EXE) -N --no-etc-fimrc-file $(top_srcdir)/media/ -o dumb -C 'next;next' -c quit && grep -q '^next;next' .fim_history && rm .fim_history # note: history file may contain spaces newlines etc else rm -f .fim_history && HOME=`pwd` $(FIM_EXE) -N --no-etc-fimrc-file $(top_srcdir)/media/ -o dumb -C 'next;' -c quit && test -n .fim_history endif if ENABLE_PNG $(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep png $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/image.png -c 'next' -c quit # leak fixed if WITH_INKSCAPE $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/sample.svg -c 'quit !(i:width>0 && i:height>0)' # endif endif if ENABLE_TIFF if $(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep tiff && which convert ; then \ convert $(top_srcdir)/media/image.png $(top_srcdir)/image.tiff && \ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/image.tiff -c 'next' -c quit; fi # leak fixed $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/ -c 'echo i:*' -k Tab -c quit # bogus test: should rather exercise MiniConsole if which convert ; then \ convert $(top_srcdir)/media/numbers_pcx/*.pcx $(top_srcdir)/image.tiff && \ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/image.tiff -c 'quit !(i:pages == 10)'; fi # multipage code in Image and load rm -f $(top_srcdir)/image.tiff $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_gray.tiff -c 'i:width;quit !(i:width!=0)' # convert media/numbers/0.gif -grayscale average media/special/0_gray.tiff $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_rgba.tiff -c 'i:width;quit !(i:width!=0)' # convert media/numbers/0.gif -alpha transparent -depth 4 media/special/0_rgba.tiff $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_monochrome_white_polarity.tiff -c 'i:width;quit !(i:width!=0)' # convert media/numbers/0.gif -monochrome -define quantum:polarity=min-is-white -depth 1 media/special/0_monochrome_white_polarity.tiff $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/special/0_16bps_msb.tiff -c 'i:width;quit !(i:width!=0)' # convert media/numbers/0.gif -depth 16 -colorspace srgb -define tiff:endian=msb media/special/0_16bps_msb.tiff endif if ENABLE_JPEG $(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep jpeg if which wrjpgcom; then wrjpgcom -replace -comment 'add JPEG comment' $(top_srcdir)/media/image.jpg > image_commented.jpg && $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X image_commented.jpg -c quit && rm -f image_commented.jpg; fi # leak fixed if which convert && which exiftool; then \ convert $(top_srcdir)/media/icon_smile.gif $(top_srcdir)/media/icon_smile.jpg && \ exiftool -exif:iso=42 -overwrite_original_in_place $(top_srcdir)/media/icon_smile.jpg && \ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.jpg -c quit && \ rm -f $(top_srcdir)/media/icon_smile.jpg ; \ fi # only cover test exif cp $(top_srcdir)/media/image.jpg $(abs_srcdir)/media/upc_abs.JPG && $(FIM_EXE) $(FIMNORCOPTS) -o dumb --no-stat-push $(abs_srcdir)/media/upc_abs.JPG -c 'quit !(i:width>0 && i:height>0)' && rm -f $(abs_srcdir)/media/upc_abs.JPG # not really jpg-specific, exploits regexps & co endif if ENABLE_POPPLER if which epstopdf && which epstopdf; then \ epstopdf $(top_srcdir)/media/special/postscript.eps && \ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/special/postscript.pdf -c 'quit !(i:width>0 && i:height>0)' ; fi # libpoppler endif if ENABLE_PS $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/special/postscript.eps -c 'quit !(i:width>0 && i:height>0)' $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -C '_downscale_huge_at_load=-1;_preferred_rendering_dpi=100' $(top_srcdir)/media/special/postscript.eps -c 'quit !(i:width>0 && i:height>0)' test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -C '_downscale_huge_at_load=-1;_preferred_rendering_dpi=100' $(top_srcdir)/media/special/postscript.eps -c 'stdout i:width;quit'` -lt `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -C '_downscale_huge_at_load=-1;_preferred_rendering_dpi=200' $(top_srcdir)/media/special/postscript.eps -c 'stdout i:width;quit'` endif if ENABLE_PNG $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'info;stdout _last_cmd_output;quit' | grep 'media.*KB' # cover info $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/image.png -c '/*.jpg' -c quit # parser leak fixed endif $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -c 'identifier /*path...' -k q # parser leak fixed with destructor lines in yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -hs -h | grep h.s -q test `$(FIM_EXE) $(FIMNORCOPTS) --help | wc -c` -eq `$(FIM_EXE) $(FIMNORCOPTS) --help=s | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) --help=s | wc -l` -eq `$(FIM_EXE) $(FIMNORCOPTS) --help=d | wc -l` test `$(FIM_EXE) $(FIMNORCOPTS) --help=s | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=d | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) --help=d | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=l | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) --help=l | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=m | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) --help=l | wc -l` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=m | wc -l` test `$(FIM_EXE) $(FIMNORCOPTS) --help _last_cmd_output | wc -l` = 5 test `$(FIM_EXE) $(FIMNORCOPTS) --help _LAST_CMD_OUTPUT | wc -l` = 2 test `$(FIM_EXE) $(FIMNORCOPTS) --help A | wc -l` = 4 test `$(FIM_EXE) $(FIMNORCOPTS) -hs -h | wc -l` = 2 test `$(FIM_EXE) $(FIMNORCOPTS) -hd -h | wc -l` = 2 test `$(FIM_EXE) $(FIMNORCOPTS) -hl -h | wc -l` = 3 test `$(FIM_EXE) $(FIMNORCOPTS) -hm -h | wc -l` = 3 test `$(FIM_EXE) $(FIMNORCOPTS) -hs -h | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) -hd -h | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) -h -R | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) -h -R -R | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) -hs -R | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) -hd -R | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) -hd -R | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) -hl -R | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) -hl -R | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) -hm -R | wc -c` if WANT_READ_STDIN_IMAGE test `$(FIM_EXE) $(FIMNORCOPTS) --help --read-from-stdin | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help --read-from-stdin --read-from-stdin | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) --help=s --read-from-stdin | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=d --read-from-stdin | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) --help=d --read-from-stdin | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=l --read-from-stdin | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) --help=l --read-from-stdin | wc -c` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=m --read-from-stdin | wc -c` test `$(FIM_EXE) $(FIMNORCOPTS) --help=l --read-from-stdin | wc -l` -lt `$(FIM_EXE) $(FIMNORCOPTS) --help=m --read-from-stdin | wc -l` endif # if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb --background-recursive -B . -kK -kq -F 'if(_filelistlen==1)quit 255'; fi # -kK triggers a yield (often, not always) # if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb --background-recursive -B . -kq -F 'if(_filelistlen!=1)quit 255'; fi # no -kK -> no background images in batch mode (often, not always) if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb --background-recursive -B $(top_srcdir)/ -kn -kq -F 'if(_filelistlen< 1)quit 255'; fi # difficult to write a reliable test for -B, but -kn can help a bit with timing test `$(FIM_EXE) $(FIMNORCOPTS) --help /a /q | wc -c` -gt 900 test `$(FIM_EXE) $(FIMNORCOPTS) --help help magnify _TERM jfngjfngjfn | wc -c` -gt 500 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'dump_key_codes; stdout _last_cmd_output; quit' | wc -c` -gt 1000 test `$(FIM_EXE) $(FIMNORCOPTS) --dump-reference-help | wc -c` -gt 30000 test `$(FIM_EXE) $(FIMNORCOPTS) --dump-reference-help | wc -c` -lt 60000 test `$(FIM_EXE) $(FIMNORCOPTS) --dump-reference-help=man | wc -c` -gt 60000 test `$(FIM_EXE) $(FIMNORCOPTS) --dump-default-fimrc | wc -c` -gt 15000 $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'exec "src/fimrc"; echo; stdout; pwd; status "status" unalias' -c quit #; cover test misc corner cases (note: no functionality check here) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'autocmd; autocmd "PostDisplay";autocmd "PostDisplay" "pattern";autocmd "1" "2" "toomuch"' -c quit #; cover test misc corner cases (note: no functionality check here) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'autocmd_del; autocmd_del "PostDisplay";autocmd_del "PostDisplay" "pattern";autocmd_del "1" "2" "3";autocmd_del "1" "2" "3" "4"' -c quit #; cover test misc corner cases (note: no functionality check here) $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'alias "a" "quit 11"; unalias "a"; alias "a" "quit 23"; a; quit 13' -c quit ; test $$? = 23 $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'alias "a" "quit 23"; unalias "-a"; a; quit 13' -c quit ; test $$? = 13 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'unalias; stdout _last_cmd_output; unalias "NotExistent"; stdout _last_cmd_output;quit' | sed 's/unalias.*$$/Un/g' | tr -d '\n' $(SNTZ)` = UnUn test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c "bind 'F1' 'stdout 1';_max_iterated_commands=2;" -k 10F1 -k q | tr -d '\n' $(SNTZ)` = 11 # test binding repeat and F1 binding test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c "bind 'F1' 'stdout 1';_max_iterated_commands=1;" -k 10F1 -k q | tr -d '\n' $(SNTZ)` = 1 # test binding repeat and F1 binding test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c "bind 'F1' 'stdout 1';_max_iterated_commands=0;" -k 10F1 -k q | tr -d '\n' $(SNTZ)` = 1111111111 # test binding repeat and F1 binding if WANT_READLINE if ENABLE_GIF cp -p $(top_srcdir)/media/icon_smile.gif $(top_srcdir)/media/icon_smile.pgm cp -p $(top_srcdir)/media/icon_smile.gif $(top_srcdir)/media/icon_smile.ppm $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.pgm $(top_srcdir)/media/icon_smile.ppm -K /smile.ppm -K '' -K q -F 'quit !(_fileindex==2);' # test slash search $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.pgm $(top_srcdir)/media/icon_smile.ppm -K /smole.ppm -K '' -K q -F 'quit !(_fileindex==0);' # test slash search $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.pgm $(top_srcdir)/media/icon_smile.ppm -c "goto '?$(top_srcdir)/media/icon_smile.ppm'" -K '' -K q -F 'quit !(_fileindex==2);' # test goto query rm $(top_srcdir)/media/icon_smile.pgm $(top_srcdir)/media/icon_smile.ppm endif endif test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'v=1; bind "_" "recording;stdout _last_cmd_output;"; bind "S" "recording \"start\""' -K _S_rQ_E_q -F 'stdout i:_orientation' | wc -w ` -gt 70 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'v=1; bind "_" "recording; "; bind "S" "recording \"start\""' -K _S_rQ_E_q -F 'stdout i:_orientation' | wc -w ` -lt 70 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'v=1; bind "_" "recording;stdout _last_cmd_output;"; bind "S" "recording \"start\""' -K _S_rQ_E_q -F 'stdout i:_orientation' | grep ^.$$ | tr -d '\n' $(SNTZ)` = 2 test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -C 'v=1; bind "_" "recording;stdout _last_cmd_output;"; bind "S" "recording \"start\""' -K _S_rQ_E_q -F 'stdout i:_orientation' | grep ^.$$ | tr -d '\n' $(SNTZ)` = 1 if ENABLE_GIF test "`$(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers/* -K 2n.q -F 'stdout i:_filename;' $(SNTZ)`" = $(top_srcdir)/media/numbers/3.gif endif test "`$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'stderr; stdout; quit' 2>&1 > /dev/null | grep echo`" = "echo command" # stdout vs stderr test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'stderr "out:due";stdout "out:uno";quit' 2>&1 > /dev/null | grep out $(SNTZ)` = "out:due" # stdout vs stderr if WANT_READLINE test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -C set_commandline_mode -K 'stdout "cli"; quit;' -K '' $(SNTZ)` = cli endif test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'set; stdout _last_cmd_output; quit' | wc -w` -ge 50 # test set test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'set "_TERM"; stdout _last_cmd_output; quit' | wc -w` -eq 1 # test set test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'set "_TERM" "WhatWhat"; stdout _last_cmd_output; set 1 2 3 ; stdout _last_cmd_output; quit' | sed "s/set.*$$/Set/g" | tr -d '\n' $(SNTZ)` = WhatWhatSetSetSet $(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'unbind; unbind "?"; bind "~"; bind "n"; bind "n" ""' -c quit $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/ -c 'color "desaturate";color "negate";color "identity";color "colorblind" "daltonize";color "deuteranopia" "daltonize";color "protanopia" "daltonize";color "tritanopia" "daltonize";color "colorblind"' -c quit # only cover test if which timeout; then if ! timeout 2 $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -c '/media' -c 'quit' ; then echo 'Seems like -c "/" is broken!'; false; fi; fi $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -c 'quit 14' ; if test $$? = 14 ; then echo '[*] Error code return test PASSED' ; else echo 'Error code return test FAILED'; false ; fi # $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c 'a=../' -k q # TODO: test missing. for lex.lex $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c 'a=./' -k q # TODO: test missing. for lex.lex $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c $$'\b' -k q # TODO: test missing. for lex.lex $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c 'stdout 0100' -k q # TODO: test missing. for lex.lex $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c 'stdout 0x10' -k q # TODO: test missing. for lex.lex $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c 'quit' -F '|' # TODO: test missing. for lex.lex $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/image.png -c 'i=3;do { i=i-1; stdout i; } while (i>=1) stdout "ok";quit i;' # seldom used language feats (TODO): this is buggy anyways..) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c '-1;stdout _fileindex;quit!(_fileindex==10);' # FIXME $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c '-3;stdout _fileindex;quit!(_fileindex==8);' $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/?.pcx -c ' 0;stdout _fileindex;quit!(_fileindex==0);' test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/-.pcx -c '3 stdout "y"; quit ((2+2)%(1+1))' | tr -d '\n' $(SNTZ)` = yyy # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '+"30.0"%;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '+ 30.0% ;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '*"30.0" ;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '* 30.0 ;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c ' "30.0"%;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '30.0 %;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '-"30.0"%;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '- 30.0% ;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '"30.0"%;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c ' 30.0 %;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '1,2a;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '1z;quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c 'stdout exce.ption' -k q # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/0.pcx -c '{1;;;}quit' # FIXME: add actual test # stress yacc.ypp $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'cache; quit ! ( _want_prefetch && _cache_status =~ "count:1/5")' # on all loadable files $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'prefetch; cache; quit ! ( _want_prefetch && _cache_status =~ "count:3/5")' # on all loadable files if ENABLE_PNG $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale ; w2=i:swidth; quit !(w1==w2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "Z" ; w2=i:swidth; quit !(w1==w2)' # Z is unknown $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "H" ; w2=i:swidth; quit !(w1!=w2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale ">" ; w2=i:swidth; quit !(2*w1==w2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "<" ; w2=i:swidth; quit !(w1/2==w2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "*0.5"; w2=i:swidth; quit !(w1/2==w2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "*0" ; w2=i:swidth; quit !(w1 < w2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "+" ; w2=i:swidth; quit !(w1 < w2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'm1=_magnify_factor;scale "++"; m2=_magnify_factor;quit !(m1 < m2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'm1=_magnify_factor;scale "+-"; m2=_magnify_factor;quit !(m1 > m2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'r1=_reduce_factor;scale "++"; r2=_reduce_factor; quit !(r1 < r2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'r1=_reduce_factor;scale "+-"; r2=_reduce_factor; quit !(r1 > r2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'm1=_magnify_factor;scale "+*"; m2=_magnify_factor;quit !(m1 < m2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'm1=_magnify_factor;scale "+/"; m2=_magnify_factor;quit !(m1 > m2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'r1=_reduce_factor;scale "+*"; r2=_reduce_factor; quit !(r1 < r2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'r1=_reduce_factor;scale "+/"; r2=_reduce_factor; quit !(r1 > r2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-0" ; w2=i:swidth; quit !(w1==w2)' # cover $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "0" ; w2=i:swidth; quit !(w1==w2)' # cover $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "*" ; w2=i:swidth; quit !(w1==w2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "+" ; w2=i:swidth; quit !(w1 < w2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-" ; w2=i:swidth; quit !(w1 > w2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-0.5"; w2=i:swidth; quit !(w1 > w2)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-10%"; w2=i:swidth; quit !(w1 > w2)' endif if $(FIM_EXE) --help crop | grep -q is.a.command; then make croptests; fi if ENABLE_AA @make aatests endif if ENABLE_CACA @make cacatests endif if ENABLE_FRAMEBUFFER @if test -z "$(DISPLAY)$(SSH_TTY)" -a -w "/dev/fb0"; then make fbtests; fi endif if ENABLE_IMLIB2 @make imlib2tests endif if ENABLE_SDL @if test -n "$(DISPLAY)"; then make sdltests; fi endif if HAVE_FIMGS make fimgstests endif make ltests @echo "[*] TESTS: SUCCESS" else @echo "[!] TESTS: Skipped (you are cross-compiling, aren't you?)" endif .PHONY: croptests croptests: if ENABLE_GIF $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;_crop_once="0 0 10 10";crop;w2=i:width;quit !(w1+w2==25)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;crop ;w2=i:width;quit !(w1+w2==22)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;crop 10 ;w2=i:width;quit !(w1+w2==16)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;crop 40 40 60 60;w2=i:width;quit !(w1+w2==18)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;crop 25 25 ;w2=i:width;quit !(w1+w2==18)' $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/icon_smile.gif $(FIMSCLTSTOPTS) -c 'w1=i:width;crop 50 50 ;w2=i:width;quit !(w1+w2==22)' endif .PHONY: ltests ltests: if ENABLE_JPEG $(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep jpeg if test $(abs_builddir) = $(abs_srcdir) ; then make -C src/testdir ; else echo "out-of-dir? skipping ltests..." ; fi endif .PHONY: fimgstests fimgstests: $(FIMGS_EXE) --help -- $(FIMNORCOPTS) >/dev/null 2>&1 ; echo $$? = 255 # no fimgs --help option yet test `$(FIMGS_EXE) -h -- $(FIMNORCOPTS) | wc -l` -gt 14 test `$(FIMGS_EXE) -m -- $(FIMNORCOPTS) | wc -w` -gt 53 if HAVE_FIMGS $(FIMGS_EXE) -- $(FIMNORCOPTS) -o dumb ./media/special/postscript.eps -c 'stdout _last_file_loader;quit 1' -K quit; test $$? = 0 # spaces not accepted by fimgs endif if ENABLE_PCX if which tar ; then $(FIMGS_EXE) $(top_srcdir)/media/special/numbers_pcx.tar -- $(FIMNORCOPTS) -o dumb -c 'quit !(_last_file_loader=="pcx")' ; fi if which tar && which bunzip2 ; then $(FIMGS_EXE) $(top_srcdir)/media/special/numbers_pcx.tar.bz2 -- $(FIMNORCOPTS) -o dumb -c 'quit !(_last_file_loader=="pcx")' ; fi if which tar && which gunzip ; then $(FIMGS_EXE) $(top_srcdir)/media/special/numbers_pcx.tar.gz -- $(FIMNORCOPTS) -o dumb -c 'quit !(_last_file_loader=="pcx")' ; fi if which tar && which unxz ; then $(FIMGS_EXE) $(top_srcdir)/media/special/numbers_pcx.tar.xz -- $(FIMNORCOPTS) -o dumb -c 'quit !(_last_file_loader=="pcx")' ; fi endif FIMSCRIPTSDIR=`pwd`/scripts/maintenance/ # new target, still not working .PHONY: tests-all tests-all: tests cd src && which cppcheck && cppcheck *cpp *.h || true $(SHELL) $(FIMSCRIPTSDIR)/configure-brute-check.sh #news-dump: # $(AWK) -- 'v=0;($$1 == "Version" && $$2=="'`cat VERSION`'"){while((input=getline) && $$1!="Version"){print}};' NEWS > f # this rule is deprecated, too .PHONY: test test: all @$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/* #~/M*s/*g # this rule is old and deprecated #tgz: clean # tar -czf ../fim.`date +%Y%m%d%H%M`.tgz ../fim/* # ls -l ../fim*.tgz -v # this rule is encouraged .PHONY: report report: @cat VERSION @echo '-' @$(LEX) -V 2>&1 @echo '-' @$(YACC) -V 2>&1 @echo '-' @$(CC) -v 2>&1 @echo '-' @echo 'now please report the bug with this information to the author via email' ; # this rule is redundant .PHONY: exec exec: test # this rule is smart, isn't it ? I love it ! .PHONY: edit edit: $(EDITOR) $(srcdir)/fim.cpp +':split $(srcdir)/fim.h' # Vim ! :) .PHONY: @true # this rule is informative and for acting like a peacock .PHONY: wc wc: wc $(srcdir)/*.cpp $(srcdir)/*.h $(srcdir)/yacc.ypp $(srcdir)/lex.lex @#wc $(FIM) # missing headers.. .PHONY: devhelp devhelp: @echo ----------------------------------------------- @echo ' short Makefile dev help' @echo ----------------------------------------------- @echo @echo 'make uptrunk' will upload trunk tarballs to @echo http://download.savannah.nongnu.org/releases/fbi-improved/ @echo @make help .PHONY: help help: @echo ----------------------------------------------- @echo ' short Makefile help' @echo ----------------------------------------------- @echo @echo 'Please read the documentation file before complaining!' @echo @echo 'The first documentation file you should read is README' @echo @echo 'If you are experiencing problems, please contact the code author.' @echo @echo 'His mail box resides as dezperado, then a dot, then autistici dot org.' @echo @echo 'You are encouraged attaching the output of `make report` in your bug reports.' @echo 'Thanks for your collaboration.' @echo .PHONY: ai ai: $(distdir).tar.gz.sig $(distdir).tar.gz $(distdir).tar.bz2.sig $(distdir).tar.bz2 make up -C var/ .PHONY: up up: upload news .PHONY: news news: freshmeat mail-announce .PHONY: dox dox: doc/fim.man doc/fimrc.man doc/fimgs.man MANSUBST = sed -e 's,@sysconfdir\@,$(sysconfdir),g' -e 's,@docdir\@,$(docdir),g' -e 's,-,\\-,g' doc/fim.man.in doc/fimrc.man.in: $(FIM_EXE) if HAVE_RUNNABLE_TESTS $(FIM_EXE) $(FIMNORCOPTS) --help=m > doc/fim.man.in $(FIM_EXE) $(FIMNORCOPTS) --dump-reference-help=man > doc/fimrc.man.in endif doc/fimgs.man.in: $(FIM_EXE) if HAVE_RUNNABLE_TESTS if HAVE_GS $(FIMGS_EXE) -m -- $(FIMNORCOPTS) > doc/fimgs.man.in endif endif doc/fim.man doc/fimrc.man doc/fimgs.man: doc/fim.man.in doc/fimrc.man.in doc/fimgs.man.in cat doc/fim.man.in |$(MANSUBST) > doc/fim.man cat doc/fimrc.man.in |$(MANSUBST) > doc/fimrc.man cat doc/fimgs.man.in |$(MANSUBST) > doc/fimgs.man # fixme : missing integration with ChangeLog file .PHONY: mail-announce mail-announce: @ figlet fim | mutt -s "fim-`cat VERSION` release" "fbi-improved-devel@nongnu.org" -i - .PHONY: log log: changelog # from trunk, we should call svn2cl .. to get the full fim changelog history .PHONY: changelog changelog: svn2cl -i .. .PHONY: release release: make signed-dist make uptrunk make -C var all make -C var ci #release: upload freshmeat .PHONY: upload upload: savannah .PHONY: uptrunk uptrunk: read && scp $(distdir).tar.gz.sig $(distdir).tar.gz $(distdir).tar.bz2.sig $(distdir).tar.bz2 dezperado@dl.sv.nongnu.org:/releases/fbi-improved/ # echo -en "cd /releases/fbi-improved\nput $(distdir).tar.gz.sig\n put fim-${fim_cv_version}.tar.gz\n put fim-${fim_cv_version}.tar.bz2\n put fim-${fim_cv_version}.tar.bz2.sig" | sftp "dezperado@dl.sv.gnu.org" -b .PHONY: savannah_ savannah_: signed-dist grep trunk VERSION || echo do lynx -dump dl.sv.gnu.org/releases/fbi-improved .PHONY: savannah-lookup savannah-lookup: lynx -dump dl.sv.gnu.org/releases/fbi-improved # fixme : missing integration with ChangeLog file and such information .PHONY: freshmeat_old freshmeat_old: @ $(AWK) -- 'v=0;($$1 == "Version" && $$2=="'`cat VERSION`'"){while((input=getline) && $$1!="Version"){print}};' NEWS @echo freshmeat-submit -v "fbi-`cat VERSION`" \ --project fbi-improved \ --license GPL \ --mailing-list-url $$(cat README | grep "^Mailing List :"|sed s/^.*\ :.//g) \ --home-page-url $$(cat README | grep "^Web Page "|sed s/^.*\ :.//g) \ --cvs-url $$(cat README | grep "^Repository"|sed s/^.*\ :.//g) \ --gzipped-tar-url $$(cat README | grep "^Releases "|sed s/^.*\ :.//g)/"fim-`cat VERSION`".tar.gz \ --mirror-site-url $$(cat README | grep "^Off.*rror : "|sed s/^.*\ :.//g) \ --changelog-url $$(cat README | grep "^ChangeLog "|sed s/^.*\ :.//g) @ echo "are you sure ? (any key to abort, yes to continue)" && read yes && [[ "$${yes}" == "yes" ]] && \ $(AWK) -- 'v=0;($$1 == "Version" && $$2=="'`cat VERSION`'"){while((input=getline) && $$1!="Version"){print}};' NEWS | \ freshmeat-submit -v "fbi-`cat VERSION`" \ --project fbi-improved \ --license GPL \ --mailing-list-url $$(cat README | grep "^Mailing List :"|sed s/^.*\ :.//g) \ --home-page-url $$(cat README | grep "^Web Page "|sed s/^.*\ :.//g) \ --cvs-url $$(cat README | grep "^Repository"|sed s/^.*\ :.//g) \ --gzipped-tar-url $$(cat README | grep "^Releases "|sed s/^.*\ :.//g)/"fim-`cat VERSION`".tar.gz \ --mirror-site-url $$(cat README | grep "^Off.*rror : "|sed s/^.*\ :.//g) \ --changelog-url $$(cat README | grep "^ChangeLog "|sed s/^.*\ :.//g) # --url-demo $$(cat README | grep "^Web Page "|sed s/^.*:.//g) # --bzipped-tar-url $$(cat README | grep "^Web Page "|sed s/^.*:.//g) .PHONY: freshmeat-submit freshmeat-submit: @echo Project: fim @echo Version: `cat VERSION` @echo Release-Focus: Major feature enhancements @echo Hide: N @echo Home-Page-URL: $$(cat README | grep "^Web Page "|sed s/^.*\ :.//g) @echo Mailing-List-URL: $$(cat README | grep "^Mailing List :"|sed s/^.*\ :.//g) @echo Gzipped-Tar-URL: $$(cat README | grep "^Releases "|sed s/^.*\ :.//g)/"fim-`cat VERSION`".tar.gz @echo Bzipped-Tar-URL: $$(cat README | grep "^Releases "|sed s/^.*\ :.//g)/"fim-`cat VERSION`".tar.bz2 @echo License: GPL @echo Mirror-Site-URL: $$(cat README | grep "^Off.*rror : "|sed s/^.*\ :.//g) @echo ChangeLog-URL: $$(cat README | grep "^ChangeLog "|sed s/^.*\ :.//g) @echo CVS-URL: $$(cat README | grep "^Repository"|sed s/^.*\ :.//g) @echo @ $(AWK) -- 'v=0;($$1 == "Version" && $$2=="'`cat VERSION`'"){while((input=getline) && $$1!="Version"){print}};' NEWS .PHONY: freshmeat freshmeat: @ echo "are you sure you want to freshmeat-submit ? (any key to abort, yes to continue)" && read yes && [[ "$${yes}" == "yes" ]] && \ make freshmeat-submit | grep -v '^make\[' | freshmeat-submit .PHONY: commit commit: log svn commit # This awaits completion. #rpm: dist # rpmbuild -ta @PACKAGE@-@VERSION@.tar.gz NEWS: NEWS.in grep -v '^#' < $< > $@ README.md: README cp $< $@.tmp; $(GREP) '^ [0-9][.]\?[0-9]\? ' README | while read; do \ ID=$${REPLY/ - /}; \ ID=$${ID//, /-}; \ ID=$${ID// /-}; \ ID=$${ID//,/}; \ ID=$${ID,,}; \ ID=$${ID// /}; \ ID=$${ID// /}; \ ID=$${ID//(/}; \ ID=$${ID//)/}; \ ID=$${ID//:/}; \ ID=$${ID//./}; \ ID=$${ID//\//}; \ $(GREP) "^$${REPLY/ - /}" README -C0 | $(SED) "s/\(^$${REPLY/ - /}.*\)/## <\/a>\1 ##/g;s/$${REPLY}/[$${REPLY/ - /}]\(#$${ID}\)/g;" -i $@.tmp; done; $(SED) -i "s|doc.fim.man.html|$(WWW)/\#man_fim|g" $@.tmp; $(SED) -i "s|doc.fimrc.man.html|$(WWW)/\#man_fimrc|g" $@.tmp; $(SED) -i "s|^-===\+-$$||g" $@.tmp; $(SED) -i "s|^ FIM|FIM|g" $@.tmp; $(SED) -i "s|^================================================================================|--------------------------------------------------------------------------------|g" $@.tmp; $(GREP) -v '^\(.vim:\|..Id\)' $@.tmp > $@; rm $@.tmp fim-0.6-rc2/src/0000755000175000017500000000000014503655326010417 500000000000000fim-0.6-rc2/src/readline.h0000644000175000017500000000255114454347340012275 00000000000000/* $LastChangedDate: 2015-01-17 15:47:05 +0100 (Sat, 17 Jan 2015) $ */ /* readline.h : Code dealing with the GNU readline library. (c) 2008-2015 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_READLINE_H #define FIM_READLINE_H #include /* the GNU readline library */ #include /* the GNU readline library */ #include /* the GNU readline library */ #include "fim_types.h" namespace fim { fim_char_t* fim_readline(const fim_char_t *prompt); } namespace rl { void initialize_readline (fim_bool_t with_no_display_device, fim_bool_t wcs); int fim_search_rl_startup_hook(void); } #endif /* FIM_READLINE_H */ fim-0.6-rc2/src/common.h0000644000175000017500000001144414454347340012003 00000000000000/* $LastChangedDate: 2023-03-09 23:11:04 +0100 (Thu, 09 Mar 2023) $ */ /* common.h : Miscellaneous stuff header file (c) 2007-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_COMMON_H #define FIM_COMMON_H #include "fim_types.h" #if HAVE_FLEXLEXER_H #undef yyFlexLexer #include #endif /* HAVE_FLEXLEXER_H */ extern int fim_pipedesc[2]; #if HAVE_FLEXLEXER_H extern FlexLexer *lexer; //#define YYLEX lexer->yylex() #endif /* HAVE_FLEXLEXER_H */ namespace fim { class CommandConsole; class string; } int fim_isspace(int c); int fim_isquote(int c); fim::string fim_dirname(const fim::string& arg); fim::string fim_auto_quote(const fim::string& arg, int quoted=0); fim::string fim_shell_arg_escape(const fim::string& arg, bool quoted=true); fim::string fim_key_escape(const fim::string uk); fim::string fim_man_to_text(const fim::string ms); void fim_perror(const fim_char_t *s); //void fim_tolowers(fim_char_t *s); //void fim_touppers(fim_char_t *s); size_t fim_strlen(const fim_char_t *str); void trec(fim_char_t *str,const fim_char_t *f,const fim_char_t*t); //void trhex(fim_char_t *str); void chomp(fim_char_t *s); #if FIM_WANT_OBSOLETE void sanitize_string_from_nongraph(fim_char_t *s, int c=0); #endif /* FIM_WANT_OBSOLETE */ void sanitize_string_from_nongraph_except_newline(fim_char_t *s, int c=0); using namespace fim; int int2msbf(int in); #if FIM_WANT_OBSOLETE int int2lsbf(int in); #endif /* FIM_WANT_OBSOLETE */ fim::string slurp_file(fim::string filename); fim_char_t* slurp_binary_fd(int fd,int *rs); #if FIM_SHALL_BUFFER_STDIN fim_byte_t* slurp_binary_FD(FILE* fd, size_t *rs); #endif /* FIM_SHALL_BUFFER_STDIN */ bool write_to_file(fim::string filename, fim::string lines, bool append = false); fim_char_t * dupstr (const fim_char_t* s); fim_char_t * dupnstr (float n, const fim_char_t c='\0'); fim_char_t * dupnstr (const fim_char_t c1, double n, const fim_char_t c2='\0'); fim_char_t * dupnstr (fim_int n); fim_char_t * dupsqstr (const fim_char_t* s); fim_int fim_rand(void); bool regexp_match(const fim_char_t*s, const fim_char_t*r, int ignorecase=1, int ignorenewlines=0, int globexception=1); int lines_count(const fim_char_t*s, int cols); #if FIM_WANT_OBSOLETE int strchr_count(const fim_char_t*s, int c); int newlines_count(const fim_char_t*s); #endif /* FIM_WANT_OBSOLETE */ const fim_char_t* next_row(const fim_char_t*s, int cols); int fim_common_test(void); double getmicroseconds(void); double getmilliseconds(void); const fim_char_t * fim_getenv(const fim_char_t * name); FILE * fim_fread_tmpfile(FILE * fp); double fim_atof(const fim_char_t *nptr); ssize_t fim_getline(fim_char_t **lineptr, size_t *n, FILE *stream, int delim); bool is_dir(const fim::string nf); bool is_file(const fim::string nf); bool is_file_nonempty(const fim::string nf); FILE *fim_fopen(const char *path, const char *mode); int fim_fclose(FILE*fp); size_t fim_fread(void *ptr, size_t size, size_t nmemb, FILE *stream); int fim_rewind(FILE *stream); int fim_fseek(FILE *stream, long offset, int whence); int fim_fgetc(FILE *stream); int fim_snprintf_fim_int(char *r, fim_int n); int fim_snprintf_XB(char *str, size_t size, size_t q); fim_byte_t * fim_pm_alloc(unsigned int width, unsigned int height, bool want_calloc = false); const fim_char_t * fim_basename_of(const fim_char_t * s); fim::string fim_getcwd(void); fim_int fim_util_atoi_km2(const fim_char_t *nptr); fim_int fim_atoi(const char*s); size_t fim_maxrss(void); fim_bool_t fim_is_id(const char*s); fim_bool_t fim_is_id_char(const char c); /* exceptions */ typedef int FimException; #define FIM_E_NO_IMAGE 1 #define FIM_E_NO_VIEWPORT 2 #define FIM_E_WINDOW_ERROR 3 #define FIM_E_TRAGIC -1 /* no hope */ #define FIM_E_NO_MEM 4 /* also a return code */ /* ... */ #define FIM_CHAR_BIT 8 /* FIXME */ #define FIM_IS_SIGNED(T) (((T)0) > (((T)-1))) #define FIM_MAX_UNSIGNED(T) ((T)-1) #define FIM_HALF_MAX_SIGNED(T) ((T)1 << (sizeof(T)*FIM_CHAR_BIT-2)) #define FIM_MAX_SIGNED(T) (FIM_HALF_MAX_SIGNED(T) - 1 + FIM_HALF_MAX_SIGNED(T)) #define FIM_MAX_VALUE_FOR_TYPE(T) (FIM_IS_SIGNED(T)?FIM_MAX_SIGNED(T):FIM_MAX_UNSIGNED(T)) #define FIM_MAX_INT FIM_MAX_VALUE_FOR_TYPE(fim_int) #endif /* FIM_COMMON_H */ fim-0.6-rc2/src/DummyDisplayDevice.h0000644000175000017500000000636414454347340014261 00000000000000/* $LastChangedDate: 2022-10-08 00:22:10 +0200 (Sat, 08 Oct 2022) $ */ /* DummyDisplayDevice.h : virtual device Fim driver header file (c) 2008-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_DUMMYDISPLAY_DEVICE_H #define FIM_DUMMYDISPLAY_DEVICE_H #define FIM_DUMB_BUT_WITH_FONT 1 /* font support in DummyDisplayDevice is mostly for testing purposes */ class DummyDisplayDevice FIM_FINAL:public DisplayDevice { /* * The generalization of a Fim output device. */ public: virtual fim_err_t initialize(sym_keys_t &sym_keys){return FIM_ERR_NO_ERROR;} virtual void finalize(void){} virtual fim_err_t display( const void *ida_image_img, // source image structure fim_coo_t iroff,fim_coo_t icoff, // row and column offset of the first input pixel fim_coo_t irows,fim_coo_t icols,// rows and columns in the input image fim_coo_t icskip, // input columns to skip for each line fim_coo_t oroff,fim_coo_t ocoff,// row and column offset of the first output pixel fim_coo_t orows,fim_coo_t ocols,// rows and columns to draw in output buffer fim_coo_t ocskip,// output columns to skip for each line fim_flags_t flags// some flags ){return FIM_ERR_NO_ERROR;} #ifndef FIM_WANT_NO_OUTPUT_CONSOLE DummyDisplayDevice(MiniConsole& mc_):DisplayDevice(mc_) { #if FIM_DUMB_BUT_WITH_FONT FontServer::fb_text_init1(fontname_,&f_); // FIXME : move this outta here #endif /* FIM_DUMB_BUT_WITH_FONT */ } #else DummyDisplayDevice(void){} #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ virtual ~DummyDisplayDevice(void){} virtual fim_coo_t get_chars_per_line(void)const{return 0;/* this is a special value */} virtual fim_coo_t get_chars_per_column(void)const{return 0;/* */} virtual fim_coo_t width(void)const{return 1;/* 0 would be so cruel */} virtual fim_coo_t height(void)const{return 1;/* 0 would be so cruel */} virtual fim_err_t status_line(const fim_char_t *msg){return FIM_ERR_NO_ERROR;} virtual fim_err_t console_control(fim_cc_t code){return FIM_ERR_NO_ERROR;} virtual fim_bool_t handle_console_switch(void){return false;} virtual fim_err_t clear_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2){return FIM_ERR_NO_ERROR;} virtual fim_err_t fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t color){ return FIM_ERR_NO_ERROR; } fim_err_t fs_puts(struct fs_font *f, fim_coo_t x, fim_coo_t y, const fim_char_t *str){return FIM_ERR_NO_ERROR;} virtual fim_bpp_t get_bpp(void)const{return 0;/* 0 signifies non-graphical output */} virtual fim_coo_t status_line_height(void)const{return 0;} private: }; #endif /* FIM_DUMMYDISPLAY_DEVICE_H */ fim-0.6-rc2/src/fim_plugin.cpp0000644000175000017500000001135014454347340013173 00000000000000/* $LastChangedDate: 2017-07-07 23:19:21 +0200 (Fri, 07 Jul 2017) $ */ /* fim_plugin.cpp : Fim plugin stuff (c) 2011-2017 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* FIXME: this code is still at embryonic stage * to test the sample opencv 'plugin', shall include -I/usr/include/opencv and link to -lcv -lcvaux (OpenCV version 1 API) * e.g.: * http://opencv.itseez.com/modules/core/doc/old_basic_structures.html?highlight=iplimage#void cvSetData(CvArr* arr, void* data, int step) * */ #include "fim_plugin.h" #define FIM_WANT_OPENCV_EXAMPLE 0 #if FIM_WANT_OPENCV_EXAMPLE #include #include #include #include #include #include #include #include #include #include #include #define FIM_INVERT_BYTE(x) x=~x #define FIM_BLAKEN_BYTE(x) x=0 #define FIM_PROCESS_BYTE(x) FIM_BLAKEN_BYTE(x) extern fim::CommandConsole fim::cc; static void fim_opencv_detect_and_draw( IplImagePtr img, struct ida_image *iimg ) { /* * this code is based on the example from the OpenCV wiki at: * http://opencv.willowgarage.com/wiki/FaceDetection * */ CvPoint pt1, pt2; int i; fim_coo_t w=iimg->i.width; static CvMemStorage* storage=FIM_NULL; static CvHaarClassifierCascade* cascade=FIM_NULL; static int haar_file_existent=-1; const fim_char_t*const haarfile="haarcascade_frontalface_alt.xml"; string haarpath; FIM_CONSTEXPR fim_char_t*FIM_HAAR_PATH="FIM_HAAR_PATH"; if(haar_file_existent==0) return; storage=cvCreateMemStorage(0); cvClearMemStorage(storage); haarpath=fim::cc.getStringVariable(FIM_HAAR_PATH); #ifdef HAVE_GETENV if(haarpath==FIM_CNS_EMPTY_STRING) haarpath=getenv(FIM_HAAR_PATH); #endif /* HAVE_GETENV */ haarpath+=haarfile; if(is_file(haarpath)) haar_file_existent=1; else haar_file_existent=0; /* Usage : export FIM_HAAR_PATH=~/OpenCV-2.3.1/data/haarcascades/ fim ... or fim -C 'FIM_HAAR_PATH="~/OpenCV-2.3.1/data/haarcascades/"' ... */ if(!cascade ) cascade=(CvHaarClassifierCascade*)cvLoad(haarpath.c_str(),FIM_NULL,FIM_NULL,FIM_NULL); if( cascade ) { CvSeq*faces=cvHaarDetectObjects(img,cascade,storage,1.1,2,CV_HAAR_DO_CANNY_PRUNING,cvSize(40,40)); CvRect * fr=FIM_NULL; if(faces) for(i=0;i<(faces ? faces->total:0);i++) if(fr=(CvRect*)cvGetSeqElem(faces,i)) { pt1.x=fr->x; pt2.x=fr->x+fr->width; pt1.y=fr->y; pt2.y=fr->y+fr->height; for(fim_coo_t r=pt1.y;rdata[3*(r*w+c)+0]); FIM_PROCESS_BYTE(iimg->data[3*(r*w+c)+1]); FIM_PROCESS_BYTE(iimg->data[3*(r*w+c)+2]); } } if(faces) cvClearSeq(faces); /* FIXME: The OpenCV documentation says that cvClearSeq() does not deallocate anything; am not fully sure whether this code is completely correct, then. */ faces=FIM_NULL; } if(cascade) cvReleaseHaarClassifierCascade(&cascade); cascade=FIM_NULL; } static fim_err_t fim_opencv_plugin_example(struct ida_image *img, const fim_char_t *filename) { fim_coo_t r,c,h=img->i.height,w=img->i.width; FIM_CONSTEXPR int b=30; IplImagePtrcvimage=FIM_NULL; int depth=IPL_DEPTH_8U; int channels=3; CvSize size; if(!img) goto err; #if 0 cvimage=cvLoadImage(filename,1); #else size.width=img->i.width; size.height=img->i.height; cvimage = cvCreateImage(size,depth,channels); cvSetData(cvimage,img->data,3*img->i.width); #endif if(cvimage) fim_opencv_detect_and_draw(cvimage,img); else goto err; return FIM_ERR_NO_ERROR; err: return FIM_ERR_GENERIC; } #endif /* FIM_WANT_OPENCV_EXAMPLE */ #if FIM_WANT_EXPERIMENTAL_PLUGINS fim_err_t fim_post_read_plugins_exec(struct ida_image *img, const fim_char_t * filename) { /* FIXME: here shall call all registered post-read plugins */ /* as a first thing, need here a function drawing random boxes */ #if FIM_WANT_OPENCV_EXAMPLE return fim_opencv_plugin_example(img,filename); #else return FIM_ERR_NO_ERROR; #endif /* FIM_WANT_OPENCV_EXAMPLE */ } #endif /* FIM_WANT_EXPERIMENTAL_PLUGINS */ fim-0.6-rc2/src/FbiStuffFbtools.h0000644000175000017500000000253414454347340013554 00000000000000/* $LastChangedDate: 2013-07-04 23:07:07 +0200 (Thu, 04 Jul 2013) $ */ /* FbiStuffFbtools.h : fbi functions from fbtools.c, modified for fim (c) 2008-2013 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #include "fim.h" #include "FramebufferDevice.h" #ifndef FIM_FBISTUFFFBTOOLS_H #define FIM_FBISTUFFFBTOOLS_H namespace fim { /* info about videomode - yes I know, quick & dirty... */ /* init + cleanup */ int fb_probe(void); void fb_catch_exit_signals(void); void svga_dither_palette(int r, int g, int b); } #endif /* FIM_FBISTUFFFBTOOLS_H */ fim-0.6-rc2/src/CommandConsole.cpp0000644000175000017500000023242314455057600013747 00000000000000/* $LastChangedDate: 2023-07-16 23:22:08 +0200 (Sun, 16 Jul 2023) $ */ /* CommandConsole.cpp : Fim console dispatcher (c) 2007-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #include #if FIM_EXPERIMENTAL_FONT_CMD #include // readdir #endif /* FIM_EXPERIMENTAL_FONT_CMD */ #include #ifdef FIM_USE_READLINE #include "readline.h" #endif /* FIM_USE_READLINE */ #if HAVE_SYS_IOCTL_H #include #endif /* HAVE_SYS_IOCTL_H */ #include #include #if HAVE_GET_CURRENT_DIR_NAME #else /* HAVE_GET_CURRENT_DIR_NAME */ #if _BSD_SOURCE || _XOPEN_SOURCE >= 500 #include /* getcwd, as replacement for get_current_dir_name */ /* STDIN_FILENO */ #endif /* _BSD_SOURCE || _XOPEN_SOURCE >= 500 */ #endif /* HAVE_GET_CURRENT_DIR_NAME */ #if FIM_WANT_RAW_KEYS_BINDING #define FIM_CNS_RAW_KEYS_MESG "If " FIM_CNS_EX_KSY_STRING " is at least two characters long and begins with 0 (zero), the integer number after the 0 will be treated as a raw keycode to bind the specified " FIM_CNS_EX_KSY_STRING " to." FIM_CNS_CMDSEP "Use the '" FIM_VID_VERBOSE_KEYS "' variable to discover (display device dependent) raw keys." #else /* FIM_WANT_RAW_KEYS_BINDING */ #define FIM_CNS_RAW_KEYS_MESG #endif /* FIM_WANT_RAW_KEYS_BINDING */ #define FIM_KEY_OFFSET '0' #define FIM_UNLIMITED_INFO_STRINGS 1 /* Description line can be of any length */ extern fim_sys_int yyparse(); #if FIM_WANT_BACKGROUND_LOAD #include #endif /* FIM_WANT_BACKGROUND_LOAD */ #define FIM_USE_STD_CHRONO FIM_USE_CXX14 && !FIM_USING_MINGW #if FIM_WANT_BACKGROUND_LOAD || FIM_USE_STD_CHRONO #include #include #endif /* */ #define FIM_CNS_IFELSE "if(expression){action;}['else'{action;}]" namespace fim { #if ( FIM_FONT_MAGNIFY_FACTOR <= 0 ) extern fim_int fim_fmf_; /* FIXME */ #endif /* FIM_FONT_MAGNIFY_FACTOR */ #ifdef FIM_USE_READLINE static bool nochars(const fim_char_t *s) { /* * true if the string is null or empty, false otherwise */ if(s==FIM_NULL) return true; while(*s && fim_isspace(*s)) ++s; return *s=='\0'?true:false; } #endif /* FIM_USE_READLINE */ int CommandConsole::findCommandIdx(fim_cmd_id cmd)const { /* * check whether cmd is a valid internal (registered) Fim command and returns index */ for(size_t i=0;i(c)); rs+=ksym; if(bindings_.find(c) != bindings_.end()) rs+=" successfully reassigned to \""; else rs+=" successfully assigned to \""; bindings_[c]=binding; /* this is the operation; what follows is only debug info */ rs+=bindings_[c]; rs+="\"\n"; if(hstr!="") bindings_help_[c]=hstr; return rs; } fim::string CommandConsole::getBindingsList(void)const { /* * collates all registered action bindings_ together in a single string * */ std::ostringstream oss; bindings_t::const_iterator bi; for( bi=bindings_.begin();bi!=bindings_.end();++bi) { key_syms_t::const_iterator ikbi=key_syms_.find(((*bi).first)); if(ikbi!=key_syms_.end()) if ( ikbi->second.size() ) if ( ! iscntrl(ikbi->second[0]) ) { oss << FIM_FLT_BIND" "; oss << fim_auto_quote(ikbi->second,0); oss << " \"" << ((*bi).second); if( bindings_help_.find((*bi).first) != bindings_help_.end() ) oss << "\" # " << bindings_help_.find((*bi).first) -> second << "\n"; else oss << "\"\n"; } } return oss.str(); } fim::string CommandConsole::unbind(const fim::string& kfstr) { /* * unbinds the action possibly bound to the first key name specified in args.. */ fim_key_t key=FIM_SYM_NULL_KEY; #ifdef FIM_WANT_RAW_KEYS_BINDING const fim_char_t* const kstr=kfstr.c_str(); if(strlen(kstr)>=2 && isdigit(kstr[0]) && isdigit(kstr[1])) { key=atoi(kstr+1); } else #endif /* FIM_WANT_RAW_KEYS_BINDING */ { sym_keys_t::const_iterator kbi=sym_keys_.find(kfstr); if(kbi!=sym_keys_.end()) key=sym_keys_[kfstr]; } return unbind(key); } fim_key_t CommandConsole::find_keycode_for_bound_cmd(fim_cls binding)const { /* * looks for a binding to 'cmd' and returns a string description for its bound key */ bindings_t::const_iterator bi; aliases_t::const_iterator ai; fim_key_t key=FIM_SYM_NULL_KEY; for( bi=bindings_.begin();bi!=bindings_.end();++bi) { if(bi->second==binding) { key = bi->first; goto ret; } } for( ai=aliases_.begin();ai!=aliases_.end();++ai) { if(ai->second.first==binding) { key = ai->first; goto ret; } } ret: return key; } fim::string CommandConsole::find_key_for_bound_cmd(fim_cls cmd)const { const fim_key_t key = find_keycode_for_bound_cmd(cmd); if( key != FIM_SYM_NULL_KEY ) { key_syms_t::const_iterator ki = key_syms_.find(key); if( ki != key_syms_.end() ) return ki->second; } return FIM_CNS_EMPTY_RESULT; } fim::string CommandConsole::unbind(fim_key_t c) { /* * unbinds the action possibly bound to the key combination code c */ std::ostringstream oss; const bindings_t::const_iterator bi=bindings_.find(c); if( bi != bindings_.end() ) { #if FIM_USE_CXX11 bindings_.erase(bi); #else /* FIM_USE_CXX11 */ bindings_.erase(c); #endif /* FIM_USE_CXX11 */ oss << c << ": successfully unbound.\n"; bindings_help_.erase(c); // if key c existent, erases associated help msg. } else oss << c << ": there is not such binding.\n"; return oss.str(); } fim::string CommandConsole::aliasRecall(fim_cmd_id cmd)const { // returns the expanded alias specified by cmd const aliases_t::const_iterator ai=aliases_.find(cmd); if(ai!=aliases_.end()) return ai->second.first; return FIM_CNS_EMPTY_RESULT; } fim::string CommandConsole::getAliasesList(FimDocRefMode refmode)const { // collates all expanded aliases fim::string aliases_expanded; aliases_t::const_iterator ai; for( ai=aliases_.begin();ai!=aliases_.end();++ai) aliases_expanded+=get_alias_info((*ai).first, refmode); return aliases_expanded; } fim::string CommandConsole::get_alias_info(const fim::string aname, FimDocRefMode refmode)const { std::ostringstream oss; const aliases_t::const_iterator ai=aliases_.find(aname); if(refmode==Man) oss << FIM_FLT_ALIAS << "\n.B\n\"" << aname << "\"\n\""; //oss << ".na\n" /* No output-line adjusting; inelegant way to avoid man --html=cat's: cannot adjust line */ else oss << FIM_FLT_ALIAS" \"" << aname << "\" \""; if(ai!=aliases_.end()) oss << ai->second.first; oss << "\""; if(ai!=aliases_.end()) if(ai->second.second!=FIM_CNS_EMPTY_STRING) oss << " # " << ai->second.second; oss << fim::string("\n"); if(refmode==Man) oss << ".fi\n"; return oss.str(); } fim_cxr CommandConsole::fcmd_alias(const args_t& args) { // create an alias fim::string cmdlist,desc; std::ostringstream r; if(args.size()==0) { return getAliasesList(); } if(args.size()<2) { return get_alias_info(args[0]); } if(args.size()>=2) cmdlist+=args[1]; if(args.size()>=3) desc +=args[2]; if(aliases_[args[0]].first!=FIM_CNS_EMPTY_STRING) { aliases_[args[0]]=std::pair(cmdlist,desc); r << FIM_FLT_ALIAS " " << args[0] << " successfully replaced.\n"; } else { aliases_[args[0]].first=cmdlist; aliases_[args[0]].second=desc; r << FIM_FLT_ALIAS " " << args[0]<< " successfully added.\n"; } return r.str(); } fim::string CommandConsole::dummy(const args_t & args) { return "dummy function for test purposes\n"; } CommandConsole::CommandConsole(void): Namespace(*this), #ifndef FIM_WANT_NO_OUTPUT_CONSOLE #ifndef FIM_KEEP_BROKEN_CONSOLE mc_(*this,FIM_NULL), #endif /* FIM_KEEP_BROKEN_CONSOLE */ #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ fontserver_(), show_must_go_on_(1), return_code_(0) ,mangle_tcattr_(false) ,browser_(*this) ,cycles_(0) #ifdef FIM_RECORDING ,recordMode_(Normal) ,dont_record_last_action_(false) #endif /* FIM_RECORDING */ ,fim_stdin_(STDIN_FILENO) #ifndef FIM_WANT_NO_OUTPUT_CONSOLE ,dummydisplaydevice_(this->mc_) #else /* FIM_WANT_NO_OUTPUT_CONSOLE */ ,dummydisplaydevice_() #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ ,displaydevice_(FIM_NULL) ,oldcwd_(fim_getcwd()) { mc_.setDisplayDevice(&dummydisplaydevice_); addCommand(Command(FIM_FLT_ALIAS,FIM_CMD_HELP_ALIAS,this,&CommandConsole::fcmd_foo)); addCommand(Command(FIM_FLT_ALIGN,FIM_CMD_HELP_ALIGN,&browser_,&Browser::fcmd_align)); #ifdef FIM_AUTOCMDS addCommand(Command(FIM_FLT_AUTOCMD,FIM_CMD_HELP_AUTOCMD,this,&CommandConsole::fcmd_autocmd)); addCommand(Command(FIM_FLT_AUTOCMD_DEL,FIM_CMD_HELP_AUTOCMD_DEL,this,&CommandConsole::fcmd_autocmd_del)); #endif /* FIM_AUTOCMDS */ addCommand(Command(FIM_FLT_BASENAME,FIM_CMD_HELP_BASENAME,this,&CommandConsole::fcmd_basename)); addCommand(Command(FIM_FLT_BIND,FIM_CMD_HELP_BIND,this,&CommandConsole::fcmd_bind)); addCommand(Command(FIM_FLT_CD,FIM_CMD_HELP_CD,this,&CommandConsole::fcmd_cd)); #ifndef FIM_WANT_NO_OUTPUT_CONSOLE addCommand(Command(FIM_FLT_CLEAR,FIM_CMD_HELP_CLEAR,this,&CommandConsole::fcmd_clear)); #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ addCommand(Command(FIM_FLT_COMMANDS,FIM_CMD_HELP_COMMANDS,this,&CommandConsole::fcmd_commands_list)); addCommand(Command(FIM_FLT_COLOR,FIM_CMD_HELP_COLOR,&browser_,&Browser::fcmd_color)); #if FIM_WANT_CROP addCommand(Command(FIM_FLT_CROP,FIM_CMD_HELP_CROP ,&browser_,&Browser::fcmd_crop)); #endif /* FIM_WANT_CROP */ addCommand(Command(FIM_FLT_DESC,FIM_FLT_HELP_DESC,this,&CommandConsole::fcmd_desc)); addCommand(Command(FIM_FLT_DISPLAY,FIM_FLT_HELP_DISPLAY,this,&CommandConsole::fcmd_display)); addCommand(Command(FIM_FLT_DUMP_KEY_CODES,FIM_CMD_HELP_DUMP_KEY_CODES,this,&CommandConsole::fcmd_dump_key_codes)); addCommand(Command(FIM_FLT_ECHO,FIM_CMD_HELP_ECHO,this,&CommandConsole::fcmd_echo)); addCommand(Command(FIM_FLT_ELSE,FIM_CMD_HELP_ELSE,this,&CommandConsole::fcmd_foo)); #ifdef FIM_RECORDING addCommand(Command(FIM_FLT_EVAL,FIM_CMD_HELP_EVAL,this,&CommandConsole::fcmd_eval)); #endif /* FIM_RECORDING */ #ifndef FIM_WANT_NOSCRIPTING addCommand(Command(FIM_FLT_EXEC,FIM_CMD_HELP_EXEC,this,&CommandConsole::fcmd_executeFile)); #endif /* FIM_WANT_NOSCRIPTING */ #if FIM_EXPERIMENTAL_FONT_CMD addCommand(Command(FIM_FLT_FONT,FIM_CMD_HELP_FONT,this,&CommandConsole::fcmd_font)); #endif /* FIM_EXPERIMENTAL_FONT_CMD */ addCommand(Command(FIM_FLT_GETENV,FIM_CMD_HELP_GETENV,this,&CommandConsole::fcmd_do_getenv)); addCommand(Command(FIM_FLT_GOTO,FIM_CMD_HELP_GOTO,&browser_,&Browser::fcmd_goto)); addCommand(Command(FIM_FLT_HELP,FIM_CMD_HELP_HELP,this,&CommandConsole::fcmd_help)); addCommand(Command(FIM_FLT_IF,FIM_CMD_HELP_IFELSE,this,&CommandConsole::fcmd_foo)); addCommand(Command(FIM_FLT_INFO,FIM_CMD_HELP_INFO,&browser_,&Browser::fcmd_info)); #if FIM_WANT_PIC_LBFL addCommand(Command(FIM_FLT_LIMIT,fim::string(FIM_FLT_LIMIT " " #if FIM_WANT_PIC_LVDN " {'-list'|'-listall'} 'variable'|" #endif /* FIM_WANT_PIC_LVDN */ "['-further'|'-merge'|'-subtract'] [{expression} |{variable} {value}]: A browsable file list filtering function (like limiting in the \'mutt\' program). Uses information loaded via --" FIM_OSW_LOAD_IMG_DSC_FILE "." #if FIM_WANT_PIC_LVDN FIM_CNS_CMDSEP " If invoked with '-list'/'-listall' only, will list the current description variable ids." FIM_CNS_CMDSEP " If invoked with '-list'/'-listall' 'id', will list set values for the variable 'id'." #endif /* FIM_WANT_PIC_LVDN */ FIM_CNS_CMDSEP " If '-further' is present, will start with the current list; if not, with the full list." FIM_CNS_CMDSEP " If '-merge' is present, new matches will be merged in the existing list and sorted." FIM_CNS_CMDSEP " If '-subtract' is present, sort and filter out matches." FIM_CNS_CMDSEP " If {variable} and {values} are provided, limit to files having property {variable} set to {value}." #if FIM_WANT_FILENAME_MARK_AND_DUMP FIM_CNS_CMDSEP " If {expression} is one exclamation point ('!'), will limit to the currently marked files only." #endif /* FIM_WANT_FILENAME_MARK_AND_DUMP */ #if FIM_WANT_LIMIT_DUPBN FIM_CNS_CMDSEP " If {expression} is '~!' will limit to files with unique basename." FIM_CNS_CMDSEP " if '~=', to files with duplicate basename." FIM_CNS_CMDSEP " if '~^', to the first of the files with duplicate basename." FIM_CNS_CMDSEP " if '~$', to the last of the files with duplicate basename." #endif /* FIM_WANT_LIMIT_DUPBN */ FIM_CNS_CMDSEP " On '~i' [MINIDX][-][MAXIDX], (each a number possibly followed by a multiplier 'K') will limit on filenames in position MINIDX to MAXIDX." #if FIM_WANT_FLIST_STAT FIM_CNS_CMDSEP " On '~z' will limit to files having the current file's size." FIM_CNS_CMDSEP " on '~z' [MINSIZE][-][MAXSIZE], (each a number possibly followed by a multiplier among 'k','K','m','M') will limit on filesize within these limits." FIM_CNS_CMDSEP " on '~d' will limit to files having the current file's date +- one day." FIM_CNS_CMDSEP " on '~d' [MINTIME][-][MAXTIME], (each the count of seconds since the Epoch (First of Jan. of 1970) or a date as DD/MM/YYYY) will limit on file time (struct stat's 'st_mtime', in seconds) within this interval." #endif /* FIM_WANT_FLIST_STAT */ FIM_CNS_CMDSEP " For other values of {expression}, limit to files whose description string matches {expression}." FIM_CNS_CMDSEP " Invoked with no arguments, the original browsable files list is restored." ),&browser_,&Browser::fcmd_limit)); #endif /* FIM_WANT_PIC_LBFL */ addCommand(Command(FIM_FLT_LIST,FIM_CMD_HELP_LIST,&browser_,&Browser::fcmd_list)); addCommand(Command(FIM_FLT_LOAD,FIM_CMD_HELP_LOAD,&browser_,&Browser::fcmd_load)); addCommand(Command(FIM_FLT_PAN,FIM_CMD_HELP_PAN,&browser_,&Browser::fcmd_pan)); addCommand(Command(FIM_FLT_POPEN,FIM_CMD_HELP_POPEN,this,&CommandConsole::fcmd_sys_popen)); #ifdef FIM_PIPE_IMAGE_READ addCommand(Command(FIM_FLT_PREAD,FIM_CMD_HELP_PREAD,this,&CommandConsole::fcmd_pread)); #endif /* FIM_PIPE_IMAGE_READ */ addCommand(Command(FIM_FLT_PREFETCH,FIM_CMD_HELP_PREFETCH,&browser_,&Browser::fcmd_prefetch)); addCommand(Command(FIM_FLT_PWD,FIM_CMD_HELP_PWD,this,&CommandConsole::fcmd_pwd)); addCommand(Command(FIM_FLT_QUIT,FIM_CMD_HELP_QUIT,this,&CommandConsole::fcmd_quit)); #ifdef FIM_RECORDING addCommand(Command(FIM_FLT_RECORDING,FIM_CMD_HELP_RECORDING,this,&CommandConsole::fcmd_recording)); #endif /* FIM_RECORDING */ addCommand(Command(FIM_FLT_REDISPLAY,FIM_CMD_HELP_REDISPLAY ,this,&CommandConsole::fcmd_redisplay)); addCommand(Command(FIM_FLT_RELOAD,FIM_CMD_HELP_RELOAD,&browser_,&Browser::fcmd_reload)); addCommand(Command(FIM_FLT_ROTATE,FIM_CMD_HELP_ROTATE,&browser_,&Browser::fcmd_rotate)); addCommand(Command(FIM_FLT_SCALE,FIM_CMD_HELP_SCALE,&browser_,&Browser::fcmd_scale)); addCommand(Command(FIM_FLT_SCROLL,FIM_CMD_HELP_SCROLL,&browser_,&Browser::fcmd_scroll)); addCommand(Command(FIM_FLT_SET,FIM_CMD_HELP_SET,this,&CommandConsole::fcmd_set)); addCommand(Command(FIM_FLT_SET_CONSOLE_MODE,FIM_CMD_HELP_SET_CONSOLE_MODE,this,&CommandConsole::fcmd_set_in_console)); addCommand(Command(FIM_FLT_SET_INTERACTIVE_MODE,FIM_CMD_HELP_SET_INTERACTIVE_MODE,this,&CommandConsole::fcmd_set_interactive_mode)); addCommand(Command(FIM_FLT_SLEEP,FIM_CMD_HELP_SLEEP,this,&CommandConsole::fcmd_foo)); addCommand(Command(FIM_FLT_STATUS,FIM_CMD_HELP_STATUS,this,&CommandConsole::fcmd_status)); addCommand(Command(FIM_FLT_STDERR,FIM_CMD_HELP_STDERR,this,&CommandConsole::fcmd__stderr)); addCommand(Command(FIM_FLT_STDOUT,FIM_CMD_HELP_STDOUT ,this,&CommandConsole::fcmd__stdout)); #ifndef FIM_NO_SYSTEM addCommand(Command(FIM_FLT_SYSTEM,FIM_CMD_HELP_SYSTEM,this,&CommandConsole::fcmd_system)); #endif /* FIM_NO_SYSTEM */ addCommand(Command(FIM_FLT_VARIABLES,FIM_CMD_HELP_VARIABLES,this,&CommandConsole::fcmd_variables_list)); addCommand(Command(FIM_FLT_UNALIAS,FIM_CMD_HELP_UNALIAS,this,&CommandConsole::fcmd_unalias)); addCommand(Command(FIM_FLT_UNBIND,FIM_CMD_HELP_UNBIND,this,&CommandConsole::fcmd_unbind)); addCommand(Command(FIM_FLT_WHILE,FIM_CMD_HELP_WHILE,this,&CommandConsole::fcmd_foo));/* may introduce a special "help grammar" command */ #ifdef FIM_WINDOWS /* this is a stub for the manual generation (actually, the FimWindow object gets built later) */ addCommand(Command(FIM_FLT_WINDOW,FIM_CMD_HELP_WINDOW,this,&CommandConsole::fcmd_foo)); #endif /* FIM_WINDOWS */ execDefaultConfiguration(); fcmd_cd(args_t()); setVariable(FIM_VID_VERSION,FIM_REVISION_NUMBER); setVariable(FIM_VID_STEPS,FIM_CNS_STEPS_DEFAULT); setVariable(FIM_VID_TERM, fim_getenv(FIM_CNS_TERM_VAR)); setVariable(FIM_VID_LOAD_DEFAULT_ETC_FIMRC,1); setVariable(FIM_VID_DEFAULT_ETC_FIMRC,FIM_CNS_SYS_RC_FILEPATH); setVariable(FIM_VID_PRELOAD_CHECKS,1); *prompt_=*(prompt_+1)=FIM_SYM_CHAR_NUL; } fim_err_t CommandConsole::execDefaultConfiguration(void) { #include "defaultConfiguration.cpp" return FIM_ERR_NO_ERROR; } bool CommandConsole::is_file(fim::string nf)const { /* * consider using access() as an alternative. */ #if HAVE_SYS_STAT_H struct stat stat_s; if(-1==stat(nf.c_str(),&stat_s)) goto err; if( S_ISDIR(stat_s.st_mode)) goto err; #endif /* HAVE_SYS_STAT_H */ return true; err: /* if the file doesn't exist, return false */ return false; } fim_err_t CommandConsole::addCommand(Command c) { const int idx=findCommandIdx(c.cmd()); if(idx!=FIM_INVALID_IDX) commands_[idx]=c; else commands_.push_back(c); return FIM_ERR_NO_ERROR; } fim::string CommandConsole::alias(const fim_cmd_id& a, const fim_cmd_id& c, const fim_cmd_id& d) { /* * an internal alias member function */ #if FIM_USE_CXX11 return fcmd_alias({a,c,d}); #else /* FIM_USE_CXX11 */ args_t args; args.push_back(a); args.push_back(c); args.push_back(d); return fcmd_alias(args); #endif /* FIM_USE_CXX11 */ } fim_char_t * CommandConsole::command_generator (const fim_char_t *text,int state,int mask)const { // Caching results and skip repeated searches, but ugly (uses static variables). // Note: as it feeds input for readline(), it uses malloc/free, not fim_malloc/fim_free. static args_t completions; static size_t list_index=0; aliases_t::const_iterator ai; variables_t::const_iterator vi; fim_char_t nschar='\0'; fim_cmd_id cmd; if(state==0) completions.erase(completions.begin(),completions.end()), list_index=0; else goto done; while(isdigit(*text)) text++; //initial repeat match if(!*text) return FIM_NULL; if(string(text).re_match(FIM_SYM_NAMESPACE_REGEX)==true) { mask=4, nschar=text[0], text+=2; } cmd = text; if(mask==0 || (mask&1)) for(size_t i=0;ifirst).find(cmd)==0){ completions.push_back(ai->first);} } if(mask==0 || (mask&4)) { if(nschar==FIM_SYM_NULL_NAMESPACE_CHAR || nschar==FIM_SYM_NAMESPACE_GLOBAL_CHAR) for( vi=variables_.begin();vi!=variables_.end();++vi) { if((vi->first).find(cmd)==0) completions.push_back((*vi).first); } if(browser_.c_getImage()) if(nschar==FIM_SYM_NULL_NAMESPACE_CHAR || nschar==FIM_SYM_NAMESPACE_IMAGE_CHAR) browser_.c_getImage()->find_matching_list(cmd,completions,true); if(nschar==FIM_SYM_NULL_NAMESPACE_CHAR || nschar==FIM_SYM_NAMESPACE_BROWSER_CHAR) browser_.find_matching_list(cmd,completions,true); #ifdef FIM_WINDOWS if(current_window().current_viewportp()) if(nschar==FIM_SYM_NULL_NAMESPACE_CHAR || nschar==FIM_SYM_NAMESPACE_VIEWPORT_CHAR) current_window().current_viewportp()->find_matching_list(cmd,completions,true); if(nschar==FIM_SYM_NULL_NAMESPACE_CHAR || nschar==FIM_SYM_NAMESPACE_WINDOW_CHAR) current_window().find_matching_list(cmd,completions,true); #endif } #ifndef FIM_COMMAND_AUTOCOMPLETION sort(completions.begin(),completions.end()); #endif /* FIM_COMMAND_AUTOCOMPLETION */ done: if(list_indexsecond; else return FIM_CNS_EMPTY_RESULT; } bool CommandConsole::executeBinding(const fim_key_t c) { /* * Executes a command, without logging / recording. * If binding inexistent, ignores silently error and return false. */ const bindings_t::const_iterator bi=bindings_.find(c); fim_err_t status=FIM_ERR_NO_ERROR; #ifdef FIM_ITERATED_COMMANDS static fim_int it_buf=-1; /* FIXME: make this it_buf_ instead. */ if( c>='0' && c <='9' && (bi==bindings_.end() || bi->second==FIM_CNS_EMPTY_STRING))//a number, not bound { if(it_buf>0) { const fim_int nit_buf = it_buf; it_buf*=10; it_buf+=c - FIM_KEY_OFFSET; if( it_buf < nit_buf ) it_buf = nit_buf; } else it_buf=c - FIM_KEY_OFFSET; goto ret; } if(c==FIM_SYM_NULL_KEY) // this branch happens to be entered in SDL mode. investigate way to avoid this check. goto ret; #endif /* FIM_ITERATED_COMMANDS */ if(bi!=bindings_.end() && bi->second!=FIM_CNS_EMPTY_STRING) { FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PREINTERACTIVECOMMAND,current()); #ifdef FIM_ITERATED_COMMANDS if(it_buf>1) { const fim_int mit = getIntVariable(FIM_VID_MAX_ITERATED_COMMANDS); fim::string nc; if(mit>0 && it_buf > mit) { cout << "Command repeat parameter of " << it_buf << " exceeds the maximum allowed value of " << mit << ". You can adjust " FIM_VID_MAX_ITERATED_COMMANDS " to raise this limit.\n"; it_buf = FIM_MIN(mit,it_buf); } nc=it_buf; if(it_buf>1) nc+="{"+getBoundAction(c)+"}"; /* adding ; before } can cause problems as long as ;; is not supported by the parser*/ else nc = getBoundAction(c); cout << "About to execute " << nc << " .\n"; status=execute_internal(nc.c_str(),FIM_X_HISTORY); it_buf=-1; } else it_buf = -1, #endif /* FIM_ITERATED_COMMANDS */ status=execute_internal(getBoundAction(c).c_str(),FIM_X_NULL); FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTINTERACTIVECOMMAND); } if(status) { std::cerr << "error performing execute()\n"; //show_must_go_on_=0; /* we terminate interactive execution */ } else return true; ret: return false; } fim_err_t CommandConsole::execute_internal(const fim_char_t *ss, fim_xflags_t xflags) { #if HAVE_PIPE try{ /* * execute a string containing a fim script. * second argument specifies whether to add to history. * * note: the pipe here opened shall be closed in the yyparse() * call, by the YY_INPUT macro (defined by me in lex.lex) */ /* fim_bool_t suppress_output_=(xflags&FIM_X_QUIET)?true:false; */ fim_char_t *s=dupstr(ss);//this malloc is free int iret=0; int r =0; if(s==FIM_NULL) { std::cerr << "allocation problem!\n"; //if(s==FIM_NULL){ferror("null command");return;} //assert(s); //this shouldn't happen //this->quit(0); return FIM_ERR_GENERIC; } if(errno) { //fim_perror("before pipe(fim_pipedesc)"); //goto ret; fim_perror(FIM_NULL);// we need to clear errno } //we open a pipe with the lexer/parser r = pipe(fim_pipedesc); if(r!=0) { //strerror(errno); std::cerr << "error piping with the command interpreter ( pipe() gave "<< r<< " )\n"; std::cerr << "the command was:\"" << ss << "\"\n"; std::cerr << "we had: "<< aliases_.size()<< " aliases_\n"; // std::exit(-1); // ferror("pipe error\n"); // cleanup(); if(errno) { fim_perror("in pipe(fim_pipedesc)"); goto ret; } return FIM_ERR_GENERIC; } //we write there our script or commands r=write(fim_pipedesc[1],s,strlen(s)); if(errno) { fim_perror("in write(fim_pipedesc[1])"); goto ret; } //we are done! if((size_t)r!=strlen(s)) { ferror("write error"); cleanup(); return FIM_ERR_GENERIC; } for(fim_char_t *p=s;*p;++p) if(*p=='\n') *p=' '; iret=close(fim_pipedesc[1]); if(iret || errno) { fim_perror("in close(fim_pipedesc[1])"); goto ret; } try { iret=yyparse(); } catch (FimException e) { if( e == FIM_E_TRAGIC || e == FIM_E_NO_MEM ) this->quit( FIM_E_NO_MEM ); else ; /* ]:-)> */ } close(fim_pipedesc[0]); if(iret!=0 || errno!=0) { if(getIntVariable(FIM_VID_VERBOSE_ERRORS)==1) { // FIXME; the pipe descriptor is used in a bad way. std::cout << "When parsing: " << FIM_MSG_CONSOLE_LONG_LINE << s << FIM_MSG_CONSOLE_LONG_LINE << "\n"; fim_perror("in yyparse()"); } else fim_perror(FIM_NULL); // ignoring yyparse's errno: it may originate from any command! //goto ret; } #ifdef FIM_USE_READLINE if ( xflags & FIM_X_HISTORY ) if(nochars(s)==false) add_history(s); #endif /* FIM_USE_READLINE */ ret: fim_free(s); } catch (FimException e) { if( e == FIM_E_TRAGIC || true ) return this->quit( FIM_E_TRAGIC ); } #endif /* HAVE_PIPE */ return FIM_ERR_NO_ERROR; } fim::string CommandConsole::execute(fim_cmd_id cmd, args_t args) { /* * Single tokenized commands with arguments. */ int cidx=FIM_INVALID_IDX; /* first determine whether cmd is an alias */ const fim::string ocmd=aliasRecall(cmd); const int int0 = (args.size()>0) ? atoi(args[0].c_str()) : 1; if(ocmd!=FIM_CNS_EMPTY_STRING) { #if HAVE_PIPE //an alias should be expanded. arguments are appended. std::ostringstream oss; cmd=ocmd; oss << ocmd; // pipe to the parser fim_sys_int r = pipe(fim_pipedesc),sl; if(r!=0) {ferror("pipe error\n");exit(-1);} #ifndef FIM_ALIASES_WITHOUT_ARGUMENTS for(size_t i=0;i0 && catchLoopBreakingCommand(seconds--))sleep(1); catchLoopBreakingCommand(seconds); #endif goto ok; } else if(cmd==FIM_FLT_ALIAS) { //assignment of an alias args_t aargs; for(size_t i=0;ifcmd_alias(aargs) << "\n"; goto ok; } else { cidx=findCommandIdx(cmd); #ifdef FIM_COMMAND_AUTOCOMPLETION if(getIntVariable(FIM_VID_CMD_EXPANSION)==1) if(cidx==FIM_INVALID_IDX) { fim_char_t *match = this->command_generator(cmd.c_str(),0,0); if(match) { //cout << "but found:`"<= 0) std::cout << FIM_CNS_DBG_CMDS_PFX << "executing: " << cmd << " " << args << "\n"; fim::string lco = commands_[cidx].execute(args); cout << lco; setVariable(FIM_VID_LAST_CMD_OUTPUT,lco); goto ok; } } return "If you see this string, please report it to the program maintainer.\n"; ok: return FIM_CNS_EMPTY_RESULT; } fim_int CommandConsole::catchLoopBreakingCommand(fim_ts_t seconds) { /* * Interactive loops breaking logic. * Allows user to press any key during loop. * Loop will continue its execution, unless pressed key is exitBinding_. * If not, and if the key is bound to some action, this action is executed. * If loop has to be broken, returns 1 and changes show_must_go_on_ to 2. */ fim_key_t c; if ( !show_must_go_on_ ) goto err; show_must_go_on_ = 1; if ( exitBinding_ == 0 ) goto err; /* any key triggers an exit */ // note: truly honouring input with "if ( ! pop_key_press(&c) )" here would consume also -K keys -- which we don't want c = displaydevice_->catchInteractiveCommand(seconds); while(c!=-1) { /* while characters read */ //if( c == -1 ) return 0; /* no chars read */ sym_keys_t::const_iterator ki; if((ki=sym_keys_.find(FIM_KBD_ESC))!=sym_keys_.end() && c==ki->second) goto err; if((ki=sym_keys_.find(FIM_KBD_COLON))!=sym_keys_.end() && c==ki->second) goto err; if( c != exitBinding_ ) /* characters read */ { executeBinding(c); /* any interactive action */ if(!show_must_go_on_) goto err; c = displaydevice_->catchInteractiveCommand(1); } if(c==exitBinding_) goto err; } return 0; /* no chars read */ err: show_must_go_on_ = 2; return 1; /* break any enclosing loop */ } #ifdef FIM_USE_GPM static int gh(Gpm_Event *event, void *clientdata) { std::cout << "GPM event captured.\n"; exit(0); return 'n'; //return 0; } #endif /* FIM_USE_GPM */ fim_perr_t CommandConsole::executionCycle(void) { /* * the cycle with fetches the instruction stream. * */ #if FIM_WANT_NEXT_ACCEL static fim_cycles_t cycles_last; static fim_key_t c_last; #endif /* FIM_WANT_NEXT_ACCEL */ #ifdef FIM_USE_GPM Gpm_PushRoi(0,0,1023,768,GPM_DOWN|GPM_UP|GPM_DRAG|GPM_ENTER|GPM_LEAVE,gh,FIM_NULL); #endif /* FIM_USE_GPM */ const fim::string initial = browser_.current(); FIM_AUTOCMD_EXEC(FIM_ACM_PREEXECUTIONCYCLE,initial); FIM_AUTOCMD_EXEC(FIM_ACM_PREEXECUTIONCYCLEARGS,initial); *prompt_=FIM_SYM_PROMPT_NUL; #if FIM_WANT_BACKGROUND_LOAD background_push(); #endif /* FIM_WANT_BACKGROUND_LOAD */ #if FIM_WANT_CMDLINE_KEYPRESS for(size_t i=0;i0) { if(getIntVariable(FIM_VID_VERBOSE_KEYS)==1) { /* * <0x20 ? print ^ 0x40+.. * */ sprintf(buf,"got: 0x%x (%d) %s\n",c,c,fim_key_escape(key_syms_[c]).c_str()); cout << buf ; } if(getVariable(FIM_VID_DBG_COMMANDS).find('k') >= 0) { std::cout << FIM_CNS_DBG_CMDS_PFX << "keysym: '"<executeBinding(c) ) { #ifdef FIM_RECORDING if(recordMode_==Recording) record_action(getBoundAction(c)); memorize_last(getBoundAction(c)); #endif /* FIM_RECORDING */ } } } else { // framebuffer console switching is handled here if(r==-1) redisplay(), // fbi used to redraw elsewhere browser_.display_status(""); } } #if FIM_WANT_NEXT_ACCEL if(!same_keypress_repeat) same_keypress_repeats=0; #endif /* FIM_WANT_NEXT_ACCEL */ continue; #ifdef FIM_USE_READLINE rlnull: { ic_=0; *prompt_=FIM_SYM_CHAR_NUL; *prompt_=*(prompt_+1)=FIM_SYM_CHAR_NUL; const fim_char_t * const msg = " Warning: readline failed ! Probably no stdin is available, right ? Unfortunately fim is not yet ready for this case.\n"; cout << msg; set_status_bar(msg,FIM_NULL); } #endif /* FIM_USE_READLINE */ } #if FIM_WANT_BACKGROUND_LOAD blt_.join(); #endif /* FIM_WANT_BACKGROUND_LOAD */ show_must_go_on_ = -1; /* without this it would break loops in postExecutionCommand_ aka -F */ FIM_AUTOCMD_EXEC(FIM_ACM_POSTEXECUTIONCYCLE,initial); return quit(return_code_); } FIM_NORETURN void CommandConsole::exit(fim_perr_t i)const { /* * Exit the program as a whole. * If various object destructors are set to destroy device * contexts, it should do no harm to the console. * (it will call statically declared object's destructors ) */ std::exit(i); } fim_perr_t CommandConsole::quit(fim_perr_t i) { /* * To be called to exit from the program safely. * it is used mainly for safe exit after severe errors. */ show_must_go_on_=0; cleanup(); return i; } #if FIM_WANT_FILENAME_MARK_AND_DUMP fim::string CommandConsole::marked_files_list(void)const { std::ostringstream oss; for(std::set::iterator i=marked_files_.begin();i!=marked_files_.end();++i) oss << *i << "\n"; return oss.str(); } fim::string CommandConsole::marked_files_clear(void) { marked_files_.erase(marked_files_.begin(),marked_files_.end()); #if FIM_USE_CXX11 return {}; #else /* FIM_USE_CXX11 */ return fim::string(); #endif /* FIM_USE_CXX11 */ } #endif /* FIM_WANT_FILENAME_MARK_AND_DUMP */ CommandConsole::~CommandConsole(void) { fim::string sof=getStringVariable(FIM_VID_SCRIPTOUT_FILE); #if FIM_WANT_FILENAME_MARK_AND_DUMP if(!marked_files_.empty()) { std::cerr << "The following files were marked by the user:\n"; std::cerr << "\n"; std::cout << marked_files_list(); } #endif /* FIM_WANT_FILENAME_MARK_AND_DUMP */ if(sof!=FIM_CNS_EMPTY_STRING) { if(is_file(sof)) { std::cerr << "Warning: the "<0) { buf[r]='\0'; cmds+=buf; /* if(displaydevice_->catchInteractiveCommand(0)!=-1) goto ret; */ } if(rp) *rp=r; ret: return cmds; } fim_err_t CommandConsole::executeStdFileDescriptor(FILE* fd) { fim_sys_int r; fim_err_t errv = FIM_ERR_NO_ERROR; const fim::string cmds = CommandConsole::readStdFileDescriptor(fd,&r); if(r==-1) { errv = FIM_ERR_GENERIC; goto ret; } execute_internal(cmds.c_str(),FIM_X_QUIET); ret: return errv; } fim_err_t CommandConsole::executeFile(const fim_char_t *s) { return execute_internal(slurp_file(s).c_str(),FIM_X_QUIET); } fim_var_t CommandConsole::getVariableType(const fim_var_id& varname)const { const variables_t::const_iterator vi=variables_.find(varname); if(vi!=variables_.end()) return vi->second.getType(); else return FimTypeWrong; } bool CommandConsole::isVariable(const fim_var_id& varname)const { return getStringVariable(varname).size(); } fim_bool_t CommandConsole::drawOutput(const fim_char_t *s)const { /* * whether the console should draw or not itself upon the arrival of textual output * */ //std::cout << s << ": " << (this->inConsole() )<< ( (s&&*s) ) << "\n"; const fim_bool_t sd=( ( this->inConsole() /* in the command line */ && (s&&*s) /* actually some text to add */ ) || this->getIntVariable(FIM_VID_DISPLAY_CONSOLE) /* or user requested for showing console */ ); return sd; } fim::string CommandConsole::get_aliases_list(void)const { /* * returns the list of set action aliases */ std::ostringstream oss; aliases_t::const_iterator ai; for( ai=aliases_.begin();ai!=aliases_.end();++ai) oss << ((*ai).first) << " "; return oss.str(); } fim::string CommandConsole::get_commands_list(void)const { std::ostringstream oss; for(size_t i=0;iget_variables_list() << sep; #endif /* FIM_NAMESPACES */ #ifdef FIM_WINDOWS if(window_) acl << window_->get_variables_list() << sep; if(current_viewport()) acl << current_viewport()->get_variables_list() << sep; #endif /* FIM_WINDOWS */ return acl.str(); } #ifdef FIM_AUTOCMDS fim::string CommandConsole::autocmds_list(const fim::string event, const fim::string pattern)const { std::ostringstream acl; autocmds_t::const_iterator ai; if(event==FIM_CNS_EMPTY_STRING && pattern==FIM_CNS_EMPTY_STRING) //for each autocommand event registered for( ai=autocmds_.begin();ai!=autocmds_.end();++ai ) //for each file pattern registered, display the list.. for( autocmds_p_t::const_iterator api=((*ai)).second.begin(); api!=((*ai)).second.end();++api ) //.. display the list of autocommands... for( args_t::const_iterator aui=((*api)).second.begin(); aui!=((*api)).second.end();++aui ) acl << FIM_FLT_AUTOCMD" \"" << (*ai).first << "\" \"" << (*api).first << "\" \"" << (*aui) << "\"\n"; else if(pattern==FIM_CNS_EMPTY_STRING) { const autocmds_t::const_iterator ci=autocmds_.find(event); //for each autocommand event registered //for each file pattern registered, display the list.. if(ci!=autocmds_.end()) for( autocmds_p_t::const_iterator api=(*ci).second.begin(); api!=(*ci).second.end();++api ) //.. display the list of autocommands... for( args_t::const_iterator aui=((*api)).second.begin(); aui!=((*api)).second.end();++aui ) acl << FIM_FLT_AUTOCMD" \"" << (*ci).first << "\" \"" << (*api).first << "\" \"" << (*aui) << "\"\n"; } else { const autocmds_t::const_iterator ci=autocmds_.find(event); //for each autocommand event registered //for each file pattern registered, display the list.. if(ci!=autocmds_.end()) { autocmds_p_t::const_iterator api=(*ci).second.find(pattern); //.. display the list of autocommands... if(api!=(*ci).second.end()) { for( args_t::const_iterator aui=((*api)).second.begin(); aui!=((*api)).second.end();++aui ) acl << FIM_FLT_AUTOCMD" \"" << (*ci).first << "\" \"" << (*api).first << "\" \"" << (*aui) << "\"\n"; } } } if(acl.str()==FIM_CNS_EMPTY_STRING) acl << "no autocommands loaded\n"; return acl.str(); } fim::string CommandConsole::autocmd_del(const fim::string event, const fim::string pattern, const fim::string action) { autocmds_t::iterator ai; size_t n = 0; if(event==FIM_CNS_EMPTY_STRING && pattern==FIM_CNS_EMPTY_STRING && action == FIM_CNS_EMPTY_STRING ) { /* deletion of all autocmd's */ n = autocmds_.size(); autocmds_.erase(autocmds_.begin(),autocmds_.end()); } else if(action==FIM_CNS_EMPTY_STRING && pattern==FIM_CNS_EMPTY_STRING ) { /* deletion of all autocmd's for given event */ ai=autocmds_.find(event); if(ai==autocmds_.end()) return FIM_CNS_EMPTY_RESULT; n = (*ai).second.size(); for( autocmds_p_t::iterator api=((*ai)).second.begin(); api!=((*ai)).second.end();++api ) (*ai).second.erase(api); } else if(action==FIM_CNS_EMPTY_STRING) { /* deletion of all autocmd's for given event and pattern */ ai=autocmds_.find(event); if(ai==autocmds_.end()) return FIM_CNS_EMPTY_RESULT; autocmds_p_t::iterator api=((*ai)).second.find(pattern); n = (*api).second.size(); for( args_t::iterator aui=((*api)).second.begin(); aui!=((*api)).second.end();++aui ) (*api).second.erase(aui); } if(n) return fim::string(n)+" autocmd's removed\n"; else return "no autocmd's removed\n"; } fim::string CommandConsole::autocmd_add(const fim::string& event,const fim::string& pat,const fim_cmd_id& cmd) { /* valid vs invalid events? check and warning .. */ if(cmd==FIM_CNS_EMPTY_STRING) { cout << "can't add empty autocommand\n"; goto ok; } for(size_t i=0;i= 0) std::cout << FIM_CNS_DBG_CMDS_PFX << "adding autocmd " << cmd << ":\n"; return autocmd_add(FIM_ACM_POSTHFIMRC,"",cmd); } fim::string CommandConsole::pre_autocmd_exec(void) { return FIM_AUTOCMD_EXEC(FIM_ACM_POSTHFIMRC,""); } fim::string CommandConsole::autocmd_exec(const fim::string& event, const fim_fn_t& fname) { autocmds_p_t::const_iterator api; /* * we want to prevent from looping autocommands; this rudimentary mechanism shall avoid them. */ autocmds_loop_frame_t frame(event,fname); if( show_must_go_on_ == 0 ) return FIM_CNS_EMPTY_RESULT; if(! autocmd_in_stack( frame )) { autocmd_push_stack( frame ); if ( autocmds_.find(event) != autocmds_.end() ) { const autocmds_p_t ea = autocmds_[event]; // need copy because autocmd_ may be changed for( api=ea.begin();api!=ea.end();++api ) autocmd_exec(event,(*api).first,fname); } autocmd_pop_stack( frame ); } else { cout << "WARNING: there is a loop for " << "(event:" << event << ",filename:" << fname << ")"; } return FIM_CNS_EMPTY_RESULT; } fim::string CommandConsole::autocmd_exec(const fim::string& event, const fim::string& pat, const fim_fn_t& fname) { // cout << "autocmd_exec_cmd...\n"; // cout << "autocmd_exec_cmd. for pat '" << fname << "'\n"; if(getIntVariable(FIM_VID_DBG_AUTOCMD_TRACE_STACK)!=0) autocmd_trace_stack(); if ( regexp_match(fname.c_str(),pat.c_str(),getIntVariable(FIM_VID_IGNORECASE)) ) if ( autocmds_.find(event) != autocmds_.end() ) if ( autocmds_[event].find(pat) != autocmds_[event].end() ) if ( autocmds_[event][pat].size() ) { const size_t sz = autocmds_[event][pat].size(); const autocmds_p_t autocmds = autocmds_[event]; for (size_t i=0;isecond[i].c_str(); autocmds_frame_t frame(autocmds_loop_frame_t(event,fname),acmd); if(getVariable(FIM_VID_DBG_COMMANDS).find('a') >= 0) std::cout << FIM_CNS_DBG_CMDS_PFX << "autocmd: '"<'"<\n"; for( autocmds_stack_t::const_iterator citer=autocmds_stack.begin(); citer!=autocmds_stack.end();++citer,++indent ) { for(i=0;ifirst.first << " " << citer->first.second << " " << citer->second << "\n"; } } fim_bool_t CommandConsole::autocmd_in_stack(const autocmds_loop_frame_t& frame)const { /* * prevents a second autocommand triggered against the same file to execute */ return find(autocmds_loop_stack.begin(),autocmds_loop_stack.end(),frame)!=autocmds_loop_stack.end(); } #endif /* FIM_AUTOCMDS */ bool CommandConsole::regexp_match(const fim_char_t*s, const fim_char_t*r, int rsic)const { /* * given a string s, and a Posix regular expression r, this * member function returns true if there is match. false otherwise. */ return ::regexp_match(s, r, rsic, true); } bool CommandConsole::redisplay(void) { bool needed_redisplay=false; #ifdef FIM_WINDOWS if(window_) needed_redisplay = window_->recursive_redisplay(); #else /* FIM_WINDOWS */ needed_redisplay = viewport_->redisplay(); #endif /* FIM_WINDOWS */ return needed_redisplay; } #ifdef FIM_RECORDING void CommandConsole::record_action(const fim_cmd_id& cmd) { static time_t pt=0; time_t ct,dt; struct timeval tv; if(cmd==FIM_CNS_EMPTY_STRING) { pt=0; return; } if(gettimeofday(&tv, FIM_NULL)!=0) // error case. return; ct=tv.tv_usec/1000+tv.tv_sec*1000; if(!pt) pt=ct; dt=(ct-pt)*1000; pt=ct; recorded_actions_.push_back(recorded_action_t(sanitize_action(cmd),dt)); } #endif /* FIM_RECORDING */ #if FIM_WANT_FILENAME_MARK_AND_DUMP bool CommandConsole::isMarkedFile(fim_fn_t fname)const { if(marked_files_.find(fname)==marked_files_.end()) return false; else return true; } void CommandConsole::markCurrentFile(bool mark) { markFile(browser_.current(), mark); } fim_int CommandConsole::markFile(const fim_fn_t& file, bool mark, bool aloud) { /* * the current file will be added to the list of filenames * which will be printed upon the program termination. * */ fim_int ret = 0; /* number of impacted files */ if(file!=FIM_STDIN_IMAGE_NAME) { marked_files_t::iterator mfi=marked_files_.find(file); if(mfi==marked_files_.end()) { if(mark) { ++ret; marked_files_.insert(file); if(aloud) cout<<"Marked file \""<fnpv_ ) this->browser_.push_path(fnpi,FIM_FLAG_PUSH_REC|FIM_FLAG_PUSH_BACKGROUND,&this->show_must_go_on_); this->fnpv_.erase(this->fnpv_.begin(),this->fnpv_.end()); this->fnpv_.shrink_to_fit(); /* no use for this now */ setVariable(FIM_VID_LOADING_IN_BACKGROUND,0); } ); return true; } #endif /* FIM_WANT_BACKGROUND_LOAD */ #ifndef FIM_WANT_NOSCRIPTING bool CommandConsole::push_scriptfile(const fim_fn_t ns) { /* * pushes a script up in the pre-execution scriptfile list * */ scripts_.push_back(ns); return true; /* for now a fare return code */ } bool CommandConsole::with_scriptfile(void)const { return scripts_.size() !=0 ; } #endif /* FIM_WANT_NOSCRIPTING */ /* * Setting the terminal in raw mode means: * - setting the line discipline * - setting the read rate * - disabling the echo */ void CommandConsole::tty_raw(void) { #if HAVE_TERMIOS_H struct termios tattr; //we set the terminal in raw mode. fcntl(0,F_GETFL,saved_fl_); tcgetattr (0, &saved_attributes_); //fcntl(0,F_SETFL,O_BLOCK); memcpy(&tattr,&saved_attributes_,sizeof(struct termios)); tattr.c_lflag &= ~(ICANON|ECHO); tattr.c_cc[VMIN] = 1; tattr.c_cc[VTIME] = 0; tcsetattr (0, TCSAFLUSH, &tattr); #endif /* HAVE_TERMIOS_H */ } void CommandConsole::tty_restore(void) { #if HAVE_TERMIOS_H //POSIX.1 compliant: //"a SIGIO signal is sent whenever input or output becomes possible on that file descriptor" fcntl(0,F_SETFL,saved_fl_); //the Terminal Console State Attributes will be set right NOW tcsetattr (0, TCSANOW, &saved_attributes_); #endif /* HAVE_TERMIOS_H */ } fim_err_t CommandConsole::load_or_save_history(bool load_or_save) { #if FIM_WANT_HISTORY #ifndef FIM_NOHISTORY #ifndef FIM_WANT_NOSCRIPTING #ifdef FIM_USE_READLINE bool do_load = ( load_or_save && getIntVariable(FIM_VID_LOAD_FIM_HISTORY)==1 ); bool do_save = ((!load_or_save) && getIntVariable(FIM_VID_SAVE_FIM_HISTORY)==1 ); if( do_load || do_save ) { fim_char_t hfile[FIM_PATH_MAX]; const fim_char_t *const e = fim_getenv(FIM_CNS_HOME_VAR); if(e && strlen(e)finalize(); load_or_save_history(false); } /* * insert desc text into the textual console; possibly display it */ void CommandConsole::status_screen(const fim_char_t *desc) { if(!displaydevice_) return; displaydevice_->fb_status_screen_new((fim_char_t*)desc,drawOutput(desc),0); } void CommandConsole::set_status_bar(fim::string desc, const fim_char_t *info) { set_status_bar(desc.c_str(), info); } bool CommandConsole::set_wm_caption(const fim_char_t *str) { bool wcs = true; #if FIM_WANT_CAPTION_CONTROL fim_err_t rc=FIM_ERR_NO_ERROR; string wcss = getStringVariable(FIM_VID_WANT_CAPTION_STATUS); if( wcss.c_str() && *wcss.c_str() && browser_.c_getImage()) { fim::string clb = this->getInfoCustom(wcss.c_str()); rc = displaydevice_->set_wm_caption(clb.c_str()); wcs = false; /* window caption + status */ } else if( str && *str ) rc = displaydevice_->set_wm_caption(str); if(rc==FIM_ERR_UNSUPPORTED) wcs = false; /* revert */ #endif /* FIM_WANT_CAPTION_CONTROL */ return wcs; } fim_err_t CommandConsole::update_font_size(void) { #if ( FIM_FONT_MAGNIFY_FACTOR <= 0 ) { fim_int fim_fmf__ = getIntVariable(FIM_VID_FBFMF); if( displaydevice_ && displaydevice_->f_ ) { fim_int fim_afs__ = getIntVariable(FIM_VID_FBAFS); if( fim_afs__ >= 0 ) { if( fim_afs__ == 0 ) fim_afs__ = 50; fim_fmf__ = displaydevice_->suggested_font_magnification(fim_afs__,fim_afs__); } } if( fim_fmf__ < FIM_FONT_MAGNIFY_FACTOR_MIN ) fim_fmf__ = FIM_FONT_MAGNIFY_FACTOR_DEFAULT; setVariable(FIM_VID_FBFMF,fim_fmf__); fim_fmf_ = FIM_MIN(fim_fmf__, FIM_FONT_MAGNIFY_FACTOR_MAX); #ifndef FIM_WANT_NO_OUTPUT_CONSOLE /* FIXME: instead, call something like SDLDevice::post_wmresize(void) */ mc_.setGlobalVariable(FIM_VID_CONSOLE_ROWS,(displaydevice_->get_chars_per_column()/2)); mc_.reformat( displaydevice_->get_chars_per_line() ); #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ if( displaydevice_ ) displaydevice_->format_console(); } #else /* FIM_FONT_MAGNIFY_FACTOR */ setVariable(FIM_VID_FBFMF,FIM_FONT_MAGNIFY_FACTOR); #endif /* FIM_FONT_MAGNIFY_FACTOR */ return FIM_ERR_NO_ERROR; } void CommandConsole::set_status_bar(const fim_char_t *desc, const fim_char_t *info) { /* * Set the 'status bar' of the program. * - desc will be placed on the left corner * - info on the right * Pointers are meant to be freed by the caller. */ int chars, ilen; fim_char_t *str = FIM_NULL; fim::string hk=FIM_CNS_EMPTY_STRING; /* help key string */ int hkl=0; /* help key string length */ FIM_CONSTEXPR int mhkl=5,eisl=9; const fim_char_t *const hp=" - Help"; int hpl=fim_strlen(hp); prompt_[1]=FIM_SYM_CHAR_NUL; fim_bool_t wcs = isSetVar(FIM_VID_WANT_CAPTION_STATUS); if( ! displaydevice_ ) goto done; hk=this->find_key_for_bound_cmd(FIM_FLT_HELP); // slow hkl=fim_strlen(hk.c_str()); /* FIXME: can we guarantee a bound on its length in some way ? */ if(hkl>mhkl) {hk=FIM_CNS_EMPTY_STRING;hkl=0;/* fix */} else { if(hkl>0) {hk+=hp;hkl=hpl;/* help message append*/} else {hpl=0;/* no help key ? no message, then */} } update_font_size(); chars = displaydevice_->get_chars_per_line(); if(chars<1) goto done; str = fim_stralloc(chars+1); if(!str) goto done; if (desc && info) { /* non interactive print */ ilen = fim_strlen(info); if(chars-eisl-ilen-hkl>0) { #if 0 // sprintf(str, "%s%-*.*s [ %s ] %s",prompt_, sprintf(str, "%s%-*.*s %s %s",prompt_, chars-eisl-ilen-hkl, chars-eisl-ilen-hkl, desc, info, hk.c_str());//here above there is the need of 14+ilen chars #else snprintf(str, chars-1, "%s%-*.*s %s %s",prompt_, chars-eisl-ilen-hkl, chars-eisl-ilen-hkl, desc, info, hk.c_str());//here above there is the need of 14+ilen chars #endif } else { if(chars>5) { if(chars>10) { snprintf(str, chars-3, "%s%s", prompt_, info); strcat(str, "..."); } else sprintf(str, "<-!->"); } else { if(chars>0) sprintf(str, "!"); } } } #ifdef FIM_USE_READLINE else if(chars>=6+hkl && desc) /* would be a nonsense */ { /* interactive print */ static int statusline_cursor=0; int offset=0,coffset=0; statusline_cursor=rl_point; /* rl_point is readline stuff */ ilen = fim_strlen(desc); chars-=6+hpl+(*prompt_==FIM_SYM_CHAR_NUL?0:1); /* displayable, non-service chars */ if(!chars) goto done; /* 11 is strlen(" | H - Help")*/ offset =(statusline_cursor/(chars))*(chars); coffset=(*prompt_!=FIM_SYM_CHAR_NUL)+(statusline_cursor%(chars)); sprintf(str, "%s%-*.*s | %s",prompt_, chars, chars, desc+offset, hk.c_str()); if (prompt_[0]) str[coffset]='_'; } #endif /* FIM_USE_READLINE */ #if FIM_WANT_CAPTION_CONTROL if(wcs) wcs = set_wm_caption(str); if(!wcs) #endif /* FIM_WANT_CAPTION_CONTROL */ displaydevice_->status_line(str); /* one may check the return value.... */ done: if (str) fim_free(str); return; } fim_bool_t CommandConsole::inConsole(void)const { #ifdef FIM_USE_READLINE return ic_==1; #else /* FIM_USE_READLINE */ return false; #endif /* FIM_USE_READLINE */ } fim_err_t CommandConsole::display_resize(fim_coo_t w, fim_coo_t h, fim_bool_t wsl) { if(!displaydevice_) return FIM_ERR_GENERIC; if( wsl ) h += displaydevice_->status_line_height(); if(FIM_ERR_NO_ERROR!=displaydevice_->resize(w,h)) return FIM_ERR_GENERIC; w=displaydevice_->width(); h=displaydevice_->height(); #ifdef FIM_WINDOWS if(window_) window_->update(Rect(0,0,w,h)); #endif displaydevice_->format_console(); if(current_viewport()) current_viewport()->update_meta(true); FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PREWINDOW,current()); this->fcmd_redisplay(args_t()); FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTWINDOW); if(getGlobalIntVariable(FIM_VID_DISPLAY_BUSY)) { std::ostringstream oss; oss << "resized window to " << w << " x " << h; cc.set_status_bar(oss.str().c_str(),FIM_NULL); } return FIM_ERR_NO_ERROR; } fim_err_t CommandConsole::display_reinit(const fim_char_t *rs) { if(!displaydevice_) goto err; return displaydevice_->reinit(rs); err: return FIM_ERR_GENERIC; } fim_bool_t CommandConsole::key_syms_update(void) { sym_keys_t::const_iterator ki; for( ki=sym_keys_.begin();ki!=sym_keys_.end();++ki) key_syms_[(((*ki).second))]=((*ki).first); return true; } fim::string CommandConsole::find_key_syms(fim_key_t key)const { fim::string sym; if ( key_syms_.find(key) != key_syms_.end() ) sym = key_syms_.find(key)->second; return sym; } size_t CommandConsole::byte_size(void)const { size_t bs = 0; bs += browser_.byte_size(); /* NOTE: lots is missing here */ #if FIM_WANT_PIC_CMTS bs += id_.byte_size(); #endif /* FIM_WANT_PIC_CMTS */ return bs; } #if FIM_EXPERIMENTAL_FONT_CMD fim_cxr CommandConsole::fcmd_font(const args_t& args) { // Experimental. Note that as of now, this leaks memory of the first loaded font. typedef std::pair fim_ffp_t; /* file font pair */ fim_ffp_t fr; static std::vector fc; static int fidx = 0; const size_t fcnt = fc.size(); const fim_int vl = 0; // font loading verbosity level (font loading will exit() if not 0) std::ostringstream rs; if(args.size()>=0) { fim::string cid; if(args.size()==0) cid = "info"; else cid = args[0]; if( cid == "next" || cid == "prev" ) if( fcnt == 0 ) cid = "scan"; // scan first time if( cid == "scan" ) { fim::string nf; std::vector lfc; DIR *dir = FIM_NULL; struct dirent *de = FIM_NULL; int nfiles=0; if(args.size()>1) nf = args[1]; else nf = FIM_LINUX_CONSOLEFONTS_DIR; if(nf.size() && nf[nf.size()-1]!=FIM_CNS_DIRSEP_CHAR) nf += FIM_CNS_DIRSEP_STRING; if( !is_dir( nf )) goto nop; if ( ! ( dir = opendir(nf.c_str() ) )) goto ret; set_status_bar(" scanning for fonts...",FIM_NULL); while( ( de = readdir(dir) ) != FIM_NULL ) { if( de->d_name[0] == '.' && de->d_name[1] == '.' && !de->d_name[2] ) continue; if( de->d_name[0] == '.' && !de->d_name[1] ) continue; nfiles++; fr.first = nf; fr.first += de->d_name; fr.second = FIM_NULL; FontServer::fb_text_init1(fr.first.c_str(),&fr.second,vl); // FIXME: move this outta here if(fr.second) lfc.push_back(fr); } closedir(dir); #if FIM_USE_CXX11 for(auto & fs : fc) fim_free_fs_font(fs.second), fs.second=FIM_NULL; #else /* FIM_USE_CXX11 */ for( std::vector::iterator fi=fc.begin(); fi!=fc.end();++fi ) fim_free_fs_font(fi->second), fi->second=FIM_NULL; #endif /* FIM_USE_CXX11 */ fc.erase(fc.begin(),fc.end()); fc=lfc; rs << "font: " << "preloaded " << fc.size() << " fonts out of " << nfiles << " files scanned."; set_status_bar(rs.str().c_str(),FIM_NULL); rs << "\n"; } if( cid == "load" && args.size()>1 ) { fr.first=args[1]; fr.second=FIM_NULL; FontServer::fb_text_init1(fr.first.c_str(),&fr.second,vl); // FIXME: move this outta here if(fr.second) goto lofo; else rs << "failed loading font file " << fr.first; } if( cid == "info" ) rs << getStringVariable(FIM_VID_FBFONT) << "\n"; if( cid == "next" || cid == "prev" ) { if( fcnt>0 ) { if( cid == "next" ) fidx=(fidx+1)%fcnt; if( cid == "prev" ) fidx=(fidx+fcnt-1)%fcnt; rs << "font: loaded " << fidx << "/" << fcnt << ": "; fr=fc[fidx]; goto lofo; } else rs << "first 'scan' a directory for fonts.\n"; } goto nop; lofo: if( displaydevice_ && displaydevice_->f_ ) if(fr.second) { rs << fr.first.c_str() << "\n"; setVariable(FIM_VID_FBFONT,fr.first); displaydevice_->f_ = fr.second; update_font_size(); } } nop: ret: return rs.str(); } #endif /* FIM_EXPERIMENTAL_FONT_CMD */ fim_cxr CommandConsole::fcmd_variables_list(const args_t& args) { return get_variables_list(); } fim_cxr CommandConsole::fcmd_commands_list(const args_t& args) { return get_commands_list(); } fim::string CommandConsole::current(void)const { return browser_.current(); } fim_sys_int CommandConsole::get_displaydevice_input(fim_key_t * c, bool want_poll) { // Note: get_displaydevice_input not used in fbdev command line mode (bad; see also fim_pre_input_hook). if ( pop_key_press(c) ) return 1; return displaydevice_->get_input(c, want_poll); } #if FIM_WANT_PIC_CMTS bool CommandConsole::push_from_id(void) { for( ImgDscs::const_iterator ifn=id_.begin(); ifn!=id_.end();++ifn ) this->push(ifn->first); return true; } #endif /* FIM_WANT_PIC_CMTS */ fim_cxr CommandConsole::fcmd_display(const args_t& args) { if( browser_.c_getImage() ) { FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PREDISPLAY,current()); if( args.size()>0 && args[0] == "reinit" ) { string arg = args.size()>1?args[1]:""; this->display_reinit(arg.c_str()); } if( args.size()>0 && args[0] == "resize" ) { fim_coo_t nww = browser_.c_getImage()->width(); fim_coo_t nwh = browser_.c_getImage()->height(); fim_bool_t wsl = (getGlobalIntVariable(FIM_VID_DISPLAY_BUSY)) ? true : false;; if( args.size()>2 ) nww = args[1], nwh = args[2], wsl = false; this->display_resize(nww,nwh,wsl); } if(browser_.c_getImage() && (getGlobalIntVariable(FIM_VID_OVERRIDE_DISPLAY)!=1)) { if( this->redisplay() ) browser_.display_status(current().c_str()); } FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTDISPLAY); } else { cout << "no image to display, sorry!"; this->set_status_bar("no image loaded.", "*"); } return FIM_CNS_EMPTY_RESULT; } fim_cxr CommandConsole::fcmd_redisplay(const args_t& args) { if(browser_.c_getImage()) { FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PREREDISPLAY,current()); if(browser_.c_getImage()) { current_viewport()->recenter(); if( redisplay() ) browser_.display_status(current().c_str()); } FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTREDISPLAY); } return FIM_CNS_EMPTY_RESULT; } void CommandConsole::switch_if_needed(void) { #if FIM_WANT_CONSOLE_SWITCH_WHILE_LOADING displaydevice_->switch_if_needed(); #endif /* FIM_WANT_CONSOLE_SWITCH_WHILE_LOADING */ } fim::string CommandConsole::getInfoCustom(const fim_char_t * ifsp)const { // see FIM_VID_INFO_FMT_STR FIM_VID_COMMENT_OI FIM_VID_COMMENT_OI_FMT fim::string linebuffer; fim_char_t pagesinfobuffer[FIM_STATUSLINE_BUF_SIZE]; fim_char_t imagemode[4]; #if FIM_WANT_CUSTOM_INFO_STATUS_BAR fim::string ifs; #endif /* FIM_WANT_CUSTOM_INFO_STATUS_BAR */ const Image * image = browser_.c_getImage(); image->get_irs(imagemode); if(image->n_pages()>1) snprintf(pagesinfobuffer,sizeof(pagesinfobuffer)," [%d/%d]",image->get_page(),image->n_pages()); else *pagesinfobuffer='\0'; #if FIM_WANT_CUSTOM_INFO_STATUS_BAR if( ifsp ) { const char*fp=ifsp; const char*sp=ifsp; while(*sp && *sp!='%') ++sp; linebuffer.append(ifsp,sp-ifsp); while(*sp=='%' && isprint(sp[1])) { #if FIM_UNLIMITED_INFO_STRINGS string app; #endif /* FIM_UNLIMITED_INFO_STRINGS */ fim_char_t clb[FIM_IMG_DESC_ITEM_MAX_LEN]; fim_char_t *clbp = clb; int rbc = sizeof(clb)/sizeof(clb[0]); clb[0]=FIM_SYM_CHAR_NUL; ++sp; switch(*sp) { // "%p %wx%h %i/%l %F %M" case('p'): snprintf(clbp, rbc, "%.0f",image->get_scale()*100); break; case('w'): snprintf(clbp, rbc, "%d",(int)image->width()); break; case('h'): snprintf(clbp, rbc, "%d",(int)image->height()); break; case('i'): snprintf(clbp, rbc, "%d",(int)(browser_.current_n()+1)); break; case('k'): { string cv = image->getStringVariable(FIM_VID_COMMENT); if( cv.c_str() && *cv.c_str() ) #if FIM_UNLIMITED_INFO_STRINGS app+='[', app+=cv, app+=']'; #else /* FIM_UNLIMITED_INFO_STRINGS */ snprintf(clbp, rbc, "[%s] ",cv.c_str()); /* TODO: might generalize/change this */ #endif /* FIM_UNLIMITED_INFO_STRINGS */ } break; case('l'): snprintf(clbp, rbc, "%d",(int)browser_.n_files()); break; case('L'): snprintf(clbp, rbc, "%s",imagemode); break; case('P'): snprintf(clbp, rbc, "%s",pagesinfobuffer); break; case('F'): fim_snprintf_XB(clbp, rbc,image->get_file_size()); break; case('M'): fim_snprintf_XB(clbp, rbc,(int)image->get_pixelmap_byte_size()); break; case('n'): #if FIM_UNLIMITED_INFO_STRINGS app += image->getStringVariable(FIM_VID_FILENAME).c_str(); #else /* FIM_UNLIMITED_INFO_STRINGS */ snprintf(clbp, rbc, "%s",image->getStringVariable(FIM_VID_FILENAME).c_str()); #endif /* FIM_UNLIMITED_INFO_STRINGS */ break; case('N'): #if FIM_UNLIMITED_INFO_STRINGS app += fim_basename_of(image->getStringVariable(FIM_VID_FILENAME)); #else /* FIM_UNLIMITED_INFO_STRINGS */ snprintf(clbp, rbc, "%s",fim_basename_of(image->getStringVariable(FIM_VID_FILENAME))); #endif /* FIM_UNLIMITED_INFO_STRINGS */ break; case('T'): fim_snprintf_XB(clbp, rbc,cc.byte_size()); break; case('R'): fim_snprintf_XB(clbp, rbc, fim_maxrss()); break; #if FIM_WANT_MIPMAPS case('m'): fim_snprintf_XB(clbp, rbc,image->mm_byte_size()); break; #endif /* FIM_WANT_MIPMAPS */ case('C'): { fim_char_t buf[2*FIM_PRINTFNUM_BUFSIZE]; fim_snprintf_XB(buf, sizeof(buf),browser_.cache_.img_byte_size()); snprintf(clbp, rbc, "#%d:%s",(int)browser_.cache_.cached_elements(),buf); } break; case('c'): current_viewport()->snprintf_centering_info(clbp, rbc); break; case('v'): snprintf(clbp, rbc, "%s",FIM_CNS_FIM_APPTITLE); break; case('%'): snprintf(clbp, rbc, "%c",'%'); break; #if FIM_EXPERIMENTAL_VAR_EXPANDOS case('?'): /* "%?forward_comment?_filename?back_comment?" */ #if 1 if(strlen(sp+1)>=4) { /* NOTE: C++ sscanf does not support %m; expect broken -pedantic builds */ /* TODO: improve portability of this */ char *fcp = FIM_NULL, *vip = FIM_NULL; if( 2 == sscanf(sp,"?%m[A-Z_a-z]?%m[^?]?",&vip,&fcp) ) if(fcp && vip) { char *fcpp = fcp; if(*vip && image->isSetVar(vip) && *fcp ) { char *vipp = FIM_NULL; strdo: vipp = fcpp; while(*fcpp && *fcpp != '%') ++fcpp; #if FIM_UNLIMITED_INFO_STRINGS app += std::string(vipp,fcpp); #else /* FIM_UNLIMITED_INFO_STRINGS */ snprintf(clbp, FIM_MIN(rbc,fcpp-vipp+1), "%s", vipp ); rbc -= strlen(clbp); clbp += strlen(clbp); #endif /* FIM_UNLIMITED_INFO_STRINGS */ if(!*fcpp) goto strdone; ++fcpp; vipp = fcpp; if(*fcpp==':') { ++fcpp; while(*fcpp && *fcpp!=':' && ( isalpha(*fcpp) || isdigit(*fcpp) || *fcpp=='_' )) ++fcpp; string vn = string(vipp).substr(1,fcpp-vipp-1); string vv = image->getStringVariable(vn); if(*fcpp==':') #if FIM_UNLIMITED_INFO_STRINGS app += vv.c_str(), #else /* FIM_UNLIMITED_INFO_STRINGS */ snprintf(clbp, rbc, "%s",vv.c_str()), #endif /* FIM_UNLIMITED_INFO_STRINGS */ ++fcpp; else #if FIM_UNLIMITED_INFO_STRINGS app += ""; #else /* FIM_UNLIMITED_INFO_STRINGS */ snprintf(clbp, rbc, "%s",""); #endif /* FIM_UNLIMITED_INFO_STRINGS */ } else #if FIM_UNLIMITED_INFO_STRINGS app += ""; #else /* FIM_UNLIMITED_INFO_STRINGS */ snprintf(clbp, rbc, "%s",""); rbc -= strlen(clbp); clbp += strlen(clbp); #endif /* FIM_UNLIMITED_INFO_STRINGS */ goto strdo; } strdone: sp += strlen(fcp)+strlen(vip)+2; } if(fcp)std::free(fcp); if(vip)std::free(vip); } #else /* 1 */ if(strlen(sp+1)>=3) { char *fcp = FIM_NULL, *vip = FIM_NULL, *bcp = FIM_NULL; if( 3 == sscanf(sp,"?%a[^?%]?%a[A-Z_a-z]?%a[^?%]?",&fcp,&vip,&bcp) ) if(fcp && bcp && vip) { if(*vip && image->isSetVar(vip)) snprintf(clbp, rbc, "%s%s%s",fcp,image->getStringVariable(vip).c_str(),bcp); sp += strlen(fcp)+strlen(vip)+strlen(bcp)+3; } if(fcp)std::free(fcp); if(bcp)std::free(bcp); if(vip)std::free(vip); } #endif /* 1 */ break; #endif /* FIM_EXPERIMENTAL_VAR_EXPANDOS */ // default: /* rejecting char; may display an error message here */ } ++sp; fp=sp; while(*sp!='%' && sp[0]) ++sp; rbc -= strlen(clbp); clbp += strlen(clbp); #if FIM_UNLIMITED_INFO_STRINGS if(!app.empty()) { if(sp-fp>1) app = std::string(fp,sp) + app; linebuffer+=app; } else #endif /* FIM_UNLIMITED_INFO_STRINGS */ { snprintf(clbp, FIM_MIN(sp-fp+1,rbc), "%s",fp); rbc -= strlen(clbp); clbp += strlen(clbp); linebuffer+=clb; } } //std::cout << "Custom format string chosen: "<< ifsp << ", resulting in: "<< clb <<"\n"; goto labeldone; } #endif /* FIM_WANT_CUSTOM_INFO_STATUS_BAR */ labeldone: return linebuffer; } fim_int CommandConsole::show_must_go_on(void) const { return show_must_go_on_; } int CommandConsole::pop_key_press(fim_key_t *cp) { #if FIM_WANT_CMDLINE_KEYPRESS if ( ! cc.clkpv_.empty() ) { *cp = cc.clkpv_.front(); cc.clkpv_.pop(); return 1; // std::cout << "emitting " << (fim_char_t)*cp << " (" << cc.clkpv_.size() << " chars left)\n"; } #endif return 0; } #if FIM_WANT_CMDLINE_KEYPRESS void CommandConsole::push_key_press(const char *cp) { if ((!clkpv_.empty()) || !cp || !*cp) clkpv_.push(FIM_SYM_ENTER); for (; cp && *cp; ++cp) clkpv_.push(*cp); } #endif /* FIM_WANT_CMDLINE_KEYPRESS */ } /* namespace fim */ fim-0.6-rc2/src/Arg.cpp0000644000175000017500000000313414454347340011554 00000000000000/* $LastChangedDate: 2017-07-23 13:04:56 +0200 (Sun, 23 Jul 2017) $ */ /* Arg.cpp : argument lists (c) 2007-2017 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #include "Arg.h" namespace fim { int fim_args_opt_count(const args_t& args, const char oc) { int aoc = 0; fim::string s; for(size_t i=0;i0) os << " "; os << fim_shell_arg_escape(v[i]); } #endif return os; } } /* namespace fim */ fim-0.6-rc2/src/FbiStuffFbtools.cpp0000644000175000017500000000505614454347340014111 00000000000000/* $LastChangedDate: 2022-10-30 09:00:05 +0100 (Sun, 30 Oct 2022) $ */ /* FbiStuffFbtools.cpp : fbi functions from fbtools.c, modified for fim (c) 2008-2022 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #include #include #include #include #include #include // sigaction, ... #include #ifdef HAVE_SYS_USER_H #include /* this should be a safer replacement */ #endif /* HAVE_SYS_USER_H */ #include "FbiStuffFbtools.h" #include "FramebufferDevice.h" #define HAVE_SIGJMP_BUF !FIM_USING_MINGW namespace fim { /* -------------------------------------------------------------------- */ /* handle fatal errors */ #if HAVE_SIGJMP_BUF //static jmp_buf fb_fatal_cleanup; /* old, broken */ static sigjmp_buf fb_fatal_cleanup; /* posix */ static void fb_catch_exit_signal(int signal) { siglongjmp(fb_fatal_cleanup,signal); } #endif /* HAVE_SIGJMP_BUF */ void fb_catch_exit_signals(void) { #if HAVE_SIGJMP_BUF struct sigaction act,old; int termsig; fim_bzero(&act,sizeof(act)); act.sa_handler = fb_catch_exit_signal; sigemptyset(&act.sa_mask); sigaction(SIGINT, &act,&old); sigaction(SIGQUIT,&act,&old); sigaction(SIGTERM,&act,&old); sigaction(SIGABRT,&act,&old); sigaction(SIGTSTP,&act,&old); sigaction(SIGBUS, &act,&old); sigaction(SIGILL, &act,&old); sigaction(SIGSEGV,&act,&old); if (0 == (termsig = sigsetjmp(fb_fatal_cleanup,0))) return; /* console cleanup should happen here */ cc.cleanup(); #ifdef HAVE_SYS_SIGLIST FIM_FBI_PRINTF("Oops: %s\n",sys_siglist[termsig]); #endif /* HAVE_SYS_SIGLIST */ #endif /* HAVE_SIGJMP_BUF */ std::exit(FIM_PERR_OOPS); } } fim-0.6-rc2/src/FbiStuffMatrixMarket.cpp0000644000175000017500000000754614454347340015117 00000000000000/* $LastChangedDate: 2018-01-09 22:49:26 +0100 (Tue, 09 Jan 2018) $ */ /* FbiStuffMatrixMarket.cpp : fim functions for decoding Matrix Market files (c) 2009-2023 Michele Martone based on code (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include "FbiStuff.h" #include "FbiStuffLoader.h" #ifdef HAVE_MATRIX_MARKET_DECODER /* This is an experimental library of mine, yet unreleased */ #include namespace fim { /* ---------------------------------------------------------------------- */ /* load */ struct mm_state_t { fim_char_t * filename; fim_byte_t * first_row_dst; int width ; int height ; }; /* ---------------------------------------------------------------------- */ static void* mm_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { rsb_coo_idx_t rows,cols; rsb_nnz_idx_t nnz; struct mm_state_t *h; h = (struct mm_state_t *)fim_calloc(1,sizeof(*h)); const int rows_max=FIM_RENDERING_MAX_ROWS,cols_max=FIM_RENDERING_MAX_COLS; if(!h)goto err; h->first_row_dst=FIM_NULL; h->filename=FIM_NULL; i->dpi = FIM_RENDERING_DPI; /* FIXME */ i->npages = 1; if(rsb_lib_init(RSB_NULL_INIT_OPTIONS)) goto err; #if RSB_LIBRSB_VER < 10300 if(rsb_file_mtx_get_dimensions(filename, &cols, &rows, &nnz, FIM_NULL)) goto err; #else /* RSB_LIBRSB_VER */ if(rsb_file_mtx_get_dims(filename, &cols, &rows, &nnz, FIM_NULL)) goto err; #endif /* RSB_LIBRSB_VER */ #if 1 if(cols<1 || rows<1) goto err; #if FIM_EXPERIMENTAL_IMG_NMSPC if(i->nsp) { i->nsp->setVariable(string("columns"),cols); i->nsp->setVariable(string("rows"),rows); i->nsp->setVariable(string("nnz"),nnz); } #endif /* FIM_EXPERIMENTAL_IMG_NMSPC */ if(cols>cols_max) cols=cols_max; if(rows>rows_max) rows=rows_max; #endif i->width = cols; i->height = rows; h->width = cols; h->height = rows; h->filename=dupstr(filename); if(!h->filename) goto err; return h; err: if( h ) fim_free(h); return FIM_NULL; } static void mm_read(fim_byte_t *dst, unsigned int line, void *data) { struct mm_state_t *h = (struct mm_state_t*)data; if(!h)return; if(h->first_row_dst == FIM_NULL) h->first_row_dst = dst; else return; #if 0 if(rsb_get_pixmap_RGB_from_matrix(h->filename, dst, h->width, h->height)) #else if(rsb_file_mtx_render(dst,h->filename,h->width,h->width,h->height,RSB_MARF_RGB)) #endif goto err; err: return; } static void mm_done(void *data) { struct mm_state_t *h = (struct mm_state_t*)data; if(!data) goto err; if(h->filename) fim_free(h->filename); if(rsb_lib_exit(RSB_NULL_EXIT_OPTIONS)) goto err; err: return; } /* 00000000 25 25 4D 61 74 72 69 78 4D 61 72 6B 65 74 20 6D 61 74 72 69 78 20 63 6F 6F 72 64 69 %%MatrixMarket matrix coordi */ static struct ida_loader mm_loader = { magic: "%%MatrixMarket matrix", moff: 0, mlen: 20, name: "MatrixMarket", init: mm_init, read: mm_read, done: mm_done, }; static void fim__init init_rd(void) { fim_load_register(&mm_loader); } } #endif // ifdef HAVE_MATRIX_MARKET_DECODER fim-0.6-rc2/src/fim_interpreter.cpp0000644000175000017500000003661514454347340014253 00000000000000/* $LastChangedDate: 2023-03-25 20:21:41 +0100 (Sat, 25 Mar 2023) $ */ /* interpreter.cpp : Fim language interpreter (c) 2007-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "lex.h" #include "yacc.tab.hpp" #include "fim.h" #include "common.h" #include "fim_interpreter.h" #include /* va_list, va_arg, va_start, va_end */ #define FIM_INTERPRETER_ERROR "Unexpected !\n" #ifdef DBG #undef DBG #endif /* DBG */ #if 0 #define DBG(X) if(dv)std::cout<<__LINE__<<":"<opr.op[(N)]) #define FIM_FACC(O) (O)->fid.f #define FIM_SACC(O) (O)->scon.s #define FIM_IACC(O) (O)->con.value #define FIM_NOPS(O) (O)->opr.nops #define FIM_FOPRND(P,N) FIM_FACC(FIM_OPRND(P,N)) #define FIM_IOPRND(P,N) FIM_IACC(FIM_OPRND(P,N)) #define FIM_OPRNDO(P) (P)->opr.oper #define FIM_OPRNDT(P) (P)->type #define FIM_OPRNDH(P) (P)->typeHint #define FIM_GV(V) Var((fim_int)1) /* fim::cc.getVariable(V) */ #define FIM_SV(I,V) /*fim::cc.setVariable(I,V)*/ #define FIM_GVT(V) /*fim::cc.getVariableType(V)*/FIM_SYM_TYPE_FLOAT #define FIM_EC(CMD,ARGS) /* fim::cc.execute(CMD,ARGS) */ "result" /*Var((fim_int)1)*/ /* FIXME: shall return Arg or Var or Val */ typedef nodeType * NodeType; #else /* FIM_INDEPENDENT_NAMESPACE */ #define FIM_NO_BREAK ( abs(fim::cc.show_must_go_on()) == 1 && ( fim::cc.catchLoopBreakingCommand(0)==0) ) #define FIM_OPRND(P,N) ((P)->opr.op[(N)]) #define FIM_FACC(O) (O)->fid.f #define FIM_SACC(O) (O)->scon.s #define FIM_IACC(O) (O)->con.value #define FIM_NOPS(O) (O)->opr.nops #define FIM_FOPRND(P,N) FIM_FACC(FIM_OPRND(P,N)) #define FIM_IOPRND(P,N) FIM_IACC(FIM_OPRND(P,N)) #define FIM_OPRNDO(P) (P)->opr.oper #define FIM_OPRNDT(P) (P)->type #define FIM_OPRNDH(P) (P)->typeHint #define FIM_GV(V) fim::cc.getVariable(V) #define FIM_SV(I,V) fim::cc.setVariable(I,V) #define FIM_GVT(V) fim::cc.getVariableType(V) #define FIM_EC(CMD,ARGS) fim::cc.execute(CMD,ARGS) typedef nodeType * NodeType; #endif /* FIM_INDEPENDENT_NAMESPACE */ #define FIM_INTERPRETER_PARANOIA 0 namespace fim { extern CommandConsole cc; } std::ostream& operator<<(std::ostream& os, const nodeType& p) { os<< "type " << p.type << FIM_SYM_ENDL; return os; } static Var cvar(NodeType p, const bool dv, const int sd) { /* evaluate a single 'arg' entry */ NodeType np=p; fim::string arg; if(FIM_OPRNDT(p) == typeOpr && FIM_OPRNDO(p)==FIM_SYM_STRING_CONCAT) { DBG("Concat (.)"<=0); if (!p) goto ret; if (abs(fim::cc.show_must_go_on()) != 0) switch(FIM_OPRNDT(p)) { case intCon: DBG("intConstant\n") return FIM_IACC(p); case floatCon: DBG("floatConstant"< 2) ex(FIM_OPRND(p,2)); --sd; DBG("End If\n") goto ret; case FIM_SYM_SEMICOLON: DBG("Semicolon (;)\n") // cmd;cmd ex(FIM_OPRND(p,0)); if (abs(fim::cc.show_must_go_on()) == 2) { /* Workaround to interrupt an entire semantic command tree after interactive command break. * Shall better use return codes of yyparse() for this. */ fim::cout << "Command loop interrupted interactively." << FIM_SYM_ENDL; goto ret; } return ex(FIM_OPRND(p,1)); case FESF: if( FIM_NOPS(p) >= 3 ) { const fim_int n1 = ex(FIM_OPRND(p,0)).getInt(); const fim_int n2 = ex(FIM_OPRND(p,1)).getInt(); const flist_t fl = cc.browser_.get_file_list(); fim::string result; for( fim_uint fi = FIM_MAX(0,n1-1); fi 3 ) { NodeType np=p; np=(FIM_OPRND(np,3)); // right subtree first node while( np && FIM_NOPS(np) >=1 ) if( FIM_OPRNDO(np)=='a' ) { DBG("Args...\n") args_t na=var(np,dv,sd); DBG("Args: "<=1 ) if( FIM_OPRNDO(np)=='a' ) { DBG("Args...\n") args_t na=var(np,dv,sd); DBG("Args: "<': return ex(FIM_OPRND(p,0)) > ex(FIM_OPRND(p,1)); case GE: return ex(FIM_OPRND(p,0)) >= ex(FIM_OPRND(p,1)); case LE: return ex(FIM_OPRND(p,0)) <= ex(FIM_OPRND(p,1)); case NE: return ex(FIM_OPRND(p,0)) != ex(FIM_OPRND(p,1)); case EQ: {/*DBG("EQ (==)\n");*/return ex(FIM_OPRND(p,0)) == ex(FIM_OPRND(p,1));} case REGEXP_MATCH: return ex(FIM_OPRND(p,0)).re_match(ex(FIM_OPRND(p,1))); case AND:return ex(FIM_OPRND(p,0)) && ex(FIM_OPRND(p,1)); case OR :return ex(FIM_OPRND(p,0)) || ex(FIM_OPRND(p,1)); case BOR :return ex(FIM_OPRND(p,0)) | ex(FIM_OPRND(p,1)); case BAND:return ex(FIM_OPRND(p,0)) & ex(FIM_OPRND(p,1)); default: goto err; } } ret: return Var((fim_int)0); err: return Var((fim_int)-1); } /* * string constant handling */ nodeType *scon(fim_char_t*s) { if(s==NULL)yyerror("TOKEN NULL!\n"); nodeType *p; /* allocate node */ if ((p =(nodeType*) malloc(sizeof(nodeType))) == NULL) yyerror(FIM_EMSG_OUT_OF_MEM); /* copy information */ p->type = stringCon; p->scon.s=s; return p; } nodeType *vscon(fim_char_t*s,int typeHint) { #ifdef FIM_RANDOM if( strlen(s) > 5 ) // make sure s points to 6+ bytes #ifndef FIM_BIG_ENDIAN #if ((SIZEOF_INT)>=8) if( *reinterpret_cast(s+0) == 0x00006d6f646e6172 ) // ..modnar // note: wrong (can't assume two zeros, and eight byte illegal) #else /* SIZEOF_INT */ /* this is LSB order, so it is not portable code. */ if( *reinterpret_cast(s+0) == 0x646e6172 // dnar && (*reinterpret_cast(s+3))== 0x006d6f64 ) // .mod // access legal bytes //&& (*reinterpret_cast(s+4)<<8)== 0x006d6f00 ) // .mo. eight byte illegal #endif /* SIZEOF_INT */ #else /* FIM_BIG_ENDIAN */ #if ((SIZEOF_INT)>=8) if( *reinterpret_cast(s+0) == 0x72616e646f6d0000 ) // random.. // note: wrong (can't assume two zeros, and eight byte illegal) #else /* SIZEOF_INT */ if( *reinterpret_cast(s+0) == 0x72616e64 // rand && (*reinterpret_cast(s+3))== 0x646f6d00 ) // dom. // access legal bytes //&& (*reinterpret_cast(s+4)<<8)== 0x006f6d00 ) // .om. // eight byte illegal #endif /* SIZEOF_INT */ #endif /* FIM_BIG_ENDIAN */ { fim_free(s); return con(fim_rand()); } #endif /* FIM_RANDOM */ nodeType *p=scon(s); if(p) p->type = vId, p->typeHint = typeHint; return p; } nodeType *fcon(float fValue) { nodeType *p; /* allocate node */ if ((p =(nodeType*) malloc(sizeof(nodeType))) == NULL) yyerror(FIM_EMSG_OUT_OF_MEM); /* copy information */ p->type = floatCon; p->fid.f = fValue; return p; } nodeType *con(fim_int value) { nodeType *p; /* allocate node */ if ((p =(nodeType*) malloc(sizeof(nodeType))) == NULL) yyerror(FIM_EMSG_OUT_OF_MEM); /* copy information */ p->type = intCon; p->con.value = value; return p; } nodeType *opr(int oper, int nops, ...) { va_list ap; nodeType *p; int i; /* allocate node */ if ((p =(nodeType*) malloc(sizeof(nodeType) * nops)) == NULL) yyerror(FIM_EMSG_OUT_OF_MEM); /* copy information */ p->type = typeOpr; p->opr.oper = oper; p->opr.nops = nops; va_start(ap, nops); for (i = 0; i < nops; i++) p->opr.op[i] = va_arg(ap, nodeType*); va_end(ap); return p; } void freeNode(nodeType *p) { if (!p) return; if (p->type == stringCon) {fim_free(p->scon.s);p->scon.s=NULL;} if (p->type == vId) {fim_free(p->scon.s);p->scon.s=NULL;} if (p->type == typeOpr) { for (int i = 0; i < p->opr.nops; i++) freeNode(p->opr.op[i]); } free (p); } void yyerror(const fim_char_t *s) { //fprintf(stdout, "%s \n", s); /* omitting std:: causes error on darwin gcc */ //std::cout << s << "\n"; #if FIM_INDEPENDENT_NAMESPACE std::cout << s << FIM_SYM_ENDL; #else /* FIM_INDEPENDENT_NAMESPACE */ fim::cout << s << FIM_SYM_ENDL; #endif /* FIM_INDEPENDENT_NAMESPACE */ } fim-0.6-rc2/src/CommandConsole-cmd.cpp0000644000175000017500000006136014454347340014512 00000000000000/* $LastChangedDate: 2023-03-25 18:31:40 +0100 (Sat, 25 Mar 2023) $ */ /* CommandConsole-cmd.cpp : Fim console commands (c) 2009-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #ifdef HAVE_LIBGEN_H #include #endif /* HAVE_LIBGEN_H */ #define FIM_WANT_SYSTEM_CALL_DEBUG 0 #define FIM_CMD_RET_HELP_MSG(CMD) "See " FIM_FLT_HELP " " CMD " for its invocation.\n" namespace fim { fim_key_t CommandConsole::kstr_to_key(const fim_char_t * kstr)const { int l; fim_key_t key = FIM_SYM_NULL_KEY; if(!kstr) goto err; l=strlen(kstr); if(!l) goto err; #ifdef FIM_WANT_RAW_KEYS_BINDING if(l>=2 && isdigit(kstr[0]) && isdigit(kstr[1])) { /* special syntax for raw keys */ key=atoi(kstr+1); } #endif /* FIM_WANT_RAW_KEYS_BINDING */ else { if(sym_keys_.find(kstr)!= sym_keys_.end()) key=sym_keys_.find(fim::string(kstr))->second; } err: return key; } fim_cxr CommandConsole::fcmd_bind(const args_t& args) { /* * this is the interactive bind command * the user supplies a string with the key combination, and if valid, its keycode * is associated to the user supplied action (be it a command, alias, etc..) */ const fim_char_t* kerr=FIM_FLT_BIND ": invalid key argument (should be one of: k, C-k, K, }\n"; const fim_char_t* kstr=FIM_NULL; fim_key_t key=FIM_SYM_NULL_KEY; if(args.size()==0) return getBindingsList(); kstr=(args[0].c_str()); if(!kstr || 0 == strlen(kstr)) { #if FIM_WANT_BIND_ALL if(args.size()>1) { for (auto bi=bindings_.begin(); bi != bindings_.end(); ++bi) bindings_[bi->first]=args[1]; return "Re-bound all keys to " + args[1]; } else #endif return kerr; } key = kstr_to_key(args[0].c_str()); if(key==FIM_SYM_NULL_KEY) { return "supplied key "+args[0]+" is invalid.\n"; } if(args.size()==1 && bindings_.find(key)==bindings_.end()) { return "no command bound to keycode "+string(key)+" (keysym "+args[0]+").\n"; } if(args.size()==1) { //first arg should be a valid key code std::ostringstream oss; oss << FIM_FLT_BIND" '" << args[0] << "' '" << bindings_[key] << "'\n"; return oss.str(); } if(args.size()<2) return kerr; if(args[1]==FIM_CNS_EMPTY_STRING) return unbind(args[0]); if(args.size()>=3) return bind(key,args[1],args[2]); else return bind(key,args[1]); } fim_cxr CommandConsole::fcmd_unbind(const args_t& args) { /* * unbinds the action possibly bound to the first key name specified in args.. * what about multiple unbindings ? * maybe you should made surjective the binding_keys mapping.. */ if(args.size()!=1) return FIM_FLT_UNBIND ": specify the key to unbind\n"; return unbind(args[0]); } #if 0 fim_cxr CommandConsole::fcmd_setenv(const args_t& args) { /* * */ if(args.size()<2) return FIM_CNS_EMPTY_RESULT; setenv(args[0].c_str(),args[1].c_str(),1); setenv("DISPLAY","",1); return FIM_CNS_EMPTY_RESULT; } #endif fim_cxr CommandConsole::get_help(const fim_cmd_id& item, const char dl)const { if(item.size()) { if((item.at(0))==FIM_CNS_SLASH_CHAR) { /* regexp-based would be nicer */ fim::string hstr,cstr,astr,bstr,ptn; ptn = item.substr(1,item.size()); for(size_t i=0;ifirst.find(ptn) != ai->first.npos) { astr +=((*ai).first); astr += " "; } else if(ai->second.first.find(ptn) != ai->second.first.npos) { astr +=((*ai).first); astr += " "; } else if(ai->second.second.find(ptn) != ai->second.second.npos) { astr +=((*ai).first); astr += " "; } } for(bindings_t::const_iterator bi=bindings_.begin();bi!=bindings_.end();++bi) { key_syms_t::const_iterator ikbi=key_syms_.find(((*bi).first)); bindings_help_t::const_iterator bhi=bindings_help_.find((*bi).first); if(ikbi!=key_syms_.end()) { if(ikbi->second.find(ptn) != ikbi->second.npos) { bstr += ikbi->second; bstr += " "; // std::cout << "key: " << ikbi->second << "\n"; } else if(bi->second.find(ptn) != bi->second.npos) { bstr += ikbi->second; bstr += " "; // std::cout << "def: " << ikbi->second << "\n"; } if(bhi != bindings_help_.end() ) if(bhi->second.find(ptn) != bhi->second.npos) { bstr += ikbi->second; bstr += " "; // std::cout << "dsc: " << ikbi->second << "\n"; } } } /* FIXME: may extend to autocmd's */ if(!cstr.empty()) hstr+="Commands (type 'help' and one quoted command name to get more info):\n " + cstr + "\n"; if(!astr.empty()) hstr+="Aliases (type 'alias' and one quoted alias to get more info):\n " + astr + "\n"; if(!bstr.empty()) hstr+="Bindings (type 'bind' and one quoted binding to get more info):\n " + bstr + "\n"; if(!hstr.empty()) return "The following help items matched \"" + ptn + "\":\n" + hstr; else return "No item matched \"" + ptn + "\"\n"; // note that '/' will be caught here as well.. } { std::ostringstream oss; const fim::string sws = fim_help_opt(item.c_str(), dl); // consider using fim_shell_arg_escape or a modification of it here. if( sws != FIM_CNS_EMPTY_STRING ) oss << sws << "\n"; if( findCommandIdx(item) != FIM_INVALID_IDX ) oss << "\"" << item << "\" is a command, documented:\n" << commands_[findCommandIdx(item)].getHelp() << "\n"; if(aliasRecall(fim::string(item))!=FIM_CNS_EMPTY_STRING) oss << "\"" << item << "\" is an alias, and was declared as:\n" << get_alias_info(item) << "\n"; if( getBoundAction(kstr_to_key(item))!=FIM_CNS_EMPTY_STRING) oss << "\"" << item << "\" key is bound to command: " << getBoundAction(kstr_to_key(item))<<"\n"; if(isVariable(item) || fim_var_help_db_query(item).size()) oss << "\"" << item << "\" is a variable, with value:\n" << getStringVariable(item) << "\nand description:\n" << fim_var_help_db_query(item) << "\n"; if( oss.str() != FIM_CNS_EMPTY_STRING ) return oss.str(); else return item + ": no such command, alias, bound key or variable.\n"; } } return ""; } fim_cxr CommandConsole::fcmd_help(const args_t& args) { fim_cxr retval; if( !args.empty() && args[0].length()>0 ) retval = get_help(args[0],'l'); this->setVariable(FIM_VID_DISPLAY_CONSOLE,1); if(retval.empty()) retval = "" FIM_FLT_HELP " " FIM_CNS_EX_ID_STRING ": provides help for " FIM_CNS_EX_ID_STRING ", if it is a variable, alias, key, or command. Use " FIM_KBD_TAB " in commandline mode to get a list of aliases and commands. Command line mode can be entered with the default key '" FIM_SYM_CONSOLE_KEY_STR "', and left pressing " FIM_KBD_ENTER ".\n"; return retval; } fim_cxr CommandConsole::fcmd_quit(const args_t& args) { /* * now the postcycle execution autocommands are enabled ! * */ show_must_go_on_=0; if( args.size() < 1 ) return_code_=0; else return_code_=(int)args[0]; return FIM_CNS_EMPTY_RESULT; } #ifndef FIM_WANT_NOSCRIPTING fim_cxr CommandConsole::fcmd_executeFile(const args_t& args) { for(size_t i=0;i0 ) fwrite(buf,rc,1,tfd); rewind(tfd); */ /* * Note that it would be much nicer to do this in another way, * but it would require to rewrite much of the file loading stuff * (which is quite fbi's untouched stuff right now) * */ ImagePtr stream_image=FIM_NULL; if(!tfd) return FIM_ERR_GENERIC; try{ stream_image=ImagePtr ( new Image(FIM_STDIN_IMAGE_NAME,fim_fread_tmpfile(tfd)) ); } catch (FimException e){/* write me */} #ifdef FIM_READ_STDIN_IMAGE if(stream_image) { #if FIM_USE_CXX11 browser_.set_default_image(ImagePtr(std::move(stream_image))); #else /* FIM_USE_CXX11 */ browser_.set_default_image(stream_image); #endif /* FIM_USE_CXX11 */ browser_.push_path(FIM_STDIN_IMAGE_NAME); } #else /* FIM_READ_STDIN_IMAGE */ /* FIXME: this point should be better not reached */ #endif /* FIM_READ_STDIN_IMAGE */ return FIM_ERR_NO_ERROR; //pclose(tfd); } #ifdef FIM_PIPE_IMAGE_READ /* * FBI/FIM FILE PROBING MECHANISMS ARE NOT THOUGHT WITH PIPES IN MIND! * THEREFORE WE MUST FIND A SMARTER TRICK TO IMPLEMENT THIS * */ fim_cxr CommandConsole::fcmd_pread(const args_t& args) { /* * we read a whole image file from pipe * */ size_t i; FILE* tfd; /* fim_char_t buf[FIM_PIPE_BUFSIZE]; int rc=0; */ for(i=0;i " << fim::string((int)(((*ki).second))); oss << " "; } oss << "\n"; return oss.str(); } #ifdef FIM_RECORDING fim::string CommandConsole::dump_record_buffer(const args_t& args) { return do_dump_record_buffer(args,false); } fim::string CommandConsole::do_dump_record_buffer(const args_t& args, bool headeronly)const { std::ostringstream oss; if(headeronly) oss << recorded_actions_.size() << " commands.\n"; else for(size_t i=0;iconsole_control(0x01); return FIM_CNS_EMPTY_RESULT; } fim::string CommandConsole::scroll_down(const args_t& args) { if(!displaydevice_) { } else displaydevice_->console_control(0x02); return FIM_CNS_EMPTY_RESULT; } fim_cxr CommandConsole::fcmd_clear(const args_t& args) { displaydevice_->console_control(0x03);//experimental return FIM_CNS_EMPTY_RESULT; } #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ fim_cxr CommandConsole::fcmd_do_getenv(const args_t& args) { string help="usage: " FIM_CMD_HELP_GETENV; #ifndef HAVE_GETENV help="sorry, no getenv call was not available at build time\n"; #endif /* HAVE_GETENV */ if( ! args.size()) return help; #ifdef HAVE_GETENV if(1==args.size()) { if(fim_getenv(args[0].c_str())) setVariable( fim::string("ENV_")+args[0], fim_getenv(args[0].c_str()) ); return FIM_CNS_EMPTY_RESULT; } else return help; #else /* HAVE_GETENV */ return help; #endif /* HAVE_GETENV */ } #if FIM_WANT_PIC_CMTS_RELOAD #if FIM_USE_CXX11 /* */ #else /* FIM_USE_CXX11 */ static void fim_cc_fetch(const std::pair & dfp){cc.id_.fetch(dfp.first,dfp.second);} #endif /* FIM_USE_CXX11 */ #endif /* FIM_WANT_PIC_CMTS_RELOAD */ fim_cxr CommandConsole::fcmd_desc(const args_t& args) { #if FIM_WANT_PIC_CMTS fim_char_t sc = '\t'; const int aoc = fim_args_opt_count(args,'-'); #if FIM_WANT_PIC_CMTS_RELOAD if ( args.size()-aoc > 0 && args[aoc] == "reload" ) { #if FIM_USE_CXX11 for (auto & dfp : cc.browser_.dfl_) cc.id_.fetch(dfp.first,dfp.second); #else /* FIM_USE_CXX11 */ std::for_each(cc.browser_.dfl_.begin(),cc.browser_.dfl_.end(),fim_cc_fetch); #endif /* FIM_USE_CXX11 */ browser_.cache_.desc_update(); } #endif /* FIM_WANT_PIC_CMTS_RELOAD */ if(2 > args.size()-aoc ) goto err; if ( args[aoc] == "load" ) { if(2 < args.size()-aoc) sc = *args[2+aoc].c_str(); this->id_.fetch(args[1+aoc],sc); browser_.cache_.desc_update(); } else if ( args[aoc] == "save" ) { const bool saveall = fim_args_opt_have(args,"-all"); const bool wappend = fim_args_opt_have(args,"-append"); const bool nooverw = fim_args_opt_have(args,"-nooverw"); const string sdn = args[aoc+1]; if(2 < args.size()-aoc) sc = *args[2+aoc].c_str(); if(nooverw && is_file_nonempty(sdn)) goto err; browser_.dump_desc(args[1+aoc].c_str(),sc,saveall,wappend); } else goto err; err: #endif /* FIM_WANT_PIC_CMTS */ return FIM_CNS_EMPTY_RESULT; } } /* namespace fim */ fim-0.6-rc2/src/FbiStuffText.cpp0000644000175000017500000001265114454347340013424 00000000000000/* $LastChangedDate: 2013-07-04 21:56:00 +0200 (Thu, 04 Jul 2013) $ */ /* FbiStuffBitText.cpp : fbi functions for rendering image bytes as text (c) 2013-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * this is basically toy code, so enjoy! * */ #include "fim.h" #if FIM_WANT_TEXT_RENDERING #include #include #include #include #ifdef HAVE_ENDIAN_H #include #endif /* HAVE_ENDIAN_H */ namespace fim { extern CommandConsole cc; /* ---------------------------------------------------------------------- */ typedef unsigned int uint32; typedef unsigned short uint16; /* ---------------------------------------------------------------------- */ /* load */ struct text_state { FILE *fp; uint32 w; uint32 h; uint32 flen; struct fs_font *f_; fim_int fw,fh; long maxc; fim_int cw,ch; }; static void* text_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { struct text_state *h=FIM_NULL; long ftellr; const fim_int prwv=cc.getIntVariable(FIM_VID_PREFERRED_RENDERING_WIDTH); const fim_int prw=prwv<1?FIM_BITRENDERING_DEF_WIDTH:prwv; h = (struct text_state *)fim_calloc(1,sizeof(*h)); if(!h) goto oops; FontServer::fb_text_init1(FIM_NULL,&(h->f_)); // FIXME : move this outta here if(!h->f_) goto oops; h->fp = fp; h->fw = h->f_->width; h->fh = h->f_->height; h->cw = prw / h->fw; if(fseek(fp,0,SEEK_END)!=0) goto oops; ftellr=ftell(fp); if((ftellr)==-1) goto oops; if(ftellr==0) ftellr=1; /* (artificial) promotion to 1x1 */ h->maxc = (128*1024*1024)/(3*h->fw*h->fh); ftellr = FIM_MIN(h->maxc,ftellr); /* FIXME: shall make max allocation limit configurable :) */ h->cw = FIM_MIN(h->cw, ftellr); h->ch = ( ( ftellr + h->cw - 1 ) / h->cw ); i->npages = 1; i->width = h->w = /* prw */ h->fw * h->cw; i->height = h->h = h->ch * h->fh; return h; oops: if(h && h->f_)fim_free_fs_font(h->f_); if(h)fim_free(h); return FIM_NULL; } static void fs_render_fb(fim_byte_t *ptr, int pitch, FSXCharInfo *charInfo, int fs_bpp_, fim_byte_t *data) { /* FIXME: shall produce generic version of this code and move somewhere else */ /* * These preprocessor macros should serve *only* for font handling purposes. * */ #define BIT_ORDER BitmapFormatBitOrderMSB #ifdef BYTE_ORDER #undef BYTE_ORDER #endif /* BYTE_ORDER */ #define BYTE_ORDER BitmapFormatByteOrderMSB #define SCANLINE_UNIT BitmapFormatScanlineUnit8 #define SCANLINE_PAD BitmapFormatScanlinePad8 #define EXTENTS BitmapFormatImageRectMin #define SCANLINE_PAD_BYTES 1 #define GLWIDTHBYTESPADDED(bits, nBytes) \ ((nBytes) == 1 ? (((bits) + 7) >> 3) /* pad to 1 byte */\ :(nBytes) == 2 ? ((((bits) + 15) >> 3) & ~1) /* pad to 2 bytes */\ :(nBytes) == 4 ? ((((bits) + 31) >> 3) & ~3) /* pad to 4 bytes */\ :(nBytes) == 8 ? ((((bits) + 63) >> 3) & ~7) /* pad to 8 bytes */\ : 0) int row,bit,x; const int bpr = GLWIDTHBYTESPADDED((charInfo->right - charInfo->left), SCANLINE_PAD_BYTES); for (row = 0; row < (charInfo->ascent + charInfo->descent); row++) { for (x = 0, bit = 0; bit < (charInfo->right - charInfo->left); bit++) { if (data[bit>>3] & fs_masktab[bit&7]) // WARNING ! // fs_setpixel(ptr+x,fs_white_); ptr[x+0]=0xFF, ptr[x+1]=0xFF, ptr[x+2]=0xFF; x += fs_bpp_; } data += bpr; ptr += pitch; } #undef BIT_ORDER #undef BYTE_ORDER #undef SCANLINE_UNIT #undef SCANLINE_PAD #undef EXTENTS #undef SCANLINE_PAD_BYTES #undef GLWIDTHBYTESPADDED } static void text_read(fim_byte_t *dst, unsigned int line, void *data) { struct text_state *h = (struct text_state *) data; int fr,cc=0; if(line==0) { fim_bzero(dst,3*h->h*h->w); fseek(h->fp, 0,SEEK_SET ); while( ( fr = fgetc(h->fp) ) != EOF && cc < h->maxc ) { fim_byte_t *dstp=dst+3*( (cc/h->cw)*h->fh*h->w + (cc%h->cw)*h->fw); if(!isprint(fr)) fr=FIM_SYM_UNKNOWN_CHAR; fs_render_fb(dstp, h->w*3 , h->f_->eindex[fr], 3, h->f_->gindex[fr]); cc++; } } } static void text_done(void *data) { struct text_state *h = (struct text_state *) data; fclose(h->fp); if(h && h->f_)fim_free_fs_font(h->f_); fim_free(h); } struct ida_loader text_loader = { /* not a filetype-specific decoder */ /*magic:*/ "", /*moff:*/ 0, /*mlen:*/ 0, /*name:*/ "Text", /*init:*/ text_init, /*read:*/ text_read, /*done:*/ text_done, }; static void fim__init init_rd(void) { fim_load_register(&text_loader); } } #endif /* FIM_WANT_TEXT_RENDERING */ fim-0.6-rc2/src/Image.cpp0000644000175000017500000010220114454347340012060 00000000000000/* $LastChangedDate: 2023-03-25 18:31:40 +0100 (Sat, 25 Mar 2023) $ */ /* Image.cpp : Image manipulation and display (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ //#include "Image.h" #include "fim.h" #if FIM_WANT_EXIFTOOL #include "ExifTool.h" #endif /* FIM_WANT_EXIFTOOL */ #define FIM_IMAGE_INSPECT 0 #if FIM_IMAGE_INSPECT #define FIM_PR(X) printf("IMAGE:%c:%20s: f:%d/%d p:%d/%d %s\n",X,__func__,(int)getGlobalIntVariable(FIM_VID_FILEINDEX),(int)getGlobalIntVariable(FIM_VID_FILELISTLEN),(int)getGlobalIntVariable(FIM_VID_PAGE),(int)getIntVariable(FIM_VID_PAGES),(cacheable()?"cacheable":"uncacheable")); #else /* FIM_IMAGE_INSPECT */ #define FIM_PR(X) #endif /* FIM_IMAGE_INSPECT */ #define FIM_WANT_ASCALE_FRIENDLY_ROTATION 1 #if FIM_CACHE_DEBUG #if FIM_WANT_PIC_CMTS std::ostream& operator<<(std::ostream& os, const ImgDscs & id) { return id.print(os); } #endif /* FIM_WANT_PIC_CMTS */ #endif /* FIM_CACHE_DEBUG */ namespace fim { static void fim_desaturate_rgb(fim_byte_t * data, fim_pxc_t howmany) { FIM_REGISTER int avg; for( fim_byte_t * p = data; p < data + howmany ;p+=3) { avg=p[0]+p[1]+p[2]; p[0]=p[1]=p[2]=(fim_byte_t) (avg/3); } } static void fim_simulate_cvd(fim_byte_t * data, fim_pxc_t howmany, enum fim_cvd_t cvd, bool daltonize) { /* Based on formulas from from http://www.daltonize.org */ fim_pif_t l,m,s; // long medium short [cones] fim_pif_t dl,dm,ds; // long medium short [cones] fim_pif_t er,eg,eb; // red green blue fim_byte_t r,g,b; // red green blue fim_byte_t dr,dg,db; // red green blue #define FIM_PD3_T(RC,R,GC,G,BC,B,T) \ ((RC*(T)R)+(GC*(T)G)+(BC*(T)B)) #define FIM_RGB_TRIM(V) FIM_MIN(FIM_MAX(0.0,V),255.0) #define FIM_PD3(RC,R,GC,G,BC,B) \ (FIM_PD3_T(RC,R,GC,G,BC,B,fim_pif_t)) #define FIM_CPS(V1,V2) (((fim_pif_t)(V1))-((fim_pif_t)(V2))) for( fim_byte_t * p = data; p < data + howmany ;p+=3) { r=p[0]; g=p[1]; b=p[2]; dl=l=FIM_PD3(17.8824 ,r, 43.5161,g, 4.11935,b), dm=m=FIM_PD3(3.45565 ,r, 27.1554,g, 3.86714,b), ds=s=FIM_PD3(0.0299566,r,0.184309,g, 1.46709,b); if(cvd == FIM_CVD_PROTANOPIA ) dl=FIM_PD3(0.0 ,l,2.02344 ,m,-2.52581,s), dm=FIM_PD3(0.0 ,l,1.0 ,m, 0.0 ,s), ds=FIM_PD3(0.0 ,l,0.0 ,m, 1.0 ,s); if(cvd == FIM_CVD_DEUTERANOPIA) dl=FIM_PD3(1.0 ,l,0.0,m,0.0 ,s), dm=FIM_PD3(0.494207 ,l,0.0,m,1.24827 ,s), ds=FIM_PD3(0.0 ,l,0.0,m,1.0 ,s); if(cvd == FIM_CVD_TRITANOPIA) dl=FIM_PD3(1.0 ,l,0.0 ,m,0.0 ,s), dm=FIM_PD3(0.0 ,l,1.0 ,m,0.0 ,s), ds=FIM_PD3(-0.395913,l,0.801109,m,0.0 ,s); dr=FIM_RGB_TRIM(FIM_PD3( 0.080944 ,dl,-0.130504 ,dm, 0.116721,ds)), dg=FIM_RGB_TRIM(FIM_PD3(-0.0102485 ,dl, 0.0540194 ,dm,-0.113614,ds)), db=FIM_RGB_TRIM(FIM_PD3(-0.000365294,dl,-0.00412163,dm, 0.693513,ds)); if(daltonize) { er=FIM_CPS(r,dr); eg=FIM_CPS(g,dg); eb=FIM_CPS(b,db); dr+=FIM_RGB_TRIM(FIM_PD3(0.0 ,er,0.0 ,eg,0.0 ,eb)); dg+=FIM_RGB_TRIM(FIM_PD3(0.7 ,er,1.0 ,eg,0.0 ,eb)); db+=FIM_RGB_TRIM(FIM_PD3(0.7 ,er,0.0 ,eg,1.0 ,eb)); } p[0]=dr; p[1]=dg; p[2]=db; } #undef FIM_PD3 #undef FIM_PD3_T #undef FIM_CPS #undef FIM_RGB_TRIM } static bool fim_generate_24bit_identity(fim_byte_t * data, fim_pxc_t howmany) { int val=0x0; for( fim_byte_t * p = data; p < data + howmany ;p+=3) { p[2] = (fim_byte_t )( ( val & 0x000000FF ) >> 0 );//b p[1] = (fim_byte_t )( ( val & 0x0000FF00 ) >> 8 ); p[0] = (fim_byte_t )( ( val & 0x00FF0000 ) >> 16 );//r ++val; } return true; } static void fim_negate_rgb(fim_byte_t * data, fim_pxc_t howmany) { #if FIM_USE_CXX11 //This is just an example; in C++17 (not yet in compiler when writing this) we shall be able to have: //#include //std::for_each(std::execution::parallel_policy,data,data+howmany,[](fim_byte_t & b){b = ~ b;}); std::for_each(data,data+howmany,[](fim_byte_t & b){b = ~ b;}); #else /* FIM_USE_CXX11 */ for( fim_byte_t * p = data; p < data + howmany ;p++) *p = ~ *p; #endif /* FIM_USE_CXX11 */ } #if FIM_WANT_IMG_SHRED static void fim_shred(fim_byte_t * data, fim_pxc_t howmany) { fim_desaturate_rgb(data, howmany); fim_negate_rgb( data, howmany); } #endif /* FIM_WANT_IMG_SHRED */ fim_coo_t Image::original_width(void)const { fim_coo_t ow; assert(fimg_); if(orientation_%2) ow = fimg_->i.height; else ow = fimg_->i.width; return ow; } fim_coo_t Image::original_height(void)const { fim_coo_t ow; assert(fimg_); if(orientation_%2) ow = fimg_->i.width; else ow = fimg_->i.height; return ow; } int Image::width(void)const { assert(img_); return img_->i.width; } int Image::height(void)const { assert(img_); return img_->i.height; } void Image::desc_update(void) { #if FIM_WANT_PIC_CMTS fim_fn_t key(fname_.c_str()); if(cc.id_.find(key) != cc.id_.end() ) { setVariable(FIM_VID_COMMENT,(cc.id_[key])); } else { key = fim_fn_t (fim_basename_of(fname_)); if(cc.id_.find(key) != cc.id_.end() ) setVariable(FIM_VID_COMMENT,(cc.id_[key])); } #if FIM_WANT_PIC_LVDN assign_ns(cc.id_.vd_[key]); #endif /* FIM_WANT_PIC_LVDN */ #endif /* FIM_WANT_PIC_CMTS */ } bool Image::fetchExifToolInfo(const fim_char_t *fname) { #if FIM_WANT_EXIFTOOL fim_int ue = getGlobalIntVariable(FIM_VID_EXIFTOOL); /* one might execute this code in a background thread */ std::ostringstream oss; if ( ExifTool *et = new ExifTool ) { if ( TagInfo *info = et->ImageInfo(fname,FIM_NULL,2) ) { for (TagInfo *i=info; i; i=i->next) { oss << i->name << " = " << i->value << ";" << "\n"; //std::cout << "reading " << i->name << "...\n"; } delete info; } else if (et->LastComplete() <= 0) { std::cerr << "Error executing exiftool!" << std::endl; } char *err = et->GetError(); if (err) std::cerr << err; delete et; // delete our ExifTool object //std::cout << "setting: " << oss.str() << "\n", if(ue == 1) setVariable(FIM_VID_COMMENT,getVariable(FIM_VID_COMMENT)+oss.str()); if(ue == 2) setVariable(FIM_VID_EXIFTOOL_COMMENT,oss.str()); return true; } #endif /* FIM_WANT_EXIFTOOL */ return false; } Image::Image(const fim_char_t *fname, FILE*fd, fim_page_t page): #ifdef FIM_NAMESPACES Namespace(&cc,FIM_SYM_NAMESPACE_IMAGE_CHAR), #endif /* FIM_NAMESPACES */ scale_(0.0), ascale_(0.0), newscale_(0.0), angle_(0.0), newangle_(0.0), page_(0), img_ (FIM_NULL), fimg_ (FIM_NULL), orientation_(FIM_NO_ROT), fis_(fim::string(fname)==fim::string(FIM_STDIN_IMAGE_NAME)?FIM_E_STDIN:FIM_E_FILE), fname_ (FIM_CNS_DEFAULT_IFNAME), fs_(0) { reset(); if( !load(fname,fd,/*getGlobalIntVariable(FIM_VID_PAGE)*/page) || !check_valid() || (!fimg_) ) { FIM_PR('e'); // FIXME: sometimes load() intentionally skips a file. an appropriate message shall be printed out cout << "warning: invalid loading "<i),EXTRA_COMMENT); if(ie) setVariable(FIM_VID_COMMENT,(fim_char_t*)(ie->data)); if(fname) desc_update(); #endif /* FIM_WANT_PIC_CMTS */ #if FIM_WANT_EXIFTOOL if(fname && getGlobalIntVariable(FIM_VID_EXIFTOOL) != 0) fetchExifToolInfo(fname); #endif /* FIM_WANT_EXIFTOOL */ } } void Image::reset(void) { fimg_ = FIM_NULL; img_ = FIM_NULL; reset_view_props(); if( getGlobalIntVariable(FIM_VID_AUTOTOP ) ) setVariable(FIM_VID_AUTOTOP,getGlobalIntVariable(FIM_VID_AUTOTOP)); } void Image::reset_view_props(void) { scale_ = FIM_CNS_SCALE_DEFAULT; newscale_= FIM_CNS_SCALE_DEFAULT; ascale_ = FIM_CNS_SCALE_DEFAULT; angle_ = FIM_CNS_ANGLE_DEFAULT; orientation_=FIM_NO_ROT; setVariable(FIM_VID_SCALE ,newscale_*100); setVariable(FIM_VID_ASCALE ,ascale_); setVariable(FIM_VID_ANGLE ,angle_); setVariable(FIM_VID_NEGATED , 0); setVariable(FIM_VID_DESATURATED, 0); setVariable(FIM_VID_ORIENTATION, FIM_NO_ROT); } void Image::set_exif_extra(fim_int shouldrotate, fim_int shouldmirror, fim_int shouldflip) { if(shouldrotate) setVariable(FIM_VID_EXIF_ORIENTATION,shouldrotate); if(shouldmirror) setVariable(FIM_VID_EXIF_MIRRORED,1); if(shouldflip) setVariable(FIM_VID_EXIF_FLIPPED,1); } static void ers(const char*value, Image * image) { // EXIF orientation value can be of the form "X - Y", with X and Y in // {top,bottom,left,right} // // from http://sylvana.net/jpegcrop/exif_orientation.html // we got the following combinations: // Value 0th Row 0th Column // 1 top left side // 2 top right side // 3 bottom right side // 4 bottom left side // 5 left side top // 6 right side top // 7 right side bottom // 8 left side bottom // // neatly depicted in an F letter example: // // 1 2 3 4 5 6 7 8 // // 888888 888888 88 88 8888888888 88 88 8888888888 // 88 88 88 88 88 88 88 88 88 88 88 88 // 8888 8888 8888 8888 88 8888888888 8888888888 88 // 88 88 88 88 // 88 88 888888 888888 // // note that (in this order): // 2,3,5,7 want a mirror transformation // 4,3 want a flip transformation // 7,8 want a cw rotation // 5,6 want a ccw rotation // bool shouldmirror,shouldflip; fim_int shouldrotate = 0; fim_char_t r,c; const fim_char_t *p = FIM_NULL; fim_char_t f; if(!value || FIM_NULL == strchr(value,'-')) goto uhmpf; p = strchr(value,'-')+1; r=tolower(value[0]); c=tolower(p[0]); switch(r) { case 't': switch(c){ case 'l':f=1; break; case 'r':f=2; break; default: f=0; } break; case 'b': switch(c){ case 'r':f=3; break; case 'l':f=4; break; default: f=0; } break; case 'l': switch(c){ case 't':f=5; break; case 'b':f=8; break; default: f=0; } break; case 'r': switch(c){ case 't':f=6; break; case 'b':f=7; break; default: f=0; } break; default: f=0; } if(f==0) goto uhmpf; shouldmirror=(f==2 || f==3 || f==5 || f==7); shouldflip=(f==4 || f==3); if (f==5 || f==6) shouldrotate = Image::FIM_ROT_R; // cw if (f==7 || f==8) shouldrotate = Image::FIM_ROT_L; // ccw //std::cout << "EXIF_TAG_ORIENTATION FOUND !\n", //std::cout << "VALUE: " <<(int)f << r<< c<< //shouldmirror << shouldrotate << shouldflip, //std::cout << "\n"; if(shouldmirror && shouldflip && !shouldrotate) shouldmirror = false, shouldflip = false, shouldrotate = Image::FIM_ROT_U; image->set_exif_extra(shouldrotate, shouldmirror, shouldflip); uhmpf: return; } bool Image::load(const fim_char_t *fname, FILE* fd, int want_page) { /* * an image is loaded and initializes this image. * returns false if the image does not load */ bool retval = false; #if FIM_WANT_IMAGE_LOAD_TIME fim_fms_t dt=getmilliseconds(); #endif /* FIM_WANT_IMAGE_LOAD_TIME */ FIM_PR('*'); if(fname==FIM_NULL && fname_==FIM_CNS_EMPTY_STRING) { FIM_PR('e'); goto ret;//no loading = no state change } this->free(); fname_=fname; if( getGlobalIntVariable(FIM_VID_DISPLAY_STATUS_BAR)||getGlobalIntVariable(FIM_VID_DISPLAY_BUSY)) { if( getGlobalIntVariable(FIM_VID_WANT_PREFETCH) == 1) cc.set_status_bar("please wait while prefetching...", "*"); else cc.set_status_bar("please wait while reloading...", "*"); } fimg_ = FbiStuff::read_image(fname,fd,want_page,this); #if 0 if(fimg_) { // fim_free(fimg_->data); /* Such dimensions break SDL */ fimg_->i.width = 100*1000*1000; fimg_->i.height = 1; fimg_->data = fim_pm_alloc(fimg_->i.width, fimg_->i.height); for(int i=0;ii.width*fimg_->i.height;++i) fimg_->data[i*3+0]=i%256, fimg_->data[i*3+1]=i%256, fimg_->data[i*3+2]=i%256; } #endif #if FIM_WANT_MIPMAPS if(fimg_) mm_make(); #endif /* FIM_WANT_MIPMAPS */ if(strcmp(FIM_STDIN_IMAGE_NAME,fname)==0) { fis_ = FIM_E_STDIN; // yes, it seems redundant but it is necessary } else { #if FIM_WANT_KEEP_FILESIZE #if HAVE_SYS_STAT_H struct stat stat_s; if(-1!=stat(fname,&stat_s)) { fs_=stat_s.st_size; } #endif /* HAVE_SYS_STAT_H */ #endif /* FIM_WANT_KEEP_FILESIZE */ } img_=fimg_; /* no scaling: one copy only */ should_redraw(); if(! img_) { FIM_PR('!'); cout<<"warning: image loading error!\n" ; goto ret; } else page_=want_page; #ifdef FIM_NAMESPACES #if FIM_WANT_IMAGE_LOAD_TIME setVariable(FIM_VID_IMAGE_LOAD_TIME,(fim_float_t)((getmilliseconds()-dt)/1000.0)); #endif /* FIM_WANT_IMAGE_LOAD_TIME */ setVariable(FIM_VID_PAGES ,fimg_->i.npages); setVariable(FIM_VID_HEIGHT ,fimg_->i.height); setVariable(FIM_VID_WIDTH ,fimg_->i.width ); setVariable(FIM_VID_SHEIGHT, img_->i.height); setVariable(FIM_VID_SWIDTH, img_->i.width ); setVariable(FIM_VID_FIM_BPP, getGlobalIntVariable(FIM_VID_FIM_BPP) ); setVariable(FIM_VID_FILENAME,fname_); setVariable(FIM_VID_SCALE ,newscale_*100); setVariable(FIM_VID_ASCALE,ascale_); setVariable(FIM_VID_ANGLE , angle_); setVariable(FIM_VID_NEGATED , 0); setVariable(FIM_VID_DESATURATED, 0); setVariable(FIM_VID_ORIENTATION, FIM_NO_ROT); #endif /* FIM_NAMESPACES */ setGlobalVariable(FIM_VID_HEIGHT ,fimg_->i.height); setGlobalVariable(FIM_VID_WIDTH ,fimg_->i.width ); setGlobalVariable(FIM_VID_SHEIGHT, img_->i.height); setGlobalVariable(FIM_VID_SWIDTH , img_->i.width ); //setGlobalVariable(FIM_VID_SCALE ,newscale_*100); //setGlobalVariable(FIM_VID_ASCALE ,ascale_); if( getGlobalIntVariable(FIM_VID_DISPLAY_STATUS_BAR)||getGlobalIntVariable(FIM_VID_DISPLAY_BUSY)) cc.browser_.display_status(cc.browser_.current().c_str()); /* FIXME: an ugly way to force the proper status display */ if(isSetVar("EXIF_Orientation")) ers(getStringVariable("EXIF_Orientation").c_str(),this); FIM_PR('.'); retval = true; ret: return retval; } Image::~Image(void) { FIM_PR('*'); #ifdef FIM_CACHE_DEBUG std::cout << "freeing Image " << this << "\n"; #endif /* FIM_CACHE_DEBUG */ this->free(); FIM_PR('.'); } bool Image::is_tiny(void)const { if(!img_) return true; return ( img_->i.width<=1 || img_->i.height<=1 )?true:false; } fim_err_t Image::scale_multiply(fim_scale_t sm) { if(scale_*sm>0.0) newscale_=scale_*sm; return do_scale_rotate(); } fim_err_t Image::set_scale(fim_scale_t ns) { newscale_=ns; return do_scale_rotate(); } bool Image::check_valid(void)const { if(!img_) img_ = fimg_; if(!img_) return false; else return true; } void Image::free(void) { FIM_PR('*'); #if FIM_WANT_IMG_SHRED if(FIM_WANT_IMG_SHRED ) /* activate this only for debug purposes */ this->shred(); #endif /* FIM_WANT_IMG_SHRED */ if(fimg_!=img_ && img_ ) FbiStuff::free_image(img_ ); if(fimg_ ) FbiStuff::free_image(fimg_); #if FIM_WANT_MIPMAPS mm_free(); #endif /* FIM_WANT_MIPMAPS */ reset(); FIM_PR('.'); } #if FIM_WANT_IMG_SHRED void Image::shred(void) { FIM_PR('*'); if(fimg_!=img_ && img_ ) { fim_shred(img_->data, fbi_img_pixel_bytes(img_)); } if(fimg_ ) { FbiStuff::free_image(fimg_); } FIM_PR('.'); } #endif /* FIM_WANT_IMG_SHRED */ #if FIM_WANT_CROP fim_err_t Image::do_crop(const ida_rect prect) { struct ida_image * img = fimg_; const int x1 = FIM_INT_PCNT(prect.x1, img->i.width); const int y1 = FIM_INT_PCNT(prect.y1, img->i.height); const int x2 = FIM_INT_PCNT(prect.x2, img->i.width-1); const int y2 = FIM_INT_PCNT(prect.y2, img->i.height-1); if ( x2 > x1 && y2 > y1 ) if ( x1 >= 0 && x2 < (int) img->i.width ) if ( y1 >= 0 && y2 < (int) img->i.height ) { struct ida_image *rb = NULL; const ida_rect rect { x1, y1, x2, y2 }; rb = FbiStuff::crop_image(img,rect); if(rb) { img = rb; setVariable(FIM_VID_HEIGHT ,img->i.height); setVariable(FIM_VID_WIDTH ,img->i.width ); setVariable(FIM_VID_SHEIGHT,img->i.height); setVariable(FIM_VID_SWIDTH ,img->i.width ); FbiStuff::free_image(fimg_); if( img_ != fimg_ ) FbiStuff::free_image(img_); fimg_ = img_ = img; mm_make(); should_redraw(); } } return FIM_ERR_NO_ERROR; } #endif /* FIM_WANT_CROP */ fim_err_t Image::do_rotate( void ) { if( img_ && ( orientation_==FIM_ROT_L || orientation_ == FIM_ROT_R )) { // we make a backup.. who knows! // FIXME: should use a faster and memory-smarter member function: in-place struct ida_image *rb=img_; rb = FbiStuff::rotate_image90(rb,orientation_==FIM_ROT_L?FIM_I_ROT_L:FIM_I_ROT_R); if(rb) { FbiStuff::free_image(img_); img_=rb; } } if( img_ && orientation_ == FIM_ROT_U) { // we make a backup.. who knows! struct ida_image *rbb=FIM_NULL,*rb=FIM_NULL; // FIXME: should use a faster and memory-smarter member function: in-place rb = FbiStuff::rotate_image90(img_,FIM_I_ROT_L); if(rb) rbb = FbiStuff::rotate_image90(rb,FIM_I_ROT_L); if(rbb) { FbiStuff::free_image(img_); FbiStuff::free_image(rb); img_=rbb; } else { if(rbb) FbiStuff::free_image(rbb); if(rb ) FbiStuff::free_image(rb); } } /* we rotate only in case there is the need to do so */ if( img_ && ( angle_ != newangle_ || newangle_) ) { // we make a backup.. who knows! struct ida_image *rbb=FIM_NULL,*rb=FIM_NULL; rb = FbiStuff::rotate_image(img_,newangle_); if(rb) rbb = FbiStuff::rotate_image(rb,0); if(rbb) { FbiStuff::free_image(img_); FbiStuff::free_image(rb); img_=rbb; } else { if(rbb) FbiStuff::free_image(rbb); if(rb ) FbiStuff::free_image(rb); } } return FIM_ERR_NO_ERROR; } fim_err_t Image::do_scale_rotate( fim_scale_t ns ) { /* * effective image rescaling * */ fim_pgor_t neworientation; fim_angle_t gascale; fim_scale_t newascale; fim_angle_t gangle; if(ns>0.0) newscale_=ns;//patch if( !check_valid() ) goto err; if(is_tiny() && newscale_0.0 && newascale!=1.0)?newascale:((gascale>0.0 && gascale!=1.0)?gascale:1.0); //float newascale=getFloatVariable(FIM_VID_ASCALE); if(newascale<=0.0) newascale=1.0; /* * The global angle_ variable value will override the local if not 0 and the local unset * */ gangle =getGlobalFloatVariable(FIM_VID_ANGLE), newangle_=getFloatVariable(FIM_VID_ANGLE); newangle_=angle_?newangle_:((gangle!=0.0)?gangle:newangle_); if( newscale_ == scale_ && newascale == ascale_ && neworientation == orientation_ //&& newangle_ == angle_ && ( !newangle_ && !angle_ ) ) { goto ret;/*no need to rescale*/ } orientation_ = FIM_MOD(neworientation,FIM_ROT_ROUND); setGlobalVariable(FIM_VID_SCALE,newscale_*100); if(fimg_) { /* * In case of memory allocation failure, we would * like to recover the current image. * * Here it would be nice to add some sort of memory manager * keeping score of copies and ... too complicated ... */ struct ida_image *backup_img=img_; if(getGlobalIntVariable(FIM_VID_DISPLAY_STATUS_BAR)||getGlobalIntVariable(FIM_VID_DISPLAY_BUSY)) cc.set_status_bar("please wait while rescaling...", "*"); #if FIM_WANT_ASCALE_FRIENDLY_ROTATION if( img_ && ( orientation_==FIM_ROT_L || orientation_ == FIM_ROT_R )) if( newascale != 1.0 ) newascale = 1.0 / newascale; #endif /* FIM_WANT_ASCALE_FRIENDLY_ROTATION */ #define FIM_PROGRESSIVE_RESCALING 0 #if FIM_PROGRESSIVE_RESCALING /* * progressive rescaling is computationally convenient in when newscale_scale_ && scale_ > 1.0) || ( newscale_0)?(&mm_):FIM_NULL #endif /* FIM_WANT_MIPMAPS */ ); #endif /* FIM_PROGRESSIVE_RESCALING */ #if FIM_WANT_ASCALE_FRIENDLY_ROTATION if( img_ && ( orientation_==FIM_ROT_L || orientation_ == FIM_ROT_R )) if( newascale != 1.0 ) newascale = 1.0 / newascale; #endif /* FIM_WANT_ASCALE_FRIENDLY_ROTATION */ do_rotate(); if(!img_) { img_=backup_img; if(getGlobalIntVariable(FIM_VID_DISPLAY_BUSY)) cc.set_status_bar( "rescaling failed (insufficient memory?!)", getInfo().c_str()); sleep(1); //just to give a glimpse.. } else { /* reallocation succeeded */ if( backup_img && backup_img!=fimg_ ) FbiStuff::free_image(backup_img); scale_=newscale_; ascale_=newascale; angle_ =newangle_; should_redraw(); } /* * it is important to set these values after rotation, too! * */ setVariable(FIM_VID_HEIGHT ,fimg_->i.height); setVariable(FIM_VID_WIDTH ,fimg_->i.width ); setVariable(FIM_VID_SHEIGHT, img_->i.height); setVariable(FIM_VID_SWIDTH , img_->i.width ); setVariable(FIM_VID_ASCALE , ascale_ ); //setGlobalVariable(FIM_VID_ANGLE , angle_ ); } else should_redraw(); /* FIXME: here shall not really redraw */ orientation_=neworientation; ret: return FIM_ERR_NO_ERROR; err: return FIM_ERR_GENERIC; } fim_err_t Image::reduce(fim_scale_t factor) { newscale_ = scale_ / factor; return do_scale_rotate(); } fim_err_t Image::magnify(fim_scale_t factor, fim_bool_t aes) { newscale_ = scale_ * factor; #if FIM_WANT_APPROXIMATE_EXPONENTIAL_SCALING if(newscale_<2.0 && aes && ascale_ == 1.0) { fim_scale_t newscale = 1.0; while ( newscale / 2 >= newscale_ ) newscale /= 2; newscale_ = newscale; } #endif /* FIM_WANT_APPROXIMATE_EXPONENTIAL_SCALING */ return do_scale_rotate(); } Image::Image(const Image& rhs): #ifdef FIM_NAMESPACES Namespace(rhs.rnsp_,FIM_SYM_NAMESPACE_IMAGE_CHAR), #endif /* FIM_NAMESPACES */ scale_(rhs.scale_), ascale_(rhs.ascale_), newscale_(rhs.newscale_), angle_(rhs.angle_), newangle_(rhs.newangle_), page_(rhs.page_), img_ (FIM_NULL), fimg_ (FIM_NULL), orientation_(rhs.orientation_), fis_(rhs.fis_), fname_ (rhs.fname_), fs_(0) { reset(); img_ = fbi_image_clone(rhs.img_ ); fimg_ = fbi_image_clone(rhs.fimg_); } fim_int Image::shall_mirror(void)const { const fim_int automirror= getGlobalIntVariable(FIM_VID_AUTOMIRROR); const fim_int me_mirrored = getIntVariable(FIM_VID_MIRRORED); //fim_int mirrored = getGlobalIntVariable("v:" FIM_VID_MIRRORED); return (((automirror== 1)/*|(mirrored== 1)*/|(is_mirrored()))&& !((automirror==-1)/*|(mirrored==-1)*/|(me_mirrored==-1))); } fim_int Image::check_flip(void)const { const fim_int autoflip = getGlobalIntVariable(FIM_VID_AUTOFLIP); const fim_int am_flipped = getIntVariable(FIM_VID_FLIPPED); //fim_int flipped = getGlobalIntVariable("v:" FIM_VID_FLIPPED); return (((autoflip == 1)/*|(flipped == 1)*/| is_flipped()) && !((autoflip ==-1)/*|(flipped ==-1)*/|(am_flipped==-1))); } fim_int Image::check_negated(void)const { return getIntVariable(FIM_VID_NEGATED); } fim_int Image::check_desaturated(void)const { return getIntVariable(FIM_VID_DESATURATED); } fim_int Image::check_autocenter(void)const { return getIntVariable(FIM_VID_WANT_AUTOCENTER); } fim_int Image::check_autotop(void)const { return getIntVariable(FIM_VID_AUTOTOP); } fim::string Image::getInfo(void)const { if(!fimg_) return FIM_CNS_EMPTY_RESULT; static fim_char_t linebuffer[FIM_STATUSLINE_BUF_SIZE]; #if FIM_WANT_CUSTOM_INFO_STATUS_BAR fim::string ifs(getGlobalStringVariable(FIM_VID_INFO_FMT_STR)); if( !ifs.empty() ) { fim::string clb = cc.getInfoCustom(ifs.c_str()); snprintf(linebuffer, sizeof(linebuffer),"%s",clb.c_str()); goto labeldone; } else #endif /* FIM_WANT_CUSTOM_INFO_STATUS_BAR */ { /* FIXME: for cleanup, shall eliminate this branch and introduce a default string. */ fim_char_t pagesinfobuffer[FIM_PRINTFNUM_BUFSIZE*2+3]; fim_char_t imagemode[3],*imp; const fim_int n=getGlobalIntVariable(FIM_VID_FILEINDEX); imp=imagemode; if(check_flip()) *(imp++)=FIM_SYM_FLIPCHAR; if(shall_mirror()) *(imp++)=FIM_SYM_MIRRCHAR; *imp='\0'; if(fimg_->i.npages>1) snprintf(pagesinfobuffer,sizeof(pagesinfobuffer)," [%d/%d]",(int)page_+1,(int)fimg_->i.npages); else *pagesinfobuffer='\0'; #if FIM_WANT_DISPLAY_MEMSIZE const size_t ms = fbi_img_pixel_bytes(fimg_); /* memory size */ #endif /* FIM_WANT_DISPLAY_MEMSIZE */ snprintf(linebuffer, sizeof(linebuffer)-1, "[ %s%.0f%% %dx%d%s%s %d/%d ]" #if FIM_WANT_DISPLAY_FILESIZE " %dkB" #endif /* FIM_WANT_DISPLAY_FILESIZE */ #if FIM_WANT_DISPLAY_MEMSIZE " %dMB" #endif /* FIM_WANT_DISPLAY_MEMSIZE */ , /*fcurrent->tag*/ 0 ? "* " : "", (scale_*100), (int)this->width(), (int)this->height(), imagemode, pagesinfobuffer, (int)(n?n:1), /* ... */ (int)(getGlobalIntVariable(FIM_VID_FILELISTLEN)) #if FIM_WANT_DISPLAY_FILESIZE ,fs_/FIM_CNS_K #endif /* FIM_WANT_DISPLAY_FILESIZE */ #if FIM_WANT_DISPLAY_MEMSIZE ,ms/FIM_CNS_M #endif /* FIM_WANT_DISPLAY_MEMSIZE */ ); } labeldone: return fim::string(linebuffer); } fim_err_t Image::update_meta(bool fresh) { fim_err_t errval = FIM_ERR_NO_ERROR; if(fresh) should_redraw(FIM_REDRAW_NECESSARY); // FIXME: this is duplication setVariable(FIM_VID_FRESH,fresh ? 1 : 0); if(fimg_) setVariable(FIM_VID_PAGES,fimg_->i.npages); fim_pgor_t neworientation=getOrientation(); if( neworientation!=orientation_) if( ( errval = do_scale_rotate() ) == FIM_ERR_NO_ERROR ) orientation_=neworientation; return errval; } fim_pgor_t Image::getOrientation(void)const { /* * not very intuitive * */ fim_int eo = FIM_NO_ROT, weo = cc.getIntVariable(FIM_VID_WANT_EXIF_ORIENTATION); eo += getIntVariable(FIM_VID_EXIF_ORIENTATION) * ( weo ? 1 : 0 ); return (FIM_MOD( ( eo + getIntVariable(FIM_VID_ORIENTATION) //+getGlobalIntVariable("v:" FIM_VID_ORIENTATION) +getGlobalIntVariable(FIM_VID_ORIENTATION) ) ,4)); } fim_err_t Image::rotate( fim_angle_t angle ) { fim_angle_t newangle=this->angle_+angle; if( !check_valid() ) return FIM_ERR_GENERIC; setVariable(FIM_VID_ANGLE,newangle); return do_scale_rotate(); } bool Image::goto_page(fim_page_t j) { fim_fn_t s(fname_); bool retval = false; FIM_PR('*'); if( !fimg_ ) goto ret; if( j<0 ) j=fimg_->i.npages-1; if( j>page_ ? have_nextpage(j-page_) : have_prevpage(page_-j) ) { //std::cout<<"about to goto page "<i.npages>1 ) ) return true; return false; } bool Image::have_page(int page)const { return ( page >=0 && (0U + page) < (0U + fimg_->i.npages) ); // 0U is to impose signedness and type on either word length } bool Image::have_nextpage(int j)const { return (is_multipage() && have_page(page_+j)); } bool Image::have_prevpage(int j)const { return (is_multipage() && have_page(page_-j)); } bool Image::is_mirrored(void)const { return FIM_XOR( this->getIntVariable(FIM_VID_EXIF_MIRRORED)==1, this->getIntVariable(FIM_VID_MIRRORED)==1 ); } bool Image::is_flipped(void)const { return FIM_XOR( this->getIntVariable(FIM_VID_EXIF_FLIPPED) ==1, this->getIntVariable(FIM_VID_FLIPPED)==1 ); } bool Image::colorblind(enum fim_cvd_t cvd, bool daltonize) { if( fimg_ && fimg_->data) fim_simulate_cvd(fimg_->data, fbi_img_pixel_bytes(fimg_), cvd, daltonize); if( img_ && img_->data && ! (fimg_ && img_->data==fimg_->data) ) fim_simulate_cvd(img_->data, fbi_img_pixel_bytes(img_), cvd, daltonize); #if FIM_WANT_MIPMAPS if( mm_.mdp) fim_simulate_cvd(mm_.mdp, mm_.mmb, cvd, daltonize); #endif /* FIM_WANT_MIPMAPS */ should_redraw(); return true; } fim_err_t Image::desaturate(void) { if( fimg_ && fimg_->data) fim_desaturate_rgb(fimg_->data, fbi_img_pixel_bytes(fimg_)); if( img_ && img_->data) fim_desaturate_rgb(img_->data, fbi_img_pixel_bytes(img_)); #if FIM_WANT_MIPMAPS if( mm_.mdp) fim_desaturate_rgb(mm_.mdp, mm_.mmb); #endif /* FIM_WANT_MIPMAPS */ setVariable(FIM_VID_DESATURATED ,1-getIntVariable(FIM_VID_DESATURATED )); should_redraw(); return FIM_ERR_NO_ERROR; } fim_err_t Image::identity(void) { if( fimg_ && fimg_->data) fim_generate_24bit_identity(fimg_->data, fbi_img_pixel_bytes(fimg_)); if( img_ && img_->data) fim_generate_24bit_identity(img_->data, fbi_img_pixel_bytes(img_)); #if FIM_WANT_MIPMAPS if( mm_.mdp) fim_generate_24bit_identity(mm_.mdp, mm_.mmb); #endif /* FIM_WANT_MIPMAPS */ should_redraw(); return FIM_ERR_NO_ERROR; } fim_err_t Image::negate(void) { if( fimg_ && fimg_->data) fim_negate_rgb(fimg_->data, fbi_img_pixel_bytes(fimg_)); if( img_ && img_->data) fim_negate_rgb(img_->data, fbi_img_pixel_bytes(img_)); #if FIM_WANT_MIPMAPS if( mm_.mdp) fim_negate_rgb(mm_.mdp, mm_.mmb); #endif /* FIM_WANT_MIPMAPS */ setVariable(FIM_VID_NEGATED ,1-getIntVariable(FIM_VID_NEGATED )); should_redraw(); return FIM_ERR_NO_ERROR; } int Image::n_pages()const{return (fimg_?fimg_->i.npages:0);} size_t Image::byte_size(void)const { size_t ms = 0; if(fimg_) ms += fbi_img_pixel_bytes(fimg_); if(fimg_!=img_ && img_) ms += fbi_img_pixel_bytes(img_); #if FIM_WANT_MIPMAPS ms += mm_.byte_size(); #endif /* FIM_WANT_MIPMAPS */ return ms; } #if FIM_WANT_BDI Image::Image(enum fim_tii_t tii) { reset(); #if FIM_WANT_OBSOLETE if( tii == FIM_TII_16M) { fim_coo_t fourk=256*16; img_ = fbi_image_black(fourk,fourk); fimg_ = img_; if(img_) identity(); else cout << "warning: problem generating an image\n"; } else #endif /* FIM_WANT_OBSOLETE */ { /* nevertheless this instance shall support all operations on it */ assert(!check_valid()); } } const fim_char_t* Image::getName(void)const{return fname_.c_str();} #endif /* FIM_WANT_BDI */ #if FIM_WANT_MIPMAPS void Image::mm_free(void) { mm_.dealloc(); } void Image::mm_make(void) { enum fim_mmo_t mmo = FIM_MMO_NORMAL; fim_int wmm = getGlobalIntVariable(FIM_VID_WANT_MIPMAPS); if( wmm<=0 || has_mm() ) return; if(wmm>1) mmo = FIM_MMO_FASTER; mm_.dealloc(); mm_.mmo=mmo; FbiStuff::fim_mipmaps_compute(fimg_,&mm_); } bool Image::has_mm(void)const { return mm_.ok(); } size_t Image::mm_byte_size(void)const { // might implement has_mm in terms of this return this->mm_.byte_size(); } #endif /* FIM_WANT_MIPMAPS */ bool Image::cacheable(void)const { return this->n_pages() == 1 ; } void Image::set_auto_props(fim_int autocenter, fim_int autotop) { setVariable(FIM_VID_WANT_AUTOCENTER,autocenter); setVariable( FIM_VID_AUTOTOP,autotop); } void Image::get_irs(char *imp)const { // imp shall be at least 4 chars long if(this->check_flip()) *(imp++)=FIM_SYM_FLIPCHAR; if(this->shall_mirror()) *(imp++)=FIM_SYM_MIRRCHAR; switch(this->orientation_) { case Image::FIM_ROT_L: *(imp++)=Image::FIM_ROT_L_C; break; case Image::FIM_ROT_U: *(imp++)=Image::FIM_ROT_U_C; break; case Image::FIM_ROT_R: *(imp++)=Image::FIM_ROT_R_C; break; case Image::FIM_NO_ROT: default: /**/ break; } *imp=FIM_SYM_CHAR_NUL; } size_t Image::get_pixelmap_byte_size(void)const { return fim::fbi_img_pixel_bytes(fimg_); } } /* namespace fim */ fim-0.6-rc2/src/Makefile.in0000644000175000017500000011557314503403454012411 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ # $Id: Makefile.am 1963 2023-04-07 17:59:40Z dezperado $ 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 = : check_PROGRAMS = fim$(EXEEXT) bin_PROGRAMS = fim$(EXEEXT) @WITH_FLEXLEXER_TRUE@am__append_1 = lex.yy.cc yacc.tab.cpp conf.h yacc.tab.hpp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(docdir)" PROGRAMS = $(bin_PROGRAMS) am__fim_SOURCES_DIST = lex.yy.cc yacc.tab.cpp conf.h yacc.tab.hpp \ $(srcdir)/fim.cpp $(srcdir)/fim.h $(srcdir)/fim_types.h \ $(srcdir)/fim_limits.h $(srcdir)/fim_plugin.h \ $(srcdir)/fim_plugin.cpp $(srcdir)/fim_wrappers.h \ $(srcdir)/default_font_byte_array.h \ $(srcdir)/default_icon_byte_array.h $(srcdir)/AADevice.h \ $(srcdir)/Benchmarkable.h $(srcdir)/CACADevice.h \ $(srcdir)/SDLDevice.h $(srcdir)/Arg.h $(srcdir)/Browser.h \ $(srcdir)/Cache.h $(srcdir)/Command.h \ $(srcdir)/CommandConsole.h $(srcdir)/DebugConsole.h \ $(srcdir)/DisplayDevice.h $(srcdir)/DummyDisplayDevice.h \ $(srcdir)/FbiStuff.h $(srcdir)/FbiStuffList.h \ $(srcdir)/FbiStuffFbtools.h $(srcdir)/FbiStuffLoader.h \ $(srcdir)/FontServer.h $(srcdir)/FramebufferDevice.h \ $(srcdir)/Imlib2Device.h $(srcdir)/Image.h \ $(srcdir)/Namespace.h $(srcdir)/Var.h $(srcdir)/Viewport.h \ $(srcdir)/FimWindow.h $(srcdir)/common.h \ $(srcdir)/fim_interpreter.h $(srcdir)/conf.h \ $(srcdir)/help.cpp $(srcdir)/help-acm.cpp $(srcdir)/version.h \ $(srcdir)/grammar.h $(srcdir)/examples.h \ $(srcdir)/fim_stream.h $(srcdir)/fim_stream.cpp \ $(srcdir)/fimgs $(srcdir)/lex.h $(srcdir)/readline.h \ $(srcdir)/readline.cpp $(srcdir)/fim_string.h \ $(srcdir)/AADevice.cpp $(srcdir)/CACADevice.cpp \ $(srcdir)/SDLDevice.cpp $(srcdir)/Arg.cpp \ $(srcdir)/Browser.cpp $(srcdir)/Cache.cpp \ $(srcdir)/Command.cpp $(srcdir)/CommandConsole.cpp \ $(srcdir)/CommandConsole-cmd.cpp \ $(srcdir)/CommandConsole-var.cpp \ $(srcdir)/CommandConsole-init.cpp \ $(srcdir)/CommandConsole-help.cpp $(srcdir)/DebugConsole.cpp \ $(srcdir)/DisplayDevice.cpp $(srcdir)/FbiStuff.cpp \ $(srcdir)/FbiStuffFbtools.cpp $(srcdir)/FbiStuffLoader.cpp \ $(srcdir)/FbiStuffPpm.cpp $(srcdir)/FbiStuffBit1.cpp \ $(srcdir)/FbiStuffBit24.cpp $(srcdir)/FbiStuffText.cpp \ $(srcdir)/FbiStuffMatrixMarket.cpp $(srcdir)/FontServer.cpp \ $(srcdir)/FramebufferDevice.cpp $(srcdir)/Image.cpp \ $(srcdir)/Namespace.cpp $(srcdir)/Var.cpp \ $(srcdir)/Viewport.cpp $(srcdir)/FimWindow.cpp \ $(srcdir)/common.cpp $(srcdir)/fim_interpreter.cpp \ $(srcdir)/fim_string.cpp @WITH_FLEXLEXER_TRUE@am__objects_1 = lex.yy.$(OBJEXT) \ @WITH_FLEXLEXER_TRUE@ yacc.tab.$(OBJEXT) am__objects_2 = $(am__objects_1) am_fim_OBJECTS = $(am__objects_2) fim.$(OBJEXT) fim_plugin.$(OBJEXT) \ help.$(OBJEXT) help-acm.$(OBJEXT) fim_stream.$(OBJEXT) \ readline.$(OBJEXT) AADevice.$(OBJEXT) CACADevice.$(OBJEXT) \ SDLDevice.$(OBJEXT) Arg.$(OBJEXT) Browser.$(OBJEXT) \ Cache.$(OBJEXT) Command.$(OBJEXT) CommandConsole.$(OBJEXT) \ CommandConsole-cmd.$(OBJEXT) CommandConsole-var.$(OBJEXT) \ CommandConsole-init.$(OBJEXT) CommandConsole-help.$(OBJEXT) \ DebugConsole.$(OBJEXT) DisplayDevice.$(OBJEXT) \ FbiStuff.$(OBJEXT) FbiStuffFbtools.$(OBJEXT) \ FbiStuffLoader.$(OBJEXT) FbiStuffPpm.$(OBJEXT) \ FbiStuffBit1.$(OBJEXT) FbiStuffBit24.$(OBJEXT) \ FbiStuffText.$(OBJEXT) FbiStuffMatrixMarket.$(OBJEXT) \ FontServer.$(OBJEXT) FramebufferDevice.$(OBJEXT) \ Image.$(OBJEXT) Namespace.$(OBJEXT) Var.$(OBJEXT) \ Viewport.$(OBJEXT) FimWindow.$(OBJEXT) common.$(OBJEXT) \ fim_interpreter.$(OBJEXT) fim_string.$(OBJEXT) fim_OBJECTS = $(am_fim_OBJECTS) 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; }; \ } SCRIPTS = $(bin_SCRIPTS) 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 = am__maybe_remake_depfiles = 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 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(fim_SOURCES) $(EXTRA_fim_SOURCES) DIST_SOURCES = $(am__fim_SOURCES_DIST) $(EXTRA_fim_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am 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 DEJATOOL = $(PACKAGE) RUNTEST = runtest DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in regex.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPECT = @EXPECT@ FIM_CONFIGURATION = @FIM_CONFIGURATION@ FIM_CUSTOM_HARDCODED_CONSOLEFONT = @FIM_CUSTOM_HARDCODED_CONSOLEFONT@ FIM_DEFS = @FIM_DEFS@ FIM_LIBS = @FIM_LIBS@ FIM_LIB_OBJECTS = @FIM_LIB_OBJECTS@ FIM_SVN_REPOSITORY = @FIM_SVN_REPOSITORY@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ HAVE_AWK = @HAVE_AWK@ HAVE_BISON = @HAVE_BISON@ HAVE_CAT = @HAVE_CAT@ HAVE_CPP = @HAVE_CPP@ HAVE_ECHO = @HAVE_ECHO@ HAVE_FLEX = @HAVE_FLEX@ HAVE_GREP = @HAVE_GREP@ HAVE_MAN = @HAVE_MAN@ HAVE_RM = @HAVE_RM@ HAVE_SED = @HAVE_SED@ HAVE_SORT = @HAVE_SORT@ HAVE_TIMEOUT = @HAVE_TIMEOUT@ HAVE_VALGRIND = @HAVE_VALGRIND@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBAA_CONFIG = @LIBAA_CONFIG@ LIBCACA_CONFIG = @LIBCACA_CONFIG@ LIBDJVU = @LIBDJVU@ LIBGIF = @LIBGIF@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBPOPPLER = @LIBPOPPLER@ LIBPS = @LIBPS@ LIBS = @LIBS@ LIBSDL2_CONFIG = @LIBSDL2_CONFIG@ LIBSDL_CONFIG = @LIBSDL_CONFIG@ LIBTIFF = @LIBTIFF@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN = @MAN@ 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@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POPPLER_CFLAGS = @POPPLER_CFLAGS@ POPPLER_LIBS = @POPPLER_LIBS@ RANLIB = @RANLIB@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHELLCHECK = @SHELLCHECK@ SORT = @SORT@ STRIP = @STRIP@ SVN_REVISION = @SVN_REVISION@ SVN_REVISION_NUMBER = @SVN_REVISION_NUMBER@ TIMEOUT_LARGE = @TIMEOUT_LARGE@ TIMEOUT_SMALL = @TIMEOUT_SMALL@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = -v -d 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@ ac_ct_CXX = @ac_ct_CXX@ 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@ fim_cv_version = @fim_cv_version@ have_convert = @have_convert@ have_dia = @have_dia@ have_gs = @have_gs@ have_inkscape = @have_inkscape@ have_xcftopnm = @have_xcftopnm@ have_xfig = @have_xfig@ have_zcat = @have_zcat@ 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@ subdir = src AUTOMAKE_OPTIONS = no-dependencies dejagnu subdir-objects #AUTOMAKE_OPTIONS+= nostdinc SUBDIRS = bin_SCRIPTS = fimgs doc_DATA = fimrc LFLAGS = -+ # --nounistd # the following sources are built at make time # old bison versions could have problems with this (e.g.: generating yacc.tab.cpp.h instead of yacc.tab.hpp) BUILT_SOURCES = $(am__append_1) # The following files are marked as source files by configure.ac EXTRA_fim_SOURCES = FbiStuffGif.cpp FbiStuffJasPer.cpp \ FbiStuffJpeg.cpp FbiStuffTiff.cpp FbiStuffPng.cpp \ FbiStuffDjvu.cpp FbiStuffMagick.cpp FbiStuffPdf.cpp \ FbiStuffPs.cpp Imlib2Device.cpp FbiStuffXyz.cpp \ FbiStuffPcx.cpp FbiStuffBmp.cpp CLEANFILES = $(BUILT_SOURCES) yacc.output b2ba$(EXEEXT) #CPP_FLAGS="$CPP_FLAGS -D X_DISPLAY_MISSING" #AM_CPPFLAGS= fim_DEPENDENCIES = @FIM_LIB_OBJECTS@ @LIBOBJS@ $(INTLDEPS) fim_LDADD = @FIM_LIB_OBJECTS@ @LIBOBJS@ $(FIMLIBS) #fim_LDADD = @FIM_LIB_OBJECTS@ @LIBOBJS@ $(FIMLIBS) $(LEXLIB) fim_SOURCES = $(BUILT_SOURCES) \ $(srcdir)/fim.cpp \ $(srcdir)/fim.h \ $(srcdir)/fim_types.h \ $(srcdir)/fim_limits.h \ $(srcdir)/fim_plugin.h \ $(srcdir)/fim_plugin.cpp \ $(srcdir)/fim_wrappers.h \ $(srcdir)/default_font_byte_array.h \ $(srcdir)/default_icon_byte_array.h \ $(srcdir)/AADevice.h \ $(srcdir)/Benchmarkable.h \ $(srcdir)/CACADevice.h \ $(srcdir)/SDLDevice.h \ $(srcdir)/Arg.h \ $(srcdir)/Browser.h \ $(srcdir)/Cache.h \ $(srcdir)/Command.h \ $(srcdir)/CommandConsole.h \ $(srcdir)/DebugConsole.h \ $(srcdir)/DisplayDevice.h \ $(srcdir)/DummyDisplayDevice.h \ $(srcdir)/FbiStuff.h \ $(srcdir)/FbiStuffList.h \ $(srcdir)/FbiStuffFbtools.h \ $(srcdir)/FbiStuffLoader.h \ $(srcdir)/FontServer.h \ $(srcdir)/FramebufferDevice.h \ $(srcdir)/Imlib2Device.h \ $(srcdir)/Image.h \ $(srcdir)/Namespace.h \ $(srcdir)/Var.h \ $(srcdir)/Viewport.h \ $(srcdir)/FimWindow.h \ $(srcdir)/common.h \ $(srcdir)/fim_interpreter.h \ $(srcdir)/conf.h \ $(srcdir)/help.cpp \ $(srcdir)/help-acm.cpp \ $(srcdir)/version.h \ $(srcdir)/grammar.h \ $(srcdir)/examples.h \ $(srcdir)/fim.h \ $(srcdir)/fim_stream.h \ $(srcdir)/fim_stream.cpp \ $(srcdir)/fimgs \ $(srcdir)/lex.h \ $(srcdir)/readline.h \ $(srcdir)/readline.cpp \ $(srcdir)/fim_string.h \ $(srcdir)/AADevice.cpp \ $(srcdir)/CACADevice.cpp \ $(srcdir)/SDLDevice.cpp \ $(srcdir)/Arg.cpp \ $(srcdir)/Browser.cpp \ $(srcdir)/Cache.cpp \ $(srcdir)/Command.cpp \ $(srcdir)/CommandConsole.cpp \ $(srcdir)/CommandConsole-cmd.cpp \ $(srcdir)/CommandConsole-var.cpp \ $(srcdir)/CommandConsole-init.cpp \ $(srcdir)/CommandConsole-help.cpp \ $(srcdir)/DebugConsole.cpp \ $(srcdir)/DisplayDevice.cpp \ $(srcdir)/FbiStuff.cpp \ $(srcdir)/FbiStuffFbtools.cpp \ $(srcdir)/FbiStuffLoader.cpp \ $(srcdir)/FbiStuffPpm.cpp \ $(srcdir)/FbiStuffBit1.cpp \ $(srcdir)/FbiStuffBit24.cpp \ $(srcdir)/FbiStuffText.cpp \ $(srcdir)/FbiStuffMatrixMarket.cpp \ $(srcdir)/FontServer.cpp \ $(srcdir)/FramebufferDevice.cpp \ $(srcdir)/Image.cpp \ $(srcdir)/Namespace.cpp \ $(srcdir)/Var.cpp \ $(srcdir)/Viewport.cpp \ $(srcdir)/FimWindow.cpp \ $(srcdir)/common.cpp \ $(srcdir)/fim_interpreter.cpp \ $(srcdir)/fim_string.cpp # regex.c is work in progress and awaits for integration EXTRA_DIST = lex.lex yacc.ypp fimrc defaultConfiguration.cpp fimgs \ testdir/*ok testdir/*in testdir/Makefile \ testsuite/*/* \ regex.c b2ba.c RUNTESTDEFAULTFLAGS = --tool ./fim$(EXEEXT) FIM=$$srcdir/./fim$(EXEEXT) --srcdir $$srcdir/testsuite all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .cc .cpp .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) fim$(EXEEXT): $(fim_OBJECTS) $(fim_DEPENDENCIES) $(EXTRA_fim_DEPENDENCIES) @rm -f fim$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fim_OBJECTS) $(fim_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; 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 \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(AM_V_CC)$(COMPILE) -c -o $@ $< .c.obj: $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.o: $(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $< .cc.obj: $(AM_V_CXX)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.o: $(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: $(AM_V_CXX)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-docDATA: @$(NORMAL_UNINSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-DEJAGNU: site.exp srcdir='$(srcdir)'; export srcdir; \ EXPECT=$(EXPECT); export EXPECT; \ if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \ exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \ if $(RUNTEST) $(RUNTESTDEFAULTFLAGS) $(AM_RUNTESTFLAGS) $(RUNTESTFLAGS); \ then :; else exit_status=1; fi; \ done; \ else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\ fi; \ exit $$exit_status site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @echo 'Making a new site.exp file ...' @echo '## these variables are automatically generated by make ##' >site.tmp @echo '# Do not edit here. If you wish to override these values' >>site.tmp @echo '# edit the last section' >>site.tmp @echo 'set srcdir "$(srcdir)"' >>site.tmp @echo "set objdir `pwd`" >>site.tmp @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \ echo "## Begin content included from file $$f. Do not modify. ##" \ && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \ && echo "## End content included from file $$f. ##" \ || exit 1; \ done >> site.tmp @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp @if test -f site.exp; then \ sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \ fi @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp distclean-DEJAGNU: -rm -f site.exp site.bak -l='$(DEJATOOL)'; for tool in $$l; do \ rm -f $$tool.sum $$tool.log; \ done distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-DEJAGNU distclean-compile \ distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-docDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-docDATA .MAKE: $(am__recursive_targets) all check check-am install install-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-DEJAGNU check-am clean clean-binPROGRAMS \ clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ dist-hook distclean distclean-DEJAGNU distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-binSCRIPTS install-data install-data-am \ install-docDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-docDATA .PRECIOUS: Makefile #lex.yy.cc : lex.lex lex.yy.cc: lex.lex yacc.tab.cpp $(LEX) $(LFLAGS) $< # @$(ECHO) "Applying a horrible hack to avoid the flex non-throwing isatty() redeclaration in 'extern "C" int isatty (int );'" # $(SED) -i 's/^.*extern.*isatty.*int.*$$//g' $@ yacc.tab.hpp: yacc.tab.cpp yacc.tab.cpp: yacc.ypp lex.lex LC_ALL=C $(YACC) $(YFLAGS) $< -o $@ # FIM_LIB_OBJECTS = yacc.tab.$(OBJEXT) lex.yy.$(OBJEXT) conf.h: fimrc $(ECHO) 'const fim_char_t * const FIM_DEFAULT_CONFIG_FILE_CONTENTS =' > $@ $(SED) 's/\\/\\\\/g;s/"/\\\"/g;s/^/"/g;s/$$/\\n"/g;' $< | $(GREP) -v '^.###' >> $@ $(ECHO) '"";' >> $@ grammar.h: yacc.tab.cpp yacc.output @WITH_FLEXLEXER_TRUE@ $(ECHO) 'const fim_char_t * const FIM_DEFAULT_GRAMMAR_FILE_CONTENTS =' > $@ @WITH_FLEXLEXER_TRUE@ $(AWK) -f $(top_srcdir)/scripts/maintenance/yacc2grammar.awk yacc.output | $(CPP) -include $(top_srcdir)/scripts/maintenance/yacc2grammar.h | $(GREP) -v '^#' | $(SED) 's/"/\\\"/g;s/^/"/g;s/$$/\\n"/g;' >> $@ @WITH_FLEXLEXER_TRUE@ $(ECHO) '"";' >> $@ examples.h: ../scripts/example/oneline.fim $(ECHO) 'const fim_char_t * const FIM_DEFAULT_EXAMPLE_FILE_CONTENTS =' > $@ $(SED) 's/"/\\\"/g;s/^/"/g;s/$$/\\n"/g;' $< >> $@ $(ECHO) '"";' >> $@ CommandConsole-help.$(OBJEXT): CommandConsole-help.cpp help-acm.cpp help.cpp examples.h grammar.h @FIM_WANT_HARDCODED_CONSOLEFONT_TRUE@FontServer.$(OBJEXT): default_font_byte_array.h SDLDevice.$(OBJEXT): default_icon_byte_array.h # in the following : for some freebsd oddity, i was forced to replace ..0-9_]\+ with ..0-9_]* version.h: ../config.h $(GREP) define $< | $(GREP) FIM | LC_ALL=C $(SORT) | $(SED) 's/^#//g;s/define //g;s/^\([A-Za-z0-9_]*\).*$$/+\1 /g;s/^/\"/g;s/$$/\"/g' > $@ $(ECHO) "\"\n\"" >> $@ $(GREP) define $< | $(GREP) FIM.*'"' | LC_ALL=C $(SORT) | $(SED) 's/^#//g;s/define //g;s/^\([A-Za-z0-9_]*\) "\(.*\)"$$/"\1 = \\"\2\\"\\n"/g' >> $@ $(GREP) undef $< | $(GREP) FIM | LC_ALL=C $(SORT) | $(SED) 's/^#//g;s/.*undef //g;s/^\([A-Za-z0-9_]*\).\+$$/-\1 /g;s/^/\"/g;s/$$/\"/g' >> $@ @WITH_DEBUG_TRUE@ $(ECHO) '"\n'CXXFLAGS=$(CXXFLAGS)'\n"' >> $@ help.cpp: fim.h $(ECHO) -e "#ifdef FIM_WANT_INLINE_HELP\n" > $@ $(GREP) '^#define FIM_VID' $< | $(SED) 's/^#define //g;s/\(^[A-Z0-9_]\+\)\s\+\("[^ ]*"\)\s*\/\*\(.*\)\*\/$$/fim_var_help_db[\1]=\3;/g' >> $@ $(ECHO) '#endif /* FIM_WANT_INLINE_HELP */' >> $@ help-acm.cpp: fim.h $(ECHO) -e "//#ifdef FIM_WANT_INLINE_HELP\n" > $@ $(ECHO) -e '#define FIM_AUTOCOMMANDS_LIST \' >> $@ $(GREP) '^#define FIM_ACM' $< | $(SED) 's/^#define //g;s/\(^[A-Z0-9_]\+\)\s\+\("[^ ]*"\)\s*\/\*\(.*\)\*\/$$/\1", "/g'|tr '\n' ' ' >> $@ $(ECHO) ' '>> $@ $(ECHO) '//#endif' >> $@ b2ba$(EXEEXT): b2ba.c $(CC) -o $@ $< @FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@default_font_byte_array.h: $(FIM_CUSTOM_HARDCODED_CONSOLEFONT) b2ba$(EXEEXT) @FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ ./b2ba$(EXEEXT) < $< > $@ @FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_FALSE@@HAVE_RUNNABLE_TESTS_TRUE@default_font_byte_array.h: ../var/fonts/Lat15-Terminus16.psf b2ba$(EXEEXT) @FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_FALSE@@HAVE_RUNNABLE_TESTS_TRUE@ ./b2ba$(EXEEXT) < $< > $@ @WITH_FLEXLEXER_FALSE@yacc.output: @WITH_FLEXLEXER_FALSE@ touch $@ # this hook triggers on 'make dist' .PHONY: dist-hook dist-hook: -for file in $(BUILT_SOURCES) ; do $(RM) -f $(distdir)/$$file ; done Command.$(OBJEXT): Command.h Viewport.$(OBJEXT): Viewport.h Browser.$(OBJEXT): Browser.h Image.$(OBJEXT): Image.h CommandConsole.$(OBJEXT): defaultConfiguration.$(OBJEXT) fim.h CommandConsole-cmd.$(OBJEXT): fim.h CommandConsole-help.$(OBJEXT): conf.h defaultConfiguration.$(OBJEXT) CommandConsole-init.$(OBJEXT): conf.h defaultConfiguration.$(OBJEXT) help.$(OBJEXT): conf.h defaultConfiguration.$(OBJEXT) fim.$(OBJEXT): version.h help.cpp grammar.h examples.h Var.$(OBJEXT): help.cpp fim.cpp: version.h help.cpp grammar.h examples.h lex.yy.$(OBJEXT): lex.yy.cc #RUNTESTDEFAULTFLAGS = --all --tool ./fim$(EXEEXT) FIM=$$srcdir/./fim$(EXEEXT) --tool_opts=$$srcdir/../media/fim.png --srcdir $$srcdir/testsuite # 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: fim-0.6-rc2/src/fim_plugin.h0000644000175000017500000000216214454347340012641 00000000000000/* $LastChangedDate: 2013-07-04 23:07:07 +0200 (Thu, 04 Jul 2013) $ */ /* fim_plugin.h : Fim plugin definitions (c) 2011-2013 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_PLUGIN_FIM_H #define FIM_PLUGIN_FIM_H #include "fim.h" #if FIM_WANT_EXPERIMENTAL_PLUGINS fim_err_t fim_post_read_plugins_exec(struct ida_image *img, const fim_char_t * filename); #endif /* FIM_WANT_EXPERIMENTAL_PLUGINS */ #endif /* FIM_PLUGIN_FIM_H */ fim-0.6-rc2/src/DebugConsole.h0000644000175000017500000000662714454347340013073 00000000000000/* $LastChangedDate: 2022-11-20 23:14:42 +0100 (Sun, 20 Nov 2022) $ */ /* DebugConsole.h : Fim virtual console display. (c) 2008-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_CONSOLE_H #define FIM_CONSOLE_H #include #include "fim.h" #include "Var.h" #include "Namespace.h" #ifndef FIM_WANT_NO_OUTPUT_CONSOLE class DisplayDevice; namespace fim { class MiniConsole FIM_FINAL #ifdef FIM_NAMESPACES :public Namespace #endif /* FIM_NAMESPACES */ { fim_char_t *buffer_; // the raw console buffer fim_char_t **line_; // the (displayed) line_ pointers array fim_char_t *bp_; // pointer to the top of the buffer int bsize_; // the buffer size int lsize_; // the lines array size int ccol_; // the currently pointed column int cline_; // the line_ on the top of the buffer int lwidth_; // line width int rows_; // rows count int scroll_; // last line displayed (up to rows_) DisplayDevice *displaydevice_; public: MiniConsole(CommandConsole& cc, DisplayDevice *dd, int lw=48, int r=12); /* get rid of these default numerical constants! */ virtual ~MiniConsole(void); fim_err_t dump(void); // non const due to user variables reaction fim_err_t grow(void); fim_err_t setRows(int nr); fim_err_t add(const fim_char_t * cso); #if FIM_WANT_OBSOLETE fim_err_t add(const fim_byte_t* cso); #endif /* FIM_WANT_OBSOLETE */ fim_err_t reformat(int newlsize); fim_err_t clear(void); fim_err_t scroll_down(void); fim_err_t scroll_up(void); virtual size_t byte_size(void)const; #if FIM_USE_CXX11 public: /* deleted member functions cannot be called not even by be'friend'ed clases */ MiniConsole& operator= (const MiniConsole&rhs) = delete; MiniConsole(const MiniConsole& rhs) = delete; #else /* FIM_USE_CXX11 */ /* private member functions can be called even by be'friend'ed clases */ private: MiniConsole& operator= (const MiniConsole&rhs){return *this;/* a nilpotent assignment */} MiniConsole(const MiniConsole& rhs) : Namespace(rhs), buffer_(FIM_NULL), line_(FIM_NULL), bp_(FIM_NULL), bsize_(0), lsize_(0), ccol_(0), cline_(0), lwidth_(0), rows_(0), scroll_(0), displaydevice_(rhs.displaydevice_) {/* this constructor should not be used */} #endif /* FIM_USE_CXX11 */ private: #if FIM_WANT_OBSOLETE int line_length(int li); fim_err_t do_dump(void)const; fim_err_t do_dump(int amount)const; #endif /* FIM_WANT_OBSOLETE */ fim_err_t do_dump(int f, int l)const; fim_err_t grow_lines(int glines); fim_err_t grow_buffer(int gbuffer); fim_err_t grow(int glines, int gbuffer); public: void setDisplayDevice(DisplayDevice *displaydevice){displaydevice_=displaydevice;} }; } #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ #endif /* FIM_CONSOLE_H */ fim-0.6-rc2/src/Command.cpp0000644000175000017500000000360014454347340012417 00000000000000/* $LastChangedDate: 2017-07-25 00:49:49 +0200 (Tue, 25 Jul 2017) $ */ /* Command.cpp : (c) 2007-2017 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #include "Command.h" namespace fim { const fim_cmd_id & Command::cmd(void)const{return cmd_;} const fim::string & Command::getHelp(void)const{return help_;} #if FIM_USE_CXX11 fim::string Command::execute(const args_t&args) { assert(cmf_); return (cmf_)(args); } #else /* FIM_USE_CXX11 */ fim::string Command::execute(const args_t&args) { assert(browser_ && browserf_); return (browser_->*browserf_)(args); // Browser or CommandConsole or FimWindow } Command::Command(fim_cmd_id cmd, fim::string help, Browser *b, fim::string(Browser::*bf)(const args_t&)) :cmd_(cmd),help_(help),browserf_(bf),browser_(b) {} #ifdef FIM_WINDOWS Command::Command(fim_cmd_id cmd, fim::string help, FimWindow *w, fim::string(FimWindow::*cf)(const args_t&)) :cmd_(cmd),help_(help),windowf_(cf),window_(w) {} #endif /* FIM_WINDOWS */ Command::Command(fim_cmd_id cmd, fim::string help, CommandConsole *c,fim::string(CommandConsole::*cf)(const args_t&)) :cmd_(cmd),help_(help),consolef_(cf),commandconsole_(c) {} #endif /* FIM_USE_CXX11 */ } /* namespace fim */ fim-0.6-rc2/src/FontServer.h0000644000175000017500000000742014454347340012607 00000000000000/* $LastChangedDate: 2022-10-02 20:11:31 +0200 (Sun, 02 Oct 2022) $ */ /* FontServer.h : Font Server code from fbi, adapted for fim. (c) 2008-2022 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #ifndef FIM_FONT_SERVER_H #define FIM_FONT_SERVER_H #include "fim.h" # include # include //for FIM_NULL # include //for stderr.. # include //for exit.. # include //for strlen.. namespace fim { #ifdef FIM_USE_X11_FONTS # include int swidth(void)const{return /*_FSXCharInfo::fim_fmf_**/width;} struct fs_font { Font font; FSXFontInfoHeader fontHeader; FSPropInfo propInfo; FSPropOffset *propOffsets; fim_byte_t *propData; FSXCharInfo *extents; FSOffset *offsets; fim_byte_t *glyphs; int maxenc,width,height; FSXCharInfo **eindex; fim_byte_t **gindex; }; #else /* FIM_USE_X11_FONTS */ #if FIM_FONT_MAGNIFY_FACTOR > 0 #define fim_fmf FIM_FONT_MAGNIFY_FACTOR #endif /* FIM_FONT_MAGNIFY_FACTOR */ typedef struct _FSXCharInfo { short left; short right; short width; short ascent; short descent; /*unsigned short attributes;*/ #if ( FIM_FONT_MAGNIFY_FACTOR <= 0 ) int fmf(void)const{extern fim_int fim_fmf_;return fim_fmf_;} #else /* FIM_FONT_MAGNIFY_FACTOR */ int fmf(void)const{return FIM_FONT_MAGNIFY_FACTOR;} #endif /* FIM_FONT_MAGNIFY_FACTOR */ int swidth(void)const{return fmf()*width;} } FSXCharInfo; typedef struct _FSXFontInfoHeader { /*int flags; //FSRange char_range; //unsigned draw_direction; //FSChar2b default_char; */ FSXCharInfo min_bounds; FSXCharInfo max_bounds; short font_ascent; short font_descent; } FSXFontInfoHeader; struct fs_font { FSXFontInfoHeader fontHeader; /*fim_byte_t *propData;*/ FSXCharInfo *extents; fim_byte_t *glyphs; int maxenc,width,height; FSXCharInfo **eindex; fim_byte_t **gindex; #if ( FIM_FONT_MAGNIFY_FACTOR <= 0 ) int fmf(void)const{extern fim_int fim_fmf_;return fim_fmf_;} #else /* FIM_FONT_MAGNIFY_FACTOR */ int fmf(void)const{return FIM_FONT_MAGNIFY_FACTOR;} #endif /* FIM_FONT_MAGNIFY_FACTOR */ int swidth(void)const{return fmf()*width;} int sheight(void)const{return fmf()*height;} }; #endif /* FIM_USE_X11_FONTS */ static const unsigned fs_masktab[] = { (1 << 7), (1 << 6), (1 << 5), (1 << 4), (1 << 3), (1 << 2), (1 << 1), (1 << 0), }; fim::string get_default_font_list(void); class FontServer FIM_FINAL { public: FontServer( ); #if 1 /* 20080507 unused, as default_font ? */ static void fb_text_init1(const fim_char_t *font, struct fs_font **_f, fim_int vl=1); static struct fs_font* fs_consolefont(const fim_char_t **filename, fim_int vl=1); #endif }; void fim_free_fs_font(struct fs_font *f_); } #endif /* FIM_FONT_SERVER_H */ fim-0.6-rc2/src/FbiStuffLoader.h0000644000175000017500000001205614454347340013352 00000000000000/* $LastChangedDate: 2022-11-20 02:50:16 +0100 (Sun, 20 Nov 2022) $ */ /* FbiStuffLoader.h : fbi functions for loading files, modified for fim (c) 2008-2022 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #ifndef FIM_STUFF_LOADER_H #define FIM_STUFF_LOADER_H #include "fim_string.h" #include "fim_types.h" #include "FbiStuffList.h" //#include "list.h" #ifdef USE_X11 # include #endif /* USE_X11 */ namespace fim { enum ida_extype { EXTRA_COMMENT = 1, EXTRA_EXIF = 2 }; struct ida_extra { enum ida_extype type; fim_byte_t *data; unsigned int size; struct ida_extra *next; }; /* image data and metadata */ struct ida_image_info { unsigned int width; unsigned int height; unsigned int dpi; unsigned int npages; struct ida_extra *extra; #ifdef FIM_EXPERIMENTAL_ROTATION unsigned int fim_extra_flags;/* FIXME : unclean: regard this as a hack (flag set on a rotated image) */ #endif /* FIM_EXPERIMENTAL_ROTATION */ int thumbnail; unsigned int real_width; unsigned int real_height; #if FIM_EXPERIMENTAL_IMG_NMSPC fim::Namespace *nsp; #endif /* FIM_EXPERIMENTAL_IMG_NMSPC */ }; struct ida_image { struct ida_image_info i; fim_byte_t *data; }; struct ida_rect { int x1,y1,x2,y2; }; /* load image files */ struct ida_loader { //const fim_byte_t *magic; const fim_char_t *magic; int moff; int mlen; const fim_char_t *name; void* (*init)(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail); void (*read)(fim_byte_t *dst, unsigned int line, void *data); void (*done)(void *data); struct list_head list; }; /* filter + operations */ struct ida_op { const fim_char_t *name; void* (*init)(const struct ida_image *src, struct ida_rect *rect, struct ida_image_info *i, void *parm); void (*work)(const struct ida_image *src, struct ida_rect *rect, fim_byte_t *dst, int line, void *data); void (*done)(void *data); }; #if FIM_WANT_OBSOLETE void* op_none_init(struct ida_image *src, struct ida_rect *rect, struct ida_image_info *i, void *parm); #endif /* FIM_WANT_OBSOLETE */ void op_none_done(void *data); #if FIM_WANT_OBSOLETE void op_free_done(void *data); #endif /* FIM_WANT_OBSOLETE */ #ifdef USE_X11 /* save image files */ struct ida_writer { const fim_char_t *label; const fim_char_t *ext[8]; int (*write)(FILE *fp, struct ida_image *img); int (*conf)(Widget widget, struct ida_image *img); struct list_head list; }; #endif /* USE_X11 */ /* ----------------------------------------------------------------------- */ /* resolution */ #define res_cm_to_inch(x) ((x * 2540 + 5) / 1000) #define res_m_to_inch(x) ((x * 2540 + 5) / 100000) #define res_inch_to_m(x) ((x * 100000 + 5) / 2540) /* ----------------------------------------------------------------------- */ /* helpers */ void load_bits_lsb(fim_byte_t *dst, fim_byte_t *src, int width, int on, int off); void load_bits_msb(fim_byte_t *dst, fim_byte_t *src, int width, int on, int off); void load_gray(fim_byte_t *dst, fim_byte_t *src, int width); void load_graya(fim_byte_t *dst, fim_byte_t *src, int width); void load_rgba(fim_byte_t *dst, fim_byte_t *src, int width); int load_add_extra(struct ida_image_info *info, enum ida_extype type, fim_byte_t *data, unsigned int size); struct ida_extra* load_find_extra(struct ida_image_info *info, enum ida_extype type); int load_free_extras(struct ida_image_info *info); /* ----------------------------------------------------------------------- */ /* other */ //extern int debug; extern struct ida_loader ppm_loader; extern struct ida_loader sane_loader; extern struct ida_writer ps_writer; extern struct ida_writer jpeg_writer; /* lists */ #define fim__init __attribute__ ((constructor)) #define fim__fini __attribute__ ((destructor)) extern struct list_head loaders; extern struct list_head writers; void fim_load_register(struct ida_loader *loader); void fim_write_register(struct ida_writer *writer); void fim_loaders_to_stderr(FILE * stream); string fim_loaders_to_string(void); } #endif /* FIM_STUFF_LOADER_H */ fim-0.6-rc2/src/examples.h0000644000175000017500000000100414454347340012320 00000000000000const fim_char_t * const FIM_DEFAULT_EXAMPLE_FILE_CONTENTS = "# jump to the third image:\n" "3;\n" "# jump to first image:\n" "^;\n" "# jump to last image:\n" "$;\n" "# magnify the image two times:\n" "*2;\n" "# scale the image to the 30% of the original:\n" "30%;\n" "# scale the image up by 30%:\n" "+30%;\n" "# scale the image down by 30%:\n" "-30%;\n" "# jump to the next image whose filename matches the \".*jpg\" regular expression:\n" "/.*jpg;\n" "# executes the \"date\" system command\n" "!\"date\";\n" ""; fim-0.6-rc2/src/FbiStuff.h0000644000175000017500000000654314454347340012227 00000000000000/* $LastChangedDate: 2022-12-11 15:22:59 +0100 (Sun, 11 Dec 2022) $ */ /* FbiStuff.h : Misc fbi functionality routines, modified for fim (c) 2008-2022 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #ifndef FIM_FBI_STUFF_H #define FIM_FBI_STUFF_H #include "fim.h" #include "FramebufferDevice.h" #include "FbiStuffLoader.h" #include "FontServer.h" #ifdef USE_X11 # include #endif /* USE_X11 */ #include //FILE #include //free() #include //free() #include //memset,strerror,.. #if FIM_HAS_TIMEOUT #define FIM_EXECLP_TIMEOUT "15" #define FIM_TIMED_EXECLP(CMD,...) FbiStuff::fim_execlp("timeout","timeout",FIM_EXECLP_TIMEOUT,CMD,__VA_ARGS__) #else /* FIM_HAS_TIMEOUT */ #define FIM_TIMED_EXECLP(CMD,...) FbiStuff::fim_execlp(CMD,CMD,__VA_ARGS__) #endif /* FIM_HAS_TIMEOUT */ // WARNING : THIS IS PURE REDUNDANCE ! /* struct list_head { struct list_head *next, *prev; };*/ extern struct list_head loaders; namespace fim { class FbiStuff FIM_FINAL { public: static void free_image(struct ida_image *img); static FILE* fim_execlp(const fim_char_t *arg, ...);/* new */ static struct ida_image* read_image(const fim_char_t *filename, FILE* fd, fim_int page=0, Namespace *nsp=FIM_NULL); #if FIM_WANT_MIPMAPS static fim_err_t fim_mipmaps_compute(const struct ida_image *src, fim_mipmap_t * mmp); #endif /* FIM_WANT_MIPMAPS */ #if FIM_WANT_CROP static struct ida_image* crop_image(struct ida_image *src, ida_rect rect); #endif /* FIM_WANT_CROP */ static struct ida_image* rotate_image90(struct ida_image *src, unsigned int rotation); static struct ida_image* rotate_image(struct ida_image *src, float angle); static struct ida_image* scale_image(const struct ida_image *src, float scale, float ascale #if FIM_WANT_MIPMAPS , const fim_mipmap_t * mmp=FIM_NULL #endif /* FIM_WANT_MIPMAPS */ ); static int fim_filereading_debug(void); static bool want_fbi_style_debug(void); }; // filter.h struct op_3x3_parm { int f1[3]; int f2[3]; int f3[3]; int mul,div,add; }; struct op_sharpe_parm { int factor; }; struct op_resize_parm { int width; int height; int dpi; }; struct op_rotate_parm { int angle; }; //int new_image; // end filter.h /* * fim's functions * */ struct ida_image * fbi_image_clone(const struct ida_image *img); #if FIM_WANT_OBSOLETE struct ida_image * fbi_image_black(fim_coo_t w, fim_coo_t h); #endif /* FIM_WANT_OBSOLETE */ fim_pxc_t fbi_img_pixel_count(const struct ida_image *img); fim_pxc_t fbi_img_pixel_bytes(const struct ida_image *img); } #endif /* FIM_FBI_STUFF_H */ fim-0.6-rc2/src/FbiStuffList.h0000644000175000017500000001307514454347340013061 00000000000000/* $LastChangedDate: 2022-10-30 19:33:08 +0100 (Sun, 30 Oct 2022) $ */ /* FbiStuffList.h : fbi functions for lists, modified for fim (c) 2008-2022 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi. * */ #ifndef FBI_STUFF_LIST_H #define FBI_STUFF_LIST_H #include "fim_types.h" //from list.h /* * Simple doubly linked list implementation. * -- shameless stolen from the linux kernel sources * * Some of the internal functions ("__xxx") are useful when * manipulating whole lists rather than single entries, as * sometimes we already know the next/prev entries and we can * generate better code by using them directly rather than * using the generic single-entry routines. */ struct list_head { struct list_head *next, *prev; }; /* beware that LIST_HEAD is defined in freebsd's */ #ifdef FIM_LIST_HEAD_INIT #undef FIM_LIST_HEAD_INIT #endif /* FIM_LIST_HEAD_INIT */ #ifdef FIM_LIST_HEAD #undef FIM_LIST_HEAD #endif /* FIM_LIST_HEAD */ #define FIM_LIST_HEAD_INIT(name) { &(name), &(name) } #define FIM_LIST_HEAD(name) \ struct list_head name = FIM_LIST_HEAD_INIT(name) #define FIM_INIT_LIST_HEAD(ptr) do { \ (ptr)->next = (ptr); (ptr)->prev = (ptr); \ } while (0) /* * Insert a new entry between two known consecutive entries. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static __inline__ void __list_add(struct list_head * _new, struct list_head * prev, struct list_head * next) { next->prev = _new; _new->next = next; _new->prev = prev; prev->next = _new; } /** * list_add - add a new entry * @new: new entry to be added * @head: list head to add it after * * Insert a new entry after the specified head. * This is good for implementing stacks. */ static __inline__ void list_add(struct list_head *_new, struct list_head *head) { __list_add(_new, head, head->next); } /** * list_add_tail - add a new entry * @new: new entry to be added * @head: list head to add it before * * Insert a new entry before the specified head. * This is useful for implementing queues. */ static __inline__ void list_add_tail(struct list_head *_new, struct list_head *head) { __list_add(_new, head->prev, head); } /* * Delete a list entry by making the prev/next entries * point to each other. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static __inline__ void __list_del(struct list_head * prev, struct list_head * next) { next->prev = prev; prev->next = next; } /** * list_del - deletes entry from list. * @entry: the element to delete from the list. * Note: list_empty on entry does not return true after this, the entry is in an undefined state. */ static __inline__ void list_del(struct list_head *entry) { __list_del(entry->prev, entry->next); } /** * list_del_init - deletes entry from list and reinitialize it. * @entry: the element to delete from the list. */ static __inline__ void list_del_init(struct list_head *entry) { __list_del(entry->prev, entry->next); FIM_INIT_LIST_HEAD(entry); } /** * list_empty - tests whether a list is empty * @head: the list to test. */ static __inline__ int list_empty(struct list_head *head) { return head->next == head; } /** * list_splice - join two lists * @list: the new list to add. * @head: the place to add it in the first list. */ static __inline__ void list_splice(struct list_head *list, struct list_head *head) { struct list_head *first = list->next; if (first != list) { struct list_head *last = list->prev; struct list_head *at = head->next; first->prev = head; head->next = first; last->next = at; at->prev = last; } } /** * list_entry - get the struct for this entry * @ptr: the &struct list_head pointer. * @type: the type of the struct this is embedded in. * @member: the name of the list_struct within the struct. */ #define list_entry(ptr, type, member) \ ((type *)((fim_char_t *)(ptr)-(ptrdiff_t)(&((type *)0)->member))) /** * list_for_each - iterate over a list * @pos: the &struct list_head to use as a loop counter. * @head: the head for your list. */ #define list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); pos = pos->next) /** * list_for_each_safe - iterate over a list safe against removal of list entry * @pos: the &struct list_head to use as a loop counter. * @n: another &struct list_head to use as temporary storage * @head: the head for your list. */ #define list_for_each_safe(pos, n, head) \ for (pos = (head)->next, n = pos->next; pos != (head); \ pos = n, n = pos->next) /** * list_for_each_prev - iterate over a list in reverse order * @pos: the &struct list_head to use as a loop counter. * @head: the head for your list. */ #define list_for_each_prev(pos, head) \ for (pos = (head)->prev; pos != (head); pos = pos->prev) //end from list.h #endif /* FBI_STUFF_LIST_H */ fim-0.6-rc2/src/FbiStuffGif.cpp0000644000175000017500000002211214454347340013176 00000000000000/* $LastChangedDate: 2022-11-21 01:19:31 +0100 (Mon, 21 Nov 2022) $ */ /* FbiStuffGif.cpp : fbi functions for GIF files, modified for fim (c) 2008-2022 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #include #include #include #include //#include "loader.h" #include "FbiStuff.h" #include "FbiStuffLoader.h" #if defined(GIFLIB_MAJOR) && (GIFLIB_MAJOR >= 5) #define FIM_GIFLIB_STATE_HAS_ERRCODE 1 #else #define FIM_GIFLIB_STATE_HAS_ERRCODE 0 #endif #if defined(GIFLIB_MAJOR) && ((GIFLIB_MAJOR> 4) || ((GIFLIB_MAJOR==4) && defined(GIFLIB_MINOR) && (GIFLIB_MINOR>=2))) #define FIM_GIFLIB_RETIRED_PrintGifError 1 #else #define FIM_GIFLIB_RETIRED_PrintGifError 0 #endif #if defined(GIFLIB_MAJOR) && ((GIFLIB_MAJOR> 5) || ((GIFLIB_MAJOR==5) && defined(GIFLIB_MINOR) && (GIFLIB_MINOR>=1))) #define FIM_DGifCloseFile_ARG ,FIM_NULL #else #define FIM_DGifCloseFile_ARG #endif namespace fim { struct gif_state { FILE *infile; GifFileType *gif; GifPixelType *row; GifPixelType *il; int w,h; int ErrorCode; /* used by newer versions (e.g.: >= 5) of library */ }; #if FIM_GIFLIB_RETIRED_PrintGifError void FimPrintGifError(struct gif_state * gs) { #if defined(GIFLIB_MAJOR) && (GIFLIB_MAJOR==4) && defined(GIFLIB_MINOR) && (GIFLIB_MINOR>=2) int ErrorCode = GifError();// introduced in 4.2, removed in 5.0 #else int ErrorCode = gs->gif->Error; #endif /* On the basis of giflib-5.0.5/util/qprintf.c suggestion, after retirement of PrintGifError */ const char *Err = FIM_NULL; if(ErrorCode == 0) return; #if ( defined(GIFLIB_MAJOR) && (GIFLIB_MAJOR >= 5) ) Err = GifErrorString(ErrorCode);// Introduced in 4.2; argument from 5.0.0. #else Err = GifErrorString();// introduced in 4.2 #endif if (Err != FIM_NULL) fprintf(stderr, "GIF-LIB error: %s.\n", Err); else fprintf(stderr, "GIF-LIB undefined error %d.\n", ErrorCode); } #else /* Version 4.2 retired the PrintGifError function. */ #define FimPrintGifError(GS) PrintGifError #endif /* FIM_GIFLIB_RETIRED_PrintGifError */ static GifRecordType gif_fileread(struct gif_state *h) { GifRecordType RecordType; GifByteType *Extension = FIM_NULL; int ExtCode = 0, rc = 0; #if FIM_WANT_FBI_PRINTF const fim_char_t *type = FIM_NULL; #endif /* FIM_WANT_FBI_PRINTF */ for (;;) { if (GIF_ERROR == DGifGetRecordType(h->gif,&RecordType)) { if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: DGifGetRecordType failed\n"); FimPrintGifError(h); return (GifRecordType)-1; } switch (RecordType) { case IMAGE_DESC_RECORD_TYPE: if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: IMAGE_DESC_RECORD_TYPE found\n"); return RecordType; case EXTENSION_RECORD_TYPE: if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: EXTENSION_RECORD_TYPE found\n"); for (rc = DGifGetExtension(h->gif,&ExtCode,&Extension); FIM_NULL != Extension; rc = DGifGetExtensionNext(h->gif,&Extension)) { if (rc == GIF_ERROR) { if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: DGifGetExtension failed\n"); FimPrintGifError(h); return (GifRecordType)-1; } #if FIM_WANT_FBI_PRINTF if (FbiStuff::fim_filereading_debug()) { switch (ExtCode) { case COMMENT_EXT_FUNC_CODE: type="comment"; break; case GRAPHICS_EXT_FUNC_CODE: type="graphics"; break; case PLAINTEXT_EXT_FUNC_CODE: type="plaintext"; break; case APPLICATION_EXT_FUNC_CODE: type="appl"; break; default: type="???"; break; } FIM_FBI_PRINTF("gif: extcode=0x%x [%s]\n",ExtCode,type); } #endif /* FIM_WANT_FBI_PRINTF */ } break; case TERMINATE_RECORD_TYPE: if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: TERMINATE_RECORD_TYPE found\n"); return RecordType; default: if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: unknown record type [%d]\n",RecordType); return (GifRecordType)-1; } } } #if 0 static void gif_skipimage(struct gif_state *h) { fim_byte_t *line; int i; if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: skipping image record ...\n"); DGifGetImageDesc(h->gif); line = fim_malloc(h->gif->SWidth); for (i = 0; i < h->gif->SHeight; i++) DGifGetLine(h->gif, line, h->gif->SWidth); fim_free(line); } #endif static void* gif_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *info, int thumbnail) { struct gif_state *h = FIM_NULL; GifRecordType RecordType; int i, image = 0; h = (gif_state*)fim_calloc(1,sizeof(*h)); if(!h)goto oops; h->infile = fp; #if FIM_GIFLIB_STATE_HAS_ERRCODE h->gif = DGifOpenFileHandle(fileno(fp),&h->ErrorCode); /* TODO: shall make use of h->ErrorCode */ #else h->gif = DGifOpenFileHandle(fileno(fp)); #endif if(!h->gif)goto oops; /* opening gifs from stdin seems to cause DGifOpenFileHandle=FIM_NULL */ h->row = (GifPixelType*)fim_malloc(h->gif->SWidth * sizeof(GifPixelType)); if(!h->row)goto oops; while (0 == image) { RecordType = gif_fileread(h); switch (RecordType) { case IMAGE_DESC_RECORD_TYPE: if (GIF_ERROR == DGifGetImageDesc(h->gif)) { if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: DGifGetImageDesc failed\n"); FimPrintGifError(h); } if (FIM_NULL == h->gif->SColorMap && FIM_NULL == h->gif->Image.ColorMap) { if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: oops: no colormap found\n"); goto oops; } #if 0 info->width = h->w = h->gif->SWidth; info->height = h->h = h->gif->SHeight; #else info->width = h->w = h->gif->Image.Width; info->height = h->h = h->gif->Image.Height; #endif info->npages = 1; image = 1; if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: reading image record ...\n"); if (h->gif->Image.Interlace) { if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: interlaced\n"); { h->il = (GifPixelType*)fim_malloc(h->w * h->h * sizeof(GifPixelType)); if(!h->il)goto oops; } for (i = 0; i < h->h; i += 8) DGifGetLine(h->gif, h->il + h->w*i,h->w); for (i = 4; i < h->gif->SHeight; i += 8) DGifGetLine(h->gif, h->il + h->w*i,h->w); for (i = 2; i < h->gif->SHeight; i += 4) DGifGetLine(h->gif, h->il + h->w*i,h->w); } break; case TERMINATE_RECORD_TYPE: default: goto oops; } } if (0 == info->width || 0 == info->height) goto oops; if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: s=%dx%d i=%dx%d\n", h->gif->SWidth,h->gif->SHeight, h->gif->Image.Width,h->gif->Image.Height); return h; oops: if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: fatal error, aborting\n"); if(h->gif) { DGifCloseFile(h->gif FIM_DGifCloseFile_ARG); } fclose(h->infile); if(h && h->il )fim_free(h->il ); if(h && h->row)fim_free(h->row); if(h)fim_free(h); return FIM_NULL; } static void gif_read(fim_byte_t *dst, unsigned int line, void *data) { struct gif_state *h = (struct gif_state *) data; GifColorType *cmap; int x; if (h->gif->Image.Interlace) { if (line % 2) { DGifGetLine(h->gif, h->row, h->w); } else { memcpy(h->row, h->il + h->w * line, h->w); } } else { DGifGetLine(h->gif, h->row, h->w); } cmap = h->gif->Image.ColorMap ? h->gif->Image.ColorMap->Colors : h->gif->SColorMap->Colors; for (x = 0; x < h->w; x++) { dst[0] = cmap[h->row[x]].Red; dst[1] = cmap[h->row[x]].Green; dst[2] = cmap[h->row[x]].Blue; dst += 3; } } static void gif_done(void *data) { struct gif_state *h = (struct gif_state *) data; if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: done, cleaning up\n"); DGifCloseFile(h->gif FIM_DGifCloseFile_ARG); fclose(h->infile); if (h->il) fim_free(h->il); fim_free(h->row); fim_free(h); } static struct ida_loader gif_loader = { /*magic:*/ "GIF", /*moff:*/ 0, /*mlen:*/ 3, /*name:*/ "libungif", /*init:*/ gif_init, /*read:*/ gif_read, /*done:*/ gif_done, }; static void fim__init init_rd(void) { fim_load_register(&gif_loader); } } fim-0.6-rc2/src/Image.h0000644000175000017500000004345514454347340011544 00000000000000/* $LastChangedDate: 2023-03-25 18:31:40 +0100 (Sat, 25 Mar 2023) $ */ /* Image.h : Image class headers (c) 2007-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_IMAGE_H #define FIM_IMAGE_H #include "FbiStuff.h" #include "FbiStuffLoader.h" #include "fim.h" #if FIM_WANT_PIC_CMTS #include #include #include #include #include #endif /* FIM_WANT_PIC_CMTS */ #include #define FIM_WANT_IMG_SHRED 0 namespace fim { enum fim_cvd_t /* color vision deficiency */ { FIM_CVD_NO=0, /* no deficiency */ FIM_CVD_PROTANOPIA=1, /* a red/green color deficiency */ FIM_CVD_DEUTERANOPIA=2, /* a red/green color deficiency */ FIM_CVD_TRITANOPIA=3 /* a blue/yellow color deficiency */ }; enum fim_tii_t /* test image index */ { FIM_TII_NUL=0, FIM_TII_16M=1 }; /* pixel intensity float */ #if FIM_USE_CXX11 using fim_pif_t = float; #else /* FIM_USE_CXX11 */ typedef float fim_pif_t; #endif /* FIM_USE_CXX11 */ class Image FIM_FINAL #ifdef FIM_NAMESPACES :public Namespace #else /* FIM_NAMESPACES */ #endif /* FIM_NAMESPACES */ { public: explicit Image(const fim_char_t *fname, FILE *fd=FIM_NULL, fim_page_t page = 0); ~Image(void); int n_pages(void)const; bool is_multipage(void)const; bool is_mirrored(void)const; bool is_flipped(void)const; bool have_nextpage(int j=1)const; bool have_prevpage(int j=1)const; bool have_page(int page)const; private: Image& operator= (const Image& i){return *this;/* a nilpotent assignment */} fim_scale_t scale_; /* viewport variables */ fim_scale_t ascale_; fim_scale_t newscale_; fim_scale_t angle_; fim_scale_t newangle_;// 0-360 degrees fim_page_t page_; public: enum { FIM_ROT_L=3,FIM_ROT_R=1,FIM_ROT_U=2 }; const struct ida_image *get_ida_image(void)const{ return img_; } private: mutable struct ida_image *img_ ; /* local (possibly) copy images */ #if FIM_WANT_MIPMAPS fim_mipmap_t mm_; #endif /* FIM_WANT_MIPMAPS */ struct ida_image *fimg_ ; /* master image */ bool load(const fim_char_t *fname, FILE *fd, int want_page); public: void should_redraw(enum fim_redraw_t sr = FIM_REDRAW_NECESSARY) { redraw_ = sr; } /* for Viewport after drawing */ private: fim_redraw_t redraw_; enum { FIM_NO_ROT=0,FIM_ROT_ROUND=4 }; enum { FIM_ROT_L_C='L',FIM_ROT_R_C='R',FIM_ROT_U_C='U' }; enum { FIM_I_ROT_L=0, FIM_I_ROT_R=1}; /* internal */ fim_pgor_t orientation_; // orthogonal rotation fim_image_source_t fis_; fim_fn_t fname_; /* viewport variable, too */ size_t fs_; /* file size */ void free(void); void reset(void); public: bool is_tiny(void)const; void reset_view_props(void); void set_auto_props(fim_int autocenter, fim_int autotop); virtual size_t byte_size(void)const; bool can_reload(void)const; fim_err_t update_meta(bool fresh); fim::string getInfo(void)const; Image(const Image& rhs); // yes, a private constructor (was) #if FIM_WANT_BDI Image(enum fim_tii_t tii=FIM_TII_NUL); #endif /* FIM_WANT_BDI */ fim_err_t do_scale_rotate( fim_scale_t ns=0.0 ); #if FIM_WANT_CROP fim_err_t do_crop(const ida_rect prect); #endif /* FIM_WANT_CROP */ private: fim_err_t do_rotate( void ); public: fim_err_t rotate( fim_angle_t angle_=1.0 ); const fim_char_t* getName(void)const; cache_key_t getKey(void)const; fim_err_t reduce( fim_scale_t factor=FIM_CNS_SCALEFACTOR); fim_err_t magnify(fim_scale_t factor=FIM_CNS_SCALEFACTOR, fim_bool_t aes=false); fim_pgor_t getOrientation(void)const; fim_err_t set_scale(fim_scale_t ns); fim_scale_t get_scale(void)const{return scale_;} int get_page(void)const{return page_+1;} size_t get_file_size(void)const{return fs_;/* need a Browser::file_info_cache */} size_t get_pixelmap_byte_size(void)const; fim_err_t scale_multiply (fim_scale_t sm); fim_scale_t ascale(void)const{ return (ascale_>0.0?ascale_:1.0); } #if FIM_WANT_IMG_SHRED void shred(void); #endif /* FIM_WANT_IMG_SHRED */ fim_err_t negate (void); fim_err_t identity (void); fim_err_t desaturate (void); bool colorblind(enum fim_cvd_t cvd, bool daltonize); bool check_valid(void)const; int width(void)const; fim_coo_t original_width(void)const; int height(void)const; fim_coo_t original_height(void)const; bool goto_page(fim_page_t j); #if FIM_WANT_MIPMAPS void mm_free(void); void mm_make(void); bool has_mm(void)const; size_t mm_byte_size(void)const; #endif /* FIM_WANT_MIPMAPS */ bool cacheable(void)const; void desc_update(void); fim_bool_t need_redraw(void)const{ return (redraw_ != FIM_REDRAW_UNNECESSARY); } bool fetchExifToolInfo(const fim_char_t *fname); fim_int shall_mirror(void)const; fim_int check_flip(void)const; fim_int check_negated(void)const; fim_int check_desaturated(void)const; fim_int check_autotop(void)const; fim_int check_autocenter(void)const; void set_exif_extra(fim_int shouldrotate, fim_int shouldmirror, fim_int shouldflip); void get_irs(char *irs)const; }; /* class Image */ #if FIM_USE_CXX11 #if FIM_IMG_NAKED_PTRS using ImagePtr = Image*; using ImageCPtr = const Image*; #else /* FIM_IMG_NAKED_PTRS */ using ImagePtr = std::shared_ptr; using ImageCPtr = std::shared_ptr; #endif /* FIM_IMG_NAKED_PTRS */ #else /* FIM_USE_CXX11 */ typedef Image* ImagePtr; typedef const Image* ImageCPtr; #endif /* FIM_USE_CXX11 */ } /* namespace fim */ #if FIM_WANT_PIC_LVDN class VNamespace FIM_FINAL: public Namespace { public: const Var & setVariable(const fim_var_id& varname,const Var& value){return Namespace::setVariable(varname,value);} size_t byte_size(void)const { size_t bs=0; for( variables_t::const_iterator it = variables_.begin();it != variables_.end(); ++it ) bs += it->first.size() + sizeof(it->first), bs += it->second.size() + sizeof(it->second); return bs; } }; #endif /* FIM_WANT_PIC_LVDN */ #if FIM_WANT_PIC_CMTS class ImgDscs FIM_FINAL: public std::map { public: #if FIM_WANT_PIC_LVDN #if FIM_USE_CXX11 using vd_t = std::map ; #else /* FIM_USE_CXX11 */ typedef std::map vd_t; #endif /* FIM_USE_CXX11 */ vd_t vd_; #endif /* FIM_WANT_PIC_LVDN */ #if FIM_USE_CXX11 #else /* FIM_USE_CXX11 */ template struct ImgDscsCmp:public std::binary_function { public: bool operator() (const typename T::value_type &vo, const typename T::mapped_type mo) const { return vo.second == mo; } }; #endif /* FIM_USE_CXX11 */ ImgDscs::iterator li_; ImgDscs::iterator fo(const key_type& sk, const ImgDscs::iterator & li) { #if FIM_USE_CXX11 return std::find_if(li,end(),[&](ImgDscs::value_type v){return v.second == sk;}); #else /* FIM_USE_CXX11 */ return std::find_if(li,end(),std::bind2nd(ImgDscsCmp(),sk)); #endif /* FIM_USE_CXX11 */ } ImgDscs::const_iterator fo(const key_type& sk, const ImgDscs::const_iterator & li)const { #if FIM_USE_CXX11 return std::find_if(li,cend(),[&](ImgDscs::value_type v){return v.second == sk;}); #else /* FIM_USE_CXX11 */ return std::find_if(li,end() ,std::bind2nd(ImgDscsCmp(),sk)); #endif /* FIM_USE_CXX11 */ } public: ImgDscs::const_iterator fo(const key_type& sk)const { #if FIM_USE_CXX11 return std::find_if(cbegin(),cend(),[&](ImgDscs::value_type v){return v.second == sk;}); #else /* FIM_USE_CXX11 */ return std::find_if( begin(), end(),std::bind2nd(ImgDscsCmp(),sk)); #endif /* FIM_USE_CXX11 */ } private: ImgDscs::iterator fi(const key_type& sk) { ImgDscs::iterator li; if(li_ == end()) li_ = begin(); li = li_ = fo(sk,li_); if(li_ == end()) li_ = begin(); else ++li_; return li; } public: void reset(void) { li_=begin(); } ImgDscs(void) { reset(); } std::string expand(const VNamespace & ns, const fim_fn_t ds)const { #if FIM_WANT_DESC_VEXP fim_fn_t ss; // substituted string const fim_char_t ec = '@'; std::string::size_type bci = 0, eci = 0; while ( ( bci = ds.find(ec,eci) ) != std::string::npos ) { ss+=ds.substr(eci,bci-eci); if(ds[eci=++bci]=='#') { eci=ds.size(); break; } if(!fim_is_id_char(ds[eci=bci])) { ss+='@'; continue; } while(eci < ds.size() && fim_is_id_char(ds[++eci])) ; if(ns.isSetVar(ds.substr(bci,eci-bci))) ss+=ns.getStringVariable(ds.substr(bci,eci-bci)); else ss+='@', ss+=ds.substr(bci,eci-bci); // might issue warning instead } ss+=ds.substr(eci); #if FIM_USE_CXX11 return std::move(ss); #else /* FIM_USE_CXX11 */ return ss; #endif /* FIM_USE_CXX11 */ #else /* FIM_WANT_DESC_VEXP */ return ds; #endif /* FIM_WANT_DESC_VEXP */ } void fetch(const fim_fn_t& dfn, const fim_char_t sc) { /* dfn: descriptions file name */ /* sc: separator char */ std::ifstream mfs (dfn.c_str(),std::ios::app); std::string ln; #if FIM_WANT_PIC_CCMT std::string cps,cas,din; // contextual prepend/append/dirname string #endif /* FIM_WANT_PIC_CCMT */ #if FIM_WANT_PIC_RCMT std::string ld; // last description #endif /* FIM_WANT_PIC_RCMT */ #if FIM_WANT_PIC_LVDN VNamespace ns; #endif /* FIM_WANT_PIC_LVDN */ bool imgdscs_want_basename = true; /* FIXME: shall be more clear/flexible with this */ // fim_fms_t dt; // dt = - getmilliseconds(); while( std::getline(mfs,ln)) { std::stringstream ls(ln); key_type fn; const fim_char_t nl = '\n'; fim_fn_t ds; #if FIM_WANT_PIC_LVDN if( ls.peek() == FIM_SYM_PIC_CMT_CHAR ) { if( std::getline(ls,fn,nl) ) { size_t vn = fn.find("!fim:",1); /* vn will point to first variable id char */ if( vn != std::string::npos && fn[vn+=5] ) { size_t es = fn.find_first_of("=",vn); /* point to the first equal sign char */ if( es != std::string::npos ) { const std::string pvarname = fn.substr(vn,es-vn); // prefixed variable name ++es; #if FIM_WANT_PIC_CCMT /* FIXME: rationalize this code */ if( pvarname == "^" ) { const std::string varval = fn.substr(es); if( fn[es] ) cps = varval; else cps = ""; } else if( pvarname == "+" ) { const std::string varval = fn.substr(es); if( fn[es] ) cas = varval; else cas = ""; } else if( pvarname == "!" ) { ns = VNamespace();//reset } else if( pvarname == "/" ) { const std::string varval = fn.substr(es); if( fn[es] ) din = varval; else din = ""; imgdscs_want_basename = true; } else if( pvarname == "\\" ) { const std::string varval = fn.substr(es); if( fn[es] ) din = varval; else din = ""; imgdscs_want_basename = false; } else #endif /* FIM_WANT_PIC_CCMT */ if( fn[es] ) { if ( fim_is_id(pvarname.c_str()) ) { const std::string varval = fn.substr(es); ns.setVariable(pvarname,Var(varval)); } else ; // not an id; TODO: may warn the user } else { const std::string varname = fn.substr(vn,es-1-vn); ns.unsetVariable(varname); } } } } } else #endif /* FIM_WANT_PIC_LVDN */ if(std::getline(ls,fn,sc)) { const bool aoec = true; // (propagate i:variables) also on empty commentary if( (std::getline(ls,ds,nl) /* non empty commentary */) || aoec) { #if FIM_WANT_PIC_RCMT { const size_t csi = ds.find("#!fim:",0); size_t csil = 6; if( csi != 0 ) ld = ds; // cache new description else { // use last (cached) description const char oc = ds[csil]; switch(oc) { case('='): // #!fim:= ds = ld; break; case('+'): // #!fim:+ ds = ld + ds.substr(csil + 1); break; case('^'): // #!fim:^ ds = ds.substr(csil + 1) + ld; break; case('s'): // #!fim:s/from/to '/' not allowed in from or to { fim::string es = ds.substr(csil); size_t m = ((es).re_match("s/[^/]+/[^/]+")); if(m) { size_t n = es.find("/",2); std::string fs = es.substr(2,n-2), ts = es.substr(n+1); fim::string fds = ld; fds.substitute(fs.c_str(),ts.c_str()); ds = fds.c_str(); } } break; } } } #endif /* FIM_WANT_PIC_RCMT */ const bool would_remove = false; VNamespace cns; cns=ns; cns.cleanup(); if (!would_remove) { #if FIM_WANT_PIC_CCMT ds = cps + ds + cas; #endif /* FIM_WANT_PIC_CCMT */ ds = expand(ns,ds); if(! imgdscs_want_basename ) { (*this)[din+fn]=ds; #if FIM_WANT_PIC_LVDN vd_[std::string(din+fn)]=cns; #endif /* FIM_WANT_PIC_LVDN */ } else { (*this)[din+fim_basename_of(fn)]=ds; #if FIM_WANT_PIC_LVDN vd_[din+fim_basename_of(fn)]=cns; #endif /* FIM_WANT_PIC_LVDN */ } } else { // TODO: FIXME: this branch waits to be activated. // ... remove pic ds = expand(ns,ds); if(! (imgdscs_want_basename || true) ) { (*this)[din+fn]=ds; #if FIM_WANT_PIC_LVDN vd_[std::string(din+fn)]=cns; #endif /* FIM_WANT_PIC_LVDN */ } else { (*this)[din+fim_basename_of(fn)]=ds; #if FIM_WANT_PIC_LVDN vd_[din+fim_basename_of(fn)]=cns; #endif /* FIM_WANT_PIC_LVDN */ } } } } } reset(); #if FIM_WANT_PIC_LVDN // print(std::cout) << "\n"; shrink_to_fit(); // print(std::cout) << "\n"; #endif /* FIM_WANT_PIC_LVDN */ // dt += getmilliseconds(); // std::cout << fim::string("fetched images descriptions in ") << dt << " ms" << std::endl; } key_type fk(const mapped_type & sk) { mapped_type v; if ( fo(sk,li_) != end() ) { v = fi(sk)->first; } else { reset(); if ( fo(sk,li_) != end() ) v = fi(sk)->first; } return v; } void shrink_to_fit(void) { /* note we cannot it->first.shrink_to_fit(), */ #if FIM_USE_CXX11 for( auto it = begin();it != end(); ++it ) it->second.shrink_to_fit(); #if FIM_WANT_PIC_LVDN for( auto it = vd_.begin();it != vd_.end(); ++it ) it->second.shrink_to_fit(); #endif /* FIM_WANT_PIC_LVDN */ #endif /* FIM_USE_CXX11 */ } size_t byte_size(void)const { size_t bs = size() + sizeof(*this); for( const_iterator it = begin();it != end(); ++it ) bs += it->first.capacity() + sizeof(it->first), bs += it->second.capacity() + sizeof(it->second); #if FIM_WANT_PIC_LVDN for( vd_t::const_iterator it = vd_.begin();it != vd_.end(); ++it ) bs += it->first.capacity() + sizeof(it->first), bs += it->second.byte_size(); #endif /* FIM_WANT_PIC_LVDN */ return bs; } #if FIM_CACHE_DEBUG std::ostream& print(std::ostream& os)const { os << (size()) << " entries in " << byte_size() << " bytes"; return os; } #endif /* FIM_CACHE_DEBUG */ #if FIM_WANT_PIC_LVDN string get_variables_id_list(size_t up_to_max)const { // FIXME: not using up_to_max properly yet (by popularity, etc) ! size_t cnt = 0; std::ostringstream vls; fim_var_id_set vis; for( vd_t::const_iterator li = vd_.begin();li != vd_.end(); ++li ) li->second.get_id_list(vis); if(vis.size()) vls << "there are " << vis.size() << " variable ids:"; else vls << "no variable ids."; for( fim_var_id_set::const_iterator li = vis.begin();li != vis.end() && cnt < up_to_max ; ++li ) cnt++, vls << " " << *li; if( vis.size() > up_to_max ) vls << " ..."; return vls.str(); } #endif /* FIM_WANT_PIC_LVDN */ #if FIM_WANT_PIC_LVDN string get_values_list_for(const string& id, size_t up_to_max)const { // FIXME: not using up_to_max properly yet (by popularity, etc) ! string vls; size_t cnt = 0; //fim_var_val_set vvs; // FIXME: Var is not yet ready to be used in a std::set fim_var_id_set vvs;//FIXME: temporary for( vd_t::const_iterator li = vd_.begin();li != vd_.end(); ++li ) if( li->second.isSetVar(id) ) vvs.insert(li->second.getStringVariable(id)); if(vvs.size()) vls += string("there are "), vls += string(Var(static_cast(vvs.size()))), vls += string(" values for variable "), vls += id, vls += string(":"); else vls += string("no instances for variable "), vls += id, vls += string("."); //for( fim_var_val_set::const_iterator li = vvs.begin();li != vvs.end() for( fim_var_id_set ::const_iterator li = vvs.begin();li != vvs.end() && cnt < up_to_max ; ++li ) cnt++, vls += " '", vls += *li, // TODO: shall unescape this value vls += "'"; //vls += li->getString(); // TODO: shall unescape this value if( vvs.size() > up_to_max ) vls += " ..."; return vls; } #endif /* FIM_WANT_PIC_LVDN */ /* std::ostream& print_descs(std::ostream& os, fim_char_t sc)const { for( const_iterator it = begin();it != end(); ++it ) os << it->first << sc << it->second << "\n"; return os; } */ }; /* ImgDscs */ #if FIM_CACHE_DEBUG std::ostream& operator<<(std::ostream& os, const ImgDscs & id); #endif /* FIM_CACHE_DEBUG */ #endif /* FIM_WANT_PIC_CMTS */ #endif /* FIM_IMAGE_H */ fim-0.6-rc2/src/Command.h0000644000175000017500000000616014454347340012070 00000000000000/* $LastChangedDate: 2017-07-25 00:49:49 +0200 (Tue, 25 Jul 2017) $ */ /* Command.h : Fim Command class header file (c) 2007-2017 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_COMMAND_H #define FIM_COMMAND_H #include "fim.h" #if FIM_USE_CXX11 #include #endif /* FIM_USE_CXX11 */ namespace fim { #if FIM_USE_CXX11 using fim_cmd_id = fim::string; // command id using fim_cls = fim::string; // command line statement class Command FIM_FINAL { fim_cmd_id cmd_; fim::string help_; public: template explicit Command(fim_cmd_id cmd, fim::string help, O*op, fim::string(O::*fp)(const args_t&)); private: typedef std::function cmf_t; cmf_t cmf_; public: const fim_cmd_id & cmd(void)const; const fim::string & getHelp(void)const; fim::string execute(const args_t&args); bool operator < (const Command&c)const{return cmd_< c.cmd_;} bool operator <=(const Command&c)const{return cmd_<=c.cmd_;} ~Command(void) { } }; template Command::Command(fim_cmd_id cmd, fim::string help, O*op, fim::string(O::*fp)(const args_t&)) :cmd_(cmd),help_(help),cmf_(std::bind(fp,op,std::placeholders::_1)) {} #else /* FIM_USE_CXX11 */ typedef fim::string fim_cmd_id; // command id typedef fim::string fim_cls; // command line statement class Command FIM_FINAL { fim_cmd_id cmd_; fim::string help_; public: explicit Command(fim_cmd_id cmd, fim::string help, Browser *b, fim::string(Browser::*bf)(const args_t&)); explicit Command(fim_cmd_id cmd, fim::string help, CommandConsole *c,fim::string(CommandConsole::*cf)(const args_t&)); #ifdef FIM_WINDOWS explicit Command(fim_cmd_id cmd, fim::string help, FimWindow *w, fim::string(FimWindow::*cf)(const args_t&)); #endif /* FIM_WINDOWS */ private: union{ fim::string (Browser::*browserf_)(const args_t&) ; fim::string (CommandConsole::*consolef_)(const args_t&) ; #ifdef FIM_WINDOWS fim::string (FimWindow::*windowf_)(const args_t&) ; #endif /* FIM_WINDOWS */ }; union{ Browser *browser_; CommandConsole *commandconsole_; #ifdef FIM_WINDOWS FimWindow *window_; #endif /* FIM_WINDOWS */ }; public: const fim_cmd_id & cmd(void)const; const fim::string & getHelp(void)const; fim::string execute(const args_t&args); bool operator < (const Command&c)const{return cmd_< c.cmd_;} bool operator <=(const Command&c)const{return cmd_<=c.cmd_;} ~Command(void) { } }; #endif /* FIM_USE_CXX11 */ } /* namespace fim */ #endif /* FIM_COMMAND_H */ fim-0.6-rc2/src/CACADevice.cpp0000644000175000017500000003015114454347340012651 00000000000000/* $LastChangedDate: 2022-11-27 16:57:30 +0100 (Sun, 27 Nov 2022) $ */ /* CACADevice.cpp : libcaca device Fim driver file (c) 2008-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #ifdef FIM_WITH_LIBCACA #include "CACADevice.h" #define min(x,y) ((x)<(y)?(x):(y)) fim_err_t CACADevice::display( //const struct ida_image *img, // source image structure const void *ida_image_img, // source image structure //void* rgb,// source rgb array fim_coo_t iroff,fim_coo_t icoff, // row and column offset of the first input pixel fim_coo_t irows,fim_coo_t icols,// rows and columns in the input image fim_coo_t icskip, // input columns to skip for each line fim_coo_t oroff,fim_coo_t ocoff,// row and column offset of the first output pixel fim_coo_t orows,fim_coo_t ocols,// rows and columns to draw in output buffer fim_coo_t ocskip,// output columns to skip for each line fim_flags_t flags// some flags ) { /* * TODO : first cleanup, then generalize code from here and elsewhere to obtain reusable centering and copy code (with aa, fbdev). * */ void* rgb = ida_image_img?((const struct ida_image*)ida_image_img)->data:FIM_NULL;// source rgb array const int mirror=flags&FIM_FLAG_MIRROR, flip=flags&FIM_FLAG_FLIP; if ( !rgb ) return FIM_ERR_GENERIC; if( iroff <0 ) return -2; if( icoff <0 ) return -3; if( irows <=0 ) return -4; if( icols <=0 ) return -5; if( icskip<0 ) return -6; if( oroff <0 ) return -7; if( ocoff <0 ) return -8; if( orows <=0 ) return -9; if( ocols <=0 ) return -10; if( ocskip<0 ) return -11; if( flags <0 ) return -12; if( iroff>irows ) return -2-3*100 ; if( icoff>icols ) return -3-5*100; // if( oroff>orows ) return -7-9*100;//EXP // if( ocoff>ocols ) return -8-10*100;//EXP if( oroff>height() ) return -7-9*100;//EXP if( ocoff>width()) return -8-10*100;//EXP if( icskip height() ) return -9 -99*100; if( ocols > width() ) return -10-99*100; if( ocskip < width() ) return -11-99*100; if( icskip #include #include #include "common.h" #include "lex.h" #include "fim_interpreter.h" #include "fim.h" #ifndef yylex #define yylex lexer->yylex #endif /* See fim_interpreter.cpp for prototypes */ %} %union { fim_int iValue; /* integer value */ float fValue; /* float value */ fim_char_t* sValue; nodeType *nPtr; /* node pointer */ }; %token INTEGER //%token PIPE %token STRING %token SLASH_AND_REGEXP %token QUOTED_FLOAT %token UNQUOTED_FLOAT %token IDENTIFIER %token FILE_PATH //%token NEWLINE %token COMMAND //unimplemented yet %token WHILE IF DO ELSE SYSTEM AND BAND OR BOR NOT FESF //%token NEWLINE //%nonassoc IFX //%nonassoc FI //%nonassoc ELSE //%left '$' //lower priority %left ';' %nonassoc '}' '{' %left OR BOR %left AND BAND %left GE LE EQ REGEXP_MATCH NE '>' '<' %left '.' %nonassoc '(' ')' %left '%' %left '+' %left '-' %left '*' '/' %left NOT //%nonassoc UMINUS %left UMINUS //higher priority %type statement expression statement_list statements_block arguments conditional_statement if_statement loop_statement atomic_statements_block non_atomic_statements_block // unused // %type error // func_dec %destructor {freeNode($$);} %destructor {fim_free($$);} %% /* * we explicitly specify the starting nonterminal symbol * (will be enabled in the future, as some old working versions don't support this ) */ /*%start program;*/ /* * a whole program parse tree */ program: //function { ; /*exit(0);*/ } //statement { ex($1); FIM_FREENODE($1); } {} | statement_list { ex($1); FIM_FREENODE($1); }//conflict // | func_dec { } ; /* * a statement_list is a list of two or more statements concatenated by the ';' operator or separated by brackets or newlines */ statement_list: statement { $$ = $1; } | statement ';' statement_list { $$ = FIM_OPR(';', 2, $1, $3); } | non_atomic_statements_block statement_list{ $$ = FIM_OPR(';', 2, $1, $2); } | statements_block { $$ = $1; } ; non_atomic_statements_block: '{' statement_list '}' { $$ = FIM_OPR(';', 2, $2, NULL); } | INTEGER '{' statement_list '}' { if($1>0){$$ = FIM_OPR('r',2,FIM_OPR(';', 2, $3, NULL), FIM_ICON($1)); }} | conditional_statement { $$ = $1; } ; /* * a statements_block is a block of one or more statements/statement lists */ statements_block: atomic_statements_block { $$ = $1; } | non_atomic_statements_block { $$ = $1; } ; /* * a conditional statement */ conditional_statement: if_statement { $$ = $1; } | loop_statement { $$ = $1; } ; /* * if statements */ /* * here follows a 'dangling else' ambiguity ( dates back to Algol 60 :) ) */ if_statement: IF '(' expression ')' statements_block { $$ = FIM_OPR(IF, 2, $3, $5); } | IF '(' expression ')' statements_block ELSE statements_block { $$ = FIM_OPR(IF, 3, $3, $5, $7); } //<- causes shift-reduce conflict.. // | IF '(' expression ')' statement ';' ELSE statements_block { $$ = FIM_OPR(IF, 3, $3, $5, $8); } //<- causes shift-reduce conflict.. // | IF '(' expression ')' statements_block ELSE statement ';' { $$ = FIM_OPR(IF, 3, $3, $5, $7); } //<- causes shift-reduce conflict.. ; /* * a loop statement */ loop_statement: WHILE '(' expression ')' statements_block { $$ = FIM_OPR(WHILE, 2, $3, $5); } | DO statements_block WHILE '(' expression ')' { $$ = FIM_OPR(WHILE, 2, $5, $2); } ; atomic_statements_block: statement ';' { $$ = FIM_OPR(';', 2, $1, NULL); } | statement ';' ';' { $$ = FIM_OPR(';', 2, $1, NULL); /*a hack for handling redundancy */ } | statement ';' ';' ';' { $$ = FIM_OPR(';', 2, $1, NULL); /*a hack for handling redundancy */ } ; /* * function declaration */ //func_dec: // "function" IDENTIFIER '(' /*TODO: ARG_DECS */ ')' statements_block { ; } // ; /* * function: */ //function statement { ex($2); freeNode($2); } //function statement_list { ex($2); freeNode($2); } // function statement{ ex($2); freeNode($2); } // | /* NULL */ // ; /* * a simple statement */ statement: // ! 'shell-cmd' NOT arguments { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SYSTEM)),$2); } // | SYSTEM arguments { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SYSTEM)),$2); } // [n]cmd | INTEGER ',' INTEGER IDENTIFIER { $$ = FIM_OPR(FESF,3,FIM_ICON($1),FIM_ICON($3),FIM_SCON($4)); } | INTEGER ',' INTEGER IDENTIFIER arguments { $$ = FIM_OPR(FESF,4,FIM_ICON($1),FIM_ICON($3),FIM_SCON($4),$5); } | INTEGER IDENTIFIER { if($1>0){$$ = FIM_OPR('r',2,FIM_OPR('x',1,FIM_SCON($2)),FIM_ICON($1)); }} // goto | SLASH_AND_REGEXP { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_GOTO)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupsqstr ($1))))); fim_free($1); } // magnification | '+' UNQUOTED_FLOAT '%' { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('+',((float)$2),'%'))))); } | '+' QUOTED_FLOAT '%' { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('+',((float)$2),'%'))))); } | '+' INTEGER '%' { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('+',((double)$2),'%'))))); } | '*' UNQUOTED_FLOAT { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('*',((float)$2)))))); } | '*' QUOTED_FLOAT { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('*',((float)$2)))))); } | '*' INTEGER { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('*',((float)$2)))))); } | UNQUOTED_FLOAT '%'{if($1>0.0){$$=FIM_OPR('x',2,FIM_SCON(dupstr(FIM_VID_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr(((float)$1)/100.0f)))));}else { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('-',-((float)$1),'%'))))); } } | QUOTED_FLOAT '%'{if($1>0.0){$$=FIM_OPR('x',2,FIM_SCON(dupstr(FIM_VID_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr(((float)$1)/100.0f)))));}else { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('-',-((float)$1),'%'))))); } } | INTEGER'%'{{$$=FIM_OPR('x',2,FIM_SCON(dupstr(FIM_VID_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr(((float)$1),'%')))));}} // minification (yes, minification) | '-' UNQUOTED_FLOAT '%' { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('-',((float)$2),'%'))))); } | '-' QUOTED_FLOAT '%' { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('-',((float)$2),'%'))))); } | '-' INTEGER '%' { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_SCALE)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('-',((float)$2),'%'))))); } // $ and ^ work too (see lex.lex) | INTEGER { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_GOTO)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr( $1))))); } | '-' INTEGER { $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_GOTO)),FIM_OPR('a',1,FIM_OPR('a',1,FIM_SCON(dupnstr('-',$2))))); } // cmd .. | IDENTIFIER { $$ = FIM_OPR('x',1,FIM_SCON($1)); } | IDENTIFIER FILE_PATH { #ifdef FIM_SMART_COMPLETION /* This patch allows first filename argument unquoted. */ $$ = FIM_OPR('x',2,FIM_SCON($1),FIM_OPR('a',1,FIM_SCON(dupstr($2)))); fim_free($2); #else $$ = FIM_OPR('x',2,FIM_SCON(dupstr(FIM_FLT_ECHO)),FIM_OPR('a',1,FIM_SCON(dupstr("Please quote or double-quote your argument or enable FIM_SMART_COMPLETION at compile time\n")))); #endif } | IDENTIFIER arguments { $$ = FIM_OPR('x',2,FIM_SCON($1),$2); /* here I would like to use FIM_SMART_COMPLETION but for now it works with the FILE_PATH trick above. */ } | INTEGER IDENTIFIER arguments { if($1>0){$$ = FIM_OPR('r',2,FIM_OPR('x',2,FIM_SCON($2),$3),FIM_ICON($1)); }} // assignment | IDENTIFIER '=' expression { $$ = FIM_OPR('=', 2, FIM_VSCON($1,'a'), $3); } // semicolons can be added arbitrarily with no harm (not so Vim'ish, though) // | statement ';' { $$ = $1; } // new // | NEWLINE { /* this still doesn't work as we would like to */ } // | error { yyerrok ; /* can be evil */ } ; /* * command arguments are separated arguments * * Here a reduce/reduce problem arise: * IDENTIFIER STRING '-' STRING -> IDENTIFIER ARG ARG -> IDENTIFIER ARGS or * IDENTIFIER STRING '-' STRING -> IDENTIFIER ARG ARG -> IDENTIFIER ARGS ? * * should be interpeted as a a single expression or as two arguments ? * * the same for : * * IDENTIFIER INTEGER '-' INTEGER -> IDENTIFIER ARG ARG -> IDENTIFIER ARGS or * IDENTIFIER INTEGER '-' INTEGER -> IDENTIFIER EXPR -> IDENTIFIER ARGS ? * * Vim seems to handle this in a context (command) dependent way: * * :echo -1 -1 * -2 * vs * * :imap */ arguments: expression { $$ = FIM_OPR('a',1, $1 ); } | expression arguments { $$ = FIM_OPR('a', 2, $1, $2); } ; /* * a command argument is an expressionession or a concatenation of expressionessions */ //arg: // expression { $$ = FIM_OPR('a',1, $1 ); } // | expression '.' expression { $$ = FIM_OPR('.', 2, $1, $3); } // ; /* * expressionessions (mostly numerical: strings are not well supported right now) */ expression: '(' expression ')' { $$ = $2; } | expression '.' expression { $$ = FIM_OPR('.', 2, $1, $3); } | NOT expression { $$ = FIM_OPR('!', 1, $2); } | expression '%' expression { $$ = FIM_OPR('%', 2, $1, $3); } | expression '+' expression { $$ = FIM_OPR('+', 2, $1, $3); } | expression '-' expression { $$ = FIM_OPR('-', 2, $1, $3); } | expression '*' expression { $$ = FIM_OPR('*', 2, $1, $3); } | expression '/' expression { $$ = FIM_OPR('/', 2, $1, $3); } | expression '<' expression { $$ = FIM_OPR('<', 2, $1, $3); } | expression '>' expression { $$ = FIM_OPR('>', 2, $1, $3); } | expression OR expression { $$ = FIM_OPR( OR , 2, $1, $3); } | expression BOR expression { $$ = FIM_OPR( BOR , 2, $1, $3); } | expression AND expression { $$ = FIM_OPR( AND, 2, $1, $3); } | expression BAND expression { $$ = FIM_OPR( BAND, 2, $1, $3); } | expression GE expression { $$ = FIM_OPR(GE, 2, $1, $3); } | expression LE expression { $$ = FIM_OPR(LE, 2, $1, $3); } | expression NE expression { $$ = FIM_OPR(NE, 2, $1, $3); } | expression EQ expression { $$ = FIM_OPR(EQ, 2, $1, $3); } | expression REGEXP_MATCH expression { $$ = FIM_OPR(REGEXP_MATCH, 2, $1, $3); } /* * writing the same next rule with '-' instead UMINUS * would cause lots of conflicts, because UMINUS gets * caught by the lexer, contrarily to the lone '-' string. */ // | UMINUS expression { $$ = FIM_OPR('-', 1, $2); } // conflict // | UMINUS expression { $$ = FIM_OPR('-', 1, $2); } // conflict | '-' expression %prec UMINUS { $$ = FIM_OPR(UMINUS, 1, $2); } //conflicts // | '(' '-' expression ')' %prec UMINUS { $$ = FIM_OPR('-', 1, $3); } // conflict // | '`' IDENTIFIER '`' { $$ = FIM_OPR('x',1,FIM_SCON($2)); } | IDENTIFIER { $$ = FIM_VSCON($1,'v'); } | INTEGER { $$ = FIM_ICON($1); } | QUOTED_FLOAT { $$ = FIM_FCON($1); } | UNQUOTED_FLOAT { $$ = FIM_FCON($1); } | STRING { $$ = FIM_SCON($1); } ; %% /* See fim_interpreter.cpp */ fim-0.6-rc2/src/fim_interpreter.h0000644000175000017500000000345514454347340013714 00000000000000/* $LastChangedDate: 2016-02-16 12:08:20 +0100 (Tue, 16 Feb 2016) $ */ /* interpreter.h : Interpreter-related declarations (c) 2016-2016 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This file will grow, as definitions will be moved there from fim.h */ #ifndef FIM_INTERPRETER_H #define FIM_INTERPRETER_H #include "fim.h" #if FIM_INDEPENDENT_NAMESPACE #define FIM_SCON(V) scon(V) #define FIM_VSCON(V,T) vscon(V,T) #define FIM_FCON(V) fcon(V) #define FIM_ICON(V) con(V) #define FIM_OPR opr #define FIM_FREENODE freeNode #else /* FIM_INDEPENDENT_NAMESPACE */ #define FIM_SCON(V) scon(V) #define FIM_VSCON(V,T) vscon(V,T) #define FIM_FCON(V) fcon(V) #define FIM_ICON(V) con(V) #define FIM_OPR opr #define FIM_FREENODE freeNode #endif /* FIM_INDEPENDENT_NAMESPACE */ /* TODO: need to rename the functions in here */ void yyerror(const fim_char_t *s); nodeType *opr(int oper, int nops, ...); //nodeType *fid(float f); nodeType *con(fim_int value); nodeType *fcon(float fValue); nodeType *scon(fim_char_t* s); nodeType *vscon(fim_char_t*s,int typeHint); void freeNode(nodeType *p); Var ex(nodeType *p); #endif /* FIM_INTERPRETER_H */ fim-0.6-rc2/src/FbiStuffJasPer.cpp0000644000175000017500000001562414454347340013667 00000000000000/* $LastChangedDate: 2022-10-30 16:13:52 +0100 (Sun, 30 Oct 2022) $ */ /* FbiStuffXyz.cpp : An example file for reading new file types with hypothetical library libjp2. (c) 2014-2022 Michele Martone based on code (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #if FIM_WITH_LIBJASPER /* Experimental, preliminar, unfinished support for JPEG-2K (JPEG-2000) files loading. * Error handling and performance shall be dealt with... * * A few references: * http://www.ece.uvic.ca/~frodo/jasper * http://www.jpeg.org/jpeg2000/index.html * https://tools.ietf.org/html/rfc3745 */ #include #include #include #include #ifdef HAVE_ENDIAN_H #include #endif /* HAVE_ENDIAN_H */ #include namespace fim { extern CommandConsole cc; typedef unsigned char fim_byte_t ; #define JP2_ERR -1 #define JP2_OK 0 #define jp2_vctocc(i, co, cs) \ (( (i) - (co)) / (cs)) static int jp2_image_render(jas_image_t *image, int vw, int vh, fim_byte_t *vdata) { /* Derived from jas_image_render in the jasper-1.900.1/src/appl/jiv.c example. */ int i; int j; int k; int x; int y; int v[3]; fim_byte_t *vdatap; int cmptlut[3]; int width; int height; int hs; int vs; int tlx; int tly; FIM_CONSTEXPR int sc = 256; if ((cmptlut[0] = jas_image_getcmptbytype(image, JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R))) < 0 || (cmptlut[1] = jas_image_getcmptbytype(image, JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G))) < 0 || (cmptlut[2] = jas_image_getcmptbytype(image, JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B))) < 0) goto error; width = jas_image_cmptwidth(image, cmptlut[0]); height = jas_image_cmptheight(image, cmptlut[0]); tlx = jas_image_cmpttlx(image, cmptlut[0]); tly = jas_image_cmpttly(image, cmptlut[0]); vs = jas_image_cmptvstep(image, cmptlut[0]); hs = jas_image_cmpthstep(image, cmptlut[0]); for (i = 1; i < 3; ++i) { if (jas_image_cmptwidth(image, cmptlut[i]) != width || jas_image_cmptheight(image, cmptlut[i]) != height) goto error; } for (i = 0; i < vh; ++i) { vdatap = &vdata[( i) * (3 * vw)]; for (j = 0; j < vw; ++j) { x = jp2_vctocc(j, tlx, hs); y = jp2_vctocc(i, tly, vs); for (k = 0; k < 3; ++k) { v[k] = jas_image_readcmptsample(image, cmptlut[k], x, y); v[k] <<= 16 - jas_image_cmptprec(image, cmptlut[k]); if (v[k] < 0) { v[k] = 0; } else if (v[k] > 65535) { v[k] = 65535; } } v[0]/=sc; v[1]/=sc; v[2]/=sc; *vdatap++ = v[0]; *vdatap++ = v[1]; *vdatap++ = v[2]; } } return JP2_OK; error: return JP2_ERR; } struct jp2_state { FILE *fp; int w; /* image width: 1... */ int h; /* image height: 1... */ size_t flen; /* file length */ fim_byte_t*rgb; /* pixels, from upper left to lower right, line by line */ int bytes_per_line; /* rgb has bytes_per_line bytes per line */ jas_stream_t *in; jas_image_t *image; jas_cmprof_t *outprof; }; static void* jp2_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { /* it is safe to ignore filename, page, thumbnail */ struct jp2_state *h = FIM_NULL; fim_err_t errval = FIM_ERR_GENERIC; long fo = 0; h = (struct jp2_state *)fim_calloc(1,sizeof(*h)); if(!h) goto oops; h->fp = fp; if(fseek(h->fp,0,SEEK_END)!=0) goto oops; fo = ftell(h->fp); h->flen = fo; /* FIXME: evil conversion */ if( fo == -1 ) goto oops; if (jas_init()) { goto oops; } /* see also: jas_stream_t *jas_stream_fopen(const char *filename, const char *mode); jas_stream_t *jas_stream_memopen(char *buf, int bufsize); jas_stream_t *jas_stream_fdopen(int fd, const char *mode); jas_stream_t *jas_stream_freopen(const char *path, const char *mode, FILE *fp); */ if(filename) { if (!(h->in = jas_stream_fopen(filename, "rb"))) { fprintf(stderr, "error: cannot open file %s\n", filename); goto oops; } } else goto oops; if (!(h->image = jas_image_decode(h->in, -1, 0))) { fprintf(stderr, "error: cannot load image data\n"); goto oops; } #if 0 if (!(h->outprof = jas_cmprof_createfromclrspc(JAS_CLRSPC_SRGB))) { goto oops; } jas_image_t *altimage; if (!(altimage = jas_image_chclrspc(h->image, outprof, JAS_CMXFORM_INTENT_PER))) goto oops;*/ fprintf(stderr, "num of components %d\n", jas_image_numcmpts(h->image)); fprintf(stderr, "dimensions %d %d\n", jas_image_width(h->image), jas_image_height(h->image)); #endif i->width = jas_image_width(h->image); i->height = jas_image_height(h->image); i->npages = 1; h->rgb = (fim_byte_t*) fim_calloc( i->width * i->height * 3 , sizeof(fim_byte_t)); if(!h->rgb) { std::cout << "Failed fim_calloc!\n"; goto oops; } if( JP2_OK != jp2_image_render(h->image, i->width, i->height, h->rgb) ) { goto oops; } h->w = i->width; h->h = i->height; h->bytes_per_line = i->width * 3; if(!h->rgb) { std::cout << "Failed fim_malloc!\n"; goto oops; } jas_stream_close(h->in); errval = FIM_ERR_NO_ERROR; if(errval != FIM_ERR_NO_ERROR) { std::cout << "Failed jp2_load_image_fp!\n"; goto oops; } jas_cleanup(); return h; oops: if(h) { if(h->in) jas_stream_close(h->in); if(h->rgb) fim_free(h->rgb); fim_free(h); } jas_cleanup(); return FIM_NULL; } static void jp2_read(fim_byte_t *dst, unsigned int line, void *data) { /* this gets called every line. can be left empty if useless. */ struct jp2_state *h = (struct jp2_state *) data; int c; for (c=0;cw;++c) { dst[c*3+0] = h->rgb[h->bytes_per_line*line+c*3+0]; dst[c*3+1] = h->rgb[h->bytes_per_line*line+c*3+1]; dst[c*3+2] = h->rgb[h->bytes_per_line*line+c*3+2]; } } static void jp2_done(void *data) { struct jp2_state *h = (struct jp2_state *) data; fclose(h->fp); fim_free(h->rgb); fim_free(h); } struct ida_loader jp2_loader = { /* * 12 chars, of which 3 heading zeros * 0000000: 0000 000c 6a50 2020 0d0a 870a ....jP .... * (https://www.iana.org/assignments/media-types/image/jp2) */ /*magic:*/ "\x0c\x6a\x50\x20\x20\x0d\x0a\x87\x0a", /*moff:*/ 3, /*mlen:*/ 9, /*name:*/ "jp2", /*init:*/ jp2_init, /*read:*/ jp2_read, /*done:*/ jp2_done, }; static void fim__init init_rd(void) { fim_load_register(&jp2_loader); } } #endif /* FIM_WITH_LIBJASPER */ fim-0.6-rc2/src/FimWindow.cpp0000644000175000017500000007253714454347340012763 00000000000000/* $LastChangedDate: 2022-11-16 02:27:16 +0100 (Wed, 16 Nov 2022) $ */ /* FimWindow.cpp : Fim's own windowing system (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #ifdef FIM_WINDOWS #define FIM_WINDOW_PROBLEM "FimWindow Internal Error" namespace fim { fim_cxr FimWindow::fcmd_cmd(const args_t&args) { #if FIM_DISABLE_WINDOW_SPLITTING return "Warning: window control (splitting, etc.) is disabled. It may be re-enabled in a future version.\n"; #else /* FIM_DISABLE_WINDOW_SPLITTING */ unsigned int i=0; fim_err_t rc=0;/*return code*/ #ifdef FIM_AUTOCMDS fim::string c=getGlobalIntVariable(FIM_VID_FILENAME); // note that an autocommand on a transient object is lethal if(amroot_) { FIM_AUTOCMD_EXEC(FIM_ACM_PREWINDOW,c); } #endif /* FIM_AUTOCMDS */ try { while(ireassignWindow(this); } else viewport_=new Viewport( commandConsole_, displaydevice, corners_ ); if( viewport_ == FIM_NULL ) throw FIM_E_NO_MEM; } //#ifdef FIM_UNDEFINED #if !FIM_DISABLE_WINDOW_SPLITTING FimWindow::FimWindow(const FimWindow& root): #ifdef FIM_NAMESPACES Namespace(root), #endif /* FIM_NAMESPACES */ displaydevice_(root.displaydevice_), corners_(root.corners_),focus_(root.focus_),first_(root.first_),second_(root.second_),amroot_(false), viewport_(FIM_NULL),commandConsole_(root.commandConsole_) { /* * A new leave FimWindow is created with a specified geometry. * An exception is launched upon memory errors. * * Note : this member function is useless, and should be kept private :D */ viewport_=new Viewport( commandConsole_, root.displaydevice_, corners_ ); if( viewport_ == FIM_NULL ) throw FIM_E_NO_MEM; } //#endif #endif #if !FIM_DISABLE_WINDOW_SPLITTING bool FimWindow::issplit(void)const { /* * return whether this window is split in some way * */ return ( first_ && second_ ) ; } #endif #if !FIM_DISABLE_WINDOW_SPLITTING bool FimWindow::isleaf(void)const { /* * +----------+ * |____|_____| * |+--+| | * ||L || | * |+--+| | * +----------+ * NON LEAF * +----------+ * * +----------+ * | | * | LEAF | * | | * | | * +----------+ */ return ( ! first_ && ! second_ ) ; } #endif #if !FIM_DISABLE_WINDOW_SPLITTING bool FimWindow::isvalid(void)const { /* * return whether this window is split right, if it is * */ return !(( first_ && ! second_ ) || ( ! first_ && second_ ) ); } #endif #if !FIM_DISABLE_WINDOW_SPLITTING bool FimWindow::ishsplit(void)const { /* * +----------+ * | | * |__________| * | | * | | * +----------+ */ return ( issplit() && focused().corners_.x_==shadowed().corners_.x_ ) ; } #endif #if !FIM_DISABLE_WINDOW_SPLITTING bool FimWindow::isvsplit(void)const { /* * +----------+ * | | | * | | | * | | | * | | | * +----------+ */ return ( issplit() && focused().corners_.y_==shadowed().corners_.y_ ) ; } const FimWindow& FimWindow::c_focused(void)const { /* * return a const reference to the focused window * throws an exception in case the window is not split! * */ if(isleaf())/* temporarily, for security reasons */throw FIM_E_WINDOW_ERROR; if(focus_==false) return first_->c_focused(); else return second_->c_focused(); } #endif #if !FIM_DISABLE_WINDOW_SPLITTING FimWindow& FimWindow::focused(void)const { /* * return a reference to the focused window * throws an exception in case the window is not split! * */ if(isleaf())/* temporarily, for security reasons */throw FIM_E_WINDOW_ERROR; if(focus_==false) return *first_; else return *second_; } #endif #if !FIM_DISABLE_WINDOW_SPLITTING FimWindow& FimWindow::upper(void) { /* * return a reference to the upper window * throws an exception in case the window is not split! * */ if(!ishsplit())/* temporarily, for security reasons */throw FIM_E_WINDOW_ERROR; return *first_; } FimWindow& FimWindow::lower(void) { /* * return a reference to the lower window * throws an exception in case the window is not split! * */ if(!ishsplit())/* temporarily, for security reasons */throw FIM_E_WINDOW_ERROR; return *second_; } FimWindow& FimWindow::left(void) { /* * return a reference to the left window * throws an exception in case the window is not split! * */ if(!isvsplit())/* temporarily, for security reasons */throw FIM_E_WINDOW_ERROR; return *first_; } FimWindow& FimWindow::right(void) { /* * return a reference to the right window * throws an exception in case the window is not split! * */ if(!isvsplit())/* temporarily, for security reasons */throw FIM_E_WINDOW_ERROR; return *second_; } #endif #if !FIM_DISABLE_WINDOW_SPLITTING FimWindow& FimWindow::shadowed(void)const { /* * return a const reference to the right window * throws an exception in case the window is not split! * */ if(isleaf())/* temporarily, for security reasons */throw FIM_E_WINDOW_ERROR; if(focus_!=false) return *first_; else return *second_; } #endif #if !FIM_DISABLE_WINDOW_SPLITTING const FimWindow& FimWindow::c_shadowed(void)const { /* * return a const reference to the shadowed window * throws an exception in case the window is not split! * */ if(isleaf())/* temporarily, for security reasons */throw FIM_E_WINDOW_ERROR; if(focus_!=false) return first_->c_shadowed(); else return second_->c_shadowed(); } #endif void FimWindow::setroot(void) { /* * FIXME * */ amroot_=true; } #if !FIM_DISABLE_WINDOW_SPLITTING void FimWindow::split(void) { /* * an alias for hsplit(void) * */ hsplit(); } #endif #if 0 void FimWindow::print_focused(void) { if(isleaf()) { std::cout << "F:" ; corners_.print(); } else focused().print_focused(); } void FimWindow::print(void) { if(amroot_) std::cout<<"--\n"; if(amroot_) print_focused(); if(isleaf()) std::cout<<"L:"; corners_.print(); if(!isleaf()) first_ ->print(); if(!isleaf()) second_->print(); } #endif #if !FIM_DISABLE_WINDOW_SPLITTING void FimWindow::hsplit(void) { /* * splits the window with a horizontal separator * */ if( ! isvalid() ) return; /* * we should check if there is still room to split ... * */ if(isleaf()) { first_ = new FimWindow( commandConsole_, displaydevice_, this->corners_.hsplit(Rect::Upper),viewport_); second_ = new FimWindow( commandConsole_, displaydevice_, this->corners_.hsplit(Rect::Lower),viewport_); if(viewport_ && first_ && second_) { #define FIM_COOL_WINDOWS_SPLITTING 0 #if FIM_COOL_WINDOWS_SPLITTING first_ ->current_viewport().pan_up ( second_->current_viewport().viewport_height() ); #endif /* FIM_COOL_WINDOWS_SPLITTING */ delete viewport_; viewport_ = FIM_NULL; } } else focused().hsplit(); } void FimWindow::vsplit(void) { /* * splits the window with a vertical separator * */ if( !isvalid() ) return; /* * we should check if there is still room to split ... * */ if(isleaf()) { first_ = new FimWindow( commandConsole_, displaydevice_, this->corners_.vsplit(Rect::Left ),viewport_); second_ = new FimWindow( commandConsole_, displaydevice_, this->corners_.vsplit(Rect::Right),viewport_); if(viewport_ && first_ && second_) { #if FIM_COOL_WINDOWS_SPLITTING second_->current_viewport().pan_right( first_->current_viewport().viewport_width() ); #endif /* FIM_COOL_WINDOWS_SPLITTING */ delete viewport_; viewport_ = FIM_NULL; } } else focused().vsplit(); } #endif #if !FIM_DISABLE_WINDOW_SPLITTING bool FimWindow::swap(void) { /* * swap window content * * FIXME : unfinished * * +-----+-----+ +-----+-----+ * | | | | | | * | S | F |-->| F | S | * | | | | | | * |b.jpg|a.jpg| |a.jpg|b.jpg| * +-----+-----+ +-----+-----+ */ if( !isvalid() ) return false; if(isleaf()) { // no problem return false; } else if(focused().isleaf()) { Viewport *vf,*vs; vf = focused().viewport_; vs = shadowed().viewport_; // WARNING : dangerous if(vf && vs) { ;//vf ->reassignWindow(&(shadowed())); ;//vs ->reassignWindow(&( focused())); focused().viewport_ = vs; shadowed().viewport_ = vf; } else { // an error should be spawned // FIXME return false; } } else return focused().swap(); return true; } bool FimWindow::close(void) { /* * closing a leaf window implies its rejoining with the parent one * * FIXME : unfinished * * +----+-----+ +----------+ * | | | | | * | | |-->| | * | | | | | * | | | | | * +----+-----+ +----------+ */ if( !isvalid() ) return false; if(isleaf()) { // no problem return false; } else if(focused().isleaf()) { /*if(ishsplit()) this->corners_=Rect(focused().corners_.x,focused().corners_.y,shadowed().corners_.w,focused().corners_.h+shadowed().corners_.h); else if(isvsplit()) this->corners_=Rect(focused().corners_.x,focused().corners_.y,shadowed().corners_.w+focused().corners_.w,shadowed().corners_.h); else ;//error */ /* * some inheritance operations needed here! */ // WARNING : dangerous if(viewport_) { cout << "viewport_ should be FIM_NULL!\n"; // an error should be spawned } if( ( viewport_ = focused().viewport_ ) ) { ;//viewport_ ->reassignWindow(this); focused().viewport_=FIM_NULL; } else { // error action return false; } delete first_; first_ = FIM_NULL; delete second_; second_ = FIM_NULL; } else return focused().close(); // print(); return true; } void FimWindow::balance(void) { /* * FIXME * +---+-------+ +-----+-----+ * |---+-------+ | | | * | |-->| | | * | | +-----+-----+ * | | | | | * | | | | | * +-----------+ +-----+-----+ */ } FimWindow::Moves FimWindow::reverseMove(Moves move) { /* * returns the complementary window move * * ( > )^-1 = < * ( < )^-1 = > * ( ^ )^-1 = v * ( v )^-1 = ^ * */ if(move==Left ) return Right; if(move==Right) return Left; if(move==Up ) return Down; if(move==Down ) return Up; return move; } #endif #if !FIM_DISABLE_WINDOW_SPLITTING FimWindow::Moves FimWindow::move_focus(Moves move) { /* * shifts the focus_ from a window to another, * unfortunately not always adjacent (a better algorithm would is needed for this) * * maybe more abstractions is needed here.. * */ Moves m; if( isleaf() || move==NoMove ) return NoMove; else if( isvsplit() ) { if( move != Left && move != Right ) return focused().move_focus(move); if( focused().isleaf() ) { if( ( right() == focused() && move == Left ) || ( left() == focused() && move == Right ) ) { chfocus(); return move; } else { return NoMove; } } else { if((m=focused().move_focus(move)) == NoMove) { chfocus(); focused().move_focus(reverseMove(move)); } return move; } } else if( ishsplit() ) { if( move != Up && move != Down ) return focused().move_focus(move); if( focused().isleaf() ) { if( ( upper() == focused() && move == Down ) || ( lower() == focused() && move == Up ) ) { chfocus(); return move; } else { return NoMove; } } else { if((m=focused().move_focus(move)) == NoMove) { chfocus(); focused().move_focus(reverseMove(move)); } return move; } } return move; } bool FimWindow::chfocus(void) { /* * this makes sense if issplit(). * * swaps the focus_ only. * * +----+----+ +----+----+ * | | | | | | * | | | | | | * | F | S |-->| S | F | * | | | | | | * +----+----+ +----+----+ */ return focus_ = !focus_; } #endif fim_coo_t Rect::height(void)const { /* * +---+ + * | | | * +---+ + */ return h_ ; } #if !FIM_DISABLE_WINDOW_SPLITTING fim_coo_t Rect::setwidth(fim_coo_t w) { /* * +---+ * +---+ * | | * +---+ */ return w_=w; } fim_coo_t Rect::setheight(fim_coo_t h) { /* * +---+ + * | | | * +---+ + */ return h_=h; } #endif fim_coo_t Rect::width(void)const { /* * +---+ * +---+ * | | * +---+ */ return w_ ; } #if !FIM_DISABLE_WINDOW_SPLITTING fim_coo_t Rect::setxorigin(fim_coo_t x) { /* * o---+ * | | * +---+ */ return x_=x ; } fim_coo_t Rect::setyorigin(fim_coo_t y) { /* * o---+ * | | * +---+ */ return y_=y ; } #endif fim_coo_t Rect::xorigin(void)const { /* * o---+ * | | * +---+ */ return x_ ; } fim_coo_t Rect::yorigin(void)const { /* * o---+ * | | * +---+ */ return y_ ; } #if !FIM_DISABLE_WINDOW_SPLITTING bool FimWindow::can_vgrow(const FimWindow& window, fim_coo_t howmuch)const { /* * Assuming that the argument window is a contained one, * can this window grow the specified amount and assure the * minimum spacing is respected ? * * +--------+ * +-^-+this| * | ? | | * +-v-+ | * +--------+ */ return window.corners_.height() + howmuch + vspacing < corners_.height(); } bool FimWindow::can_hgrow(const FimWindow& window, fim_coo_t howmuch)const { /* * Assuming that the argument window is a contained one, * can this window grow the specified amount and assure the * minimum spacing is respected ? * * +--------+ * +---+this| * || | * +---+ | * +--------+ */ return window.corners_.width() + howmuch + hspacing < corners_.width(); } #endif #if !FIM_DISABLE_WINDOW_SPLITTING bool FimWindow::operator==(const FimWindow&window)const { /* * #===# * # # * #===# */ return corners_==window.corners_; } #endif #if !FIM_DISABLE_WINDOW_SPLITTING int FimWindow::count_hdivs(void)const { /* * how many horizontal divisions ? * * +----------+ * | | * | | hdivs = 3 * +----------+ * +----------+ * +----------+ * */ return (isleaf()|| !ishsplit())?1: first_->count_hdivs()+ second_->count_hdivs(); } int FimWindow::count_vdivs(void)const { /* * how many vertical divisions ? * */ return (isleaf()|| !isvsplit())?1: first_->count_vdivs()+ second_->count_vdivs(); } #endif /* FIM_DISABLE_WINDOW_SPLITTING */ #if !FIM_DISABLE_WINDOW_SPLITTING bool FimWindow::normalize(void) { /* * FIXME vs balance * * +---+-------+ +-----+-----+ * |---+-------+ | | | * | |-->| | | * | | +-----+-----+ * | | | | | * | | | | | * +-----------+ +-----+-----+ */ return // (hnormalize(corners_.xorigin(), corners_.width() )!= -1); (hnormalize(corners_.xorigin(), corners_.width() )!= -1) && (vnormalize(corners_.yorigin(), corners_.height())!= -1); } fim_err_t FimWindow::vnormalize(fim_coo_t y, fim_coo_t h) { /* * balances the horizontal divisions height * * FIXME * * +---+-------+ +---+-------+ * |---+-------+ | | | * | |-->| | | * | | +---+-------+ * | | | | | * | | | | | * +-----------+ +---+-------+ */ if(isleaf()) { corners_.setyorigin(y); corners_.setheight(h); return FIM_ERR_NO_ERROR; } else { int fhdivs,/*shdivs,*/hdivs,upd; fhdivs=first_ ->count_hdivs(); //shdivs=second_->count_hdivs(); hdivs=count_hdivs(); upd=h/hdivs; if(hdivs>h)// no space left return FIM_ERR_GENERIC; //... corners_.setyorigin(y); corners_.setheight(h); if(ishsplit()) { first_-> vnormalize(y,upd*fhdivs); second_->vnormalize(y+upd*fhdivs,h-upd*fhdivs); } else { first_-> vnormalize(y,h); second_->vnormalize(y,h); } return FIM_ERR_NO_ERROR; } } fim_err_t FimWindow::hnormalize(fim_coo_t x, fim_coo_t w) { /* * balances the vertical divisions width * * FIXME * * +---+-------+ +-----+-----+ * | | | | | | * | | |-->| | | * |---+-------+ +-----+-----+ * | | | | | | * | | | | | | * +---+-------+ +-----+-----+ */ if(isleaf()) { corners_.setxorigin(x); corners_.setwidth(w); return FIM_ERR_NO_ERROR; } else { int fvdivs,/*svdivs,*/vdivs,upd; fvdivs=first_ ->count_vdivs(); //svdivs=second_->count_vdivs(); vdivs=count_vdivs(); upd=w/vdivs; if(vdivs>w)// no space left return FIM_ERR_GENERIC; //... corners_.setxorigin(x); corners_.setwidth(w); if(isvsplit()) { first_-> hnormalize(x,upd*fvdivs); second_->hnormalize(x+upd*fvdivs,w-upd*fvdivs); } else { first_-> hnormalize(x,w); second_->hnormalize(x,w); } return FIM_ERR_NO_ERROR; } } #endif #if !FIM_DISABLE_WINDOW_SPLITTING fim_err_t FimWindow::venlarge(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT) { #if FIM_BUGGED_ENLARGE return FIM_ERR_GENERIC; #endif /* FIM_BUGGED_ENLARGE */ /* * SEEMS BUGGY: * */ // make && src/fim media/* -c 'split;vsplit;6henlarge;wd;7henlarge;wu;4henlarge' // make && src/fim media/* -c 'split;vsplit;window "venlarge";wd; window "venlarge";' /* * +----------+ * | | | * | >| | * | F | S | * | | | * +----------+ */ if( isleaf() ) { should_redraw();// no effect return FIM_ERR_NO_ERROR; } if(isvsplit()) { /* * +-+-+ * + | + * +-+-+ * */ if(focused()==left()) focused().hrgrow(units); if(focused()==right()) focused().hlgrow(units); focused().normalize(); // i think there is a more elegant way to this but hmm.. } focused().venlarge(units); //regardless the split status if(isvsplit()) { if(focused()==left()) shadowed().hlshrink(units); if(focused()==right()) shadowed().hrshrink(units); shadowed().normalize(); } return FIM_ERR_NO_ERROR; } #endif #if !FIM_DISABLE_WINDOW_SPLITTING fim_err_t FimWindow::henlarge(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT) { /* * SEEMS BUGGY: * */ // make && src/fim media/* -c 'split;vsplit;6henlarge;wd;7henlarge;wu;4henlarge' #if FIM_BUGGED_ENLARGE return FIM_ERR_GENERIC; #endif /* FIM_BUGGED_ENLARGE */ /* * this operation doesn't change the outer bounds of the called window * * +----------+ * | S | * |__________| * | ^ | * | F | * +----------+ */ if( isleaf() ) { should_redraw();// no effect return FIM_ERR_NO_ERROR; } if(ishsplit()) { /* * +---+ * +---+ * +---+ * */ if(focused()==upper()) focused().vlgrow(units); if(focused()==lower()) focused().vugrow(units); focused().normalize(); // i think there is a more elegant way to thism but hmm.. } focused().henlarge(units); //regardless the split status if(ishsplit()) { if(focused()==upper()) shadowed().vushrink(units); if(focused()==lower()) shadowed().vlshrink(units); shadowed().normalize(); } return FIM_ERR_NO_ERROR; } fim_err_t FimWindow::enlarge(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT) { /* * FIXME : ??? */ #if FIM_BUGGED_ENLARGE return FIM_ERR_GENERIC; #endif /* FIM_BUGGED_ENLARGE */ /* * complicato ... */ // std::cout << "enlarge\n"; if(ishsplit() && can_vgrow(focused(),units)) { return henlarge(units); }else if(isvsplit() && can_hgrow(focused(),units)) { return venlarge(units); }else // isleaf(void) return FIM_ERR_NO_ERROR; } #endif #if !FIM_DISABLE_WINDOW_SPLITTING fim_err_t FimWindow::vlgrow(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT) { return corners_.vlgrow( units); } fim_err_t FimWindow::vlshrink(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT) { return corners_.vlshrink(units); } fim_err_t FimWindow::vugrow(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT) { return corners_.vugrow( units); } fim_err_t FimWindow::vushrink(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT) { return corners_.vushrink(units); } fim_err_t FimWindow::hlgrow(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT) { return corners_.hlgrow( units); } fim_err_t FimWindow::hlshrink(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT) { return corners_.hlshrink(units); } fim_err_t FimWindow::hrgrow(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT) { return corners_.hrgrow( units); } fim_err_t FimWindow::hrshrink(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT) { return corners_.hrshrink(units); } #endif /* FIM_DISABLE_WINDOW_SPLITTING */ #if 0 void FimWindow::draw(void)const { /* * * */ if(isleaf()) { // we draw int OFF=100,K=4; OFF=40; fb_clear_rect(corners_.x+OFF, corners_.x+(corners_.w-OFF)*K, (corners_.y+OFF),(corners_.y+(corners_.h-OFF))); } else { focused().draw(); shadowed().draw(); } } #endif // WARNING : SHOULD BE SURE VIEWPORT IS CORRECTLY INITIALIZED bool FimWindow::recursive_redisplay(void)const { /* * whole, deep, window redisplay * */ bool re=false;//really redisplayed ? sometimes fim guesses it is not necessary try { #if !FIM_DISABLE_WINDOW_SPLITTING if(isleaf()) #endif { if(viewport_) re=viewport_->redisplay(); } #if !FIM_DISABLE_WINDOW_SPLITTING else { re |= focused().recursive_redisplay(); re |= shadowed().recursive_redisplay(); } #endif } catch(FimException e) { if( e != FIM_E_WINDOW_ERROR) // this would be bad.. std::cerr << FIM_WINDOW_PROBLEM << std::endl; } return re; } // WARNING : SHOULD BE SURE VIEWPORT IS CORRECTLY INITIALIZED #if !FIM_DISABLE_WINDOW_SPLITTING bool FimWindow::recursive_display(void)const { /* * whole, deep, window display * */ bool re=false;//really displayed ? sometimes fim guesses it is not necessary try { if(isleaf()) { if(viewport_) re=viewport_->display(); } else { re |= focused().recursive_display(); re |= shadowed().recursive_display(); } } catch(FimException e) { if( e != FIM_E_WINDOW_ERROR) // this would be bad.. std::cerr << FIM_WINDOW_PROBLEM << std::endl; } return re; } #endif Viewport * FimWindow::current_viewportp(void)const { /* * returns a pointer to the current window's viewport_. * * +#===#+-----+ * || || | * || || | * ||FVP|| | * || || | * +#===#+-----+ */ #if !FIM_DISABLE_WINDOW_SPLITTING if(!isleaf()) return focused().current_viewportp(); #endif return viewport_; } #if !FIM_DISABLE_WINDOW_SPLITTING Viewport& FimWindow::current_viewport(void)const { /* * returns a reference to the current window's viewport_. * throws an exception if this window is a leaf. * * +#===#+-----+ * || || | * || || | * ||FVP|| | * || || | * +#===#+-----+ */ #if !FIM_DISABLE_WINDOW_SPLITTING if(!isleaf()) return focused().current_viewport(); #endif if(!viewport_)/* temporarily, for security reasons throw FIM_E_TRAGIC*/ // isleaf(void) std::cerr << FIM_WINDOW_PROBLEM << std::endl; return *viewport_; } #endif #if 0 const Image* FimWindow::getImage(void)const { if( current_viewportp() ) return current_viewportp()->getImage(); else return FIM_NULL; } #endif FimWindow::~FimWindow(void) { if(viewport_) delete viewport_; if(first_) delete first_; if(second_) delete second_; } fim_err_t FimWindow::update(const Rect& corners) { corners_=corners; should_redraw(); return FIM_ERR_NO_ERROR; } size_t FimWindow::byte_size(void)const { size_t bs = 0; bs += sizeof(*this); return bs; } #if !FIM_DISABLE_WINDOW_SPLITTING FimWindow& FimWindow ::operator= (const FimWindow& w){return *this;/* a disabled assignment */} fim_bool_t FimWindow::need_redraw(void)const { return ( viewport_ && viewport_->need_redraw() ); } #endif void FimWindow::should_redraw(enum fim_redraw_t sr) { if(viewport_) viewport_->should_redraw(sr); } /* Rect stuff */ #if !FIM_DISABLE_WINDOW_SPLITTING Rect Rect::hsplit(Splitmode s){return split(s);} Rect Rect::vsplit(Splitmode s){return split(s);} Rect Rect::split(Splitmode s) { /* * the default split halves * */ switch(s) { case Left: return Rect(x_,y_,w_/2,h_); case Right: return Rect(x_+w_/2,y_,w_-w_/2,h_); case Upper: return Rect(x_,y_,w_,h_/2); case Lower: return Rect(x_,y_+h_/2,w_,h_-h_/2); break; } return Rect(x_,y_,w_,h_); } void Rect::print() { std::cout << x_ <<" " << y_ << " "<< w_ << " " << h_ << "\n"; } #endif Rect::Rect(fim_coo_t x,fim_coo_t y,fim_coo_t w,fim_coo_t h): x_(x), y_(y), w_(w), h_(h) /* redundant, but not evil */ { } Rect::Rect(const Rect& rect): x_(rect.x_), y_(rect.y_), w_(rect.w_), h_(rect.h_){} #if !FIM_DISABLE_WINDOW_SPLITTING bool Rect::operator==(const Rect&rect)const { return x_==rect.x_ && y_==rect.y_ && w_==rect.w_ && h_==rect.h_; } #endif #if !FIM_DISABLE_WINDOW_SPLITTING fim_err_t Rect::vlgrow(fim_coo_t units) { h_+=units; return FIM_ERR_NO_ERROR; } fim_err_t Rect::vlshrink(fim_coo_t units) { h_-=units; return FIM_ERR_NO_ERROR; } fim_err_t Rect::vugrow(fim_coo_t units) { y_-=units; h_+=units ; return FIM_ERR_NO_ERROR; } fim_err_t Rect::vushrink(fim_coo_t units) { y_+=units; h_-=units ; return FIM_ERR_NO_ERROR; } fim_err_t Rect::hlgrow(fim_coo_t units) { x_-=units; w_+=units ; return FIM_ERR_NO_ERROR; } fim_err_t Rect::hrshrink(fim_coo_t units) { w_-=units; return FIM_ERR_NO_ERROR; } fim_err_t Rect::hrgrow(fim_coo_t units) { w_+=units; return FIM_ERR_NO_ERROR; } fim_err_t Rect::hlshrink(fim_coo_t units) { x_+=units; w_-=units ; return FIM_ERR_NO_ERROR; } #endif } #if 0 /* * A test main program. */ int main(void) { FimWindow w(Rect(0,0,1024,768)); w.setroot(); w.vsplit(); w.hsplit(); w.normalize(); w.print(); std::cout << "move_focus:\n"; w.move_focus(FimWindow::Down); w.move_focus(FimWindow::Right); w.move_focus(FimWindow::Left); w.move_focus(FimWindow::Down); w.print(); std::cout << "move_focus:\n"; w.move_focus(FimWindow::Up); w.print(); /* w.enlarge(); w.enlarge(); w.enlarge(); w.enlarge(); w.enlarge(); std::cout << "normalized:\n"; w.print(); std::cout << "enlarged:\n";*/ // w.hnormalize(w.corners_.xorigin(),w.corners_.width()); w.close(); w.close(); w.close(); } #endif #endif /* FIM_WINDOWS */ fim-0.6-rc2/src/readline.cpp0000644000175000017500000003345014454751116012632 00000000000000/* $LastChangedDate: 2023-07-16 13:19:42 +0200 (Sun, 16 Jul 2023) $ */ /* readline.cpp : Code dealing with the GNU readline library. (c) 2008-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "CommandConsole.h" #include #ifdef FIM_USE_READLINE #include "readline.h" #endif /* FIM_USE_READLINE */ #ifdef FIM_USE_READLINE #include "fim.h" #define min(x,y) ((x)<(y)?(x):(y)) #define max(x,y) ((x)>(y)?(x):(y)) #define FIM_COMPLETE_ONLY_IF_QUOTED 1 #define FIM_COMPLETE_INSERTING_DOUBLE_QUOTE 0 #define FIM_WANT_RL_VERBOSE 0 #define FIM_WANT_RL_KEY_DUMPOUT FIM_WANT_RL_VERBOSE #define FIM_RL_DBG_COUT(OP) cout << "RL:" << __FILE__ ":" << __LINE__ << ":" << __func__ << "()" << OP << "\n"; #define FIM_RL_KEY_DBG(C) " pressed key: '" << (fim_char_t)C << "' code: " << (int)(C) << " is esc: " << (C==FIM_SYM_ESC) #define FIM_PR(OP) if (FIM_WANT_RL_VERBOSE) FIM_RL_DBG_COUT(OP) #define FIM_DR(C) if (cc.getVariable(FIM_VID_DBG_COMMANDS).find('k') >= 0) std::cout << FIM_RL_KEY_DBG(C) << std::endl // TODO: add --verbose-keys option as _debug_commands="k" /* * This file is severely messed up :). * */ static int fim_rl_pc=FIM_SYM_CHAR_NUL; namespace fim { extern CommandConsole cc; fim_char_t * fim_readline(const fim_char_t *prompt) { fim_char_t * rc=FIM_NULL; fim_rl_pc=FIM_SYM_CHAR_NUL; FIM_PR(" prompt: " << prompt << "\n") rc=readline(prompt); FIM_PR(" rc: " << (rc==FIM_NULL?"(NULL)":(*rc?rc:"(NUL)")) << "\n") fim_rl_pc=FIM_SYM_CHAR_NUL; return rc; } } /* * in fim.cpp * */ extern fim::string g_fim_output_device; /* Generator function for command completion. STATE lets us * know whether to start from scratch; without any state * (i.e. STATE == 0), then we start at the top of the list. */ static fim_char_t * command_generator (const fim_char_t *text,int state) { // static int list_index, len; // fim_char_t *name; /* If this is a new word to complete, initialize now. This * includes saving the length of TEXT for efficiency, and * initializing the index variable to 0. */ return cc.command_generator(text,state,0); // if (!state) { list_index = 0; len = strlen (text); } /* Return the next name which partially matches from the * command list. */ // while (name = commands[list_index].name) // { list_index++; if (strncmp (name, text, len) == 0) return (dupstr(name)); } /* If no names matched, then return FIM_NULL. */ // return ((fim_char_t *)FIM_NULL); } static fim_char_t * varname_generator (const fim_char_t *text,int state) { return cc.command_generator(text,state,4); } namespace rl { #if FIM_WANT_READLINE_CLEAR_WITH_ESC static int fim_want_rl_cl_with_esc; #endif /* FIM_WANT_READLINE_CLEAR_WITH_ESC */ /* * Attempt to complete on the contents of TEXT. START and END * bound the region of rl_line_buffer that contains the word to * complete. TEXT is the word to complete. We can use the entire * contents of rl_line_buffer in case we want to do some simple * parsing. Return the array of matches, or FIM_NULL if there aren't any. */ static fim_char_t ** fim_completion (const fim_char_t *text, int start,int end) { //FIX ME fim_char_t **matches = (fim_char_t **)FIM_NULL; if(start==end && end<1) { #if 0 fim_char_t **__s,*_s; _s=dupstr(""); if(! _s)return FIM_NULL; __s=(fim_char_t**)fim_calloc(1,sizeof(fim_char_t*)); if(!__s)return FIM_NULL;__s[0]=_s; //we print all of the commands, with no completion, though. #endif cc.print_commands(); rl_attempted_completion_over = 1; /* this could be set only here :) */ return FIM_NULL; } /* If this word is at the start of the line, then it is a command * to complete. Otherwise it is the name of a file in the current * directory. */ if (start == 0) { //std::cout << "completion for word " << start << "\n"; matches = rl_completion_matches (text, command_generator); } else { if(start>0 && !fim_isquote(rl_line_buffer[start-1]) ) { #if FIM_COMPLETE_INSERTING_DOUBLE_QUOTE // FIXME: this is NEW if(start==end && fim_isspace(rl_line_buffer[start-1])) { fim_char_t**sp=(fim_char_t**)malloc(2*sizeof(fim_char_t*)); sp[0]=dupstr("\""); sp[1]=FIM_NULL; rl_completion_append_character = '\0'; fim::cout << "you can type double quoted string (e.g.: \"" FIM_CNS_EXAMPLE_FILENAME "\"), or a variable name (e.g.:" FIM_VID_FILELISTLEN "). some variables need a prefix (one of " FIM_SYM_NAMESPACE_PREFIXES ")\n" ; return sp; } #endif /* FIM_COMPLETE_INSERTING_DOUBLE_QUOTE */ if(start1) fim::cout << "possible completions for \""<0;++i) { #if FIM_SHOULD_SUGGEST_POSSIBLE_COMPLETIONS fim::cout << matches[i] << "\n"; #endif /* FIM_SHOULD_SUGGEST_POSSIBLE_COMPLETIONS */ w=min(strlen(matches[i])+1,(size_t)f); if(f>0){ strncpy(buffer+l,matches[i],w); w=strlen(buffer+l);l+=w;f-=w;} if(f>0){strcpy(buffer+l," ");--f;++l;} buffer[l]='\0'; // strcpy(buffer+strlen(buffer),matches[i]); // strcpy(buffer+strlen(buffer)," "); } // std::cout << buffer << "\n" ; // status((fim_byte_t*)"here shall be autocompletions", FIM_NULL); } /* static void redisplay_no_fb(void) { printf("%s",rl_line_buffer); } */ static void redisplay(void) { cc.set_status_bar(( fim_char_t*)rl_line_buffer,FIM_NULL); } /* * ?! * */ /* static int redisplay_hook_no_fb(void) { redisplay_no_fb(); return 0; }*/ static int fim_post_rl_getc(int c) { FIM_PR(FIM_RL_KEY_DBG(c)) FIM_DR(c); #if FIM_WANT_READLINE_CLEAR_WITH_ESC if(c==FIM_SYM_ESC && fim_want_rl_cl_with_esc) { FIM_PR("esc -> enter\n") if(rl_line_buffer) { rl_point=0, rl_line_buffer[0]=FIM_SYM_PROMPT_NUL; FIM_PR("left readline mode\n") } c=FIM_SYM_ENTER; #if FIM_WANT_DOUBLE_ESC_TO_ENTER if(fim_want_rl_cl_with_esc==-1) fim_want_rl_cl_with_esc=0; #endif /* FIM_WANT_DOUBLE_ESC_TO_ENTER */ } #endif /* FIM_WANT_READLINE_CLEAR_WITH_ESC */ FIM_PR(FIM_RL_KEY_DBG(c)) return c; } #if defined(FIM_WITH_LIBSDL) || defined(FIM_WITH_AALIB) || defined(FIM_WITH_LIBCACA) || defined(FIM_WITH_LIBIMLIB2) static int fim_rl_sdl_aa_getc_hook(void) { //unsigned int c; fim_key_t c; c=0; FIM_PR(" fim_rl_pc=" << fim_rl_pc) if(cc.get_displaydevice_input(&c,true)==1) { c=fim_post_rl_getc(c); if(c&(1<<31)) { FIM_PR(FIM_RL_KEY_DBG(c)) rl_set_keymap(rl_get_keymap_by_name("emacs-meta")); /* FIXME : this is a dirty trick : */ //c&=!(1<<31); /* FIXME : a dirty trick */ c&=0xFFFFFF^(1<<31); /* FIXME : a dirty trick */ //std::cout << "alt! : "<< (fim_byte_t)c <<" !\n"; //rl_stuff_char(c); /* warning : this may fail */ rl_stuff_char(c); /* warning : this may fail */ } else { FIM_PR(FIM_RL_KEY_DBG(c)) rl_set_keymap(rl_get_keymap_by_name("emacs")); /* FIXME : this is a dirty trick : */ //std::cout << "char in : "<< (fim_byte_t)c <<" !\n"; rl_stuff_char(c); /* warning : this may fail */ } return 1; } return 0; } //void fim_rl_prep_dummy(int meta_flag){} //void fim_rl_deprep_dummy(void){} int fim_rl_sdl_aa_getc(FILE * fd) { FIM_PR("") return 0;/* yes, a dummy function instead of getc() */ } #endif /* defined(FIM_WITH_LIBSDL) || defined(FIM_WITH_AALIB) || defined(FIM_WITH_LIBCACA) || defined(FIM_WITH_LIBIMLIB2) */ int fim_rl_getc(FILE * fd) { int c=FIM_SYM_CHAR_NUL; #if 1 c=rl_getc(fd); FIM_PR(FIM_RL_KEY_DBG(c)) #if FIM_WANT_DOUBLE_ESC_TO_ENTER if(c==FIM_SYM_ESC) { if(fim_rl_pc==c) fim_want_rl_cl_with_esc=-1, fim_rl_pc=c; else fim_rl_pc=c; //c=FIM_SYM_CHAR_NUL; } else #endif /* FIM_WANT_DOUBLE_ESC_TO_ENTER */ fim_rl_pc=c; #else /* the following code is not complete yet. it needs interpretation of the input sequence */ int cc=rl_getc(fd); if(cc==FIM_SYM_ESC) { int tries=0; fim_char_t cb[4]; cb[0]=cb[1]=cb[2]=cb[3]=FIM_SYM_CHAR_NUL; c|=cc; cb[0]=cc; if(FIM_WANT_RL_KEY_DUMPOUT)cout<<"adding: "<<((int)cc)<<"\n"; for(tries=1;tries<3;++tries) if((cc=rl_getc(fd))==FIM_SYM_ESC) { ungetc(cc,fd); for(--tries;tries>1;--tries) ungetc(cb[tries],fd); c=cb[0]; goto read_ok; } else { if(cc==FIM_SYM_CHAR_NUL) { for(--tries;tries>1;--tries) ungetc(cb[tries],fd); c=cb[0]; goto read_ok; } if(FIM_WANT_RL_KEY_DUMPOUT)cout<<"adding: "<<((int)cc)<<"\n"; c*=256; c|=cc; cb[tries]=cc; c=*(int*)cb; } } else c=cc; read_ok: #endif c=fim_post_rl_getc(c); return c; } int fim_search_rl_startup_hook(void) { const fim_char_t * hs=cc.browser_.last_regexp_.c_str(); if(hs) { FIM_PR(hs) rl_replace_line(hs,0); rl_point=strlen(hs); } return 0; } static int fim_pre_input_hook(void) { fim_key_t c; if ( cc.pop_key_press(&c) ) { FIM_DR(c); rl_stuff_char(c); return 1; } return 0; } /* static int redisplay_hook(void) { redisplay(); return 0; } */ /* * ?! * */ /*static int fim_rl_end(int a,int b) { rl_point=rl_end; return 0; }*/ /* * ?! * */ /*static int fim_set_command_line_text(const fim_char_t*s) { rl_replace_line(s,0); return 0; }*/ /* * initial setup to set the readline library working */ void initialize_readline (fim_bool_t with_no_display_device, fim_bool_t wcs) { //FIX ME /* Allow conditional parsing of the ~/.inputrc file. */ rl_readline_name = "fim"; //?? /* Tell the completer that we want a crack first. */ rl_attempted_completion_function = fim_completion; rl_completion_display_matches_hook=completion_display_matches_hook; rl_erase_empty_line=1; // NEW: 20110630 in sdl mode with no echo disabling, prints newlines, if unset rl_set_keyboard_input_timeout(1000); // rl_read_key will wait 1000us (1ms) before rl_event_hook #if FIM_WANT_READLINE_CLEAR_WITH_ESC fim_want_rl_cl_with_esc=1; #endif /* FIM_WANT_READLINE_CLEAR_WITH_ESC */ #define FIM_WANT_COOKIE_STREAM 1 /* FIXME: for now, this is just a dirty hack for the no-stdin case; in the future this shall be completed and replace the rl_stuff_char trick. */ #if FIM_WANT_COOKIE_STREAM if(wcs) { int isp[2]; pipe(isp); rl_instream = fdopen(isp[0],"r"); rl_outstream = fopen("/dev/null","w"); /* FIXME: seems like rl_erase_empty_line is not always working :-( */ } #endif /* FIM_WANT_COOKIE_STREAM */ rl_pre_input_hook=fim_pre_input_hook; if(with_no_display_device==0) { rl_catch_signals=0; rl_catch_sigwinch=0; rl_redisplay_function=redisplay; rl_event_hook=fim_pre_input_hook; } #if defined(FIM_WITH_LIBSDL) || defined(FIM_WITH_AALIB) || defined(FIM_WITH_LIBCACA) || defined(FIM_WITH_LIBIMLIB2) if( false || g_fim_output_device.find(FIM_DDN_INN_SDL)==0 /* uncommenting the following may give problems; but commenting it will break X11-backed aalib input .. */ || g_fim_output_device.find(FIM_DDN_INN_AA)==0 || g_fim_output_device.find(FIM_DDN_INN_CACA)==0 || g_fim_output_device.find(FIM_DDN_INN_IL2)==0 ) { rl_getc_function=fim_rl_sdl_aa_getc; rl_event_hook =fim_rl_sdl_aa_getc_hook; // rl_prep_term_function=fim_rl_prep_dummy; // rl_deprep_term_function=fim_rl_deprep_dummy; /* * FIXME : The following hack uses SDLK_UP, SDLK_DOWN, SDLK_LEFT, SDLK_RIGHT, all -0x100 .. * (/usr/include/SDL/SDL_keysym.h) * * Regard this as a problem. */ rl_bind_keyseq("\x11", rl_get_previous_history); // up rl_bind_keyseq("\x12", rl_get_next_history); // down rl_bind_keyseq("\x13", rl_forward_char); // right rl_bind_keyseq("\x14", rl_backward_char); // left } #endif #if FIM_WANT_READLINE_CLEAR_WITH_ESC if( false || g_fim_output_device.find(FIM_DDN_INN_AA)==0 || g_fim_output_device.find(FIM_DDN_INN_FB)==0 || g_fim_output_device.find(FIM_DDN_INN_CACA)==0 ) { fim_want_rl_cl_with_esc=0; rl_getc_function=fim_rl_getc; } #endif /* FIM_WANT_READLINE_CLEAR_WITH_ESC */ //rl_completion_entry_function=FIM_NULL; /* * to do: * see rl_filename_quoting_function .. * */ //rl_inhibit_completion=1; //if set, TABs are read as normal characters rl_filename_quoting_desired=1; rl_filename_quote_characters="\""; //rl_reset_terminal("linux"); //rl_reset_terminal("vt100"); //rl_bind_key(0x09,fim_rl_end); //rl_bind_key(0x7F,fim_rl_end); //rl_bind_key(-1,fim_rl_end); //rl_bind_key('~',fim_rl_end); // .. //rl_bind_key('\t',rl_insert); //rl_bind_keyseq("g",fim_rl_end); //rl_set_prompt("$"); /* rl_voidfunc_t *rl_redisplay_function=redisplay; rl_hook_func_t *rl_event_hook=redisplay_hook; rl_hook_func_t *rl_pre_input_hook=redisplay_hook;*/ //std::cout << "readline initialized\n"; } } #endif /* FIM_USE_READLINE */ fim-0.6-rc2/src/FbiStuffMagick.cpp0000644000175000017500000001205014454347340013664 00000000000000/* $LastChangedDate: 2022-11-22 13:08:47 +0100 (Tue, 22 Nov 2022) $ */ /* FbiStuffMagick.cpp : fim functions for decoding image files using libGraphicsMagick (c) 2011-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* FIXME: This code is very inefficient, so please regard it as temporary */ /* FIXME: Error handling is incomplete */ /* TODO: CatchException fprintf's stuff: it is not adequate error reporting; we would prefer an error string instead */ /* Tested with MagickLibVersion defined as 0x090600 */ #include #include #include #include #include "../config.h" #include "fim_types.h" #include "fim_wrappers.h" #include "FbiStuffList.h" #include "FbiStuffLoader.h" #ifdef HAVE_LIBGRAPHICSMAGICK #include /* versions as far as e.g. 1.13.12 have this bug, in coders/txt.c:328, due to a FIM_NULL p returning in case of empty text file */ #ifdef MagickLibVersion #define HAVE_LIBGRAPHICSMAGICK_TXT_FILEXTENSION_BUG (MagickLibVersion<=0x151200) /* 0x090600 was previously supposed to fix the problem but it did not, seemingly (as of 1.3.20) ... still: fim: magick/semaphore.c:531: LockSemaphoreInfo: Assertion `semaphore_info != (SemaphoreInfo *) ((void *)0)' failed. Aborted */ #else /* MagickLibVersion */ #define HAVE_LIBGRAPHICSMAGICK_TXT_FILEXTENSION_BUG 1 #endif /* MagickLibVersion */ struct magick_state_t { ImagePtr image; /* Warning: this is NOT to be confused with fim's Image class */ ImagePtr cimage; /* Warning: this is NOT to be confused with fim's Image class */ ImageInfo* image_info; MagickPassFail mpf; ExceptionInfo exception; struct fim::ida_image_info *i; }; static struct magick_state_t ms; // TODO: get rid of this namespace fim { static void magick_cleanup() { if(ms.image)DestroyImageList(ms.image); if(ms.i->npages>1) if(ms.cimage)DestroyImageList(ms.cimage); if(ms.image_info)DestroyImageInfo(ms.image_info); //DestroyExceptionInfo(ms.exception); DestroyMagick(); } static void* magick_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { fim_bzero(&ms,sizeof(ms)); ms.mpf=MagickFail; ms.i = i; if(!fp && !filename) goto nocleanuperr; if(!filename) goto nocleanuperr; if(!fp) goto nocleanuperr; #if HAVE_LIBGRAPHICSMAGICK_TXT_FILEXTENSION_BUG if(filename) { fim_size_t fnl=strlen(filename); if(fnl>=3 && 0==strcasecmp(filename+fnl-3,"txt")) goto nocleanuperr; if(fnl>=4 && 0==strcasecmp(filename+fnl-4,"text")) goto nocleanuperr; } #endif /* HAVE_LIBGRAPHICSMAGICK_TXT_FILEXTENSION_BUG */ InitializeMagick(filename); GetExceptionInfo(&ms.exception); if (ms.exception.severity != UndefinedException) { //CatchException(&ms.exception); goto err; } ms.image_info=CloneImageInfo((ImageInfo *) FIM_NULL); if(ms.image_info==FIM_NULL) goto err; /* FIXME need correctness check on dimensions values ! */ if(strlen(filename)>MaxTextExtent-1) goto err; (void) strncpy(ms.image_info->filename,filename,MaxTextExtent-1); ms.image_info->filename[MaxTextExtent-1]='\0'; ms.image=ReadImage(ms.image_info,&ms.exception); if (ms.exception.severity != UndefinedException) { //CatchException(&ms.exception); goto err; } if(!ms.image) goto err; i->npages = GetImageListLength(ms.image); /* ! */ i->width = (ms.image)->columns; i->height = (ms.image)->rows; if(page>=i->npages || page<0)goto err; if(i->width<1 || i->height<1 || i->npages<1) goto err; ms.cimage=GetImageFromList(ms.image,page); if (ms.exception.severity != UndefinedException) { //CatchException(&ms.exception); } if(!ms.cimage) { goto err; } return &ms; err: magick_cleanup(); nocleanuperr: return FIM_NULL; } static void magick_read(fim_byte_t *dst, unsigned int line, void *data) { /* note: inefficient */ for(unsigned int c=0;c<(ms.cimage)->columns;++c) { PixelPacket pp=AcquireOnePixel( ms.cimage, c, line, &ms.exception ); dst[c*3+0]=pp.red; dst[c*3+1]=pp.green; dst[c*3+2]=pp.blue; } } static void magick_done(void *data) { magick_cleanup(); } /* not a filetype-specific decoder */ struct ida_loader magick_loader = { /*magic:*/ "", /*moff:*/ 0, /*mlen:*/ 0, /*name:*/ "libGraphicsMagick", /*init:*/ magick_init, /*read:*/ magick_read, /*done:*/ magick_done, }; static void fim__init init_rd(void) { fim_load_register(&magick_loader); } } #endif /* HAVE_LIBGRAPHICSMAGICK */ fim-0.6-rc2/src/lex.lex0000644000175000017500000001230214454347340011636 00000000000000/* $Id: lex.lex 1761 2022-10-31 16:12:40Z dezperado $ */ /* lex.lex : Lexer source file template (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ %option noyywrap %{ #include #include #include #include /* 20110709 now calling flex --nounistd; this way we have to include it by ourselves; this is good because we overcome the C++ isatty redeclaration from within lex.yy.cc, which often does not match that of unistd.h regarding the thrown exceptions */ #include "lex.h" #include "yacc.tab.hpp" #include "common.h" #include "fim.h" /* fim_calloc, ... */ void yyerror(const fim_char_t *); #if 0 /* we use %option noyywrap now ! */ #ifdef YY_PROTO //this branch is taken by flex 2.5.4 //int yywrap YY_PROTO((void)){return 1;} #else //this branch is taken by flex 2.5.33 int yywrap (){return 1;} #endif #endif int fim_pipedesc[2]; /*#define YY_INPUT(buf,result,max_size) \ { \ int r=read(fim_pipedesc[0],buf,1); \ printf("letti in input : %d\n",r); \ result = (buf[0]==EOF||r<1)?YY_NULL:1; \ return; \ }*/ #define YY_INPUT(buf,result,max_size) \ { \ int r=read(fim_pipedesc[0],buf,1); \ result = (buf[0]==EOF||r<1)?EOB_ACT_END_OF_FILE:EOB_ACT_CONTINUE_SCAN; \ result = (buf[0]==EOF||r<1)?0:1; \ if(result<=0) {close(fim_pipedesc[0]);close(fim_pipedesc[1]);} \ } //allocate and strcpy #define astrcpy(dst,src) \ { \ if((src)==NULL)yyerror("null pointer given!\n"); \ if(((dst)=(fim_char_t*)fim_calloc(1+strlen(src),1))==NULL) \ yyerror("out of memory\n"); \ strcpy((dst),(src)); \ } //quoted allocate and strcpy #define qastrcpy(dst,src) \ { \ if((src)==NULL)yyerror("null pointer given!\n"); \ (src+1)[strlen(src+1)-1]='\0'; \ astrcpy(dst,src+1) \ } //to lower #define tl(src) \ { \ if((src)==NULL)yyerror("null pointer given!\n"); \ {fim_char_t*s=src;while(*s){*s=tolower(*s);++s;}} \ } %} DIGIT [0-9] NUMBER [0-9]+ _ID [a-z][a-z0-9]* UC [A-Z] LC [a-z] Q \' DQ \" C UC|LC CD C|DIGIT __ID [a-zA-Z]CD* ID [a-z_A-Z][a-z_A-Z0-9]* ARG [a-z_A-Z0-9]+ HH [a-f]|[A-F]|[0-9] __SYMBOL [%:;,.\-\\$|!/(){}_] SYMBOL [-()<>=+*\/;{}.,`:$\\^%#] EXCLMARK ! STRINGC {SYMBOL}|{DIGIT}|{UC}|{LC}|[ _] STRINGC_Q {STRINGC}|\" STRINGC_DQ {STRINGC}|\' %% ^"|" return SYSTEM; "!" return NOT; ">=" return GE; "<=" return LE; "==" return EQ; "=~" return REGEXP_MATCH; "!=" return NE; "&&" return AND; "&" return BAND; "||" return OR; "|" return BOR; "while" return WHILE; "if" return IF; "else" return ELSE; "do" return DO; "i:*" { astrcpy(yylval.sValue,yytext); return IDENTIFIER; } ([gi]:)?{ID} { /*was: ([gwibv]:)?{ID} */ astrcpy(yylval.sValue,yytext); //tl(yylval.sValue); // tolower breaks aliases, but it would be useful on keywords, above.. return IDENTIFIER; } "0"[0-9]+ { yylval.iValue = strtol(yytext,NULL,8); return INTEGER; } "0x"[0-9]+ { yylval.iValue = strtol(yytext,NULL,16); return INTEGER; } [0-9]+ { yylval.iValue = fim_atoi(yytext); return INTEGER; } "$" { yylval.iValue = FIM_CNS_LAST; return INTEGER; } "^" { yylval.iValue = FIM_CNS_FIRST; return INTEGER; } "'"{DIGIT}+"."{DIGIT}*"'" { yylval.fValue = fim_atof(yytext+1); return QUOTED_FLOAT; } "\""{DIGIT}+"."{DIGIT}*"\"" { yylval.fValue = fim_atof(yytext+1); return QUOTED_FLOAT; } \'((\\\')|[^\'])*\' { /* single quoted strings escaping */ trec(yytext+1,"n\\\'","\n\\\'"); qastrcpy(yylval.sValue,yytext);; return STRING; } \"((\\\")|[^\"])*\" { /* double quoted strings unescaping */ trec(yytext+1,"n\\\"","\n\\\""); //trhex(yytext+1); // hex escaping already perfomed in trec. qastrcpy(yylval.sValue,yytext);; return STRING; } "./"{STRINGC}* {/* FIXME : "/"{STRINGC} - like tokens clashed with lone / operator */ /* FIM_SMART_COMPLETION patch */ /* a path */ astrcpy(yylval.sValue,yytext);; return FILE_PATH; } "../"{STRINGC}* { /* FIM_SMART_COMPLETION patch */ /* a path */ astrcpy(yylval.sValue,yytext);; return FILE_PATH; } {ID}([.]{ID})+ { /* FIM_SMART_COMPLETION patch */ /* a path */ astrcpy(yylval.sValue,yytext);; return FILE_PATH; } {SYMBOL} { return *yytext; } ^"/"([^;])+ { astrcpy(yylval.sValue,yytext+1);; return SLASH_AND_REGEXP; } {DIGIT}+"."{DIGIT}* { yylval.fValue = fim_atof(yytext+0); return UNQUOTED_FLOAT; } [ \t]+ { /* we ignore whitespace */ ; } \n { /* return NEWLINE; */ /* this works ! in this case, it means that we ignore \n */ } . printf("Unknown character :'%s'\n",yytext);yyerror("Unknown character"); /*THERE SHOULD GO LEX ERRORS..*/ \#.*$ { /* ... a comment encountered... */ ; } %% fim-0.6-rc2/src/CommandConsole.h0000644000175000017500000003652514455057600013421 00000000000000/* $LastChangedDate: 2023-07-16 23:22:08 +0200 (Sun, 16 Jul 2023) $ */ /* CommandConsole.h : Fim console dispatcher header file (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_COMMANDCONSOLE_H #define FIM_COMMANDCONSOLE_H #include "fim.h" #include "DummyDisplayDevice.h" #define FIM_WANT_RAW_KEYS_BINDING 1 #define FIM_INVALID_IDX -1 namespace fim { class CommandConsole FIM_FINAL : #if FIM_WANT_BENCHMARKS public Benchmarkable, #endif /* FIM_WANT_BENCHMARKS */ public Namespace { #ifndef FIM_WANT_NO_OUTPUT_CONSOLE #ifndef FIM_KEEP_BROKEN_CONSOLE public: MiniConsole mc_; #endif /* FIM_KEEP_BROKEN_CONSOLE */ #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ private: FontServer fontserver_; fim_cls postInitCommand_; // Executed after preConfigCommand_. fim_cls preConfigCommand_; // Executed before postInitCommand_. fim_cls postExecutionCommand_; // Executed right before a normal termination of Fim. fim_int show_must_go_on_; fim_int return_code_; /* new, to support the 'return' command */ bool mangle_tcattr_; #if HAVE_TERMIOS_H struct termios saved_attributes_; #endif /* HAVE_TERMIOS_H */ fim_sys_int saved_fl_; /* file status flags for stdin */ public: Browser browser_; /* the image browser_ logic */ private: #ifdef FIM_WINDOWS fim::FimWindow * window_; #endif /* FIM_WINDOWS */ /* * the registered command member functions and objects */ std::vector commands_; //command->member function /* * the aliases to actions (compounds of commands) */ typedef std::map > aliases_t; //alias->[commands,description] //typedef std::map aliases_t; //alias->commands aliases_t aliases_; //alias->commands /* * bindings of key codes to actions (compounds of commands) */ typedef std::map bindings_t; //code->commands bindings_t bindings_; //code->commands typedef std::map bindings_help_t; // code->help bindings_help_t bindings_help_; //code->commands /* * mapping of key name to key code */ sym_keys_t sym_keys_; //symbol->code typedef std::map key_syms_t;//code->symbol key_syms_t key_syms_;//code->symbol private: fim_err_t load_or_save_history(bool load_or_save); #if FIM_WANT_FILENAME_MARK_AND_DUMP typedef std::set marked_files_t; marked_files_t marked_files_; //filenames public: bool isMarkedFile(fim_fn_t fname)const; fim::string marked_files_list(void)const; fim::string marked_files_clear(void); private: #endif /* FIM_WANT_FILENAME_MARK_AND_DUMP */ /* * flags */ #ifdef FIM_USE_READLINE /* no readline ? no console ! */ fim_status_t ic_; //in console if 1. not if 0. willing to exit from console mode if -1 #endif /* FIM_USE_READLINE */ fim_cycles_t cycles_; //fim execution cycles_ counter (quite useless) fim_key_t exitBinding_; //The key bound to exit. If 0, the special "Any" key. #ifdef FIM_AUTOCMDS /* * the mapping structure for autocommands () */ typedef std::map autocmds_p_t; //pattern - commands typedef std::map autocmds_t; //autocommand - pattern - commands autocmds_t autocmds_; #endif /* FIM_AUTOCMDS */ /* * the last executed action (being a command line or key bounded command issued) */ fim_cls last_action_; #ifdef FIM_RECORDING enum RecordMode { Recording, Playing, Normal }; RecordMode recordMode_; typedef std::pair recorded_action_t; typedef std::vector recorded_actions_t; recorded_actions_t recorded_actions_; bool dont_record_last_action_; fim::string memorize_last(const fim_cmd_id& cmd); fim::string repeat_last(const args_t& args); fim::string dump_record_buffer(const args_t& args); fim::string do_dump_record_buffer(const args_t& args, bool headeronly=false)const; fim::string execute_record_buffer(const args_t& args); fim::string start_recording(void); fim_cxr fcmd_recording(const args_t& args); #if FIM_EXPERIMENTAL_FONT_CMD fim_cxr fcmd_font(const args_t& args); #endif /* FIM_EXPERIMENTAL_FONT_CMD */ fim::string stop_recording(void); fim::string sanitize_action(const fim_cmd_id& cmd)const; void record_action(const fim_cmd_id& cmd); #endif /* FIM_RECORDING */ public: fim_str_t fim_stdin_; // the standard input file descriptor private: fim_char_t prompt_[2]; #ifndef FIM_WANT_NOSCRIPTING args_t scripts_; //scripts to execute : FIX ME PRIVATE #endif /* FIM_WANT_NOSCRIPTING */ #if FIM_WANT_FILENAME_MARK_AND_DUMP public: void markCurrentFile(bool mark = true); fim_int markFile(const fim_fn_t& file, bool mark = true, bool aloud = true); private: #endif /* FIM_WANT_FILENAME_MARK_AND_DUMP */ #ifdef FIM_WITH_AALIB AADevice * aad_; #endif /* FIM_WITH_AALIB */ DummyDisplayDevice dummydisplaydevice_; DisplayDevice *displaydevice_; fim::string oldcwd_; public: fim_sys_int get_displaydevice_input(fim_key_t * c, bool want_poll=false); fim::string execute(fim_cmd_id cmd, args_t args); //const fim_char_t*get_prompt(void)const{return prompt_;} CommandConsole(void); #if FIM_USE_CXX11 public: /* a deleted copy constructor (e.g. not even a be'friend'ed class can call it) */ CommandConsole& operator= (const CommandConsole&cc) = delete; #else /* FIM_USE_CXX11 */ private: /* a disabled copy constructor (because private:) */ CommandConsole& operator= (const CommandConsole&cc) { return *this; } #endif /* FIM_USE_CXX11 */ public: bool redisplay(void); fim_char_t * command_generator (const fim_char_t *text,int state,int mask)const; fim_perr_t executionCycle(void); fim_err_t init(fim::string device); fim_bool_t inConsole(void)const; ~CommandConsole(void); /* the following group is defined in Namespace.cpp */ fim_float_t getFloatVariable(const fim_var_id& varname)const; fim::string getStringVariable(const fim_var_id& varname)const; fim_int getIntVariable(const fim_var_id& varname)const; const Var getVariable(const fim_var_id& varname)const; fim_int setVariable(const fim_var_id& varname,fim_int value); #if FIM_WANT_LONG_INT int setVariable(const fim_var_id& varname, int value); unsigned int setVariable(const fim_var_id& varname, unsigned int value); #endif /* FIM_WANT_LONG_INT */ fim_float_t setVariable(const fim_var_id& varname, fim_float_t value); const fim_char_t* setVariable(const fim_var_id& varname,const fim_char_t*value); const Var& setVariable(const fim_var_id varname,const Var&value); const fim::string& setVariable(const fim_var_id varname,const fim::string&value); Namespace * rns(const fim_var_id varname); const Namespace * c_rns(const fim_var_id varname)const; fim_var_id rnid(const fim_var_id& varname)const; fim_var_t getVariableType(const fim_var_id& varname)const; bool push(const char * nf, fim_flags_t pf=FIM_FLAG_DEFAULT); #if FIM_WANT_BACKGROUND_LOAD bool background_push(void); #endif /* FIM_WANT_BACKGROUND_LOAD */ fim_err_t executeStdFileDescriptor(FILE *fd); fim::string readStdFileDescriptor(FILE* fd, int*rp=FIM_NULL); #ifndef FIM_WANT_NOSCRIPTING bool push_scriptfile(const fim_fn_t ns); bool with_scriptfile(void)const; fim_cxr fcmd_executeFile(const args_t& args); #endif /* FIM_WANT_NOSCRIPTING */ fim_cxr get_help(const fim_cmd_id& item, const char dl)const; private: bool push(const fim_fn_t nf, fim_flags_t pf=FIM_FLAG_DEFAULT); fim_cxr fcmd_echo(const args_t& args); fim::string do_echo(const args_t& args)const; fim_cxr fcmd_help(const args_t& args); fim_cxr fcmd_quit(const args_t& args); fim_cxr fcmd__stderr(const args_t& args); fim_cxr fcmd__stdout(const args_t& args); fim_cxr fcmd_foo (const args_t& args); fim_cxr fcmd_status(const args_t& args); fim_err_t executeFile(const fim_char_t *s); fim_err_t execute_internal(const fim_char_t *ss, fim_xflags_t xflags); fim_err_t addCommand(Command c); //Command &findCommand(fim_cmd_id cmd)const; int findCommandIdx(fim_cmd_id cmd)const; fim_cxr fcmd_alias(const args_t& args); fim::string alias(const fim_cmd_id& a, const fim_cmd_id& c, const fim_cmd_id& d=""); fim::string aliasRecall(fim_cmd_id cmd)const; fim_cxr fcmd_system(const args_t& args); fim_cxr fcmd_cd(const args_t& args); fim_cxr fcmd_pwd(const args_t& args); fim_cxr fcmd_sys_popen(const args_t& args); #ifdef FIM_PIPE_IMAGE_READ fim_cxr fcmd_pread(const args_t& args); #endif /* FIM_PIPE_IMAGE_READ */ public:// 20110601 fim_err_t fpush(FILE *tfd); private: fim_cxr fcmd_set_interactive_mode(const args_t& args); fim_cxr fcmd_set_in_console(const args_t& args); #ifdef FIM_AUTOCMDS fim_cxr fcmd_autocmd(const args_t& args); fim::string autocmd_del(const fim::string event, const fim::string pattern, const fim::string action); fim_cxr fcmd_autocmd_del(const args_t& args); public:// 20110601 fim::string autocmd_add(const fim::string& event,const fim::string& pat,const fim_cmd_id& cmd); private: fim::string autocmds_list(const fim::string event, const fim::string pattern)const; #endif /* FIM_AUTOCMDS */ typedef std::pair autocmds_loop_frame_t; typedef std::pair autocmds_frame_t; typedef std::vector autocmds_stack__t; typedef std::vector autocmds_stack_t; //typedef std::set autocmds_stack_t; autocmds_stack__t autocmds_loop_stack; autocmds_stack_t autocmds_stack; fim_cxr fcmd_bind(const args_t& args); fim_key_t kstr_to_key(const fim_char_t * kstr)const; public: int pop_key_press(fim_key_t *cp); #if FIM_WANT_CMDLINE_KEYPRESS std::vector clkcv_; /* command line key-bound commands vector*/ void push_key_press(const char *cp); private: std::queue > clkpv_; /* command line key presses vector*/ #endif /* FIM_WANT_CMDLINE_KEYPRESS */ fim::string getAliasesList(FimDocRefMode refmode=DefRefMode)const; fim::string dummy(const args_t& args); fim_cxr fcmd_variables_list(const args_t& args); fim_cxr fcmd_commands_list(const args_t& args); fim_cxr fcmd_set(const args_t& args); fim_cxr fcmd_unalias(const args_t& args); //fim_char_t ** tokenize_(const fim_char_t *s); bool executeBinding(const fim_key_t c); fim::string getBoundAction(const fim_key_t c)const; // void execute(fim_cmd_id cmd); fim_cxr fcmd_eval(const args_t& args); FIM_NORETURN void exit(fim_perr_t i)const;// FIXME: exit vs quit fim::string unbind(fim_key_t c); fim::string bind(const fim_key_t c, const fim_cls binding, const fim::string hstr=""); public: fim::string find_key_for_bound_cmd(fim_cls cmd)const; fim_err_t execDefaultConfiguration(void); private: fim::string unbind(const fim::string& key); fim_cxr fcmd_unbind(const args_t& args); fim::string getBindingsList(void)const; fim_cxr fcmd_dump_key_codes(const args_t& args); fim::string do_dump_key_codes(FimDocRefMode refmode=DefRefMode)const; #ifndef FIM_WANT_NO_OUTPUT_CONSOLE fim_cxr fcmd_clear(const args_t& args); fim::string scroll_up(const args_t& args); fim::string scroll_down(const args_t& args); #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ fim_perr_t quit(fim_perr_t i=FIM_CNS_ERR_QUIT); public: fim_key_t find_keycode_for_bound_cmd(fim_cls binding)const; fim_bool_t drawOutput(const fim_char_t*s=FIM_NULL)const; bool regexp_match(const fim_char_t*s, const fim_char_t*r, int rsic)const; #ifdef FIM_AUTOCMDS fim::string autocmd_exec(const fim::string& event,const fim_fn_t& fname); fim::string pre_autocmd_add(const fim_cmd_id& cmd); fim::string pre_autocmd_exec(void); #endif /* FIM_AUTOCMDS */ fim_int catchLoopBreakingCommand(fim_ts_t seconds=0); private: /* fim_key_t catchInteractiveCommand(fim_ts_t seconds=0)const; */ #ifdef FIM_AUTOCMDS fim::string autocmd_exec(const fim::string& event,const fim::string& pat,const fim_fn_t& fname); void autocmd_push_stack(const autocmds_loop_frame_t& frame); void autocmd_pop_stack(const autocmds_loop_frame_t& frame); public: void autocmd_trace_stack(void); private: fim_bool_t autocmd_in_stack(const autocmds_loop_frame_t& frame)const; #endif /* FIM_AUTOCMDS */ fim::string current(void)const; fim::string get_alias_info(const fim::string aname, FimDocRefMode refmode=DefRefMode)const; #ifdef FIM_WINDOWS const FimWindow& current_window(void)const; #endif /* FIM_WINDOWS */ fim::string get_variables_list(void)const; fim::string get_aliases_list(void)const; fim::string get_commands_list(void)const; public: void printHelpMessage(const fim_char_t *pn="fim")const; void appendPostInitCommand(const fim::string& c); void appendPreConfigCommand(const fim::string& c); void appendPostExecutionCommand(const fim::string& c); bool appendedPostInitCommand(void)const; bool appendedPreConfigCommand(void)const; Viewport* current_viewport(void)const; #ifdef FIM_WINDOWS /* Viewport is managed by FimWindow */ #else /* FIM_WINDOWS */ Viewport* viewport_; #endif /* FIM_WINDOWS */ void dumpDefaultFimrc(void)const; void tty_raw(void); void tty_restore(void); void cleanup(void); fim::string print_commands(void)const; void status_screen(const fim_char_t *desc); void set_status_bar(fim::string desc, const fim_char_t *info); void set_status_bar(const fim_char_t *desc, const fim_char_t *info); bool is_file(fim::string nf)const; fim_cxr fcmd_do_getenv(const args_t& args); bool isVariable(const fim_var_id& varname)const; fim::string dump_reference_manual(const args_t& args); fim::string get_reference_manual(const args_t& args); private: fim::string get_commands_reference(FimDocRefMode refmode=DefRefMode)const; fim::string get_variables_reference(FimDocRefMode refmode=DefRefMode)const; public: bool set_wm_caption(const fim_char_t *str); fim_err_t display_resize(fim_coo_t w, fim_coo_t h, fim_bool_t wsl = false); fim_err_t display_reinit(const fim_char_t *rs); fim_cxr fcmd_basename(const args_t& args); fim_cxr fcmd_desc(const args_t& args); fim_cxr fcmd_display(const args_t& args); fim_cxr fcmd_redisplay(const args_t& args); fim_bool_t key_syms_update(void); fim::string find_key_syms(fim_key_t key)const; #if FIM_WANT_BENCHMARKS virtual fim_int get_n_qbenchmarks(void)const; virtual string get_bresults_string(fim_int qbi, fim_int qbtimes, fim_fms_t qbttime)const; virtual void quickbench_init(fim_int qbi); virtual void quickbench_finalize(fim_int qbi); virtual void quickbench(fim_int qbi); #endif /* FIM_WANT_BENCHMARKS */ virtual size_t byte_size(void)const; public: #if FIM_WANT_PIC_CMTS ImgDscs id_; bool push_from_id(void); #endif /* FIM_WANT_PIC_CMTS */ #if FIM_WANT_BACKGROUND_LOAD private: std::thread blt_; /* background loader thread */ std::vector fnpv_; /* file names pointers vector */ #endif /* FIM_WANT_BACKGROUND_LOAD */ fim_err_t update_font_size(void); public: void switch_if_needed(void); fim::string getInfoCustom(const fim_char_t * ifsp)const; fim_int show_must_go_on(void) const; }; } #endif /* FIM_COMMANDCONSOLE_H */ fim-0.6-rc2/src/CommandConsole-help.cpp0000644000175000017500000002315414454347340014676 00000000000000/* $LastChangedDate: 2023-03-08 01:27:18 +0100 (Wed, 08 Mar 2023) $ */ /* CommandConsole-help.cpp : Fim console dispatcher--help member functions (c) 2011-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" namespace fim { fim::string CommandConsole::get_variables_reference(FimDocRefMode refmode)const { /* * returns the reference of registered functions */ fim::string s; s+= fim_get_variables_reference(refmode); // ... return s; } fim::string CommandConsole::get_commands_reference(FimDocRefMode refmode)const { /* * returns the reference of registered commands. */ std::ostringstream oss; if(refmode==Man) goto manmode; for(size_t i=0;i= 0 * lines from min(f,cline_) to min(l,cline_) will be dumped * * if f<0 and l>=0 and f+l<0 and -f<=cline_, * lines from cline_+f to cline_-l will be dumped * */ int fh; // font height const int cancols = displaydevice_->get_chars_per_line(); // canvas columns const int maxcols = FIM_MIN(cancols,lwidth_)+1; fim_char_t *buf=FIM_NULL; fim_err_t errval = FIM_ERR_GENERIC; if(f<0 && l>=0 && f+l<0 && -f<=cline_) { f=cline_+f; l=cline_-l; } else if(f<=l && f>=0) { f=FIM_MIN(cline_,f); l=FIM_MIN(cline_,l); } else goto err; if(cancols<1) { #if FIM_WANT_OVERLY_VERBOSE_DUMB_CONSOLE if(cancols==0) { // a fixup for the dumb console const int n=1+line_[l]-line_[f]; fim_char_t*ibuf=FIM_NULL; if(n>0 && (ibuf=(fim_char_t*) fim_malloc(n))!=FIM_NULL) { strncpy(ibuf,line_[f],n); ibuf[n-1]='\0'; displaydevice_->fs_puts(displaydevice_->f_,0,0,ibuf); fim_free(ibuf); } } else #endif /* FIM_WANT_OVERLY_VERBOSE_DUMB_CONSOLE */ goto err; } if(*bp_) goto err; //if *bp_ then we could print garbage so we exit before damage is done fh=displaydevice_->f_ ? displaydevice_->f_->sheight():1; // FIXME : this is not clean l-=f; l%=(rows_+1); l+=f; /* FIXME : the following line_ is redundant in fb, but not in SDL * moreover, it seems useless in AA (could be a bug) * */ if(fh*(l-f+1)>=displaydevice_->height()) goto done; buf = (fim_char_t*) fim_malloc(cancols+1); if(!buf) goto err; displaydevice_->clear_rect(0, displaydevice_->width()-1, 0 ,fh*(l-f+1) ); // fs_puts alone won't draw to screen, but to the back plane, so unlock/flip will be necessary displaydevice_->lock(); for(int i=f ;i<=l ;++i) { int t = ( (i0 && buf[t-1]=='\n' ) --t; // rewind newlines while(tfs_puts(displaydevice_->f_, 0, fh*(i-f), buf); } // extra empty lines (originally for aa) for(int i=0 ;ifs_puts(displaydevice_->f_, 0, fh*((l-f+1)+i), buf); } displaydevice_->unlock(); displaydevice_->flush(); done: errval = FIM_ERR_NO_ERROR; err: if(buf) fim_free(buf); return errval; } fim_err_t MiniConsole::add(const fim_char_t* cso_) { fim_char_t *s=FIM_NULL,*b=FIM_NULL; int nc; int nl; const int ol=cline_; fim_char_t *cs=FIM_NULL;/* using co would mean provoking the compiler */ fim_char_t*cso=(fim_char_t*)cso_;// FIXME #if FIM_WANT_MILDLY_VERBOSE_DUMB_CONSOLE if(displaydevice_ && 0==displaydevice_->get_chars_per_column()) { // we display input as soon as it received. if(this->getGlobalIntVariable(FIM_VID_DISPLAY_CONSOLE)) displaydevice_->fs_puts(displaydevice_->f_,0,0,(const fim_char_t*)cso); } #endif /* FIM_WANT_MILDLY_VERBOSE_DUMB_CONSOLE */ cs=dupstr(cso); if(!cs) goto rerr; nc=strlen(cs); if(!nc) goto rerr; nl=lines_count(cs,lwidth_); if(lwidth_<1) goto rerr; nl=lines_count(cs,lwidth_); // we count exactly the number of new entries needed in the arrays we have if((s=const_cast(strchr(cs,'\n')))!=FIM_NULL && s!=cs) nl+=(ccol_+(s-cs-1))/lwidth_;// single line_ with \n or multiline else nl+=(strlen(cs)+ccol_)/lwidth_; // single line_, with no terminators /* * we check for room (please note that nl >= the effective new lines introduced , while * nc amounts to the exact extra room needed ) * */ if( ( nc+1+(bp_-buffer_) ) > bsize_ || nl+1+cline_ > lsize_ ) { fim_free(cs); return FIM_ERR_BUFFER_FULL;//no room : realloc needed ; 1 is for secur1ty } scroll_=scroll_-nl<0?0:scroll_-nl; // we copy the whole new string in our buffer_ strcpy(bp_,cs); fim_free(cs); cs=FIM_NULL; sanitize_string_from_nongraph_except_newline(bp_,0); s=bp_-ccol_;// we will work in our buffer_ space now on b=s; while(*s && (s=(fim_char_t*)next_row(s,lwidth_))!=FIM_NULL && *s) { line_[++cline_]=s;// we keep track of each new line_ ccol_=0; bp_=s; }// !s || !*s if(!*s && s-b==lwidth_){line_[++cline_]=(bp_=s);}// we keep track of the last line_ too if(ol==cline_) { ccol_=strlen(line_[cline_]); // we update the current (right after last) column bp_+=strlen(bp_); // the buffer_ points to the current column } else { ccol_=strlen(bp_); // we update the current (right after last) column bp_+=ccol_; // the buffer_ points to the current column } return FIM_ERR_NO_ERROR; rerr: fim_free(cs); return FIM_ERR_GENERIC; } fim_err_t MiniConsole::setRows(int nr) { /* * We update the displayed rows_, if this is physically possible * If nr is negative, no correctness checks will occur. * ( useful if calling this routine with FIM_NULL displaydevice.. ) * */ int maxrows; if(nr<0) { rows_=-nr; return FIM_ERR_NO_ERROR; } maxrows = displaydevice_->get_chars_per_column(); if(nr>0 && nr<=maxrows) { rows_=nr; return FIM_ERR_NO_ERROR; } return FIM_ERR_GENERIC; } MiniConsole::MiniConsole(CommandConsole& gcc, DisplayDevice *dd,int lw, int r) : Namespace(&gcc), buffer_(FIM_NULL), line_(FIM_NULL), bp_(FIM_NULL), bsize_(0), lsize_(0), ccol_(0), cline_(0), lwidth_(0), rows_(0), scroll_(0), displaydevice_(dd) { const int BS=FIM_CONSOLE_BLOCKSIZE; //block size of 1k bsize_ = BS * FIM_CONSOLE_DEF_WIDTH; lsize_ = BS * 8; lwidth_=lw<=0?FIM_CONSOLE_DEF_WIDTH:lw; rows_=r<=0?FIM_CONSOLE_DEF_ROWS:r; cline_ =0; ccol_ =0; buffer_=(fim_char_t*) fim_calloc(bsize_,sizeof(fim_char_t )); line_ =(fim_char_t**)fim_calloc(lsize_,sizeof(fim_char_t*)); bp_ =buffer_; if(!buffer_ || !line_) { bsize_=0; lsize_=0; if(buffer_) fim_free(buffer_); if(line_ ) fim_free(line_); } else { line_[cline_]=buffer_; } add(FIM_MSG_CONSOLE_FIRST_LINE_BANNER); } #if FIM_WANT_OBSOLETE fim_err_t MiniConsole::do_dump(int amount)const { /* * We dump: * the last amount of lines if amount > 0 * all the lines if amount == 0 * the first ones if amount < 0 * */ if(amount > 0) { // dumps the last amount of lines amount=amount>cline_?cline_:amount; do_dump(cline_-amount+1,cline_); } else if(amount ==0) { // dumps all of the lines do_dump(0,cline_); } else if(amount < 0) { // dumps the first amount of lines if(-amount>=cline_) amount+=cline_; do_dump(0,-amount); } return FIM_ERR_NO_ERROR; } #endif /* FIM_WANT_OBSOLETE */ fim_err_t MiniConsole::grow_lines(int glines) { /* * grow of a specified amount of lines the lines array * * see the doc for grow() to get more * */ /* TEST ME AND FINISH ME */ if(glines< 0) return FIM_ERR_GENERIC; if(glines==0) return FIM_ERR_NO_ERROR; fim_char_t **p; p=line_; line_=(fim_char_t**)fim_realloc(line_,bsize_+glines*sizeof(fim_char_t*)); if(!line_){line_=p;return FIM_ERR_GENERIC;/* no change */} lsize_+=glines; return FIM_ERR_NO_ERROR; } fim_err_t MiniConsole::grow_buffer(int gbuffer) { /* * grow of a specified amount of lines the buffer_ array * * see the doc for grow() to get more * */ /* TEST ME AND FINISH ME */ if(gbuffer< 0) return FIM_ERR_GENERIC; if(gbuffer==0) return FIM_ERR_NO_ERROR; fim_char_t *p; int i; ptrdiff_t d; p=buffer_; buffer_=(fim_char_t*)fim_realloc(buffer_,(bsize_+gbuffer)*sizeof(fim_char_t)); if(!buffer_){buffer_=p;return FIM_ERR_GENERIC;/* no change */} if((d=(p-buffer_))!=0)// in the case a shift is needed { for(i=0;i<=cline_;++i) line_[i]-=d; bp_-=d; } bsize_+=gbuffer; return FIM_ERR_NO_ERROR; } fim_err_t MiniConsole::grow(void) { /* * We grow a specified amount both the line_ count and the line_ buffer_. * */ return grow(FIM_CONSOLE_BLOCKSIZE,8*FIM_CONSOLE_BLOCKSIZE); } fim_err_t MiniConsole::grow(int glines, int gbuffer) { /* * grow of a specified amount of lines or bytes the * current line_ and text buffers; i.e.: make room * to support glines more lines and gbuffer more characters. * * grow values can be negative. in this case, the current * buffers will be shrunk of the specified amounts. * * consistency will be preserved by deleting a certain amount * of lines: the older ones. * * a zero amount for a value imply the line_ or buffer_ arrays * to remain untouched. * */ /* FINISH ME AND TEST ME */ int gb,gl; gb=grow_buffer(gbuffer); gl=grow_lines (glines); return ( gb==FIM_ERR_NO_ERROR && FIM_ERR_NO_ERROR ==gl )?FIM_ERR_NO_ERROR:FIM_ERR_GENERIC;// 0 if both 0 } fim_err_t MiniConsole::reformat(int newlwidth) { /* * This member function reformats the whole buffer_ array; that is, it recomputes * line_ information for it, thus updating the whole line_ array contents. * It may fail, in the case a new line_ width (smaller) is desired, because * more line_ information would be needed. * * If the new lines are longer than before, then it could not fail. * Upon a successful execution, the width is updated. * * */ int nls; if(newlwidth==lwidth_) return FIM_ERR_NO_ERROR;//are we sure? if(newlwidth< lwidth_) { // realloc needed if ( ( nls=lines_count(buffer_, newlwidth) + 1 ) < lsize_ ) if ( grow_lines( nls )!=FIM_ERR_NO_ERROR ) return FIM_ERR_GENERIC; } if(newlwidth> lwidth_ || ( lines_count(buffer_, newlwidth) + 1 < lsize_ ) ) { // no realloc, no risk fim::string buf=buffer_; if( buf.size() == (size_t)(bp_-buffer_) ) { ccol_=0;cline_=0;lwidth_=newlwidth;*line_=buffer_;bp_=buffer_; // the easy way add(buf.c_str());// by adding a very big chunk of text, we make sure it gets formatted. return FIM_ERR_NO_ERROR; } // if some error happened in buf string initialization, we return -1 return FIM_ERR_GENERIC; } return FIM_ERR_GENERIC; } fim_err_t MiniConsole::dump(void) { /* * We dump on screen the textual console contents. * We consider user set variables. * */ const fim_int co=getGlobalIntVariable(FIM_VID_CONSOLE_LINE_OFFSET); const fim_int lw=getGlobalIntVariable(FIM_VID_CONSOLE_LINE_WIDTH ); const fim_int ls=getGlobalIntVariable(FIM_VID_CONSOLE_ROWS ); setGlobalVariable(FIM_VID_CONSOLE_BUFFER_TOTAL,bsize_); setGlobalVariable(FIM_VID_CONSOLE_BUFFER_FREE, (bsize_-(bp_-buffer_))); setGlobalVariable(FIM_VID_CONSOLE_BUFFER_USED, (bp_-buffer_)); setGlobalVariable(FIM_VID_CONSOLE_BUFFER_LINES,cline_); // we possibly update internal variables now setRows(ls); if( lw > 0 && lw!=lwidth_ ) reformat(lw); if(co>=0) { scroll_=scroll_%(rows_+1); if(scroll_>0) return do_dump((cline_-rows_+1-co)>=0?(cline_-(rows_-scroll_)+1-co):0,cline_-co); else return do_dump((cline_-rows_+1-co)>=0?(cline_-rows_+1-co):0,cline_-co); } else return do_dump(-co-1,cline_); return FIM_ERR_GENERIC; } #if FIM_WANT_OBSOLETE fim_err_t MiniConsole::do_dump(void)const { /* * We dump on screen the textual console contents. * */ return do_dump((cline_-rows_+1)>=0?(cline_-rows_+1):0,cline_); } #endif /* FIM_WANT_OBSOLETE */ fim_err_t MiniConsole::clear(void) { scroll_=rows_; return FIM_ERR_NO_ERROR; } fim_err_t MiniConsole::scroll_down(void) { scroll_=scroll_<1?0:scroll_-1; return FIM_ERR_NO_ERROR; } fim_err_t MiniConsole::scroll_up(void) { scroll_=scroll_ //#include "fim.h" #include #include "fim.h" #include "fim_string.h" #include "common.h" #include #include #include /* gettimeofday */ #if HAVE_SYS_RESOURCE_H #include /* getrusage */ #endif /* HAVE_SYS_RESOURCE_H */ #ifdef HAVE_GETLINE #include /* getline : _GNU_SOURCE */ #endif /* HAVE_GETLINE */ #ifdef HAVE_WCHAR_H #include #endif /* HAVE_WCHAR_H */ #ifdef HAVE_LIBGEN_H #include #endif /* HAVE_LIBGEN_H */ #define FIM_WANT_ZLIB 0 /* #include */ /* useless as long as FIM_WANT_ZLIB is 0 */ /* void fim_tolowers(fim_char_t *s) { if(!s) return; for(;*s;++s) *s=tolower(*s); } void fim_touppers(fim_char_t *s) { if(!s) return; for(;*s;++s) *s=toupper(*s); } */ static fim::string fim_my_dirname(const fim::string& arg) { size_t lds = arg.rfind(FIM_CNS_DIRSEP_CHAR); if (lds != std::string::npos) { while (lds > 0 && arg[lds-1] == FIM_CNS_DIRSEP_CHAR) --lds; fim::string dir(arg); dir.erase(lds); return dir; } return arg; } fim::string fim_dirname(const fim::string& arg) { #ifdef HAVE_LIBGEN_H fim_char_t buf[FIM_PATH_MAX]; strncpy(buf,arg.c_str(),FIM_PATH_MAX-1); buf[FIM_PATH_MAX-1]='\0'; return dirname(buf); #else /* HAVE_LIBGEN_H */ return fim_my_dirname(arg); #endif /* HAVE_LIBGEN_H */ } fim::string fim_auto_quote(const fim::string& arg, int quoted) { char qc = 0; fim::string ear=arg; fim::string res=FIM_CNS_EMPTY_STRING; if (quoted == 0) { quoted = 2; if (arg.size() == 1) if ( arg[0] == '\"' ) quoted = 1; // ... } if (quoted == 1) qc = '\''; if (quoted == 2) qc = '"'; if(qc) res+=qc; if(qc == '\'') ear.substitute("'","\\'"); if(qc == '\"') ear.substitute("\"","\\\""); res+=ear; if(qc) res+=qc; return res; } fim::string fim_shell_arg_escape(const fim::string& arg, bool quoted) { fim::string ear=arg; fim::string res=FIM_CNS_EMPTY_STRING; if(quoted) res+="'"; ear.substitute("'","\\'"); res+=ear; if(quoted) res+="'"; return res; } fim::string fim_key_escape(const fim::string uk) { // escape for display std::ostringstream oss; oss << "[" << uk << "]"; return oss.str(); } fim::string fim_man_to_text(const fim::string ms) { fim::string ts = ms; #if FIM_USE_CXX_REGEX ts.substitute("(\\\\fB)(.*?)(\\\\fP)", "$2", 0); ts.substitute("(\n\\.B)(.*?)(\n)", "$2 ", 0); ts.substitute("(\\\\fR\\\\fI)(.*?)(\\\\fR)", "$2 ", 0); ts.substitute("(\n)", " ", 0); #else /* FIM_USE_CXX_REGEX */ /* workaround */ ts.substitute("\\\\fB", "", 0); ts.substitute("\\\\fP", "", 0); ts.substitute("\\\\fR", "", 0); ts.substitute("\\\\fI", "", 0); ts.substitute("\\.B", " ", 0); ts.substitute("(\n)", " "); #endif /* FIM_USE_CXX_REGEX */ ts.substitute("\\\\:", ""); return ts; } void fim_perror(const fim_char_t *s) { #if 1 if(errno) { if(s) perror(s); errno=0; // shall reset the error status } #endif } size_t fim_strlen(const fim_char_t *str) { return strlen(str); } #if 0 void trhex(fim_char_t *str) { /* * translates C-like hexcodes (e.g.: \xFF) to chars, in place. * if \x is not followed by two hexadecimal values, it is ignored and silently copied. * * * this function could be optimized. * * FIXME : UNUSED */ const fim_char_t *fp;//fast pointer fim_char_t *sp;//slow pointer fim_char_t hb[3]; if(!str) goto ret; hb[2]=0; fp=sp=str; while(*fp) { if( fp[0] =='\\' && fp[1] && fp[1]=='x' && fp[2] && isxdigit(toupper(fp[2])) && fp[3] && isxdigit(toupper(fp[3])) ) { unsigned int hc; hb[0]=toupper(fp[2]); hb[1]=toupper(fp[3]); hc=(fim_byte_t)strtol(hb,FIM_NULL,FIM_PRINTINUM_BUFSIZE); *sp=hc; fp+=3; } else *sp=*fp; ++fp; ++sp; } *sp=0; ret: return; } #endif void trec(fim_char_t *str,const fim_char_t *f,const fim_char_t*t) { /* this function translates escaped characters at index i in * f into the characters at index i in t. * * order is not important for the final effect. * * this function could be optimized. * 20090520 hex translation in * 20221204 not sure about whether hex translation is useful */ int tl; fim_char_t*_p=FIM_NULL; const fim_char_t *fp; const fim_char_t *tp; if(!str || !f || !t || strlen(f)-strlen(t)) goto ret; tl = strlen(f);//table length _p=str; while(*_p && _p[1])//redundant ? { fp=f; tp=t; #if 1 if( _p[0] =='\\' && _p[1] && _p[1]=='x' && _p[2] && isxdigit(toupper(_p[2])) && _p[3] && isxdigit(toupper(_p[3])) ) { unsigned int hc = (toupper(_p[2])-'0')*16 + (toupper(_p[3])-'0'); *_p=hc; /* \xFF ^-_p^-_p+4 */ fim_char_t *pp=_p+4; while(*pp){pp[-3]=*pp;++pp;} pp[-3]='\0'; } else #endif while(*fp) { // if the following character is backslash-escaped and is in our from-list .. if( *_p == '\\' && *(_p+1) == *fp ) { fim_char_t*pp; *_p = *tp;//translation ++_p; //new focus pp=_p+1; while(*pp) { pp[-1]=*pp;++pp; }//!*pp means we are done :) pp[-1]='\0'; //if(*_p=='\\')++_p;//we want a single pass // if(*_p)++_p;//we want a single pass // ! BUG fp=f+tl;// in this way *(fp) == '\0' (single translation pass) as soon as we continue if(!*_p) goto ret; --_p;//note that the outermost loop will increment this anyway continue;//we jump straight to while(NUL) } ++fp;++tp; } ++_p; } ret: return; } #if FIM_SHALL_BUFFER_STDIN fim_byte_t* slurp_binary_FD(FILE* fd, size_t *rs) { /* * ripped off quickly from slurp_binary_fd * FIXME : it is not throughly tested * */ fim_byte_t *buf=FIM_NULL; int inc=FIM_FILE_BUF_SIZE,rb=0,nrb=0; buf=(fim_byte_t*)fim_calloc(inc,1); if(!buf) goto ret; while((nrb=fim_fread(buf+rb,1,inc,fd))>0) { fim_byte_t *tb; // if(nrb==inc) a full read. let's try again // else we assume this is the last read (could not be true, of course) tb=(fim_byte_t*)fim_realloc(buf,rb+=nrb); if(tb!=FIM_NULL) buf=tb; else {rb-=nrb;continue;} } if(rs) { *rs=rb; } ret: return buf; } #endif /* FIM_SHALL_BUFFER_STDIN */ fim_char_t* slurp_binary_fd(int fd,int *rs) { /* * slurps a string. * puts length of non-NUL bytes in *rs. * TODO: rename to slurp_string(). * */ fim_char_t *buf=FIM_NULL; int inc=FIM_FILE_BUF_SIZE,rb=0,nrb=0; buf = fim_stralloc(inc); if(!buf) goto ret; while((nrb=read(fd,buf+rb,inc))>0) { fim_char_t *tb; // if(nrb==inc) a full read. let's try again // else we assume this is the last read (could not be true, of course) tb=(fim_char_t*)fim_realloc(buf,(rb+=nrb)+1); if(tb!=FIM_NULL) buf=tb; else {rb-=nrb;buf[rb]=FIM_SYM_CHAR_NUL;continue;} } if(rs) *rs=rb; ret: return buf; } fim::string slurp_file(fim::string filename) { std::string file; std::ifstream fs; fs.open(filename.c_str(),std::ios::binary); if(fs.is_open()) { std::string tmp; /* FIXME : this is not efficient */ while(!fs.eof()) { getline(fs,tmp); tmp+="\n" ; file+=tmp; } // printf("%s\n",file.c_str()); } fs.close(); return fim::string(file.c_str()); } bool write_to_file(fim::string filename, fim::string lines, bool append) { std::ofstream fs; fs.open(filename.c_str(), std::ios::out | ( append ? std::ios::app : std::ios::binary )); if(fs.rdstate()!=std::ios_base::goodbit) { cout << "Error opening file " << filename << " for writing !\n"; goto err; } if(fs.is_open()) { fs << lines.c_str(); if(fs.rdstate()!=std::ios_base::goodbit) { cout << "Error writing to file " << filename << " !\n"; goto err; } fs.close(); if(fs.rdstate()!=std::ios_base::goodbit) { cout << "Error closing file " << filename << " !\n"; goto err; } } else { cout << "Error after opening file " << filename << " !\n"; goto err; } #if HAVE_SYNC sync(); #endif /* HAVE_SYNC */ return true; err: return false; } /* * Turns newline characters in NULs. * Does stop on the first NUL encountered. */ void chomp(fim_char_t *s) { for(;*s;++s) if(*s=='\n') *s='\0'; } /* * cleans the input string terminating it when some non printable character is encountered * (except newline) * */ void sanitize_string_from_nongraph_except_newline(fim_char_t *s, int c) { const int n=c; if(s) while(*s && (c--||!n)) { if(!isgraph(*s)&&*s!='\n') *s=' ', ++s; else ++s; } return; } /* * cleans the input string terminating it when some non printable character is encountered * */ #if FIM_WANT_OBSOLETE void sanitize_string_from_nongraph(fim_char_t *s, int c) { const int n=c; if(s) while(*s && (c--||!n)) { if(!isgraph(*s)||*s=='\n') *s=' ', ++s; else ++s; } return; } #endif /* FIM_WANT_OBSOLETE */ /* * Allocation of a small string for storing the * representation of a double. */ fim_char_t * dupnstr (float n, const fim_char_t c) { //allocation of a single string fim_char_t *r = (fim_char_t*) fim_malloc (32); if(!r){/*assert(r);*/throw FIM_E_NO_MEM;} sprintf(r,"%f%c",n,c); return (r); } fim_char_t * dupnstr (const fim_char_t c1, double n, const fim_char_t c2) { //allocation of a single string fim_char_t *r = (fim_char_t*) fim_malloc (32); if(!r){/*assert(r);*/throw FIM_E_NO_MEM;} sprintf(r,"%c%f%c",c1,n,c2); return (r); } /* * Allocation of a small string for storing the * representation of an integer. */ fim_char_t * dupnstr (fim_int n) { //allocation of a single string fim_char_t *r = (fim_char_t*) fim_malloc (FIM_PRINTINUM_BUFSIZE); if(!r){/*assert(r);*/throw FIM_E_NO_MEM;} fim_snprintf_fim_int(r,n); return (r); } /* * Allocation and duplication of a single string */ fim_char_t * dupstr (const fim_char_t* s) { fim_char_t *r = (fim_char_t*) fim_malloc (strlen (s) + 1); if(!r){/*assert(r);*/throw FIM_E_NO_MEM;} strcpy (r, s); return (r); } /* * Allocation and duplication of a single string, slash-quoted */ fim_char_t * dupsqstr (const fim_char_t* s) { int l=0; fim_char_t *r = (fim_char_t*) fim_malloc ((l=strlen (s)) + 3); if(!r){/*assert(r);*/throw FIM_E_NO_MEM;} else { r[0]='/'; strcpy (r+1 , s); strcat (r+1+l,"/"); } return (r); } /* * Allocation and duplication of a single string (not necessarily terminating) */ #ifdef HAVE_FGETLN #if FIM_USE_CXX14 auto dupstrn (const fim_char_t* s, size_t l) /* Return type inference could be useful in a few places; this is just an example reminder. */ #else /* FIM_USE_CXX14 */ static fim_char_t * dupstrn (const fim_char_t* s, size_t l) #endif /* FIM_USE_CXX14 */ { fim_char_t *r = (fim_char_t*) fim_malloc (l + 1); if(!r){/*assert(r);*/throw FIM_E_NO_MEM;} strncpy(r,s,l); r[l]='\0'; return (r); } #endif /* HAVE_FGETLN */ template static int pick_word(const fim_char_t *f, T*wp) { int fd = open(f,O_RDONLY); if(fd==-1) goto ret; if(read(fd,wp,sizeof(T))==sizeof(T)) wp=FIM_NULL; // success close(fd); if(wp==FIM_NULL) fd=0; // success else fd=-1; ret: return fd; } fim_int fim_rand(void) { /* * Please don't use Fim random numbers for cryptographical purposes ;) * Note that we use /dev/urandom because it will never block on reading. * Reading from /dev/random may block. * */ fim_int w; unsigned int u; if(pick_word(FIM_LINUX_RAND_FILE,&u)==0) w = (u%RAND_MAX); else { srand(clock()); w = rand(); } return w; } bool regexp_match(const fim_char_t*s, const fim_char_t*r, int ignorecase, int ignorenewlines, int globexception) { /* * given a string s, and a Posix regular expression r, this * member function returns true if there is match. false otherwise. */ bool match=false; match=true; #if FIM_USE_CXX_REGEX /* * we allow for the default match, in case of null regexp */ if(!r || !*r || !strlen(r)) goto ret; /* fixup code for a mysterious bug (TODO: check if still relevant) */ if(globexception && *r=='*') { match = false; goto ret; } try { match = std::regex_search(s, std::regex(r, ignorecase ? ( std::regex_constants::extended | std::regex_constants::icase) : std::regex_constants::extended )); } catch (const std::exception &) { match = false; } #else /* FIM_USE_CXX_REGEX */ #if HAVE_REGEX_H regex_t regex; //should be static!!! FIM_CONSTEXPR int nmatch=1; // we are satisfied with the first match, aren't we ? regmatch_t pmatch[nmatch]; /* * we allow for the default match, in case of null regexp */ if(!r || !*r || !strlen(r)) goto ret; /* fixup code for a mysterious bug (TODO: check if still relevant) */ if(globexception && *r=='*') { match = false; goto ret; } if(ignorenewlines) { /* TODO: unfinished, maybe obsolete */ fim::string aux; aux=s; } //if(regcomp(®ex,"^ \\+$", 0 | REG_EXTENDED | REG_ICASE )!=0) if(regcomp(®ex,r, 0 | REG_EXTENDED | (ignorecase==0?0:REG_ICASE) )!=0) { /* error calling regcomp (invalid regexp?)! (should we warn the user ?) */ //cout << "error calling regcomp (invalid regexp?)!" << "\n"; return false; } else { // cout << "done calling regcomp!" << "\n"; } //if(regexec(®ex,s+0,nmatch,pmatch,0)==0) if(regexec(®ex,s+0,nmatch,pmatch,0)!=REG_NOMATCH) { // cout << "'"<< s << "' matches with '" << r << "'\n"; /* cout << "match : " << "\n"; cout << "\""; for(int m=pmatch[0].rm_so;m \0 * next_row("123\n4") -> 4 * next_row("12") -> \0 * next_row("1234") -> 4 * */ const fim_char_t *b=s; int l=strlen(s); if(!s) return FIM_NULL; if((s=strchr(s,'\n'))!=FIM_NULL) { // we have a newline marking the end of line: // with newline-column merge (*s==\n and s+1 is after) if((s-b)<=cols) return s+1; // ... or without merge (b[cols]!=\n and belongs to the next line) else return b+=cols; } return b+(l>=cols?cols:l);// no newlines in this string; we return the cols'th character or the NUL } int lines_count(const fim_char_t*s, int cols) { /* for cols=6 * * "" 0 * "aab" 0 * "aaaaba\nemk" 1 * "aaaaba\nemk\n" 2 * "aaaabaa\nemk\n" 3 * */ if(cols<=0) return -1; #if FIM_WANT_OBSOLETE if(cols==0) return newlines_count(s); #endif /* FIM_WANT_OBSOLETE */ int n=0; const fim_char_t*b; if(!s) return 0; b=s; while((s=strchr(s,'\n'))!=FIM_NULL && *s) { /* * we want a cols long sequence followed by \n * to be counted as one line, just as cols chars alone. * * moreover, we want to be able to enter in this body * even if *++s is NUL, just to perform this computation. */ n+=s>b?(s-1-b)/cols:0; /* extra lines due to the excessive line width (if s==b we can't expect any wrapping, of course ) */ ++n; // the \n is counted as a new line b=++s; // if now *s==NUL, strchr simply will fail } //printf("n:%d\n",n); s=b;//*b==NUL or *b points to the last substring non newline terminated n+=(strlen(s))/cols; // we count the last substring chars (with no wrapping exceptions) return n; } int swap_bytes_in_int(int in) { // to Most Significant Byte First // FIXME : this function should be optimized const int b=sizeof(int); int out=0; int i=-1; while(i++0 ) { wc=fwrite(buf,1,rc,tfd); if(wc!=rc) { /* FIXME : this error condition should be handled, as this mechanism is very brittle */ // std::cerr << "fwrite error writing to tmpfile()!\n"; } } rewind(tfd); if(errno) { // FIXME: need to handle errors properly. std::cerr << "Error while reading temporary file: errno has now value "<1024) d*=FIM_CNS_K,u='K',b='B'; if(q/d>1024) d*=FIM_CNS_K,u='M'; if(q/d>1024) d*=FIM_CNS_K,u='G'; #if (SIZEOF_SIZE_T > 4) if(q/d>1024) d*=FIM_CNS_K,u='T'; if(q/d>1024) d*=FIM_CNS_K,u='P'; #endif if(q/d<10) src = snprintf(str, size, "%1.1f%c%c",((float)q)/((float)d),u,b); else #if FIM_USE_OLDCXX src = snprintf(str, size, "%d%c%c",(int)(q/d),u,b); #else src = snprintf(str, size, "%zd%c%c",q/d,u,b); #endif return src; } fim_byte_t * fim_pm_alloc(unsigned int width, unsigned int height, bool want_calloc) { size_t nmemb=1, size=1; nmemb *= width; nmemb *= height; nmemb *= 3; /* FIXME: shall implement overflow checks here */ if(want_calloc) return (fim_byte_t*)fim_calloc(nmemb, size); else return (fim_byte_t*)fim_malloc(nmemb); } const fim_char_t * fim_basename_of(const fim_char_t * s) { if(s && *s) { #if 0 size_t sl = strlen(s); while(sl > 0 ) { sl--; if(s[sl]=='/') return s+sl+1; } #else const fim_char_t * const bn = strrchr(s,'/'); if(bn) s=bn+1; #endif } return s; } fim::string fim_getcwd(void) { fim::string cwd; #if HAVE_GET_CURRENT_DIR_NAME /* default */ if( fim_char_t *p = get_current_dir_name() ) { cwd=p; free(p); } #else /* HAVE_GET_CURRENT_DIR_NAME */ #if _BSD_SOURCE || _XOPEN_SOURCE >= 500 { /* untested */ fim_char_t *buf[PATH_MAX]; getcwd(buf,PATH_MAX-1): buf[PATH_MAX-1]=FIM_SYM_CHAR_NUL; cwd=buf; } #endif /* _BSD_SOURCE || _XOPEN_SOURCE >= 500 */ #endif /* HAVE_GET_CURRENT_DIR_NAME */ return cwd; } static fim_int fim_util_atoi_kmX(const fim_char_t *nptr, int base) { // from rsb__util_atoi_kmX fim_int v = fim_atoi(nptr); if(*nptr=='-') ++nptr; while(isdigit(*nptr)) ++nptr; if(*nptr && tolower(*nptr)=='g') v *= base * base * base; if(*nptr && tolower(*nptr)=='m') v *= base * base; if(*nptr && tolower(*nptr)=='k') v *= base; return v; } fim_int fim_util_atoi_km2(const fim_char_t *nptr) { // from rsb__util_atoi_km2 return fim_util_atoi_kmX(nptr, 1024); } fim_int fim_atoi(const char*s) { if(FIM_LARGE_FIM_INT) return atoll(s); else return atoi(s); } size_t fim_maxrss(void) { #if HAVE_SYS_RESOURCE_H struct rusage usage; /* int gru = */getrusage(RUSAGE_SELF,&usage);// TODO: shall report in case of error. // printf("ru_maxrss: %ld (maximum resident set size -- MB)\n",usage.ru_maxrss / 1024); // return quantity in B return usage.ru_maxrss * 1024; #else /* HAVE_SYS_RESOURCE_H */ return 0; #endif /* HAVE_SYS_RESOURCE_H */ } fim_bool_t fim_is_id(const char*s) { /* is fim variable identifier ? */ if(s) { if(*s != '_' && ! isalpha(*s) ) goto no; for(; *s == '_' || isalnum(*s); ++s ) ; if(!*s) return true; } no: return false; } fim_bool_t fim_is_id_char(const char c) { // valid only within desc file ids return isalpha(c) || c == '_'; } fim-0.6-rc2/src/default_icon_byte_array.h0000644000175000017500000001602014454347340015363 00000000000000{ 0x42,0x4d,0x8a,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x8a,0x00,0x00,0x00,0x7c,0x00, 0x00,0x00,0x13,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x01,0x00,0x10,0x00,0x03,0x00, 0x00,0x00,0x00,0x05,0x00,0x00,0x13,0x0b,0x00,0x00,0x13,0x0b,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0xe0,0x07,0x00,0x00,0x1f,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x47,0x52,0x73,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00, 0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00, 0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00, }; fim-0.6-rc2/src/AADevice.cpp0000644000175000017500000005532714454347340012457 00000000000000/* $LastChangedDate: 2022-11-27 16:57:30 +0100 (Sun, 27 Nov 2022) $ */ /* AADevice.cpp : aalib device Fim driver file (c) 2008-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #ifdef FIM_WITH_AALIB #include "AADevice.h" #include #define FIM_AA_MINWIDTH 2 #define FIM_AA_MINHEIGHT 2 /* FIXME : aalib has two resolutions : an input one, and a screen one. this is not well handled by our code, as we expect a 1:1 mapping. */ #define min(x,y) ((x)<(y)?(x):(y)) typedef char fim_aa_char; /* a type for aalib chars */ static bool aainvalid; template fim_err_t AADevice::clear_rect_( void* dst, // destination gray array and source rgb array fim_coo_t oroff,fim_coo_t ocoff, // row and column offset of the first output pixel fim_coo_t orows,fim_coo_t ocols, // rows and columns drawable in the output buffer fim_coo_t ocskip // output columns to skip for each line ) { /* output screen variables */ const fim_byte_t PIXELVAL = (fim_byte_t) PIXELCOL; fim_coo_t oi,// output image row index oj;// output image columns index fim_coo_t lor,loc; if( oroff <0 ) return -8; if( ocoff <0 ) return -9; if( orows <=0 ) return -10; if( ocols <=0 ) return -11; if( ocskip<0 ) return -12; if( oroff>orows ) return -8-10*100; if( ocoff>ocols ) return -9-11*100; if( ocskipirows ) return -3-4*100 ; if( icoff>icols ) return -4-6*100; if( oroff>orows ) return -8-10*100; if( ocoff>ocols ) return -9-11*100; if( icskipdata:FIM_NULL;// source rgb array if ( !rgb ) return FIM_ERR_GENERIC; if( iroff <0 ) return -2; if( icoff <0 ) return -3; if( irows <=0 ) return -4; if( icols <=0 ) return -5; if( icskip<0 ) return -6; if( oroff <0 ) return -7; if( ocoff <0 ) return -8; if( orows <=0 ) return -9; if( ocols <=0 ) return -10; if( ocskip<0 ) return -11; if( flags <0 ) return -12; if( iroff>irows ) return -2-3*100 ; if( icoff>icols ) return -3-5*100; // if( oroff>orows ) return -7-9*100;//EXP // if( ocoff>ocols ) return -8-10*100;//EXP if( oroff>height() ) return -7-9*100;//EXP if( ocoff>width()) return -8-10*100;//EXP if( icskip height() ) return -9 -99*100; if( ocols > width() ) return -10-99*100; if( ocskip < width() ) return -11-99*100; if( icskip( aa_image(ascii_context_), oroff,ocoff, oroff+orows,ocoff+ocols, ocskip); // cout << iroff << " " << icoff << " " << irows << " " << icols << " " << icskip << "\n"; /* cout << oroff << " " << ocoff << " " << orows << " " << ocols << " " << ocskip << "\n"; cout << " aa_scrwidth(ascii_context_):" << aa_scrwidth(ascii_context_) << " "; cout << "aa_scrheight(ascii_context_):" <0) ascii_hwparms_.width = v-1; // if((e=getenv("LINES" ))!=FIM_NULL && (v=fim_atoi(e))>0) ascii_hwparms_.height = v-1; // if((e=getenv("COLUMNS"))!=FIM_NULL && (v=fim_atoi(e))>0) ascii_hwparms_.recwidth = v; // if((e=getenv("LINES" ))!=FIM_NULL && (v=fim_atoi(e))>0) ascii_hwparms_.recheight = v; // ascii_hwparms_.width = 80; // ascii_hwparms_.height = 56; // // ascii_hwparms_.width = 128-1; // ascii_hwparms_.height = 48 -1; /*ascii_hwparms_.width() = 4; ascii_hwparms_.height() = 4;*/ name_[0] = FIM_SYM_CHAR_NUL; name_[1] = FIM_SYM_CHAR_NUL; if(allow_windowed==0) setenv(FIM_ENV_DISPLAY,"",1); /* running fim -o aalib in a window may render fim unusable */ ascii_save_.name = (fim_aa_char*)name_; ascii_save_.format = &aa_text_format; ascii_save_.file = FIM_NULL; // ascii_context_ = aa_init (&save_d, &ascii_hwparms_, &ascii_save_); ascii_context_ = aa_autoinit (&ascii_hwparms_); if(!ascii_context_) { std::cout << "problem initializing aalib!\n"; return FIM_ERR_GENERIC; } if(!aa_autoinitkbd(ascii_context_, 0)) { std::cout << "problem initializing aalib keyboard!\n"; return FIM_ERR_GENERIC; } /*if(!aa_autoinitmouse(ascii_context_, 0)) { std::cout << "problem initializing aalib mouse!\n"; return FIM_ERR_GENERIC; }*/ aa_hidecursor (ascii_context_); #if 0 /* won't help in the ill X11-windowed aalib shipped with many distros case */ sym_keys[FIM_KBD_LEFT]=AA_LEFT; sym_keys[FIM_KBD_RIGHT]=AA_RIGHT; sym_keys[FIM_KBD_UP]=AA_UP; sym_keys[FIM_KBD_DOWN]=AA_DOWN; sym_keys[FIM_KBD_ESC]=AA_ESC; #else const int aa_f0 = 65870 - 1; sym_keys[FIM_KBD_F1 ]=aa_f0+1; sym_keys[FIM_KBD_F2 ]=aa_f0+2; sym_keys[FIM_KBD_F3 ]=aa_f0+3; sym_keys[FIM_KBD_F4 ]=aa_f0+4; sym_keys[FIM_KBD_F5 ]=aa_f0+5; sym_keys[FIM_KBD_F6 ]=aa_f0+6; sym_keys[FIM_KBD_F7 ]=aa_f0+7; sym_keys[FIM_KBD_F8 ]=aa_f0+8; sym_keys[FIM_KBD_F9 ]=aa_f0+9; sym_keys[FIM_KBD_F10]=aa_f0+10; sym_keys[FIM_KBD_F11]=aa_f0+11; sym_keys[FIM_KBD_F12]=aa_f0+12; cc.key_syms_update(); #endif /* The mulx and muly are not reliable */ #if 0 if(ascii_context_->mulx>0 && ascii_context_->muly>0) cc.setVariable("aascale",FIM_INT_SCALE_FRAC(ascii_context_->muly,static_cast(ascii_context_->mulx))); cc.setVariable("aamuly",(ascii_context_->muly)); cc.setVariable("aamulx",(ascii_context_->mulx)); #endif return FIM_ERR_NO_ERROR; } void AADevice::finalize(void) { finalized_=true; aa_close(ascii_context_); } fim_coo_t AADevice::get_chars_per_line(void)const{return aa_scrwidth(ascii_context_);} fim_coo_t AADevice::get_chars_per_column(void)const{return aa_scrheight(ascii_context_);} fim_coo_t AADevice::txt_width(void)const { return aa_scrwidth(ascii_context_ ) ;} fim_coo_t AADevice::txt_height(void)const{ return aa_scrheight(ascii_context_) ;} fim_coo_t AADevice::width(void)const { return aa_imgwidth(ascii_context_ ) ;} fim_coo_t AADevice::height(void)const{ return aa_imgheight(ascii_context_) ;} #if 0 fim_err_t AADevice::format_console(void) { #ifndef FIM_WANT_NO_OUTPUT_CONSOLE //mc_.setRows ( -height()/2); mc_.setRows ( get_chars_per_column()/2 ); mc_.reformat( txt_width() ); #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ return FIM_ERR_NO_ERROR; } #endif fim_err_t AADevice::fs_puts(struct fs_font *f, fim_coo_t x, fim_coo_t y, const fim_char_t *str) { #if (!FIM_AALIB_DRIVER_DEBUG) aa_puts(ascii_context_,x,y, //AA_REVERSE, AA_NORMAL, //AA_SPECIAL, (const fim_aa_char*)str); #endif /* FIM_AALIB_DRIVER_DEBUG */ return FIM_ERR_NO_ERROR; } void AADevice::flush(void) { aa_flush(ascii_context_); } fim_err_t AADevice::clear_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1, fim_coo_t y2) { /* FIXME : only if initialized ! * TODO : define the exact conditions to use this member function * */ return clear_rect_(aa_image(ascii_context_),y1, x1, y2-y1+1, x2-x1+1,aa_imgwidth(ascii_context_)); } fim_err_t AADevice::fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t color) { if( color == FIM_CNS_WHITE ) return clear_rect_(aa_image(ascii_context_),y1, x1, y2-y1+1, x2-x1+1,aa_imgwidth(ascii_context_)); else return clear_rect_(aa_image(ascii_context_),y1, x1, y2-y1+1, x2-x1+1,aa_imgwidth(ascii_context_)); } fim_err_t AADevice::status_line(const fim_char_t *msg) { const fim_coo_t th=txt_height(); if(th<1) goto err; #if (!FIM_AALIB_DRIVER_DEBUG) aa_printf(ascii_context_,0,th-1,AA_NORMAL,"%s",msg); #endif /* FIM_AALIB_DRIVER_DEBUG */ aa_flush(ascii_context_); err: return FIM_ERR_NO_ERROR; } AADevice::~AADevice(void) { /* seems like in some cases some aa stuff doesn't get freed. is this possible ? */ if(!finalized_) finalize(); } static aa_context *fim_aa_ascii_context; /* This was a global variable just for the use in fim_aa_get_input. Now one it's of no use. */ static fim_sys_int fim_aa_get_input(fim_key_t * c, bool want_poll, bool * srp) { fim_key_t e = 0; if(srp) *srp = true; if(!c) return 0; *c = FIM_SYM_NULL_KEY; *c = aa_getevent(fim_aa_ascii_context,0);/* 1 for blocking wait */ if(*c==AA_UNKNOWN) *c=0; if(*c) std::cout << "";/* FIXME : removing this breaks things. console-related problem, I guess */ if(!*c) return 0; switch (*c) { case (AA_UP ): e=FIM_KKE_UP; break; case (AA_DOWN ): e=FIM_KKE_DOWN;break; case (AA_LEFT ): e=FIM_KKE_LEFT;break; case (AA_RIGHT): e=FIM_KKE_RIGHT;break; case (AA_BACKSPACE): e=FIM_KKE_BACKSPACE;break; /* Note: these five bindings work only under X11 .. */ case (65765): e=FIM_KKE_PAGE_UP;break; case (65766): e=FIM_KKE_PAGE_DOWN;break; case (65779): e=FIM_KKE_INSERT;break; case (65760): e=FIM_KKE_HOME;break; case (65767): e=FIM_KKE_END;break; case (AA_ESC): e=FIM_KKE_ESC; break; } if (e) { *c = e; return 1; } if(srp) *srp = false; return 0; } fim_sys_int AADevice::get_input(fim_key_t * c, bool want_poll) { fim_sys_int rc = 0; bool sr = false; fim_aa_ascii_context = ascii_context_; rc = fim_aa_get_input(c, want_poll, &sr); if(sr) return rc; rc = 1; switch (*c) { case (65907): status_line((const fim_char_t*)"control key not yet supported in aa. sorry!"); /* left ctrl (arbitrary) */ break; case (65908): status_line((const fim_char_t*)"control key not yet supported in aa. sorry!"); /* right ctrl (arbitrary) */ break; case (65909): status_line((const fim_char_t*)"lock key not yet supported in aa. sorry!"); /* right ctrl (arbitrary) */ break; case (65906): status_line((const fim_char_t*)"shift key not yet supported in aa. sorry!"); /* shift (arbitrary) */ break; case (AA_MOUSE): status_line((const fim_char_t *)"mouse events not yet supported in aa. sorry!"); /* */ break; case (AA_RESIZE): //status_line((const fim_char_t *)"window resizing not yet supported. sorry!"); cc.display_resize(0,0); /*aa_resize(ascii_context_);*//*we are not yet ready : the FimWindow and Viewport stuff .. */ rc = 0; /* */ break; } //std::cout << "event : " << *c << "\n"; //if(*c<0x80) return 1; return rc; } fim_err_t AADevice::resize(fim_coo_t w, fim_coo_t h) { /* resize is handled by aalib */ FIM_CONSTEXPR bool want_resize_=true; #if AA_LIB_VERSIONCODE>=104000 /* aalib version 104000 calls exit(-1) on zero-width/height contexts. this is simply stupid. the code we have here is not completely clean, but it catches the situation and proposes a fallback solution, by reinitializing the library video mode to reasonable defaults. */ { fim_coo_t width=0, height=0; ascii_context_->driver->getsize(ascii_context_, &width, &height); if (width < FIM_AA_MINWIDTH || height < FIM_AA_MINHEIGHT ) { /* this is a fix to avoid a segfault in aalib following to-zero window resize */ aa_close(ascii_context_); memcpy (&ascii_hwparms_, &aa_defparams, sizeof (struct aa_hardware_params)); ascii_context_ = aa_autoinit (&ascii_hwparms_); if(!aa_autoinitkbd(ascii_context_, 0)) ;// error handling / reporting missing return FIM_ERR_NO_ERROR; } } #else /* AA_LIB_VERSIONCODE */ /* FIXME: shall track back the first evil aalib version */ #endif /* AA_LIB_VERSIONCODE */ if(!want_resize_) return FIM_ERR_GENERIC; if(1==aa_resize(ascii_context_)) { cc.setVariable(FIM_VID_SCREEN_WIDTH, width() ); cc.setVariable(FIM_VID_SCREEN_HEIGHT,height()); return FIM_ERR_NO_ERROR; } return FIM_ERR_GENERIC; } fim_coo_t AADevice::status_line_height(void)const { return FIM_AALIB_FONT_HEIGHT; } fim_coo_t AADevice::font_height(void)const { return FIM_AALIB_FONT_HEIGHT; } #ifndef FIM_WANT_NO_OUTPUT_CONSOLE AADevice::AADevice(MiniConsole& mc_, fim::string opts ):DisplayDevice(mc_), #else /* FIM_WANT_NO_OUTPUT_CONSOLE */ AADevice( fim::string opts ):DisplayDevice(), #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ allow_windowed(0) { this->reinit(opts.c_str()); } #endif /* FIM_WITH_AALIB */ fim-0.6-rc2/src/FbiStuffBit24.cpp0000644000175000017500000000653414454347340013367 00000000000000/* $LastChangedDate: 2022-10-30 16:13:52 +0100 (Sun, 30 Oct 2022) $ */ /* FbiStuffBit24.cpp : reading any file as a raw 24 bits per pixel pixelmap (c) 2007-2022 Michele Martone based on code (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #if FIM_WANT_RAW_BITS_RENDERING #include #include #include #include #ifdef HAVE_ENDIAN_H #include #endif /* HAVE_ENDIAN_H */ namespace fim { extern CommandConsole cc; /* ---------------------------------------------------------------------- */ typedef unsigned int uint32; typedef unsigned short uint16; /* ---------------------------------------------------------------------- */ /* load */ struct bit24_state { FILE *fp; uint32 w; uint32 h; long flen; /* for ftell() */ }; static void* bit24_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { struct bit24_state *h=FIM_NULL; const fim_int prwv=cc.getIntVariable(FIM_VID_PREFERRED_RENDERING_WIDTH); const fim_int prw=prwv<1?FIM_BITRENDERING_DEF_WIDTH:prwv; h = (struct bit24_state *)fim_calloc(1,sizeof(*h)); if(!h) goto oops; h->fp = fp; if(fseek(fp,0,SEEK_END)!=0) goto oops; if((h->flen=ftell(fp))==-1) goto oops; if(h->flen < static_cast(prw*3)) { i->width = h->w = h->flen/3; i->height = h->h = 1; } else { i->width = h->w = prw; i->height = h->h = FIM_INT_FRAC(h->flen,h->w*3); // should pad } i->npages = 1; return h; oops: if(h)fim_free(h); return FIM_NULL; } static void bit24_read(fim_byte_t *dst, unsigned int line, void *data) { struct bit24_state *h = (struct bit24_state *) data; unsigned int ll,y,x = 0; y = line ; if(y==h->h-1) ll = h->flen - h->w*3 * (h->h-1); else { ll = h->w * 3; } fseek(h->fp,0 + y * ll,SEEK_SET); for (x = 0; x < h->w; x++) { *(dst++) = fgetc(h->fp); *(dst++) = fgetc(h->fp); *(dst++) = fgetc(h->fp); } // if(y==h->h-1) fim_bzero(dst,h->w*3-3*x); } static void bit24_done(void *data) { struct bit24_state *h = (struct bit24_state *) data; fclose(h->fp); fim_free(h); } struct ida_loader bit24_loader = { /* * 0000000: 7f45 4c46 0101 0100 0000 0000 0000 0000 .ELF............ */ /*magic:*/ "ELF", /*moff:*/ 1, /*mlen:*/ 3, /*name:*/ "Bit24", /*init:*/ bit24_init, /*read:*/ bit24_read, /*done:*/ bit24_done, }; static void fim__init init_rd(void) { fim_load_register(&bit24_loader); } } #endif /* FIM_WANT_RAW_BITS_RENDERING */ fim-0.6-rc2/src/Namespace.cpp0000644000175000017500000001736214454347340012747 00000000000000/* $LastChangedDate: 2023-03-25 18:31:40 +0100 (Sat, 25 Mar 2023) $ */ /* Namespace.cpp : a class for local variables storage (c) 2007-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #ifndef FIM_INDEPENDENT_NAMESPACE #define FIM_NS_SV(VN,VL) if(rnsp_) rnsp_->setVariable(VN,VL); /* FIXME: need a better solution here ! */ #else #define FIM_NS_SV(VN,VL) #endif /* FIM_INDEPENDENT_NAMESPACE */ namespace fim { fim_int Namespace::setVariable(const fim_var_id& varname,fim_int value) { variables_[varname].setInt(value); return value; } #if FIM_WANT_LONG_INT int Namespace::setVariable(const fim_var_id& varname,int value) { setVariable(varname,static_cast(value)); return value; } unsigned int Namespace::setVariable(const fim_var_id& varname,unsigned int value) { setVariable(varname,static_cast(value)); return value; } #endif /* FIM_WANT_LONG_INT */ fim_float_t Namespace::setVariable(const fim_var_id& varname,fim_float_t value) { variables_[varname].setFloat(value); return value; } const Var& Namespace::setVariable(const fim_var_id& varname,const Var&value) { variables_[varname].set(value); return value; } const fim::string& Namespace::setVariable(const fim_var_id& varname,const fim::string&value) { variables_[varname].set(value); return value; } const fim_char_t* Namespace::setVariable(const fim_var_id& varname,const fim_char_t*value) { variables_[varname].setString(string(value)); return value; } fim_bool_t Namespace::isSetVar(const fim_var_id& varname)const { fim_bool_t isv = ( variables_.find(varname) != variables_.end() ); return isv; } void Namespace::unsetVariable(const fim_var_id& varname) { variables_t ::iterator vi=variables_.find(varname); if( vi!= variables_.end() ) variables_.erase(varname); } fim_int Namespace::getIntVariable(const fim_var_id& varname)const { variables_t::const_iterator vi=variables_.find(varname); fim_int retval = FIM_CNS_EMPTY_INT_VAL; if(vi!=variables_.end()) retval = vi->second.getInt(); return retval; } const Var Namespace::getVariable(const fim_var_id& varname)const { if(varname == "*") { return Var(get_variables_list(true)); } else { variables_t::const_iterator vi=variables_.find(varname); if(vi!=variables_.end()) return vi->second; else return Var(); } } fim_float_t Namespace::getFloatVariable(const fim_var_id& varname)const { variables_t::const_iterator vi=variables_.find(varname); fim_float_t retval = FIM_CNS_EMPTY_FP_VAL; if(vi!=variables_.end()) retval = vi->second.getString(); return retval; } fim::string Namespace::getStringVariable(const fim_var_id& varname)const { fim::string retval = FIM_CNS_EMPTY_RESULT; variables_t::const_iterator vi=variables_.find(varname); if(vi!=variables_.end()) retval = vi->second.getString(); return retval; } fim_float_t Namespace::setGlobalVariable(const fim_var_id& varname,fim_float_t value) { FIM_NS_SV(varname,value) return value; } fim_int Namespace::setGlobalVariable(const fim_var_id& varname,fim_int value) { FIM_NS_SV(varname,value) return value; } #if FIM_WANT_LONG_INT int Namespace::setGlobalVariable(const fim_var_id& varname,int value) { return setGlobalVariable(varname,static_cast(value)); } unsigned int Namespace::setGlobalVariable(const fim_var_id& varname,unsigned int value) { return setGlobalVariable(varname,static_cast(value)); } #endif /* FIM_WANT_LONG_INT */ const fim_char_t* Namespace::setGlobalVariable(const fim_var_id& varname,const fim_char_t*value) { FIM_NS_SV(varname,value) return value; } const fim::string& Namespace::setGlobalVariable(const fim_var_id& varname, const fim::string& value) { FIM_NS_SV(varname,value) return value; } fim_bool_t Namespace::isSetGlobalVar(const fim_var_id& varname)const { fim_bool_t isv = false; #ifndef FIM_INDEPENDENT_NAMESPACE if(rnsp_) isv = ( rnsp_->variables_.find(varname) != rnsp_->variables_.end() ); #endif /* FIM_INDEPENDENT_NAMESPACE */ return isv; } fim_int Namespace::getGlobalIntVariable(const fim_var_id& varname)const { #ifndef FIM_INDEPENDENT_NAMESPACE if(rnsp_) return rnsp_->getIntVariable(varname); #endif /* FIM_INDEPENDENT_NAMESPACE */ return FIM_CNS_EMPTY_INT_VAL; } fim_float_t Namespace::getGlobalFloatVariable(const fim_var_id& varname)const { #ifndef FIM_INDEPENDENT_NAMESPACE if(rnsp_) return rnsp_->getFloatVariable(varname); #endif /* FIM_INDEPENDENT_NAMESPACE */ return FIM_CNS_EMPTY_FP_VAL; } fim::string Namespace::getGlobalStringVariable(const fim_var_id& varname)const { #ifndef FIM_INDEPENDENT_NAMESPACE if(rnsp_) return rnsp_->getStringVariable(varname); #endif /* FIM_INDEPENDENT_NAMESPACE */ return FIM_CNS_EMPTY_RESULT; } const Var Namespace::getGlobalVariable(const fim_var_id& varname)const { #ifndef FIM_INDEPENDENT_NAMESPACE if(rnsp_) return rnsp_->getVariable(varname); #endif /* FIM_INDEPENDENT_NAMESPACE */ return FIM_CNS_EMPTY_RESULT; } fim::string Namespace::autocmd_exec(const fim::string&event, const fim_fn_t& fname) { #ifdef FIM_AUTOCMDS #ifndef FIM_INDEPENDENT_NAMESPACE if(rnsp_) return rnsp_->autocmd_exec(event,fname); #endif /* FIM_INDEPENDENT_NAMESPACE */ return FIM_CNS_EMPTY_RESULT; #else /* FIM_AUTOCMDS */ return FIM_CNS_EMPTY_RESULT; #endif /* FIM_AUTOCMDS */ } fim::string Namespace::get_variables_list(bool with_values, bool fordesc)const { /* A list of var=val like lines. */ std::ostringstream oss; variables_t::const_iterator vi; for( vi=variables_.begin();vi!=variables_.end();++vi) { if(fordesc) oss << "#!fim:"; if(ns_char_!=FIM_SYM_NULL_NAMESPACE_CHAR) { oss << ns_char_ << FIM_SYM_NAMESPACE_SEP; } oss << ((*vi).first); if(fordesc) { oss << "="; if(with_values) oss << ((*vi).second.getString()); oss << "\n"; // newline always } else { oss << " "; if(with_values) oss << " = " << ((*vi).second.getString()) << "\n"; // newline only on with_values } } return oss.str(); } fim_err_t Namespace::find_matching_list(fim_cmd_id cmd, args_t& completions, bool prepend_ns)const { for(variables_t::const_iterator vi=variables_.begin();vi!=variables_.end();++vi) { if((vi->first).find(cmd)==0) { fim::string res; if(prepend_ns) res+=ns_char_,res+=FIM_SYM_NAMESPACE_SEP; res+=(*vi).first; completions.push_back(res); } } return FIM_ERR_NO_ERROR; } fim_err_t Namespace::assign_ns(const Namespace& ns) { for(variables_t::const_iterator fit=ns.variables_.begin();fit!=ns.variables_.end();++fit) setVariable((fit->first),Var(fit->second)); return FIM_ERR_NO_ERROR; } std::ostream& Namespace::print(std::ostream&os)const { return os << this->get_variables_list(true); } std::ostream& operator<<(std::ostream &os, const Namespace& ns) { return ns.print(os); } } fim-0.6-rc2/src/DisplayDevice.cpp0000644000175000017500000002056114454347340013573 00000000000000/* $LastChangedDate: 2022-10-30 09:00:05 +0100 (Sun, 30 Oct 2022) $ */ /* DisplayDevice.cpp : virtual device Fim driver file (c) 2008-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #include "DisplayDevice.h" #ifndef FIM_WANT_NO_OUTPUT_CONSOLE DisplayDevice::DisplayDevice(MiniConsole& mc): finalized_(false) ,mc_(mc) ,f_(FIM_NULL) ,fontname_(FIM_NULL) #else /* FIM_WANT_NO_OUTPUT_CONSOLE */ DisplayDevice::DisplayDevice(void): finalized_(false) ,f_(FIM_NULL) ,fontname_(FIM_NULL) #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ ,redraw_(FIM_REDRAW_UNNECESSARY) { const fim_char_t *line; if (FIM_NULL != (line = fim_getenv(FIM_ENV_FBFONT))) fontname_ = line; } fim_sys_int DisplayDevice::get_input(fim_key_t * c, bool want_poll) { fim_sys_int r=0; #if HAVE_SYS_SELECT_H *c=0; #ifdef FIM_SWITCH_FIXUP /* This way the console switches the right way. */ /* (The following code dates back to the original fbi.c) */ /* * patch: the following read blocks the program even when switching console */ //r=read(fim_stdin_,&c,1); if(c==0x1b){read(0,&c,3);c=(0x1b)+(c<<8);} /* * so the next coded shoul circumvent this behaviour! */ { fd_set set; fim_sys_int fdmax; struct timeval limit; fim_sys_int timeout=1,rc,paused=0; FD_ZERO(&set); FD_SET(cc.fim_stdin_, &set); fdmax = 1; #ifdef FBI_HAVE_LIBLIRC /* * expansion code :) */ if (-1 != lirc) { FD_SET(lirc,&set); fdmax = lirc+1; } #endif /* FBI_HAVE_LIBLIRC */ limit.tv_sec = timeout; limit.tv_usec = 0; rc = select(fdmax, &set, FIM_NULL, FIM_NULL, (0 != timeout && !paused) ? &limit : FIM_NULL); if(handle_console_switch()) { r=-1; /* originally a 'continue' in a loop */ goto ret; } if (FD_ISSET(cc.fim_stdin_,&set)) rc = read(cc.fim_stdin_, c, 4); r=rc; *c=int2msbf(*c); } #else /* FIM_SWITCH_FIXUP */ /* This way the console switches the wrong way. */ r=read(fim_stdin_,&c,4); //up to four chars should suffice #endif /* FIM_SWITCH_FIXUP */ ret: #endif /* HAVE_SYS_SELECT_H */ return r; } fim_key_t DisplayDevice::catchInteractiveCommand(fim_ts_t seconds)const { fim_key_t c=-1;/* -1 means 'no character pressed */ #if HAVE_TERMIOS_H /* * This call 'steals' circa 1/10 of second.. */ fd_set set; ssize_t rc=0,r; struct termios tattr, sattr; //we set the terminal in raw mode. if (! isatty(cc.fim_stdin_)) { sleep(seconds); goto ret; } FD_SET(0, &set); //fcntl(0,F_GETFL,&saved_fl); tcgetattr (0, &sattr); //fcntl(0,F_SETFL,O_BLOCK); memcpy(&tattr,&sattr,sizeof(struct termios)); tattr.c_lflag &= ~(ICANON|ECHO); tattr.c_cc[VMIN] = 0; tattr.c_cc[VTIME] = 1 * (seconds==0?1:(seconds*10)%256); tcsetattr (0, TCSAFLUSH, &tattr); //r=read(fim_stdin_,&c,4); // FIXME : read(.,.,3) is NOT portable. DANGER unsigned char uc; r = read(cc.fim_stdin_,&uc,1); c = uc; if(r>0&&c==0x1b){rc=read(0,&c,3);if(rc)c=(0x1b)+(c<<8);/* we should do something with rc now */} //we restore the previous console attributes tcsetattr (0, TCSAFLUSH, &sattr); if( r<=0 ) c=-1; ret: #endif /* HAVE_TERMIOS_H */ return c; /* read key */ } void DisplayDevice::clear_screen_locking(void) { this->lock(); fim_int ls=cc.getIntVariable(FIM_VID_CONSOLE_ROWS); fim_coo_t fh=f_?f_->sheight():1; ls=FIM_MIN(ls,height()/fh); clear_rect(0, width()-1, 0,fh*ls); this->unlock(); } #ifndef FIM_KEEP_BROKEN_CONSOLE void DisplayDevice::fb_status_screen_new(const fim_char_t *msg, fim_bool_t draw, fim_flags_t flags) { #ifndef FIM_WANT_NO_OUTPUT_CONSOLE fim_err_t r=FIM_ERR_NO_ERROR; if(flags==0x03) { /* clear screen sequence */ mc_.clear(); goto ret; } if( flags==0x01 ) { mc_.scroll_down(); goto ret; } if( flags==0x02 ) { mc_.scroll_up(); goto ret; } r=mc_.add(msg); if(r==FIM_ERR_BUFFER_FULL) { r=mc_.grow(); if(r==FIM_ERR_GENERIC) goto ret; r=mc_.add(msg); if(r==FIM_ERR_GENERIC) goto ret; } if(!draw ) goto ret; clear_screen_locking(); mc_.dump(); #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ ret: return; } #endif /* FIM_KEEP_BROKEN_CONSOLE */ fim_err_t DisplayDevice::console_control(fim_cc_t arg) { if(arg==0x01) fb_status_screen_new(FIM_NULL,false,arg); if(arg==0x02) fb_status_screen_new(FIM_NULL,false,arg); if(arg==0x03) fb_status_screen_new(FIM_NULL,false,arg); return FIM_ERR_NO_ERROR; } fim_err_t DisplayDevice::format_console(void) { #ifndef FIM_WANT_NO_OUTPUT_CONSOLE if(f_) { mc_.setRows ((height()/f_->sheight())/2); mc_.reformat( width() /f_->swidth() ); } else { mc_.setRows ( height()/2 ); mc_.reformat( get_chars_per_line() ); } #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ return FIM_ERR_NO_ERROR; } DisplayDevice::~DisplayDevice(void) { /* added in fim : fbi did not have this */ fim_free_fs_font(f_); } #if FIM_WANT_BENCHMARKS fim_int DisplayDevice::get_n_qbenchmarks(void)const { return 1; } string DisplayDevice::get_bresults_string(fim_int qbi, fim_int qbtimes, fim_fms_t qbttime)const { std::ostringstream oss; string msg; switch(qbi) { case 0: oss << "fim display check" << " : " << (float)(((fim_fms_t)(qbtimes*2))/((qbttime)*1.e-3)) << " clears/s\n"; msg=oss.str(); } return msg; } void DisplayDevice::quickbench_init(fim_int qbi) { switch(qbi) { case 0: std::cout << "fim display check" << " : " << "please be patient\n"; break; } } void DisplayDevice::quickbench_finalize(fim_int qbi) { } void DisplayDevice::quickbench(fim_int qbi) { /* a quick draw benchmark and sanity check. currently performs only the clear function. */ const fim_coo_t x1 = 0, x2 = width()-1, y1 = 0, y2 = height()-1; switch(qbi) { case 0: this->lock(); // clear_rect(x1, x2, y1, y2); fill_rect(x1, x2, y1, y2, FIM_CNS_WHITE); this->unlock(); this->lock(); fill_rect(x1, x2, y1, y2, FIM_CNS_BLACK); this->unlock(); break; } } #endif /* FIM_WANT_BENCHMARKS */ fim_err_t DisplayDevice::resize(fim_coo_t w, fim_coo_t h){return FIM_ERR_NO_ERROR;} fim_err_t DisplayDevice::reinit(const fim_char_t *rs){return FIM_ERR_NO_ERROR;} fim_err_t DisplayDevice::set_wm_caption(const fim_char_t *msg){return FIM_ERR_UNSUPPORTED;} fim_coo_t DisplayDevice::suggested_font_magnification(const fim_coo_t wf, const fim_coo_t hf)const { // suggests a font magnification until font is wider than 1/wf and taller than 1/hf wrt screen. // if a value is non positive, it will be ignored. fim_coo_t fmf = 1; if(wf>0 && hf<0) while ( wf * fmf * this->f_->width < this->width() ) ++fmf; if(wf<0 && hf>0) while ( hf * fmf * this->f_->height < this->height() ) ++fmf; if(wf>0 && hf>0) while ( wf * fmf * this->f_->width < this->width() && hf * fmf * this->f_->height < this->height() ) ++fmf; return fmf; } fim_err_t DisplayDevice::fs_putc(struct fs_font *f, fim_coo_t x, fim_coo_t y, const fim_char_t c) { fim_char_t s[2] = {c,FIM_SYM_CHAR_NUL}; return fs_puts(f, x, y, s); } void DisplayDevice::fs_multiline_puts(const char *str, fim_int doclear, int vw, int wh) { const int fh=this->f_ ? this->f_->sheight():1; // FIXME : this is not clean const int fw=this->f_ ? this->f_->swidth():1; // FIXME : this is not clean const int sl = strlen(str), rw = vw / fw; const int cpl = this->get_chars_per_line(); if(doclear && cpl) { const int lc = FIM_INT_FRAC(sl,cpl); /* lines count */ this->clear_rect(0, vw-1, 0, FIM_MIN(fh*lc,wh-1)); } for( int li = 0 ; sl > rw * li ; ++li ) if((li+1)*fhfs_puts(this->f_, 0, fh*li, str+rw*li); } fim-0.6-rc2/src/FramebufferDevice.cpp0000644000175000017500000013234614454347340014417 00000000000000/* $LastChangedDate: 2023-03-25 18:31:40 +0100 (Sat, 25 Mar 2023) $ */ /* FramebufferDevice.cpp : Linux Framebuffer functions from fbi, adapted for fim (c) 2007-2023 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #include "FbiStuffFbtools.h" #include "FramebufferDevice.h" #ifdef FIM_WITH_NO_FRAMEBUFFER static void foo(){} /* let's make our compiler happy */ #else /* FIM_WITH_NO_FRAMEBUFFER */ #if HAVE_LINUX_KD_H # include // KDGETMODE, KDSETMODE, KD_GRAPHICS, ... #endif /* HAVE_LINUX_KD_H */ #if HAVE_LINUX_VT_H # include // VT_GETSTATE, .. #endif /* HAVE_LINUX_VT_H */ #ifdef HAVE_SYS_USER_H # include // for PAGE_MASK (sometimes it is needed to include it here explicitly) #else /* HAVE_SYS_USER_H */ # error missing ! #endif /* HAVE_SYS_USER_H */ #ifdef HAVE_SYS_MMAN_H # include // PROT_READ, PROT_WRITE, MAP_SHARED #else /* HAVE_SYS_MMAN_H */ # error missing ! #endif /* HAVE_SYS_MMAN_H */ #include #ifdef HAVE_SYS_IOCTL_H # include #else /* HAVE_SYS_IOCTL_H */ # error missing ! #endif /* HAVE_SYS_IOCTL_H */ //#include //#include //#include //#include //#include /*#include */ /* seems like this gives problems */ #if 0 #include /* added in fim. missing when compiling with -ansi */ #include /* added in fim. missing when compiling with -ansi */ #endif namespace fim { extern fim_int fim_fmf_; /* FIXME */ #define FIM_DEBUGGING_FOR_ARM_WITH_VITALY 0 #define FIM_FBI_FB_MODES_LINE_BUFSIZE 80 #define FIM_FBI_FB_MODES_LABEL_BUFSIZE 32 #define FIM_FBI_FB_MODES_VALUE_BUFSIZE 16 /* this code will be enabled by default if we can make sure it won't break often with kernel updates */ #if FIM_DEBUGGING_FOR_ARM_WITH_VITALY static void print_vinfo(struct fb_var_screeninfo *vinfo) { FIM_FPRINTF(stderr, "Printing vinfo:\n"); FIM_FPRINTF(stderr, "\txres: %d\n", vinfo->xres); FIM_FPRINTF(stderr, "\tyres: %d\n", vinfo->yres); FIM_FPRINTF(stderr, "\txres_virtual: %d\n", vinfo->xres_virtual); FIM_FPRINTF(stderr, "\tyres_virtual: %d\n", vinfo->yres_virtual); FIM_FPRINTF(stderr, "\txoffset: %d\n", vinfo->xoffset); FIM_FPRINTF(stderr, "\tyoffset: %d\n", vinfo->yoffset); FIM_FPRINTF(stderr, "\tbits_per_pixel: %d\n", vinfo->bits_per_pixel); FIM_FPRINTF(stderr, "\tgrayscale: %d\n", vinfo->grayscale); FIM_FPRINTF(stderr, "\tnonstd: %d\n", vinfo->nonstd); FIM_FPRINTF(stderr, "\tactivate: %d\n", vinfo->activate); FIM_FPRINTF(stderr, "\theight: %d\n", vinfo->height); FIM_FPRINTF(stderr, "\twidth: %d\n", vinfo->width); FIM_FPRINTF(stderr, "\taccel_flags: %d\n", vinfo->accel_flags); FIM_FPRINTF(stderr, "\tpixclock: %d\n", vinfo->pixclock); FIM_FPRINTF(stderr, "\tleft_margin: %d\n", vinfo->left_margin); FIM_FPRINTF(stderr, "\tright_margin: %d\n", vinfo->right_margin); FIM_FPRINTF(stderr, "\tupper_margin: %d\n", vinfo->upper_margin); FIM_FPRINTF(stderr, "\tlower_margin: %d\n", vinfo->lower_margin); FIM_FPRINTF(stderr, "\thsync_len: %d\n", vinfo->hsync_len); FIM_FPRINTF(stderr, "\tvsync_len: %d\n", vinfo->vsync_len); FIM_FPRINTF(stderr, "\tsync: %d\n", vinfo->sync); FIM_FPRINTF(stderr, "\tvmode: %d\n", vinfo->vmode); FIM_FPRINTF(stderr, "\tred: %d/%d\n", vinfo->red.length, vinfo->red.offset); FIM_FPRINTF(stderr, "\tgreen: %d/%d\n", vinfo->green.length, vinfo->green.offset); FIM_FPRINTF(stderr, "\tblue: %d/%d\n", vinfo->blue.length, vinfo->blue.offset); FIM_FPRINTF(stderr, "\talpha: %d/%d\n", vinfo->transp.length, vinfo->transp.offset); } static void print_finfo(struct fb_fix_screeninfo *finfo) { FIM_FPRINTF(stderr, "Printing finfo:\n"); FIM_FPRINTF(stderr, "\tsmem_start = %p\n", (void *)finfo->smem_start); FIM_FPRINTF(stderr, "\tsmem_len = %d\n", finfo->smem_len); FIM_FPRINTF(stderr, "\ttype = %d\n", finfo->type); FIM_FPRINTF(stderr, "\ttype_aux = %d\n", finfo->type_aux); FIM_FPRINTF(stderr, "\tvisual = %d\n", finfo->visual); FIM_FPRINTF(stderr, "\txpanstep = %d\n", finfo->xpanstep); FIM_FPRINTF(stderr, "\typanstep = %d\n", finfo->ypanstep); FIM_FPRINTF(stderr, "\tywrapstep = %d\n", finfo->ywrapstep); FIM_FPRINTF(stderr, "\tline_length = %d\n", finfo->line_length); FIM_FPRINTF(stderr, "\tmmio_start = %p\n", (void *)finfo->mmio_start); FIM_FPRINTF(stderr, "\tmmio_len = %d\n", finfo->mmio_len); FIM_FPRINTF(stderr, "\taccel = %d\n", finfo->accel); } #endif /* FIM_DEBUGGING_FOR_ARM_WITH_VITALY */ #define DITHER_LEVEL 8 typedef unsigned long vector[DITHER_LEVEL]; typedef vector matrix[DITHER_LEVEL]; //#if DITHER_LEVEL == 8 || DITHER_LEVEL == 4 //static int matrix DM ; //#endif #if DITHER_LEVEL == 8 #define DITHER_MASK 7 static matrix DM = { {0, 32, 8, 40, 2, 34, 10, 42}, {48, 16, 56, 24, 50, 18, 58, 26}, {12, 44, 4, 36, 14, 46, 6, 38}, {60, 28, 52, 20, 62, 30, 54, 22}, {3, 35, 11, 43, 1, 33, 9, 41}, {51, 19, 59, 27, 49, 17, 57, 25}, {15, 47, 7, 39, 13, 45, 5, 37}, {63, 31, 55, 23, 61, 29, 53, 21} }; #endif /* DITHER_LEVEL */ #if DITHER_LEVEL == 4 #define DITHER_MASK 3 static matrix DM = { {0, 8, 2, 10}, {12, 4, 14, 6}, {3, 11, 1, 9}, {15, 7, 13, 5} }; #endif /* DITHER_LEVEL */ static FramebufferDevice *ffdp; static void _fb_switch_signal(int signal) { // WARNING : THIS IS A DIRTY HACK // necessary to enable framebuffer console switching ffdp->fb_switch_signal(signal); } fim_err_t FramebufferDevice::fs_puts(struct fs_font *f_, fim_coo_t x, fim_coo_t y, const fim_char_t *str) { fim_byte_t *pos,*start; #if 0 int j,w; #endif int i,c; #if FIM_FONT_MAGNIFY_FACTOR <= 0 const fim_int fim_fmf = fim::fim_fmf_; #endif /* FIM_FONT_MAGNIFY_FACTOR */ pos = fb_mem_+fb_mem_offset_; pos += fb_fix_.line_length * y; for (i = 0; str[i] != '\0'; i++) { c = (fim_byte_t)str[i]; if (FIM_NULL == f_->eindex[c]) continue; /* clear with bg color */ #if 0 start = pos + x*fs_bpp_ + f_->fontHeader.max_bounds.descent * fb_fix_.line_length; w = (f_->eindex[c]->width*fim_fmf+1)*fs_bpp_; #ifdef FIM_IS_SLOWER_THAN_FBI for (j = 0; j < f_->sheight(); j++) { ///// memset_combine(start,0x20,w); fim_bzero(start,w); start += fb_fix_.line_length; } #else /* FIM_IS_SLOWER_THAN_FBI */ //sometimes we can gather multiple calls.. if(fb_fix_.line_length==(unsigned int)w) { //contiguous case fim_bzero(start,w*f_->sheight()); start += fb_fix_.line_length*f_->sheight(); } else for (j = 0; j < f_->sheight(); j++) { fim_bzero(start,w); start += fb_fix_.line_length; } #endif /* FIM_IS_SLOWER_THAN_FBI */ /* draw character */ #endif start = pos + x*fs_bpp_ + fb_fix_.line_length * (f_->sheight()-fim_fmf*f_->eindex[c]->ascent); fs_render_fb(start,fb_fix_.line_length,f_->eindex[c],f_->gindex[c]); x += f_->eindex[c]->width*fim_fmf; if (0U + x > fb_var_.xres - f_->swidth()) return FIM_ERR_GENERIC; } return FIM_ERR_NO_ERROR; } void FramebufferDevice::fs_render_fb(fim_byte_t *ptr, int pitch, FSXCharInfo *charInfo, fim_byte_t *data) { /* * These preprocessor macros should serve *only* for font handling purposes. * */ #define BIT_ORDER BitmapFormatBitOrderMSB #ifdef BYTE_ORDER #undef BYTE_ORDER #endif /* BYTE_ORDER */ #define BYTE_ORDER BitmapFormatByteOrderMSB #define SCANLINE_UNIT BitmapFormatScanlineUnit8 #define SCANLINE_PAD BitmapFormatScanlinePad8 #define EXTENTS BitmapFormatImageRectMin #define SCANLINE_PAD_BYTES 1 #define GLWIDTHBYTESPADDED(bits, nBytes) \ ((nBytes) == 1 ? (((bits) + 7) >> 3) /* pad to 1 byte */\ :(nBytes) == 2 ? ((((bits) + 15) >> 3) & ~1) /* pad to 2 bytes */\ :(nBytes) == 4 ? ((((bits) + 31) >> 3) & ~3) /* pad to 4 bytes */\ :(nBytes) == 8 ? ((((bits) + 63) >> 3) & ~7) /* pad to 8 bytes */\ : 0) int row,bit,bpr,x; #if FIM_FONT_MAGNIFY_FACTOR <= 0 const fim_int fim_fmf = fim::fim_fmf_; #endif /* FIM_FONT_MAGNIFY_FACTOR */ bpr = GLWIDTHBYTESPADDED((charInfo->right - charInfo->left), SCANLINE_PAD_BYTES); for (row = 0; row < (charInfo->ascent + charInfo->descent); row++) { for (x = 0, bit = 0; bit < (charInfo->right - charInfo->left); bit++) { if (data[bit>>3] & fs_masktab[bit&7]) // WARNING ! #if FIM_FONT_MAGNIFY_FACTOR == 1 fs_setpixel(ptr+x,fs_white_); #else /* FIM_FONT_MAGNIFY_FACTOR */ for(fim_coo_t mi = 0; mi < fim_fmf; ++mi) for(fim_coo_t mj = 0; mj < fim_fmf; ++mj) fs_setpixel(ptr+((fim_fmf*x+mj*FB_BPP)+(mi)*pitch),fs_white_); #endif /* FIM_FONT_MAGNIFY_FACTOR */ x += fs_bpp_; } data += bpr; ptr += pitch*fim_fmf; } #undef BIT_ORDER #undef BYTE_ORDER #undef SCANLINE_UNIT #undef SCANLINE_PAD #undef EXTENTS #undef SCANLINE_PAD_BYTES #undef GLWIDTHBYTESPADDED } fim_err_t FramebufferDevice::framebuffer_init(const bool try_boz_patch) { int rc=0; //initialization of the framebuffer text FontServer::fb_text_init1(fontname_,&f_); // FIXME : move this outta here /* * will initialize with the user set (or default ones) * - framebuffer device * - framebuffer mode * - virtual terminal * */ fd_ = fb_init(fbdev_, fbmode_, vt_); if(fd_==-1 && !try_boz_patch) return FIM_ERR_GENERIC; if(fd_==-1) fd_ = fb_init(fbdev_, fbmode_, vt_, try_boz_patch);//maybe we are under screen.. if(fd_==-1) exit(1); //return -1;//this is a TEMPORARY and DEAF,DUMB, AND BLIND bug noted by iam //setting signals to handle in the right ways signals fb_catch_exit_signals(); fb_switch_init(); /* * C-z is inhibited now (for framebuffer's screen safety!) */ signal(SIGTSTP,SIG_IGN); //signal(SIGSEGV,cleanup(); //set text color to white ? //initialization of the framebuffer device handlers if((rc=fb_text_init2()))return rc; switch (fb_var_.bits_per_pixel) { case 8: svga_dither_palette(8, 8, 4); dither_ = FIM_FBI_TRUE; init_dither(8, 8, 4, 2); break; case 15: case 16: if (fb_fix_.visual == FB_VISUAL_DIRECTCOLOR) linear_palette(5); if (fb_var_.green.length == 5) { lut_init(15); } else { lut_init(16); } break; case 24: if (fb_fix_.visual == FB_VISUAL_DIRECTCOLOR) linear_palette(8); break; case 32: if (fb_fix_.visual == FB_VISUAL_DIRECTCOLOR) linear_palette(8); lut_init(24); break; default: FIM_FPRINTF(stderr, "Oops: %i bit/pixel ???\n", fb_var_.bits_per_pixel); std::exit(1); } if (fb_fix_.visual == FB_VISUAL_DIRECTCOLOR || fb_var_.bits_per_pixel == 8) { if (-1 == ioctl(fd_,FBIOPUTCMAP,&cmap_)) { fim_perror("ioctl FBIOPUTCMAP"); std::exit(1); } } return FIM_ERR_NO_ERROR; } void FramebufferDevice::dev_init(void) { fim_stat_t dummy; if (FIM_NULL != devices_) return; #if HAVE_SYS_STAT_H if (0 == stat("/dev/.devfsd",&dummy)) devices_ = &devs_devfs_; else #endif /* HAVE_SYS_STAT_H */ devices_ = &devs_default_; } void FramebufferDevice::console_switch(fim_bool_t is_busy) { //FIXME switch (fb_switch_state_) { case FB_REL_REQ: fb_switch_release(); case FB_INACTIVE: visible_ = 0; break; case FB_ACQ_REQ: fb_switch_acquire(); case FB_ACTIVE: //when stepping in console.. visible_ = 1; ioctl(fd_,FBIOPAN_DISPLAY,&fb_var_); redraw_ = FIM_REDRAW_NECESSARY; /* * we use to redraw on console switch here; not anymore; */ //mc_.cc_.redisplay(); // fbi used to redraw now //if (is_busy) status("busy, please wait ...", FIM_NULL); break; default: break; } switch_last_ = fb_switch_state_; return; } //void FramebufferDevice::svga_display_image_new(struct ida_image *img, int xoff, int yoff,unsigned int bx,unsigned int bw,unsigned int by,unsigned int bh,int mirror,int flip) void FramebufferDevice::svga_display_image_new( const struct ida_image *img, int yoff, int xoff, int irows,int icols,// rows and columns in the input image int icskip, // input columns to skip for each line unsigned int by, unsigned int bx, unsigned int bh, unsigned int bw, int ocskip,// output columns to skip for each line int flags) FIM_NOEXCEPT { /* bx is the box's x origin * by is the box's y origin * bw is the box's width * bh is the box's heigth * */ /* * WARNING : SHOULD ASSeRT BX+BW < FB_VAR.XReS ..!! * */ unsigned int dwidth = FIM_MIN(img->i.width, bw); unsigned int dheight = FIM_MIN(img->i.height, bh); unsigned int data, video, /*bank,*/ offset, /*bytes,*/ y; int yo=(bh-dheight)/2; int xo=(bw-dwidth )/2; int cxo=bw-dwidth-xo; //int cyo=bh-yo; int mirror=flags&FIM_FLAG_MIRROR, flip=flags&FIM_FLAG_FLIP; if (!visible_)/*COMMENT THIS IF svga_display_image IS NOT IN A CYCLE*/ return; /*fb_clear_screen();//EXPERIMENTAL if(xoff&&yoff)clear_rect(0,xoff,0,yoff);*/ //bytes = FB_BPP; /* offset for image data (image > screen, select visible area) */ offset = (yoff * img->i.width + xoff) * 3; /* offset for video memory (image < screen, center image) */ video = 0;//, bank = 0; video += FB_BPP * (bx); if (img->i.width < bw) { video += FB_BPP * (xo); } video += fb_fix_.line_length * (by); if (img->i.height < bh ) { video += fb_fix_.line_length * (yo); } if (dheight < bh ) { /* clear by lines */ #ifdef FIM_FASTER_CLEARLINES if(bw==fb_var_.xres && bx==0) { /* * +------------------------------+ * | whole screen line clear join | * +------------------------------+ */ // wide screen clear { clear_line(FB_BPP, by, bw*(bh), FB_MEM(bx,by)); } //top and bottom lines clear : maybe better //{ clear_line(FB_BPP, by, bw*(yo), FB_MEM(bx,by)); } //{ clear_line(FB_BPP, by+yo, bw*(dheight), FB_MEM(bx,by+yo)); } //{ clear_line(FB_BPP, by+dheight+yo, bw*(bh-yo-dheight), FB_MEM(bx,by+yo+dheight)); } } else #endif /* FIM_FASTER_CLEARLINES */ { for ( y = by; y < by+yo;++y) { clear_line(FB_BPP, y, bw, FB_MEM(bx,y)); } for ( y = by+dheight+yo; y < by+bh;++y) { clear_line(FB_BPP, y, bw, FB_MEM(bx,y)); } } } if (dwidth < bw ) { #ifdef FIM_FASTER_CLEARLINES if(bw==fb_var_.xres && bx==0) { if (dheight >= bh ) clear_line(FB_BPP, by, bw*(bh), FB_MEM(bx,by)); } else #endif /* FIM_FASTER_CLEARLINES */ for ( y = by; y < by+bh;++y) { clear_line(FB_BPP, y, xo, FB_MEM(bx,y)); clear_line(FB_BPP, y, cxo,FB_MEM(bx+xo+dwidth,y)); } } /*for ( y = 0; y < fb_var_.yres;y+=100)fb_line(0, fb_var_.xres, y, y);*/ /* go ! */ /*flip patch*/ #ifndef min #define min(x,y) ((x)<(y)?(x):(y)) #endif /* min */ //int fb_fix_line_length=FB_MEM_LINE_OFFSET; int fb_fix_line_length=fb_fix_.line_length; if(flip) { fb_fix_line_length*=-1; video += (min(img->i.height,dheight)-1)*(fb_fix_.line_length);} /*flip patch*/ /* FIXME : COMPLETE ME ... */ #ifndef FIM_IS_SLOWER_THAN_FBI fim_byte_t *(FramebufferDevice::*convert_line_f)(int , int , int , fim_byte_t *, fim_byte_t *, int ); if(fb_var_.bits_per_pixel==8) convert_line_f=&fim::FramebufferDevice::convert_line_8; else convert_line_f=&fim::FramebufferDevice::convert_line; #endif /* FIM_IS_SLOWER_THAN_FBI */ fim_pxc_t pc = fbi_img_pixel_bytes(img); for (data = 0, y = by; data < pc && data / img->i.width / 3 < dheight; data += img->i.width * 3, video += fb_fix_line_length) { #ifndef FIM_IS_SLOWER_THAN_FBI (this->*convert_line_f) #else convert_line #endif /* FIM_IS_SLOWER_THAN_FBI */ (fb_var_.bits_per_pixel, y++, dwidth, fb_mem_+video, img->data + data + offset,mirror);/*<- mirror patch*/ } } int FramebufferDevice::fb_init(const fim_char_t *device, fim_char_t *mode, int vt, int try_boz_patch) { /* * This member function will probe for a valid framebuffer device. * * The try_boz_patch will make framebuffer fim go straight ahead ignoring lots of errors. * Like the ones when running fim under screen. * Like the ones when running fim under X. * */ fim_char_t fbdev[FIM_FBDEV_FILE_MAX_CHARS]; struct vt_stat vts; dev_init(); tty_ = 0; if (vt != 0) fb_setvt(vt); #ifdef FIM_BOZ_PATCH if(!try_boz_patch) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty_,VT_GETSTATE, &vts)) { FIM_FPRINTF(stderr, "ioctl VT_GETSTATE: %s (not a linux console?)\n", strerror(errno)); return -1; } /* no device supplied ? we probe for one */ if (FIM_NULL == device) { device = fim_getenv(FIM_ENV_FRAMEBUFFER); /* no environment - supplied device ? */ if (FIM_NULL == device) { struct fb_con2fbmap c2m; if (-1 == (fb_ = open(devices_->fb0,O_RDWR /* O_WRONLY */,0))) { FIM_FPRINTF(stderr, "open %s: %s\n",devices_->fb0,strerror(errno)); fim_perror(FIM_NULL); exit(1); } c2m.console = vts.v_active; #ifdef FIM_BOZ_PATCH if(!try_boz_patch){ #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(fb_, FBIOGET_CON2FBMAP, &c2m)) { fim_perror("ioctl FBIOGET_CON2FBMAP"); exit(1); } close(fb_); /* FIM_FPRINTF(stderr, "map: vt%02d => fb%d\n", c2m.console,c2m.framebuffer);*/ sprintf(fbdev,devices_->fbnr,c2m.framebuffer); device = fbdev; #ifdef FIM_BOZ_PATCH } else device = "/dev/fb0"; #endif /* FIM_BOZ_PATCH */ } } /* get current settings (which we have to restore) */ if (-1 == (fb_ = open(device,O_RDWR /* O_WRONLY */))) { FIM_FPRINTF(stderr, "open %s: %s\n",device,strerror(errno)); fim_perror(FIM_NULL); exit(1); } if (-1 == ioctl(fb_,FBIOGET_VSCREENINFO,&fb_ovar_)) { fim_perror("ioctl FBIOGET_VSCREENINFO"); exit(1); } #if FIM_DEBUGGING_FOR_ARM_WITH_VITALY print_vinfo(&fb_ovar_); #endif /* FIM_DEBUGGING_FOR_ARM_WITH_VITALY */ if (-1 == ioctl(fb_,FBIOGET_FSCREENINFO,&fb_fix_)) { fim_perror("ioctl FBIOGET_FSCREENINFO"); exit(1); } #if FIM_DEBUGGING_FOR_ARM_WITH_VITALY print_finfo(&fb_fix_); #endif /* FIM_DEBUGGING_FOR_ARM_WITH_VITALY */ if (fb_ovar_.bits_per_pixel == 8 || fb_fix_.visual == FB_VISUAL_DIRECTCOLOR) { if (-1 == ioctl(fb_,FBIOGETCMAP,&ocmap_)) { fim_perror("ioctl FBIOGETCMAP"); exit(1); } } #ifdef FIM_BOZ_PATCH if(!try_boz_patch) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty_,KDGETMODE, &kd_mode_)) { fim_perror("ioctl KDGETMODE"); exit(1); } #ifdef FIM_BOZ_PATCH if(!try_boz_patch) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty_,VT_GETMODE, &vt_omode_)) { fim_perror("ioctl VT_GETMODE"); exit(1); } tcgetattr(tty_, &term_); /* switch mode */ if(-1 == fb_setmode(mode)){ #if 0 /* * FIXME: * mm's strict mode checking (right now, this function triggers an exit() but things should change) */ #ifdef FIM_BOZ_PATCH if(!try_boz_patch) #endif /* FIM_BOZ_PATCH */ { fim_perror("failed setting mode"); exit(1); } #endif } /* checks & initialisation */ if (-1 == ioctl(fb_,FBIOGET_FSCREENINFO,&fb_fix_)) { fim_perror("ioctl FBIOGET_FSCREENINFO"); exit(1); } if (fb_fix_.type != FB_TYPE_PACKED_PIXELS) { FIM_FPRINTF(stderr, "can handle only packed pixel frame buffers\n"); goto err; } #if 0 switch (fb_var_.bits_per_pixel) { case 8: white = 255; black = 0; bpp = 1; break; case 15: case 16: if (fb_var_.green.length == 6) white = 0xffff; else white = 0x7fff; black = 0; bpp = 2; break; case 24: white = 0xffffff; black = 0; bpp = fb_var_.bits_per_pixel/8; break; case 32: white = 0xffffff; black = 0; bpp = fb_var_.bits_per_pixel/8; fb_setpixels = fb_setpixels4; break; default: FIM_FPRINTF(stderr, "Oops: %i bit/pixel ???\n", fb_var_.bits_per_pixel); goto err; } #endif #ifdef PAGE_MASK fb_mem_offset_ = (fb_fix_.smem_start) & (~PAGE_MASK); #else /* PAGE_MASK */ /* some systems don't have this symbol outside their kernel headers - will do any harm ? */ /* FIXME : what are the wider implications of this ? */ fb_mem_offset_ = 0; #endif /* PAGE_MASK */ fb_mem_ = (fim_byte_t*) mmap(FIM_NULL,fb_fix_.smem_len+fb_mem_offset_, PROT_READ|PROT_WRITE,MAP_SHARED,fb_,0); #ifdef MAP_FAILED if (fb_mem_ == MAP_FAILED) #else if (-1L == static_castfb_mem_) #endif { fim_perror("mmap failed"); goto err; } /* move viewport to upper left corner */ if (fb_var_.xoffset != 0 || fb_var_.yoffset != 0) { fb_var_.xoffset = 0; fb_var_.yoffset = 0; if (-1 == ioctl(fb_,FBIOPAN_DISPLAY,&fb_var_)) { fim_perror("ioctl FBIOPAN_DISPLAY"); goto err; } } #ifdef FIM_BOZ_PATCH if(!try_boz_patch) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty_,KDSETMODE, KD_GRAPHICS)) { fim_perror("ioctl KDSETMODE"); goto err; } fb_activate_current(tty_); /* cls */ fb_memset(fb_mem_+fb_mem_offset_,0,fb_fix_.smem_len); #ifdef FIM_BOZ_PATCH with_boz_patch_=try_boz_patch; #endif /* FIM_BOZ_PATCH */ return fb_; err: cleanup(); exit(1); return -1; } void FramebufferDevice::fb_memset (void *addr, int c, size_t len) { #if 1 /* defined(__powerpc__) */ unsigned int i; i = (c & 0xff) << 8; i |= i << 16; #ifdef FIM_IS_SLOWER_THAN_FBI len >>= 2; unsigned int *p; for (p = (unsigned int*) addr; len--; p++) *p = i; #else /* FIM_IS_SLOWER_THAN_FBI */ fim_memset(addr, c, len ); #endif /* FIM_IS_SLOWER_THAN_FBI */ #else fim_memset(addr, c, len); #endif } void FramebufferDevice::fb_setvt(int vtno) { struct vt_stat vts; fim_char_t vtname[12]; if (vtno < 0) { if (-1 == ioctl(tty_,VT_OPENQRY, &vtno) || vtno == -1) { fim_perror("ioctl VT_OPENQRY"); exit(1); } } vtno &= 0xff; sprintf(vtname, devices_->ttynr, vtno); if ( chown(vtname, getuid(), getgid())){ FIM_FPRINTF(stderr, "chown %s: %s\n",vtname,strerror(errno)); exit(1); } if (-1 == access(vtname, R_OK | W_OK)) { FIM_FPRINTF(stderr, "access %s: %s\n",vtname,strerror(errno)); exit(1); } switch (fork()) { case 0: break; case -1: fim_perror("fork"); exit(1); default: exit(0); } close(tty_); close(0); close(1); close(2); setsid(); if( -1 == open(vtname,O_RDWR) ) { fim_perror(FIM_NULL); } { /* on some systems, we get 'int dup(int)', declared with attribute warn_unused_result */ int ndd; ndd = dup(0); ndd+= dup(0); } #ifdef FIM_BOZ_PATCH if(!with_boz_patch_) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty_,VT_GETSTATE, &vts)) { fim_perror("ioctl VT_GETSTATE"); exit(1); } orig_vt_no_ = vts.v_active; if (-1 == ioctl(tty_,VT_ACTIVATE, vtno)) { fim_perror("ioctl VT_ACTIVATE"); exit(1); } if (-1 == ioctl(tty_,VT_WAITACTIVE, vtno)) { fim_perror("ioctl VT_WAITACTIVE"); exit(1); } } int FramebufferDevice::fb_setmode(fim_char_t const * const name) { FILE *fp; fim_char_t line[FIM_FBI_FB_MODES_LINE_BUFSIZE], label[FIM_FBI_FB_MODES_LABEL_BUFSIZE], value[FIM_FBI_FB_MODES_VALUE_BUFSIZE]; int geometry=0, timings=0; /* load current values */ if (-1 == ioctl(fb_,FBIOGET_VSCREENINFO,&fb_var_)) { fim_perror("ioctl FBIOGET_VSCREENINFO"); exit(1); } /* example name="640x480-72"; */ if (FIM_NULL == name) { goto nerr; } if (FIM_NULL == (fp = fopen("/etc/fb.modes","r"))) { goto nerr; } while (FIM_NULL != fgets(line,FIM_FBI_FB_MODES_LINE_BUFSIZE-1,fp)) { if (1 == sscanf(line, "mode \"%31[^\"]\"",label) && 0 == strcmp(label,name)) { /* fill in new values */ fb_var_.sync = 0; fb_var_.vmode = 0; while (FIM_NULL != fgets(line,FIM_FBI_FB_MODES_LINE_BUFSIZE-1,fp) && FIM_NULL == strstr(line,"endmode")) { // if (5 == sscanf(line," geometry %d %d %d %d %d", if (5 == sscanf(line," geometry %u %u %u %u %u", &fb_var_.xres,&fb_var_.yres, &fb_var_.xres_virtual,&fb_var_.yres_virtual, &fb_var_.bits_per_pixel)) geometry = 1; // if (7 == sscanf(line," timings %d %d %d %d %d %d %d", if (7 == sscanf(line," timings %u %u %u %u %u %u %u", &fb_var_.pixclock, &fb_var_.left_margin, &fb_var_.right_margin, &fb_var_.upper_margin, &fb_var_.lower_margin, &fb_var_.hsync_len, &fb_var_.vsync_len)) timings = 1; if (1 == sscanf(line, " hsync %15s",value) && 0 == strcasecmp(value,"high")) fb_var_.sync |= FB_SYNC_HOR_HIGH_ACT; if (1 == sscanf(line, " vsync %15s",value) && 0 == strcasecmp(value,"high")) fb_var_.sync |= FB_SYNC_VERT_HIGH_ACT; if (1 == sscanf(line, " csync %15s",value) && 0 == strcasecmp(value,"high")) fb_var_.sync |= FB_SYNC_COMP_HIGH_ACT; if (1 == sscanf(line, " extsync %15s",value) && 0 == strcasecmp(value,"true")) fb_var_.sync |= FB_SYNC_EXT; if (1 == sscanf(line, " laced %15s",value) && 0 == strcasecmp(value,"true")) fb_var_.vmode |= FB_VMODE_INTERLACED; if (1 == sscanf(line, " double %15s",value) && 0 == strcasecmp(value,"true")) fb_var_.vmode |= FB_VMODE_DOUBLE; } /* ok ? */ if (!geometry || !timings) goto err; /* set */ fb_var_.xoffset = 0; fb_var_.yoffset = 0; if (-1 == ioctl(fb_,FBIOPUT_VSCREENINFO,&fb_var_)) fim_perror("ioctl FBIOPUT_VSCREENINFO"); /* * FIXME * mm : this should be placed here and uncommented : */ /* if (-1 == ioctl(fb_,FBIOGET_FSCREENINFO,&fb_fix_)) { fim_perror("ioctl FBIOGET_VSCREENINFO"); exit(1); }*/ /* look what we have now ... */ if (-1 == ioctl(fb_,FBIOGET_VSCREENINFO,&fb_var_)) { fim_perror("ioctl FBIOGET_VSCREENINFO"); exit(1); } goto ret; } } err: return -1; nerr: // not really an error ret: return 0; } int FramebufferDevice::fb_activate_current(int tty) { /* Hmm. radeonfb needs this. matroxfb doesn't. (<- fbi comment) */ struct vt_stat vts; #ifdef FIM_BOZ_PATCH if(!with_boz_patch_) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty,VT_GETSTATE, &vts)) { fim_perror("ioctl VT_GETSTATE"); goto err; } #ifdef FIM_BOZ_PATCH if(!with_boz_patch_) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty,VT_ACTIVATE, vts.v_active)) { fim_perror("ioctl VT_ACTIVATE"); goto err; } #ifdef FIM_BOZ_PATCH if(!with_boz_patch_) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty,VT_WAITACTIVE, vts.v_active)) { fim_perror("ioctl VT_WAITACTIVE"); goto err; } return 0; err: return -1; } fim_err_t FramebufferDevice::status_line(const fim_char_t *msg) { int y; if (!visible_) goto ret; if(fb_var_.yres< 1U + f_->sheight() + ys_) /* we need enough pixels, and have no assumptions on weird visualization devices_ */ goto rerr; y = fb_var_.yres -1 - f_->sheight() - ys_; // fb_memset(fb_mem_ + fb_fix_.line_length * y, 0, fb_fix_.line_length * (f_->height+ys_)); clear_rect(0, fb_var_.xres-1, y+1,y+f_->sheight()+ys_); fb_line(0, fb_var_.xres, y, y); fs_puts(f_, 0, y+ys_, msg); ret: return FIM_ERR_NO_ERROR; rerr: return FIM_ERR_GENERIC; } void FramebufferDevice::fb_text_box(int x, int y, fim_char_t *lines[], unsigned int count) { unsigned int i,len,max, x1, x2, y1, y2; if (!visible_) goto err; max = 0; for (i = 0; i < count; i++) { len = strlen(lines[i]); if (max < len) max = len; } x1 = x; x2 = x + max * f_->width; y1 = y; y2 = y + count * f_->height; x += xs_; x2 += 2*xs_; y += ys_; y2 += 2*ys_; clear_rect(x1, x2, y1, y2); fb_rect(x1, x2, y1, y2); for (i = 0; i < count; i++) { fs_puts(f_,x,y,(const fim_char_t*)lines[i]); y += f_->height; } err: return; } void FramebufferDevice::fb_line(int x1, int x2, int y1,int y2) { /*static void fb_line(int x1, int x2, int y1,int y2)*/ int x,y,h; float inc; if (x2 < x1) h = x2, x2 = x1, x1 = h; if (y2 < y1) h = y2, y2 = y1, y1 = h; if (x2 - x1 < y2 - y1) { inc = (float)(x2-x1)/(float)(y2-y1); for (y = y1; y <= y2; y++) { x = x1 + (int)(inc * (float)(y - y1)); fb_setpixel(x,y,fs_white_); } } else { inc = (float)(y2-y1)/(float)(x2-x1); for (x = x1; x <= x2; x++) { y = y1 + (int)(inc * (float)(x - x1)); fb_setpixel(x,y,fs_white_); } } } void FramebufferDevice::fb_rect(int x1, int x2, int y1,int y2) { fb_line(x1, x2, y1, y1); fb_line(x1, x2, y2, y2); fb_line(x1, x1, y1, y2); fb_line(x2, x2, y1, y2); } void FramebufferDevice::fb_setpixel(int x, int y, unsigned int color) { fim_byte_t *ptr; ptr = fb_mem_; ptr += y * fb_fix_.line_length; ptr += x * fs_bpp_; fs_setpixel(ptr, color); } void FramebufferDevice::fb_clear_rect(int x1, int x2, int y1,int y2) { fim_byte_t *ptr; int y,h; if (!visible_) goto ret; if (x2 < x1) h = x2, x2 = x1, x1 = h; if (y2 < y1) h = y2, y2 = y1, y1 = h; ptr = fb_mem_; ptr += y1 * fb_fix_.line_length; ptr += x1 * fs_bpp_; for (y = y1; y <= y2; y++) { fb_memset(ptr, 0, (x2 - x1 + 1) * fs_bpp_); ptr += fb_fix_.line_length; } ret: return; } void FramebufferDevice::clear_screen(void) { if (visible_) fb_memset(fb_mem_,0,fb_fix_.smem_len); } void FramebufferDevice::cleanup(void) { /* restore console */ if (-1 == ioctl(fb_,FBIOPUT_VSCREENINFO,&fb_ovar_)) fim_perror("ioctl FBIOPUT_VSCREENINFO"); if (-1 == ioctl(fb_,FBIOGET_FSCREENINFO,&fb_fix_)) fim_perror("ioctl FBIOGET_FSCREENINFO"); #if 0 printf("id:%s\t%ld\t%ld\t%ld\t\n",fb_fix_.id,fb_fix_.accel,fb_fix_.xpanstep,fb_fix_.xpanstep); #endif if (fb_ovar_.bits_per_pixel == 8 || fb_fix_.visual == FB_VISUAL_DIRECTCOLOR) { if (-1 == ioctl(fb_,FBIOPUTCMAP,&ocmap_)) fim_perror("ioctl FBIOPUTCMAP"); } close(fb_); #ifdef FIM_BOZ_PATCH if(!with_boz_patch_) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty_,KDSETMODE, kd_mode_)) fim_perror("ioctl KDSETMODE"); #ifdef FIM_BOZ_PATCH if(!with_boz_patch_) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty_,VT_SETMODE, &vt_omode_)) fim_perror("ioctl VT_SETMODE"); if (orig_vt_no_ && -1 == ioctl(tty_, VT_ACTIVATE, orig_vt_no_)) fim_perror("ioctl VT_ACTIVATE"); if (orig_vt_no_ && -1 == ioctl(tty_, VT_WAITACTIVE, orig_vt_no_)) fim_perror("ioctl VT_WAITACTIVE"); // there's no need to restore the tty : this is performed outside ( 20081221 ) //tcsetattr(tty_, TCSANOW, &term_); //close(tty_); } fim_byte_t * FramebufferDevice::convert_line_8(int bpp, int line, int owidth, fim_byte_t *dst, fim_byte_t *buffer, int mirror) FIM_NOEXCEPT/*fim mirror patch*/ { fim_byte_t *ptr = (fim_byte_t *)dst; dither_line(buffer, ptr, line, owidth, mirror); ptr += owidth; return ptr; } fim_byte_t * FramebufferDevice::convert_line(int bpp, int line, int owidth, fim_byte_t *dst, fim_byte_t *buffer, int mirror) FIM_NOEXCEPT/*fim mirror patch*/ { fim_byte_t *ptr = (fim_byte_t *)dst; unsigned short *ptr2 = (unsigned short*)dst; unsigned int *ptr4 = (unsigned int *)dst; int x; int xm;/*fim mirror patch*/ switch (fb_var_.bits_per_pixel) { case 8: dither_line(buffer, ptr, line, owidth, mirror); ptr += owidth; return ptr; case 15: case 16: #ifdef FIM_IS_SLOWER_THAN_FBI /*swapped RGB patch*/ for (x = 0; x < owidth; x++) { xm=mirror?owidth-1-x:x; ptr2[xm] = lut_red_[buffer[x*3]] | lut_green_[buffer[x*3+1]] | lut_blue_[buffer[x*3+2]]; } #else /* FIM_IS_SLOWER_THAN_FBI */ if(FIM_LIKELY(!mirror)) for (x = 0; x < owidth; x++) { ptr2[x] = lut_red_[buffer[x*3+2]] | lut_green_[buffer[x*3+1]] | lut_blue_[buffer[x*3]]; } else for (x = 0,xm=owidth; x < owidth; x++) { xm--; ptr2[xm] = lut_red_[buffer[x*3+2]] | lut_green_[buffer[x*3+1]] | lut_blue_[buffer[x*3]]; } #endif /* FIM_IS_SLOWER_THAN_FBI */ ptr2 += owidth; return (fim_byte_t*)ptr2; case 24: #ifdef FIM_IS_SLOWER_THAN_FBI for (x = 0; x < owidth; x++) { xm=mirror?owidth-1-x:x; ptr[3*xm+2] = buffer[3*x+0]; ptr[3*xm+1] = buffer[3*x+1]; ptr[3*xm+0] = buffer[3*x+2]; } #else /* FIM_IS_SLOWER_THAN_FBI */ /*swapped RGB patch*/ if(FIM_LIKELY(!mirror)) { /* * this code could be faster if using processor specific routines.. * ... or maybe even not ? */ //owidth*=3; #if 0 for (x = 0; x < owidth; x+=3) { ptr[x+2] = buffer[x+0]; ptr[x+1] = buffer[x+1]; ptr[x+0] = buffer[x+2]; } #else /* * this is far worse than the preceding ! */ memcpy(ptr,buffer,owidth*3); //FIM_REGISTER fim_char_t t; //FIM_REGISTER i=x; /*since RGB and GBR swap already done, this is not necessary*/ /*for (i = 0; i < owidth; i+=3) { t=ptr[i]; ptr[i]=ptr[i+2]; ptr[i+2]=t; }*/ #endif //owidth/=3; } else for (x = 0; x < owidth; x++) { x*=3; xm=3*owidth-x-3; ptr[xm+2] = buffer[x+2]; ptr[xm+1] = buffer[x+1]; ptr[xm+0] = buffer[x+0]; x/=3; } #endif ptr += owidth * 3; return ptr; case 32: #ifndef FIM_IS_SLOWER_THAN_FBI /*swapped RGB patch*/ for (x = 0; x < owidth; x++) { xm=mirror?owidth-1-x:x; ptr4[xm] = lut_red_[buffer[x*3+2]] | lut_green_[buffer[x*3+1]] | lut_blue_[buffer[x*3]]; } #else /* FIM_IS_SLOWER_THAN_FBI */ if(FIM_LIKELY(!mirror)) for (x = 0; x < owidth; x++) { ptr4[x] = lut_red_[buffer[x*3]] | lut_green_[buffer[x*3+1]] | lut_blue_[buffer[x*3+2]]; } else for (x = 0; x < owidth; x++) { ptr4[owidth-1-x] = lut_red_[buffer[x*3]] | lut_green_[buffer[x*3+1]] | lut_blue_[buffer[x*3+2]]; } #endif /* FIM_IS_SLOWER_THAN_FBI */ ptr4 += owidth; return (fim_byte_t*)ptr4; default: /* keep compiler happy */ return FIM_NULL; } } fim_byte_t * FramebufferDevice::clear_line(int bpp, int line, int owidth, fim_byte_t *dst) FIM_NOEXCEPT { fim_byte_t *ptr = (fim_byte_t*)dst; unsigned short *ptr2 = (unsigned short*)dst; unsigned int *ptr4 = (unsigned int*)dst; unsigned clear_byte=0x00; #ifdef FIM_IS_SLOWER_THAN_FBI int x; #endif /* FIM_IS_SLOWER_THAN_FBI */ switch (fb_var_.bits_per_pixel) { case 8: fim_bzero(ptr, owidth); ptr += owidth; return ptr; case 15: case 16: #ifdef FIM_IS_SLOWER_THAN_FBI for (x = 0; x < owidth; x++) { ptr2[x] = 0x0; } #else /* FIM_IS_SLOWER_THAN_FBI */ std::fill_n(ptr,2*owidth,clear_byte); #endif /* FIM_IS_SLOWER_THAN_FBI */ ptr2 += owidth; return (fim_byte_t*)ptr2; case 24: #ifdef FIM_IS_SLOWER_THAN_FBI for (x = 0; x < owidth; x++) { ptr[3*x+2] = 0x0; ptr[3*x+1] = 0x0; ptr[3*x+0] = 0x0; } #else /* FIM_IS_SLOWER_THAN_FBI */ std::fill_n(ptr,3*owidth,clear_byte); #endif /* FIM_IS_SLOWER_THAN_FBI */ ptr += owidth * 3; return ptr; case 32: #ifdef FIM_IS_SLOWER_THAN_FBI for (x = 0; x < owidth; x++) { ptr4[x] = 0x0; } #else /* FIM_IS_SLOWER_THAN_FBI */ std::fill_n(ptr,4*owidth,clear_byte); #endif /* FIM_IS_SLOWER_THAN_FBI */ ptr4 += owidth; return (fim_byte_t*)ptr4; default: /* keep compiler happy */ return FIM_NULL; } } void FramebufferDevice::init_dither(int shades_r, int shades_g, int shades_b, int shades_gray) { int i, j; fim_byte_t low_shade, high_shade; unsigned short index; float red_colors_per_shade; float green_colors_per_shade; float blue_colors_per_shade; float gray_colors_per_shade; red_mult_ = shades_g * shades_b; green_mult_ = shades_b; red_colors_per_shade = 256.0 / (shades_r - 1); green_colors_per_shade = 256.0 / (shades_g - 1); blue_colors_per_shade = 256.0 / (shades_b - 1); gray_colors_per_shade = 256.0 / (shades_gray - 1); /* this avoids a shift when checking these values */ for (i = 0; i < DITHER_LEVEL; i++) for (j = 0; j < DITHER_LEVEL; j++) DM[i][j] *= 0x10000; /* setup arrays containing three bytes of information for red, green, & blue */ /* the arrays contain : * 1st byte: low end shade value * 2nd byte: high end shade value * 3rd & 4th bytes: ordered dither matrix index */ for (i = 0; i < 256; i++) { /* setup the red information */ { low_shade = (fim_byte_t) (i / red_colors_per_shade); high_shade = low_shade + 1; index = (unsigned short) (((i - low_shade * red_colors_per_shade) / red_colors_per_shade) * (DITHER_LEVEL * DITHER_LEVEL + 1)); low_shade *= red_mult_; high_shade *= red_mult_; red_dither_[i] = (index << 16) + (high_shade << 8) + (low_shade); } /* setup the green information */ { low_shade = (fim_byte_t) (i / green_colors_per_shade); high_shade = low_shade + 1; index = (unsigned short) (((i - low_shade * green_colors_per_shade) / green_colors_per_shade) * (DITHER_LEVEL * DITHER_LEVEL + 1)); low_shade *= green_mult_; high_shade *= green_mult_; green_dither_[i] = (index << 16) + (high_shade << 8) + (low_shade); } /* setup the blue information */ { low_shade = (fim_byte_t) (i / blue_colors_per_shade); high_shade = low_shade + 1; index = (unsigned short) (((i - low_shade * blue_colors_per_shade) / blue_colors_per_shade) * (DITHER_LEVEL * DITHER_LEVEL + 1)); blue_dither_[i] = (index << 16) + (high_shade << 8) + (low_shade); } /* setup the gray information */ { low_shade = (fim_byte_t) (i / gray_colors_per_shade); high_shade = low_shade + 1; index = (unsigned short) (((i - low_shade * gray_colors_per_shade) / gray_colors_per_shade) * (DITHER_LEVEL * DITHER_LEVEL + 1)); gray_dither_[i] = (index << 16) + (high_shade << 8) + (low_shade); } } } void inline FramebufferDevice::dither_line(fim_byte_t *src, fim_byte_t *dst, int y, int width,int mirror) FIM_NOEXCEPT { FIM_REGISTER long a, b #ifndef FIM_IS_SLOWER_THAN_FBI __attribute((aligned(16))) #endif /* FIM_IS_SLOWER_THAN_FBI */ ; long *ymod, xmod; ymod = (long int*) DM[y & DITHER_MASK]; /* fim mirror patch */ FIM_REGISTER const int inc=mirror?-1:1; dst=mirror?dst+width-1:dst; /* fim mirror patch */ if(FIM_UNLIKELY(width<1)) goto nodither; //who knows #ifndef FIM_IS_SLOWER_THAN_FBI switch(width%8){ case 0: goto dither0; break ; case 1: goto dither1; break ; case 2: goto dither2; break ; case 3: goto dither3; break ; case 4: goto dither4; break ; case 5: goto dither5; break ; case 6: goto dither6; break ; case 7: goto dither7; break ; } #endif /* FIM_IS_SLOWER_THAN_FBI */ while (FIM_LIKELY(width)) { #if 0 #define DITHER_CORE \ xmod = --width & DITHER_MASK; \ \ b = blue_dither_[*(src++)]; \ b >>= (ymod[xmod] < b)?8:0; \ a = green_dither_[*(src++)]; \ a >>= (ymod[xmod] < a)?8:0; \ b += a; \ a = red_dither_[*(src++)]; \ a >>= (ymod[xmod] < a)?8:0; \ *(dst) = b+a & 0xff; \ /* fim mirror patch */ dst+=inc; #else #define DITHER_CORE \ { \ width--; \ xmod = width & DITHER_MASK; \ const long ymod_xmod=ymod[xmod]; \ \ b = blue_dither_[*(src++)]; \ if (ymod_xmod < b) \ b >>= 8; \ \ a = green_dither_[*(src++)]; \ if (ymod_xmod < a) \ a >>= 8; \ b += a; \ \ a = red_dither_[*(src++)]; \ if (ymod_xmod < a) \ a >>= 8; \ b += a; \ *(dst) = b & 0xff; \ /* fim mirror patch */ \ dst+=inc; \ } \ /* *(dst++) = b & 0xff;*/ #endif #ifndef FIM_IS_SLOWER_THAN_FBI dither0: DITHER_CORE dither7: DITHER_CORE dither6: DITHER_CORE dither5: DITHER_CORE dither4: DITHER_CORE dither3: DITHER_CORE dither2: DITHER_CORE #endif /* FIM_IS_SLOWER_THAN_FBI */ dither1: DITHER_CORE } nodither: return; } void FramebufferDevice::dither_line_gray(fim_byte_t *src, fim_byte_t *dst, int y, int width) { long xmod; FIM_REGISTER long a; long *ymod = (long int*) DM[y & DITHER_MASK]; while (width--) { xmod = width & DITHER_MASK; a = gray_dither_[*(src++)]; if (ymod[xmod] < a) a >>= 8; *(dst++) = a & 0xff; } } void FramebufferDevice::fb_switch_release(void) { ioctl(tty_, VT_RELDISP, 1); fb_switch_state_ = FB_INACTIVE; if (debug_) FIM_FPRINTF(stderr, "vt: release\n"); } void FramebufferDevice::fb_switch_acquire(void) { ioctl(tty_, VT_RELDISP, VT_ACKACQ); fb_switch_state_ = FB_ACTIVE; if (debug_) FIM_FPRINTF(stderr, "vt: acquire\n"); } int FramebufferDevice::fb_switch_init(void) { struct sigaction act,old; fim_bzero(&act,sizeof(act)); ffdp=this;// WARNING : A DIRTY HACK act.sa_handler = _fb_switch_signal; sigemptyset(&act.sa_mask); sigaction(SIGUSR1,&act,&old); sigaction(SIGUSR2,&act,&old); #ifdef FIM_BOZ_PATCH if(!with_boz_patch_) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty_,VT_GETMODE, &vt_mode_)) { fim_perror("ioctl VT_GETMODE"); exit(1); } vt_mode_.mode = VT_PROCESS; vt_mode_.waitv = 0; vt_mode_.relsig = SIGUSR1; vt_mode_.acqsig = SIGUSR2; #ifdef FIM_BOZ_PATCH if(!with_boz_patch_) #endif /* FIM_BOZ_PATCH */ if (-1 == ioctl(tty_,VT_SETMODE, &vt_mode_)) { fim_perror("ioctl VT_SETMODE"); exit(1); } return 0; } void FramebufferDevice::fb_switch_signal(int signal) { if (signal == SIGUSR1) { /* release */ fb_switch_state_ = FB_REL_REQ; if (debug_) FIM_FPRINTF(stderr, "vt: SIGUSR1\n"); } if (signal == SIGUSR2) { /* acquisition */ fb_switch_state_ = FB_ACQ_REQ; if (debug_) FIM_FPRINTF(stderr, "vt: SIGUSR2\n"); } } int FramebufferDevice::fb_text_init2(void) { return fs_init_fb(255); } int FramebufferDevice::fb_font_width(void)const { return f_->swidth(); } int FramebufferDevice::fb_font_height(void)const { return f_->sheight(); } int FramebufferDevice::fs_init_fb(int white8) { switch (fb_var_.bits_per_pixel) { case 8: fs_white_ = white8; fs_black_ = 0; fs_bpp_ = 1; fs_setpixel = setpixel1; break; case 15: case 16: if (fb_var_.green.length == 6) fs_white_ = 0xffff; else fs_white_ = 0x7fff; fs_black_ = 0; fs_bpp_ = 2; fs_setpixel = setpixel2; break; case 24: fs_white_ = 0xffffff; fs_black_ = 0; fs_bpp_ = fb_var_.bits_per_pixel/8; fs_setpixel = setpixel3; break; case 32: fs_white_ = 0xffffff; fs_black_ = 0; fs_bpp_ = fb_var_.bits_per_pixel/8; fs_setpixel = setpixel4; break; default: FIM_FPRINTF(stderr, "Oops: %i bit/pixel ???\n", fb_var_.bits_per_pixel); return -1; } return 0; } #ifndef FIM_WANT_NO_OUTPUT_CONSOLE FramebufferDevice::FramebufferDevice(MiniConsole& mc): DisplayDevice(mc) #else /* FIM_WANT_NO_OUTPUT_CONSOLE */ FramebufferDevice::FramebufferDevice(void): DisplayDevice() #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ ,vt_(0) ,dither_(FIM_FBI_FALSE) ,fbgamma_(FIM_CNS_GAMMA_DEFAULT) ,fs_bpp_(), fs_black_(), fs_white_() ,visible_(1) //,x11_font_("10x20") ,ys_( 3) ,xs_(10) ,debug_(FIM_WANT_FBI_FBDEV_DIAGNOSTICS) ,fs_setpixel(FIM_NULL) ,fbdev_(FIM_NULL) ,fbmode_(FIM_NULL) #ifdef FIM_BOZ_PATCH ,with_boz_patch_(0) #endif /* FIM_BOZ_PATCH */ ,fb_mem_offset_(0) ,fb_switch_state_(FB_ACTIVE) ,orig_vt_no_(0) ,devices_(FIM_NULL) #ifndef FIM_KEEP_BROKEN_CONSOLE //mc_(48,12), // int R=(fb_var_.yres/fb_font_height())/2,/* half screen */ // C=(fb_var_.xres/fb_font_width()); #endif /* FIM_KEEP_BROKEN_CONSOLE */ { const fim_char_t *line; cmap_.start = 0; cmap_.len = 256; cmap_.red = red_; cmap_.green = green_; cmap_.blue = blue_; //! transp! devs_default_.fb0= FIM_DEFAULT_FB_FILE; devs_default_.fbnr= "/dev/fb%d"; devs_default_.ttynr= "/dev/tty%d"; devs_devfs_.fb0= "/dev/fb/0"; devs_devfs_.fbnr= "/dev/fb/%d"; devs_devfs_.ttynr= "/dev/vc/%d"; ocmap_.start = 0; ocmap_.len = 256; ocmap_.red=ored_; ocmap_.green=ogreen_; ocmap_.blue=oblue_; if (FIM_NULL != (line = fim_getenv(FIM_ENV_FBGAMMA))) fbgamma_ = fim_atof(line); } } fim_err_t FramebufferDevice::display( const void *ida_image_img, fim_coo_t yoff, fim_coo_t xoff, fim_coo_t irows,fim_coo_t icols,// rows and columns in the input image fim_coo_t icskip, // input columns to skip for each line fim_coo_t by, fim_coo_t bx, fim_coo_t bh, fim_coo_t bw, fim_coo_t ocskip,// output columns to skip for each line fim_flags_t flags) { if(by<0) goto err; if(bx<0) goto err; if(bw<0) goto err; if(bh<0) goto err; /* * Uncommenting this clear_rect() might fix a few cases where a clear * screen seems missing, but also introduce flickering --- this has to * be fixed differently than enabling this as done in r882. */ // clear_rect( 0, width()-1, 0, height()-1); svga_display_image_new( (const struct ida_image*)ida_image_img, yoff, xoff, irows,icols,// rows and columns in the input image icskip, // input columns to skip for each line by, bx, bh, bw, ocskip,// output columns to skip for each line flags); redraw_ = FIM_REDRAW_UNNECESSARY; return FIM_ERR_NO_ERROR; err: return FIM_ERR_GENERIC; } void FramebufferDevice::finalize (void) { finalized_=true; clear_screen(); cleanup(); } FramebufferDevice::~FramebufferDevice(void) { } fim_coo_t FramebufferDevice::status_line_height(void)const { return f_ ? border_height_ + f_->sheight() : 0; } #endif //ifdef FIM_WITH_NO_FRAMEBUFFER, else fim-0.6-rc2/src/Var.h0000644000175000017500000001660414454347340011246 00000000000000/* $LastChangedDate: 2023-03-25 18:31:40 +0100 (Sat, 25 Mar 2023) $ */ /* Var.h : Var class header file (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_VAR_H #define FIM_VAR_H #include "string.h" #include "fim_types.h" #define FIM_FFL_PRT printf("In %s located in %20s:%d :\n",__func__,__FILE__,__LINE__) #if 0 #define DBG(X) FIM_FFL_PRT;std::cout<set(v); } int set(const Var& v) { DBG("(v:?)\n"); this->type=v.type; if(type==FimTypeInt) this->i=v.i; if(type==FimTypeFloat) this->f=v.f; if(type==FimTypeString) this->s_=v.s_; return getInt(); } Var(fim_float_t v): type(FimTypeFloat),i(0) { DBG("(f:"<s_=s; else i=0; } Var(const fim::string s): type(FimTypeDefault),i(0) { type=FimTypeString; this->s_=s.c_str(); } Var(const fim_char_t*s): type(FimTypeDefault),i(0) { type=FimTypeString; this->s_=s; } const Var& operator= (int i){DBG("2i:"<i=i;return *this;} const Var& operator= (fim_float_t f){setFloat(f);return *this;} const Var& operator= (fim::string& s){setString(s);return *this;} const Var& operator= (const Var& rhs){set(rhs);return *this;} //Var concat(const Var& v)const{return this->getString()+v.getString();} fim_float_t setFloat(fim_float_t f){type=FimTypeFloat;return this->f=f;} fim_int setInt(fim_int i){type=FimTypeInt;return this->i=i;} fim::string setString(const fim::string& s){type=FimTypeString;this->s_=s;return this->s_;} int getType(void)const{return type;} fim_int getInt(void)const{return(type==FimTypeInt)?i: (type==FimTypeFloat?(static_cast(f)): (type==FimTypeString?(fim_atoi(s_.c_str())):0) ); } fim_float_t getFloat(void)const{ return(type==FimTypeFloat)?f: (type==FimTypeInt? ((fim_float_t)i): ((type==FimTypeString)?fim_atof(s_.c_str()):0.0f) ); } fim::string getString(void)const { DBG("t:"<<(char)type <<"\n"); if(type==FimTypeString) return this->s_; else { fim_char_t buf[FIM_CHARS_FOR_INT]; if(type==FimTypeInt) fim_snprintf_fim_int(buf,i); else if(type==FimTypeFloat) sprintf(buf,"%f",f); DBG(" v:"<=(const Var& v)const { return getFloat()>=v.getFloat(); } Var operator< (const Var& v)const { return getFloat()< v.getFloat(); } Var operator> (const Var& v)const { return getFloat()> v.getFloat(); } private: bool both_typed(fim_var_t t, const Var& v)const {return getType() == t && ( ((getType()==t) && (v.getType()==t))); } //#define _types() DBG("t1:"<<(getType())<<",t2:"<<(v.getType())<<"\n"); public: Var operator!=(const Var& v)const { //_types() if(both_typed(FimTypeInt,v)) return getInt() !=v.getInt(); if(both_typed(FimTypeFloat,v)) return getFloat() !=v.getFloat(); if(both_typed(FimTypeString,v)) return getString()!=v.getString(); return getFloat()!=v.getFloat(); } Var operator==(const Var& rhs)const {DBG("EQV\n"); return 1-(*this != rhs).getInt(); } Var operator/ (const Var& v)const { if(both_typed(FimTypeInt,v)) return getInt()/(v.getInt()!=0?v.getInt():1); return getFloat()/(v.getFloat()!=0.0?v.getFloat():1); } Var operator* (const Var& v)const { if(both_typed(FimTypeInt,v)) return getInt()*v.getInt(); if(both_typed(FimTypeFloat,v)) return getFloat()*v.getFloat(); if(both_typed(FimTypeString,v)) return getFloat()*v.getFloat(); return getFloat()*v.getFloat(); } Var operator| (const Var& v)const { return getInt()|v.getInt(); } Var operator& (const Var& v)const { return getInt()&v.getInt(); } Var operator+ (const Var& v)const { if(both_typed(FimTypeInt,v)) return getInt()+v.getInt(); if(both_typed(FimTypeFloat,v)) return getFloat()+v.getFloat(); if(both_typed(FimTypeString,v)) return getString()+v.getString(); return getFloat()+v.getFloat(); } Var operator- (const Var& v)const { DBG("SUB"<getString().c_str()); return aeq == 0; } int re (const Var& v)const { return re_match(v).getInt(); } Var operator- (void)const { if(getType()==FimTypeFloat)return - getFloat(); if(getType()==FimTypeString)return - getFloat(); /*if(getType()==FimTypeInt)*/return - getInt(); } Var operator% (const Var& v)const { return getInt()%v.getInt(); } // Var operator, (const Var& v)const { return (getString()+v.getString()); } Var operator&&(const Var& v)const { return getInt()&&v.getInt(); } Var operator||(const Var& v)const { return getInt()||v.getInt(); } Var re_match(const Var& v)const { return getString().re_match(v.getString().c_str()); } //#undef _types std::ostream& print(std::ostream& os)const; size_t size(void) const { return sizeof(Var) + this->s_.capacity(); } void shrink_to_fit(void) { #if FIM_USE_CXX11 this->s_.shrink_to_fit(); #endif /* FIM_USE_CXX11 */ } int find(const fim_char_t c)const{const char*p=FIM_NULL,*r=FIM_NULL;if(getType()==FimTypeString && (p=s_.c_str()) && (r=strchr(s_.c_str(),c)))return r-p; return -1; } }; fim::string fim_var_help_db_query(const fim::string& id); void fim_var_help_db_init(void); fim::string fim_get_variables_reference(FimDocRefMode refmode); std::ostream& operator<<(std::ostream& os, const Var& var); } #endif /* FIM_VAR_H */ fim-0.6-rc2/src/FimWindow.h0000644000175000017500000001447514454347340012425 00000000000000/* $LastChangedDate: 2022-11-16 02:15:11 +0100 (Wed, 16 Nov 2022) $ */ /* FimWindow.h : Fim's own windowing system header file (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_WINDOW_H #define FIM_WINDOW_H #include "fim.h" #include "DisplayDevice.h" #ifdef FIM_WINDOWS #include #include #define FIM_DISABLE_WINDOW_SPLITTING 1 namespace fim { #define FIM_BUGGED_ENLARGE 0 /* The window class should model the behaviour of a binary splitting window in a portable manner. It should not be tied to a particular window system or graphical environment, but it should mimic the behaviour of Vim's windowing system. (x,y) : upper left point in +--------------+ | | | | | | +--------------+ | | +--------------+ (x+w,y+h) : lower right point out */ class Rect FIM_FINAL { public: fim_coo_t x_,y_,w_,h_; // units, not pixels #if !FIM_DISABLE_WINDOW_SPLITTING void print(void); #endif Rect(fim_coo_t x,fim_coo_t y,fim_coo_t w,fim_coo_t h); Rect(const Rect& rect); public: enum Splitmode{ Left,Right,Upper,Lower}; #if !FIM_DISABLE_WINDOW_SPLITTING Rect hsplit(Splitmode s); Rect vsplit(Splitmode s); Rect split(Splitmode s); #endif #if !FIM_DISABLE_WINDOW_SPLITTING fim_err_t vlgrow(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT); fim_err_t vlshrink(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT); fim_err_t vugrow(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT); fim_err_t vushrink(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT); fim_err_t hlgrow(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT); fim_err_t hrshrink(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT); fim_err_t hrgrow(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT); fim_err_t hlshrink(fim_coo_t units=FIM_CNS_WGROW_STEPS_DEFAULT); bool operator==(const Rect&rect)const; #endif #if !FIM_DISABLE_WINDOW_SPLITTING fim_coo_t setwidth(fim_coo_t w); fim_coo_t setheight(fim_coo_t h); fim_coo_t setxorigin(fim_coo_t x); fim_coo_t setyorigin(fim_coo_t y); #endif fim_coo_t height(void)const; fim_coo_t width(void)const; fim_coo_t xorigin(void)const; fim_coo_t yorigin(void)const; }; #ifdef FIM_NAMESPACES class FimWindow FIM_FINAL:public Namespace #else /* FIM_NAMESPACES */ class FimWindow FIM_FINAL #endif /* FIM_NAMESPACES */ { private: enum Spacings{ hspacing=0, vspacing=0}; enum Moves{Up,Down,Left,Right,NoMove}; DisplayDevice *displaydevice_; public: Rect corners_;//,status,canvas; private: bool focus_; // if 0 left/up ; otherwise right/lower FimWindow *first_,*second_; bool amroot_; #if !FIM_DISABLE_WINDOW_SPLITTING void split(void); void hsplit(void); void vsplit(void); bool close(void); bool swap(void); // new void balance(void); #endif #if !FIM_DISABLE_WINDOW_SPLITTING bool chfocus(void); Moves move_focus(Moves move); #endif #if !FIM_DISABLE_WINDOW_SPLITTING Moves reverseMove(Moves move); bool normalize(void); #endif #if !FIM_DISABLE_WINDOW_SPLITTING fim_err_t enlarge(fim_coo_t units); fim_err_t henlarge(fim_coo_t units); fim_err_t venlarge(fim_coo_t units); #endif #if !FIM_DISABLE_WINDOW_SPLITTING bool can_vgrow(const FimWindow& window, fim_coo_t howmuch)const; bool can_hgrow(const FimWindow& window, fim_coo_t howmuch)const; #endif private: #if !FIM_DISABLE_WINDOW_SPLITTING explicit FimWindow(const FimWindow& root); bool isleaf(void)const; bool isvalid(void)const; bool issplit(void)const; bool ishsplit(void)const; #endif bool isvsplit(void)const; #if !FIM_DISABLE_WINDOW_SPLITTING fim_err_t hnormalize(fim_coo_t x, fim_coo_t w); fim_err_t vnormalize(fim_coo_t y, fim_coo_t h); #endif #if !FIM_DISABLE_WINDOW_SPLITTING int count_hdivs(void)const; int count_vdivs(void)const; #endif #if !FIM_DISABLE_WINDOW_SPLITTING fim_err_t vlgrow(fim_coo_t units); fim_err_t vugrow(fim_coo_t units); fim_err_t vushrink(fim_coo_t units); fim_err_t vlshrink(fim_coo_t units); fim_err_t hlgrow(fim_coo_t units); fim_err_t hrgrow(fim_coo_t units); fim_err_t hlshrink(fim_coo_t units); fim_err_t hrshrink(fim_coo_t units); #endif #if !FIM_DISABLE_WINDOW_SPLITTING FimWindow& focused(void)const; FimWindow& shadowed(void)const; #endif #if !FIM_DISABLE_WINDOW_SPLITTING FimWindow& upper(void); FimWindow& lower(void); FimWindow& left(void); FimWindow& right(void); bool operator==(const FimWindow&window)const; #endif Viewport *viewport_; #if !FIM_DISABLE_WINDOW_SPLITTING const FimWindow& c_focused(void)const; const FimWindow& c_shadowed(void)const; Viewport& current_viewport(void)const; #endif CommandConsole& commandConsole_; #if !FIM_DISABLE_WINDOW_SPLITTING FimWindow& operator= (const FimWindow& w); #endif public: void setroot(void); // only one root window should exist /* The only public member function launching exceptions is the constructor now. * */ FimWindow(CommandConsole& c, DisplayDevice *dd, const Rect& corners, Viewport* vp=FIM_NULL); // throws FIM_E_NO_MEM exception fim_err_t update(const Rect& corners); Viewport * current_viewportp(void)const; fim_cxr fcmd_cmd(const args_t&args); bool recursive_redisplay(void)const; //exception safe #if !FIM_DISABLE_WINDOW_SPLITTING bool recursive_display(void)const; //exception safe #endif const Image* getImage(void)const; //exception safe #if 0 void print(void); void print_focused(void); void draw(void)const; #endif ~FimWindow(void); virtual size_t byte_size(void)const; void should_redraw(enum fim_redraw_t sr = FIM_REDRAW_NECESSARY); /* FIXME: this is a wrapper to Viewport's, until multiple windows get introduced again. */ #if !FIM_DISABLE_WINDOW_SPLITTING fim_bool_t need_redraw(void)const; #endif }; } /* namespace fim */ #endif /* FIM_WINDOWS */ #endif /* FIM_WINDOW_H */ fim-0.6-rc2/src/fimrc0000644000175000017500000005116014454347340011364 00000000000000# $LastChangedDate: 2023-03-09 00:38:06 +0100 (Thu, 09 Mar 2023) $ # Contents of the default 'fimrc' file, hardcoded in the fim executable. # Read the documentation (man fimrc) to discover how to change this default hardcoded file and how to make your own. # Note that usually a ~/.fimrc file is read after these options take effect, so you could reset all of this with ease. # Lines beginning with a pound (#) are ignored by fim (they are treated as comments). # # Internal variables. # Some of these variables influence fim's behaviour (input variables), some are set by fim (output variables). # It is wise the input variables are set at the beginning of the file, so the bottom may issue commands correctly affected by them. if(_cache_control==''){_cache_control='m';} if(_debug_commands==''){_debug_commands='';} if(_command_expansion==''){_command_expansion=1;} if(_display_status==''){_display_status=0;} if(_max_cached_images==''){_max_cached_images=5;} if(_min_cached_images==''){_min_cached_images=4;} if(_max_cached_memory==''){_max_cached_memory=81920;} if(_max_iterated_commands==''){_max_iterated_commands=100;} if(_want_prefetch==''){_want_prefetch=1;} if(_no_external_loader_programs==''){_no_external_loader_programs=0;} if(_scale_style==''){_scale_style='b';} if(_save_fim_history==''){_save_fim_history=1;} if(_load_fim_history==''){_load_fim_history=1;} if(_verbose_keys==''){_verbose_keys=0;} if(_display_busy==''){_display_busy=1;} if(_ignorecase==''){_ignorecase=1;} if(_re_search_opts==''){_re_search_opts='bi';} if(_console_offset==''){_console_offset=0;} if(_console_key==''){_console_key=58;} if(_display_as_binary==''){_display_as_binary=0;} if(_push_checks==''){_push_checks=1;} #if(_want_wm_caption_status==''){_want_wm_caption_status=0;} if(_want_exif_orientation==''){_want_exif_orientation=1;} if(ascale==''){ascale="1.0";} if(_use_mipmaps==''){_use_mipmaps=1;} if(_downscale_huge_at_load==''){_downscale_huge_at_load=1;} if(_scroll_skip_page_fraction==''){_scroll_skip_page_fraction=0;} if(_want_wm_mouse_ctrl==''){_want_wm_mouse_ctrl="'pP+a-=nN";} # # External variables (not used internally). if(allow_round_scroll==''){allow_round_scroll=0;} if(console_scroll_n==''){console_scroll_n=3;} # alias "toggleautoflip" "_autoflip=1-_autoflip" ""; alias "toggleautonegate" "_autonegate=1-_autonegate" ""; alias "toggleflip" "i:flipped=1-i:flipped" "toggles flipped property on the current image"; alias "flip" "toggleflip;redisplay" "flip the current image along the horizontal axis"; alias "fliponce" "flip;toggleflip" "flip, but just for one display"; alias "toggleautomirror" "_automirror=1-_automirror" ""; alias "togglemirror" "i:mirrored=1-i:mirrored" "toggles mirrored property on the current image"; alias "mirror" "togglemirror;redisplay" "mirror the image along the vertical axis" ""; alias "mirroronce" "mirror;togglemirror" "mirror, but just for one display"; alias 'toggleLimitMarked' '__pre_limit_fileindex=_fileindex;_limit_mode=1-_limit_mode; if(_limit_mode==1){limit "!";} else { limit; } if(_filelistlen<1){_limit_mode=0;limit;goto __pre_limit_fileindex;} i:fresh=1;redisplay; ' "toggle between limiting file list to the marked files and the full list"; alias "unlimit" "limit" "calling limit with no arguments restores the original list"; # Warning : binding to C-s, C-z and C-c won't make effect, as these # codes are get caught by the console driver and will have no effect in fim. # Moreover, C-z will crash fim and C-c will terminate it. # Some other combinations (e.g.:C-l) may have similar problems in your console. bind 'f' "flip"; bind 'F' "fliponce"; bind 'm' "mirror"; bind 'M' "mirroronce"; bind 'q' "quit"; bind 'Esc' "quit"; #bind 'n' "next_file"; #bind 'n' "next"; bind 'C-h' "help"; #bind '?' "help"; # assigned to back-search #bind '/' "help"; # assigned to forward-search bind '=' "scale '100%'"; #bind 'p' "prev_file"; bind 'Del' "list 'remove';reload"; #bind 's' "list 'sort'"; bind ' ' "scroll 'forward'"; ###bind 'C-s' "swap;redisplay"; bind 'S' "toggleDisplayStatus"; bind 'I' "toggleautonegate"; bind 'i' "color 'negate';redisplay"; bind 'g' "color 'desaturate';redisplay"; ###bind '[' "color 'colorblind' ; redisplay"; ###bind ']' "color 'colorblind' 'daltonize'; redisplay"; bind '[' 'font_reduce;redisplay'; bind ']' 'font_magnify;redisplay'; bind '|' 'toggle_font_auto_scale;redisplay'; bind '{' 'font "prev";redisplay'; bind '}' 'font "next";redisplay'; bind 'G' "toggleDesaturate"; ####bind 'R' "reload"; ####bind 'R' "redisplay"; bind 'r' "rotate90"; bind 'R' "rotate270"; ####bind 'R' "rotate10;display"; ####bind 'r' "rotate10_ccw;display"; ####bind 'r' "reload"; ###bind 'C-d' "display"; bind '+' "magnify"; ####bind 'C-+' "angle=angle+10.0;display"; bind 'a' "scale 'a'"; bind 'H' "scale 'H'"; bind 'Tab' "toggleVerbosity"; bind 'Menu' "toggleVerbosity"; ####bind 'C-k' "_want_wm_caption_status=1-_want_wm_caption_status;status ' '"; bind 'v' "toggleDisplayStatus"; bind 'A' "A"; bind 'C-m' "list 'mark'"; bind 'u' "list 'unmark'"; ####bind 'Enter' "list 'mark';next"; bind 'Enter' "list 'mark';goto _lastgotodirection"; bind '-' "reduce"; bind "Up" "pan_up"; bind 'k' "pan_up"; ###bind 'k' "pan 'up-'"; ####bind 'C-k' "pan_up"; bind "Right" "pan_right"; bind 'l' "pan_right"; bind "Down" "pan_down"; bind 'j' "pan_down"; ###bind 'j' "pan 'down+'"; bind "Left" "pan_left"; bind 'h' "pan_left"; ####bind ' ' "scroll 'down'"; bind 't' "align 'top'"; bind 'C-g' "system 'fbgrab' 'fim_'._device_string.'.png'"; # grab a screenshot #bind 'C-r' "recording 'start'"; bind 'C-r' "reload ''"; bind 'Q' "recording 'stop'"; bind 'D' "recording 'dump'"; bind 'E' "recording 'execute'"; bind 'C-e' "recording 'execute'"; bind 'C-x' "recording 'execute'"; bind '.' "recording 'repeat_last'"; bind '`' "toggleLimitMarked"; alias "toggleVerbosity" "_display_console=1-_display_console;i:fresh=1;redisplay" ""; alias "toggleKeyVerbosity" "_verbose_keys=1-_verbose_keys;redisplay" ""; alias "toggleDesaturate" "_autodesaturate=1-_autodesaturate;redisplay" ""; alias "idempotent_cmd" "goto ''"; # # Autocommands examples: #autocmd "PostInteractiveCommand" "fim.png" "echo '\\nmatched an interactive command on fim.png\\n'"; #autocmd "PostDisplay" ".*png" "echo 'this is a png file'"; #autocmd "PostDisplay" ".*jpg" "echo 'this is a jpg file'"; ###autocmd "PostDisplay" ".*gif" "echo 'this is a gif file'"; #autocmd "PostDisplay" "" "echo '\\nthis is a file\\n'"; #autocmd "PostGoto" "" "set_interactive_mode"; autocmd "PostGoto" "" "reload"; ###autocmd "PostGoto" "" "load"; ###autocmd "PostDisplay" "" "i:fresh=1" ; ###autocmd "PreWindow" "" ""; autocmd "PostWindow" "" "i:fresh=1;redisplay;"; autocmd "PreRedisplay" "" "i:_will_display=1"; autocmd "PreRedisplay" "" "if(_scale_style!='' && i:fresh){i:fresh=0;scale _scale_style ;i:fresh=0;}"; autocmd "PostRedisplay" "" "i:_will_display=0"; # Display device specific config alias "aalib_fix_do" "{if(aascale==''){ascale='2.0';}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+aalib?expect binding problems!'}}" "See aalib_fix."; alias "aalib_fix" "if(_device_string=='aa'){aalib_fix_do;scale 'a';}" "When using the aalib (ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'aascale' variable for an accurate scaling."; alias "cacalib_fix_do" "{if(cacascale==''){ascale='1.18';}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+cacalib?expect binding problems!'}}" "See cacalib_fix."; alias "cacalib_fix" "getenv 'DISPLAY';if(_device_string=='caca' && ENV_DISPLAY==''){cacalib_fix_do;scale 'a';}" "When using the libcaca (Coloured ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'cacascale' variable for an accurate scaling."; ###alias "exif_fix" "i:_orientation=exif_orientation;exif_orientation='';i:mirrored=exif_mirrored;exif_mirrored='';i:flipped=exif_flipped;exif_flipped=''" ""; ###autocmd "PostReload" "" "aalib_fix;exif_fix"; ###autocmd "PostLoad" "" "aalib_fix;exif_fix"; autocmd "PostReload" "" "aalib_fix"; autocmd "PostLoad" "" "aalib_fix"; autocmd "PostReload" "" "cacalib_fix"; autocmd "PostLoad" "" "cacalib_fix"; alias "refresh" "desc 'reload';redisplay;" "reloads and displays image description"; bind "F5" "refresh"; bind "F11" "if(_device_string=='sdl' && !_fullscreen){_old_sw=_screen_width;_old_sh=_screen_height;display 'reinit' 'mW0:0';_fullscreen=1;}else if(_device_string=='sdl' && _old_sw*_old_sh*_fullscreen){display 'reinit' 'rwm'._old_sw.':'._old_sh;_fullscreen=0;}" "Toggles full screen. Will show mouse cursor in full screen."; autocmd "PostReload" "" "i:fresh=1" ; autocmd "PostScale" "" "if(0==i:_will_display){i:fresh=1;display;}" ; ###autocmd "PostScale" "" "{i:fresh=1;display;}" ; autocmd "PostPan" "" "{i:fresh=1;display;}" ; autocmd "PostReload" "" "if(i:fresh){redisplay;}"; autocmd "PostInteractiveCommand" "" "if(i:fresh){display;i:fresh=0;}"; autocmd "PostInteractiveCommand" "" "if(_want_prefetch>0){prefetch;}"; autocmd "PostInteractiveCommand" "" "if(_display_console==0 && i:fresh){redisplay;i:fresh=0;}"; autocmd "PostInteractiveCommand" "" "idempotent_cmd"; # Bug workaround: without it console scroll is broken. alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep '1';}" "goes forward 10 images"; alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep '1';}" "goes backward 10 images"; bind 'N' 'next10'; bind 'P' 'prev10'; bind 'C-n' "goto '+//'"; bind 'C-p' "goto '-//'"; bind 'C-b' "goto '-//'"; # Warning: many configurations cannot detect C-b. bind 'W' "display 'resize'" "if supported, resizes the window to match the current image pixels size"; #bind 'C-w' "scale '100%';display 'resize'" "if supported, scales the image to 100% and resizes the window to match its size (if fits)"; bind 'C-w' "if(_scale_style!='w'){_scale_style='w';scale 'w';}else{_scale_style='';scale '100%';}" "scale to width"; alias "endless_slideshow" "while(1){display;sleep '1';next;}" "performs an automated slideshow, endlessly"; alias "bookview" "while(1){display;sleep '2';scroll 'down';}" ""; alias "comicview" "while(1){display;sleep '1';scroll 'down';}" ""; alias "read" "while(1){display;sleep '1';scroll 'forward';}" ""; alias "slowread" "while(1){display;sleep '2';scroll 'forward';}" ""; alias "fastread" "while(1){display;scroll 'forward';}" "proceeds like in a book bug very fast"; alias "pornview" "echo 'press any key repeatedly to terminate' ;endless_slideshow" "enters an endless slideshow"; ####bind "C-p" "pornview"; ####bind "C-b" "bookview"; autocmd "PreExecutionCycle" "/fbps-" "_display_busy=0;_display_status=0" ; autocmd "PreExecutionCycle" "" "i:fresh=1;reload"; ####autocmd "PreExecutionCycle" "" "redisplay"; autocmd "PreExecutionCycle" "/fbps-.*ps001.png" "i:fresh=1;redisplay"; ####autocmd "PostInteractiveCommand" "" "i:fresh=0"; ####autocmd "PostInteractiveCommand" "" "prefetch"; ## Example in imposing a file loader to an extension: #autocmd "PreReload" ".*mtx.gz" "_file_loader='MatrixMarket'"; #autocmd "PostReload" ".*mtx.gz" "_file_loader=''"; ###bind '*' "scale '100%'"; bind '*' "_display_console=0;toggleVerbosity;echo i:*"; bind 'w' "scale 'w'"; bind '<' "rotate10_ccw;display"; bind '>' "rotate10;display"; bind '_' "_scale_style='';scale '100%'"; bind ',' "_display_console=1;echo _last_system_output"; bind 'C-a' "if(_scale_style!='a'){_scale_style='a';scale 'a';}else{_scale_style='';scale '100%';}" "scale to height"; ####bind 'h' "scale 'h'"; # alias "pan_nw" "pan 'nw'" "pans the image to the upper left"; alias "pan_ne" "pan 'ne'" "pans the image to the upper right"; alias "pan_se" "pan 'se'" "pans the image to the lower left"; alias "pan_sw" "pan 'sw'" "pans the image to the lower right"; alias "pan_down" "if(_display_console==0){pan 'down';}else{scd;}" "pans the image down / scrolls console down"; alias "pan_up" "if(_display_console==0){pan 'up' ;}else{scu;}" "pans the image up / scrolls console up"; alias "pan_left" "pan 'left'" "pans the image left"; alias "pan_right" "pan 'right'" "pans the image right"; alias "diagonal_nw" "pan_nw" "pans the image to the upper left"; alias "diagonal_ne" "pan_ne" "pans the image to the upper right"; alias "diagonal_se" "pan_se" "pans the image to the lower left"; alias "diagonal_sw" "pan_sw" "pans the image to the lower right"; bind 'd' "diagonal_nw"; bind 'D' "diagonal_se"; bind 'x' "diagonal_ne"; bind 'X' "diagonal_sw"; alias "toggleDisplayStatus" "_display_status=1-_display_status;redisplay" ""; alias "toggleDisplayBusy" "_display_busy=1-_display_busy" ""; alias "sort" "list 'sort'" "sorts the files list ordered"; ####toggleVerbosity; ####bind 'f' "next;display"; ####bind 'b' "prev;display"; bind 'o' "sort"; bind 'b' "prev"; bind 'B' "toggleDisplayBusy"; alias "random_slideshow" "while(1){goto random;}" "performs a shuffled slideshow"; alias "rotate90_ccw" "i:_orientation=i:_orientation+3;i:fresh=1;i:fresh=1;redisplay" "rotate 90 degrees counter clockwise"; alias "rotate90_cw" "i:_orientation=i:_orientation+1;i:fresh=1;i:fresh=1;redisplay" "rotate 90 degrees clockwise"; alias "rotate180" "i:_orientation=i:_orientation+2;i:fresh=1;i:fresh=1;redisplay" "rotate 180 degrees"; alias "rotate90" "rotate90_cw;display" "rotate 90 degrees clockwise"; alias "rotate270" "rotate90_ccw;display" "rotate 90 degrees counter clockwise"; alias "rotate10" "rotate '10';display" "rotate 10 degrees counter clockwise"; alias "rotate10_ccw" "rotate -10 ;display" "rotate 10 degrees clockwise"; #### window related aliases and commands ###alias "wu" "window 'up'" "selects the window upwards the current"; ###alias "wd" "window 'down'" "selects the window under the current"; ###alias "wl" "window 'left'" "selects the window at left of the current"; ###alias "wr" "window 'right'" "selects the window at right of the current"; ####bind 'K' "wu"; bind 'K' 'if(_display_console==0){echo i:_filename.": ".i:_comment;toggleVerbosity}else{toggleVerbosity;}'; bind 'C-k' 'crop' # still experimental #### Note : on many consoles C-j is by default equivalent to Enter.. so this may not work :) ####bind 'C-j' "wd"; ####bind 'J' "wd"; ####bind 'H' "wl"; ####bind 'L' "wr"; ####alias "split" "window 'split'" "split the current window horizontally"; ####alias "vsplit" "window 'vsplit'" "split the current window vertically"; ####alias "swap" "window 'swap'" "swap the enclosing window subwindows"; ####alias "ws " "window 'swap'" "see swap"; ####bind 'T' "split;redisplay"; #####don't use C-s : it will be usually caught by the console driver, and fim won't get it! #####bind 'C-s' "split"; ####bind 'V' "vsplit;redisplay"; ####bind 'U' "swap;redisplay"; ####alias 'venlarge' 'window "venlarge"' ""; ####alias 'henlarge' 'window "henlarge"' ""; ####alias 'wnormalize' 'window "normalize"' ""; ####alias 'wclose' 'window "close"' ""; ####alias 'wc' 'window "close"' "closes the current window"; ####bind 'C' "wc;redisplay"; alias 'cache' 'echo _cache_status' "displays cached images status"; ###bind 'c' 'cache'; bind 'c' 'align "center"'; alias 'widen' 'i:ascale=i:ascale*"1.1";*1.0' "widen the current image"; alias 'narrow' 'i:ascale=i:ascale/"1.1";*1.0' "narrow the current image"; ###alias 'contract' 'narrow'; bind 'y' "widen" "widen horizontally the image"; bind 'Y' "narrow" "shrink horizontally the image"; ####alias 'scu' 'scroll_console_up' ""; ####alias 'scd' 'scroll_console_down' ""; ####alias 'console_scroll_up' 'if(_console_offset<_console_lines){_console_offset=_console_offset+1;}'; ####alias 'console_scroll_down' 'if(_console_offset>0){_console_offset=_console_offset-1;}'; alias 'console_scroll_up' 'if(_console_offset<_console_lines+console_scroll_n-_rows){_console_offset=_console_offset+console_scroll_n;}' "scrolls up the virtual console"; alias 'console_scroll_down' 'if(allow_round_scroll || (_console_offset>=console_scroll_n)){_console_offset=_console_offset-console_scroll_n;}' "scrolls down the virtual console"; alias 'console_scroll_reset' '{_console_offset=0;}'; alias 'scu' 'console_scroll_up' ""; alias 'scd' 'console_scroll_down' ""; alias 'scz' 'console_scroll_reset' ""; alias 'center' 'align "center"'; alias 'left' 'align "left"'; alias 'right' 'align "right"'; alias 'top' 'align "top"'; alias 'bottom' 'align "bottom"'; alias "font_magnify_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction-1;}else{_fbfont_as_screen_fraction=_screen_width/100+_screen_height/100;}" ""; alias "font_magnify_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor+1" ""; alias "font_reduce_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction+1;}" ""; alias "font_reduce_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor-1" ""; alias "toggle_font_auto_scale" "if(_fbfont_as_screen_fraction<0){_fbfont_as_screen_fraction=0;echo 'Auto font scaling on.';}else{_fbfont_as_screen_fraction=-1;echo 'Auto font scaling off.';}" "toggles between manual and auto font scaling control"; alias 'next_file_dir_same' "goto '+/s';" "go to next file in same dir"; alias 'next_file_dir_other' "goto '+/S';" "go to next file in other dir"; alias 'next_file_dir_up' "goto '+/u';" "go to next file up the dir hierarchy"; alias 'next_file_dir_down' "goto '+/d';" "go to next file down the dir hierarchy"; alias 'next_file_same_basename' "goto '+/b';" "go to next file with same basename"; alias 'prev_file_dir_same' "goto '-/s';" "go to prev file in same dir"; alias 'prev_file_dir_other' "goto '-/S';" "go to prev file in other dir"; alias 'prev_file_dir_up' "goto '-/u';" "go to prev file up the dir hierarchy"; alias 'prev_file_dir_down' "goto '-/d';" "go to prev file down the dir hierarchy"; alias 'prev_file_same_basename' "goto '-/b';" "go to prev file with same basename"; #alias "font_magnify" "if(_fbfont_as_screen_fraction<0) {font_magnify_manual;}else{font_magnify_auto;}" "increase font size (either relative or absolute)"; #alias "font_reduce" "if(_fbfont_as_screen_fraction<0) {font_reduce_manual;} else{font_reduce_auto;}" "increase font size (either relative or absolute)"; alias "font_magnify" "_fbfont_as_screen_fraction=-1;font_magnify_manual" "increase absolute font size and set manual font control"; alias "font_reduce" "_fbfont_as_screen_fraction=-1;font_reduce_manual" "decrease absolute font size and set manual font control"; bind "PageUp" "if(_display_console==0){prev;}else{scu;}"; bind "PageDown" "if(_display_console==0){next;}else{scd;}"; bind "Home" "0;"; bind "End" "$;"; bind "^" "0;"; bind "$" "$;"; #bind "Backspace" "prev"; # console code for C-h and Backspace is the same :-) bind "'" "goto _lastfileindex"; bind '"' "scale 'shadow';i:fresh=1;redisplay;"; bind '(' "goto '^p'"; bind ')' "goto '$p'"; bind 'Z' "sleep 1"; _display_status=1; # lower status line _want_wm_caption_status="fim:%N@%p%%%L[%i/%l]"; _info_fmt_str="%p%% %wx%h%L %i/%l%P %F %T %c"; # lower right line part #_display_status_fmt="%N:%k"; # _display_status_fmt="%N%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?%?EXIF_ExposureTime?[%:EXIF_ExposureTime:]?%?EXIF_FNumber?[%:EXIF_FNumber:]?%?EXIF_ApertureValue?[%:EXIF_ApertureValue:]?%?EXIF_ISOSpeedRatings?[ISO%:EXIF_ISOSpeedRatings:]?:%k"; # lower left line part #_fbfont_as_screen_fraction=-1; # disable auto font scaling echo "WELCOME: to switch to the command line interface press ':'"; # More examples: #alias "plisten" 'popen "nc -l -p 9999 "' "executes fim commands coming from port 9999 on this computer"; #alias "wlisten" "while(1){sleep;plisten;}" "listen to a pipe, endlessly"; #alias "musicplay" "system 'mpc' 'play'" ""; #alias "musicpause" "system 'mpc' 'pause'" ""; #alias "rdjpgcom" 'system "rdjpgcom" i:_filename'; # offsetscan usage : need a mechanism for popping all images before. #alias "offsetscan" "while(i:width<1){list 'push' 'blob.jpg';stdout _open_offset ;_open_offset=_open_offset+1;reload;}"; #alias "webcam" "pread 'vgrabbj -d /dev/video0'"; #alias "webcam_cycle" "while(1){webcam;reload;sleep 1;}"; # This is a FIM initialization file. # Without it FIM cannot work like it should. # Feel free to modify it, but with caution! fim-0.6-rc2/src/regex.c0000644000175000017500000055155314454347340011632 00000000000000/* Extended regular expression matching and search library, * version 0.12. * (Implements POSIX draft P1003.2/D11.2, except for some of the * internationalization features.) * * Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. * * This file is part of the GNU C Library. Its master source is NOT part of * the C library, however. The master source lives in /gd/gnu/lib. * * The GNU C Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * The GNU C Library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the GNU C Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ /* * Modifications: * * Use _regex.h instead of regex.h. tlr, 1999-01-06 * Make REGEX_MALLOC depend on HAVE_ALLOCA &c. * tlr, 1999-02-14 * Don't switch on regex debugging when debugging mutt. * tlr, 1999-02-25 */ /* The following doesn't mix too well with autoconfiguring * the use of alloca. So let's disable it for AIX. */ #if 0 /* AIX requires this to be the first thing in the file. */ # if defined (_AIX) && !defined (REGEX_MALLOC) # pragma alloca # endif #endif #undef _GNU_SOURCE #define _GNU_SOURCE #if HAVE_CONFIG_H # include #endif #undef DEBUG #if (defined(HAVE_ALLOCA_H) && !defined(_AIX)) # include #endif #if (!defined(HAVE_ALLOCA) || defined(_AIX)) # define REGEX_MALLOC #endif #if defined(STDC_HEADERS) && !defined(emacs) #include #else /* We need this for `regex.h', and perhaps for the Emacs include files. */ #include #endif /* For platform which support the ISO C amendement 1 functionality we support user defined character classes. */ #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) # include # include #endif /* This is for other GNU distributions with internationalized messages. */ #if HAVE_LIBINTL_H || defined (_LIBC) # include #else # define gettext(msgid) (msgid) #endif #ifndef gettext_noop /* This define is so xgettext can find the internationalizable strings. */ #define gettext_noop(String) String #endif /* The `emacs' switch turns on certain matching commands that make sense only in Emacs. */ #ifdef emacs #include "lisp.h" #include "buffer.h" #include "syntax.h" #else /* not emacs */ /* If we are not linking with Emacs proper, we can't use the relocating allocator even if config.h says that we can. */ #undef REL_ALLOC #if defined (STDC_HEADERS) || defined (_LIBC) #include #else char *malloc (); /* __MEM_CHECKED__ */ char *realloc (); /* __MEM_CHECKED__ */ #endif /* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. If nothing else has been done, use the method below. */ #ifdef INHIBIT_STRING_HEADER #if !(defined (HAVE_BZERO) && defined (HAVE_BCOPY)) #if !defined (bzero) && !defined (bcopy) #undef INHIBIT_STRING_HEADER #endif #endif #endif /* This is the normal way of making sure we have a bcopy and a bzero. This is used in most programs--a few other programs avoid this by defining INHIBIT_STRING_HEADER. */ #ifndef INHIBIT_STRING_HEADER #if defined (HAVE_STRING_H) || defined (STDC_HEADERS) || defined (_LIBC) #include #ifndef bcmp #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) #endif #ifndef bcopy #define bcopy(s, d, n) memcpy ((d), (s), (n)) #endif #ifndef bzero #define bzero(s, n) memset ((s), 0, (n)) #endif #else #include #endif #endif /* Define the syntax stuff for \<, \>, etc. */ /* This must be nonzero for the wordchar and notwordchar pattern commands in re_match_2. */ #ifndef Sword #define Sword 1 #endif #ifdef SWITCH_ENUM_BUG #define SWITCH_ENUM_CAST(x) ((int)(x)) #else #define SWITCH_ENUM_CAST(x) (x) #endif #ifdef SYNTAX_TABLE extern char *re_syntax_table; #else /* not SYNTAX_TABLE */ /* How many characters in the character set. */ #define CHAR_SET_SIZE 256 static char re_syntax_table[CHAR_SET_SIZE]; static void init_syntax_once () { register int c; static int done = 0; if (done) return; bzero (re_syntax_table, sizeof re_syntax_table); for (c = 'a'; c <= 'z'; c++) re_syntax_table[c] = Sword; for (c = 'A'; c <= 'Z'; c++) re_syntax_table[c] = Sword; for (c = '0'; c <= '9'; c++) re_syntax_table[c] = Sword; re_syntax_table['_'] = Sword; done = 1; } #endif /* not SYNTAX_TABLE */ #define SYNTAX(c) re_syntax_table[c] #endif /* not emacs */ /* Get the interface, including the syntax bits. */ /* Changed to fit into mutt - tlr, 1999-01-06 */ #include "_regex.h" /* isalpha etc. are used for the character classes. */ #include /* Jim Meyering writes: "... Some ctype macros are valid only for character codes that isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when using /bin/cc or gcc but without giving an ansi option). So, all ctype uses should be through macros like ISPRINT... If STDC_HEADERS is defined, then autoconf has verified that the ctype macros don't need to be guarded with references to isascii. ... Defining isascii to 1 should let any compiler worth its salt eliminate the && through constant folding." */ #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) #define ISASCII(c) 1 #else #define ISASCII(c) isascii(c) #endif #ifdef isblank #define ISBLANK(c) (ISASCII (c) && isblank (c)) #else #define ISBLANK(c) ((c) == ' ' || (c) == '\t') #endif #ifdef isgraph #define ISGRAPH(c) (ISASCII (c) && isgraph (c)) #else #define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) #endif #define ISPRINT(c) (ISASCII (c) && isprint (c)) #define ISDIGIT(c) (ISASCII (c) && isdigit (c)) #define ISALNUM(c) (ISASCII (c) && isalnum (c)) #define ISALPHA(c) (ISASCII (c) && isalpha (c)) #define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) #define ISLOWER(c) (ISASCII (c) && islower (c)) #define ISPUNCT(c) (ISASCII (c) && ispunct (c)) #define ISSPACE(c) (ISASCII (c) && isspace (c)) #define ISUPPER(c) (ISASCII (c) && isupper (c)) #define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) #ifndef NULL #define NULL (void *)0 #endif /* We remove any previous definition of `SIGN_EXTEND_CHAR', since ours (we hope) works properly with all combinations of machines, compilers, `char' and `unsigned char' argument types. (Per Bothner suggested the basic approach.) */ #undef SIGN_EXTEND_CHAR #if __STDC__ #define SIGN_EXTEND_CHAR(c) ((signed char) (c)) #else /* not __STDC__ */ /* As in Harbison and Steele. */ #define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128) #endif /* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we use `alloca' instead of `malloc'. This is because using malloc in re_search* or re_match* could cause memory leaks when C-g is used in Emacs; also, malloc is slower and causes storage fragmentation. On the other hand, malloc is more portable, and easier to debug. Because we sometimes use alloca, some routines have to be macros, not functions -- `alloca'-allocated space disappears at the end of the function it is called in. */ #ifdef REGEX_MALLOC #define REGEX_ALLOCATE malloc #define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize) #define REGEX_FREE free #else /* not REGEX_MALLOC */ /* Emacs already defines alloca, sometimes. */ #ifndef alloca /* Make alloca work the best possible way. */ #ifdef __GNUC__ #define alloca __builtin_alloca #else /* not __GNUC__ */ #if HAVE_ALLOCA_H #include #else /* not __GNUC__ or HAVE_ALLOCA_H */ #if 0 /* It is a bad idea to declare alloca. We always cast the result. */ #ifndef _AIX /* Already did AIX, up at the top. */ char *alloca (); #endif /* not _AIX */ #endif #endif /* not HAVE_ALLOCA_H */ #endif /* not __GNUC__ */ #endif /* not alloca */ #define REGEX_ALLOCATE alloca /* Assumes a `char *destination' variable. */ #define REGEX_REALLOCATE(source, osize, nsize) \ (destination = (char *) alloca (nsize), \ bcopy (source, destination, osize), \ destination) /* No need to do anything to free, after alloca. */ #define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */ #endif /* not REGEX_MALLOC */ /* Define how to allocate the failure stack. */ #if defined (REL_ALLOC) && defined (REGEX_MALLOC) #define REGEX_ALLOCATE_STACK(size) \ r_alloc (&failure_stack_ptr, (size)) #define REGEX_REALLOCATE_STACK(source, osize, nsize) \ r_re_alloc (&failure_stack_ptr, (nsize)) #define REGEX_FREE_STACK(ptr) \ r_alloc_free (&failure_stack_ptr) #else /* not using relocating allocator */ #ifdef REGEX_MALLOC #define REGEX_ALLOCATE_STACK malloc #define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize) #define REGEX_FREE_STACK free #else /* not REGEX_MALLOC */ #define REGEX_ALLOCATE_STACK alloca #define REGEX_REALLOCATE_STACK(source, osize, nsize) \ REGEX_REALLOCATE (source, osize, nsize) /* No need to explicitly free anything. */ #define REGEX_FREE_STACK(arg) #endif /* not REGEX_MALLOC */ #endif /* not using relocating allocator */ /* True if `size1' is non-NULL and PTR is pointing anywhere inside `string1' or just past its end. This works if PTR is NULL, which is a good thing. */ #define FIRST_STRING_P(ptr) \ (size1 && string1 <= (ptr) && (ptr) <= string1 + size1) /* (Re)Allocate N items of type T using malloc, or fail. */ #define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) #define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) #define RETALLOC_IF(addr, n, t) \ if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t) #define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) #define BYTEWIDTH 8 /* In bits. */ #define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) #undef MAX #undef MIN #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) typedef char boolean; #define false 0 #define true 1 static int re_match_2_internal (); /* These are the command codes that appear in compiled regular expressions. Some opcodes are followed by argument bytes. A command code can specify any interpretation whatsoever for its arguments. Zero bytes may appear in the compiled regular expression. */ typedef enum { no_op = 0, /* Succeed right away--no more backtracking. */ succeed, /* Followed by one byte giving n, then by n literal bytes. */ exactn, /* Matches any (more or less) character. */ anychar, /* Matches any one char belonging to specified set. First following byte is number of bitmap bytes. Then come bytes for a bitmap saying which chars are in. Bits in each byte are ordered low-bit-first. A character is in the set if its bit is 1. A character too large to have a bit in the map is automatically not in the set. */ charset, /* Same parameters as charset, but match any character that is not one of those specified. */ charset_not, /* Start remembering the text that is matched, for storing in a register. Followed by one byte with the register number, in the range 0 to one less than the pattern buffer's re_nsub field. Then followed by one byte with the number of groups inner to this one. (This last has to be part of the start_memory only because we need it in the on_failure_jump of re_match_2.) */ start_memory, /* Stop remembering the text that is matched and store it in a memory register. Followed by one byte with the register number, in the range 0 to one less than `re_nsub' in the pattern buffer, and one byte with the number of inner groups, just like `start_memory'. (We need the number of inner groups here because we don't have any easy way of finding the corresponding start_memory when we're at a stop_memory.) */ stop_memory, /* Match a duplicate of something remembered. Followed by one byte containing the register number. */ duplicate, /* Fail unless at beginning of line. */ begline, /* Fail unless at end of line. */ endline, /* Succeeds if at beginning of buffer (if emacs) or at beginning of string to be matched (if not). */ begbuf, /* Analogously, for end of buffer/string. */ endbuf, /* Followed by two byte relative address to which to jump. */ jump, /* Same as jump, but marks the end of an alternative. */ jump_past_alt, /* Followed by two-byte relative address of place to resume at in case of failure. */ on_failure_jump, /* Like on_failure_jump, but pushes a placeholder instead of the current string position when executed. */ on_failure_keep_string_jump, /* Throw away latest failure point and then jump to following two-byte relative address. */ pop_failure_jump, /* Change to pop_failure_jump if know won't have to backtrack to match; otherwise change to jump. This is used to jump back to the beginning of a repeat. If what follows this jump clearly won't match what the repeat does, such that we can be sure that there is no use backtracking out of repetitions already matched, then we change it to a pop_failure_jump. Followed by two-byte address. */ maybe_pop_jump, /* Jump to following two-byte address, and push a dummy failure point. This failure point will be thrown away if an attempt is made to use it for a failure. A `+' construct makes this before the first repeat. Also used as an intermediary kind of jump when compiling an alternative. */ dummy_failure_jump, /* Push a dummy failure point and continue. Used at the end of alternatives. */ push_dummy_failure, /* Followed by two-byte relative address and two-byte number n. After matching N times, jump to the address upon failure. */ succeed_n, /* Followed by two-byte relative address, and two-byte number n. Jump to the address N times, then fail. */ jump_n, /* Set the following two-byte relative address to the subsequent two-byte number. The address *includes* the two bytes of number. */ set_number_at, wordchar, /* Matches any word-constituent character. */ notwordchar, /* Matches any char that is not a word-constituent. */ wordbeg, /* Succeeds if at word beginning. */ wordend, /* Succeeds if at word end. */ wordbound, /* Succeeds if at a word boundary. */ notwordbound /* Succeeds if not at a word boundary. */ #ifdef emacs ,before_dot, /* Succeeds if before point. */ at_dot, /* Succeeds if at point. */ after_dot, /* Succeeds if after point. */ /* Matches any character whose syntax is specified. Followed by a byte which contains a syntax code, e.g., Sword. */ syntaxspec, /* Matches any character whose syntax is not that specified. */ notsyntaxspec #endif /* emacs */ } re_opcode_t; /* Common operations on the compiled pattern. */ /* Store NUMBER in two contiguous bytes starting at DESTINATION. */ #define STORE_NUMBER(destination, number) \ do { \ (destination)[0] = (number) & 0377; \ (destination)[1] = (number) >> 8; \ } while (0) /* Same as STORE_NUMBER, except increment DESTINATION to the byte after where the number is stored. Therefore, DESTINATION must be an lvalue. */ #define STORE_NUMBER_AND_INCR(destination, number) \ do { \ STORE_NUMBER (destination, number); \ (destination) += 2; \ } while (0) /* Put into DESTINATION a number stored in two contiguous bytes starting at SOURCE. */ #define EXTRACT_NUMBER(destination, source) \ do { \ (destination) = *(source) & 0377; \ (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \ } while (0) #ifdef DEBUG static void extract_number _RE_ARGS ((int *dest, unsigned char *source)); static void extract_number (dest, source) int *dest; unsigned char *source; { int temp = SIGN_EXTEND_CHAR (*(source + 1)); *dest = *source & 0377; *dest += temp << 8; } #ifndef EXTRACT_MACROS /* To debug the macros. */ #undef EXTRACT_NUMBER #define EXTRACT_NUMBER(dest, src) extract_number (&dest, src) #endif /* not EXTRACT_MACROS */ #endif /* DEBUG */ /* Same as EXTRACT_NUMBER, except increment SOURCE to after the number. SOURCE must be an lvalue. */ #define EXTRACT_NUMBER_AND_INCR(destination, source) \ do { \ EXTRACT_NUMBER (destination, source); \ (source) += 2; \ } while (0) #ifdef DEBUG static void extract_number_and_incr _RE_ARGS ((int *destination, unsigned char **source)); static void extract_number_and_incr (destination, source) int *destination; unsigned char **source; { extract_number (destination, *source); *source += 2; } #ifndef EXTRACT_MACROS #undef EXTRACT_NUMBER_AND_INCR #define EXTRACT_NUMBER_AND_INCR(dest, src) \ extract_number_and_incr (&dest, &src) #endif /* not EXTRACT_MACROS */ #endif /* DEBUG */ /* If DEBUG is defined, Regex prints many voluminous messages about what it is doing (if the variable `debug' is nonzero). If linked with the main program in `iregex.c', you can enter patterns and strings interactively. And if linked with the main program in `main.c' and the other test files, you can run the already-written tests. */ #ifdef DEBUG /* We use standard I/O for debugging. */ #include /* It is useful to test things that ``must'' be true when debugging. */ #include static int debug = 0; #define DEBUG_STATEMENT(e) e #define DEBUG_PRINT1(x) if (debug) printf (x) #define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2) #define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3) #define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4) #define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \ if (debug) print_partial_compiled_pattern (s, e) #define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \ if (debug) print_double_string (w, s1, sz1, s2, sz2) /* Print the fastmap in human-readable form. */ void print_fastmap (fastmap) char *fastmap; { unsigned was_a_range = 0; unsigned i = 0; while (i < (1 << BYTEWIDTH)) { if (fastmap[i++]) { was_a_range = 0; putchar (i - 1); while (i < (1 << BYTEWIDTH) && fastmap[i]) { was_a_range = 1; i++; } if (was_a_range) { printf ("-"); putchar (i - 1); } } } putchar ('\n'); } /* Print a compiled pattern string in human-readable form, starting at the START pointer into it and ending just before the pointer END. */ void print_partial_compiled_pattern (start, end) unsigned char *start; unsigned char *end; { int mcnt, mcnt2; unsigned char *p1; unsigned char *p = start; unsigned char *pend = end; if (start == NULL) { printf ("(null)\n"); return; } /* Loop over pattern commands. */ while (p < pend) { printf ("%d:\t", p - start); switch ((re_opcode_t) *p++) { case no_op: printf ("/no_op"); break; case exactn: mcnt = *p++; printf ("/exactn/%d", mcnt); do { putchar ('/'); putchar (*p++); } while (--mcnt); break; case start_memory: mcnt = *p++; printf ("/start_memory/%d/%d", mcnt, *p++); break; case stop_memory: mcnt = *p++; printf ("/stop_memory/%d/%d", mcnt, *p++); break; case duplicate: printf ("/duplicate/%d", *p++); break; case anychar: printf ("/anychar"); break; case charset: case charset_not: { register int c, last = -100; register int in_range = 0; printf ("/charset [%s", (re_opcode_t) *(p - 1) == charset_not ? "^" : ""); assert (p + *p < pend); for (c = 0; c < 256; c++) if (c / 8 < *p && (p[1 + (c/8)] & (1 << (c % 8)))) { /* Are we starting a range? */ if (last + 1 == c && ! in_range) { putchar ('-'); in_range = 1; } /* Have we broken a range? */ else if (last + 1 != c && in_range) { putchar (last); in_range = 0; } if (! in_range) putchar (c); last = c; } if (in_range) putchar (last); putchar (']'); p += 1 + *p; } break; case begline: printf ("/begline"); break; case endline: printf ("/endline"); break; case on_failure_jump: extract_number_and_incr (&mcnt, &p); printf ("/on_failure_jump to %d", p + mcnt - start); break; case on_failure_keep_string_jump: extract_number_and_incr (&mcnt, &p); printf ("/on_failure_keep_string_jump to %d", p + mcnt - start); break; case dummy_failure_jump: extract_number_and_incr (&mcnt, &p); printf ("/dummy_failure_jump to %d", p + mcnt - start); break; case push_dummy_failure: printf ("/push_dummy_failure"); break; case maybe_pop_jump: extract_number_and_incr (&mcnt, &p); printf ("/maybe_pop_jump to %d", p + mcnt - start); break; case pop_failure_jump: extract_number_and_incr (&mcnt, &p); printf ("/pop_failure_jump to %d", p + mcnt - start); break; case jump_past_alt: extract_number_and_incr (&mcnt, &p); printf ("/jump_past_alt to %d", p + mcnt - start); break; case jump: extract_number_and_incr (&mcnt, &p); printf ("/jump to %d", p + mcnt - start); break; case succeed_n: extract_number_and_incr (&mcnt, &p); p1 = p + mcnt; extract_number_and_incr (&mcnt2, &p); printf ("/succeed_n to %d, %d times", p1 - start, mcnt2); break; case jump_n: extract_number_and_incr (&mcnt, &p); p1 = p + mcnt; extract_number_and_incr (&mcnt2, &p); printf ("/jump_n to %d, %d times", p1 - start, mcnt2); break; case set_number_at: extract_number_and_incr (&mcnt, &p); p1 = p + mcnt; extract_number_and_incr (&mcnt2, &p); printf ("/set_number_at location %d to %d", p1 - start, mcnt2); break; case wordbound: printf ("/wordbound"); break; case notwordbound: printf ("/notwordbound"); break; case wordbeg: printf ("/wordbeg"); break; case wordend: printf ("/wordend"); #ifdef emacs case before_dot: printf ("/before_dot"); break; case at_dot: printf ("/at_dot"); break; case after_dot: printf ("/after_dot"); break; case syntaxspec: printf ("/syntaxspec"); mcnt = *p++; printf ("/%d", mcnt); break; case notsyntaxspec: printf ("/notsyntaxspec"); mcnt = *p++; printf ("/%d", mcnt); break; #endif /* emacs */ case wordchar: printf ("/wordchar"); break; case notwordchar: printf ("/notwordchar"); break; case begbuf: printf ("/begbuf"); break; case endbuf: printf ("/endbuf"); break; default: printf ("?%d", *(p-1)); } putchar ('\n'); } printf ("%d:\tend of pattern.\n", p - start); } void print_compiled_pattern (bufp) struct re_pattern_buffer *bufp; { unsigned char *buffer = bufp->buffer; print_partial_compiled_pattern (buffer, buffer + bufp->used); printf ("%ld bytes used/%ld bytes allocated.\n", bufp->used, bufp->allocated); if (bufp->fastmap_accurate && bufp->fastmap) { printf ("fastmap: "); print_fastmap (bufp->fastmap); } printf ("re_nsub: %d\t", bufp->re_nsub); printf ("regs_alloc: %d\t", bufp->regs_allocated); printf ("can_be_null: %d\t", bufp->can_be_null); printf ("newline_anchor: %d\n", bufp->newline_anchor); printf ("no_sub: %d\t", bufp->no_sub); printf ("not_bol: %d\t", bufp->not_bol); printf ("not_eol: %d\t", bufp->not_eol); printf ("syntax: %lx\n", bufp->syntax); /* Perhaps we should print the translate table? */ } void print_double_string (where, string1, size1, string2, size2) const char *where; const char *string1; const char *string2; int size1; int size2; { int this_char; if (where == NULL) printf ("(null)"); else { if (FIRST_STRING_P (where)) { for (this_char = where - string1; this_char < size1; this_char++) putchar (string1[this_char]); where = string2; } for (this_char = where - string2; this_char < size2; this_char++) putchar (string2[this_char]); } } void printchar (c) int c; { putc (c, stderr); } #else /* not DEBUG */ #undef assert #define assert(e) #define DEBUG_STATEMENT(e) #define DEBUG_PRINT1(x) #define DEBUG_PRINT2(x1, x2) #define DEBUG_PRINT3(x1, x2, x3) #define DEBUG_PRINT4(x1, x2, x3, x4) #define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) #define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) #endif /* not DEBUG */ /* Set by `re_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own syntax, so it can be changed between regex compilations. */ /* This has no initializer because initialized variables in Emacs become read-only after dumping. */ reg_syntax_t re_syntax_options; /* Specify the precise syntax of regexps for compilation. This provides for compatibility for various utilities which historically have different, incompatible syntaxes. The argument SYNTAX is a bit mask comprised of the various bits defined in regex.h. We return the old syntax. */ reg_syntax_t re_set_syntax (syntax) reg_syntax_t syntax; { reg_syntax_t ret = re_syntax_options; re_syntax_options = syntax; #ifdef DEBUG if (syntax & RE_DEBUG) debug = 1; else if (debug) /* was on but now is not */ debug = 0; #endif /* DEBUG */ return ret; } /* This table gives an error message for each of the error codes listed in regex.h. Obviously the order here has to be same as there. POSIX doesn't require that we do anything for REG_NOERROR, but why not be nice? */ static const char *re_error_msgid[] = { gettext_noop ("Success"), /* REG_NOERROR */ gettext_noop ("No match"), /* REG_NOMATCH */ gettext_noop ("Invalid regular expression"), /* REG_BADPAT */ gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */ gettext_noop ("Invalid character class name"), /* REG_ECTYPE */ gettext_noop ("Trailing backslash"), /* REG_EESCAPE */ gettext_noop ("Invalid back reference"), /* REG_ESUBREG */ gettext_noop ("Unmatched [ or [^"), /* REG_EBRACK */ gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */ gettext_noop ("Unmatched \\{"), /* REG_EBRACE */ gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */ gettext_noop ("Invalid range end"), /* REG_ERANGE */ gettext_noop ("Memory exhausted"), /* REG_ESPACE */ gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */ gettext_noop ("Premature end of regular expression"), /* REG_EEND */ gettext_noop ("Regular expression too big"), /* REG_ESIZE */ gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */ }; /* Avoiding alloca during matching, to placate r_alloc. */ /* Define MATCH_MAY_ALLOCATE unless we need to make sure that the searching and matching functions should not call alloca. On some systems, alloca is implemented in terms of malloc, and if we're using the relocating allocator routines, then malloc could cause a relocation, which might (if the strings being searched are in the ralloc heap) shift the data out from underneath the regexp routines. Here's another reason to avoid allocation: Emacs processes input from X in a signal handler; processing X input may call malloc; if input arrives while a matching routine is calling malloc, then we're scrod. But Emacs can't just block input while calling matching routines; then we don't notice interrupts when they come in. So, Emacs blocks input around all regexp calls except the matching calls, which it leaves unprotected, in the faith that they will not malloc. */ /* Normally, this is fine. */ #define MATCH_MAY_ALLOCATE /* When using GNU C, we are not REALLY using the C alloca, no matter what config.h may say. So don't take precautions for it. */ #ifdef __GNUC__ #undef C_ALLOCA #endif /* The match routines may not allocate if (1) they would do it with malloc and (2) it's not safe for them to use malloc. Note that if REL_ALLOC is defined, matching would not use malloc for the failure stack, but we would still use it for the register vectors; so REL_ALLOC should not affect this. */ #if (defined (C_ALLOCA) || defined (REGEX_MALLOC)) && defined (emacs) #undef MATCH_MAY_ALLOCATE #endif /* Failure stack declarations and macros; both re_compile_fastmap and re_match_2 use a failure stack. These have to be macros because of REGEX_ALLOCATE_STACK. */ /* Number of failure points for which to initially allocate space when matching. If this number is exceeded, we allocate more space, so it is not a hard limit. */ #ifndef INIT_FAILURE_ALLOC #define INIT_FAILURE_ALLOC 5 #endif /* Roughly the maximum number of failure points on the stack. Would be exactly that if always used MAX_FAILURE_ITEMS items each time we failed. This is a variable only so users of regex can assign to it; we never change it ourselves. */ #ifdef INT_IS_16BIT #if defined (MATCH_MAY_ALLOCATE) /* 4400 was enough to cause a crash on Alpha OSF/1, whose default stack limit is 2mb. */ long int re_max_failures = 4000; #else long int re_max_failures = 2000; #endif union fail_stack_elt { unsigned char *pointer; long int integer; }; typedef union fail_stack_elt fail_stack_elt_t; typedef struct { fail_stack_elt_t *stack; unsigned long int size; unsigned long int avail; /* Offset of next open position. */ } fail_stack_type; #else /* not INT_IS_16BIT */ #if defined (MATCH_MAY_ALLOCATE) /* 4400 was enough to cause a crash on Alpha OSF/1, whose default stack limit is 2mb. */ int re_max_failures = 20000; #else int re_max_failures = 2000; #endif union fail_stack_elt { unsigned char *pointer; int integer; }; typedef union fail_stack_elt fail_stack_elt_t; typedef struct { fail_stack_elt_t *stack; unsigned size; unsigned avail; /* Offset of next open position. */ } fail_stack_type; #endif /* INT_IS_16BIT */ #define FAIL_STACK_EMPTY() (fail_stack.avail == 0) #define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0) #define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size) /* Define macros to initialize and free the failure stack. Do `return -2' if the alloc fails. */ #ifdef MATCH_MAY_ALLOCATE #define INIT_FAIL_STACK() \ do { \ fail_stack.stack = (fail_stack_elt_t *) \ REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \ \ if (fail_stack.stack == NULL) \ return -2; \ \ fail_stack.size = INIT_FAILURE_ALLOC; \ fail_stack.avail = 0; \ } while (0) #define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack) #else #define INIT_FAIL_STACK() \ do { \ fail_stack.avail = 0; \ } while (0) #define RESET_FAIL_STACK() #endif /* Double the size of FAIL_STACK, up to approximately `re_max_failures' items. Return 1 if succeeds, and 0 if either ran out of memory allocating space for it or it was already too large. REGEX_REALLOCATE_STACK requires `destination' be declared. */ #define DOUBLE_FAIL_STACK(fail_stack) \ ((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS) \ ? 0 \ : ((fail_stack).stack = (fail_stack_elt_t *) \ REGEX_REALLOCATE_STACK ((fail_stack).stack, \ (fail_stack).size * sizeof (fail_stack_elt_t), \ ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \ \ (fail_stack).stack == NULL \ ? 0 \ : ((fail_stack).size <<= 1, \ 1))) /* Push pointer POINTER on FAIL_STACK. Return 1 if was able to do so and 0 if ran out of memory allocating space to do so. */ #define PUSH_PATTERN_OP(POINTER, FAIL_STACK) \ ((FAIL_STACK_FULL () \ && !DOUBLE_FAIL_STACK (FAIL_STACK)) \ ? 0 \ : ((FAIL_STACK).stack[(FAIL_STACK).avail++].pointer = POINTER, \ 1)) /* Push a pointer value onto the failure stack. Assumes the variable `fail_stack'. Probably should only be called from within `PUSH_FAILURE_POINT'. */ #define PUSH_FAILURE_POINTER(item) \ fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (item) /* This pushes an integer-valued item onto the failure stack. Assumes the variable `fail_stack'. Probably should only be called from within `PUSH_FAILURE_POINT'. */ #define PUSH_FAILURE_INT(item) \ fail_stack.stack[fail_stack.avail++].integer = (item) /* Push a fail_stack_elt_t value onto the failure stack. Assumes the variable `fail_stack'. Probably should only be called from within `PUSH_FAILURE_POINT'. */ #define PUSH_FAILURE_ELT(item) \ fail_stack.stack[fail_stack.avail++] = (item) /* These three POP... operations complement the three PUSH... operations. All assume that `fail_stack' is nonempty. */ #define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer #define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer #define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail] /* Used to omit pushing failure point id's when we're not debugging. */ #ifdef DEBUG #define DEBUG_PUSH PUSH_FAILURE_INT #define DEBUG_POP(item_addr) (item_addr)->integer = POP_FAILURE_INT () #else #define DEBUG_PUSH(item) #define DEBUG_POP(item_addr) #endif /* Push the information about the state we will need if we ever fail back to it. Requires variables fail_stack, regstart, regend, reg_info, and num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be declared. Does `return FAILURE_CODE' if runs out of memory. */ #define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \ do { \ char *destination; \ /* Must be int, so when we don't save any registers, the arithmetic \ of 0 + -1 isn't done as unsigned. */ \ /* Can't be int, since there is not a shred of a guarantee that int \ is wide enough to hold a value of something to which pointer can \ be assigned */ \ s_reg_t this_reg; \ \ DEBUG_STATEMENT (failure_id++); \ DEBUG_STATEMENT (nfailure_points_pushed++); \ DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \ DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\ DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\ \ DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \ DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \ \ /* Ensure we have enough space allocated for what we will push. */ \ while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \ { \ if (!DOUBLE_FAIL_STACK (fail_stack)) \ return failure_code; \ \ DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \ (fail_stack).size); \ DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\ } \ \ /* Push the info, starting with the registers. */ \ DEBUG_PRINT1 ("\n"); \ \ if (1) \ for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ this_reg++) \ { \ DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \ DEBUG_STATEMENT (num_regs_pushed++); \ \ DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \ PUSH_FAILURE_POINTER (regstart[this_reg]); \ \ DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \ PUSH_FAILURE_POINTER (regend[this_reg]); \ \ DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \ DEBUG_PRINT2 (" match_null=%d", \ REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \ DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \ DEBUG_PRINT2 (" matched_something=%d", \ MATCHED_SOMETHING (reg_info[this_reg])); \ DEBUG_PRINT2 (" ever_matched=%d", \ EVER_MATCHED_SOMETHING (reg_info[this_reg])); \ DEBUG_PRINT1 ("\n"); \ PUSH_FAILURE_ELT (reg_info[this_reg].word); \ } \ \ DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\ PUSH_FAILURE_INT (lowest_active_reg); \ \ DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\ PUSH_FAILURE_INT (highest_active_reg); \ \ DEBUG_PRINT2 (" Pushing pattern 0x%x:\n", pattern_place); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ PUSH_FAILURE_POINTER (pattern_place); \ \ DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \ DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \ size2); \ DEBUG_PRINT1 ("'\n"); \ PUSH_FAILURE_POINTER (string_place); \ \ DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \ DEBUG_PUSH (failure_id); \ } while (0) /* This is the number of items that are pushed and popped on the stack for each register. */ #define NUM_REG_ITEMS 3 /* Individual items aside from the registers. */ #ifdef DEBUG #define NUM_NONREG_ITEMS 5 /* Includes failure point id. */ #else #define NUM_NONREG_ITEMS 4 #endif /* We push at most this many items on the stack. */ /* We used to use (num_regs - 1), which is the number of registers this regexp will save; but that was changed to 5 to avoid stack overflow for a regexp with lots of parens. */ #define MAX_FAILURE_ITEMS (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS) /* We actually push this many items. */ #define NUM_FAILURE_ITEMS \ (((0 \ ? 0 : highest_active_reg - lowest_active_reg + 1) \ * NUM_REG_ITEMS) \ + NUM_NONREG_ITEMS) /* How many items can still be added to the stack without overflowing it. */ #define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail) /* Pops what PUSH_FAIL_STACK pushes. We restore into the parameters, all of which should be lvalues: STR -- the saved data position. PAT -- the saved pattern position. LOW_REG, HIGH_REG -- the highest and lowest active registers. REGSTART, REGEND -- arrays of string positions. REG_INFO -- array of information about each subexpression. Also assumes the variables `fail_stack' and (if debugging), `bufp', `pend', `string1', `size1', `string2', and `size2'. */ #define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\ { \ DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \ s_reg_t this_reg; \ const unsigned char *string_temp; \ \ assert (!FAIL_STACK_EMPTY ()); \ \ /* Remove failure points and point to how many regs pushed. */ \ DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \ DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \ DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \ \ assert (fail_stack.avail >= NUM_NONREG_ITEMS); \ \ DEBUG_POP (&failure_id); \ DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \ \ /* If the saved string location is NULL, it came from an \ on_failure_keep_string_jump opcode, and we want to throw away the \ saved NULL, thus retaining our current position in the string. */ \ string_temp = POP_FAILURE_POINTER (); \ if (string_temp != NULL) \ str = (const char *) string_temp; \ \ DEBUG_PRINT2 (" Popping string 0x%x: `", str); \ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ DEBUG_PRINT1 ("'\n"); \ \ pat = (unsigned char *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" Popping pattern 0x%x:\n", pat); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ \ /* Restore register info. */ \ high_reg = (active_reg_t) POP_FAILURE_INT (); \ DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \ \ low_reg = (active_reg_t) POP_FAILURE_INT (); \ DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \ \ if (1) \ for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \ { \ DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \ \ reg_info[this_reg].word = POP_FAILURE_ELT (); \ DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \ \ regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \ \ regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \ } \ else \ { \ for (this_reg = highest_active_reg; this_reg > high_reg; this_reg--) \ { \ reg_info[this_reg].word.integer = 0; \ regend[this_reg] = 0; \ regstart[this_reg] = 0; \ } \ highest_active_reg = high_reg; \ } \ \ set_regs_matched_done = 0; \ DEBUG_STATEMENT (nfailure_points_popped++); \ } /* POP_FAILURE_POINT */ /* Structure for per-register (a.k.a. per-group) information. Other register information, such as the starting and ending positions (which are addresses), and the list of inner groups (which is a bits list) are maintained in separate variables. We are making a (strictly speaking) nonportable assumption here: that the compiler will pack our bit fields into something that fits into the type of `word', i.e., is something that fits into one item on the failure stack. */ /* Declarations and macros for re_match_2. */ typedef union { fail_stack_elt_t word; struct { /* This field is one if this group can match the empty string, zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */ #define MATCH_NULL_UNSET_VALUE 3 unsigned match_null_string_p : 2; unsigned is_active : 1; unsigned matched_something : 1; unsigned ever_matched_something : 1; } bits; } register_info_type; #define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p) #define IS_ACTIVE(R) ((R).bits.is_active) #define MATCHED_SOMETHING(R) ((R).bits.matched_something) #define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something) /* Call this when have matched a real character; it sets `matched' flags for the subexpressions which we are currently inside. Also records that those subexprs have matched. */ #define SET_REGS_MATCHED() \ do \ { \ if (!set_regs_matched_done) \ { \ active_reg_t r; \ set_regs_matched_done = 1; \ for (r = lowest_active_reg; r <= highest_active_reg; r++) \ { \ MATCHED_SOMETHING (reg_info[r]) \ = EVER_MATCHED_SOMETHING (reg_info[r]) \ = 1; \ } \ } \ } \ while (0) /* Registers are set to a sentinel when they haven't yet matched. */ static char reg_unset_dummy; #define REG_UNSET_VALUE (®_unset_dummy) #define REG_UNSET(e) ((e) == REG_UNSET_VALUE) /* Subroutine declarations and macros for regex_compile. */ static reg_errcode_t regex_compile _RE_ARGS ((const char *pattern, size_t size, reg_syntax_t syntax, struct re_pattern_buffer *bufp)); static void store_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg)); static void store_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg1, int arg2)); static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg, unsigned char *end)); static void insert_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end)); static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p, reg_syntax_t syntax)); static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend, reg_syntax_t syntax)); static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr, const char *pend, char *translate, reg_syntax_t syntax, unsigned char *b)); /* Fetch the next character in the uncompiled pattern---translating it if necessary. Also cast from a signed character in the constant string passed to us by the user to an unsigned char that we can use as an array index (in, e.g., `translate'). */ #ifndef PATFETCH #define PATFETCH(c) \ do {if (p == pend) return REG_EEND; \ c = (unsigned char) *p++; \ if (translate) c = (unsigned char) translate[c]; \ } while (0) #endif /* Fetch the next character in the uncompiled pattern, with no translation. */ #define PATFETCH_RAW(c) \ do {if (p == pend) return REG_EEND; \ c = (unsigned char) *p++; \ } while (0) /* Go backwards one character in the pattern. */ #define PATUNFETCH p-- /* If `translate' is non-null, return translate[D], else just D. We cast the subscript to translate because some data is declared as `char *', to avoid warnings when a string constant is passed. But when we use a character as a subscript we must make it unsigned. */ #ifndef TRANSLATE #define TRANSLATE(d) \ (translate ? (char) translate[(unsigned char) (d)] : (d)) #endif /* Macros for outputting the compiled pattern into `buffer'. */ /* If the buffer isn't allocated when it comes in, use this. */ #define INIT_BUF_SIZE 32 /* Make sure we have at least N more bytes of space in buffer. */ #define GET_BUFFER_SPACE(n) \ while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated) \ EXTEND_BUFFER () /* Make sure we have one more byte of buffer space and then add C to it. */ #define BUF_PUSH(c) \ do { \ GET_BUFFER_SPACE (1); \ *b++ = (unsigned char) (c); \ } while (0) /* Ensure we have two more bytes of buffer space and then append C1 and C2. */ #define BUF_PUSH_2(c1, c2) \ do { \ GET_BUFFER_SPACE (2); \ *b++ = (unsigned char) (c1); \ *b++ = (unsigned char) (c2); \ } while (0) /* As with BUF_PUSH_2, except for three bytes. */ #define BUF_PUSH_3(c1, c2, c3) \ do { \ GET_BUFFER_SPACE (3); \ *b++ = (unsigned char) (c1); \ *b++ = (unsigned char) (c2); \ *b++ = (unsigned char) (c3); \ } while (0) /* Store a jump with opcode OP at LOC to location TO. We store a relative address offset by the three bytes the jump itself occupies. */ #define STORE_JUMP(op, loc, to) \ store_op1 (op, loc, (int) ((to) - (loc) - 3)) /* Likewise, for a two-argument jump. */ #define STORE_JUMP2(op, loc, to, arg) \ store_op2 (op, loc, (int) ((to) - (loc) - 3), arg) /* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */ #define INSERT_JUMP(op, loc, to) \ insert_op1 (op, loc, (int) ((to) - (loc) - 3), b) /* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */ #define INSERT_JUMP2(op, loc, to, arg) \ insert_op2 (op, loc, (int) ((to) - (loc) - 3), arg, b) /* This is not an arbitrary limit: the arguments which represent offsets into the pattern are two bytes long. So if 2^16 bytes turns out to be too small, many things would have to change. */ /* Any other compiler which, like MSC, has allocation limit below 2^16 bytes will have to use approach similar to what was done below for MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up reallocating to 0 bytes. Such thing is not going to work too well. You have been warned!! */ #if defined(_MSC_VER) && !defined(WIN32) /* Microsoft C 16-bit versions limit malloc to approx 65512 bytes. The REALLOC define eliminates a flurry of conversion warnings, but is not required. */ #define MAX_BUF_SIZE 65500L #define REALLOC(p,s) realloc ((p), (size_t) (s)) #else #define MAX_BUF_SIZE (1L << 16) #define REALLOC(p,s) realloc ((p), (s)) #endif /* Extend the buffer by twice its current size via realloc and reset the pointers that pointed into the old block to point to the correct places in the new one. If extending the buffer results in it being larger than MAX_BUF_SIZE, then flag memory exhausted. */ #define EXTEND_BUFFER() \ do { \ unsigned char *old_buffer = bufp->buffer; \ if (bufp->allocated == MAX_BUF_SIZE) \ return REG_ESIZE; \ bufp->allocated <<= 1; \ if (bufp->allocated > MAX_BUF_SIZE) \ bufp->allocated = MAX_BUF_SIZE; \ bufp->buffer = (unsigned char *) REALLOC (bufp->buffer, bufp->allocated);\ if (bufp->buffer == NULL) \ return REG_ESPACE; \ /* If the buffer moved, move all the pointers into it. */ \ if (old_buffer != bufp->buffer) \ { \ b = (b - old_buffer) + bufp->buffer; \ begalt = (begalt - old_buffer) + bufp->buffer; \ if (fixup_alt_jump) \ fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\ if (laststart) \ laststart = (laststart - old_buffer) + bufp->buffer; \ if (pending_exact) \ pending_exact = (pending_exact - old_buffer) + bufp->buffer; \ } \ } while (0) /* Since we have one byte reserved for the register number argument to {start,stop}_memory, the maximum number of groups we can report things about is what fits in that byte. */ #define MAX_REGNUM 255 /* But patterns can have more than `MAX_REGNUM' registers. We just ignore the excess. */ typedef unsigned regnum_t; /* Macros for the compile stack. */ /* Since offsets can go either forwards or backwards, this type needs to be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */ /* int may be not enough when sizeof(int) == 2. */ typedef long pattern_offset_t; typedef struct { pattern_offset_t begalt_offset; pattern_offset_t fixup_alt_jump; pattern_offset_t inner_group_offset; pattern_offset_t laststart_offset; regnum_t regnum; } compile_stack_elt_t; typedef struct { compile_stack_elt_t *stack; unsigned size; unsigned avail; /* Offset of next open position. */ } compile_stack_type; #define INIT_COMPILE_STACK_SIZE 32 #define COMPILE_STACK_EMPTY (compile_stack.avail == 0) #define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size) /* The next available element. */ #define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) /* Set the bit for character C in a list. */ #define SET_LIST_BIT(c) \ (b[((unsigned char) (c)) / BYTEWIDTH] \ |= 1 << (((unsigned char) c) % BYTEWIDTH)) /* Get the next unsigned number in the uncompiled pattern. */ #define GET_UNSIGNED_NUMBER(num) \ { if (p != pend) \ { \ PATFETCH (c); \ while (ISDIGIT (c)) \ { \ if (num < 0) \ num = 0; \ num = num * 10 + c - '0'; \ if (p == pend) \ break; \ PATFETCH (c); \ } \ } \ } #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) /* The GNU C library provides support for user-defined character classes and the functions from ISO C amendement 1. */ # ifdef CHARCLASS_NAME_MAX # define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX # else /* This shouldn't happen but some implementation might still have this problem. Use a reasonable default value. */ # define CHAR_CLASS_MAX_LENGTH 256 # endif # define IS_CHAR_CLASS(string) wctype (string) #else # define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ # define IS_CHAR_CLASS(string) \ (STREQ (string, "alpha") || STREQ (string, "upper") \ || STREQ (string, "lower") || STREQ (string, "digit") \ || STREQ (string, "alnum") || STREQ (string, "xdigit") \ || STREQ (string, "space") || STREQ (string, "print") \ || STREQ (string, "punct") || STREQ (string, "graph") \ || STREQ (string, "cntrl") || STREQ (string, "blank")) #endif #ifndef MATCH_MAY_ALLOCATE /* If we cannot allocate large objects within re_match_2_internal, we make the fail stack and register vectors global. The fail stack, we grow to the maximum size when a regexp is compiled. The register vectors, we adjust in size each time we compile a regexp, according to the number of registers it needs. */ static fail_stack_type fail_stack; /* Size with which the following vectors are currently allocated. That is so we can make them bigger as needed, but never make them smaller. */ static int regs_allocated_size; static const char ** regstart, ** regend; static const char ** old_regstart, ** old_regend; static const char **best_regstart, **best_regend; static register_info_type *reg_info; static const char **reg_dummy; static register_info_type *reg_info_dummy; /* Make the register vectors big enough for NUM_REGS registers, but don't make them smaller. */ static regex_grow_registers (num_regs) int num_regs; { if (num_regs > regs_allocated_size) { RETALLOC_IF (regstart, num_regs, const char *); RETALLOC_IF (regend, num_regs, const char *); RETALLOC_IF (old_regstart, num_regs, const char *); RETALLOC_IF (old_regend, num_regs, const char *); RETALLOC_IF (best_regstart, num_regs, const char *); RETALLOC_IF (best_regend, num_regs, const char *); RETALLOC_IF (reg_info, num_regs, register_info_type); RETALLOC_IF (reg_dummy, num_regs, const char *); RETALLOC_IF (reg_info_dummy, num_regs, register_info_type); regs_allocated_size = num_regs; } } #endif /* not MATCH_MAY_ALLOCATE */ static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type compile_stack, regnum_t regnum)); /* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. Returns one of error codes defined in `regex.h', or zero for success. Assumes the `allocated' (and perhaps `buffer') and `translate' fields are set in BUFP on entry. If it succeeds, results are put in BUFP (if it returns an error, the contents of BUFP are undefined): `buffer' is the compiled pattern; `syntax' is set to SYNTAX; `used' is set to the length of the compiled pattern; `fastmap_accurate' is zero; `re_nsub' is the number of subexpressions in PATTERN; `not_bol' and `not_eol' are zero; The `fastmap' and `newline_anchor' fields are neither examined nor set. */ /* Return, freeing storage we allocated. */ #define FREE_STACK_RETURN(value) \ return (free (compile_stack.stack), value) /* __MEM_CHECKED__ */ static reg_errcode_t regex_compile (pattern, size, syntax, bufp) const char *pattern; size_t size; reg_syntax_t syntax; struct re_pattern_buffer *bufp; { /* We fetch characters from PATTERN here. Even though PATTERN is `char *' (i.e., signed), we declare these variables as unsigned, so they can be reliably used as array indices. */ register unsigned char c, c1; /* A random temporary spot in PATTERN. */ const char *p1; /* Points to the end of the buffer, where we should append. */ register unsigned char *b; /* Keeps track of unclosed groups. */ compile_stack_type compile_stack; /* Points to the current (ending) position in the pattern. */ const char *p = pattern; const char *pend = pattern + size; /* How to translate the characters in the pattern. */ RE_TRANSLATE_TYPE translate = bufp->translate; /* Address of the count-byte of the most recently inserted `exactn' command. This makes it possible to tell if a new exact-match character can be added to that command or if the character requires a new `exactn' command. */ unsigned char *pending_exact = 0; /* Address of start of the most recently finished expression. This tells, e.g., postfix * where to find the start of its operand. Reset at the beginning of groups and alternatives. */ unsigned char *laststart = 0; /* Address of beginning of regexp, or inside of last group. */ unsigned char *begalt; /* Place in the uncompiled pattern (i.e., the {) to which to go back if the interval is invalid. */ const char *beg_interval; /* Address of the place where a forward jump should go to the end of the containing expression. Each alternative of an `or' -- except the last -- ends with a forward jump of this sort. */ unsigned char *fixup_alt_jump = 0; /* Counts open-groups as they are encountered. Remembered for the matching close-group on the compile stack, so the same register number is put in the stop_memory as the start_memory. */ regnum_t regnum = 0; #ifdef DEBUG DEBUG_PRINT1 ("\nCompiling pattern: "); if (debug) { unsigned debug_count; for (debug_count = 0; debug_count < size; debug_count++) putchar (pattern[debug_count]); putchar ('\n'); } #endif /* DEBUG */ /* Initialize the compile stack. */ compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t); if (compile_stack.stack == NULL) return REG_ESPACE; compile_stack.size = INIT_COMPILE_STACK_SIZE; compile_stack.avail = 0; /* Initialize the pattern buffer. */ bufp->syntax = syntax; bufp->fastmap_accurate = 0; bufp->not_bol = bufp->not_eol = 0; /* Set `used' to zero, so that if we return an error, the pattern printer (for debugging) will think there's no pattern. We reset it at the end. */ bufp->used = 0; /* Always count groups, whether or not bufp->no_sub is set. */ bufp->re_nsub = 0; #if !defined (emacs) && !defined (SYNTAX_TABLE) /* Initialize the syntax table. */ init_syntax_once (); #endif if (bufp->allocated == 0) { if (bufp->buffer) { /* If zero allocated, but buffer is non-null, try to realloc enough space. This loses if buffer's address is bogus, but that is the user's responsibility. */ RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char); } else { /* Caller did not allocate a buffer. Do it for them. */ bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char); } if (!bufp->buffer) FREE_STACK_RETURN (REG_ESPACE); bufp->allocated = INIT_BUF_SIZE; } begalt = b = bufp->buffer; /* Loop through the uncompiled pattern until we're at the end. */ while (p != pend) { PATFETCH (c); switch (c) { case '^': { if ( /* If at start of pattern, it's an operator. */ p == pattern + 1 /* If context independent, it's an operator. */ || syntax & RE_CONTEXT_INDEP_ANCHORS /* Otherwise, depends on what's come before. */ || at_begline_loc_p (pattern, p, syntax)) BUF_PUSH (begline); else goto normal_char; } break; case '$': { if ( /* If at end of pattern, it's an operator. */ p == pend /* If context independent, it's an operator. */ || syntax & RE_CONTEXT_INDEP_ANCHORS /* Otherwise, depends on what's next. */ || at_endline_loc_p (p, pend, syntax)) BUF_PUSH (endline); else goto normal_char; } break; case '+': case '?': if ((syntax & RE_BK_PLUS_QM) || (syntax & RE_LIMITED_OPS)) goto normal_char; handle_plus: case '*': /* If there is no previous pattern... */ if (!laststart) { if (syntax & RE_CONTEXT_INVALID_OPS) FREE_STACK_RETURN (REG_BADRPT); else if (!(syntax & RE_CONTEXT_INDEP_OPS)) goto normal_char; } { /* Are we optimizing this jump? */ boolean keep_string_p = false; /* 1 means zero (many) matches is allowed. */ char zero_times_ok = 0, many_times_ok = 0; /* If there is a sequence of repetition chars, collapse it down to just one (the right one). We can't combine interval operators with these because of, e.g., `a{2}*', which should only match an even number of `a's. */ for (;;) { zero_times_ok |= c != '+'; many_times_ok |= c != '?'; if (p == pend) break; PATFETCH (c); if (c == '*' || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?'))) ; else if (syntax & RE_BK_PLUS_QM && c == '\\') { if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); PATFETCH (c1); if (!(c1 == '+' || c1 == '?')) { PATUNFETCH; PATUNFETCH; break; } c = c1; } else { PATUNFETCH; break; } /* If we get here, we found another repeat character. */ } /* Star, etc. applied to an empty pattern is equivalent to an empty pattern. */ if (!laststart) break; /* Now we know whether or not zero matches is allowed and also whether or not two or more matches is allowed. */ if (many_times_ok) { /* More than one repetition is allowed, so put in at the end a backward relative jump from `b' to before the next jump we're going to put in below (which jumps from laststart to after this jump). But if we are at the `*' in the exact sequence `.*\n', insert an unconditional jump backwards to the ., instead of the beginning of the loop. This way we only push a failure point once, instead of every time through the loop. */ assert (p - 1 > pattern); /* Allocate the space for the jump. */ GET_BUFFER_SPACE (3); /* We know we are not at the first character of the pattern, because laststart was nonzero. And we've already incremented `p', by the way, to be the character after the `*'. Do we have to do something analogous here for null bytes, because of RE_DOT_NOT_NULL? */ if (TRANSLATE (*(p - 2)) == TRANSLATE ('.') && zero_times_ok && p < pend && TRANSLATE (*p) == TRANSLATE ('\n') && !(syntax & RE_DOT_NEWLINE)) { /* We have .*\n. */ STORE_JUMP (jump, b, laststart); keep_string_p = true; } else /* Anything else. */ STORE_JUMP (maybe_pop_jump, b, laststart - 3); /* We've added more stuff to the buffer. */ b += 3; } /* On failure, jump from laststart to b + 3, which will be the end of the buffer after this jump is inserted. */ GET_BUFFER_SPACE (3); INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump : on_failure_jump, laststart, b + 3); pending_exact = 0; b += 3; if (!zero_times_ok) { /* At least one repetition is required, so insert a `dummy_failure_jump' before the initial `on_failure_jump' instruction of the loop. This effects a skip over that instruction the first time we hit that loop. */ GET_BUFFER_SPACE (3); INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6); b += 3; } } break; case '.': laststart = b; BUF_PUSH (anychar); break; case '[': { boolean had_char_class = false; if (p == pend) FREE_STACK_RETURN (REG_EBRACK); /* Ensure that we have enough space to push a charset: the opcode, the length count, and the bitset; 34 bytes in all. */ GET_BUFFER_SPACE (34); laststart = b; /* We test `*p == '^' twice, instead of using an if statement, so we only need one BUF_PUSH. */ BUF_PUSH (*p == '^' ? charset_not : charset); if (*p == '^') p++; /* Remember the first position in the bracket expression. */ p1 = p; /* Push the number of bytes in the bitmap. */ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); /* Clear the whole map. */ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH); /* charset_not matches newline according to a syntax bit. */ if ((re_opcode_t) b[-2] == charset_not && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) SET_LIST_BIT ('\n'); /* Read in characters and ranges, setting map bits. */ for (;;) { if (p == pend) FREE_STACK_RETURN (REG_EBRACK); PATFETCH (c); /* \ might escape characters inside [...] and [^...]. */ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') { if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); PATFETCH (c1); SET_LIST_BIT (c1); continue; } /* Could be the end of the bracket expression. If it's not (i.e., when the bracket expression is `[]' so far), the ']' character bit gets set way below. */ if (c == ']' && p != p1 + 1) break; /* Look ahead to see if it's a range when the last thing was a character class. */ if (had_char_class && c == '-' && *p != ']') FREE_STACK_RETURN (REG_ERANGE); /* Look ahead to see if it's a range when the last thing was a character: if this is a hyphen not at the beginning or the end of a list, then it's the range operator. */ if (c == '-' && !(p - 2 >= pattern && p[-2] == '[') && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') && *p != ']') { reg_errcode_t ret = compile_range (&p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); } else if (p[0] == '-' && p[1] != ']') { /* This handles ranges made up of characters only. */ reg_errcode_t ret; /* Move past the `-'. */ PATFETCH (c1); ret = compile_range (&p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); } /* See if we're at the beginning of a possible character class. */ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') { /* Leave room for the null. */ char str[CHAR_CLASS_MAX_LENGTH + 1]; PATFETCH (c); c1 = 0; /* If pattern is `[[:'. */ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (;;) { PATFETCH (c); if (c == ':' || c == ']' || p == pend || c1 == CHAR_CLASS_MAX_LENGTH) break; str[c1++] = c; } str[c1] = '\0'; /* If isn't a word bracketed by `[:' and:`]': undo the ending character, the letters, and leave the leading `:' and `[' (but set bits for them). */ if (c == ':' && *p == ']') { #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) boolean is_lower = STREQ (str, "lower"); boolean is_upper = STREQ (str, "upper"); wctype_t wt; int ch; wt = wctype (str); if (wt == 0) FREE_STACK_RETURN (REG_ECTYPE); /* Throw away the ] at the end of the character class. */ PATFETCH (c); if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (ch = 0; ch < 1 << BYTEWIDTH; ++ch) { if (iswctype (btowc (ch), wt)) SET_LIST_BIT (ch); if (translate && (is_upper || is_lower) && (ISUPPER (ch) || ISLOWER (ch))) SET_LIST_BIT (ch); } had_char_class = true; #else int ch; boolean is_alnum = STREQ (str, "alnum"); boolean is_alpha = STREQ (str, "alpha"); boolean is_blank = STREQ (str, "blank"); boolean is_cntrl = STREQ (str, "cntrl"); boolean is_digit = STREQ (str, "digit"); boolean is_graph = STREQ (str, "graph"); boolean is_lower = STREQ (str, "lower"); boolean is_print = STREQ (str, "print"); boolean is_punct = STREQ (str, "punct"); boolean is_space = STREQ (str, "space"); boolean is_upper = STREQ (str, "upper"); boolean is_xdigit = STREQ (str, "xdigit"); if (!IS_CHAR_CLASS (str)) FREE_STACK_RETURN (REG_ECTYPE); /* Throw away the ] at the end of the character class. */ PATFETCH (c); if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (ch = 0; ch < 1 << BYTEWIDTH; ch++) { /* This was split into 3 if's to avoid an arbitrary limit in some compiler. */ if ( (is_alnum && ISALNUM (ch)) || (is_alpha && ISALPHA (ch)) || (is_blank && ISBLANK (ch)) || (is_cntrl && ISCNTRL (ch))) SET_LIST_BIT (ch); if ( (is_digit && ISDIGIT (ch)) || (is_graph && ISGRAPH (ch)) || (is_lower && ISLOWER (ch)) || (is_print && ISPRINT (ch))) SET_LIST_BIT (ch); if ( (is_punct && ISPUNCT (ch)) || (is_space && ISSPACE (ch)) || (is_upper && ISUPPER (ch)) || (is_xdigit && ISXDIGIT (ch))) SET_LIST_BIT (ch); if ( translate && (is_upper || is_lower) && (ISUPPER (ch) || ISLOWER (ch))) SET_LIST_BIT (ch); } had_char_class = true; #endif /* libc || wctype.h */ } else { c1++; while (c1--) PATUNFETCH; SET_LIST_BIT ('['); SET_LIST_BIT (':'); had_char_class = false; } } else { had_char_class = false; SET_LIST_BIT (c); } } /* Discard any (non)matching list bytes that are all 0 at the end of the map. Decrease the map-length byte too. */ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) b[-1]--; b += b[-1]; } break; case '(': if (syntax & RE_NO_BK_PARENS) goto handle_open; else goto normal_char; case ')': if (syntax & RE_NO_BK_PARENS) goto handle_close; else goto normal_char; case '\n': if (syntax & RE_NEWLINE_ALT) goto handle_alt; else goto normal_char; case '|': if (syntax & RE_NO_BK_VBAR) goto handle_alt; else goto normal_char; case '{': if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES) goto handle_interval; else goto normal_char; case '\\': if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); /* Do not translate the character after the \, so that we can distinguish, e.g., \B from \b, even if we normally would translate, e.g., B to b. */ PATFETCH_RAW (c); switch (c) { case '(': if (syntax & RE_NO_BK_PARENS) goto normal_backslash; handle_open: bufp->re_nsub++; regnum++; if (COMPILE_STACK_FULL) { RETALLOC (compile_stack.stack, compile_stack.size << 1, compile_stack_elt_t); if (compile_stack.stack == NULL) return REG_ESPACE; compile_stack.size <<= 1; } /* These are the values to restore when we hit end of this group. They are all relative offsets, so that if the whole pattern moves because of realloc, they will still be valid. */ COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer; COMPILE_STACK_TOP.fixup_alt_jump = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer; COMPILE_STACK_TOP.regnum = regnum; /* We will eventually replace the 0 with the number of groups inner to this one. But do not push a start_memory for groups beyond the last one we can represent in the compiled pattern. */ if (regnum <= MAX_REGNUM) { COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2; BUF_PUSH_3 (start_memory, regnum, 0); } compile_stack.avail++; fixup_alt_jump = 0; laststart = 0; begalt = b; /* If we've reached MAX_REGNUM groups, then this open won't actually generate any code, so we'll have to clear pending_exact explicitly. */ pending_exact = 0; break; case ')': if (syntax & RE_NO_BK_PARENS) goto normal_backslash; if (COMPILE_STACK_EMPTY) { if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) goto normal_backslash; else FREE_STACK_RETURN (REG_ERPAREN); } handle_close: if (fixup_alt_jump) { /* Push a dummy failure point at the end of the alternative for a possible future `pop_failure_jump' to pop. See comments at `push_dummy_failure' in `re_match_2'. */ BUF_PUSH (push_dummy_failure); /* We allocated space for this jump when we assigned to `fixup_alt_jump', in the `handle_alt' case below. */ STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1); } /* See similar code for backslashed left paren above. */ if (COMPILE_STACK_EMPTY) { if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) goto normal_char; else FREE_STACK_RETURN (REG_ERPAREN); } /* Since we just checked for an empty stack above, this ``can't happen''. */ assert (compile_stack.avail != 0); { /* We don't just want to restore into `regnum', because later groups should continue to be numbered higher, as in `(ab)c(de)' -- the second group is #2. */ regnum_t this_group_regnum; compile_stack.avail--; begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset; fixup_alt_jump = COMPILE_STACK_TOP.fixup_alt_jump ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 : 0; laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset; this_group_regnum = COMPILE_STACK_TOP.regnum; /* If we've reached MAX_REGNUM groups, then this open won't actually generate any code, so we'll have to clear pending_exact explicitly. */ pending_exact = 0; /* We're at the end of the group, so now we know how many groups were inside this one. */ if (this_group_regnum <= MAX_REGNUM) { unsigned char *inner_group_loc = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset; *inner_group_loc = regnum - this_group_regnum; BUF_PUSH_3 (stop_memory, this_group_regnum, regnum - this_group_regnum); } } break; case '|': /* `\|'. */ if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR) goto normal_backslash; handle_alt: if (syntax & RE_LIMITED_OPS) goto normal_char; /* Insert before the previous alternative a jump which jumps to this alternative if the former fails. */ GET_BUFFER_SPACE (3); INSERT_JUMP (on_failure_jump, begalt, b + 6); pending_exact = 0; b += 3; /* The alternative before this one has a jump after it which gets executed if it gets matched. Adjust that jump so it will jump to this alternative's analogous jump (put in below, which in turn will jump to the next (if any) alternative's such jump, etc.). The last such jump jumps to the correct final destination. A picture: _____ _____ | | | | | v | v a | b | c If we are at `b', then fixup_alt_jump right now points to a three-byte space after `a'. We'll put in the jump, set fixup_alt_jump to right after `b', and leave behind three bytes which we'll fill in when we get to after `c'. */ if (fixup_alt_jump) STORE_JUMP (jump_past_alt, fixup_alt_jump, b); /* Mark and leave space for a jump after this alternative, to be filled in later either by next alternative or when know we're at the end of a series of alternatives. */ fixup_alt_jump = b; GET_BUFFER_SPACE (3); b += 3; laststart = 0; begalt = b; break; case '{': /* If \{ is a literal. */ if (!(syntax & RE_INTERVALS) /* If we're at `\{' and it's not the open-interval operator. */ || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES)) || (p - 2 == pattern && p == pend)) goto normal_backslash; handle_interval: { /* If got here, then the syntax allows intervals. */ /* At least (most) this many matches must be made. */ int lower_bound = -1, upper_bound = -1; beg_interval = p - 1; if (p == pend) { if (syntax & RE_NO_BK_BRACES) goto unfetch_interval; else FREE_STACK_RETURN (REG_EBRACE); } GET_UNSIGNED_NUMBER (lower_bound); if (c == ',') { GET_UNSIGNED_NUMBER (upper_bound); if (upper_bound < 0) upper_bound = RE_DUP_MAX; } else /* Interval such as `{1}' => match exactly once. */ upper_bound = lower_bound; if (lower_bound < 0 || upper_bound > RE_DUP_MAX || lower_bound > upper_bound) { if (syntax & RE_NO_BK_BRACES) goto unfetch_interval; else FREE_STACK_RETURN (REG_BADBR); } if (!(syntax & RE_NO_BK_BRACES)) { if (c != '\\') FREE_STACK_RETURN (REG_EBRACE); PATFETCH (c); } if (c != '}') { if (syntax & RE_NO_BK_BRACES) goto unfetch_interval; else FREE_STACK_RETURN (REG_BADBR); } /* We just parsed a valid interval. */ /* If it's invalid to have no preceding re. */ if (!laststart) { if (syntax & RE_CONTEXT_INVALID_OPS) FREE_STACK_RETURN (REG_BADRPT); else if (syntax & RE_CONTEXT_INDEP_OPS) laststart = b; else goto unfetch_interval; } /* If the upper bound is zero, don't want to succeed at all; jump from `laststart' to `b + 3', which will be the end of the buffer after we insert the jump. */ if (upper_bound == 0) { GET_BUFFER_SPACE (3); INSERT_JUMP (jump, laststart, b + 3); b += 3; } /* Otherwise, we have a nontrivial interval. When we're all done, the pattern will look like: set_number_at set_number_at succeed_n jump_n (The upper bound and `jump_n' are omitted if `upper_bound' is 1, though.) */ else { /* If the upper bound is > 1, we need to insert more at the end of the loop. */ unsigned nbytes = 10 + (upper_bound > 1) * 10; GET_BUFFER_SPACE (nbytes); /* Initialize lower bound of the `succeed_n', even though it will be set during matching by its attendant `set_number_at' (inserted next), because `re_compile_fastmap' needs to know. Jump to the `jump_n' we might insert below. */ INSERT_JUMP2 (succeed_n, laststart, b + 5 + (upper_bound > 1) * 5, lower_bound); b += 5; /* Code to initialize the lower bound. Insert before the `succeed_n'. The `5' is the last two bytes of this `set_number_at', plus 3 bytes of the following `succeed_n'. */ insert_op2 (set_number_at, laststart, 5, lower_bound, b); b += 5; if (upper_bound > 1) { /* More than one repetition is allowed, so append a backward jump to the `succeed_n' that starts this interval. When we've reached this during matching, we'll have matched the interval once, so jump back only `upper_bound - 1' times. */ STORE_JUMP2 (jump_n, b, laststart + 5, upper_bound - 1); b += 5; /* The location we want to set is the second parameter of the `jump_n'; that is `b-2' as an absolute address. `laststart' will be the `set_number_at' we're about to insert; `laststart+3' the number to set, the source for the relative address. But we are inserting into the middle of the pattern -- so everything is getting moved up by 5. Conclusion: (b - 2) - (laststart + 3) + 5, i.e., b - laststart. We insert this at the beginning of the loop so that if we fail during matching, we'll reinitialize the bounds. */ insert_op2 (set_number_at, laststart, b - laststart, upper_bound - 1, b); b += 5; } } pending_exact = 0; beg_interval = NULL; } break; unfetch_interval: /* If an invalid interval, match the characters as literals. */ assert (beg_interval); p = beg_interval; beg_interval = NULL; /* normal_char and normal_backslash need `c'. */ PATFETCH (c); if (!(syntax & RE_NO_BK_BRACES)) { if (p > pattern && p[-1] == '\\') goto normal_backslash; } goto normal_char; #ifdef emacs /* There is no way to specify the before_dot and after_dot operators. rms says this is ok. --karl */ case '=': BUF_PUSH (at_dot); break; case 's': laststart = b; PATFETCH (c); BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]); break; case 'S': laststart = b; PATFETCH (c); BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]); break; #endif /* emacs */ case 'w': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; laststart = b; BUF_PUSH (wordchar); break; case 'W': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; laststart = b; BUF_PUSH (notwordchar); break; case '<': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (wordbeg); break; case '>': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (wordend); break; case 'b': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (wordbound); break; case 'B': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (notwordbound); break; case '`': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (begbuf); break; case '\'': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (endbuf); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (syntax & RE_NO_BK_REFS) goto normal_char; c1 = c - '0'; if (c1 > regnum) FREE_STACK_RETURN (REG_ESUBREG); /* Can't back reference to a subexpression if inside of it. */ if (group_in_compile_stack (compile_stack, (regnum_t) c1)) goto normal_char; laststart = b; BUF_PUSH_2 (duplicate, c1); break; case '+': case '?': if (syntax & RE_BK_PLUS_QM) goto handle_plus; else goto normal_backslash; default: normal_backslash: /* You might think it would be useful for \ to mean not to translate; but if we don't translate it it will never match anything. */ c = TRANSLATE (c); goto normal_char; } break; default: /* Expects the character in `c'. */ normal_char: /* If no exactn currently being built. */ if (!pending_exact /* If last exactn not at current position. */ || pending_exact + *pending_exact + 1 != b /* We have only one byte following the exactn for the count. */ || *pending_exact == (1 << BYTEWIDTH) - 1 /* If followed by a repetition operator. */ || *p == '*' || *p == '^' || ((syntax & RE_BK_PLUS_QM) ? *p == '\\' && (p[1] == '+' || p[1] == '?') : (*p == '+' || *p == '?')) || ((syntax & RE_INTERVALS) && ((syntax & RE_NO_BK_BRACES) ? *p == '{' : (p[0] == '\\' && p[1] == '{')))) { /* Start building a new exactn. */ laststart = b; BUF_PUSH_2 (exactn, 0); pending_exact = b - 1; } BUF_PUSH (c); (*pending_exact)++; break; } /* switch (c) */ } /* while p != pend */ /* Through the pattern now. */ if (fixup_alt_jump) STORE_JUMP (jump_past_alt, fixup_alt_jump, b); if (!COMPILE_STACK_EMPTY) FREE_STACK_RETURN (REG_EPAREN); /* If we don't want backtracking, force success the first time we reach the end of the compiled pattern. */ if (syntax & RE_NO_POSIX_BACKTRACKING) BUF_PUSH (succeed); free (compile_stack.stack); /* __MEM_CHECKED__ */ /* We have succeeded; set the length of the buffer. */ bufp->used = b - bufp->buffer; #ifdef DEBUG if (debug) { DEBUG_PRINT1 ("\nCompiled pattern: \n"); print_compiled_pattern (bufp); } #endif /* DEBUG */ #ifndef MATCH_MAY_ALLOCATE /* Initialize the failure stack to the largest possible stack. This isn't necessary unless we're trying to avoid calling alloca in the search and match routines. */ { int num_regs = bufp->re_nsub + 1; /* Since DOUBLE_FAIL_STACK refuses to double only if the current size is strictly greater than re_max_failures, the largest possible stack is 2 * re_max_failures failure points. */ if (fail_stack.size < (2 * re_max_failures * MAX_FAILURE_ITEMS)) { fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS); #ifdef emacs if (! fail_stack.stack) fail_stack.stack = (fail_stack_elt_t *) xmalloc (fail_stack.size * sizeof (fail_stack_elt_t)); else fail_stack.stack = (fail_stack_elt_t *) xrealloc (fail_stack.stack, (fail_stack.size * sizeof (fail_stack_elt_t))); #else /* not emacs */ if (! fail_stack.stack) fail_stack.stack = (fail_stack_elt_t *) malloc (fail_stack.size /* __MEM_CHECKED__ */ * sizeof (fail_stack_elt_t)); else fail_stack.stack = (fail_stack_elt_t *) realloc (fail_stack.stack, /* __MEM_CHECKED__ */ (fail_stack.size * sizeof (fail_stack_elt_t))); #endif /* not emacs */ } regex_grow_registers (num_regs); } #endif /* not MATCH_MAY_ALLOCATE */ return REG_NOERROR; } /* regex_compile */ /* Subroutines for `regex_compile'. */ /* Store OP at LOC followed by two-byte integer parameter ARG. */ static void store_op1 (op, loc, arg) re_opcode_t op; unsigned char *loc; int arg; { *loc = (unsigned char) op; STORE_NUMBER (loc + 1, arg); } /* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */ static void store_op2 (op, loc, arg1, arg2) re_opcode_t op; unsigned char *loc; int arg1, arg2; { *loc = (unsigned char) op; STORE_NUMBER (loc + 1, arg1); STORE_NUMBER (loc + 3, arg2); } /* Copy the bytes from LOC to END to open up three bytes of space at LOC for OP followed by two-byte integer parameter ARG. */ static void insert_op1 (op, loc, arg, end) re_opcode_t op; unsigned char *loc; int arg; unsigned char *end; { register unsigned char *pfrom = end; register unsigned char *pto = end + 3; while (pfrom != loc) *--pto = *--pfrom; store_op1 (op, loc, arg); } /* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */ static void insert_op2 (op, loc, arg1, arg2, end) re_opcode_t op; unsigned char *loc; int arg1, arg2; unsigned char *end; { register unsigned char *pfrom = end; register unsigned char *pto = end + 5; while (pfrom != loc) *--pto = *--pfrom; store_op2 (op, loc, arg1, arg2); } /* P points to just after a ^ in PATTERN. Return true if that ^ comes after an alternative or a begin-subexpression. We assume there is at least one character before the ^. */ static boolean at_begline_loc_p (pattern, p, syntax) const char *pattern, *p; reg_syntax_t syntax; { const char *prev = p - 2; boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; return /* After a subexpression? */ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) /* After an alternative? */ || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)); } /* The dual of at_begline_loc_p. This one is for $. We assume there is at least one character after the $, i.e., `P < PEND'. */ static boolean at_endline_loc_p (p, pend, syntax) const char *p, *pend; reg_syntax_t syntax; { const char *next = p; boolean next_backslash = *next == '\\'; const char *next_next = p + 1 < pend ? p + 1 : 0; return /* Before a subexpression? */ (syntax & RE_NO_BK_PARENS ? *next == ')' : next_backslash && next_next && *next_next == ')') /* Before an alternative? */ || (syntax & RE_NO_BK_VBAR ? *next == '|' : next_backslash && next_next && *next_next == '|'); } /* Returns true if REGNUM is in one of COMPILE_STACK's elements and false if it's not. */ static boolean group_in_compile_stack (compile_stack, regnum) compile_stack_type compile_stack; regnum_t regnum; { int this_element; for (this_element = compile_stack.avail - 1; this_element >= 0; this_element--) if (compile_stack.stack[this_element].regnum == regnum) return true; return false; } /* Read the ending character of a range (in a bracket expression) from the uncompiled pattern *P_PTR (which ends at PEND). We assume the starting character is in `P[-2]'. (`P[-1]' is the character `-'.) Then we set the translation of all bits between the starting and ending characters (inclusive) in the compiled pattern B. Return an error code. We use these short variable names so we can use the same macros as `regex_compile' itself. */ static reg_errcode_t compile_range (p_ptr, pend, translate, syntax, b) const char **p_ptr, *pend; RE_TRANSLATE_TYPE translate; reg_syntax_t syntax; unsigned char *b; { unsigned this_char; const char *p = *p_ptr; unsigned int range_start, range_end; if (p == pend) return REG_ERANGE; /* Even though the pattern is a signed `char *', we need to fetch with unsigned char *'s; if the high bit of the pattern character is set, the range endpoints will be negative if we fetch using a signed char *. We also want to fetch the endpoints without translating them; the appropriate translation is done in the bit-setting loop below. */ /* The SVR4 compiler on the 3B2 had trouble with unsigned const char *. */ range_start = ((const unsigned char *) p)[-2]; range_end = ((const unsigned char *) p)[0]; /* Have to increment the pointer into the pattern string, so the caller isn't still at the ending character. */ (*p_ptr)++; /* If the start is after the end, the range is empty. */ if (range_start > range_end) return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR; /* Here we see why `this_char' has to be larger than an `unsigned char' -- the range is inclusive, so if `range_end' == 0xff (assuming 8-bit characters), we would otherwise go into an infinite loop, since all characters <= 0xff. */ for (this_char = range_start; this_char <= range_end; this_char++) { SET_LIST_BIT (TRANSLATE (this_char)); } return REG_NOERROR; } /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible characters can start a string that matches the pattern. This fastmap is used by re_search to skip quickly over impossible starting points. The caller must supply the address of a (1 << BYTEWIDTH)-byte data area as BUFP->fastmap. We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in the pattern buffer. Returns 0 if we succeed, -2 if an internal error. */ int re_compile_fastmap (bufp) struct re_pattern_buffer *bufp; { int j, k; #ifdef MATCH_MAY_ALLOCATE fail_stack_type fail_stack; #endif #ifndef REGEX_MALLOC char *destination; #endif /* We don't push any register information onto the failure stack. */ unsigned num_regs = 0; register char *fastmap = bufp->fastmap; unsigned char *pattern = bufp->buffer; unsigned char *p = pattern; register unsigned char *pend = pattern + bufp->used; #ifdef REL_ALLOC /* This holds the pointer to the failure stack, when it is allocated relocatably. */ fail_stack_elt_t *failure_stack_ptr; #endif /* Assume that each path through the pattern can be null until proven otherwise. We set this false at the bottom of switch statement, to which we get only if a particular path doesn't match the empty string. */ boolean path_can_be_null = true; /* We aren't doing a `succeed_n' to begin with. */ boolean succeed_n_p = false; assert (fastmap != NULL && p != NULL); INIT_FAIL_STACK (); bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */ bufp->fastmap_accurate = 1; /* It will be when we're done. */ bufp->can_be_null = 0; while (1) { if (p == pend || *p == succeed) { /* We have reached the (effective) end of pattern. */ if (!FAIL_STACK_EMPTY ()) { bufp->can_be_null |= path_can_be_null; /* Reset for next path. */ path_can_be_null = true; p = fail_stack.stack[--fail_stack.avail].pointer; continue; } else break; } /* We should never be about to go beyond the end of the pattern. */ assert (p < pend); switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) { /* I guess the idea here is to simply not bother with a fastmap if a backreference is used, since it's too hard to figure out the fastmap for the corresponding group. Setting `can_be_null' stops `re_search_2' from using the fastmap, so that is all we do. */ case duplicate: bufp->can_be_null = 1; goto done; /* Following are the cases which match a character. These end with `break'. */ case exactn: fastmap[p[1]] = 1; break; case charset: for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) fastmap[j] = 1; break; case charset_not: /* Chars beyond end of map must be allowed. */ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++) fastmap[j] = 1; for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) fastmap[j] = 1; break; case wordchar: for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) == Sword) fastmap[j] = 1; break; case notwordchar: for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) != Sword) fastmap[j] = 1; break; case anychar: { int fastmap_newline = fastmap['\n']; /* `.' matches anything ... */ for (j = 0; j < (1 << BYTEWIDTH); j++) fastmap[j] = 1; /* ... except perhaps newline. */ if (!(bufp->syntax & RE_DOT_NEWLINE)) fastmap['\n'] = fastmap_newline; /* Return if we have already set `can_be_null'; if we have, then the fastmap is irrelevant. Something's wrong here. */ else if (bufp->can_be_null) goto done; /* Otherwise, have to check alternative paths. */ break; } #ifdef emacs case syntaxspec: k = *p++; for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) == (enum syntaxcode) k) fastmap[j] = 1; break; case notsyntaxspec: k = *p++; for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) != (enum syntaxcode) k) fastmap[j] = 1; break; /* All cases after this match the empty string. These end with `continue'. */ case before_dot: case at_dot: case after_dot: continue; #endif /* emacs */ case no_op: case begline: case endline: case begbuf: case endbuf: case wordbound: case notwordbound: case wordbeg: case wordend: case push_dummy_failure: continue; case jump_n: case pop_failure_jump: case maybe_pop_jump: case jump: case jump_past_alt: case dummy_failure_jump: EXTRACT_NUMBER_AND_INCR (j, p); p += j; if (j > 0) continue; /* Jump backward implies we just went through the body of a loop and matched nothing. Opcode jumped to should be `on_failure_jump' or `succeed_n'. Just treat it like an ordinary jump. For a * loop, it has pushed its failure point already; if so, discard that as redundant. */ if ((re_opcode_t) *p != on_failure_jump && (re_opcode_t) *p != succeed_n) continue; p++; EXTRACT_NUMBER_AND_INCR (j, p); p += j; /* If what's on the stack is where we are now, pop it. */ if (!FAIL_STACK_EMPTY () && fail_stack.stack[fail_stack.avail - 1].pointer == p) fail_stack.avail--; continue; case on_failure_jump: case on_failure_keep_string_jump: handle_on_failure_jump: EXTRACT_NUMBER_AND_INCR (j, p); /* For some patterns, e.g., `(a?)?', `p+j' here points to the end of the pattern. We don't want to push such a point, since when we restore it above, entering the switch will increment `p' past the end of the pattern. We don't need to push such a point since we obviously won't find any more fastmap entries beyond `pend'. Such a pattern can match the null string, though. */ if (p + j < pend) { if (!PUSH_PATTERN_OP (p + j, fail_stack)) { RESET_FAIL_STACK (); return -2; } } else bufp->can_be_null = 1; if (succeed_n_p) { EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */ succeed_n_p = false; } continue; case succeed_n: /* Get to the number of times to succeed. */ p += 2; /* Increment p past the n for when k != 0. */ EXTRACT_NUMBER_AND_INCR (k, p); if (k == 0) { p -= 4; succeed_n_p = true; /* Spaghetti code alert. */ goto handle_on_failure_jump; } continue; case set_number_at: p += 4; continue; case start_memory: case stop_memory: p += 2; continue; default: abort (); /* We have listed all the cases. */ } /* switch *p++ */ /* Getting here means we have found the possible starting characters for one path of the pattern -- and that the empty string does not match. We need not follow this path further. Instead, look at the next alternative (remembered on the stack), or quit if no more. The test at the top of the loop does these things. */ path_can_be_null = false; p = pend; } /* while p */ /* Set `can_be_null' for the last path (also the first path, if the pattern is empty). */ bufp->can_be_null |= path_can_be_null; done: RESET_FAIL_STACK (); return 0; } /* re_compile_fastmap */ /* Set REGS to hold NUM_REGS registers, storing them in STARTS and ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use this memory for recording register information. STARTS and ENDS must be allocated using the malloc library routine, and must each be at least NUM_REGS * sizeof (regoff_t) bytes long. If NUM_REGS == 0, then subsequent matches should allocate their own register data. Unless this function is called, the first search or match using PATTERN_BUFFER will allocate its own register data, without freeing the old data. */ void re_set_registers (bufp, regs, num_regs, starts, ends) struct re_pattern_buffer *bufp; struct re_registers *regs; unsigned num_regs; regoff_t *starts, *ends; { if (num_regs) { bufp->regs_allocated = REGS_REALLOCATE; regs->num_regs = num_regs; regs->start = starts; regs->end = ends; } else { bufp->regs_allocated = REGS_UNALLOCATED; regs->num_regs = 0; regs->start = regs->end = (regoff_t *) 0; } } /* Searching routines. */ /* Like re_search_2, below, but only one string is specified, and doesn't let you say where to stop matching. */ int re_search (bufp, string, size, startpos, range, regs) struct re_pattern_buffer *bufp; const char *string; int size, startpos, range; struct re_registers *regs; { return re_search_2 (bufp, NULL, 0, string, size, startpos, range, regs, size); } /* Using the compiled pattern in BUFP->buffer, first tries to match the virtual concatenation of STRING1 and STRING2, starting first at index STARTPOS, then at STARTPOS + 1, and so on. STRING1 and STRING2 have length SIZE1 and SIZE2, respectively. RANGE is how far to scan while trying to match. RANGE = 0 means try only at STARTPOS; in general, the last start tried is STARTPOS + RANGE. In REGS, return the indices of the virtual concatenation of STRING1 and STRING2 that matched the entire BUFP->buffer and its contained subexpressions. Do not consider matching one past the index STOP in the virtual concatenation of STRING1 and STRING2. We return either the position in the strings at which the match was found, -1 if no match, or -2 if error (such as failure stack overflow). */ int re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) struct re_pattern_buffer *bufp; const char *string1, *string2; int size1, size2; int startpos; int range; struct re_registers *regs; int stop; { int val; register char *fastmap = bufp->fastmap; register RE_TRANSLATE_TYPE translate = bufp->translate; int total_size = size1 + size2; int endpos = startpos + range; /* Check for out-of-range STARTPOS. */ if (startpos < 0 || startpos > total_size) return -1; /* Fix up RANGE if it might eventually take us outside the virtual concatenation of STRING1 and STRING2. Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE. */ if (endpos < 0) range = 0 - startpos; else if (endpos > total_size) range = total_size - startpos; /* If the search isn't to be a backwards one, don't waste time in a search for a pattern that must be anchored. */ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0) { if (startpos > 0) return -1; else range = 1; } #ifdef emacs /* In a forward search for something that starts with \=. don't keep searching past point. */ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0) { range = PT - startpos; if (range <= 0) return -1; } #endif /* emacs */ /* Update the fastmap now if not correct already. */ if (fastmap && !bufp->fastmap_accurate) if (re_compile_fastmap (bufp) == -2) return -2; /* Loop through the string, looking for a place to start matching. */ for (;;) { /* If a fastmap is supplied, skip quickly over characters that cannot be the start of a match. If the pattern can match the null string, however, we don't need to skip characters; we want the first null string. */ if (fastmap && startpos < total_size && !bufp->can_be_null) { if (range > 0) /* Searching forwards. */ { register const char *d; register int lim = 0; int irange = range; if (startpos < size1 && startpos + range >= size1) lim = range - (size1 - startpos); d = (startpos >= size1 ? string2 - size1 : string1) + startpos; /* Written out as an if-else to avoid testing `translate' inside the loop. */ if (translate) while (range > lim && !fastmap[(unsigned char) translate[(unsigned char) *d++]]) range--; else while (range > lim && !fastmap[(unsigned char) *d++]) range--; startpos += irange - range; } else /* Searching backwards. */ { register char c = (size1 == 0 || startpos >= size1 ? string2[startpos - size1] : string1[startpos]); if (!fastmap[(unsigned char) TRANSLATE (c)]) goto advance; } } /* If can't match the null string, and that's all we have left, fail. */ if (range >= 0 && startpos == total_size && fastmap && !bufp->can_be_null) return -1; val = re_match_2_internal (bufp, string1, size1, string2, size2, startpos, regs, stop); #ifndef REGEX_MALLOC #ifdef C_ALLOCA alloca (0); #endif #endif if (val >= 0) return startpos; if (val == -2) return -2; advance: if (!range) break; else if (range > 0) { range--; startpos++; } else { range++; startpos--; } } return -1; } /* re_search_2 */ /* This converts PTR, a pointer into one of the search strings `string1' and `string2' into an offset from the beginning of that string. */ #define POINTER_TO_OFFSET(ptr) \ (FIRST_STRING_P (ptr) \ ? ((regoff_t) ((ptr) - string1)) \ : ((regoff_t) ((ptr) - string2 + size1))) /* Macros for dealing with the split strings in re_match_2. */ #define MATCHING_IN_FIRST_STRING (dend == end_match_1) /* Call before fetching a character with *d. This switches over to string2 if necessary. */ #define PREFETCH() \ while (d == dend) \ { \ /* End of string2 => fail. */ \ if (dend == end_match_2) \ goto fail; \ /* End of string1 => advance to string2. */ \ d = string2; \ dend = end_match_2; \ } /* Test if at very beginning or at very end of the virtual concatenation of `string1' and `string2'. If only one string, it's `string2'. */ #define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2) #define AT_STRINGS_END(d) ((d) == end2) /* Test if D points to a character which is word-constituent. We have two special cases to check for: if past the end of string1, look at the first character in string2; and if before the beginning of string2, look at the last character in string1. */ #define WORDCHAR_P(d) \ (SYNTAX ((d) == end1 ? *string2 \ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \ == Sword) /* Disabled due to a compiler bug -- see comment at case wordbound */ #if 0 /* Test if the character before D and the one at D differ with respect to being word-constituent. */ #define AT_WORD_BOUNDARY(d) \ (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \ || WORDCHAR_P (d - 1) != WORDCHAR_P (d)) #endif /* Free everything we malloc. */ #ifdef MATCH_MAY_ALLOCATE #define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL #define FREE_VARIABLES() \ do { \ REGEX_FREE_STACK (fail_stack.stack); \ FREE_VAR (regstart); \ FREE_VAR (regend); \ FREE_VAR (old_regstart); \ FREE_VAR (old_regend); \ FREE_VAR (best_regstart); \ FREE_VAR (best_regend); \ FREE_VAR (reg_info); \ FREE_VAR (reg_dummy); \ FREE_VAR (reg_info_dummy); \ } while (0) #else #define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */ #endif /* not MATCH_MAY_ALLOCATE */ /* These values must meet several constraints. They must not be valid register values; since we have a limit of 255 registers (because we use only one byte in the pattern for the register number), we can use numbers larger than 255. They must differ by 1, because of NUM_FAILURE_ITEMS above. And the value for the lowest register must be larger than the value for the highest register, so we do not try to actually save any registers when none are active. */ #define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH) #define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1) /* Matching routines. */ #ifndef emacs /* Emacs never uses this. */ /* re_match is like re_match_2 except it takes only a single string. */ int re_match (bufp, string, size, pos, regs) struct re_pattern_buffer *bufp; const char *string; int size, pos; struct re_registers *regs; { int result = re_match_2_internal (bufp, NULL, 0, string, size, pos, regs, size); #ifndef REGEX_MALLOC #ifdef C_ALLOCA alloca (0); #endif #endif return result; } #endif /* not emacs */ static boolean group_match_null_string_p _RE_ARGS ((unsigned char **p, unsigned char *end, register_info_type *reg_info)); static boolean alt_match_null_string_p _RE_ARGS ((unsigned char *p, unsigned char *end, register_info_type *reg_info)); static boolean common_op_match_null_string_p _RE_ARGS ((unsigned char **p, unsigned char *end, register_info_type *reg_info)); static int bcmp_translate _RE_ARGS ((const char *s1, const char *s2, int len, char *translate)); /* re_match_2 matches the compiled pattern in BUFP against the the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 and SIZE2, respectively). We start matching at POS, and stop matching at STOP. If REGS is non-null and the `no_sub' field of BUFP is nonzero, we store offsets for the substring each group matched in REGS. See the documentation for exactly how many groups we fill. We return -1 if no match, -2 if an internal error (such as the failure stack overflowing). Otherwise, we return the length of the matched substring. */ int re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) struct re_pattern_buffer *bufp; const char *string1, *string2; int size1, size2; int pos; struct re_registers *regs; int stop; { int result = re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop); #ifndef REGEX_MALLOC #ifdef C_ALLOCA alloca (0); #endif #endif return result; } /* This is a separate function so that we can force an alloca cleanup afterwards. */ static int re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) struct re_pattern_buffer *bufp; const char *string1, *string2; int size1, size2; int pos; struct re_registers *regs; int stop; { /* General temporaries. */ int mcnt; unsigned char *p1; /* Just past the end of the corresponding string. */ const char *end1, *end2; /* Pointers into string1 and string2, just past the last characters in each to consider matching. */ const char *end_match_1, *end_match_2; /* Where we are in the data, and the end of the current string. */ const char *d, *dend; /* Where we are in the pattern, and the end of the pattern. */ unsigned char *p = bufp->buffer; register unsigned char *pend = p + bufp->used; /* Mark the opcode just after a start_memory, so we can test for an empty subpattern when we get to the stop_memory. */ unsigned char *just_past_start_mem = 0; /* We use this to map every character in the string. */ RE_TRANSLATE_TYPE translate = bufp->translate; /* Failure point stack. Each place that can handle a failure further down the line pushes a failure point on this stack. It consists of restart, regend, and reg_info for all registers corresponding to the subexpressions we're currently inside, plus the number of such registers, and, finally, two char *'s. The first char * is where to resume scanning the pattern; the second one is where to resume scanning the strings. If the latter is zero, the failure point is a ``dummy''; if a failure happens and the failure point is a dummy, it gets discarded and the next next one is tried. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ fail_stack_type fail_stack; #endif #ifdef DEBUG static unsigned failure_id = 0; unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0; #endif #ifdef REL_ALLOC /* This holds the pointer to the failure stack, when it is allocated relocatably. */ fail_stack_elt_t *failure_stack_ptr; #endif /* We fill all the registers internally, independent of what we return, for use in backreferences. The number here includes an element for register zero. */ size_t num_regs = bufp->re_nsub + 1; /* The currently active registers. */ active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG; active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG; /* Information on the contents of registers. These are pointers into the input strings; they record just what was matched (on this attempt) by a subexpression part of the pattern, that is, the regnum-th regstart pointer points to where in the pattern we began matching and the regnum-th regend points to right after where we stopped matching the regnum-th subexpression. (The zeroth register keeps track of what the whole pattern matches.) */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **regstart, **regend; #endif /* If a group that's operated upon by a repetition operator fails to match anything, then the register for its start will need to be restored because it will have been set to wherever in the string we are when we last see its open-group operator. Similarly for a register's end. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **old_regstart, **old_regend; #endif /* The is_active field of reg_info helps us keep track of which (possibly nested) subexpressions we are currently in. The matched_something field of reg_info[reg_num] helps us tell whether or not we have matched any of the pattern so far this time through the reg_num-th subexpression. These two fields get reset each time through any loop their register is in. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ register_info_type *reg_info; #endif /* The following record the register info as found in the above variables when we find a match better than any we've seen before. This happens as we backtrack through the failure points, which in turn happens only if we have not yet matched the entire string. */ unsigned best_regs_set = false; #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **best_regstart, **best_regend; #endif /* Logically, this is `best_regend[0]'. But we don't want to have to allocate space for that if we're not allocating space for anything else (see below). Also, we never need info about register 0 for any of the other register vectors, and it seems rather a kludge to treat `best_regend' differently than the rest. So we keep track of the end of the best match so far in a separate variable. We initialize this to NULL so that when we backtrack the first time and need to test it, it's not garbage. */ const char *match_end = NULL; /* This helps SET_REGS_MATCHED avoid doing redundant work. */ int set_regs_matched_done = 0; /* Used when we pop values we don't care about. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **reg_dummy; register_info_type *reg_info_dummy; #endif #ifdef DEBUG /* Counts the total number of registers pushed. */ unsigned num_regs_pushed = 0; #endif DEBUG_PRINT1 ("\n\nEntering re_match_2.\n"); INIT_FAIL_STACK (); #ifdef MATCH_MAY_ALLOCATE /* Do not bother to initialize all the register variables if there are no groups in the pattern, as it takes a fair amount of time. If there are groups, we include space for register 0 (the whole pattern), even though we never use it, since it simplifies the array indexing. We should fix this. */ if (bufp->re_nsub) { regstart = REGEX_TALLOC (num_regs, const char *); regend = REGEX_TALLOC (num_regs, const char *); old_regstart = REGEX_TALLOC (num_regs, const char *); old_regend = REGEX_TALLOC (num_regs, const char *); best_regstart = REGEX_TALLOC (num_regs, const char *); best_regend = REGEX_TALLOC (num_regs, const char *); reg_info = REGEX_TALLOC (num_regs, register_info_type); reg_dummy = REGEX_TALLOC (num_regs, const char *); reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type); if (!(regstart && regend && old_regstart && old_regend && reg_info && best_regstart && best_regend && reg_dummy && reg_info_dummy)) { FREE_VARIABLES (); return -2; } } else { /* We must initialize all our variables to NULL, so that `FREE_VARIABLES' doesn't try to free them. */ regstart = regend = old_regstart = old_regend = best_regstart = best_regend = reg_dummy = NULL; reg_info = reg_info_dummy = (register_info_type *) NULL; } #endif /* MATCH_MAY_ALLOCATE */ /* The starting position is bogus. */ if (pos < 0 || pos > size1 + size2) { FREE_VARIABLES (); return -1; } /* Initialize subexpression text positions to -1 to mark ones that no start_memory/stop_memory has been seen for. Also initialize the register information struct. */ for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) { regstart[mcnt] = regend[mcnt] = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE; REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE; IS_ACTIVE (reg_info[mcnt]) = 0; MATCHED_SOMETHING (reg_info[mcnt]) = 0; EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0; } /* We move `string1' into `string2' if the latter's empty -- but not if `string1' is null. */ if (size2 == 0 && string1 != NULL) { string2 = string1; size2 = size1; string1 = 0; size1 = 0; } end1 = string1 + size1; end2 = string2 + size2; /* Compute where to stop matching, within the two strings. */ if (stop <= size1) { end_match_1 = string1 + stop; end_match_2 = string2; } else { end_match_1 = end1; end_match_2 = string2 + stop - size1; } /* `p' scans through the pattern as `d' scans through the data. `dend' is the end of the input string that `d' points within. `d' is advanced into the following input string whenever necessary, but this happens before fetching; therefore, at the beginning of the loop, `d' can be pointing at the end of a string, but it cannot equal `string2'. */ if (size1 > 0 && pos <= size1) { d = string1 + pos; dend = end_match_1; } else { d = string2 + pos - size1; dend = end_match_2; } DEBUG_PRINT1 ("The compiled pattern is:\n"); DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend); DEBUG_PRINT1 ("The string to match is: `"); DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); DEBUG_PRINT1 ("'\n"); /* This loops over pattern commands. It exits by returning from the function if the match is complete, or it drops through if the match fails at this starting point in the input data. */ for (;;) { #ifdef _LIBC DEBUG_PRINT2 ("\n%p: ", p); #else DEBUG_PRINT2 ("\n0x%x: ", p); #endif if (p == pend) { /* End of pattern means we might have succeeded. */ DEBUG_PRINT1 ("end of pattern ... "); /* If we haven't matched the entire string, and we want the longest match, try backtracking. */ if (d != end_match_2) { /* 1 if this match ends in the same string (string1 or string2) as the best previous match. */ boolean same_str_p = (FIRST_STRING_P (match_end) == MATCHING_IN_FIRST_STRING); /* 1 if this match is the best seen so far. */ boolean best_match_p; /* AIX compiler got confused when this was combined with the previous declaration. */ if (same_str_p) best_match_p = d > match_end; else best_match_p = !MATCHING_IN_FIRST_STRING; DEBUG_PRINT1 ("backtracking.\n"); if (!FAIL_STACK_EMPTY ()) { /* More failure points to try. */ /* If exceeds best match so far, save it. */ if (!best_regs_set || best_match_p) { best_regs_set = true; match_end = d; DEBUG_PRINT1 ("\nSAVING match as best so far.\n"); for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) { best_regstart[mcnt] = regstart[mcnt]; best_regend[mcnt] = regend[mcnt]; } } goto fail; } /* If no failure points, don't restore garbage. And if last match is real best match, don't restore second best one. */ else if (best_regs_set && !best_match_p) { restore_best_regs: /* Restore best match. It may happen that `dend == end_match_1' while the restored d is in string2. For example, the pattern `x.*y.*z' against the strings `x-' and `y-z-', if the two strings are not consecutive in memory. */ DEBUG_PRINT1 ("Restoring best registers.\n"); d = match_end; dend = ((d >= string1 && d <= end1) ? end_match_1 : end_match_2); for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) { regstart[mcnt] = best_regstart[mcnt]; regend[mcnt] = best_regend[mcnt]; } } } /* d != end_match_2 */ succeed_label: DEBUG_PRINT1 ("Accepting match.\n"); /* If caller wants register contents data back, do it. */ if (regs && !bufp->no_sub) { /* Have the register data arrays been allocated? */ if (bufp->regs_allocated == REGS_UNALLOCATED) { /* No. So allocate them with malloc. We need one extra element beyond `num_regs' for the `-1' marker GNU code uses. */ regs->num_regs = MAX (RE_NREGS, num_regs + 1); regs->start = TALLOC (regs->num_regs, regoff_t); regs->end = TALLOC (regs->num_regs, regoff_t); if (regs->start == NULL || regs->end == NULL) { FREE_VARIABLES (); return -2; } bufp->regs_allocated = REGS_REALLOCATE; } else if (bufp->regs_allocated == REGS_REALLOCATE) { /* Yes. If we need more elements than were already allocated, reallocate them. If we need fewer, just leave it alone. */ if (regs->num_regs < num_regs + 1) { regs->num_regs = num_regs + 1; RETALLOC (regs->start, regs->num_regs, regoff_t); RETALLOC (regs->end, regs->num_regs, regoff_t); if (regs->start == NULL || regs->end == NULL) { FREE_VARIABLES (); return -2; } } } else { /* These braces fend off a "empty body in an else-statement" warning under GCC when assert expands to nothing. */ assert (bufp->regs_allocated == REGS_FIXED); } /* Convert the pointer data in `regstart' and `regend' to indices. Register zero has to be set differently, since we haven't kept track of any info for it. */ if (regs->num_regs > 0) { regs->start[0] = pos; regs->end[0] = (MATCHING_IN_FIRST_STRING ? ((regoff_t) (d - string1)) : ((regoff_t) (d - string2 + size1))); } /* Go through the first `min (num_regs, regs->num_regs)' registers, since that is all we initialized. */ for (mcnt = 1; (unsigned) mcnt < MIN (num_regs, regs->num_regs); mcnt++) { if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt])) regs->start[mcnt] = regs->end[mcnt] = -1; else { regs->start[mcnt] = (regoff_t) POINTER_TO_OFFSET (regstart[mcnt]); regs->end[mcnt] = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]); } } /* If the regs structure we return has more elements than were in the pattern, set the extra elements to -1. If we (re)allocated the registers, this is the case, because we always allocate enough to have at least one -1 at the end. */ for (mcnt = num_regs; (unsigned) mcnt < regs->num_regs; mcnt++) regs->start[mcnt] = regs->end[mcnt] = -1; } /* regs && !bufp->no_sub */ DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n", nfailure_points_pushed, nfailure_points_popped, nfailure_points_pushed - nfailure_points_popped); DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed); mcnt = d - pos - (MATCHING_IN_FIRST_STRING ? string1 : string2 - size1); DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt); FREE_VARIABLES (); return mcnt; } /* Otherwise match next pattern command. */ switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) { /* Ignore these. Used to ignore the n of succeed_n's which currently have n == 0. */ case no_op: DEBUG_PRINT1 ("EXECUTING no_op.\n"); break; case succeed: DEBUG_PRINT1 ("EXECUTING succeed.\n"); goto succeed_label; /* Match the next n pattern characters exactly. The following byte in the pattern defines n, and the n bytes after that are the characters to match. */ case exactn: mcnt = *p++; DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt); /* This is written out as an if-else so we don't waste time testing `translate' inside the loop. */ if (translate) { do { PREFETCH (); if ((unsigned char) translate[(unsigned char) *d++] != (unsigned char) *p++) goto fail; } while (--mcnt); } else { do { PREFETCH (); if (*d++ != (char) *p++) goto fail; } while (--mcnt); } SET_REGS_MATCHED (); break; /* Match any character except possibly a newline or a null. */ case anychar: DEBUG_PRINT1 ("EXECUTING anychar.\n"); PREFETCH (); if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n') || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000')) goto fail; SET_REGS_MATCHED (); DEBUG_PRINT2 (" Matched `%d'.\n", *d); d++; break; case charset: case charset_not: { register unsigned char c; boolean not = (re_opcode_t) *(p - 1) == charset_not; DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); PREFETCH (); c = TRANSLATE (*d); /* The character to match. */ /* Cast to `unsigned' instead of `unsigned char' in case the bit list is a full 32 bytes long. */ if (c < (unsigned) (*p * BYTEWIDTH) && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) not = !not; p += 1 + *p; if (!not) goto fail; SET_REGS_MATCHED (); d++; break; } /* The beginning of a group is represented by start_memory. The arguments are the register number in the next byte, and the number of groups inner to this one in the next. The text matched within the group is recorded (in the internal registers data structure) under the register number. */ case start_memory: DEBUG_PRINT3 ("EXECUTING start_memory %d (%d):\n", *p, p[1]); /* Find out if this group can match the empty string. */ p1 = p; /* To send to group_match_null_string_p. */ if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE) REG_MATCH_NULL_STRING_P (reg_info[*p]) = group_match_null_string_p (&p1, pend, reg_info); /* Save the position in the string where we were the last time we were at this open-group operator in case the group is operated upon by a repetition operator, e.g., with `(a*)*b' against `ab'; then we want to ignore where we are now in the string in case this attempt to match fails. */ old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) ? REG_UNSET (regstart[*p]) ? d : regstart[*p] : regstart[*p]; DEBUG_PRINT2 (" old_regstart: %d\n", POINTER_TO_OFFSET (old_regstart[*p])); regstart[*p] = d; DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p])); IS_ACTIVE (reg_info[*p]) = 1; MATCHED_SOMETHING (reg_info[*p]) = 0; /* Clear this whenever we change the register activity status. */ set_regs_matched_done = 0; /* This is the new highest active register. */ highest_active_reg = *p; /* If nothing was active before, this is the new lowest active register. */ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) lowest_active_reg = *p; /* Move past the register number and inner group count. */ p += 2; just_past_start_mem = p; break; /* The stop_memory opcode represents the end of a group. Its arguments are the same as start_memory's: the register number, and the number of inner groups. */ case stop_memory: DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]); /* We need to save the string position the last time we were at this close-group operator in case the group is operated upon by a repetition operator, e.g., with `((a*)*(b*)*)*' against `aba'; then we want to ignore where we are now in the string in case this attempt to match fails. */ old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) ? REG_UNSET (regend[*p]) ? d : regend[*p] : regend[*p]; DEBUG_PRINT2 (" old_regend: %d\n", POINTER_TO_OFFSET (old_regend[*p])); regend[*p] = d; DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p])); /* This register isn't active anymore. */ IS_ACTIVE (reg_info[*p]) = 0; /* Clear this whenever we change the register activity status. */ set_regs_matched_done = 0; /* If this was the only register active, nothing is active anymore. */ if (lowest_active_reg == highest_active_reg) { lowest_active_reg = NO_LOWEST_ACTIVE_REG; highest_active_reg = NO_HIGHEST_ACTIVE_REG; } else { /* We must scan for the new highest active register, since it isn't necessarily one less than now: consider (a(b)c(d(e)f)g). When group 3 ends, after the f), the new highest active register is 1. */ unsigned char r = *p - 1; while (r > 0 && !IS_ACTIVE (reg_info[r])) r--; /* If we end up at register zero, that means that we saved the registers as the result of an `on_failure_jump', not a `start_memory', and we jumped to past the innermost `stop_memory'. For example, in ((.)*) we save registers 1 and 2 as a result of the *, but when we pop back to the second ), we are at the stop_memory 1. Thus, nothing is active. */ if (r == 0) { lowest_active_reg = NO_LOWEST_ACTIVE_REG; highest_active_reg = NO_HIGHEST_ACTIVE_REG; } else highest_active_reg = r; } /* If just failed to match something this time around with a group that's operated on by a repetition operator, try to force exit from the ``loop'', and restore the register information for this group that we had before trying this last match. */ if ((!MATCHED_SOMETHING (reg_info[*p]) || just_past_start_mem == p - 1) && (p + 2) < pend) { boolean is_a_jump_n = false; p1 = p + 2; mcnt = 0; switch ((re_opcode_t) *p1++) { case jump_n: is_a_jump_n = true; case pop_failure_jump: case maybe_pop_jump: case jump: case dummy_failure_jump: EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (is_a_jump_n) p1 += 2; break; default: /* do nothing */ ; } p1 += mcnt; /* If the next operation is a jump backwards in the pattern to an on_failure_jump right before the start_memory corresponding to this stop_memory, exit from the loop by forcing a failure after pushing on the stack the on_failure_jump's jump in the pattern, and d. */ if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump && (re_opcode_t) p1[3] == start_memory && p1[4] == *p) { /* If this group ever matched anything, then restore what its registers were before trying this last failed match, e.g., with `(a*)*b' against `ab' for regstart[1], and, e.g., with `((a*)*(b*)*)*' against `aba' for regend[3]. Also restore the registers for inner groups for, e.g., `((a*)(b*))*' against `aba' (register 3 would otherwise get trashed). */ if (EVER_MATCHED_SOMETHING (reg_info[*p])) { unsigned r; EVER_MATCHED_SOMETHING (reg_info[*p]) = 0; /* Restore this and inner groups' (if any) registers. */ for (r = *p; r < (unsigned) *p + (unsigned) *(p + 1); r++) { regstart[r] = old_regstart[r]; /* xx why this test? */ if (old_regend[r] >= regstart[r]) regend[r] = old_regend[r]; } } p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); PUSH_FAILURE_POINT (p1 + mcnt, d, -2); goto fail; } } /* Move past the register number and the inner group count. */ p += 2; break; /* \ has been turned into a `duplicate' command which is followed by the numeric value of as the register number. */ case duplicate: { register const char *d2, *dend2; int regno = *p++; /* Get which register to match against. */ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); /* Can't back reference a group which we've never matched. */ if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno])) goto fail; /* Where in input to try to start matching. */ d2 = regstart[regno]; /* Where to stop matching; if both the place to start and the place to stop matching are in the same string, then set to the place to stop, otherwise, for now have to use the end of the first string. */ dend2 = ((FIRST_STRING_P (regstart[regno]) == FIRST_STRING_P (regend[regno])) ? regend[regno] : end_match_1); for (;;) { /* If necessary, advance to next segment in register contents. */ while (d2 == dend2) { if (dend2 == end_match_2) break; if (dend2 == regend[regno]) break; /* End of string1 => advance to string2. */ d2 = string2; dend2 = regend[regno]; } /* At end of register contents => success */ if (d2 == dend2) break; /* If necessary, advance to next segment in data. */ PREFETCH (); /* How many characters left in this segment to match. */ mcnt = dend - d; /* Want how many consecutive characters we can match in one shot, so, if necessary, adjust the count. */ if (mcnt > dend2 - d2) mcnt = dend2 - d2; /* Compare that many; failure if mismatch, else move past them. */ if (translate ? bcmp_translate (d, d2, mcnt, translate) : bcmp (d, d2, mcnt)) goto fail; d += mcnt, d2 += mcnt; /* Do this because we've match some characters. */ SET_REGS_MATCHED (); } } break; /* begline matches the empty string at the beginning of the string (unless `not_bol' is set in `bufp'), and, if `newline_anchor' is set, after newlines. */ case begline: DEBUG_PRINT1 ("EXECUTING begline.\n"); if (AT_STRINGS_BEG (d)) { if (!bufp->not_bol) break; } else if (d[-1] == '\n' && bufp->newline_anchor) { break; } /* In all other cases, we fail. */ goto fail; /* endline is the dual of begline. */ case endline: DEBUG_PRINT1 ("EXECUTING endline.\n"); if (AT_STRINGS_END (d)) { if (!bufp->not_eol) break; } /* We have to ``prefetch'' the next character. */ else if ((d == end1 ? *string2 : *d) == '\n' && bufp->newline_anchor) { break; } goto fail; /* Match at the very beginning of the data. */ case begbuf: DEBUG_PRINT1 ("EXECUTING begbuf.\n"); if (AT_STRINGS_BEG (d)) break; goto fail; /* Match at the very end of the data. */ case endbuf: DEBUG_PRINT1 ("EXECUTING endbuf.\n"); if (AT_STRINGS_END (d)) break; goto fail; /* on_failure_keep_string_jump is used to optimize `.*\n'. It pushes NULL as the value for the string on the stack. Then `pop_failure_point' will keep the current value for the string, instead of restoring it. To see why, consider matching `foo\nbar' against `.*\n'. The .* matches the foo; then the . fails against the \n. But the next thing we want to do is match the \n against the \n; if we restored the string value, we would be back at the foo. Because this is used only in specific cases, we don't need to check all the things that `on_failure_jump' does, to make sure the right things get saved on the stack. Hence we don't share its code. The only reason to push anything on the stack at all is that otherwise we would have to change `anychar's code to do something besides goto fail in this case; that seems worse than this. */ case on_failure_keep_string_jump: DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); #ifdef _LIBC DEBUG_PRINT3 (" %d (to %p):\n", mcnt, p + mcnt); #else DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt); #endif PUSH_FAILURE_POINT (p + mcnt, NULL, -2); break; /* Uses of on_failure_jump: Each alternative starts with an on_failure_jump that points to the beginning of the next alternative. Each alternative except the last ends with a jump that in effect jumps past the rest of the alternatives. (They really jump to the ending jump of the following alternative, because tensioning these jumps is a hassle.) Repeats start with an on_failure_jump that points past both the repetition text and either the following jump or pop_failure_jump back to this on_failure_jump. */ case on_failure_jump: on_failure: DEBUG_PRINT1 ("EXECUTING on_failure_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); #ifdef _LIBC DEBUG_PRINT3 (" %d (to %p)", mcnt, p + mcnt); #else DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt); #endif /* If this on_failure_jump comes right before a group (i.e., the original * applied to a group), save the information for that group and all inner ones, so that if we fail back to this point, the group's information will be correct. For example, in \(a*\)*\1, we need the preceding group, and in \(zz\(a*\)b*\)\2, we need the inner group. */ /* We can't use `p' to check ahead because we push a failure point to `p + mcnt' after we do this. */ p1 = p; /* We need to skip no_op's before we look for the start_memory in case this on_failure_jump is happening as the result of a completed succeed_n, as in \(a\)\{1,3\}b\1 against aba. */ while (p1 < pend && (re_opcode_t) *p1 == no_op) p1++; if (p1 < pend && (re_opcode_t) *p1 == start_memory) { /* We have a new highest active register now. This will get reset at the start_memory we are about to get to, but we will have saved all the registers relevant to this repetition op, as described above. */ highest_active_reg = *(p1 + 1) + *(p1 + 2); if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) lowest_active_reg = *(p1 + 1); } DEBUG_PRINT1 (":\n"); PUSH_FAILURE_POINT (p + mcnt, d, -2); break; /* A smart repeat ends with `maybe_pop_jump'. We change it to either `pop_failure_jump' or `jump'. */ case maybe_pop_jump: EXTRACT_NUMBER_AND_INCR (mcnt, p); DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt); { register unsigned char *p2 = p; /* Compare the beginning of the repeat with what in the pattern follows its end. If we can establish that there is nothing that they would both match, i.e., that we would have to backtrack because of (as in, e.g., `a*a') then we can change to pop_failure_jump, because we'll never have to backtrack. This is not true in the case of alternatives: in `(a|ab)*' we do need to backtrack to the `ab' alternative (e.g., if the string was `ab'). But instead of trying to detect that here, the alternative has put on a dummy failure point which is what we will end up popping. */ /* Skip over open/close-group commands. If what follows this loop is a ...+ construct, look at what begins its body, since we will have to match at least one of that. */ while (1) { if (p2 + 2 < pend && ((re_opcode_t) *p2 == stop_memory || (re_opcode_t) *p2 == start_memory)) p2 += 3; else if (p2 + 6 < pend && (re_opcode_t) *p2 == dummy_failure_jump) p2 += 6; else break; } p1 = p + mcnt; /* p1[0] ... p1[2] are the `on_failure_jump' corresponding to the `maybe_finalize_jump' of this case. Examine what follows. */ /* If we're at the end of the pattern, we can change. */ if (p2 == pend) { /* Consider what happens when matching ":\(.*\)" against ":/". I don't really understand this code yet. */ p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" End of pattern: change to `pop_failure_jump'.\n"); } else if ((re_opcode_t) *p2 == exactn || (bufp->newline_anchor && (re_opcode_t) *p2 == endline)) { register unsigned char c = *p2 == (unsigned char) endline ? '\n' : p2[2]; if ((re_opcode_t) p1[3] == exactn && p1[5] != c) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", c, p1[5]); } else if ((re_opcode_t) p1[3] == charset || (re_opcode_t) p1[3] == charset_not) { int not = (re_opcode_t) p1[3] == charset_not; if (c < (unsigned char) (p1[4] * BYTEWIDTH) && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) not = !not; /* `not' is equal to 1 if c would match, which means that we can't change to pop_failure_jump. */ if (!not) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } } } else if ((re_opcode_t) *p2 == charset) { #ifdef DEBUG register unsigned char c = *p2 == (unsigned char) endline ? '\n' : p2[2]; #endif #if 0 if ((re_opcode_t) p1[3] == exactn && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5] && (p2[2 + p1[5] / BYTEWIDTH] & (1 << (p1[5] % BYTEWIDTH))))) #else if ((re_opcode_t) p1[3] == exactn && ! ((int) p2[1] * BYTEWIDTH > (int) p1[4] && (p2[2 + p1[4] / BYTEWIDTH] & (1 << (p1[4] % BYTEWIDTH))))) #endif { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", c, p1[5]); } else if ((re_opcode_t) p1[3] == charset_not) { int idx; /* We win if the charset_not inside the loop lists every character listed in the charset after. */ for (idx = 0; idx < (int) p2[1]; idx++) if (! (p2[2 + idx] == 0 || (idx < (int) p1[4] && ((p2[2 + idx] & ~ p1[5 + idx]) == 0)))) break; if (idx == p2[1]) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } } else if ((re_opcode_t) p1[3] == charset) { int idx; /* We win if the charset inside the loop has no overlap with the one after the loop. */ for (idx = 0; idx < (int) p2[1] && idx < (int) p1[4]; idx++) if ((p2[2 + idx] & p1[5 + idx]) != 0) break; if (idx == p2[1] || idx == p1[4]) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } } } } p -= 2; /* Point at relative address again. */ if ((re_opcode_t) p[-1] != pop_failure_jump) { p[-1] = (unsigned char) jump; DEBUG_PRINT1 (" Match => jump.\n"); goto unconditional_jump; } /* Note fall through. */ /* The end of a simple repeat has a pop_failure_jump back to its matching on_failure_jump, where the latter will push a failure point. The pop_failure_jump takes off failure points put on by this pop_failure_jump's matching on_failure_jump; we got through the pattern to here from the matching on_failure_jump, so didn't fail. */ case pop_failure_jump: { /* We need to pass separate storage for the lowest and highest registers, even though we don't care about the actual values. Otherwise, we will restore only one register from the stack, since lowest will == highest in `pop_failure_point'. */ active_reg_t dummy_low_reg, dummy_high_reg; unsigned char *pdummy; const char *sdummy; DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); POP_FAILURE_POINT (sdummy, pdummy, dummy_low_reg, dummy_high_reg, reg_dummy, reg_dummy, reg_info_dummy); } /* Note fall through. */ unconditional_jump: #ifdef _LIBC DEBUG_PRINT2 ("\n%p: ", p); #else DEBUG_PRINT2 ("\n0x%x: ", p); #endif /* Note fall through. */ /* Unconditionally jump (without popping any failure points). */ case jump: EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */ DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt); p += mcnt; /* Do the jump. */ #ifdef _LIBC DEBUG_PRINT2 ("(to %p).\n", p); #else DEBUG_PRINT2 ("(to 0x%x).\n", p); #endif break; /* We need this opcode so we can detect where alternatives end in `group_match_null_string_p' et al. */ case jump_past_alt: DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n"); goto unconditional_jump; /* Normally, the on_failure_jump pushes a failure point, which then gets popped at pop_failure_jump. We will end up at pop_failure_jump, also, and with a pattern of, say, `a+', we are skipping over the on_failure_jump, so we have to push something meaningless for pop_failure_jump to pop. */ case dummy_failure_jump: DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n"); /* It doesn't matter what we push for the string here. What the code at `fail' tests is the value for the pattern. */ PUSH_FAILURE_POINT (0, 0, -2); goto unconditional_jump; /* At the end of an alternative, we need to push a dummy failure point in case we are followed by a `pop_failure_jump', because we don't want the failure point for the alternative to be popped. For example, matching `(a|ab)*' against `aab' requires that we match the `ab' alternative. */ case push_dummy_failure: DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n"); /* See comments just above at `dummy_failure_jump' about the two zeroes. */ PUSH_FAILURE_POINT (0, 0, -2); break; /* Have to succeed matching what follows at least n times. After that, handle like `on_failure_jump'. */ case succeed_n: EXTRACT_NUMBER (mcnt, p + 2); DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt); assert (mcnt >= 0); /* Originally, this is how many times we HAVE to succeed. */ if (mcnt > 0) { mcnt--; p += 2; STORE_NUMBER_AND_INCR (p, mcnt); #ifdef _LIBC DEBUG_PRINT3 (" Setting %p to %d.\n", p - 2, mcnt); #else DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p - 2, mcnt); #endif } else if (mcnt == 0) { #ifdef _LIBC DEBUG_PRINT2 (" Setting two bytes from %p to no_op.\n", p+2); #else DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2); #endif p[2] = (unsigned char) no_op; p[3] = (unsigned char) no_op; goto on_failure; } break; case jump_n: EXTRACT_NUMBER (mcnt, p + 2); DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt); /* Originally, this is how many times we CAN jump. */ if (mcnt) { mcnt--; STORE_NUMBER (p + 2, mcnt); #ifdef _LIBC DEBUG_PRINT3 (" Setting %p to %d.\n", p + 2, mcnt); #else DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p + 2, mcnt); #endif goto unconditional_jump; } /* If don't have to jump any more, skip over the rest of command. */ else p += 4; break; case set_number_at: { DEBUG_PRINT1 ("EXECUTING set_number_at.\n"); EXTRACT_NUMBER_AND_INCR (mcnt, p); p1 = p + mcnt; EXTRACT_NUMBER_AND_INCR (mcnt, p); #ifdef _LIBC DEBUG_PRINT3 (" Setting %p to %d.\n", p1, mcnt); #else DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt); #endif STORE_NUMBER (p1, mcnt); break; } #if 0 /* The DEC Alpha C compiler 3.x generates incorrect code for the test WORDCHAR_P (d - 1) != WORDCHAR_P (d) in the expansion of AT_WORD_BOUNDARY, so this code is disabled. Expanding the macro and introducing temporary variables works around the bug. */ case wordbound: DEBUG_PRINT1 ("EXECUTING wordbound.\n"); if (AT_WORD_BOUNDARY (d)) break; goto fail; case notwordbound: DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); if (AT_WORD_BOUNDARY (d)) goto fail; break; #else case wordbound: { boolean prevchar, thischar; DEBUG_PRINT1 ("EXECUTING wordbound.\n"); if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) break; prevchar = WORDCHAR_P (d - 1); thischar = WORDCHAR_P (d); if (prevchar != thischar) break; goto fail; } case notwordbound: { boolean prevchar, thischar; DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) goto fail; prevchar = WORDCHAR_P (d - 1); thischar = WORDCHAR_P (d); if (prevchar != thischar) goto fail; break; } #endif case wordbeg: DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1))) break; goto fail; case wordend: DEBUG_PRINT1 ("EXECUTING wordend.\n"); if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1) && (!WORDCHAR_P (d) || AT_STRINGS_END (d))) break; goto fail; #ifdef emacs case before_dot: DEBUG_PRINT1 ("EXECUTING before_dot.\n"); if (PTR_CHAR_POS ((unsigned char *) d) >= point) goto fail; break; case at_dot: DEBUG_PRINT1 ("EXECUTING at_dot.\n"); if (PTR_CHAR_POS ((unsigned char *) d) != point) goto fail; break; case after_dot: DEBUG_PRINT1 ("EXECUTING after_dot.\n"); if (PTR_CHAR_POS ((unsigned char *) d) <= point) goto fail; break; case syntaxspec: DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt); mcnt = *p++; goto matchsyntax; case wordchar: DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n"); mcnt = (int) Sword; matchsyntax: PREFETCH (); /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ d++; if (SYNTAX (d[-1]) != (enum syntaxcode) mcnt) goto fail; SET_REGS_MATCHED (); break; case notsyntaxspec: DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt); mcnt = *p++; goto matchnotsyntax; case notwordchar: DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n"); mcnt = (int) Sword; matchnotsyntax: PREFETCH (); /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ d++; if (SYNTAX (d[-1]) == (enum syntaxcode) mcnt) goto fail; SET_REGS_MATCHED (); break; #else /* not emacs */ case wordchar: DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n"); PREFETCH (); if (!WORDCHAR_P (d)) goto fail; SET_REGS_MATCHED (); d++; break; case notwordchar: DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n"); PREFETCH (); if (WORDCHAR_P (d)) goto fail; SET_REGS_MATCHED (); d++; break; #endif /* not emacs */ default: abort (); } continue; /* Successfully executed one pattern command; keep going. */ /* We goto here if a matching operation fails. */ fail: if (!FAIL_STACK_EMPTY ()) { /* A restart point is known. Restore to that state. */ DEBUG_PRINT1 ("\nFAIL:\n"); POP_FAILURE_POINT (d, p, lowest_active_reg, highest_active_reg, regstart, regend, reg_info); /* If this failure point is a dummy, try the next one. */ if (!p) goto fail; /* If we failed to the end of the pattern, don't examine *p. */ assert (p <= pend); if (p < pend) { boolean is_a_jump_n = false; /* If failed to a backwards jump that's part of a repetition loop, need to pop this failure point and use the next one. */ switch ((re_opcode_t) *p) { case jump_n: is_a_jump_n = true; case maybe_pop_jump: case pop_failure_jump: case jump: p1 = p + 1; EXTRACT_NUMBER_AND_INCR (mcnt, p1); p1 += mcnt; if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n) || (!is_a_jump_n && (re_opcode_t) *p1 == on_failure_jump)) goto fail; break; default: /* do nothing */ ; } } if (d >= string1 && d <= end1) dend = end_match_1; } else break; /* Matching at this starting point really fails. */ } /* for (;;) */ if (best_regs_set) goto restore_best_regs; FREE_VARIABLES (); return -1; /* Failure to match. */ } /* re_match_2 */ /* Subroutine definitions for re_match_2. */ /* We are passed P pointing to a register number after a start_memory. Return true if the pattern up to the corresponding stop_memory can match the empty string, and false otherwise. If we find the matching stop_memory, sets P to point to one past its number. Otherwise, sets P to an undefined byte less than or equal to END. We don't handle duplicates properly (yet). */ static boolean group_match_null_string_p (p, end, reg_info) unsigned char **p, *end; register_info_type *reg_info; { int mcnt; /* Point to after the args to the start_memory. */ unsigned char *p1 = *p + 2; while (p1 < end) { /* Skip over opcodes that can match nothing, and return true or false, as appropriate, when we get to one that can't, or to the matching stop_memory. */ switch ((re_opcode_t) *p1) { /* Could be either a loop or a series of alternatives. */ case on_failure_jump: p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); /* If the next operation is not a jump backwards in the pattern. */ if (mcnt >= 0) { /* Go through the on_failure_jumps of the alternatives, seeing if any of the alternatives cannot match nothing. The last alternative starts with only a jump, whereas the rest start with on_failure_jump and end with a jump, e.g., here is the pattern for `a|b|c': /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6 /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3 /exactn/1/c So, we have to first go through the first (n-1) alternatives and then deal with the last one separately. */ /* Deal with the first (n-1) alternatives, which start with an on_failure_jump (see above) that jumps to right past a jump_past_alt. */ while ((re_opcode_t) p1[mcnt-3] == jump_past_alt) { /* `mcnt' holds how many bytes long the alternative is, including the ending `jump_past_alt' and its number. */ if (!alt_match_null_string_p (p1, p1 + mcnt - 3, reg_info)) return false; /* Move to right after this alternative, including the jump_past_alt. */ p1 += mcnt; /* Break if it's the beginning of an n-th alternative that doesn't begin with an on_failure_jump. */ if ((re_opcode_t) *p1 != on_failure_jump) break; /* Still have to check that it's not an n-th alternative that starts with an on_failure_jump. */ p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); if ((re_opcode_t) p1[mcnt-3] != jump_past_alt) { /* Get to the beginning of the n-th alternative. */ p1 -= 3; break; } } /* Deal with the last alternative: go back and get number of the `jump_past_alt' just before it. `mcnt' contains the length of the alternative. */ EXTRACT_NUMBER (mcnt, p1 - 2); if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info)) return false; p1 += mcnt; /* Get past the n-th alternative. */ } /* if mcnt > 0 */ break; case stop_memory: assert (p1[1] == **p); *p = p1 + 2; return true; default: if (!common_op_match_null_string_p (&p1, end, reg_info)) return false; } } /* while p1 < end */ return false; } /* group_match_null_string_p */ /* Similar to group_match_null_string_p, but doesn't deal with alternatives: It expects P to be the first byte of a single alternative and END one byte past the last. The alternative can contain groups. */ static boolean alt_match_null_string_p (p, end, reg_info) unsigned char *p, *end; register_info_type *reg_info; { int mcnt; unsigned char *p1 = p; while (p1 < end) { /* Skip over opcodes that can match nothing, and break when we get to one that can't. */ switch ((re_opcode_t) *p1) { /* It's a loop. */ case on_failure_jump: p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); p1 += mcnt; break; default: if (!common_op_match_null_string_p (&p1, end, reg_info)) return false; } } /* while p1 < end */ return true; } /* alt_match_null_string_p */ /* Deals with the ops common to group_match_null_string_p and alt_match_null_string_p. Sets P to one after the op and its arguments, if any. */ static boolean common_op_match_null_string_p (p, end, reg_info) unsigned char **p, *end; register_info_type *reg_info; { int mcnt; boolean ret; int reg_no; unsigned char *p1 = *p; switch ((re_opcode_t) *p1++) { case no_op: case begline: case endline: case begbuf: case endbuf: case wordbeg: case wordend: case wordbound: case notwordbound: #ifdef emacs case before_dot: case at_dot: case after_dot: #endif break; case start_memory: reg_no = *p1; assert (reg_no > 0 && reg_no <= MAX_REGNUM); ret = group_match_null_string_p (&p1, end, reg_info); /* Have to set this here in case we're checking a group which contains a group and a back reference to it. */ if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE) REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret; if (!ret) return false; break; /* If this is an optimized succeed_n for zero times, make the jump. */ case jump: EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (mcnt >= 0) p1 += mcnt; else return false; break; case succeed_n: /* Get to the number of times to succeed. */ p1 += 2; EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (mcnt == 0) { p1 -= 4; EXTRACT_NUMBER_AND_INCR (mcnt, p1); p1 += mcnt; } else return false; break; case duplicate: if (!REG_MATCH_NULL_STRING_P (reg_info[*p1])) return false; break; case set_number_at: p1 += 4; default: /* All other opcodes mean we cannot match the empty string. */ return false; } *p = p1; return true; } /* common_op_match_null_string_p */ /* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN bytes; nonzero otherwise. */ static int bcmp_translate (s1, s2, len, translate) const char *s1, *s2; register int len; RE_TRANSLATE_TYPE translate; { register const unsigned char *p1 = (const unsigned char *) s1; register const unsigned char *p2 = (const unsigned char *) s2; while (len) { if (translate[*p1++] != translate[*p2++]) return 1; len--; } return 0; } /* Entry points for GNU code. */ /* re_compile_pattern is the GNU regular expression compiler: it compiles PATTERN (of length SIZE) and puts the result in BUFP. Returns 0 if the pattern was valid, otherwise an error string. Assumes the `allocated' (and perhaps `buffer') and `translate' fields are set in BUFP on entry. We call regex_compile to do the actual compilation. */ const char * re_compile_pattern (pattern, length, bufp) const char *pattern; size_t length; struct re_pattern_buffer *bufp; { reg_errcode_t ret; /* GNU code is written to assume at least RE_NREGS registers will be set (and at least one extra will be -1). */ bufp->regs_allocated = REGS_UNALLOCATED; /* And GNU code determines whether or not to get register information by passing null for the REGS argument to re_match, etc., not by setting no_sub. */ bufp->no_sub = 0; /* Match anchors at newline. */ bufp->newline_anchor = 1; ret = regex_compile (pattern, length, re_syntax_options, bufp); if (!ret) return NULL; return gettext (re_error_msgid[(int) ret]); } /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ #if defined (_REGEX_RE_COMP) || defined (_LIBC) /* BSD has one and only one pattern buffer. */ static struct re_pattern_buffer re_comp_buf; char * #ifdef _LIBC /* Make these definitions weak in libc, so POSIX programs can redefine these names if they don't use our functions, and still use regcomp/regexec below without link errors. */ weak_function #endif re_comp (s) const char *s; { reg_errcode_t ret; if (!s) { if (!re_comp_buf.buffer) return gettext ("No previous regular expression"); return 0; } if (!re_comp_buf.buffer) { re_comp_buf.buffer = (unsigned char *) malloc (200); /* __MEM_CHECKED__ */ if (re_comp_buf.buffer == NULL) return gettext (re_error_msgid[(int) REG_ESPACE]); re_comp_buf.allocated = 200; re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH); /* __MEM_CHECKED__ */ if (re_comp_buf.fastmap == NULL) return gettext (re_error_msgid[(int) REG_ESPACE]); } /* Since `re_exec' always passes NULL for the `regs' argument, we don't need to initialize the pattern buffer fields which affect it. */ /* Match anchors at newlines. */ re_comp_buf.newline_anchor = 1; ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); if (!ret) return NULL; /* Yes, we're discarding `const' here if !HAVE_LIBINTL. */ return (char *) gettext (re_error_msgid[(int) ret]); } int #ifdef _LIBC weak_function #endif re_exec (s) const char *s; { const int len = strlen (s); return 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0); } #endif /* _REGEX_RE_COMP */ /* POSIX.2 functions. Don't define these for Emacs. */ #ifndef emacs /* regcomp takes a regular expression as a string and compiles it. PREG is a regex_t *. We do not expect any fields to be initialized, since POSIX says we shouldn't. Thus, we set `buffer' to the compiled pattern; `used' to the length of the compiled pattern; `syntax' to RE_SYNTAX_POSIX_EXTENDED if the REG_EXTENDED bit in CFLAGS is set; otherwise, to RE_SYNTAX_POSIX_BASIC; `newline_anchor' to REG_NEWLINE being set in CFLAGS; `fastmap' and `fastmap_accurate' to zero; `re_nsub' to the number of subexpressions in PATTERN. PATTERN is the address of the pattern string. CFLAGS is a series of bits which affect compilation. If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we use POSIX basic syntax. If REG_NEWLINE is set, then . and [^...] don't match newline. Also, regexec will try a match beginning after every newline. If REG_ICASE is set, then we considers upper- and lowercase versions of letters to be equivalent when matching. If REG_NOSUB is set, then when PREG is passed to regexec, that routine will report only success or failure, and nothing about the registers. It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for the return codes and their meanings.) */ int regcomp (preg, pattern, cflags) regex_t *preg; const char *pattern; int cflags; { reg_errcode_t ret; reg_syntax_t syntax = (cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC; /* regex_compile will allocate the space for the compiled pattern. */ preg->buffer = 0; preg->allocated = 0; preg->used = 0; /* Don't bother to use a fastmap when searching. This simplifies the REG_NEWLINE case: if we used a fastmap, we'd have to put all the characters after newlines into the fastmap. This way, we just try every character. */ preg->fastmap = 0; if (cflags & REG_ICASE) { unsigned i; preg->translate = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE /* __MEM_CHECKED__ */ * sizeof (*(RE_TRANSLATE_TYPE)0)); if (preg->translate == NULL) return (int) REG_ESPACE; /* Map uppercase characters to corresponding lowercase ones. */ for (i = 0; i < CHAR_SET_SIZE; i++) preg->translate[i] = ISUPPER (i) ? tolower (i) : i; } else preg->translate = NULL; /* If REG_NEWLINE is set, newlines are treated differently. */ if (cflags & REG_NEWLINE) { /* REG_NEWLINE implies neither . nor [^...] match newline. */ syntax &= ~RE_DOT_NEWLINE; syntax |= RE_HAT_LISTS_NOT_NEWLINE; /* It also changes the matching behavior. */ preg->newline_anchor = 1; } else preg->newline_anchor = 0; preg->no_sub = !!(cflags & REG_NOSUB); /* POSIX says a null character in the pattern terminates it, so we can use strlen here in compiling the pattern. */ ret = regex_compile (pattern, strlen (pattern), syntax, preg); /* POSIX doesn't distinguish between an unmatched open-group and an unmatched close-group: both are REG_EPAREN. */ if (ret == REG_ERPAREN) ret = REG_EPAREN; return (int) ret; } /* regexec searches for a given pattern, specified by PREG, in the string STRING. If NMATCH is zero or REG_NOSUB was set in the cflags argument to `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at least NMATCH elements, and we set them to the offsets of the corresponding matched substrings. EFLAGS specifies `execution flags' which affect matching: if REG_NOTBOL is set, then ^ does not match at the beginning of the string; if REG_NOTEOL is set, then $ does not match at the end. We return 0 if we find a match and REG_NOMATCH if not. */ int regexec (preg, string, nmatch, pmatch, eflags) const regex_t *preg; const char *string; size_t nmatch; regmatch_t pmatch[]; int eflags; { int ret; struct re_registers regs; regex_t private_preg; int len = strlen (string); boolean want_reg_info = !preg->no_sub && nmatch > 0; private_preg = *preg; private_preg.not_bol = !!(eflags & REG_NOTBOL); private_preg.not_eol = !!(eflags & REG_NOTEOL); /* The user has told us exactly how many registers to return information about, via `nmatch'. We have to pass that on to the matching routines. */ private_preg.regs_allocated = REGS_FIXED; if (want_reg_info) { regs.num_regs = nmatch; regs.start = TALLOC (nmatch, regoff_t); regs.end = TALLOC (nmatch, regoff_t); if (regs.start == NULL || regs.end == NULL) return (int) REG_NOMATCH; } /* Perform the searching operation. */ ret = re_search (&private_preg, string, len, /* start: */ 0, /* range: */ len, want_reg_info ? ®s : (struct re_registers *) 0); /* Copy the register information to the POSIX structure. */ if (want_reg_info) { if (ret >= 0) { unsigned r; for (r = 0; r < nmatch; r++) { pmatch[r].rm_so = regs.start[r]; pmatch[r].rm_eo = regs.end[r]; } } /* If we needed the temporary register info, free the space now. */ free (regs.start); /* __MEM_CHECKED__ */ free (regs.end); /* __MEM_CHECKED__ */ } /* We want zero return to mean success, unlike `re_search'. */ return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH; } /* Returns a message corresponding to an error code, ERRCODE, returned from either regcomp or regexec. We don't use PREG here. */ size_t regerror (errcode, preg, errbuf, errbuf_size) int errcode; const regex_t *preg; char *errbuf; size_t errbuf_size; { const char *msg; size_t msg_size; if (errcode < 0 || errcode >= (int) (sizeof (re_error_msgid) / sizeof (re_error_msgid[0]))) /* Only error codes returned by the rest of the code should be passed to this routine. If we are given anything else, or if other regex code generates an invalid error code, then the program has a bug. Dump core so we can fix it. */ abort (); msg = gettext (re_error_msgid[errcode]); msg_size = strlen (msg) + 1; /* Includes the null. */ if (errbuf_size != 0) { if (msg_size > errbuf_size) { strncpy (errbuf, msg, errbuf_size - 1); errbuf[errbuf_size - 1] = 0; } else strcpy (errbuf, msg); /* __STRCPY_CHECKED__ */ } return msg_size; } /* Free dynamically allocated space used by PREG. */ void regfree (preg) regex_t *preg; { if (preg->buffer != NULL) free (preg->buffer); /* __MEM_CHECKED__ */ preg->buffer = NULL; preg->allocated = 0; preg->used = 0; if (preg->fastmap != NULL) free (preg->fastmap); /* __MEM_CHECKED__ */ preg->fastmap = NULL; preg->fastmap_accurate = 0; if (preg->translate != NULL) free (preg->translate); /* __MEM_CHECKED__ */ preg->translate = NULL; } #endif /* not emacs */ fim-0.6-rc2/src/SDLDevice.cpp0000644000175000017500000013754114460034210012601 00000000000000/* $LastChangedDate: 2023-07-25 23:03:03 +0200 (Tue, 25 Jul 2023) $ */ /* SDLDevice.cpp : sdllib device Fim driver file (c) 2008-2023 Michele Martone based on code (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NOTES : The SDL support is INCOMPLETE: * * - input problems when coupled with readline */ #include "fim.h" #ifdef FIM_WITH_LIBSDL #include "SDLDevice.h" #if (FIM_WITH_LIBSDL_VERSION == 1) #define FIM_SDL_FLAGS /*SDL_FULLSCREEN|*/SDL_HWSURFACE #else /* FIM_WITH_LIBSDL_VERSION == 2 <- experimental */ #define FIM_SDL_FLAGS 0 #define SDL_FULLSCREEN SDL_WINDOW_FULLSCREEN_DESKTOP // :-) #define SDL_RESIZABLE SDL_WINDOW_RESIZABLE // :-) #endif /* FIM_WITH_LIBSDL_VERSION */ #define FIM_WANT_HARDCODED_ICON 1 #define FIM_SDL_ICONPATH "" #define FIM_FRAC(VAL,N,D) (((VAL)*(N))/(D)) #define FIM_SDL_KEYSYM_TO_RL(X) ((X) | (1<<31)) // see readline.cpp #define FIM_SDL_KEYSYM_TO_RL_CTRL(X) 1+((X)-'a'); namespace fim { extern fim_int fim_fmf_; /* FIXME */ extern CommandConsole cc; } #define FIM_SDL_MINWIDTH 2 #define FIM_SDL_MINHEIGHT 2 #define FIM_SDL_ALLOW_QUIT 1 #define FIM_SDL_WANT_KEYREPEAT 1 #define FIM_SDL_WANT_RESIZE 1 #define FIM_SDL_WANT_PERCENTAGE 1 #define FIM_SDL_DEBUG 1 #undef FIM_SDL_DEBUG #define FIM_WANT_MOUSE_PAN 1 #define FIM_WANT_SDL_CLICK_MOUSE_SUPPORT FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT #define FIM_WANT_SDL_CLICK_MENU FIM_WANT_SDL_CLICK_MOUSE_SUPPORT && 1 #if FIM_WANT_MOUSE_CROP namespace fim { static fim_coo_t g_last_click_x{-1}; static fim_coo_t g_last_click_y{-1}; static SDL_Rect lastsrcrect; static SDL_Rect lastdstrect; } #endif /* FIM_WANT_MOUSE_CROP */ #ifdef FIM_SDL_DEBUG #define FIM_SDL_DBG_COUT std::cout << "SDL:" << __FILE__ ":" << __LINE__ << ":" << __func__ << "() " #define FIM_SDL_INPUT_DEBUG(C,MSG) \ { \ /* i miss sooo much printf() :'( */ \ FIM_SDL_DBG_COUT << (size_t)getmilliseconds() << " : "<redisplay(); // will indirectly trigger draw_help_map() } static fim_int fim_draw_help_map_tmp_=0; // static void flip_draw_help_map_tmp(bool flip) { #if FIM_WANT_SDL_CLICK_MENU if(!flip) if(fim_draw_help_map_tmp_==0) return; // nothing to do fim_draw_help_map_tmp_=1-fim_draw_help_map_tmp_; if(fim_draw_help_map_tmp_) if(Viewport* cv = cc.current_viewport()) cv->redisplay(); // will indirectly trigger draw_help_map() #endif /* FIM_WANT_SDL_CLICK_MENU */ } #endif /* FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT */ fim_err_t SDLDevice::parse_optstring(const fim_char_t *os) { bool want_windowed=want_windowed_; bool want_mouse_display=want_mouse_display_; bool want_resize=want_resize_; fim_coo_t current_w=current_w_; fim_coo_t current_h=current_h_; if(os) { while(*os&&!isdigit(*os)) { bool tv=true; if(isupper(*os)) tv=false; switch(tolower(*os)){ case 'w': want_windowed=tv; break; case 'm': want_mouse_display=tv; break; case 'r': want_resize=tv; break; #if FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT case 'h': toggle_draw_help_map(); if(!tv) fim_draw_help_map_=0; break; #endif default: std::cerr<<"unrecognized specifier character \""<<*os<<"\"\n";goto err; } ++os; } if(*os) { if(const int si = sscanf(os,"%d:%d",¤t_w,¤t_h)) { if ( si == 1) current_h = current_w; #if FIM_SDL_WANT_PERCENTAGE if ( strrchr(os,'%') && !strrchr(os,'%')[1] ) #endif current_w = FIM_MIN(current_w, 100), current_h = FIM_MIN(current_h, 100); } else { current_w = current_h = 0; std::cerr << "user specification of resolution (\""<viewport_width(); fim_coo_t yh = cv->viewport_height(); fim_coo_t xt = xw/3; fim_coo_t yt = yh/3; fim_coo_t xtl = xt/16; fim_coo_t ytl = yt/16; fim_coo_t eth = 1; // extra thickness fim_color_t ic = FIM_CNS_WHITE; fim_color_t oc = FIM_CNS_BLACK; // test //fill_rect(xw/2, xw/2, 0, yh-1, ic, oc); // test middle vertical //fill_rect(0, xw-1, yh/2, yh/2, ic, oc); // test middle horizontal // horizontal fill_rect(0, xtl, 1*yt-eth, 1*yt+eth, ic, oc); // left top fill_rect(0, xtl, 2*yt-eth, 2*yt+eth, ic, oc); // left bottom fill_rect(xw-xtl, xw-1, 1*yt-eth, 1*yt+eth, ic, oc); // right top fill_rect(xw-xtl, xw-1, 2*yt-eth, 2*yt+eth, ic, oc); // right bottom // vertical fill_rect(1*xt-eth, 1*xt+eth, 0*ytl, 1*ytl, ic, oc); // left top fill_rect(2*xt-eth, 2*xt+eth, 0*ytl, 1*ytl, ic, oc); // right top fill_rect(1*xt-eth, 1*xt+eth, yh-ytl, yh-1, ic, oc); // left bottom fill_rect(2*xt-eth, 2*xt+eth, yh-ytl, yh-1, ic, oc); // right bottom #if FIM_WANT_POSITION_DISPLAYED fim_coo_t yp = gy; fim_coo_t xp = gx; if(yp>=eth && yp=eth && xpviewport_width(); fim_coo_t yh = cv->viewport_height(); fim_coo_t xt = xw/6; fim_coo_t yt = yh/6; fim_coo_t eth = 1; fim_coo_t fd = FIM_MAX(f_->swidth(),f_->sheight()); if(xw > 6*fd && yh > 6*fd) { fim_color_t ic = FIM_CNS_WHITE; fim_color_t oc = FIM_CNS_BLACK; fill_rect(0*2*xt, xw, 1*2*yt-eth, 1*2*yt+eth, ic, oc); fill_rect(0*2*xt, xw, 2*2*yt-eth, 2*2*yt+eth, ic, oc); fill_rect(1*2*xt-eth, 1*2*xt+eth, 0, yh-1, ic, oc); fill_rect(2*2*xt-eth, 2*2*xt+eth, 0, yh-1, ic, oc); // left column fs_putc(f_, 1*xt, 1*yt, key_char_grid[0]); fs_putc(f_, 1*xt, 3*yt, key_char_grid[1]); fs_putc(f_, 1*xt, 5*yt, key_char_grid[2]); // middle column fs_putc(f_, 3*xt, 1*yt, key_char_grid[3]); fs_putc(f_, 3*xt, 3*yt, key_char_grid[4]); fs_putc(f_, 3*xt, 5*yt, key_char_grid[5]); // right column fs_putc(f_, 5*xt, 1*yt, key_char_grid[6]); fs_putc(f_, 5*xt, 3*yt, key_char_grid[7]); fs_putc(f_, 5*xt, 5*yt, key_char_grid[8]); } } #endif /* FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT */ return FIM_ERR_NO_ERROR; } fim_err_t SDLDevice::display( //const struct ida_image *img, // source image structure const void *ida_image_img, // source image structure //void* rgb,// source rgb array fim_coo_t iroff,fim_coo_t icoff, // row and column offset of the first input pixel fim_coo_t irows,fim_coo_t icols,// rows and columns in the input image fim_coo_t icskip, // input columns to skip for each line fim_coo_t oroff,fim_coo_t ocoff,// row and column offset of the first output pixel fim_coo_t orows,fim_coo_t ocols,// rows and columns to draw in output buffer fim_coo_t ocskip,// output columns to skip for each line fim_flags_t flags// some flags ) { /* * TODO : generalize this routine and put in common.cpp * */ /* * FIXME : centering mechanisms missing here; an intermediate function * shareable with FramebufferDevice would be nice, if implemented in AADevice. * */ //was : void fim_byte_t* rgb = ida_image_img?((const struct ida_image*)ida_image_img)->data:FIM_NULL;// source rgb array if ( !rgb ) return -1; if( iroff <0 ) return -2; if( icoff <0 ) return -3; if( irows <=0 ) return -4; if( icols <=0 ) return -5; if( icskip<0 ) return -6; if( oroff <0 ) return -7; if( ocoff <0 ) return -8; if( orows <=0 ) return -9; if( ocols <=0 ) return -10; if( ocskip<0 ) return -11; if( flags <0 ) return -12; if( iroff>irows ) return -2-3*100 ; if( icoff>icols ) return -3-5*100; // if( oroff>orows ) return -7-9*100;//EXP // if( ocoff>ocols ) return -8-10*100;//EXP if( oroff>height() ) return -7-9*100;//EXP if( ocoff>width()) return -8-10*100;//EXP if( icskip height() ) return -9 -99*100; if( ocols > width() ) return -10-99*100; if( ocskip < width() ) return -11-99*100; if( icskip 16*1024 || irows > 16*1024); /* FIXME: occurring with SDL-1.2.15; to ascertain! (actually problems occur with an 21874x940 pixelmap ) */ // FIXME : temporary // clear_rect( ocoff, ocoff+ocols, oroff, oroff+orows); // clear_rect( 0, ocols, 0, orows); clear_rect( 0, width()-1, 0, height()-1); if(!mirror && !flip && !buginsdlorsomewhere) { #if 0 for(oi=oroff;FIM_LIKELY(oipitch/Bpp_; ii = oi + idr; ij = oj + idc; srcp = ((fim_byte_t*)rgb)+(3*(ii*icskip+ij)); setpixel(screen_, oj, ytimesw, (fim_coo_t)srcp[0], (fim_coo_t)srcp[1], (fim_coo_t)srcp[2]); } #else FIM_CONSTEXPR Uint32 rmask=0x00000000,gmask=0x00000000,bmask=0x00000000,amask=0x00000000; if(SDL_Surface *src=SDL_CreateRGBSurfaceFrom(rgb,icols,irows,24,icols*3,rmask,gmask,bmask,amask)) { SDL_Rect srcrect; SDL_Rect dstrect; srcrect.x=icoff; srcrect.y=iroff; srcrect.w=icols; srcrect.h=irows; dstrect.x=ocoff; dstrect.y=oroff; dstrect.w=ocols; dstrect.h=orows; #if FIM_WANT_MOUSE_CROP lastsrcrect = srcrect; lastdstrect = dstrect; #endif /* FIM_WANT_MOUSE_CROP */ SDL_UpperBlit(src,&srcrect,screen_,&dstrect); SDL_FreeSurface(src); /* FIXME: shall check error codes */ } else { /* FIXME: need some error processing, here */ return FIM_ERR_GENERIC; } #endif } else for(oi=oroff;FIM_LIKELY(oipitch/Bpp_; /* UNFINISHED : FIX ME */ ii = oi + idr; ij = oj + idc; if(mirror)ij=((icols-1)-ij); if( flip )ii=((irows-1)-ii); srcp = ((fim_byte_t*)rgb)+(3*(ii*icskip+ij)); setpixel(screen_, oj, ytimesw, (fim_coo_t)srcp[0], (fim_coo_t)srcp[1], (fim_coo_t)srcp[2]); } #if FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT if(fim_draw_help_map_ || fim_draw_help_map_tmp_) draw_help_map(); #endif /* FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT */ if(SDL_MUSTLOCK(screen_)) SDL_UnlockSurface(screen_); #if (FIM_WITH_LIBSDL_VERSION == 1) SDL_Flip(screen_); #else /* FIM_WITH_LIBSDL_VERSION */ sdl2_redraw(); #endif /* FIM_WITH_LIBSDL_VERSION */ return FIM_ERR_NO_ERROR; } bool SDLDevice::sdl_window_update(void) { #if (FIM_WITH_LIBSDL_VERSION == 1) vi_ = SDL_GetVideoInfo(); if(!vi_) return false; current_w_=vi_->current_w; current_h_=vi_->current_h; bpp_ =vi_->vfmt->BitsPerPixel; Bpp_ =vi_->vfmt->BytesPerPixel; // FIXME: shall update want_windowed_ with effective flags contents #else /* FIM_WITH_LIBSDL_VERSION */ if(!wi_) return false; SDL_GetWindowSize(wi_, ¤t_w_, ¤t_h_); if(!screen_ || !screen_->format) return false; bpp_ =screen_->format->BitsPerPixel; Bpp_ =screen_->format->BytesPerPixel; #endif /* FIM_WITH_LIBSDL_VERSION */ return true; } fim_err_t SDLDevice::initialize(sym_keys_t &sym_keys) { fim_coo_t want_width=current_w_, want_height=current_h_/*, want_bpp=0*/; setenv("SDL_VIDEO_CENTERED","1",0); if (SDL_Init(SDL_INIT_VIDEO) < 0 ) { std::cerr << "problems initializing SDL (SDL_Init)\n"; goto sdlerr; } #if (FIM_WITH_LIBSDL_VERSION == 1) if( const SDL_VideoInfo * bvip = SDL_GetVideoInfo() ) { bvi_=*bvip; get_modes_list(); } #else /* FIM_WITH_LIBSDL_VERSION */ get_modes_list(); want_width = want_width ? want_width : FIM_DEFAULT_WINDOW_WIDTH; want_height = want_height ? want_height : FIM_DEFAULT_WINDOW_HEIGHT; wi_ = SDL_CreateWindow(FIM_CNS_FIM_APPTITLE, SDL_WINDOWPOS_CENTERED /*SDL_WINDOWPOS_UNDEFINED*/, SDL_WINDOWPOS_CENTERED, want_width, want_height, want_resize_?SDL_WINDOW_RESIZABLE:0); re_ = SDL_CreateRenderer(wi_, -1, 0); SDL_RenderClear(re_); SDL_RenderPresent(re_); #endif /* FIM_WITH_LIBSDL_VERSIO */ fim_perror(FIM_NULL); #if (FIM_WITH_LIBSDL_VERSION == 1) if(FIM_SDL_WANT_KEYREPEAT) { fim_sdl_int delay = SDL_DEFAULT_REPEAT_DELAY, interval = SDL_DEFAULT_REPEAT_INTERVAL; if( SDL_EnableKeyRepeat(delay,interval) >= 0 ) SDL_GetKeyRepeat(&delay,&interval); fim_perror(FIM_NULL); } #endif /* FIM_WITH_LIBSDL_VERSION */ if ( want_windowed_ ) { #if FIM_SDL_WANT_PERCENTAGE const bool pcnt = opts_.find('%') != opts_.npos ? true : false; #else const bool pcnt = false; #endif if ( ( want_width == 0 && want_height == 0 ) || pcnt ) get_resolution( ( pcnt ? '%' : 'a'), want_width, want_height); } if(resize(want_width,want_height)) { std::cerr << "problems initializing SDL (SDL_SetVideoMode)\n"; finalize(); goto err; } fim_perror(FIM_NULL); #if (FIM_WITH_LIBSDL_VERSION == 1) /* Enable Unicode translation ( for a more flexible input handling ) */ SDL_EnableUNICODE( 1 ); #endif /* FIM_WITH_LIBSDL_VERSION */ reset_wm_caption(); fim_perror(FIM_NULL); sym_keys[FIM_KBD_PAGEUP]=SDLK_PAGEUP; sym_keys[FIM_KBD_PAGEDOWN]=SDLK_PAGEDOWN; sym_keys[FIM_KBD_LEFT]=SDLK_LEFT; sym_keys[FIM_KBD_RIGHT]=SDLK_RIGHT; sym_keys[FIM_KBD_UP]=SDLK_UP; sym_keys[FIM_KBD_DOWN]=SDLK_DOWN; sym_keys[FIM_KBD_SPACE]=SDLK_SPACE; sym_keys[FIM_KBD_END]=SDLK_END; sym_keys[FIM_KBD_HOME]=SDLK_HOME; sym_keys[FIM_KBD_BACKSPACE]=SDLK_BACKSPACE; sym_keys[FIM_KBD_BACKSPACE_]=SDLK_BACKSPACE; sym_keys[FIM_KBD_TAB]=SDLK_TAB; sym_keys[FIM_KBD_ENTER]=SDLK_RETURN; sym_keys[FIM_KBD_PAUSE]=SDLK_PAUSE; sym_keys[FIM_KBD_INS]=SDLK_INSERT; sym_keys[FIM_KBD_DEL]=SDLK_DELETE; sym_keys[FIM_KBD_MENU]=SDLK_MENU; sym_keys[FIM_KBD_F1 ]=SDLK_F1; sym_keys[FIM_KBD_F2 ]=SDLK_F2; sym_keys[FIM_KBD_F3 ]=SDLK_F3; sym_keys[FIM_KBD_F4 ]=SDLK_F4; sym_keys[FIM_KBD_F5 ]=SDLK_F5; sym_keys[FIM_KBD_F6 ]=SDLK_F6; sym_keys[FIM_KBD_F7 ]=SDLK_F7; sym_keys[FIM_KBD_F8 ]=SDLK_F8; sym_keys[FIM_KBD_F9 ]=SDLK_F9; sym_keys[FIM_KBD_F10]=SDLK_F10; sym_keys[FIM_KBD_F11]=SDLK_F11; sym_keys[FIM_KBD_F12]=SDLK_F12; fim_perror(FIM_NULL); cc.key_syms_update(); post_wmresize(); return FIM_ERR_NO_ERROR; sdlerr: if( const fim_char_t * const errstr = SDL_GetError() ) std::cerr << "SDL error string: \"" << errstr << "\"\n"; err: return FIM_ERR_GENERIC; } void SDLDevice::finalize(void) { if ( ! finalized_ ) { #if (FIM_WITH_LIBSDL_VERSION == 2) SDL_FreeSurface(screen_); SDL_DestroyTexture(texture_); #endif /* FIM_WITH_LIBSDL_VERSION */ SDL_Quit(); } finalized_=true; } fim_coo_t SDLDevice::get_chars_per_column(void)const { return height() / f_->sheight(); } fim_coo_t SDLDevice::get_chars_per_line(void)const { return width() / f_->swidth(); } fim_coo_t SDLDevice::width(void)const { return current_w_; } fim_coo_t SDLDevice::height(void)const { return current_h_; } inline void SDLDevice::setpixel(SDL_Surface *screen, fim_coo_t x, fim_coo_t y, Uint8 r, Uint8 g, Uint8 b) FIM_NOEXCEPT { /* * this function is taken straight from the sdl documentation: there are smarter ways to do this. * */ switch (bpp_) { case 8: { Uint8 *pixmem8; Uint8 colour; colour = SDL_MapRGB( screen->format, b, g, r ); pixmem8 = (Uint8*)((fim_byte_t*)( screen->pixels) + (y + x)*Bpp_); *pixmem8 = colour; } break; case 15: case 16: { Uint16 *pixmem16; Uint16 colour; colour = SDL_MapRGB( screen->format, b, g, r ); pixmem16 = (Uint16*)((fim_byte_t*)( screen->pixels) + (y + x)*Bpp_); *pixmem16 = colour; } break; case 24: { Uint32 *pixmem32; Uint32 colour; colour = SDL_MapRGB( screen->format, b, g, r ); pixmem32 = (Uint32*)((fim_byte_t*)( screen->pixels) + (y + x)*Bpp_); *pixmem32 = colour; } break; case 32: { Uint32 *pixmem32; Uint32 colour; colour = SDL_MapRGBA( screen->format, b, g, r, 255 ); pixmem32 = (Uint32*)((fim_byte_t*)( screen->pixels) + (y + x)*Bpp_); *pixmem32 = colour; } break; default: { /* 1,2,4 modes unsupported for NOW */ } } } #if FIM_WANT_MOUSE_PAN static void get_input_inner_mouse_move(fim_key_t * c, SDL_Event & event, fim_sys_int *keypressp, bool want_poll) { FIM_SDL_INPUT_DEBUG(c,"SDL_MOUSEMOTION"); { //std::cout << current_w_ << " " << event.motion.y << "\n"; //std::cout << event.motion.x << " " << event.motion.y << "\n"; //std::cout << event.motion.xrel << " " << event.motion.yrel << "\n"; Viewport* cv = cc.current_viewport(); static bool discardedfirst = false; if(cv) if(discardedfirst) if(const Image* ci = cv->c_getImage()) if(ci->check_valid()) if( event.motion.x > 0 && event.motion.y ) { // 1/(2*bf) of each screen side will be insensitive to mouse movement. fim_off_t bf = 5; fim_off_t vx = cv->viewport_width(); fim_off_t vy = cv->viewport_height(); fim_off_t bx = vx / bf; fim_off_t by = vy / bf; fim_coo_t riw = ci->width(); fim_coo_t rih = ci->height(); #if FIM_WANT_POSITION_DISPLAYED gx = (riwpan_to(FIM_DELIMIT_TO_100(px),FIM_DELIMIT_TO_100(py)); } else { // percentage scroll. // downside: if image very wide/tall/big, will // steps might be very large. fim_off_t px = FIM_DELIMIT_TO_100(FIM_INT_DET_PCNT(event.motion.x-bx/2,vx-bx)); fim_off_t py = FIM_DELIMIT_TO_100(FIM_INT_DET_PCNT(event.motion.y-by/2,vy-by)); //std::cout << "pct:"<< px << " " << py << "\n"; cv->pan_to(px,py); } cv->display(); // draw only if necessary //cv->redisplay(); // draw always } discardedfirst=true; } } #endif /* FIM_WANT_MOUSE_PAN */ #if FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT static fim_sys_int get_input_inner_mouse_click(fim_key_t * c, SDL_Event*eventp, fim_sys_int *keypressp, bool want_poll) { //case SDL_MOUSEMOTION: //case SDL_MOUSEBUTTONUP: if(fim::string wmc = cc.getStringVariable(FIM_VID_WANT_MOUSE_CTRL)) if( wmc.size()>=9 && strncpy(key_char_grid,wmc.c_str(),9) ) { fim_coo_t x,y; const Uint8 ms = SDL_GetMouseState(&x,&y); #if FIM_WANT_MOUSE_CROP #if (FIM_WITH_LIBSDL_VERSION == 1) const SDLMod mod = SDL_GetModState(); #else /* FIM_WITH_LIBSDL_VERSION */ const SDL_Keymod mod = SDL_GetModState(); #endif /* FIM_WITH_LIBSDL_VERSION */ const bool shift_on = ( (mod & KMOD_LSHIFT) || (mod & KMOD_LSHIFT) ); if( cc.find_keycode_for_bound_cmd(FIM_FLT_CROP) ) if(shift_on) { using namespace fim; if ( g_last_click_x >= 0 && g_last_click_y >= 0 ) { x = x - lastdstrect.x + lastsrcrect.x; y = y - lastdstrect.y + lastsrcrect.y; const fim_coo_t x1 = FIM_MIN(x, g_last_click_x ); const fim_coo_t x2 = FIM_MAX(x, g_last_click_x ); const fim_coo_t y1 = FIM_MIN(y, g_last_click_y ); const fim_coo_t y2 = FIM_MAX(y, g_last_click_y ); if (x2>x1) if (y2>y1) { std::ostringstream oss; oss << x1 << " " << y1 << " " << x2 << " " << y2; cc.setVariable(FIM_VID_CROP_ONCE, oss.str()); *c=1+('k'-'a'); g_last_click_x = g_last_click_y = -1; return 1; } g_last_click_x = g_last_click_y = -1; } g_last_click_x = x - lastdstrect.x + lastsrcrect.x; g_last_click_y = y - lastdstrect.y + lastsrcrect.y; } #endif /* FIM_WANT_MOUSE_CROP */ #if FIM_WANT_SDL_CLICK_MOUSE_SUPPORT Viewport* cv = cc.current_viewport(); fim_coo_t xt = cv->viewport_width()/3; fim_coo_t yt = cv->viewport_height()/3; if(!cc.inConsole() && ms&SDL_BUTTON_LMASK) { if( x < xt ) { if( y < yt ) { *c=key_char_grid[0]; return 1; } else if( y < 2*yt ) { *c=key_char_grid[1]; return 1; } else { *c=key_char_grid[2]; return 1; } } else if( x < 2*xt ) { if( y < yt ) { *c=key_char_grid[3]; return 1; } else if( y < 2*yt ) { *c=key_char_grid[4]; return 1; } else { *c=key_char_grid[5]; return 1; } } else { if( y < yt ) { *c=key_char_grid[6]; return 1; } else if( y < 2*yt ) { *c=key_char_grid[7]; return 1; } else { *c=key_char_grid[8]; return 1; } } } #endif /* FIM_WANT_SDL_CLICK_MOUSE_SUPPORT */ //cout << "mouse clicked at "<cv->viewport_width()/2)?'r':'l') <<"; state: "< c:" << *c << " (+ALT)"); return 1; } if(event.key.keysym.mod & KMOD_RCTRL || event.key.keysym.mod & KMOD_LCTRL ) { // CTRL-key if (event.key.keysym.sym < 0x100) // isalpha & co don't require this if (isalpha(event.key.keysym.sym)) // if (event.key.keysym.sym >= 'a') && (event.key.keysym.sym <= 'z') if (isalnum(event.key.keysym.sym)) if (isprint(event.key.keysym.sym)) { *c = FIM_SDL_KEYSYM_TO_RL_CTRL(event.key.keysym.sym); FIM_SDL_INPUT_DEBUG(c," SDL_KEYDOWN: mod: " << event.key.keysym.mod << " sym:" << event.key.keysym.sym << "=" << (char)(event.key.keysym.sym) << " scancode:" << event.key.keysym.scancode << "=" << (char)(event.key.keysym.scancode) << " translated -> c:" << *c << " (+CTRL)"); return 1; } return 0; } if (event.key.keysym.sym > 0x80 || !isprint(event.key.keysym.sym)) if ( ! (event.key.keysym.mod & KMOD_RSHIFT || event.key.keysym.mod & KMOD_LSHIFT ) ) // shift not accepted { // arrows and special keys if (want_poll) // hack: only set if in readline mode switch (event.key.keysym.sym) { //case(SDLK_UP): *c=FIM_KKE_UP; break; case(SDLK_UP): *c=0x111; break; case(SDLK_DOWN): *c=0x112; break; case(SDLK_RIGHT):*c=0x113; break; case(SDLK_LEFT): *c=0x114; break; default: *c = event.key.keysym.sym; } else *c = event.key.keysym.sym; FIM_SDL_INPUT_DEBUG(c," SDL_KEYDOWN: mod: " << event.key.keysym.mod << " sym:" << event.key.keysym.sym << " =c:" << *c << " poll:" << want_poll << " " << fim_key_escape(cc.find_key_syms(event.key.keysym.sym))); return 1; } if (event.key.keysym.sym > 0x80 || isprint(event.key.keysym.sym)) { // FIM_SDL_INPUT_DEBUG(c," SDL_KEYDOWN: sym:" << event.key.keysym.sym << " (ignored)"); return 0; } *c = event.key.keysym.sym; FIM_SDL_INPUT_DEBUG(c," SDL_KEYDOWN: sym:" << event.key.keysym.sym << " =c:" << *c); return *c ? 1 : 0; #if FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT case SDL_MOUSEBUTTONDOWN: return get_input_inner_mouse_click(c, eventp, keypressp, want_poll); break; #endif /* FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT */ #if FIM_WANT_MOUSE_PAN case SDL_MOUSEMOTION: get_input_inner_mouse_move(c, event, keypressp, want_poll); break; #endif /* FIM_WANT_MOUSE_PAN */ } } done: if (*c) FIM_SDL_INPUT_DEBUG(c,"no key"); #if FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT flip_draw_help_map_tmp(false); #endif return 0; } #endif /* FIM_WITH_LIBSDL_VERSION */ #if (FIM_WITH_LIBSDL_VERSION == 1) fim_sys_int get_input_inner(fim_key_t * c, SDL_Event*eventp, fim_sys_int *keypressp, bool want_poll) { bool ctrl_on=0; bool alt_on=0; //bool shift_on=0; fim_sys_int ret=0; SDL_Event event=*eventp; *c = FIM_SYM_NULL_KEY; if(want_poll) ret=SDL_PollEvent(&event); else ret=SDL_WaitEvent(&event); if(ret) { if(event.type==SDL_KEYUP) if(!SDL_PollEvent(&event)) goto done; switch (event.type) { #if FIM_SDL_WANT_RESIZE case SDL_VIDEORESIZE: cc.display_resize(event.resize.w,event.resize.h); break; #endif /* FIM_SDL_WANT_RESIZE */ case SDL_QUIT: #if FIM_SDL_ALLOW_QUIT *c=cc.find_keycode_for_bound_cmd(FIM_FLT_QUIT); return 1; //cc.quit(); #endif /* FIM_SDL_ALLOW_QUIT */ *keypressp = 1; // fixme break; case SDL_KEYDOWN: if(event.key.keysym.mod == KMOD_RCTRL || event.key.keysym.mod == KMOD_LCTRL ) ctrl_on=true; if(event.key.keysym.mod == KMOD_RALT || event.key.keysym.mod == KMOD_LALT ) alt_on=true; if(event.key.keysym.mod == KMOD_RSHIFT || event.key.keysym.mod == KMOD_LSHIFT ) ;//shift_on=true; if( event.key.keysym.unicode == 0x0 ) if(alt_on) { *c=(fim_byte_t)event.key.keysym.unicode; *c|=(1<<31); /* FIXME : a dirty trick */ return 1; } if( event.key.keysym.unicode < 0x80) { /* * SDL documentation 1.2.12 about unicode: * It is useful to note that unicode values < 0x80 translate directly * a characters ASCII value. * */ // if(event.key.keysym.mod == KMOD_RCTRL || event.key.keysym.mod == KMOD_LCTRL ) std::cout << "ctrl ! \n"; *c=(fim_byte_t)event.key.keysym.unicode; if(ctrl_on) { // if(*c-1+'a'=='c')std::exit(-1);//works #if 0 if(*c-1+'a'<='z') { //std::cout << "with control : " << *c+'a'-1 << "\n"; } else { /* other chars */ *c-='a'; *c+= 1 ; } #else #endif FIM_SDL_INPUT_DEBUG(c,"ctrl is on"); } if(*c) /* !iscntrl(c) */ { /* the usual chars */ FIM_SDL_INPUT_DEBUG(c,"keysym"); return 1; } else /* iscntrl(c) */ { FIM_SDL_INPUT_DEBUG(c,"iscntrl"); return 0; } /* * p.s.: note that we get 0 in some cases (e.g.: KMOD_RSHIFT, ...). * */ } else { FIM_SDL_INPUT_DEBUG(c,"wchar"); cout << "sorry, no support for wide chars in fim\n"; /* no support for wide chars in fim */ return 0; } FIM_SDL_INPUT_DEBUG(c,"unknown"); return 0; break; #if FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT case SDL_MOUSEBUTTONDOWN: return get_input_inner_mouse_click(c, eventp, keypressp, want_poll); break; #endif /* FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT */ case SDL_KEYUP: return 0; break; case SDL_MOUSEMOTION: #if FIM_WANT_MOUSE_PAN get_input_inner_mouse_move(c, event, keypressp, want_poll); #endif /* FIM_WANT_MOUSE_PAN */ break; default: FIM_SDL_INPUT_DEBUG(c,"default-unknown"); } return 0; } done: if (*c) FIM_SDL_INPUT_DEBUG(c,"no key"); #if FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT flip_draw_help_map_tmp(false); #endif return 0; } #endif /* FIM_WITH_LIBSDL_VERSION */ fim_sys_int SDLDevice::get_input(fim_key_t * c, bool want_poll) { int keypress_ = 0; fim_sys_int iv = get_input_inner(c,&event_,&keypress_,want_poll); return iv; } fim_err_t SDLDevice::fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t color) FIM_NOEXCEPT { fim_coo_t y; /* * This could be optimized * */ for(y=y1;y<=y2;++y) { fim_memset(((fim_byte_t*)(screen_->pixels)) + y*screen_->pitch + x1*Bpp_,color, (x2-x1+1)* Bpp_); } return FIM_ERR_NO_ERROR; } fim_err_t SDLDevice::fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t icolor, fim_color_t ocolor) FIM_NOEXCEPT { /* * This could be optimized. * e.g. four lines around inner box would be better. * */ fim_err_t rv = FIM_ERR_NO_ERROR; rv = fill_rect(x1, x2, y1, y2, icolor); if(x2-x1<3 || y2-y1<3) rv = fill_rect(x1+1, x2-1, y1+1, y2-1, ocolor); return rv; } fim_err_t SDLDevice::clear_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2) FIM_NOEXCEPT { fim_coo_t y; /* * This could be optimized * */ for(y=y1;y<=y2;++y) { fim_bzero(((fim_byte_t*)(screen_->pixels)) + y*screen_->pitch + x1*Bpp_, (x2-x1+1)* Bpp_); } return FIM_ERR_NO_ERROR; } void SDLDevice::fs_render_fb(fim_coo_t x_, fim_coo_t y, FSXCharInfo *charInfo, fim_byte_t *data) FIM_NOEXCEPT { /* * These preprocessor macros should serve *only* for font handling purposes. * */ #define BIT_ORDER BitmapFormatBitOrderMSB #ifdef BYTE_ORDER #undef BYTE_ORDER #endif #define BYTE_ORDER BitmapFormatByteOrderMSB #define SCANLINE_UNIT BitmapFormatScanlineUnit8 #define SCANLINE_PAD BitmapFormatScanlinePad8 #define EXTENTS BitmapFormatImageRectMin #define SCANLINE_PAD_BYTES 1 #define GLWIDTHBYTESPADDED(bits, nBytes) \ ((nBytes) == 1 ? (((bits) + 7) >> 3) /* pad to 1 byte */\ :(nBytes) == 2 ? ((((bits) + 15) >> 3) & ~1) /* pad to 2 bytes */\ :(nBytes) == 4 ? ((((bits) + 31) >> 3) & ~3) /* pad to 4 bytes */\ :(nBytes) == 8 ? ((((bits) + 63) >> 3) & ~7) /* pad to 8 bytes */\ : 0) fim_coo_t row,bit,x; FIM_CONSTEXPR Uint8 rc = 0xff, gc = 0xff, bc = 0xff; // const Uint8 rc = 0x00, gc = 0x00, bc = 0xff; const fim_sys_int bpr = GLWIDTHBYTESPADDED((charInfo->right - charInfo->left), SCANLINE_PAD_BYTES); const Uint16 pitch = screen_->pitch; const Uint16 incr = pitch / Bpp_; for (row = 0; row < (charInfo->ascent + charInfo->descent); row++) { for (x = 0, bit = 0; bit < (charInfo->right - charInfo->left); bit++, x++) { if (data[bit>>3] & fs_masktab[bit&7]) { // WARNING ! #if FIM_FONT_MAGNIFY_FACTOR == 0 const fim_int fim_fmf = fim::fim_fmf_; #endif /* FIM_FONT_MAGNIFY_FACTOR */ #if FIM_FONT_MAGNIFY_FACTOR < 0 fim_int fim_fmf = fim::fim_fmf_; #endif /* FIM_FONT_MAGNIFY_FACTOR */ #if FIM_FONT_MAGNIFY_FACTOR == 1 setpixel(screen_,x_+x,(y+row)*incr,rc,gc,bc); #else /* FIM_FONT_MAGNIFY_FACTOR */ for(fim_coo_t mi = 0; mi < fim_fmf; ++mi) for(fim_coo_t mj = 0; mj < fim_fmf; ++mj) setpixel(screen_,x_+fim_fmf*x+mj,(y+fim_fmf*row+mi)*incr,rc,gc,bc); #endif /* FIM_FONT_MAGNIFY_FACTOR */ } } data += bpr; } #undef BIT_ORDER #undef BYTE_ORDER #undef SCANLINE_UNIT #undef SCANLINE_PAD #undef EXTENTS #undef SCANLINE_PAD_BYTES #undef GLWIDTHBYTESPADDED } fim_err_t SDLDevice::fs_puts(struct fs_font *f_, fim_coo_t x, fim_coo_t y, const fim_char_t *str) FIM_NOEXCEPT { fim_sys_int i,c/*,j,w*/; for (i = 0; str[i] != '\0'; i++) { c = (fim_byte_t)str[i]; if (FIM_NULL == f_->eindex[c]) continue; /* clear with bg color */ // w = (f_->eindex[c]->width+1)*Bpp_; #if 0 #ifdef FIM_IS_SLOWER_THAN_FBI for (j = 0; j < f_->sheight(); j++) { ///// memset_combine(start,0x20,w); fim_bzero(start,w); start += fb_fix.line_length; } #else //sometimes we can gather multiple calls.. if(fb_fix.line_length==w) { //contiguous case fim_bzero(start,w*f_->sheight()); start += fb_fix.line_length*f_->sheight(); } else for (j = 0; j < f_->sheight(); j++) { fim_bzero(start,w); start += fb_fix.line_length; } #endif #endif /* draw character */ //fs_render_fb(fb_fix.line_length,f_->eindex[c],f_->gindex[c]); fs_render_fb(x,y,f_->eindex[c],f_->gindex[c]); x += f_->eindex[c]->swidth(); /* FIXME : SLOW ! */ if (((fim_coo_t)x) > width() - f_->swidth()) goto err; } // FIXME return FIM_ERR_NO_ERROR; err: return FIM_ERR_GENERIC; } fim_err_t SDLDevice::status_line(const fim_char_t *msg) { fim_err_t errval = FIM_ERR_NO_ERROR; fim_coo_t y,ys=3;// FIXME if(SDL_MUSTLOCK(screen_) && SDL_LockSurface(screen_) < 0) { errval = FIM_ERR_GENERIC; goto done; } if(get_chars_per_column()<1) goto done; y = height() - f_->sheight() - ys; if(y<0 ) goto done; clear_rect(0, width()-1, y+1,y+f_->sheight()+ys-1); fs_puts(f_, 0, y+ys, msg); fill_rect(0,width()-1, y, y, FIM_CNS_WHITE); #if (FIM_WITH_LIBSDL_VERSION == 1) if(SDL_MUSTLOCK(screen_)) SDL_UnlockSurface(screen_); SDL_Flip(screen_); #else /* FIM_WITH_LIBSDL_VERSION */ sdl2_redraw(); #endif /* FIM_WITH_LIBSDL_VERSION */ done: return errval; } #if (FIM_WITH_LIBSDL_VERSION == 2) void SDLDevice::sdl2_redraw(void)const { SDL_UpdateTexture(texture_, NULL, screen_->pixels, screen_->pitch); SDL_RenderClear(re_); SDL_RenderCopy(re_, texture_, NULL, NULL); SDL_RenderPresent(re_); } #endif /* FIM_WITH_LIBSDL_VERSION */ fim_key_t SDLDevice::catchInteractiveCommand(fim_ts_t seconds)const { /* * Whether there is some input in the input queue. * Note that in this way the event_ will be lost. * */ fim_key_t c=0; SDL_Event levent; fim_sys_int lkeypress=0; fim_tms_t sms=10,ms=seconds*1000;// sms: sleep ms FIM_SDL_INPUT_DEBUG(&c,""); #if 0 for(;seconds>0;--seconds) sleep(1); if(!get_input_inner(&c,&levent,&lkeypress)) { //std::cout << "input:" << c << "\n"; return c; } else return -1; #else do { if(ms>0) usleep((useconds_t)(sms*1000)),ms-=sms; // we read input twice: it seems we have a number of "spurious" inputs. if(1==get_input_inner(&c,&levent,&lkeypress,true)) goto done; } while(ms>0); return -1; done: usleep((useconds_t)(sms*1000)),ms-=sms; return c; #endif } void SDLDevice::flush(void) { } void SDLDevice::lock(void) { #if (FIM_WITH_LIBSDL_VERSION == 1) if(SDL_MUSTLOCK(screen_)) { if(SDL_LockSurface(screen_) < 0) return; } #else /* FIM_WITH_LIBSDL_VERSION */ // nothing #endif /* FIM_WITH_LIBSDL_VERSION */ } void SDLDevice::unlock(void) { #if (FIM_WITH_LIBSDL_VERSION == 1) if(SDL_MUSTLOCK(screen_)) SDL_UnlockSurface(screen_); SDL_Flip(screen_); #else /* FIM_WITH_LIBSDL_VERSION */ sdl2_redraw(); #endif /* FIM_WITH_LIBSDL_VERSIO */ } void SDLDevice::get_modes_list(void) { #if (FIM_WITH_LIBSDL_VERSION == 1) if (!modes_) if ( bvi_.vfmt ) modes_ = SDL_ListModes(bvi_.vfmt, SDL_HWSURFACE|SDL_FULLSCREEN); #else /* FIM_WITH_LIBSDL_VERSION */ numDisplayModes_ = SDL_GetNumDisplayModes(0); #endif /* FIM_WITH_LIBSDL_VERSION */ } bool SDLDevice::allowed_resolution(fim_coo_t w, fim_coo_t h) const { if(w==0 || h==0) goto ok; if(wswidth() || hsheight()) return false; ok: return true; } fim_err_t SDLDevice::resize(fim_coo_t w, fim_coo_t h) { SDL_Surface *nscreen_=FIM_NULL; fim_sdl_int want_flags=screen_?screen_->flags:FIM_SDL_FLAGS; #if FIM_WANT_HARDCODED_ICON unsigned char icondata[] = #include "default_icon_byte_array.h" SDL_Surface *icon = FIM_NULL; #endif /* FIM_WANT_HARDCODED_ICON */ if(want_resize_) want_flags|=SDL_RESIZABLE; else want_flags&=~SDL_RESIZABLE; if(want_windowed_) want_flags&=~SDL_FULLSCREEN; else want_flags|=SDL_FULLSCREEN; if(!allowed_resolution(w,h)) return FIM_ERR_GENERIC; SDL_ShowCursor(want_mouse_display_?1:0); if(w==0 && h==0) { int nr = 1, dr = 2; if( want_flags & SDL_FULLSCREEN ) nr = 1, dr = 1; #if (FIM_WITH_LIBSDL_VERSION == 1) w = bvi_.current_w; h = bvi_.current_h; #else /* FIM_WITH_LIBSDL_VERSION */ SDL_GetWindowSize(wi_, &w, &h); #endif /* FIM_WITH_LIBSDL_VERSION */ w = FIM_FRAC(w,nr,dr); h = FIM_FRAC(h,nr,dr); } #if (FIM_WITH_LIBSDL_VERSION == 1) w = FIM_MIN(w,bvi_.current_w); h = FIM_MIN(h,bvi_.current_h); //std::cout << "using " << bvi_.current_w << " "<< bvi_.current_h << " !\n"; #else /* FIM_WITH_LIBSDL_VERSION */ { SDL_DisplayMode displayMode; SDL_GetDesktopDisplayMode(0,&displayMode); const int w_=displayMode.w; const int h_=displayMode.h; w = FIM_MIN(w,w_); h = FIM_MIN(h,h_); } #endif /* FIM_WITH_LIBSDL_VERSION */ #if FIM_WANT_HARDCODED_ICON icon = SDL_LoadBMP_RW(SDL_RWFromMem(icondata, sizeof(icondata)), 1); #if (FIM_WITH_LIBSDL_VERSION == 1) SDL_WM_SetIcon(icon, FIM_NULL); #else /* FIM_WITH_LIBSDL_VERSION */ SDL_SetWindowIcon(wi_, icon); #endif /* FIM_WITH_LIBSDL_VERSION */ SDL_FreeSurface(icon); #endif /* FIM_WANT_HARDCODED_ICON */ //std::cout << "resizing to " << w << " "<< h << "\n"; #if (FIM_WITH_LIBSDL_VERSION == 1) if (FIM_NULL==(nscreen_ = SDL_SetVideoMode(w, h, bpp_, want_flags))) { ///std::cout << "resizing to " << w << " "<< h << " FAILED!\n"; return FIM_ERR_GENERIC; } #else /* FIM_WITH_LIBSDL_VERSION */ if ( screen_) { SDL_FreeSurface(screen_); SDL_DestroyTexture(texture_); screen_=FIM_NULL; } if(wi_) { // if(!want_windowed_) w = h = 0; SDL_SetWindowFullscreen(wi_,want_flags); if((want_flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) { sdl_window_update(); w=current_w_; h=current_h_; } SDL_SetWindowSize(wi_,w,h); sdl_window_update(); } if (!screen_) { if (FIM_NULL==(nscreen_ = SDL_CreateRGBSurface(0, w/*?w:10*/, h/*?h:10*/, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000))) { return FIM_ERR_GENERIC; } else { current_w_ = w, current_h_ = h; texture_ = SDL_CreateTexture(re_, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, w, h); } } #endif /* FIM_WITH_LIBSDL_VERSION */ screen_=nscreen_; if(want_flags&SDL_FULLSCREEN) reset_wm_caption(); if(!sdl_window_update()) { std::cerr << "problems initializing SDL (SDL_GetVideoInfo)\n"; return FIM_ERR_GENERIC; } post_wmresize(); return FIM_ERR_NO_ERROR; } fim_err_t SDLDevice::reinit(const fim_char_t *rs) { #if FIM_SDL_WANT_RESIZE if ( parse_optstring(rs) == FIM_ERR_NO_ERROR ) { if ( cc.display_resize(current_w_,current_h_) == FIM_ERR_NO_ERROR ) { opts_ = rs; return FIM_ERR_NO_ERROR; } } #else cout << "reinit not allowed\n"; #endif return FIM_ERR_GENERIC; } fim_err_t SDLDevice::set_wm_caption(const fim_char_t *msg) { fim_err_t rc=FIM_ERR_NO_ERROR; #if FIM_WANT_CAPTION_CONTROL if( msg && want_windowed_ ) #if (FIM_WITH_LIBSDL_VERSION == 1) SDL_WM_SetCaption(msg,FIM_SDL_ICONPATH); #else /* FIM_WITH_LIBSDL_VERSION */ SDL_SetWindowTitle(wi_,msg); #endif /* FIM_WITH_LIBSDL_VERSION */ else rc=FIM_ERR_UNSUPPORTED; #else rc=FIM_ERR_UNSUPPORTED; #endif return rc; } fim_err_t SDLDevice::reset_wm_caption(void)const { #if (FIM_WITH_LIBSDL_VERSION == 1) SDL_WM_SetCaption(FIM_CNS_FIM_APPTITLE,FIM_SDL_ICONPATH); #else /* FIM_WITH_LIBSDL_VERSION */ SDL_SetWindowTitle(wi_,FIM_CNS_FIM_APPTITLE); #endif /* FIM_WITH_LIBSDL_VERSION */ return FIM_ERR_NO_ERROR; } fim_coo_t SDLDevice::status_line_height(void)const { return f_ ? border_height_ + f_->sheight() : 0; } fim_err_t SDLDevice::post_wmresize(void) { cc.setVariable(FIM_VID_SCREEN_WIDTH, current_w_); cc.setVariable(FIM_VID_SCREEN_HEIGHT,current_h_); #ifndef FIM_WANT_NO_OUTPUT_CONSOLE // textual console reformatting //mc_.setRows ( get_chars_per_column()/(2*f_->sheight()) ); mc_.setGlobalVariable(FIM_VID_CONSOLE_ROWS,(height()/(2*f_->sheight()))); mc_.reformat( width() / f_->swidth() ); #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ return FIM_ERR_NO_ERROR; } fim_err_t SDLDevice::get_resolution(const char spec, fim_coo_t & w, fim_coo_t & h) const { int i; #if (FIM_WITH_LIBSDL_VERSION == 1) if ( !modes_ ) return FIM_ERR_GENERIC; if( modes_ == (SDL_Rect **) -1 ) return FIM_ERR_GENERIC; for(i=0;modes_[i];++i) #ifdef FIM_SDL_DEBUG printf(" %d x %d\n", modes_[i]->w, modes_[i]->h); #else ; #endif const int mc = i; #else /* FIM_WITH_LIBSDL_VERSION */ if( numDisplayModes_ < 1 ) return FIM_ERR_GENERIC; const int mc = numDisplayModes_; i = mc - 1; #endif /* FIM_WITH_LIBSDL_VERSION */ if (mc) switch (spec) { case 'L': i = 0; break; case 'l': i = std::min ( 1, mc - 1 ); break; case 's': i = std::max ( 0, mc - 2 ); break; case 'S': i = mc - 1; break; #if (FIM_WITH_LIBSDL_VERSION == 1) default: case 'a': i = -1; w = bvi_.current_w; h = bvi_.current_h; h-= bvi_.current_h / 3; w-= bvi_.current_w / 3; break; #if FIM_SDL_WANT_PERCENTAGE case '%': h = (bvi_.current_h * h) / 100; w = (bvi_.current_w * w) / 100; i = -1; break; #endif /* FIM_SDL_WANT_PERCENTAGE */ case 'A': w = bvi_.current_w; h = bvi_.current_h; h-= bvi_.current_h / 10; i = -1; break; #else /* FIM_WITH_LIBSDL_VERSION */ default: case 'a': i = -1; w = current_w_; h = current_h_; h-= current_h_ / 3; w-= current_w_ / 3; break; #if FIM_SDL_WANT_PERCENTAGE case '%': { SDL_DisplayMode displayMode; SDL_GetDesktopDisplayMode(0,&displayMode); h = (displayMode.h * h) / 100; w = (displayMode.w * w) / 100; i = -1; } break; #endif /* FIM_SDL_WANT_PERCENTAGE */ case 'A': w = current_w_; h = current_h_; h-= current_h_ / 10; i = -1; break; #endif /* FIM_WITH_LIBSDL_VERSION */ } #if (FIM_WITH_LIBSDL_VERSION == 1) if ( i >= 0 ) w = modes_[i]->w, h = modes_[i]->h; #else /* FIM_WITH_LIBSDL_VERSION */ if ( i >= 0 ) { SDL_DisplayMode displayMode; const int displayIndex_=i; SDL_GetDisplayMode(displayIndex_,numDisplayModes_,&displayMode); w = displayMode.w; h = displayMode.h; } #endif /* FIM_WITH_LIBSDL_VERSION */ return FIM_ERR_NO_ERROR; } #endif /* FIM_WITH_LIBSDL */ fim-0.6-rc2/src/default_font_byte_array.h0000644000175000017500000006667414503371624015422 00000000000000{ 0x36,0x04,0x02,0x10,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55, 0xaa,0x55,0xaa,0x55,0x00,0x00,0x00,0x7e,0x81,0x99,0xa5,0xa1,0xa5,0x99,0x81,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x81,0xb9,0xa5,0xb9,0xa9,0xa5,0x81,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0xfb,0x55,0x55,0x51,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x24,0x20,0x20,0x78,0x20,0x20,0x20,0x22,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x54,0x38,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x40,0xfe,0x40,0x20,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x04,0xfe,0x04,0x08,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x54,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22, 0x88,0x22,0x88,0x22,0x00,0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x00, 0x00,0x00,0x00,0x00,0x00,0x18,0x24,0x24,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x00,0x7c, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x42,0x42,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x20,0x10,0x08,0x04,0x00,0x3e, 0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7c,0x10,0x10,0x00,0x7c, 0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7c,0x92,0x90,0x90,0x90,0x92,0x7c, 0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x38,0x44,0x44,0x44,0x38,0x44,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x44,0x28,0x10,0x7c,0x10,0x7c,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x40,0x30,0x48,0x44,0x44,0x24,0x18,0x04,0x44, 0x38,0x00,0x00,0x00,0x24,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x38,0x04,0x3c,0x44,0x3c,0x00,0x7c,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x24,0x48,0x90,0x48,0x24,0x12, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x02,0x02,0x02,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x24,0x24,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x24,0x24,0x7e,0x24,0x24,0x7e,0x24,0x24,0x24, 0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7c,0x92,0x90,0x90,0x7c,0x12,0x12,0x92,0x7c, 0x10,0x10,0x00,0x00,0x00,0x00,0x64,0x94,0x68,0x08,0x10,0x10,0x20,0x2c,0x52,0x4c, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x24,0x24,0x18,0x30,0x4a,0x44,0x44,0x44,0x3a, 0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x20,0x20,0x20,0x20,0x20,0x20,0x10,0x08, 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x20, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x18,0x7e,0x18,0x24,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7c,0x10,0x10,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10, 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x46,0x4a,0x52,0x62,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x18,0x28,0x08,0x08,0x08,0x08,0x08,0x08,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x02,0x04,0x08,0x10,0x20,0x40,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x02,0x1c,0x02,0x02,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x06,0x0a,0x12,0x22,0x42,0x7e,0x02,0x02,0x02, 0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x40,0x40,0x40,0x7c,0x02,0x02,0x02,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x20,0x40,0x40,0x7c,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x02,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x42,0x3c,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x3e,0x02,0x02,0x04,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x10,0x10, 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x42,0x04,0x08,0x08,0x00,0x08,0x08, 0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x82,0x9e,0xa2,0xa2,0xa2,0xa6,0x9a,0x80,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0x42,0x7c, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x40,0x40,0x40,0x40,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x44,0x42,0x42,0x42,0x42,0x42,0x42,0x44,0x78, 0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x40, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x40,0x40,0x4e,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x04,0x04,0x04,0x04,0x04,0x04,0x44,0x44,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x44,0x48,0x50,0x60,0x60,0x50,0x48,0x44,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xc6,0xaa,0x92,0x82,0x82,0x82,0x82,0x82,0x82, 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x62,0x52,0x4a,0x46,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x42,0x42,0x42,0x42,0x7c,0x40,0x40,0x40,0x40, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x4a,0x3c, 0x02,0x00,0x00,0x00,0x00,0x00,0x7c,0x42,0x42,0x42,0x42,0x7c,0x50,0x48,0x44,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x40,0x40,0x3c,0x02,0x02,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x24,0x24,0x24,0x18,0x18, 0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x82,0x82,0x82,0x82,0x92,0xaa,0xc6,0x82, 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x24,0x24,0x18,0x18,0x24,0x24,0x42,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x44,0x44,0x28,0x10,0x10,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x02,0x02,0x04,0x08,0x10,0x20,0x40,0x40,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04, 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x38, 0x00,0x00,0x00,0x00,0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x7e,0x00,0x00,0x10,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x02,0x3e,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7c,0x42,0x42,0x42,0x42,0x42,0x7c, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x40,0x40,0x40,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x3e,0x42,0x42,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x7e,0x40,0x40,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x10,0x10,0x7c,0x10,0x10,0x10,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x42,0x42,0x42,0x42,0x42,0x3e, 0x02,0x02,0x3c,0x00,0x00,0x00,0x40,0x40,0x40,0x7c,0x42,0x42,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x00,0x0c,0x04,0x04,0x04,0x04,0x04,0x04, 0x44,0x44,0x38,0x00,0x00,0x00,0x40,0x40,0x40,0x42,0x44,0x48,0x70,0x48,0x44,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x92,0x92,0x92,0x92,0x92,0x92, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x42,0x42,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x42,0x42,0x42,0x42,0x42,0x7c, 0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x42,0x42,0x42,0x42,0x42,0x3e, 0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x5e,0x60,0x40,0x40,0x40,0x40,0x40, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x40,0x40,0x3c,0x02,0x02,0x7c, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x7c,0x10,0x10,0x10,0x10,0x10,0x0e, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x24,0x24,0x18,0x18, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x92,0x92,0x92,0x92,0x7c, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x24,0x18,0x24,0x42,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3e, 0x02,0x02,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x04,0x08,0x10,0x20,0x40,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x0c, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x08,0x08,0x08,0x04,0x08,0x08,0x08,0x08,0x30, 0x00,0x00,0x00,0x00,0x00,0x62,0x92,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x18,0x24,0x08,0x10,0x3c,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x38,0x04,0x18,0x04,0x38,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x46,0x7a, 0x40,0x40,0x40,0x00,0x00,0x00,0x7e,0x92,0x92,0x92,0x92,0x72,0x12,0x12,0x12,0x12, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x10,0x10,0x20,0x00,0x00,0x10,0x30,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x38,0x00,0x7c,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x48,0x24,0x12,0x24,0x48,0x90, 0x00,0x00,0x00,0x00,0x00,0x20,0x60,0x20,0x22,0x24,0x08,0x10,0x22,0x46,0x8a,0x1e, 0x02,0x02,0x00,0x00,0x00,0x20,0x60,0x20,0x22,0x24,0x08,0x10,0x20,0x4c,0x92,0x04, 0x08,0x1e,0x00,0x00,0x00,0xe0,0x10,0x60,0x12,0xe4,0x08,0x10,0x22,0x46,0x8a,0x1e, 0x02,0x02,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x10,0x10,0x20,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x10,0x08,0x00,0x3c,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x3c,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x18,0x24,0x00,0x3c,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x32,0x4c,0x00,0x3c,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x24,0x24,0x00,0x3c,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x18,0x24,0x18,0x3c,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x90,0x90,0x90,0xfc,0x90,0x90,0x90,0x90,0x9e, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x40,0x40,0x40,0x40,0x42,0x42,0x3c, 0x10,0x10,0x20,0x00,0x10,0x08,0x00,0x7e,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7e, 0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x7e,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7e, 0x00,0x00,0x00,0x00,0x18,0x24,0x00,0x7e,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7e, 0x00,0x00,0x00,0x00,0x24,0x24,0x00,0x7e,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7e, 0x00,0x00,0x00,0x00,0x20,0x10,0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x18,0x24,0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x44,0x44,0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x44,0x42,0x42,0xf2,0x42,0x42,0x42,0x44,0x78, 0x00,0x00,0x00,0x00,0x32,0x4c,0x00,0x42,0x42,0x62,0x52,0x4a,0x46,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x10,0x08,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x18,0x24,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x32,0x4c,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x24,0x24,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x24,0x18,0x24,0x42,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x02,0x3a,0x44,0x46,0x4a,0x4a,0x52,0x52,0x62,0x22,0x5c, 0x40,0x00,0x00,0x00,0x10,0x08,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x08,0x10,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x18,0x24,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x24,0x24,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x08,0x10,0x82,0x82,0x44,0x44,0x28,0x10,0x10,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x7c,0x42,0x42,0x42,0x42,0x7c,0x40,0x40, 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x44,0x48,0x7c,0x42,0x42,0x42,0x62,0x5c, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x08,0x00,0x3c,0x02,0x3e,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x3c,0x02,0x3e,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x24,0x00,0x3c,0x02,0x3e,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x4c,0x00,0x3c,0x02,0x3e,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x24,0x00,0x3c,0x02,0x3e,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x24,0x18,0x3c,0x02,0x3e,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x12,0x72,0x9e,0x90,0x90,0x6c, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x40,0x40,0x40,0x42,0x3c, 0x10,0x10,0x20,0x00,0x00,0x00,0x10,0x08,0x00,0x3c,0x42,0x42,0x7e,0x40,0x40,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x3c,0x42,0x42,0x7e,0x40,0x40,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x24,0x00,0x3c,0x42,0x42,0x7e,0x40,0x40,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x24,0x00,0x3c,0x42,0x42,0x7e,0x40,0x40,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x48,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x48,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x10,0x28,0x3c,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x4c,0x00,0x7c,0x42,0x42,0x42,0x42,0x42,0x42, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x08,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x28,0x28,0x28,0x28,0x28,0x28,0xef,0x00,0xef,0x28,0x28,0x28, 0x28,0x28,0x28,0x28,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xff,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1f,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0xff,0x10,0xff,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1f,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xff,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x00,0x00,0x08,0x10,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x24,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x4c,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x24,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x7c,0x00,0x10,0x10,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x3c,0x46,0x4a,0x52,0x62,0x42,0xbc, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x08,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x24,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x24,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3e, 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3e, 0x02,0x02,0x3c,0x00,0x00,0x00,0x40,0x40,0x40,0x7c,0x42,0x42,0x42,0x42,0x42,0x7c, 0x40,0x40,0x40,0x00,0x00,0x00,0x24,0x24,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3e, 0x02,0x02,0x3c,0x00,0x24,0x18,0x00,0x3c,0x42,0x42,0x40,0x4e,0x42,0x42,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x18,0x00,0x3e,0x42,0x42,0x42,0x42,0x42,0x3e, 0x02,0x02,0x3c,0x00,0x10,0x10,0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x90,0x90,0x90,0x9c,0x90,0x90,0x90,0x90,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x92,0x92,0x9e,0x90,0x90,0x7c, 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x40,0x40,0x3c,0x02,0x02,0x42,0x42,0x3c, 0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x40,0x40,0x3c,0x02,0x02,0x7c, 0x10,0x10,0x20,0x00,0x24,0x18,0x00,0x3c,0x42,0x40,0x40,0x3c,0x02,0x02,0x42,0x3c, 0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x18,0x00,0x3e,0x40,0x40,0x3c,0x02,0x02,0x7c, 0x00,0x00,0x00,0x00,0x44,0x44,0x00,0x82,0x82,0x44,0x44,0x28,0x10,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x24,0x18,0x00,0x7e,0x02,0x04,0x08,0x10,0x20,0x40,0x40,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x18,0x00,0x7e,0x04,0x08,0x10,0x20,0x40,0x7e, 0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x12,0x10,0x10,0x7c,0x10,0x10,0x10,0x10,0x10, 0x10,0x90,0x60,0x00,0x18,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x32,0x4c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08, 0x10,0x00,0x00,0x00,0x00,0x12,0x24,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x12,0x12,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x24, 0x48,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7c,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7c,0x10,0x10,0x10,0x10,0x7c,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x92,0x92, 0x00,0x00,0x00,0x00,0x00,0x00,0x48,0xa8,0x50,0x10,0x20,0x20,0x40,0x54,0xaa,0x94, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x20,0x10,0x08,0x04, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x08,0x10,0x20, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x22,0x40,0xf8,0x40,0xf8,0x40,0x22,0x1c, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x7e,0x08,0x10,0x7e,0x40,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x4c,0x00,0x32,0x4c,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x96,0x96,0x96,0xd0,0xf0,0xf0,0xb0,0x96,0x90,0x96, 0x00,0x00,0x00,0x00,0x00,0x38,0x24,0x24,0x24,0x24,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x88,0x88,0x88,0xf4,0x84,0x8e,0x84,0x84,0x82, 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x10,0x10,0x1c,0x70,0x1c,0x70,0x10,0x10,0x10, 0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x00,0x24,0x24, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x20,0x40,0x40,0x7e,0x40,0x40,0x20,0x1e, 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x7c,0x8a,0x92,0x92,0xa2,0x7c,0x40,0x80, 0x00,0x00,0x00,0x00,0x92,0x25,0xff,0xff,0xa9,0x00,0xff,0xff,0xae,0x00,0xff,0xff, 0x22,0x21,0xff,0xff,0xa3,0x00,0xff,0xff,0x93,0x21,0xbc,0x25,0xff,0xff,0x90,0x21, 0xc0,0x25,0xff,0xff,0x92,0x21,0xb6,0x25,0xff,0xff,0x91,0x21,0xb2,0x25,0xff,0xff, 0x91,0x25,0xff,0xff,0xa0,0x25,0xae,0x25,0xff,0xff,0xb0,0x00,0xff,0xff,0x66,0x26, 0xfd,0xff,0xff,0xff,0x65,0x22,0xff,0xff,0xc0,0x03,0xff,0xff,0x64,0x22,0xff,0xff, 0x18,0x25,0x1b,0x25,0x1a,0x25,0x19,0x25,0xff,0xff,0xb1,0x00,0xff,0xff,0x24,0x25, 0x2b,0x25,0x2a,0x25,0x29,0x25,0x28,0x25,0x27,0x25,0x26,0x25,0x25,0x25,0xff,0xff, 0x10,0x25,0x13,0x25,0x12,0x25,0x11,0x25,0xff,0xff,0x02,0x25,0x03,0x25,0x7f,0x25, 0x7d,0x25,0x7b,0x25,0x77,0x25,0x79,0x25,0x75,0x25,0xff,0xff,0xa1,0x00,0xff,0xff, 0xa2,0x00,0xff,0xff,0xa4,0x00,0xff,0xff,0xa5,0x00,0xff,0xff,0xa6,0x00,0xff,0xff, 0xa7,0x00,0xff,0xff,0xa8,0x00,0xff,0xff,0xaa,0x00,0xff,0xff,0xab,0x00,0x6a,0x22, 0xff,0xff,0xac,0x00,0xff,0xff,0xaf,0x00,0xc9,0x02,0xff,0xff,0x20,0x00,0xa0,0x00, 0x00,0x20,0x01,0x20,0x02,0x20,0x03,0x20,0x04,0x20,0x05,0x20,0x06,0x20,0x07,0x20, 0x08,0x20,0x09,0x20,0x0a,0x20,0xff,0xff,0x21,0x00,0xff,0xff,0x22,0x00,0xff,0xff, 0x23,0x00,0xff,0xff,0x24,0x00,0xff,0xff,0x25,0x00,0x95,0x22,0xff,0xff,0x26,0x00, 0xff,0xff,0x27,0x00,0xff,0xff,0x28,0x00,0xff,0xff,0x29,0x00,0xff,0xff,0x2a,0x00, 0x9b,0x22,0xff,0xff,0x2b,0x00,0xff,0xff,0x2c,0x00,0xff,0xff,0x2d,0x00,0x12,0x20, 0x13,0x20,0x12,0x22,0xad,0x00,0x10,0x20,0x11,0x20,0x96,0x22,0xff,0xff,0x2e,0x00, 0x99,0x22,0xff,0xff,0x2f,0x00,0x98,0x22,0xff,0xff,0x30,0x00,0xea,0x24,0xff,0xff, 0x31,0x00,0x60,0x24,0xff,0xff,0x32,0x00,0x61,0x24,0xff,0xff,0x33,0x00,0x62,0x24, 0xff,0xff,0x34,0x00,0x63,0x24,0xff,0xff,0x35,0x00,0x64,0x24,0xff,0xff,0x36,0x00, 0x65,0x24,0xff,0xff,0x37,0x00,0x66,0x24,0xff,0xff,0x38,0x00,0x67,0x24,0xff,0xff, 0x39,0x00,0x68,0x24,0xff,0xff,0x3a,0x00,0xff,0xff,0x3b,0x00,0xff,0xff,0x3c,0x00, 0xff,0xff,0x3d,0x00,0x9c,0x22,0xff,0xff,0x3e,0x00,0xff,0xff,0x3f,0x00,0xff,0xff, 0x40,0x00,0xff,0xff,0x41,0x00,0x10,0x04,0x91,0x03,0xb6,0x24,0xff,0xff,0x42,0x00, 0x12,0x04,0x92,0x03,0xb7,0x24,0xff,0xff,0x43,0x00,0x21,0x04,0xb8,0x24,0xff,0xff, 0x44,0x00,0xb9,0x24,0xff,0xff,0x45,0x00,0x15,0x04,0x95,0x03,0xba,0x24,0xff,0xff, 0x46,0x00,0xbb,0x24,0xff,0xff,0x47,0x00,0xbc,0x24,0xff,0xff,0x48,0x00,0x1d,0x04, 0x97,0x03,0xbd,0x24,0xff,0xff,0x49,0x00,0x06,0x04,0x99,0x03,0xbe,0x24,0xff,0xff, 0x4a,0x00,0x08,0x04,0xbf,0x24,0xff,0xff,0x4b,0x00,0x1a,0x04,0x9a,0x03,0x2a,0x21, 0xc0,0x24,0xff,0xff,0x4c,0x00,0xc1,0x24,0xff,0xff,0x4d,0x00,0x1c,0x04,0x9c,0x03, 0xc2,0x24,0xff,0xff,0x4e,0x00,0x9d,0x03,0xc3,0x24,0xff,0xff,0x4f,0x00,0x1e,0x04, 0x9f,0x03,0xc4,0x24,0xff,0xff,0x50,0x00,0x20,0x04,0xa1,0x03,0xc5,0x24,0xff,0xff, 0x51,0x00,0xc6,0x24,0xff,0xff,0x52,0x00,0xc7,0x24,0xff,0xff,0x53,0x00,0x05,0x04, 0xc8,0x24,0xff,0xff,0x54,0x00,0x22,0x04,0xa4,0x03,0xc9,0x24,0xff,0xff,0x55,0x00, 0xca,0x24,0xff,0xff,0x56,0x00,0xcb,0x24,0xff,0xff,0x57,0x00,0xcc,0x24,0xff,0xff, 0x58,0x00,0x25,0x04,0xa7,0x03,0xcd,0x24,0xff,0xff,0x59,0x00,0xae,0x04,0xce,0x24, 0xff,0xff,0x5a,0x00,0x96,0x03,0xcf,0x24,0xff,0xff,0x5b,0x00,0xff,0xff,0x5c,0x00, 0xff,0xff,0x5d,0x00,0xff,0xff,0x5e,0x00,0xff,0xff,0x5f,0x00,0xff,0xff,0x60,0x00, 0xff,0xff,0x61,0x00,0x30,0x04,0xd0,0x24,0xff,0xff,0x62,0x00,0xd1,0x24,0xff,0xff, 0x63,0x00,0x41,0x04,0xd2,0x24,0xff,0xff,0x64,0x00,0xd3,0x24,0xff,0xff,0x65,0x00, 0x35,0x04,0xd4,0x24,0xff,0xff,0x66,0x00,0xd5,0x24,0xff,0xff,0x67,0x00,0xd6,0x24, 0xff,0xff,0x68,0x00,0xd7,0x24,0xff,0xff,0x69,0x00,0x56,0x04,0xd8,0x24,0xff,0xff, 0x6a,0x00,0x58,0x04,0xd9,0x24,0xff,0xff,0x6b,0x00,0xda,0x24,0xff,0xff,0x6c,0x00, 0xdb,0x24,0xff,0xff,0x6d,0x00,0xdc,0x24,0xff,0xff,0x6e,0x00,0xdd,0x24,0xff,0xff, 0x6f,0x00,0x3e,0x04,0xde,0x24,0xff,0xff,0x70,0x00,0x40,0x04,0xdf,0x24,0xff,0xff, 0x71,0x00,0xe0,0x24,0xff,0xff,0x72,0x00,0xe1,0x24,0xff,0xff,0x55,0x04,0x73,0x00, 0xe2,0x24,0xff,0xff,0x74,0x00,0xe3,0x24,0xff,0xff,0x75,0x00,0xe4,0x24,0xff,0xff, 0x76,0x00,0xe5,0x24,0xff,0xff,0x77,0x00,0xe6,0x24,0xff,0xff,0x78,0x00,0x45,0x04, 0xe7,0x24,0xff,0xff,0x79,0x00,0x43,0x04,0xe8,0x24,0xff,0xff,0x7a,0x00,0xe9,0x24, 0xff,0xff,0x7b,0x00,0xff,0xff,0x7c,0x00,0xff,0xff,0x7d,0x00,0xff,0xff,0x7e,0x00, 0xff,0xff,0xb2,0x00,0xff,0xff,0xb3,0x00,0xff,0xff,0xb4,0x00,0xff,0xff,0xb5,0x00, 0xbc,0x03,0xff,0xff,0xb6,0x00,0xff,0xff,0xb7,0x00,0xff,0xff,0xb8,0x00,0xff,0xff, 0xb9,0x00,0xff,0xff,0xba,0x00,0xff,0xff,0xbb,0x00,0x6b,0x22,0xff,0xff,0xbc,0x00, 0xff,0xff,0xbd,0x00,0xff,0xff,0xbe,0x00,0xff,0xff,0xbf,0x00,0xff,0xff,0xc0,0x00, 0xff,0xff,0xc1,0x00,0xff,0xff,0xc2,0x00,0xff,0xff,0xc3,0x00,0xff,0xff,0xc4,0x00, 0xff,0xff,0xc5,0x00,0x2b,0x21,0xff,0xff,0xc6,0x00,0xff,0xff,0xc7,0x00,0xff,0xff, 0xc8,0x00,0xff,0xff,0xc9,0x00,0xff,0xff,0xca,0x00,0xff,0xff,0xcb,0x00,0x01,0x04, 0xff,0xff,0xcc,0x00,0xff,0xff,0xcd,0x00,0xff,0xff,0xce,0x00,0xff,0xff,0xcf,0x00, 0x07,0x04,0xff,0xff,0xd0,0x00,0x10,0x01,0xff,0xff,0xd1,0x00,0xff,0xff,0xd2,0x00, 0xff,0xff,0xd3,0x00,0xff,0xff,0xd4,0x00,0xff,0xff,0xd5,0x00,0xff,0xff,0xd6,0x00, 0xff,0xff,0xd7,0x00,0xff,0xff,0xd8,0x00,0xff,0xff,0xd9,0x00,0xff,0xff,0xda,0x00, 0xff,0xff,0xdb,0x00,0xff,0xff,0xdc,0x00,0xff,0xff,0xdd,0x00,0xff,0xff,0xde,0x00, 0xff,0xff,0xdf,0x00,0xff,0xff,0xe0,0x00,0xff,0xff,0xe1,0x00,0xff,0xff,0xe2,0x00, 0xff,0xff,0xe3,0x00,0xff,0xff,0xe4,0x00,0xff,0xff,0xe5,0x00,0xff,0xff,0xe6,0x00, 0xff,0xff,0xe7,0x00,0xff,0xff,0xe8,0x00,0xff,0xff,0xe9,0x00,0xff,0xff,0xea,0x00, 0xff,0xff,0xeb,0x00,0x51,0x04,0xff,0xff,0xec,0x00,0xff,0xff,0xed,0x00,0xff,0xff, 0xee,0x00,0xff,0xff,0xef,0x00,0x57,0x04,0xff,0xff,0xf0,0x00,0xff,0xff,0xf1,0x00, 0xff,0xff,0xf2,0x00,0xff,0xff,0x00,0x25,0x01,0x25,0x7e,0x25,0x7c,0x25,0x7a,0x25, 0x76,0x25,0x78,0x25,0x74,0x25,0xff,0xff,0x6c,0x25,0xff,0xff,0x3c,0x25,0x4b,0x25, 0x4a,0x25,0x49,0x25,0x48,0x25,0x47,0x25,0x46,0x25,0x45,0x25,0x44,0x25,0x43,0x25, 0x42,0x25,0x41,0x25,0x40,0x25,0x3f,0x25,0x3e,0x25,0x3d,0x25,0xff,0xff,0x14,0x25, 0x17,0x25,0x16,0x25,0x15,0x25,0xff,0xff,0x6a,0x25,0xff,0xff,0x88,0x25,0xff,0xff, 0x2c,0x25,0x33,0x25,0x32,0x25,0x31,0x25,0x30,0x25,0x2f,0x25,0x2e,0x25,0x2d,0x25, 0xff,0xff,0x1c,0x25,0x23,0x25,0x22,0x25,0x21,0x25,0x20,0x25,0x1f,0x25,0x1e,0x25, 0x1d,0x25,0xff,0xff,0x34,0x25,0x3b,0x25,0x3a,0x25,0x39,0x25,0x38,0x25,0x37,0x25, 0x36,0x25,0x35,0x25,0xff,0xff,0x0c,0x25,0x0f,0x25,0x0e,0x25,0x0d,0x25,0xff,0xff, 0xf3,0x00,0xff,0xff,0xf4,0x00,0xff,0xff,0xf5,0x00,0xff,0xff,0xf6,0x00,0xff,0xff, 0xf7,0x00,0xff,0xff,0xf8,0x00,0xff,0xff,0xf9,0x00,0xff,0xff,0xfa,0x00,0xff,0xff, 0xfb,0x00,0xff,0xff,0xfc,0x00,0xff,0xff,0xfd,0x00,0xff,0xff,0xfe,0x00,0xff,0xff, 0xff,0x00,0xff,0xff,0x1e,0x01,0xff,0xff,0x1f,0x01,0xff,0xff,0x30,0x01,0xff,0xff, 0x31,0x01,0xff,0xff,0x52,0x01,0xff,0xff,0x53,0x01,0xff,0xff,0x5e,0x01,0xff,0xff, 0x5f,0x01,0xff,0xff,0x60,0x01,0xff,0xff,0x61,0x01,0xff,0xff,0x78,0x01,0xff,0xff, 0x7d,0x01,0xff,0xff,0x7e,0x01,0xff,0xff,0x92,0x01,0xff,0xff,0xc6,0x02,0xff,0xff, 0xdc,0x02,0xff,0xff,0x14,0x20,0x15,0x20,0xff,0xff,0x18,0x20,0xff,0xff,0x19,0x20, 0xff,0xff,0x1a,0x20,0xff,0xff,0x1c,0x20,0xff,0xff,0x1d,0x20,0xff,0xff,0x1e,0x20, 0xff,0xff,0x20,0x20,0xff,0xff,0x21,0x20,0xff,0xff,0x22,0x20,0xcf,0x25,0xff,0xff, 0x26,0x20,0xff,0xff,0x30,0x20,0xff,0xff,0x39,0x20,0xff,0xff,0x3a,0x20,0xff,0xff, 0xac,0x20,0xff,0xff,0x60,0x22,0xff,0xff,0x48,0x22,0xff,0xff,0x16,0x21,0xff,0xff, 0x7f,0x20,0xff,0xff,0xa7,0x20,0xff,0xff,0xae,0x20,0xff,0xff,0x3c,0x20,0xff,0xff, 0x61,0x22,0xff,0xff,0x08,0x22,0xff,0xff,0x05,0x22,0xff,0xff, }; fim-0.6-rc2/src/fim_string.h0000644000175000017500000000510714454347340012653 00000000000000/* $LastChangedDate: 2022-11-14 09:47:33 +0100 (Mon, 14 Nov 2022) $ */ #ifndef FIM_STRING_H #define FIM_STRING_H /* string.h : Fim's string type (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * the rest of the program waits still for a proper adaptation of dynamic strings. */ #define FIM_CHARS_FOR_INT 32 /* should fit a pointer address printout */ #include #include "fim_types.h" #define FIM_REG_EXTENDED 0x1 #define FIM_REG_ICASE 0x2 namespace fim { class string /*FIM_FINAL*/ :public std::string { public: string(); ~string(){} string(const std::string&rhs):std::string(rhs){} string(const fim_char_t*s):std::string(s?s:""){} string(fim_char_t c); #if FIM_WANT_LONG_INT string(int i); #endif /* FIM_WANT_LONG_INT */ string(fim_int i); string(float i); string(int * i); string(size_t i); operator fim_int (void)const; #if FIM_WANT_LONG_INT operator int (void)const; #endif /* FIM_WANT_LONG_INT */ operator float(void)const; operator const char*(void)const{return c_str();} operator bool (void)const{return c_str()!=NULL;} string operator+(const char * s)const; string operator+(const string rhs)const; fim_char_t operator[](int i)const {return this->std::string::operator[](i);} // to avoid ambiguity with operator[] of std::string and char* /* copy constructor */ string(const string& rhs); bool re_match(const fim_char_t*r)const; void substitute(const fim_char_t*r, const fim_char_t* s, int flags=FIM_REG_EXTENDED | FIM_REG_ICASE); #if FIM_WANT_OBSOLETE fim::string line(int ln)const; size_t lines(void)const; #endif /* FIM_WANT_OBSOLETE */ // int find_re(const fim_char_t*r,int *mbuf=FIM_NULL)const; }; /* fim::string */ class Browser; class CommandConsole; std::ostream& operator<<(std::ostream& os,const string& s); std::ostream& operator<<(std::ostream& os, const Browser& b); } /* namespace fim */ #endif /* FIM_STRING_H */ fim-0.6-rc2/src/FbiStuffPng.cpp0000644000175000017500000002326614454347340013230 00000000000000/* $LastChangedDate: 2022-10-30 16:13:52 +0100 (Sun, 30 Oct 2022) $ */ /* FbiStuffPng.cpp : fbi functions for PNG files, modified for fim (c) 2008-2022 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #include #include #include #include #include //#include "loader.h" #include "FbiStuff.h" #include "FbiStuffLoader.h" #ifdef USE_X11 #include "viewer.h" #endif /* USE_X11 */ namespace fim { #if FIM_WANT_FBI_PRINTF static const fim_char_t *ct[] = { "gray", "X1", "rgb", "palette", "graya", "X5", "rgba", "X7", }; #endif /* FIM_WANT_FBI_PRINTF */ struct fim_png_state { FILE *infile; png_structp png; png_infop info; png_bytep image; png_uint_32 w,h; int color_type; struct ida_image_info *i; char * cmt; }; static FILE*fim_png_fp; void PNGAPI fim_png_rw_ptr(png_structp s, png_bytep p, png_size_t l) { fim_fread(p, l, 1, fim_png_fp); } void fim_png_rd_cmts(void *data, png_infop info) #ifdef PNG_WRITE_tEXt_SUPPORTED { struct fim_png_state *h = (struct fim_png_state *) data; png_textp text_ptr = FIM_NULL; const int num_comments = png_get_text(h->png, info, &text_ptr, FIM_NULL); int ti = 0; fim::string fs; for (ti=0;ti 1 ) fs+=" "; } } if(num_comments>0) if(fs.c_str() && strlen(fs.c_str())) { const char * s = fs.c_str(); if(!h->cmt) h->cmt = (char*) fim_calloc(strlen(s)+1,1); else { h->cmt = (char*) fim_realloc(h->cmt,strlen(h->cmt)+strlen(s)+1); if(h->cmt) strcat(h->cmt," "); } if(h->cmt) { strcat(h->cmt,s); } } } #else { } #endif static void* png_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { struct fim_png_state *h; int bit_depth, interlace_type; int pass, number_passes; unsigned int y; png_uint_32 resx, resy; /* png_color_16 *file_bg, my_bg = { .red = 192, .green = 192, .blue = 192, .gray = 192, };*/ png_color_16 *file_bg, my_bg ; my_bg .red = 192; my_bg .green = 192; my_bg .blue = 192; my_bg .gray = 192; int unit; h = (struct fim_png_state *) fim_calloc(1,sizeof(*h)); if(!h) goto oops; h->infile = fp; h->i = i; h->png = png_create_read_struct(PNG_LIBPNG_VER_STRING, FIM_NULL, FIM_NULL, FIM_NULL); if (FIM_NULL == h->png) goto oops; h->info = png_create_info_struct(h->png); if (FIM_NULL == h->info) goto oops; fim_png_fp=fp; #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER>=10249) /* in the above, check on version >=10249 is not sufficient, not necessary. for e.g; 10606 it's necessary */ png_set_read_fn(h->png,FIM_NULL,fim_png_rw_ptr); /* TODO: shall make use of return second argument */ #else h->png->read_data_fn=&fim_png_rw_ptr; #endif png_init_io(h->png, h->infile); png_read_info(h->png, h->info); png_get_IHDR(h->png, h->info, &h->w, &h->h, &bit_depth,&h->color_type,&interlace_type, FIM_NULL,FIM_NULL); png_get_pHYs(h->png, h->info, &resx, &resy, &unit); i->width = h->w; i->height = h->h; if (PNG_RESOLUTION_METER == unit) i->dpi = res_m_to_inch(resx); if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("png: color_type=%s #1\n",ct[h->color_type]); i->npages = 1; png_set_packing(h->png); if (bit_depth == 16) png_set_strip_16(h->png); if (h->color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(h->png); if (h->color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) // according to http://www.libpng.org/pub/png/libpng-manual.txt, retrieved 20101129 #ifdef PNG_LIBPNG_VER #if (PNG_LIBPNG_VER>=10209) png_set_expand_gray_1_2_4_to_8(h->png); #else png_set_gray_1_2_4_to_8(h->png); #endif /* PNG_LIBPNG_VER */ #else #error need a proper function name for png_set_gray_1_2_4_to_8, here. #endif /* PNG_LIBPNG_VER */ if (png_get_bKGD(h->png, h->info, &file_bg)) { png_set_background(h->png,file_bg,PNG_BACKGROUND_GAMMA_FILE,1,1.0); } else { png_set_background(h->png,&my_bg,PNG_BACKGROUND_GAMMA_SCREEN,0,1.0); } number_passes = png_set_interlace_handling(h->png); png_read_update_info(h->png, h->info); h->color_type = png_get_color_type(h->png, h->info); if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("png: color_type=%s #2\n",ct[h->color_type]); h->image = (png_byte*)fim_malloc(i->width * i->height * 4); if(!h->image) goto oops; for (pass = 0; pass < number_passes-1; pass++) { if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("png: pass #%d\n",pass); for (y = 0; y < i->height; y++) { png_bytep row = h->image + y * i->width * 4; png_read_rows(h->png, &row, FIM_NULL, 1); } } fim_png_rd_cmts(h,h->info); return h; oops: if (h && h->image) fim_free(h->image); if (h->png) png_destroy_read_struct(&h->png, FIM_NULL, FIM_NULL); fim_fclose(h->infile); if(h->cmt) fim_free(h->cmt); if(h)fim_free(h); return FIM_NULL; } static void png_read(fim_byte_t *dst, unsigned int line, void *data) { struct fim_png_state *h = (struct fim_png_state *) data; png_bytep row = h->image + line * h->w * 4; switch (h->color_type) { case PNG_COLOR_TYPE_GRAY: png_read_rows(h->png, &row, FIM_NULL, 1); load_gray(dst,row,h->w); break; case PNG_COLOR_TYPE_RGB: png_read_rows(h->png, &row, FIM_NULL, 1); memcpy(dst,row,3*h->w); break; case PNG_COLOR_TYPE_RGB_ALPHA: png_read_rows(h->png, &row, FIM_NULL, 1); load_rgba(dst,row,h->w); break; case PNG_COLOR_TYPE_GRAY_ALPHA: png_read_rows(h->png, &row, FIM_NULL, 1); load_graya(dst,row,h->w); break; default: /* shouldn't happen */ FIM_FBI_PRINTF("Oops: %s:%d\n",__FILE__,__LINE__); exit(1); } } static void png_done(void *data) { struct fim_png_state *h =(struct fim_png_state *) data; png_infop end_info = png_create_info_struct(h->png); png_read_end(h->png, end_info ); fim_png_rd_cmts(h,end_info); if(h->cmt) { load_add_extra(h->i,EXTRA_COMMENT,(fim_byte_t*)h->cmt,strlen(h->cmt)); fim_free(h->cmt); load_free_extras(h->i); } fim_free(h->image); png_destroy_read_struct(&h->png, &h->info, &end_info); fim_fclose(h->infile); fim_free(h); } //used in FbiStuff.cpp #ifdef FIM_WITH_LIBPNG struct ida_loader png_loader #else static struct ida_loader png_loader #endif /* FIM_WITH_LIBPNG */ = { /*magic:*/ "\x89PNG", /*moff:*/ 0, /*mlen:*/ 4, /*name:*/ "libpng", /*init:*/ png_init, /*read:*/ png_read, /*done:*/ png_done, }; static void fim__init init_rd(void) { fim_load_register(&png_loader); } #ifdef USE_X11 /* ---------------------------------------------------------------------- */ /* save */ static int png_write(FILE *fp, struct ida_image *img) { png_structp png_ptr = FIM_NULL; png_infop info_ptr = FIM_NULL; png_bytep row; unsigned int y; /* Create and initialize the png_struct with the desired error handler * functions. If you want to use the default stderr and longjump based method, * you can supply FIM_NULL for the last three parameters. We also check that * the library version is compatible with the one used at compile time, * in case we are using dynamically linked libraries. REQUIRED. */ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,FIM_NULL,FIM_NULL,FIM_NULL); if (png_ptr == FIM_NULL) goto oops; /* Allocate/initialize the image information data. REQUIRED */ info_ptr = png_create_info_struct(png_ptr); if (info_ptr == FIM_NULL) goto oops; if (setjmp(png_jmpbuf(png_ptr))) goto oops; png_init_io(png_ptr, fp); png_set_IHDR(png_ptr, info_ptr, img->i.width, img->i.height, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); if (img->i.dpi) { png_set_pHYs(png_ptr, info_ptr, res_inch_to_m(img->i.dpi), res_inch_to_m(img->i.dpi), PNG_RESOLUTION_METER); } png_write_info(png_ptr, info_ptr); png_set_packing(png_ptr); for (y = 0; y < img->i.height; y++) { row = img->data + y * 3 * img->i.width; png_write_rows(png_ptr, &row, 1); } png_write_end(png_ptr, info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr); return 0; oops: FIM_FBI_PRINTF("can't save image: libpng error\n"); if (png_ptr) png_destroy_write_struct(&png_ptr, (png_infopp)FIM_NULL); return -1; } static struct ida_writer png_writer = { /*label:*/ "PNG", /* ext:*/ { "png", FIM_NULL}, /*write:*/ png_write, }; static void fim__init init_wr(void) { fim_write_register(&png_writer); } #endif /* USE_X11 */ } fim-0.6-rc2/src/FbiStuffTiff.cpp0000644000175000017500000002066514454347340013374 00000000000000/* $LastChangedDate: 2022-10-30 16:13:52 +0100 (Sun, 30 Oct 2022) $ */ /* FbiStuffTiff.cpp : fbi functions for TIFF files, modified for fim (c) 2007-2022 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #include #include #include #include #include #include "FbiStuff.h" #include "FbiStuffLoader.h" #ifdef USE_X11 #include "viewer.h" #endif /* USE_X11 */ namespace fim { struct tiff_state { TIFF* tif; //char emsg[FIM_LIBERR_BUFSIZE]; tdir_t ndirs; /* Number of directories */ /* (could be interpreted as number of pages) */ uint32 width,height; uint16 config,nsamples,depth,fillorder,photometric; uint32* row; uint32* image; uint16 resunit; float xres,yres; }; static void* tiff_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { struct tiff_state *h=FIM_NULL; fclose(fp); h = (struct tiff_state *) fim_calloc(1,sizeof(*h)); if(!h)goto oops; TIFFSetWarningHandler(FIM_NULL); h->tif = TIFFOpen(filename,"r"); if (FIM_NULL == h->tif) goto oops; /* Determine number of directories */ h->ndirs = 1; while (TIFFReadDirectory(h->tif)) h->ndirs++; i->npages = h->ndirs; /* Select requested directory (page) */ if (!TIFFSetDirectory(h->tif, (tdir_t)page)) goto oops; TIFFGetField(h->tif, TIFFTAG_IMAGEWIDTH, &h->width); TIFFGetField(h->tif, TIFFTAG_IMAGELENGTH, &h->height); TIFFGetField(h->tif, TIFFTAG_PLANARCONFIG, &h->config); TIFFGetField(h->tif, TIFFTAG_SAMPLESPERPIXEL, &h->nsamples); TIFFGetField(h->tif, TIFFTAG_BITSPERSAMPLE, &h->depth); TIFFGetField(h->tif, TIFFTAG_FILLORDER, &h->fillorder); TIFFGetField(h->tif, TIFFTAG_PHOTOMETRIC, &h->photometric); h->row = (uint32*)fim_malloc(TIFFScanlineSize(h->tif)); if(!h->row)goto oops; if (FbiStuff::fim_filereading_debug()) #ifndef FIM_PRId32 #define FIM_PRId32 "x" #endif /* FIM_PRId32 */ FIM_FBI_PRINTF("tiff: %" FIM_PRId32 "x%" FIM_PRId32 ", planar=%d, " "nsamples=%d, depth=%d fo=%d pm=%d scanline=%" FIM_PRId32 "\n", // FIM_FBI_PRINTF("tiff: %" "%d" "x%" "%d" ", planar=%d, " // "nsamples=%d, depth=%d fo=%d pm=%d scanline=%" "%d" "\n", h->width,h->height,h->config,h->nsamples,h->depth, h->fillorder,h->photometric, TIFFScanlineSize(h->tif)); if (PHOTOMETRIC_PALETTE == h->photometric || PHOTOMETRIC_YCBCR == h->photometric || PHOTOMETRIC_SEPARATED == h->photometric || TIFFIsTiled(h->tif) || (1 != h->depth && 8 != h->depth)) { /* for the more difficuilt cases we let libtiff * do all the hard work. Drawback is that we lose * progressive loading and decode everything here */ if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("tiff: reading whole image [TIFFReadRGBAImage]\n"); h->image=(uint32*)fim_malloc(4*h->width*h->height); if(!h->image)goto oops; TIFFReadRGBAImage(h->tif, h->width, h->height, h->image, 0); } else { if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("tiff: reading scanline by scanline\n"); } i->width = h->width; i->height = h->height; if (TIFFGetField(h->tif, TIFFTAG_RESOLUTIONUNIT, &h->resunit) && TIFFGetField(h->tif, TIFFTAG_XRESOLUTION, &h->xres) && TIFFGetField(h->tif, TIFFTAG_YRESOLUTION, &h->yres)) { switch (h->resunit) { case RESUNIT_NONE: break; case RESUNIT_INCH: i->dpi = (unsigned int)h->xres; break; case RESUNIT_CENTIMETER: i->dpi = (unsigned int)res_cm_to_inch(h->xres); break; } } return h; oops: if (h && h->tif) TIFFClose(h->tif); if(h && h->row)fim_free(h->row); if(h && h->image)fim_free(h->image); if(h)fim_free(h); return FIM_NULL; } static void tiff_read(fim_byte_t *dst, unsigned int line, void *data) { struct tiff_state *h = (struct tiff_state *) data; int s,on,off; if (h->image) { /* loaded whole image using TIFFReadRGBAImage() */ uint32 *row = h->image + h->width * (h->height - line -1); load_rgba(dst,(fim_byte_t*)row,h->width); return; } if (h->config == PLANARCONFIG_CONTIG) { TIFFReadScanline(h->tif, h->row, line, 0); } else if (h->config == PLANARCONFIG_SEPARATE) { for (s = 0; s < h->nsamples; s++) TIFFReadScanline(h->tif, h->row, line, s); } switch (h->nsamples) { case 1: if (1 == h->depth) { /* black/white */ on = 0, off = 0; if (PHOTOMETRIC_MINISWHITE == h->photometric) on = 0, off = 255; if (PHOTOMETRIC_MINISBLACK == h->photometric) on = 255, off = 0; #if 0 /* Huh? Does TIFFReadScanline handle this already ??? */ if (FILLORDER_MSB2LSB == h->fillorder) load_bits_msb(dst,(fim_byte_t*)(h->row),h->width,on,off); else load_bits_lsb(dst,(fim_byte_t*)(h->row),h->width,on,off); #else load_bits_msb(dst,(fim_byte_t*)(h->row),h->width,on,off); #endif } else { /* grayscaled */ load_gray(dst,(fim_byte_t*)(h->row),h->width); } break; case 3: /* rgb */ memcpy(dst,h->row,3*h->width); break; case 4: /* rgb+alpha */ load_rgba(dst,(fim_byte_t*)(h->row),h->width); break; } } static void tiff_done(void *data) { struct tiff_state *h = (struct tiff_state *) data; TIFFClose(h->tif); if (h->row) fim_free(h->row); if (h->image) fim_free(h->image); fim_free(h); } static struct ida_loader tiff1_loader = { /*magic:*/ "MM\x00\x2a", /*moff:*/ 0, /*mlen:*/ 4, /*name:*/ "libtiff-MM", /*init:*/ tiff_init, /*read:*/ tiff_read, /*done:*/ tiff_done, }; static struct ida_loader tiff2_loader = { /*magic:*/ "II\x2a\x00", /*moff:*/ 0, /*mlen:*/ 4, /*name:*/ "libtiff-II", /*init:*/ tiff_init, /*read:*/ tiff_read, /*done:*/ tiff_done, }; static void fim__init init_rd(void) { fim_load_register(&tiff1_loader); fim_load_register(&tiff2_loader); } #ifdef USE_X11 /* ---------------------------------------------------------------------- */ /* save */ static int tiff_write(FILE *fp, struct ida_image *img) { TIFF *TiffHndl; tdata_t buf; unsigned int y; TiffHndl = TIFFFdOpen(fileno(fp),"42.tiff","w"); if (TiffHndl == FIM_NULL) return -1; TIFFSetField(TiffHndl, TIFFTAG_IMAGEWIDTH, img->i.width); TIFFSetField(TiffHndl, TIFFTAG_IMAGELENGTH, img->i.height); TIFFSetField(TiffHndl, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(TiffHndl, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB); TIFFSetField(TiffHndl, TIFFTAG_BITSPERSAMPLE, 8); TIFFSetField(TiffHndl, TIFFTAG_SAMPLESPERPIXEL, 3); TIFFSetField(TiffHndl, TIFFTAG_ROWSPERSTRIP, 2); TIFFSetField(TiffHndl, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); #if 0 /* fixme: make this configureable */ TIFFSetField(TiffHndl, TIFFTAG_COMPRESSION, COMPRESSION_LZW); TIFFSetField(TiffHndl, TIFFTAG_PREDICTOR, 2); #endif if (img->i.dpi) { float dpi = img->i.dpi; TIFFSetField(TiffHndl, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); TIFFSetField(TiffHndl, TIFFTAG_XRESOLUTION, dpi); TIFFSetField(TiffHndl, TIFFTAG_YRESOLUTION, dpi); } for (y = 0; y < img->i.height; y++) { buf = img->data + 3*img->i.width*y; TIFFWriteScanline(TiffHndl, buf, y, 0); } TIFFClose(TiffHndl); return 0; } static struct ida_writer tiff_writer = { /* label:*/ "TIFF", /* ext:*/ { "tif", "tiff", FIM_NULL}, /* write:*/ tiff_write, }; static void fim__init init_wr(void) { fim_write_register(&tiff_writer); } #endif /* USE_X11 */ } fim-0.6-rc2/src/Viewport.h0000644000175000017500000001047714454347340012337 00000000000000/* $LastChangedDate: 2022-12-11 15:22:59 +0100 (Sun, 11 Dec 2022) $ */ /* Viewport.h : Viewport class headers (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_VIEWPORT_H #define FIM_VIEWPORT_H #include "fim.h" #include "FimWindow.h" // Rect #include "DisplayDevice.h" namespace fim { class Viewport FIM_FINAL #ifdef FIM_NAMESPACES :public Namespace,public ViewportState #else /* FIM_NAMESPACES */ :public ViewportState #endif /* FIM_NAMESPACES */ { private: fim_bool_t psteps_; DisplayDevice* displaydevice_; #ifdef FIM_WINDOWS const Rect&corners_; #endif /* FIM_WINDOWS */ ImagePtr image_; CommandConsole& commandConsole_; void reset(void); void steps_reset(void); public: #ifdef FIM_WINDOWS explicit Viewport(CommandConsole& commandConsole_, DisplayDevice *dd, const Rect &rect); #else /* FIM_WINDOWS */ explicit Viewport(CommandConsole& commandConsole_, DisplayDevice *dd); #endif /* FIM_WINDOWS */ explicit Viewport(const Viewport& rhs); ~Viewport(void); private: Viewport& operator= (const Viewport&rhs); fim_redraw_t redraw_; template bool pan_to_t(const PT px, const PT py); public: void should_redraw(enum fim_redraw_t sr = FIM_REDRAW_NECESSARY); fim_bool_t need_redraw(void)const; bool do_pan(const args_t& args); bool pan(const fim_char_t*a1, const fim_char_t*a2); bool pan_to(const fim_pan_t px, const fim_pan_t py); bool pan_to(const double px, const double py); fim_bool_t pan_up (fim_pan_t s=0); fim_bool_t pan_down (fim_pan_t s=0); fim_bool_t pan_right(fim_pan_t s=0); fim_bool_t pan_left (fim_pan_t s=0); bool onBottom(fim_coo_t approx_fraction=0)const; bool onRight(fim_coo_t approx_fraction=0)const; bool onLeft(fim_coo_t approx_fraction=0)const; bool onTop(fim_coo_t approx_fraction=0)const; fim_coo_t xorigin(void)const; fim_coo_t yorigin(void)const; private: fim_scale_t viewport_xscale(void)const; fim_scale_t viewport_yscale(void)const; public: fim_coo_t viewport_width(void)const; fim_coo_t viewport_height(void)const; fim_coo_t pixelable_height(void)const; fim_coo_t extra_top_height(void)const; fim_coo_t extra_bottom_height(void)const; fim_coo_t extra_height(void)const; void align(const char c); bool display(void); bool redisplay(void); void auto_width_scale(void); void auto_height_scale(void); void setImage(fim::ImagePtr ni); void scale_fix_top_left(void); const Image* c_getImage(void)const; Image* getImage(void)const; // FIXME: public only for CommandConsole::rns(const fim_var_id varname) void auto_scale(void); void auto_scale_if_bigger(void); void free_image(bool force); bool check_invalid(void)const; bool check_valid(void)const; void scale_position_magnify(fim_scale_t factor=FIM_CNS_SCALEFACTOR); void scale_position_reduce(fim_scale_t factor=FIM_CNS_SCALEFACTOR); private: void recenter_horizontally(void); void recenter_vertically(void); public: void recenter(void); virtual size_t byte_size(void)const; int snprintf_centering_info(char *str, size_t size)const; private: void transform(bool mirror, bool flip); bool shall_negate(void)const; bool shall_desaturate(void)const; bool shall_mirror(void)const; bool shall_flip(void)const; bool shall_autotop(void)const; std::string get_caption_text(void)const; public: fim_cxr img_color(const args_t& args); #if FIM_WANT_CROP fim_cxr img_crop(const args_t& args, const string ¤t); #endif /* FIM_WANT_CROP */ fim_err_t img_rotate(fim_angle_t angle); bool img_goto_page(fim_page_t j); fim_cxr img_scale(const args_t& args, const string ¤t); fim_err_t update_meta(bool fresh); }; } /* namespace fim */ #endif /* FIM_VIEWPORT_H */ fim-0.6-rc2/src/Var.cpp0000644000175000017500000000451014454347340011572 00000000000000/* $LastChangedDate: 2022-11-15 09:29:35 +0100 (Tue, 15 Nov 2022) $ */ /* Var.cpp : (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" namespace fim { typedef std::map fim_var_help_t;//variable id -> variable help static fim_var_help_t fim_var_help_db; /* this is the global help db for fim variables */ void fim_var_help_db_init(void) { #define FIM_WANT_INLINE_HELP 1 #include "help.cpp" #undef FIM_WANT_INLINE_HELP ;/* freebsd 7.2 cc dies without */ } fim::string fim_var_help_db_query(const fim::string& id) { fim_var_help_t::const_iterator hi = fim_var_help_db.find(id); fim::string hs; if(hi != fim_var_help_db.end()) hs = hi->second; return hs; } fim::string fim_get_variables_reference(FimDocRefMode refmode) { std::ostringstream oss; fim_var_help_t::const_iterator vi; if(refmode==Man) goto manmode; for( vi=fim_var_help_db.begin();vi!=fim_var_help_db.end();++vi) oss << vi->first << " : " << fim_var_help_db_query(vi->first) << "\n"; return oss.str(); manmode: for( vi=fim_var_help_db.begin();vi!=fim_var_help_db.end();++vi) oss << ".na\n" << /* No output-line adjusting; unelegant way to avoid man --html=cat's: cannot adjust line */ ".B\n" << vi->first << "\n" << fim_var_help_db_query(vi->first) << "\n" << ".fi\n"; fim::string s(oss.str()); s.substitute("\\$","$\\:"); /* Zero-width break point on $ (that is, on long hardcoded regexps). */ return s; } std::ostream& Var::print(std::ostream& os)const { return os << this->getString(); } std::ostream& operator<<(std::ostream& os, const Var& var) { return var.print(os); } } fim-0.6-rc2/src/CommandConsole-var.cpp0000644000175000017500000001410414454347340014531 00000000000000/* $LastChangedDate: 2023-03-25 18:31:40 +0100 (Sat, 25 Mar 2023) $ */ /* CommandConsole-var.h : CommandConsole variables store (c) 2013-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" namespace fim { fim_var_id CommandConsole::rnid(const fim_var_id& varname)const { fim::string id; #ifdef FIM_NAMESPACES if( varname.length() > 2 && varname.at(1) == FIM_SYM_NAMESPACE_SEP ) { if( varname.length() > 2 ) id = varname.c_str()+2; } else #endif /* FIM_NAMESPACES */ id = varname; return id; } Namespace * CommandConsole::rns(const fim_var_id varname) { Namespace * nsp = FIM_NULL; #ifdef FIM_NAMESPACES if( varname.length() > 2 && varname.at(1) == FIM_SYM_NAMESPACE_SEP ) { try { //a specific namespace was selected! const fim_char_t ns = varname.at(0); const fim_var_id id = varname.c_str()+2; if( ns == FIM_SYM_NAMESPACE_WINDOW_CHAR ) #ifdef FIM_WINDOWS { //window variable nsp = window_; goto err; } else if( ns == FIM_SYM_NAMESPACE_VIEWPORT_CHAR ) { //viewport variable if(window_) nsp = window_->current_viewportp(); goto err; } else #endif /* FIM_WINDOWS */ if( ns == FIM_SYM_NAMESPACE_IMAGE_CHAR ) { //image variable #if FIM_WINDOWS if(window_ && window_->current_viewportp() && window_->current_viewportp()->getImage()) nsp = window_->current_viewportp()->getImage(); #else /* FIM_WINDOWS */ if ( viewport_->getImage() ) nsp = viewport_->getImage(); #endif /* FIM_WINDOWS */ goto err; } else if( ns == FIM_SYM_NAMESPACE_BROWSER_CHAR ) { //browser variable nsp = & browser_; goto err; } else if( ns == FIM_SYM_NAMESPACE_GLOBAL_CHAR ) { nsp = (Namespace*) this; goto err; } else if( ns != FIM_SYM_NAMESPACE_GLOBAL_CHAR ) { //invalid namespace goto err; } } catch(FimException){} } #endif /* FIM_NAMESPACES */ nsp = this; err: return nsp; } const Namespace * CommandConsole::c_rns(const fim_var_id varname)const { const Namespace * nsp = FIM_NULL; #ifdef FIM_NAMESPACES if( varname.length() > 2 && varname.at(1) == FIM_SYM_NAMESPACE_SEP ) { try { //a specific namespace was selected! const fim_char_t ns = varname.at(0); const fim_var_id id = varname.c_str()+2; if( ns == FIM_SYM_NAMESPACE_WINDOW_CHAR ) #ifdef FIM_WINDOWS { //window variable nsp = window_; goto err; } else if( ns == FIM_SYM_NAMESPACE_VIEWPORT_CHAR ) { //viewport variable if(window_) nsp = window_->current_viewportp(); goto err; } else #endif /* FIM_WINDOWS */ if( ns == FIM_SYM_NAMESPACE_IMAGE_CHAR ) { //image variable nsp = browser_.c_getImage(); goto err; } else if( ns == FIM_SYM_NAMESPACE_BROWSER_CHAR ) { //browser variable nsp = & browser_; goto err; } else if( ns == FIM_SYM_NAMESPACE_GLOBAL_CHAR ) { nsp = (Namespace*) this; goto err; } else if( ns != FIM_SYM_NAMESPACE_GLOBAL_CHAR ) { //invalid namespace goto err; } } catch(FimException e){} } #endif /* FIM_NAMESPACES */ nsp = this; err: return nsp; } fim_int CommandConsole::setVariable(const fim_var_id& varname,fim_int value) { if( Namespace *nsp = rns(varname) ) nsp->setVariable(rnid(varname),value); return value; } #if FIM_WANT_LONG_INT int CommandConsole::setVariable(const fim_var_id& varname,int value) { return setVariable(varname,static_cast(value)); } unsigned int CommandConsole::setVariable(const fim_var_id& varname,unsigned int value) { return setVariable(varname,static_cast(value)); } #endif /* FIM_WANT_LONG_INT */ fim_float_t CommandConsole::setVariable(const fim_var_id& varname,fim_float_t value) { if( Namespace *nsp = rns(varname) ) nsp->setVariable(rnid(varname),value); return value; } const fim_char_t* CommandConsole::setVariable(const fim_var_id& varname,const fim_char_t*value) { if( Namespace *nsp = rns(varname) ) nsp->setVariable(rnid(varname),value); return value; } const Var & CommandConsole::setVariable(const fim_var_id varname,const Var&value) { if( Namespace *nsp = rns(varname) ) nsp->setVariable(rnid(varname),value); return value; } const fim::string& CommandConsole::setVariable(const fim_var_id varname,const fim::string&value) { if( Namespace *nsp = rns(varname) ) nsp->setVariable(rnid(varname),value); return value; } fim_int CommandConsole::getIntVariable(const fim_var_id& varname)const { fim_int retval = 0; if( const Namespace *nsp = c_rns(varname) ) retval = nsp->getIntVariable(rnid(varname)); return retval; } fim_float_t CommandConsole::getFloatVariable(const fim_var_id& varname)const { fim_float_t retval = FIM_CNS_EMPTY_FP_VAL; if( const Namespace *nsp = c_rns(varname) ) retval = nsp->getFloatVariable(rnid(varname)); return retval; } fim::string CommandConsole::getStringVariable(const fim_var_id& varname)const { fim::string retval = FIM_CNS_EMPTY_RESULT; if( const Namespace *nsp = c_rns(varname) ) retval = nsp->getStringVariable(rnid(varname)); return retval; } const Var CommandConsole::getVariable(const fim_var_id& varname)const { if( const Namespace *nsp = c_rns(varname) ) return nsp->getVariable(rnid(varname)); else #if FIM_USE_CXX11 return {}; #else /* FIM_USE_CXX11 */ return Var(); #endif /* FIM_USE_CXX11 */ } } /* namespace fim */ fim-0.6-rc2/src/Browser.h0000644000175000017500000002423614454347340012141 00000000000000/* $LastChangedDate: 2023-03-09 00:38:06 +0100 (Thu, 09 Mar 2023) $ */ /* Browser.h : Image browser header file (c) 2007-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_BROWSER_H #define FIM_BROWSER_H #include "fim.h" #include // std::count #if FIM_USE_CXX11 #include // std::unique_ptr #endif /* FIM_USE_CXX11 */ #define FIM_FLAG_NONREC 0 /* let this be zero */ #define FIM_FLAG_DEFAULT FIM_FLAG_NONREC #define FIM_FLAG_PUSH_REC 1 #define FIM_FLAG_PUSH_BACKGROUND 2 #define FIM_FLAG_PUSH_ONE 4 /* one is enough */ #define FIM_FLAG_PUSH_HIDDEN 8 /* */ #define FIM_FLAG_PUSH_ALLOW_DUPS 16 /* */ #define FIM_FLAG_PUSH_FILE_NO_CHECK 32 /* inner one, to save a few stat's; might better cache 'stat()' outpout instead.. */ #define FIM_FLAG_DEL(V,F) (V) &= ~(F) #define FIM_WANT_LIMIT_DUPBN 1 /* limit to duplicate base name */ namespace fim { extern CommandConsole cc; #if FIM_WANT_FLIST_STAT typedef struct stat fim_stat_t; #else /* FIM_WANT_FLIST_STAT */ typedef int fim_stat_t; #endif /* FIM_WANT_FLIST_STAT */ class fle_t FIM_FINAL : public fim_fn_t /* file list element */ { public: #if FIM_WANT_FLIST_STAT fim_stat_t stat_; #endif /* FIM_WANT_FLIST_STAT */ fle_t(const fim_fn_t& s); fle_t(const fim_fn_t& s, const fim_stat_t &ss); fle_t(); }; class fim_bitset_t FIM_FINAL :public std::vector { public: fim_bitset_t(size_t n):std::vector(n,false){} size_t count(void)const{return std::count(this->begin(),this->end(),true);} fim_bool_t any(void)const{return count()!=0;} void set(size_t pos, fim_bool_t value = true){ (*this)[pos]=value; } #if FIM_USE_CXX11 void negate(void){ for(auto bit : (*this)) bit = !bit; } #else /* FIM_USE_CXX11 */ void negate(void){ size_t tsize = size(); for(size_t pos=0;posbegin()[pos] = ! this->begin()[pos]; } #endif /* FIM_USE_CXX11 */ }; /* fim_bitset_t */ /* std::ostream& operator << (std::ostream& os, const fim_bitset_t& bs) { // FIXME: temporarily here ! os << bs.size() << ":"; for(size_t i=0;i { private: size_type cf_; public: flist_t(void):cf_(0){} flist_t(const args_t& a); void _sort(const fim_char_t sc, const char*id=""); void _unique(); size_type cf(void)const{return FIM_MAX(cf_,0U);} fim_bool_t pop_current(void); void erase_at_bitset(const fim_bitset_t& bs, fim_bool_t negative = false); flist_t copy_from_bitset(const fim_bitset_t& bs, fim_bool_t positive = true) const; void _set_difference_from(const flist_t & clist); void _set_union(const flist_t & clist); void get_stat(void); void set_cf(size_type cf){cf_=FIM_MOD(cf,size());} const fim::string pop(const fim::string& filename, bool advance); private: void adj_cf(void){cf_ = size() ? size()-1:0; } }; class Browser FIM_FINAL #ifdef FIM_NAMESPACES :public Namespace #if FIM_WANT_BENCHMARKS ,public Benchmarkable #endif /* FIM_WANT_BENCHMARKS */ #else /* FIM_NAMESPACES */ public Benchmarkable #if FIM_WANT_BENCHMARKS : public Benchmarkable, #endif /* FIM_WANT_BENCHMARKS */ #endif /* FIM_NAMESPACES */ { private: enum MatchMode{ FullFileNameMatch, PartialFileNameMatch, VarMatch, CmtMatch, MarkedMatch, DupFileNameMatch, UniqFileNameMatch, FirstFileNameMatch, LastFileNameMatch, TimeMatch, SizeMatch, ListIdxMatch }; /* FIXME */ enum FilterAction{ Mark, Unmark, Delete }; /* FIXME */ flist_t flist_; /* the names of files in the slideshow. */ #if FIM_EXPERIMENTAL_SHADOW_DIRS == 1 flist_t hlist_; #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ #if FIM_EXPERIMENTAL_SHADOW_DIRS == 2 std::vector shadow_dirs_; #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ #if FIM_WANT_PIC_LBFL flist_t tlist_; /* the names of files in the slideshow. */ flist_t llist_; /* limited file list (FIXME: still unused) */ fim_bool_t limited_; // FIXME: this->limited_ #endif /* FIM_WANT_PIC_LBFL */ const fim_fn_t nofile_; /* a dummy empty filename */ CommandConsole& commandConsole_; #ifdef FIM_READ_STDIN_IMAGE #if FIM_IMG_NAKED_PTRS ImagePtr default_image_; // experimental #else /* FIM_IMG_NAKED_PTRS */ std::shared_ptr default_image_; // experimental #endif /* FIM_IMG_NAKED_PTRS */ #endif /* FIM_READ_STDIN_IMAGE */ Viewport* viewport(void)const; int current_n(int ccp)const; const fim::string pop(fim::string filename=FIM_CNS_EMPTY_STRING, bool advance=false); fim_int current_image(void)const; public: flist_t get_file_list(void)const { return flist_; } int current_n(void)const; fim::string get_next_filename(int n)const; // FIXME: should be private fim::string last_regexp_; // was private fim_int last_src_dir_; Cache cache_; // was private #if FIM_WANT_BACKGROUND_LOAD PACA pcache_; // was private #endif /* FIM_WANT_BACKGROUND_LOAD */ #ifdef FIM_READ_STDIN_IMAGE void set_default_image(ImagePtr stdin_image); #endif /* FIM_READ_STDIN_IMAGE */ const Image* c_getImage(void)const; // was private int empty_file_list(void)const; Browser(CommandConsole& cc); ~Browser(void) { } #if FIM_WANT_PIC_CMTS_RELOAD std::vector > dfl_; // FIXME: should be private #endif /* FIM_WANT_PIC_CMTS_RELOAD */ #if FIM_USE_CXX11 public: /* a deleted copy constructor (e.g. not even a be'friend'ed class can call it) */ Browser& operator= (const Browser& rhs) = delete; Browser(const Browser& rhs) = delete; #else /* FIM_USE_CXX11 */ private: Browser& operator= (const Browser& rhs){return *this;/* a disabled copy constructor */} explicit Browser(const Browser& rhs): Namespace(rhs), flist_(args_t()), #if FIM_WANT_PIC_LBFL tlist_(args_t()), #endif /* FIM_WANT_PIC_LBFL */ #if FIM_WANT_PIC_LBFL llist_(args_t()), limited_(false), #endif /* FIM_WANT_PIC_LBFL */ nofile_(), commandConsole_(cc), #ifdef FIM_READ_STDIN_IMAGE default_image_(FIM_NULL), #endif /* FIM_READ_STDIN_IMAGE */ last_regexp_(fim::string()), last_src_dir_(0) ,cache_(Cache()) #if FIM_WANT_BACKGROUND_LOAD ,pcache_(cache_) #endif /* FIM_WANT_BACKGROUND_LOAD */ {} #endif /* FIM_USE_CXX11 */ public: fim_fn_t current(void)const; fim::string regexp_goto(const args_t& args, fim_int src_dir=1); fim_cxr fcmd_prefetch(const args_t& args); fim_cxr fcmd_goto(const args_t& args); fim::string goto_image_internal(const fim_char_t *s, fim_xflags_t xflags); fim::string goto_image(fim_int n, bool isfg=false); fim_cxr fcmd_align(const args_t& args); fim::string fcmd_pan(const args_t& args); fim_cxr scrolldown(const args_t& args); fim_cxr scrollforward(const args_t& args); fim_cxr fcmd_scroll(const args_t& args); fim_cxr fcmd_scale(const args_t& args); #if FIM_WANT_FAT_BROWSER //fim_cxr fcmd_no_image(const args_t& args); #endif /* FIM_WANT_FAT_BROWSER */ fim_cxr fcmd_rotate(const args_t& args); fim::string display_status(const fim_char_t *l); fim_cxr fcmd_color(const args_t& args); #if FIM_WANT_CROP fim_cxr fcmd_crop(const args_t& args); #endif /* FIM_WANT_CROP */ #if FIM_WANT_PIC_LBFL fim_cxr fcmd_limit(const args_t& args); #endif /* FIM_WANT_PIC_LBFL */ fim_cxr fcmd_reload(const args_t& args); fim_cxr fcmd_list(const args_t& args); fim::string do_push(const args_t& args); fim::string prev(int n=1); fim_cxr fcmd_info(const args_t& args); #if FIM_WANT_OBSOLETE fim::string info(void); #endif /* FIM_WANT_OBSOLETE */ std::ostream& print(std::ostream& os)const; fim_cxr fcmd_load(const args_t& args); const fim::string pop_current(void); fim::string pop_current(const args_t& args); bool present(const fim::string nf)const; fim_int find_file_index(const fim::string nf)const; #ifdef FIM_READ_DIRS bool push_dir(const fim::string & nf, fim_flags_t pf=FIM_FLAG_PUSH_REC, const fim_int * show_must_go_on=FIM_NULL); #endif /* FIM_READ_DIRS */ bool push_path(const fim::string & nf, fim_flags_t pf=FIM_FLAG_PUSH_REC, const fim_int * show_must_go_on=FIM_NULL); bool push_noglob(const fim::string & nf, fim_flags_t pf=FIM_FLAG_PUSH_REC, const fim_int * show_must_go_on=FIM_NULL); #if FIM_EXPERIMENTAL_SHADOW_DIRS void push_shadow_dir(const std::string fn); fim_cxr shadow_file_swap(const fim_fn_t fn); #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ fim::string _random_shuffle(bool dts=true); fim::string _sort(const fim_char_t sc=FIM_SYM_SORT_FN, const char*id=""); void _unique(void); fim::string _clear_list(void); private: fim::string do_filter_cmd(const args_t args, bool negative, enum FilterAction faction); fim::string do_filter(const args_t& args, MatchMode rm=FullFileNameMatch, bool negative=false, enum FilterAction faction = Delete); fim_err_t loadCurrentImage(void); fim::string reload(void); public: fim_int n_files(void)const; fim_int n_pages(void)const; private: fim::string next(int n=1); void free_current_image(bool force); int load_error_handle(fim::string c); public: fim::string _reverse(void); fim::string _swap(void); virtual size_t byte_size(void)const; fim_float_t file_progress(void)const { /* FIXME: relies on range 0... */ double fp = (((double)(1+this->current_n()))/this->n_files()); return FIM_MIN(1.0,fp);} void mark_from_list(const args_t& argsc); bool dump_desc(const fim_fn_t nf, fim_char_t sc, const bool want_all_vars=false, const bool want_append=false)const; #if FIM_WANT_BENCHMARKS virtual fim_int get_n_qbenchmarks(void)const; virtual string get_bresults_string(fim_int qbi, fim_int qbtimes, fim_fms_t qbttime)const; virtual void quickbench_init(fim_int qbi); virtual void quickbench_finalize(fim_int qbi); virtual void quickbench(fim_int qbi); #endif /* FIM_WANT_BENCHMARKS */ bool filechanged(void); }; /* Browser */ } /* namespace fim */ #endif /* FIM_BROWSER_H */ fim-0.6-rc2/src/help-acm.cpp0000644000175000017500000000145714454347340012537 00000000000000//#ifdef FIM_WANT_INLINE_HELP #define FIM_AUTOCOMMANDS_LIST \ FIM_ACM_PRESCALE", " FIM_ACM_POSTSCALE", " FIM_ACM_PREPAN", " FIM_ACM_POSTPAN", " FIM_ACM_PREREDISPLAY", " FIM_ACM_POSTREDISPLAY", " FIM_ACM_PREDISPLAY", " FIM_ACM_POSTDISPLAY", " FIM_ACM_PREPREFETCH", " FIM_ACM_POSTPREFETCH", " FIM_ACM_PRERELOAD", " FIM_ACM_POSTRELOAD", " FIM_ACM_PRELOAD", " FIM_ACM_POSTLOAD", " FIM_ACM_PREGOTO", " FIM_ACM_POSTGOTO", " FIM_ACM_PRECONF", " FIM_ACM_POSTCONF", " FIM_ACM_PREHFIMRC", " FIM_ACM_POSTHFIMRC", " FIM_ACM_PREUFIMRC", " FIM_ACM_POSTUFIMRC", " FIM_ACM_PREGFIMRC", " FIM_ACM_POSTGFIMRC", " FIM_ACM_PREINTERACTIVECOMMAND", " FIM_ACM_POSTINTERACTIVECOMMAND", " FIM_ACM_PREEXECUTIONCYCLE", " FIM_ACM_POSTEXECUTIONCYCLE", " FIM_ACM_PREEXECUTIONCYCLEARGS", " FIM_ACM_PREWINDOW", " FIM_ACM_POSTWINDOW", " //#endif fim-0.6-rc2/src/FbiStuffBit1.cpp0000644000175000017500000001007314454347340013273 00000000000000/* $LastChangedDate: 2022-10-30 16:13:52 +0100 (Sun, 30 Oct 2022) $ */ /* FbiStuffBit1.cpp : reading any file as a raw 1 bit per pixel pixelmap (c) 2007-2022 Michele Martone based on code (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #if FIM_WANT_RAW_BITS_RENDERING #include #include #include #include #ifdef HAVE_ENDIAN_H #include #endif /* HAVE_ENDIAN_H */ namespace fim { extern CommandConsole cc; /* ---------------------------------------------------------------------- */ typedef unsigned int uint32; typedef unsigned short uint16; /* ---------------------------------------------------------------------- */ /* load */ struct bit1_state { FILE *fp; uint32 w; uint32 h; long flen; /* for ftell() */ }; static void* bit1_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { struct bit1_state *h=FIM_NULL; const fim_int prwv=cc.getIntVariable(FIM_VID_PREFERRED_RENDERING_WIDTH); const fim_int prw=prwv<1?FIM_BITRENDERING_DEF_WIDTH:prwv; h = (struct bit1_state *)fim_calloc(1,sizeof(*h)); if(!h) goto oops; h->fp = fp; if(fseek(fp,0,SEEK_END)!=0) goto oops; if((h->flen=ftell(fp))==-1) goto oops; if(8*h->flen < static_cast(prw)) { i->width = h->w = h->flen*8; i->height = h->h = 1; } else { i->width = h->w = prw; // must be congruent to 8 i->height = h->h = FIM_INT_FRAC(8*h->flen,h->w); // should pad } i->npages = 1; return h; oops: if(h)fim_free(h); return FIM_NULL; } static void bit1_read(fim_byte_t *dst, unsigned int line, void *data) { struct bit1_state *h = (struct bit1_state *) data; unsigned int ll,y,x = 0; y = line ; if(y==h->h-1) { ll = h->flen - h->w * (h->h-1) / 8; } else ll = h->w / 8; fseek(h->fp,0 + y * ll,SEEK_SET); for (x = 0; x < h->w; x+=8) { fim_byte_t c = fgetc(h->fp); *(dst++) = (c & 1 << 0)?255:0; *(dst++) = (c & 1 << 0)?255:0; *(dst++) = (c & 1 << 0)?255:0; *(dst++) = (c & 1 << 1)?255:0; *(dst++) = (c & 1 << 1)?255:0; *(dst++) = (c & 1 << 1)?255:0; *(dst++) = (c & 1 << 2)?255:0; *(dst++) = (c & 1 << 2)?255:0; *(dst++) = (c & 1 << 2)?255:0; *(dst++) = (c & 1 << 3)?255:0; *(dst++) = (c & 1 << 3)?255:0; *(dst++) = (c & 1 << 3)?255:0; *(dst++) = (c & 1 << 4)?255:0; *(dst++) = (c & 1 << 4)?255:0; *(dst++) = (c & 1 << 4)?255:0; *(dst++) = (c & 1 << 5)?255:0; *(dst++) = (c & 1 << 5)?255:0; *(dst++) = (c & 1 << 5)?255:0; *(dst++) = (c & 1 << 6)?255:0; *(dst++) = (c & 1 << 6)?255:0; *(dst++) = (c & 1 << 6)?255:0; *(dst++) = (c & 1 << 7)?255:0; *(dst++) = (c & 1 << 7)?255:0; *(dst++) = (c & 1 << 7)?255:0; } // if(y==h->h-1) fim_bzero(dst,h->w*8-8*x); } static void bit1_done(void *data) { struct bit1_state *h = (struct bit1_state *) data; fclose(h->fp); fim_free(h); } struct ida_loader bit1_loader = { /* * 0000000: 7f45 4c46 0101 0100 0000 0000 0000 0000 .ELF............ */ /*magic:*/ "ELF", /*moff:*/ 1, /*mlen:*/ 3, /*name:*/ "Bit1", /*init:*/ bit1_init, /*read:*/ bit1_read, /*done:*/ bit1_done, }; static void fim__init init_rd(void) { fim_load_register(&bit1_loader); } } #endif /* FIM_WANT_RAW_BITS_RENDERING */ fim-0.6-rc2/src/FbiStuffBmp.cpp0000644000175000017500000001560714454347340013222 00000000000000/* $LastChangedDate: 2022-10-30 16:13:52 +0100 (Sun, 30 Oct 2022) $ */ /* FbiStuffBmp.cpp : fbi functions for BMP files, modified for fim (c) 2008-2022 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #include "fim.h" #if FIM_WITH_BMP #include #include #include #include #ifdef HAVE_ENDIAN_H #include #endif /* HAVE_ENDIAN_H */ #include // fill_n //#include "loader.h" namespace fim { /* ---------------------------------------------------------------------- */ typedef unsigned int uint32; typedef unsigned short uint16; /* bitmap files are little endian */ #if BYTE_ORDER == LITTLE_ENDIAN #define le16_to_cpu(x) (x) #define le32_to_cpu(x) (x) #elif BYTE_ORDER == BIG_ENDIAN #define le16_to_cpu(x) (((x>>8) & 0x00ff) |\ ((x<<8) & 0xff00)) #define le32_to_cpu(x) (((x>>24) & 0x000000ff) |\ ((x>>8) & 0x0000ff00) |\ ((x<<8) & 0x00ff0000) |\ ((x<<24) & 0xff000000)) #else /* BYTE_ORDER == LITTLE_ENDIAN */ #error "Oops: unknown byte order" #endif /* BYTE_ORDER == LITTLE_ENDIAN */ /* ---------------------------------------------------------------------- */ /* load */ struct bmp_hdr { uint32 foobar; uint32 size; /* == BitMapInfoHeader */ uint32 width; uint32 height; uint16 planes; uint16 bit_cnt; fim_char_t compression[4]; uint32 image_size; uint32 xpels_meter; uint32 ypels_meter; uint32 num_colors; /* used colors */ uint32 imp_colors; /* important colors */ /* may be more for some codecs */ }; struct bmp_cmap { fim_byte_t blue; fim_byte_t green; fim_byte_t red; fim_byte_t unused; }; struct bmp_state { struct bmp_hdr hdr; struct bmp_cmap cmap[256]; FILE *fp; }; static void* bmp_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { struct bmp_state *h; int fr; h = (struct bmp_state *)fim_calloc(1,sizeof(*h)); if(!h)goto oops; h->fp = fp; fim_fseek(fp,10,SEEK_SET); fr=fim_fread(&h->hdr,sizeof(struct bmp_hdr),1,fp); if(!fr)goto oops; #if BYTE_ORDER == BIG_ENDIAN h->hdr.foobar = le32_to_cpu(h->hdr.foobar); h->hdr.size = le32_to_cpu(h->hdr.size); h->hdr.width = le32_to_cpu(h->hdr.width); h->hdr.height = le32_to_cpu(h->hdr.height); h->hdr.planes = le16_to_cpu(h->hdr.planes); h->hdr.bit_cnt = le16_to_cpu(h->hdr.bit_cnt); h->hdr.image_size = le32_to_cpu(h->hdr.image_size); h->hdr.xpels_meter = le32_to_cpu(h->hdr.xpels_meter); h->hdr.ypels_meter = le32_to_cpu(h->hdr.ypels_meter); h->hdr.num_colors = le32_to_cpu(h->hdr.num_colors); h->hdr.imp_colors = le32_to_cpu(h->hdr.imp_colors); #endif /* BYTE_ORDER == BIG_ENDIAN */ if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("bmp: hdr=%d size=%dx%d planes=%d" " bits=%d size=%d res=%dx%d colors=%d/%d | %d\n", h->hdr.size,h->hdr.width,h->hdr.height, h->hdr.planes,h->hdr.bit_cnt,h->hdr.image_size, h->hdr.xpels_meter,h->hdr.ypels_meter, h->hdr.num_colors,h->hdr.imp_colors,h->hdr.foobar); if (h->hdr.bit_cnt != 1 && h->hdr.bit_cnt != 4 && h->hdr.bit_cnt != 8 && h->hdr.bit_cnt != 24) { if(FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("bmp: can't handle depth [%d]\n",h->hdr.bit_cnt); goto oops; } if (h->hdr.compression[0] || h->hdr.compression[1] || h->hdr.compression[2] || h->hdr.compression[3]) { if(FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("bmp: can't handle compressed bitmaps [%c%c%c%c]\n", h->hdr.compression[0], h->hdr.compression[1], h->hdr.compression[2], h->hdr.compression[3]); goto oops; } if (0 == h->hdr.num_colors && h->hdr.bit_cnt <= 8) h->hdr.num_colors = (1 << h->hdr.bit_cnt); if (h->hdr.num_colors > 256) h->hdr.num_colors = 256; if (h->hdr.num_colors) { fim_fseek(fp,14+h->hdr.size,SEEK_SET); fr=fim_fread(&h->cmap,sizeof(struct bmp_cmap),h->hdr.num_colors,fp); if(!fr)goto oops; } i->width = h->hdr.width; i->height = h->hdr.height; if (h->hdr.xpels_meter) i->dpi = res_m_to_inch(h->hdr.xpels_meter); i->npages = 1; return h; oops: if(h)fim_free(h); return FIM_NULL; } static void bmp_read(fim_byte_t *dst, unsigned int line, void *data) { struct bmp_state *h = (struct bmp_state *) data; unsigned int ll,y,x,pixel,byte = 0; ll = (((h->hdr.width * h->hdr.bit_cnt + 31) & ~0x1f) >> 3); y = h->hdr.height - line - 1; fim_fseek(h->fp,h->hdr.foobar + y * ll,SEEK_SET); switch (h->hdr.bit_cnt) { case 1: for (x = 0; x < h->hdr.width; x++) { if (0 == (x & 0x07)) byte = fim_fgetc(h->fp); pixel = byte & (0x80 >> (x & 0x07)) ? 1 : 0; *(dst++) = h->cmap[pixel].red; *(dst++) = h->cmap[pixel].green; *(dst++) = h->cmap[pixel].blue; } break; case 4: for (x = 0; x < h->hdr.width; x++) { if (x & 1) { pixel = byte & 0xf; } else { byte = fim_fgetc(h->fp); pixel = byte >> 4; } *(dst++) = h->cmap[pixel].red; *(dst++) = h->cmap[pixel].green; *(dst++) = h->cmap[pixel].blue; } break; case 8: for (x = 0; x < h->hdr.width; x++) { pixel = fim_fgetc(h->fp); *(dst++) = h->cmap[pixel].red; *(dst++) = h->cmap[pixel].green; *(dst++) = h->cmap[pixel].blue; } break; case 24: for (x = 0; x < h->hdr.width; x++) { dst[2] = fim_fgetc(h->fp); dst[1] = fim_fgetc(h->fp); dst[0] = fim_fgetc(h->fp); dst += 3; } break; default: std::fill_n(dst,h->hdr.width*3,128); break; } } static void bmp_done(void *data) { struct bmp_state *h = (struct bmp_state *) data; fim_fclose(h->fp); fim_free(h); } static struct ida_loader bmp_loader = { /*magic:*/ "BM", /*moff:*/ 0, /*mlen:*/ 2, /*name:*/ "bmp", /*init:*/ bmp_init, /*read:*/ bmp_read, /*done:*/ bmp_done, }; static void fim__init init_rd(void) { fim_load_register(&bmp_loader); } } #endif /* FIM_WITH_BMP */ fim-0.6-rc2/src/Cache.h0000644000175000017500000001442014454347340011513 00000000000000/* $LastChangedDate: 2022-10-09 16:35:50 +0200 (Sun, 09 Oct 2022) $ */ /* Cache.h : Cache manager header file (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_CACHE_H #define FIM_CACHE_H #include "fim.h" #ifdef HAVE_SYS_TIME_H #if FIM_USE_CXX11 #include #else /* FIM_USE_CXX11 */ #include #endif /* FIM_USE_CXX11 */ #include typedef uint64_t fim_time_t; #else /* HAVE_SYS_TIME_H */ typedef time_t fim_time_t; #endif /* HAVE_SYS_TIME_H */ #define FIM_CR_BS 0 /* base */ #define FIM_CR_CN 1 /* not detailed */ #define FIM_CR_CD 2 /* detailed */ namespace fim { class Cache FIM_FINAL #ifdef FIM_NAMESPACES :private Namespace #else #endif /* FIM_NAMESPACES */ { #if FIM_USE_CXX11 using cachels_t = std::map; //key -> image using lru_t = std::map; //image -> time using ccachels_t = std::map; //key -> counter using vcachels_t = std::map; //key -> viewport state //using cloned_cachels_t = std::map >; //key -> clones //using cuc_t = std::map; //image -> clones usage counter #else /* FIM_USE_CXX11 */ typedef std::map cachels_t; //key -> image typedef std::map lru_t; //image -> time typedef std::map ccachels_t; //key->counter typedef std::map vcachels_t; //key -> viewport state //typedef std::map > cloned_cachels_t; //key -> clones //typedef std::map cuc_t; //image -> clones usage counter #endif /* FIM_USE_CXX11 */ #if FIM_IMG_NAKED_PTRS FIM_DEPRECATED("Please build without FIM_IMG_NAKED_PTRS (naked pointers): portions of fim code (e.g. avoiding leaks in multipage documents memory management) are not functional in the older standard.") #endif /* FIM_IMG_NAKED_PTRS */ cachels_t imageCache_; lru_t lru_; ccachels_t usageCounter_; vcachels_t viewportInfo_; //cloned_cachels_t cloneCache_; //cuc_t cloneUsageCounter_; std::set< fim::ImagePtr > clone_pool_; time_t time0_; bool need_free(void)const; int lru_touch(cache_key_t key); public: bool is_in_cache(cache_key_t key)const; private: bool is_in_clone_cache(fim::ImagePtr oi)const; fim_time_t last_used(cache_key_t key)const; bool cacheNewImage( fim::ImagePtr ni ); ImagePtr loadNewImage(cache_key_t key, fim_page_t page, fim_bool_t delnc); ImagePtr getCachedImage(cache_key_t key); int erase(fim::ImagePtr oi); int erase_clone(fim::ImagePtr oi); ImagePtr get_lru( bool unused = false )const; int free_some_lru(void); int used_image(cache_key_t key)const; fim_time_t get_reltime(void)const; public: Cache(void); #if FIM_USE_CXX11 public: /* a deleted member function (e.g. not even a be'friend'ed class can call it) */ Cache& operator= (const Cache&rhs) = delete; #else /* FIM_USE_CXX11 */ private: /* a disabled member function (because of private: keyword) */ Cache& operator= (const Cache&rhs) { return *this; } #endif /* FIM_USE_CXX11 */ public: bool freeCachedImage(ImagePtr image, const ViewportState *vsp, bool force); ImagePtr useCachedImage(cache_key_t key, ViewportState *vsp, fim_page_t page = 0); ImagePtr setAndCacheStdinCachedImage(ImagePtr image); int prefetch(cache_key_t key); void touch(cache_key_t key); fim::string getReport(int type = FIM_CR_CD )const; virtual size_t byte_size(void)const; size_t img_byte_size(void)const; int cached_elements(void)const; void desc_update(void); ~Cache(void); }; } #if FIM_WANT_BACKGROUND_LOAD #include #include #include namespace fim { typedef fim::string fid_t; class PACA FIM_FINAL /* Parallel Cache */ { public: #if FIM_WANT_BACKGROUND_LOAD std::thread t; #endif /* FIM_WANT_BACKGROUND_LOAD */ Cache& cache_; static FIM_CONSTEXPR int dpc = 0; /* debug parallel cache */ void operator () (const fid_t& rid) { if(dpc) std::cout << __FUNCTION__ << ": "<< rid << " ...\n"; if(dpc) std::cout << (&cache_) << " : " << cache_.getReport() << "\n"; if(dpc) if( ! cache_.is_in_cache(cache_key_t(rid,FIM_E_FILE))) std::cout << __FUNCTION__ << ": "<< rid << " ... sleeping\n", std::this_thread::sleep_for(std::chrono::milliseconds(4000)); cache_.prefetch(cache_key_t(rid,FIM_E_FILE)); if(dpc) std::cout << __FUNCTION__ << ": "<< rid << " ... done\n"; } PACA(const PACA & paca) : cache_(paca.cache_) { if(dpc) std::cout << __FUNCTION__ << "\n"; } explicit PACA(Cache& cache):cache_(cache) { } ImagePtr useCachedImage(cache_key_t key, ViewportState *vsp, fim_page_t page=0) { ImagePtr image = FIM_NULL; if(dpc) std::cout << __FUNCTION__ << ": " << key.first << "\n"; if( t.joinable() ) { if(dpc) std::cout << __FUNCTION__ << ": " << key.first << " join()\n"; t.join(); if(dpc) std::cout << __FUNCTION__ << ": " << key.first << " joined()\n"; } image = cache_.useCachedImage(key, vsp, page); if(dpc) std::cout << __FUNCTION__ << ": " << key.first << " done\n"; if(dpc) std::cout << (&cache_) << " : " << cache_.getReport() << "\n"; return image; } void asyncPrefetch(const fid_t& rid) { if(dpc) std::cout << __FUNCTION__ << ": " << rid << "\n"; if( t.joinable() ) { //if(dpc) std::cout << __FUNCTION__ << ": " << rid << " return\n"; return; if(dpc) std::cout << __FUNCTION__ << ": " << rid << " join()\n"; t.join(); } t = std::thread(*this,rid); // operator () } ~PACA(void) { if( t.joinable() ) t.join(); } }; /* PACA */ } /* namespace */ #endif /* FIM_WANT_BACKGROUND_LOAD */ #endif /* FIM_CACHE_H */ fim-0.6-rc2/src/FbiStuffPdf.cpp0000644000175000017500000001767014454347340013217 00000000000000/* $LastChangedDate: 2023-03-26 01:52:00 +0100 (Sun, 26 Mar 2023) $ */ /* FbiStuffPdf.cpp : fim functions for decoding PDF files (c) 2008-2023 Michele Martone based on code (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * this code should be fairly correct, although unfinished * */ #include #include #include #include "FbiStuff.h" #include "FbiStuffLoader.h" #ifdef HAVE_LIBPOPPLER /* * Note : at the time of writing this, the poppler API is unstable, * and subject to change. * So when changing these headers here, take care of changing them * in the configure script, too. * And please don't blame me (fim's author)! */ #include #if (POPPLER_VERSION_MINOR>=21) #if (POPPLER_VERSION_MINOR< 24) #include #include #else #include #include #endif /* (POPPLER_VERSION_MINOR< 24) */ #include #include #include #include #include #include /* globalParams lives here */ #include #endif /* (POPPLER_VERSION_MINOR>=21) */ #if HAVE_FILENO #define FIM_PDF_USE_FILENO 1 #else #define FIM_PDF_USE_FILENO 0 #endif /* HAVE_FILENO */ /* */ #define GBool gboolean #define gTrue 1 #define gFalse 0 namespace fim { extern CommandConsole cc; /* ---------------------------------------------------------------------- */ /* load */ struct pdf_state_t { SplashBitmap* bmp ; PDFDoc * pd ; SplashOutputDev * od ; int row_stride; /* physical row width in output buffer */ fim_byte_t * first_row_dst; }; /* ---------------------------------------------------------------------- */ static SplashColor splashColRed; static SplashColor splashColGreen; static SplashColor splashColBlue; static SplashColor splashColWhite; static SplashColor splashColBlack; //static SplashColorMode gSplashColorMode = splashModeBGR8; static SplashColorMode gSplashColorMode = splashModeRGB8; #define SPLASH_COL_RED_PTR (SplashColorPtr)&(splashColRed[0]) #define SPLASH_COL_GREEN_PTR (SplashColorPtr)&(splashColGreen[0]) #define SPLASH_COL_BLUE_PTR (SplashColorPtr)&(splashColBlue[0]) #define SPLASH_COL_WHITE_PTR (SplashColorPtr)&(splashColWhite[0]) #define SPLASH_COL_BLACK_PTR (SplashColorPtr)&(splashColBlack[0]) static SplashColorPtr gBgColor = SPLASH_COL_WHITE_PTR; static void splashColorSet(SplashColorPtr col, Guchar red, Guchar green, Guchar blue, Guchar alpha) { switch (gSplashColorMode) { case splashModeBGR8: col[0] = blue; col[1] = green; col[2] = red; break; case splashModeRGB8: col[0] = red; col[1] = green; col[2] = blue; break; default: assert(0); break; } } void SplashColorsInit(void) { splashColorSet(SPLASH_COL_RED_PTR, 0xff, 0, 0, 0); splashColorSet(SPLASH_COL_GREEN_PTR, 0, 0xff, 0, 0); splashColorSet(SPLASH_COL_BLUE_PTR, 0, 0, 0xff, 0); splashColorSet(SPLASH_COL_BLACK_PTR, 0, 0, 0, 0); splashColorSet(SPLASH_COL_WHITE_PTR, 0xff, 0xff, 0xff, 0); } static void* pdf_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { struct pdf_state_t * ds=FIM_NULL; int rotation=0,pageNo=page+1; const double zoomReal=100.0; double hDPI; double vDPI; GBool useMediaBox ; GBool crop ; GBool doLinks ; const fim_int prdv=cc.getIntVariable(FIM_VID_PREFERRED_RENDERING_DPI); const fim_int prd=prdv<1?FIM_RENDERING_DPI:prdv; if(filename==std::string(FIM_STDIN_IMAGE_NAME)) { std::cerr<<"sorry, stdin multipage file reading is not supported\n"; goto retnull; } /* a drivers's problem */ #if !FIM_PDF_USE_FILENO if(fp) fclose(fp); #else if(fp) { // FIXME: this hack will only work on Linux. static fim_char_t linkname[FIM_LINUX_LINKFILENAME_BUFSIZE]; sprintf(linkname,"/proc/self/fd/%d",fileno(fp)); //printf("%s\n",linkname); filename=linkname; if(-1==access(filename,R_OK)) return FIM_NULL; } #endif /* FIM_PDF_USE_FILENO */ ds = (struct pdf_state_t*)fim_calloc(1,sizeof(struct pdf_state_t)); if(!ds) return FIM_NULL; ds->first_row_dst = FIM_NULL; ds->bmp = FIM_NULL; ds->pd = FIM_NULL; ds->od = FIM_NULL; SplashColorsInit(); // WARNING : a global variable from libpoppler! damn!! globalParams = new GlobalParams(); if (!globalParams) goto err; globalParams->setErrQuiet(gFalse); #if defined(POPPLER_VERSION_MINOR) && (POPPLER_VERSION_MINOR<22) fim_char_t _[1]; _[0]='\0'; globalParams->setBaseDir(_); #endif /* defined(POPPLER_VERSION_MINOR) && (POPPLER_VERSION_MINOR<22) */ ds->pd = new PDFDoc(new GooString(filename), FIM_NULL, FIM_NULL, (void*)FIM_NULL); if (!ds->pd) goto err; if (!ds->pd->isOk()) goto err; if (!ds->od) { GBool bitmapTopDown = gTrue; ds->od = new SplashOutputDev(gSplashColorMode, /*4*/3, gFalse, gBgColor, bitmapTopDown, splashThinLineDefault/*antialias*/); if (ds->od) #ifdef POPPLER_VERSION /* as of 0.20.2, from poppler/poppler-config.h */ /* FIXME: this is an incomplete fix (triggered on 20120719's email on fim-devel); I don't really know which version of poppler defines this macro first, but I assume 0.20.2 or so */ ds->od->startDoc(ds->pd); #else /* POPPLER_VERSION */ ds->od->startDoc(ds->pd->getXRef()); #endif /* POPPLER_VERSION */ } if (!ds->od) goto err; i->dpi = prd; hDPI = (double)i->dpi* (zoomReal * 0.01); vDPI = (double)i->dpi* (zoomReal * 0.01); useMediaBox = gFalse; crop = gTrue; doLinks = gTrue; i->npages = ds->pd->getNumPages(); if(page>=i->npages || page<0)goto err; ds->pd->displayPage(ds->od, pageNo, hDPI, vDPI, rotation, useMediaBox, crop, doLinks, FIM_NULL, FIM_NULL); if(!ds->pd) goto err; ds->bmp = ds->od->takeBitmap(); if(!ds->bmp) goto err; i->width = ds->bmp->getWidth(); i->height = ds->bmp->getHeight(); return ds; err: if(ds->pd) delete ds->pd ; if(ds->od) delete ds->od ; if (globalParams) delete globalParams; globalParams = FIM_NULL; if(ds)fim_free(ds); retnull: return FIM_NULL; } static void pdf_read(fim_byte_t *dst, unsigned int line, void *data) { struct pdf_state_t *ds = (struct pdf_state_t*)data; if(!ds)return; if(ds->first_row_dst == FIM_NULL) ds->first_row_dst = dst; else return; memcpy(dst,ds->bmp->getDataPtr(),ds->bmp->getHeight()*ds->bmp->getWidth()*3); } static void pdf_done(void *data) { struct pdf_state_t *ds = (struct pdf_state_t*)data; if(!ds) return; if(ds->pd) delete ds->pd ; if(ds->od) delete ds->od ; if (globalParams) delete globalParams; globalParams = FIM_NULL; fim_free(ds); } /* 0000000: 2550 4446 2d31 2e34 0a25 d0d4 c5d8 0a35 %PDF-1.4.%.....5 */ static struct ida_loader pdf_loader = { /*magic:*/ "%PDF-",// FI/*XME :*/ are sure this is enough ? /*moff:*/ 0, /*mlen:*/ 5, /*name:*/ "libpoppler", /*init:*/ pdf_init, /*read:*/ pdf_read, /*done:*/ pdf_done, }; static void fim__init init_rd(void) { fim_load_register(&pdf_loader); } } #endif // ifdef HAVE_LIBPOPPLER fim-0.6-rc2/src/FbiStuffDjvu.cpp0000644000175000017500000001413514454347340013407 00000000000000/* $LastChangedDate: 2022-11-06 17:05:18 +0100 (Sun, 06 Nov 2022) $ */ /* FbiStuffDjvu.cpp : fim functions for decoding DJVU files (c) 2008-2022 Michele Martone based on code (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * this code should be fairly correct, although unfinished * */ #include #include #include #include "FbiStuff.h" #include "FbiStuffLoader.h" #ifdef HAVE_LIBDJVU extern "C" { #include } /* */ namespace fim { typedef char fim_libdjvu_char; extern CommandConsole cc; /* ---------------------------------------------------------------------- */ /* load */ struct djvu_state_t { DDJVUAPI ddjvu_context_t * dc; DDJVUAPI ddjvu_document_t * dd; ddjvu_page_t *dp; ddjvu_page_rotation_t rotation; ddjvu_rect_t rrect; ddjvu_rect_t prect; ddjvu_format_t * pf; int row_stride; /* physical row width in output buffer */ fim_byte_t * first_row_dst; }; /* ---------------------------------------------------------------------- */ /* djvu loader */ /* straight out from the DJVU API doc : */ void handle_ddjvu_messages(ddjvu_context_t *ctx, int wait) { const ddjvu_message_t *msg; if (wait) ddjvu_message_wait(ctx); while ((msg = ddjvu_message_peek(ctx))) { switch(msg->m_any.tag) { case DDJVU_ERROR: /*....*/ ; break; case DDJVU_INFO: /*....*/ ; break; case DDJVU_NEWSTREAM: /*....*/ ; break; // .... default: break; } ddjvu_message_pop(ctx); } } static void* djvu_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { struct djvu_state_t * ds=FIM_NULL; // static unsigned int masks[4] = { 0xff0000, 0xff00, 0xff, 0xff000000 }; const fim_int prdv=cc.getIntVariable(FIM_VID_PREFERRED_RENDERING_DPI); const fim_int prd=prdv<1?FIM_RENDERING_DPI:prdv; if(filename==std::string(FIM_STDIN_IMAGE_NAME)) { std::cerr<<"sorry, stdin multipage file reading is not supported\n"; goto ret; } /* a drivers' problem */ if(fp) fclose(fp); ds = (struct djvu_state_t*)fim_calloc(1,sizeof(struct djvu_state_t)); if(!ds) return FIM_NULL; ds->first_row_dst = FIM_NULL; ds->dc = ddjvu_context_create("fim"); if(!ds->dc)goto err; ds->dd = ddjvu_document_create_by_filename(ds->dc, filename, 0); if(!ds->dd)goto err; handle_ddjvu_messages(ds->dc,0x1/*0x0*/); i->npages = ddjvu_document_get_pagenum(ds->dd); if(page>=i->npages || page<0)goto err; ds->dp = ddjvu_page_create_by_pageno (ds->dd, page);/* pages, from 0 */ if(!ds->dp) goto err; while (!ddjvu_page_decoding_done (ds->dp)){/* we just kill time (FIXME : inefficient) */} ds->prect.w = ddjvu_page_get_width (ds->dp) ; ds->prect.h = ddjvu_page_get_height (ds->dp) ; #if 1 ddjvu_pageinfo_t pi; ddjvu_document_get_pageinfo(ds->dd,page,&pi); ds->prect.w = ((fim_scale_t) (ds->prect.w))* FIM_INT_SCALE_FRAC(prd,static_cast(pi.dpi)); ds->prect.h = ((fim_scale_t) (ds->prect.h))* FIM_INT_SCALE_FRAC(prd,static_cast(pi.dpi)); pi.dpi=prd; #endif if(ds->prect.w<1)goto err; if(ds->prect.h<1)goto err; ds->rotation = DDJVU_ROTATE_0; ddjvu_page_set_rotation (ds->dp, ds->rotation); ds->prect.x = 0; ds->prect.y = 0; ds->rrect = ds->prect; ds->row_stride=ds->prect.w * 3; i->width = ds->prect.w; i->height = ds->prect.h; i->dpi = pi.dpi; // ds->pf = ddjvu_format_create (DDJVU_FORMAT_RGBMASK32, 4, masks); ds->pf = ddjvu_format_create (DDJVU_FORMAT_RGB24, 0, 0); ddjvu_format_set_row_order (ds->pf, 1); if(!ds->pf) goto err; return ds; err: if(ds->dp)ddjvu_page_release(ds->dp); if(ds->dd)ddjvu_document_release(ds->dd); if(ds->dc)ddjvu_context_release(ds->dc); if(ds->pf)ddjvu_format_release(ds->pf); ret: return FIM_NULL; } static void djvu_read(fim_byte_t *dst, unsigned int line, void *data) { struct djvu_state_t *ds = (struct djvu_state_t*)data; if(!ds)return; if(ds->first_row_dst == FIM_NULL) ds->first_row_dst = dst; else return; int rs=ddjvu_page_render (ds->dp, DDJVU_RENDER_COLOR, & (ds->prect), & (ds->rrect), ds->pf, ds->row_stride, (fim_libdjvu_char*)dst); if(rs) ;/* FIXME: missing error handling */ return ; } static void djvu_done(void *data) { struct djvu_state_t *ds = (struct djvu_state_t*)data; if(ds->dp)ddjvu_page_release(ds->dp); if(ds->dd)ddjvu_document_release(ds->dd); if(ds->dc)ddjvu_context_release(ds->dc); if(ds->pf)ddjvu_format_release(ds->pf); fim_free(ds); } /* 0000000: 4154 2654 464f 524d 0070 ca79 444a 564d AT&TFORM.p.yDJVM 0000010: 4449 524d 0000 1465 8102 b900 0014 7e00 DIRM...e......~. */ static struct ida_loader djvu_loader = { /* magic: "DJV", moff: 12, mlen: 3,*/ /*magic:*/ "AT&TFORM",// FI/*XME :*/ are sure this is enough ? /*moff:*/ 0, /*mlen:*/ 8, /*name:*/ "libdjvu", /*init:*/ djvu_init, /*read:*/ djvu_read, /*done:*/ djvu_done, }; static void fim__init init_rd(void) { fim_load_register(&djvu_loader); } } #endif // ifdef HAVE_LIBDJVU fim-0.6-rc2/src/FbiStuff.cpp0000644000175000017500000022406414454347340012562 00000000000000/* $LastChangedDate: 2023-03-26 03:37:38 +0200 (Sun, 26 Mar 2023) $ */ /* FbiStuff.cpp : Misc fbi functions, modified for fim (c) 2008-2023 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * Much of this file derives originally from fbi and has not been properly refactored. * */ #include "fim.h" #include "fim_plugin.h" #include "common.h" #include /* va_list, va_arg, va_start, va_end */ #include /* fdopen, tmpfile */ #include /* execlp (popen is dangerous) */ #include /* mkstemp */ #include /* tempnam */ #include #if HAVE_SYS_WAIT_H #include /* waitpid */ #endif /* HAVE_SYS_WAIT_H */ #include /* memmem */ #include /* va_start, va_end, ... */ //#include // std::experimental::filesystem::temp_directory_path #if FIM_WITH_ARCHIVE #include #include //extern "C" { const char * archive_entry_pathname(struct archive_entry *); } #endif /* FIM_WITH_ARCHIVE */ #define FIM_HAVE_FULL_PROBING_LOADER 0 #ifdef HAVE_FMEMOPEN //#define FIM_SHALL_BUFFER_STDIN (HAVE_FMEMOPEN && FIM_READ_STDIN_IMAGE) /* FIXME: new */ #define FIM_SHALL_BUFFER_STDIN 0 /* FIXME: before activating this, we shall clean up some code first (e.g.: cc.fpush(), which is backed up by a temporary file) */ #else /* HAVE_FMEMOPEN */ #define FIM_SHALL_BUFFER_STDIN 0 #endif /* HAVE_FMEMOPEN */ #define FIM_WANTS_SLOW_RESIZE 1 #define FIM_WVMM 0 /* want verbose mip maps (for FIM_WANT_MIPMAPS) */ #define FIM_WFMM 1 /* want faster mip maps */ #define FIM_FBISTUFF_INSPECT 0 #if FIM_FBISTUFF_INSPECT #define FIM_PR(X) printf("FBISTUFF:%c:%20s\n",X,__func__); #else /* FIM_FBISTUFF_INSPECT */ #define FIM_PR(X) #endif /* FIM_FBISTUFF_INSPECT */ #define FIM_DD_DEBUG() FbiStuff::want_fbi_style_debug() #if FIM_WANT_CONSOLE_SWITCH_WHILE_LOADING #define FIM_FB_SWITCH_IF_NEEDED() cc.switch_if_needed() #else /* FIM_WANT_CONSOLE_SWITCH_WHILE_LOADING */ #define FIM_FB_SWITCH_IF_NEEDED() /* */ #endif /* FIM_WANT_CONSOLE_SWITCH_WHILE_LOADING */ #define FIM_MSG_WAIT_PIPING(CP) "please wait while piping through" " '" CP "'..." #define FIM_MSG_FAILED_PIPE(CP) "piping through" " '" CP "' failed." #define FIM_TEXTURED_ROTATION 0 namespace fim { extern CommandConsole cc; /* ----------------------------------------------------------------------- */ #if FIM_WANT_MIPMAPS static fim_err_t mipmap_compute(const fim_coo_t w, const fim_coo_t h, const int hw, const int hh, const fim_byte_t *FIM_RSTRCT src, fim_byte_t * FIM_RSTRCT dst, enum fim_mmo_t mmo) { fim_err_t errval = FIM_ERR_GENERIC; /* we compute a quarter of an image, half-sided */ if(hw<1||hh<1) { goto err; } #if FIM_WFMM /* 'internal' version: faster, fewer writes */ if(mmo == FIM_MMO_FASTER) for(fim_int hr=0;hri.width, h = src->i.height; /* the original */ mm.nmm=0; mm.mmo=mmp->mmo; mm.mmoffs[mm.nmm]=0; if(FIM_WVMM) std::cout << fbi_img_pixel_bytes(src) << " bytes are needed for the original image\n"; for(d=2;w>=d && h>=d && mm.nmm<=FIM_MAX_MIPMAPS ;d*=2) { mm.mmw[mm.nmm]=w/d; mm.mmh[mm.nmm]=h/d; mm.mmsize[mm.nmm]=(w/d)*(h/d)*3; mm.mmb+=mm.mmsize[mm.nmm]; mm.mmoffs[mm.nmm+1]=mm.mmb; ++mm.nmm; } if(FIM_WVMM) std::cout << mm.nmm << " mipmaps can be computed\n"; if(FIM_WVMM) std::cout << mm.mmb << " bytes are needed for the mipmaps\n"; if(mm.nmm<1) { goto err; } mm.mdp=(fim_byte_t*)fim_calloc(1,mm.mmb); if(!mm.mdp) { goto err; } if(mm.nmm) t0 = getmilliseconds(), mipmap_compute(w,h,w/2,h/2,src->data,mm.mdp+mm.mmoffs[0],mm.mmo); for(mmidx=1,d=2;mmidxdata + line * src->i.width * 3; memcpy(dst,scanline,src->i.width * 3); if (line < rect->y1 || line >= rect->y2) return; dst += 3*rect->x1; scanline += 3*rect->x1; for (i = rect->x1; i < rect->x2; i++) { g = (scanline[0]*30 + scanline[1]*59+scanline[2]*11)/100; dst[0] = g; dst[1] = g; dst[2] = g; scanline += 3; dst += 3; } } /* ----------------------------------------------------------------------- */ struct op_3x3_handle { struct op_3x3_parm filter; int *linebuf; }; static void* op_3x3_init(const struct ida_image *src, struct ida_rect *rect, struct ida_image_info *i, void *parm) { struct op_3x3_parm *args = (struct op_3x3_parm*)parm; struct op_3x3_handle *h; h = (struct op_3x3_handle*)fim_malloc(sizeof(*h)); if(!h)goto oops; memcpy(&h->filter,args,sizeof(*args)); h->linebuf = (int*)fim_malloc(sizeof(int)*3*(src->i.width)); if(!h->linebuf)goto oops; *i = src->i; return h; oops: if(h && h->linebuf)fim_free(h->linebuf); if(h)fim_free(h); return FIM_NULL; } static int inline op_3x3_calc_pixel(struct op_3x3_parm *p, fim_byte_t *s1, fim_byte_t *s2, fim_byte_t *s3) { int val = 0; val += p->f1[0] * s1[0]; val += p->f1[1] * s1[3]; val += p->f1[2] * s1[6]; val += p->f2[0] * s2[0]; val += p->f2[1] * s2[3]; val += p->f2[2] * s2[6]; val += p->f3[0] * s3[0]; val += p->f3[1] * s3[3]; val += p->f3[2] * s3[6]; if (p->mul && p->div) val = val * p->mul / p->div; val += p->add; return val; } static void op_3x3_calc_line(const struct ida_image *src, struct ida_rect *rect, int *dst, unsigned int line, struct op_3x3_parm *p) { fim_byte_t b1[9],b2[9],b3[9]; fim_byte_t *s1,*s2,*s3; unsigned int i,left,right; s1 = src->data + (line-1) * src->i.width * 3; s2 = src->data + line * src->i.width * 3; s3 = src->data + (line+1) * src->i.width * 3; if (0 == line) s1 = src->data + line * src->i.width * 3; if (src->i.height-1 == line) s3 = src->data + line * src->i.width * 3; left = rect->x1; right = rect->x2; if (0 == left) { /* left border special case: dup first col */ memcpy(b1,s1,3); memcpy(b2,s2,3); memcpy(b3,s3,3); memcpy(b1+3,s1,6); memcpy(b2+3,s2,6); memcpy(b3+3,s3,6); dst[0] = op_3x3_calc_pixel(p,b1,b2,b3); dst[1] = op_3x3_calc_pixel(p,b1+1,b2+1,b3+1); dst[2] = op_3x3_calc_pixel(p,b1+2,b2+2,b3+2); left++; } if (src->i.width == right) { /* right border */ memcpy(b1,s1+src->i.width*3-6,6); memcpy(b2,s2+src->i.width*3-6,6); memcpy(b3,s3+src->i.width*3-6,6); memcpy(b1+3,s1+src->i.width*3-3,3); memcpy(b2+3,s2+src->i.width*3-3,3); memcpy(b3+3,s3+src->i.width*3-3,3); dst[src->i.width*3-3] = op_3x3_calc_pixel(p,b1,b2,b3); dst[src->i.width*3-2] = op_3x3_calc_pixel(p,b1+1,b2+1,b3+1); dst[src->i.width*3-1] = op_3x3_calc_pixel(p,b1+2,b2+2,b3+2); right--; } dst += 3*left; s1 += 3*(left-1); s2 += 3*(left-1); s3 += 3*(left-1); for (i = left; i < right; i++) { dst[0] = op_3x3_calc_pixel(p,s1++,s2++,s3++); dst[1] = op_3x3_calc_pixel(p,s1++,s2++,s3++); dst[2] = op_3x3_calc_pixel(p,s1++,s2++,s3++); dst += 3; } } static void op_3x3_clip_line(fim_byte_t *dst, int *src, int left, int right) { int i,val; src += left*3; dst += left*3; for (i = left*3; i < right*3; i++) { val = *(src++); if (val < 0) val = 0; if (val > 255) val = 255; *(dst++) = val; } } static void op_3x3_work(const struct ida_image *src, struct ida_rect *rect, fim_byte_t *dst, int line, void *data) { struct op_3x3_handle *h = (struct op_3x3_handle *)data; fim_byte_t *scanline; scanline = (fim_byte_t*) src->data + line * src->i.width * 3; memcpy(dst,scanline,src->i.width * 3); if (line < rect->y1 || line >= rect->y2) return; op_3x3_calc_line(src,rect,h->linebuf,line,&h->filter); op_3x3_clip_line(dst,h->linebuf,rect->x1,rect->x2); } static void op_3x3_free(void *data) { struct op_3x3_handle *h = (struct op_3x3_handle *)data; fim_free(h->linebuf); fim_free(h); } /* ----------------------------------------------------------------------- */ struct op_sharpe_handle { int factor; int *linebuf; }; static void* op_sharpe_init(const struct ida_image *src, struct ida_rect *rect, struct ida_image_info *i, void *parm) { struct op_sharpe_parm *args = (struct op_sharpe_parm *)parm; struct op_sharpe_handle *h; h = (struct op_sharpe_handle *)fim_calloc(1,sizeof(*h)); if(!h)goto oops; h->factor = args->factor; h->linebuf = (int *)fim_malloc(sizeof(int)*3*(src->i.width)); if(!h->linebuf)goto oops; *i = src->i; return h; oops: if(h && h->linebuf)fim_free(h->linebuf); if(h)fim_free(h); return FIM_NULL; } static void op_sharpe_work(const struct ida_image *src, struct ida_rect *rect, fim_byte_t *dst, int line, void *data) { static struct op_3x3_parm laplace = { /* f1: { 1, 1, 1 }, f2: { 1, -8, 1 }, f3: { 1, 1, 1 },*/ { 1, 1, 1 }, { 1, -8, 1 }, { 1, 1, 1 }, 0,0,0 }; struct op_sharpe_handle *h = (struct op_sharpe_handle *)data; fim_byte_t *scanline; int i; scanline = src->data + line * src->i.width * 3; memcpy(dst,scanline,src->i.width * 3); if (line < rect->y1 || line >= rect->y2) return; op_3x3_calc_line(src,rect,h->linebuf,line,&laplace); for (i = rect->x1*3; i < rect->x2*3; i++) h->linebuf[i] = scanline[i] - h->linebuf[i] * h->factor / 256; op_3x3_clip_line(dst,h->linebuf,rect->x1,rect->x2); } static void op_sharpe_free(void *data) { struct op_sharpe_handle *h = (struct op_sharpe_handle *)data; fim_free(h->linebuf); fim_free(h); } #endif /* FIM_WANT_OBSOLETE */ /* ----------------------------------------------------------------------- */ struct op_resize_state { float xscale,yscale,inleft; float *rowbuf; unsigned int width,height,srcrow; }; static void* op_resize_init(const struct ida_image *src, struct ida_rect *rect, struct ida_image_info *i, void *parm) { struct op_resize_parm *args = (struct op_resize_parm *)parm; struct op_resize_state *h; h = (struct op_resize_state *)fim_calloc(1,sizeof(*h)); if(!h) goto oops; h->width = args->width; h->height = args->height; h->xscale = (float)args->width/src->i.width; h->yscale = (float)args->height/src->i.height; h->rowbuf = (float*)fim_malloc(src->i.width * 3 * sizeof(float)); if(!h->rowbuf) goto oops; h->srcrow = 0; h->inleft = 1; *i = src->i; i->width = args->width; i->height = args->height; i->dpi = args->dpi; return h; oops: if(h) fim_free(h); return FIM_NULL; } #if FIM_WANT_OBSOLETE #define FIM_HAS_MISC_FBI_OPS 1 #ifdef FIM_HAS_MISC_FBI_OPS static void op_resize_work_row_expand(struct ida_image *src, struct ida_rect *rect, fim_byte_t *dst, int line, void *data) { struct op_resize_state *h = (struct op_resize_state *)data; //#ifndef FIM_WANTS_SLOW_RESIZE /*uncommenting this triggers failure */ const int sr=abs((int)h->srcrow); //who knows //#endif /* FIM_WANTS_SLOW_RESIZE */ fim_byte_t* srcline=src->data+src->i.width*3*(sr); const int Mdx=h->width; FIM_REGISTER int sx=0,dx=0; /* * this gives a ~ 50% gain * */ float d0f=0.0,d1f=0.0; int d0i=0,d1i=0; if(src->i.width) for (sx=0;sx<(int)src->i.width-1;++sx ) { d1f+=h->xscale; d1i=(unsigned int)d1f; sx*=3; for (dx=d0i;dx<(int)d1i;++dx )//d1i < Mdx { dst[3*dx+0] = srcline[ sx ]; dst[3*dx+1] = srcline[ sx+1]; dst[3*dx+2] = srcline[ sx+2] ; } sx/=3; d0f=d1f; d0i=(unsigned int)d0f; } { // contour fix sx*=3; for (dx=d0i;dxheight-1)for (dx=0;dxdata+src->i.width*3*(sr); const int Mdx=h->width; FIM_REGISTER int sx=0,dx=0; /* * interleaved loop unrolling .. * this gives a ~ 50% gain * */ float d0f=0.0,d1f=0.0; int d0i=0,d1i=0; if(src->i.width) for ( ;sx<(int)src->i.width-1-4;sx+=4) { d1f+=h->xscale; d1i=(unsigned int)d1f; sx*=3; for (dx=d0i;dxxscale; d1i=(unsigned int)d1f; sx+=3; for (dx=d0i;dxxscale; d1i=(unsigned int)d1f; sx+=3; for (dx=d0i;dxxscale; d1i=(unsigned int)d1f; sx+=3; for (dx=d0i;dxi.width ;++sx) { d1f+=h->xscale; d1i=(unsigned int)d1f; // contour fix for (dx=d0i;dxheight-1)for (dx=0;dxdata+src->i.width*3*(sr); const int Mdx=h->width; FIM_REGISTER int sx=0,dx=0; /* * this gives a ~ 70% gain * */ float d0f=0.0,d1f=0.0; int d0i=0,d1i=0; if(src->i.width) for ( ;sx<(int)src->i.width;++sx ) { d1f+=h->xscale; d1i=(unsigned int)d1f; FIM_REGISTER fim_byte_t r,g,b; r=srcline[ 3*sx+ 0]; g=srcline[ 3*sx+ 1]; b=srcline[ 3*sx+ 2]; for (dx=d0i;dxi.width-1; for (dx=d0i;dxheight-1)for (dx=0;dxdata+src->i.width*3*(sr); const int Mdx=h->width; FIM_REGISTER int sx=0,dx=0; /* * this gives a ~ 60% gain * */ float d0f=0.0,d1f=0.0; int d0i=0,d1i=0; if(src->i.width) for ( ;sx<(int)src->i.width-1;++sx ) { d1f+=h->xscale; d1i=(unsigned int)d1f; FIM_REGISTER fim_byte_t r,g,b; r=srcline[ 3*sx+ 0]; g=srcline[ 3*sx+ 1]; b=srcline[ 3*sx+ 2]; for (dx=d0i;FIM_LIKELY(dxheight-1)for (dx=0;dxrowbuf; #ifndef FIM_WANTS_SLOW_RESIZE const int sr=abs((int)h->srcrow); //who knows #endif /* FIM_WANTS_SLOW_RESIZE */ /* scale y */ fim_bzero(rowbuf, src->i.width * 3 * sizeof(float)); outleft = 1/h->yscale; while (outleft > 0 && h->srcrow < src->i.height) { if (outleft < h->inleft) { weight = outleft * h->yscale; h->inleft -= outleft; outleft = 0; } else { weight = h->inleft * h->yscale; outleft -= h->inleft; h->inleft = 0; } #if 0 if(FIM_DD_DEBUG()) FIM_FBI_PRINTF("y: %6.2f%%: %d/%d => %d/%d\n", weight*100,h->srcrow,src->height,line,h->height); #endif csrcline = src->data + h->srcrow * src->i.width * 3; for (i = 0; i < src->i.width * 3; i++) rowbuf[i] += (float)csrcline[i] * weight; if (0 == h->inleft) { h->inleft = 1; h->srcrow++; } } #ifndef FIM_WANTS_SLOW_RESIZE /* * a little tweaked resize : the following loop takes the most of cpu resources in a typical fim run! */ /* scale x */ left = 1.0f; fsrcline = h->rowbuf; const float c_outleft = 1.0f/h->xscale; // cout << "c_outleft : " << c_outleft << "\n"; // cout << "h->width : " << (int)h->width << "\n"; const unsigned int Mdx=h->width,msx=src->i.width; if(h->xscale>1.0)//here we handle the case of magnification { #ifdef FIM_WANTS_SLOW_RESIZE fim_byte_t*FIM_RSTRCT srcline=src->data+src->i.width*3*(sr); #endif /* FIM_WANTS_SLOW_RESIZE */ #ifndef FIM_WANTS_SLOW_RESIZE if(h->xscale>2.0) { if(h->xscale>4.0) op_resize_work_unrolled4_row_expand( src, rect, dst, line, data, sr); else op_resize_work_unrolled2_row_expand( src, rect, dst, line, data, sr); } else op_resize_work_row_expand_i_unrolled( src, rect, dst, line, data, sr); #if FIM_WANT_OBSOLETE // op_resize_work_row_expand( src, rect, dst, line, data); #endif /* FIM_WANT_OBSOLETE */ #else /* FIM_WANTS_SLOW_RESIZE */ float fsx=0.0; for (sx=0,dx=0; dxi.width;// % is essential dst[0] = srcline[3*sx]; dst[1] = srcline[3*sx+1]; dst[2] = srcline[3*sx+2] ; dst += 3; #else fsx+=c_outleft; sx=((unsigned int)fsx)%src->i.width;// % is (maybe) essential dst[0] = (fim_byte_t) fsrcline[3*sx]; dst[1] = (fim_byte_t) fsrcline[3*sx+1]; dst[2] = (fim_byte_t) fsrcline[3*sx+2] ; dst += 3; #endif } #endif /* FIM_WANTS_SLOW_RESIZE */ } #define ZEROF 0.0f else // image minification for (sx = 0, dx = 0; dx < Mdx; dx++) { d0 = d1 = d2 = ZEROF; outleft = c_outleft; while (outleft > ZEROF && sx < msx) { if (outleft < left) { weight = outleft * h->xscale; left -= outleft; outleft = ZEROF; } else { weight = left * h->xscale; outleft -= left; left = ZEROF; } d0 += fsrcline[3*sx] * weight; d1 += fsrcline[3*sx+1] * weight; d2 += fsrcline[3*sx+2] * weight; if (ZEROF == left) { left = 1.0f; sx++; } } dst[0] = (fim_byte_t)d0; dst[1] = (fim_byte_t)d1; dst[2] = (fim_byte_t)d2; dst += 3; } return ; #else /* the original, slow cycle */ /* scale x */ left = 1; fsrcline = h->rowbuf; for (sx = 0, dx = 0; dx < h->width; dx++) { d0 = d1 = d2 = 0; outleft = 1/h->xscale; while (outleft > 0 && dx < h->width && sx < src->i.width) { if (outleft < left) { weight = outleft * h->xscale; left -= outleft; outleft = 0; } else { weight = left * h->xscale; outleft -= left; left = 0; } #if 0 if(FIM_DD_DEBUG()) FIM_FBI_PRINTF(" x: %6.2f%%: %d/%d => %d/%d\n", weight*100,sx,src->width,dx,h->width); #endif d0 += fsrcline[3*sx+0] * weight; d1 += fsrcline[3*sx+1] * weight; d2 += fsrcline[3*sx+2] * weight; if (0 == left) { left = 1; sx++; } } dst[0] = (fim_byte_t)d0; dst[1] = (fim_byte_t)d1; dst[2] = (fim_byte_t)d2; dst += 3; } #endif /* FIM_WANTS_SLOW_RESIZE */ } static void op_resize_done(void *data) { struct op_resize_state *h = (struct op_resize_state *)data; fim_free(h->rowbuf); fim_free(h); } /* ----------------------------------------------------------------------- */ struct op_rotate_state { float angle,sina,cosa; struct ida_rect calc; int cx,cy; }; static void* op_rotate_init(const struct ida_image *src, struct ida_rect *rect, struct ida_image_info *i, void *parm) { struct op_rotate_parm *args = (struct op_rotate_parm *)parm; struct op_rotate_state *h; float diag; h = (struct op_rotate_state *)fim_malloc(sizeof(*h)); if(!h)return FIM_NULL; /* fim's : FIXME : FIM_NULL check missing */ h->angle = args->angle * 2 * M_PI / 360; h->sina = sin(h->angle); h->cosa = cos(h->angle); /* fim's : cX means source center's X */ h->cx = (rect->x2 - rect->x1) / 2 + rect->x1; h->cy = (rect->y2 - rect->y1) / 2 + rect->y1; /* the area we have to process (worst case: 45°) */ diag = sqrt((rect->x2 - rect->x1)*(rect->x2 - rect->x1) + (rect->y2 - rect->y1)*(rect->y2 - rect->y1))/2; /* fim's : diag is a half diagonal */ /* fim's : calc is the source input rectangle bounded * by source image valid coordinates ... */ h->calc.x1 = (int)(h->cx - diag); h->calc.x2 = (int)(h->cx + diag); h->calc.y1 = (int)(h->cy - diag); h->calc.y2 = (int)(h->cy + diag); if (h->calc.x1 < 0) h->calc.x1 = 0; if (h->calc.x2 > (int)src->i.width) h->calc.x2 = (int)src->i.width; if (h->calc.y1 < 0) h->calc.y1 = 0; if (h->calc.y2 > (int)src->i.height) h->calc.y2 = (int)src->i.height; *i = src->i; /* TODO : it would be nice to expand and contract * the whole canvas just to fit the rotated image in ! * */ return h; } static inline const fim_byte_t* const op_rotate_getpixel(const struct ida_image *src, struct ida_rect *rect, int sx, int sy, int dx, int dy) { static const fim_byte_t black[] = { 0, 0, 0}; #if FIM_TEXTURED_ROTATION const int xdiff = rect->x2 - rect->x1; const int ydiff = rect->y2 - rect->y1; #endif if (sx < rect->x1 || sx >= rect->x2 || sy < rect->y1 || sy >= rect->y2) { #if FIM_TEXTURED_ROTATION /* experimental : textured rotation (i.e.: with wrapping) */ while(sx < rect->x1)sx+=xdiff; while(sx >= rect->x2)sx-=xdiff; while(sy < rect->y1)sy+=ydiff; while(sy >= rect->y2)sy-=ydiff; return src->data + sy * src->i.width * 3 + sx * 3; #else /* original */ if (dx < rect->x1 || dx >= rect->x2 || dy < rect->y1 || dy >= rect->y2) return src->data + dy * src->i.width * 3 + dx * 3; return black; #endif } return src->data + sy * src->i.width * 3 + sx * 3; } static void op_rotate_work(const struct ida_image *src, struct ida_rect *rect, fim_byte_t *dst, int y, void *data) { struct op_rotate_state *h = (struct op_rotate_state *) data; const fim_byte_t *pix; float fx,fy,w; int x,sx,sy; pix = src->data + y * src->i.width * 3; /* * useless (fim) * memcpy(dst,pix,src->i.width * 3); */ if (y < h->calc.y1 || y >= h->calc.y2) return; /* fx = h->cosa * (0 - h->cx) - h->sina * (y - h->cy) + h->cx; sx = (int)fx; sx *= 0; dst += 3*(h->calc.x1+sx);*/ fim_bzero(dst, (h->calc.x2-h->calc.x1) * 3); for (x = h->calc.x1; x < h->calc.x2; x++, dst+=3) { fx = h->cosa * (x - h->cx) - h->sina * (y - h->cy) + h->cx; fy = h->sina * (x - h->cx) + h->cosa * (y - h->cy) + h->cy; sx = (int)fx; sy = (int)fy; if (fx < 0) sx--; if (fy < 0) sy--; fx -= sx; fy -= sy; pix = op_rotate_getpixel(src,rect,sx,sy,x,y); w = (1-fx) * (1-fy); dst[0] += (fim_byte_t)(pix[0] * w); dst[1] += (fim_byte_t)(pix[1] * w); dst[2] += (fim_byte_t)(pix[2] * w); pix = op_rotate_getpixel(src,rect,sx+1,sy,x,y); w = fx * (1-fy); dst[0] += (fim_byte_t)(pix[0] * w); dst[1] += (fim_byte_t)(pix[1] * w); dst[2] += (fim_byte_t)(pix[2] * w); pix = op_rotate_getpixel(src,rect,sx,sy+1,x,y); w = (1-fx) * fy; dst[0] += (fim_byte_t)(pix[0] * w); dst[1] += (fim_byte_t)(pix[1] * w); dst[2] += (fim_byte_t)(pix[2] * w); pix = op_rotate_getpixel(src,rect,sx+1,sy+1,x,y); w = fx * fy; dst[0] += (fim_byte_t)(pix[0] * w); dst[1] += (fim_byte_t)(pix[1] * w); dst[2] += (fim_byte_t)(pix[2] * w); } } static void op_rotate_done(void *data) { struct op_rotate_state *h = (struct op_rotate_state *)data; fim_free(h); } /* ----------------------------------------------------------------------- */ void op_none_done(void *data) {} #if FIM_WANT_OBSOLETE static fim_byte_t op_none_data; void* op_none_init(const struct ida_image *src, struct ida_rect *sel, struct ida_image_info *i, void *parm) { *i = src->i; return &op_none_data; } /* ----------------------------------------------------------------------- */ struct ida_op desc_grayscale = { /*name:*/ "grayscale", /*init:*/ op_none_init, /*work:*/ op_grayscale, /*done:*/ op_none_done, }; struct ida_op desc_3x3 = { /*name:*/ "3x3", /*init:*/ op_3x3_init, /*work:*/ op_3x3_work, /*done:*/ op_3x3_free, }; struct ida_op desc_sharpe = { /*name:*/ "sharpe", /*init:*/ op_sharpe_init, /*work:*/ op_sharpe_work, /*done:*/ op_sharpe_free, }; #endif /* FIM_WANT_OBSOLETE */ struct ida_op desc_resize = { /*name:*/ "resize", /*init:*/ op_resize_init, /*work:*/ op_resize_work, /*done:*/ op_resize_done, }; struct ida_op desc_rotate = { /*name:*/ "rotate", /*init:*/ op_rotate_init, /*work:*/ op_rotate_work, /*done:*/ op_rotate_done, }; // end filter.c // // op.c #include #include #include /* ----------------------------------------------------------------------- */ /* functions */ static fim_byte_t op_none_data_; #if FIM_WANT_OBSOLETE static void op_flip_vert_(const struct ida_image *src, struct ida_rect *rect, fim_byte_t *dst, int line, void *data) { fim_byte_t *scanline; scanline = (fim_byte_t*)src->data + (src->i.height - line - 1) * src->i.width * 3; memcpy(dst,scanline,src->i.width*3); } static void op_flip_horz_(const struct ida_image *src, struct ida_rect *rect, fim_byte_t *dst, int line, void *data) { fim_byte_t *scanline; unsigned int i; scanline = (fim_byte_t*)src->data + (line+1) * src->i.width * 3; for (i = 0; i < src->i.width; i++) { scanline -= 3; dst[0] = scanline[0]; dst[1] = scanline[1]; dst[2] = scanline[2]; dst += 3; } } #endif /* FIM_WANT_OBSOLETE */ static void* op_rotate_init_(const struct ida_image *src, struct ida_rect *rect, struct ida_image_info *i, void *parm) { *i = src->i; i->height = src->i.width; i->width = src->i.height; i->dpi = src->i.dpi; return &op_none_data_; } static void op_rotate_cw_(const struct ida_image *src, struct ida_rect *rect, fim_byte_t *dst, int line, void *data) { fim_byte_t *pix; unsigned int i; pix = (fim_byte_t*) src->data + fbi_img_pixel_bytes(src) + line * 3; for (i = 0; i < src->i.height; i++) { pix -= src->i.width * 3; dst[0] = pix[0]; dst[1] = pix[1]; dst[2] = pix[2]; dst += 3; } } static void op_rotate_ccw_(const struct ida_image *src, struct ida_rect *rect, fim_byte_t *dst, int line, void *data) { fim_byte_t *pix; unsigned int i; pix = (fim_byte_t*) src->data + (src->i.width-line-1) * 3; for (i = 0; i < src->i.height; i++) { dst[0] = pix[0]; dst[1] = pix[1]; dst[2] = pix[2]; pix += src->i.width * 3; dst += 3; } } #if FIM_WANT_OBSOLETE static void op_invert_(const struct ida_image *src, struct ida_rect *rect, fim_byte_t *dst, int line, void *data) { fim_byte_t *scanline; int i; scanline = src->data + line * src->i.width * 3; memcpy(dst,scanline,src->i.width * 3); if (line < rect->y1 || line >= rect->y2) return; dst += 3*rect->x1; scanline += 3*rect->x1; for (i = rect->x1; i < rect->x2; i++) { dst[0] = 255-scanline[0]; dst[1] = 255-scanline[1]; dst[2] = 255-scanline[2]; scanline += 3; dst += 3; } } #endif /* FIM_WANT_OBSOLETE */ #if FIM_WANT_CROP static void* op_crop_init_(const struct ida_image *src, struct ida_rect *rect, struct ida_image_info *i, void *parm) { if (rect->x2 - rect->x1 == (int)src->i.width && rect->y2 - rect->y1 == (int)src->i.height) return FIM_NULL; *i = src->i; i->width = rect->x2 - rect->x1; i->height = rect->y2 - rect->y1; return &op_none_data_; } static void op_crop_work_(const struct ida_image *src, struct ida_rect *rect, fim_byte_t *dst, int line, void *data) { fim_byte_t *scanline; int i; scanline = src->data + (line+rect->y1) * src->i.width * 3 + rect->x1 * 3; for (i = rect->x1; i < rect->x2; i++) { dst[0] = scanline[0]; dst[1] = scanline[1]; dst[2] = scanline[2]; scanline += 3; dst += 3; } } #endif /* FIM_WANT_CROP */ #if FIM_WANT_OBSOLETE static void* op_autocrop_init_(const struct ida_image *src, struct ida_rect *unused, struct ida_image_info *i, void *parm) { #ifdef FIM_USE_DESIGNATED_INITIALIZERS static struct op_3x3_parm filter = { /*f1:*/ { -1, -1, -1 }, /*f2:*/ { -1, 8, -1 }, /*f3:*/ { -1, -1, -1 }, }; #else /* I have no quick fix for this ! (m.m.) * However, designated initializers are a a C99 construct * and are usually tolerated by g++. * */ static struct op_3x3_parm filter = { /*f1:*/ { -1, -1, -1 }, /*f2:*/ { -1, 8, -1 }, /*f3:*/ { -1, -1, -1 }, }; #endif /* FIM_USE_DESIGNATED_INITIALIZERS */ struct ida_rect rect; struct ida_image img; int x,y,limit; fim_byte_t *line; void *data; /* detect edges */ rect.x1 = 0; rect.x2 = src->i.width; rect.y1 = 0; rect.y2 = src->i.height; data = desc_3x3.init(src, &rect, &img.i, &filter); img.data = fim_pm_alloc(img.i.width, img.i.height); if(!img.data)return FIM_NULL; for (y = 0; y < (int)img.i.height; y++) desc_3x3.work(src, &rect, img.data+3*img.i.width*y, y, data); desc_3x3.done(data); limit = 64; /* y border */ for (y = 0; y < (int)img.i.height; y++) { line = img.data + img.i.width*y*3; for (x = 0; x < (int)img.i.width; x++) if (line[3*x+0] > limit || line[3*x+1] > limit || line[3*x+2] > limit) break; if (x != (int)img.i.width) break; } rect.y1 = y; for (y = (int)img.i.height-1; y > rect.y1; y--) { line = img.data + img.i.width*y*3; for (x = 0; x < (int)img.i.width; x++) if (line[3*x+0] > limit || line[3*x+1] > limit || line[3*x+2] > limit) break; if (x != (int)img.i.width) break; } rect.y2 = y+1; /* x border */ for (x = 0; x < (int)img.i.width; x++) { for (y = 0; y < (int)img.i.height; y++) { line = img.data + (img.i.width*y+x) * 3; if (line[0] > limit || line[1] > limit || line[2] > limit) break; } if (y != (int)img.i.height) break; } rect.x1 = x; for (x = (int)img.i.width-1; x > rect.x1; x--) { for (y = 0; y < (int)img.i.height; y++) { line = img.data + (img.i.width*y+x) * 3; if (line[0] > limit || line[1] > limit || line[2] > limit) break; } if (y != (int)img.i.height) break; } rect.x2 = x+1; fim_free(img.data); #if 0 /* Disabled 20151213 */ if(FIM_DD_DEBUG()) FIM_FBI_PRINTF("y: %d-%d/%d -- x: %d-%d/%d\n", rect.y1, rect.y2, img.i.height, rect.x1, rect.x2, img.i.width); #endif if (0 == rect.x2 - rect.x1 || 0 == rect.y2 - rect.y1) return FIM_NULL; *unused = rect; *i = src->i; i->width = rect.x2 - rect.x1; i->height = rect.y2 - rect.y1; return &op_none_data_; } /* ----------------------------------------------------------------------- */ void op_free_done(void *data) { fim_free(data); } #endif /* FIM_WANT_OBSOLETE */ /* ----------------------------------------------------------------------- */ #if FIM_WANT_OBSOLETE struct ida_op desc_flip_vert = { /*name:*/ "flip-vert", /*init:*/ op_none_init, /*work:*/ op_flip_vert_, /*done:*/ op_none_done, }; struct ida_op desc_flip_horz = { /*name:*/ "flip-horz", /*init:*/ op_none_init, /*work:*/ op_flip_horz_, /*done:*/ op_none_done, }; #endif /* FIM_WANT_OBSOLETE */ struct ida_op desc_rotate_cw = { /*name:*/ "rotate-cw", /*init:*/ op_rotate_init_, /*work:*/ op_rotate_cw_, /*done:*/ op_none_done, }; struct ida_op desc_rotate_ccw = { /*name:*/ "rotate-ccw", /*init:*/ op_rotate_init_, /*work:*/ op_rotate_ccw_, /*done:*/ op_none_done, }; #if FIM_WANT_OBSOLETE struct ida_op desc_invert = { /*name:*/ "invert", /*init:*/ op_none_init, /*work:*/ op_invert_, /*done:*/ op_none_done, }; #endif /* FIM_WANT_OBSOLETE */ #if FIM_WANT_CROP struct ida_op desc_crop = { /*name:*/ "crop", /*init:*/ op_crop_init_, /*work:*/ op_crop_work_, /*done:*/ op_none_done, }; #endif /* FIM_WANT_CROP */ #if FIM_WANT_OBSOLETE struct ida_op desc_autocrop = { /*name:*/ "autocrop", /*init:*/ op_autocrop_init_, /*work:*/ op_crop_work_, /*done:*/ op_none_done, }; #endif /* FIM_WANT_OBSOLETE */ // end op.c #include #include #include #include #ifdef USE_X11 #include "viewer.h" #endif /* USE_X11 */ /* ---------------------------------------------------------------------- */ /* load */ #ifdef HAVE_LIBGRAPHICSMAGICK extern struct ida_loader magick_loader ; #endif /* HAVE_LIBGRAPHICSMAGICK */ #ifdef FIM_WITH_LIBPNG extern struct ida_loader png_loader ; #endif /* FIM_WITH_LIBPNG */ extern struct ida_loader ppm_loader ; extern struct ida_loader pgm_loader ; #if FIM_WANT_TEXT_RENDERING extern struct ida_loader text_loader ; #endif /* FIM_WANT_TEXT_RENDERING */ #if FIM_WANT_RAW_BITS_RENDERING extern struct ida_loader bit24_loader ; extern struct ida_loader bit1_loader ; #endif /* FIM_WANT_RAW_BITS_RENDERING */ #if FIM_WITH_UFRAW extern struct ida_loader nef_loader ; #endif /* FIM_WITH_UFRAW */ // 20080108 WARNING // 20080801 removed the loader functions from this file, as init_rd was not fim__init : did I break something ? //static void fim__init init_rd(void) /*static void init_rd(void) { fim_load_register(&ppm_loader); fim_load_register(&pgm_loader); }*/ #ifdef USE_X11 /* ---------------------------------------------------------------------- */ /* save */ static int ppm_write(FILE *fp, struct ida_image *img) { fprintf(fp,"P6\n" "# written by ida " VERSION "\n" "# http://bytesex.org/ida/\n" "%d %d\n255\n", img->i.width,img->i.height); fwrite(img->data, img->i.height, 3*img->i.width, fp); return 0; } static struct ida_writer ppm_writer = { /* label:*/ "PPM", /* ext:*/ { "ppm", FIM_NULL}, /* write:*/ ppm_write, /* FIXME : still missing some struct members */ }; // 20080108 WARNING //static void fim__init init_wr(void) static void init_wr(void) { fim_write_register(&ppm_writer); } #endif /* USE_X11 */ /*static void free_image(struct ida_image *img)*/ void FbiStuff::free_image(struct ida_image *img) { if (img) { if (img->data) fim_free(img->data); fim_free(img); } } FILE* FbiStuff::fim_execlp(const fim_char_t *cmd, ...) { #if HAVE_PIPE /* new */ va_list ap; int rc; FILE *fp=FIM_NULL; int p[2]; #define FIM_SUBPROCESS_MAXARGV 128 fim_char_t * argv[FIM_SUBPROCESS_MAXARGV],*s; /* FIXME */ int argc=0; if(0!=pipe(p)) goto err; switch(pid_t pid = fork()) { case -1: fim_perror("fork"); close(p[0]); close(p[1]); goto err; // FIXME case 0:/* child */ dup2(p[1],1/*stdout*/); close(p[0]); close(p[1]); va_start(ap,cmd); while(FIM_NULL!=(s=va_arg(ap,fim_char_t*)) && argcbl) { goto err; } if(base_offset) { if(fim_fseek(fp,base_offset,SEEK_SET)!=0) goto err; goff=base_offset; } else goff+=ftell(fp); while((rb=fim_fread(buf+boff,1,bl-boff,fp))>0) { if(memmem(buf,rb+boff,byte_stream,sl)) return goff+(((fim_char_t*)memmem(buf,rb+boff,byte_stream,sl))-buf); if(rb+boff 1 ) tfn = FIM_TMP_FILENAME; else #endif /* FIM_TMP_FILENAME */ { char * const tn = tempnam(NULL,tsfx.c_str()); // deprecated tfn = tn; free(tn); //tfn = std::string(std::experimental::filesystem::temp_directory_path()); //tfn = tmpnam(NULL); // deprecated // std::cout << "using temporary file:" << tfn << std::endl; } return tfn; } /*static struct ida_image**/ struct ida_image* FbiStuff::read_image(const fim_char_t *filename, FILE* fd, fim_int page, Namespace *nsp) { /* * This function is complicated and should be reworked, in some way. * FIXME : many memory allocations are not checked for failure: DANGER * */ #ifdef FIM_TRY_INKSCAPE #ifdef FIM_WITH_LIBPNG #if FIM_USE_CXX11 const char * xmlh = R"***(0 && pn[strlen(pn)-1] != FIM_CNS_DIRSEP_CHAR ) /* skip directories */ { //std::cout << re << " " << pi << " " << pn << " " << page << ".\n"; // FIXME if(pi == page) { static int fap[2]; if(vl) printf("Opening page %d of %s, subfile %s\n",(int)page,filename,pn); //archive_read_data_into_fd(a,1); if(0) { const void *buff = FIM_NULL; int64_t offset = 0; size_t tsize = 0, size = 0; if( 0 != pipe2(fap,O_NONBLOCK) ) //if( 0 != pipe(fap) ) goto noa; printf("Pipe to %s\n",pn); tsize = 0, size = 0; for (;;) { r = archive_read_data_block(a, &buff, &size, &offset); if (r == ARCHIVE_EOF) break; if (r != ARCHIVE_OK) break; write(fap[1],buff,size); tsize += size; // ... } printf("piped %zd bytes\n",(size_t)tsize); close(fap[1]); fp = fdopen(fap[0],"r"); fd = FIM_NULL; fp = fim_fread_tmpfile(fp); // FIXME: a pipe saturates quickly (at 64 k on recent Linux...) close(fap[0]); } else { FILE *tfd=FIM_NULL; if( ( tfd=tmpfile() )!=FIM_NULL ) { const int tfp = fileno(tfd); r = archive_read_data_into_fd(a,tfp); rewind(tfd); fd = FIM_NULL; fp = tfd; } else { std::cout << "Problem opening embedded file!\n"; // FIXME archive_read_data_skip(a); } } filename = FIM_STDIN_IMAGE_NAME; } else { //archive_read_data_skip(a); if(vl)printf("SKIPPING MATCHING [%d/%d] %s in %s\n",(int)pi,(int)page,pn,filename); } ++pi; } else { if(vl)printf("SKIPPING NON MATCHING [%d/%d] %s in %s\n",(int)pi,(int)page,pn,filename); //archive_read_data_skip(a); } } archive_read_close(a); archive_read_free(a); noa: 1; } #endif /* FIM_WITH_ARCHIVE */ read_offset_l = cc.getIntVariable(FIM_VID_OPEN_OFFSET_L); read_offset_u = read_offset_l + cc.getIntVariable(FIM_VID_OPEN_OFFSET_U); read_offset_u = FIM_MAX(read_offset_l,read_offset_u); if(vl) { if(read_offset_l||read_offset_u) FIM_VERB_COUT << "..found at " << read_offset_l << ":" << read_offset_u << "\n"; else FIM_VERB_PRINTF("no file seek range specified\n"); } with_offset: if(read_offset_l>0) fim_fseek(fp,read_offset_l,SEEK_SET); #ifdef FIM_WANT_SEEK_MAGIC std::string sm = cc.getStringVariable(FIM_VID_SEEK_MAGIC); if( int sl = sm.length() ) { /* the user should be able to specify a magic string like: sm="\xFF\xD8\xFF\xE0"; */ if(vl>0)FIM_VERB_PRINTF("probing file signature (long %d) \"%s\"..\n",sl,sm.c_str()); const long regexp_offset = find_byte_stream(fp, sm.c_str(), read_offset_l); if(regexp_offset>0) { read_offset_l=regexp_offset; read_offset_u=read_offset_l+sl; if(vl>0) FIM_VERB_COUT << "..found at " << read_offset_l << ":" << read_offset_u << "\n"; fim_fseek(fp,read_offset_l,SEEK_SET); cc.setVariable(FIM_VID_SEEK_MAGIC,""); } } #endif /* FIM_WANT_SEEK_MAGIC */ fim_bzero(blk,sizeof(blk)); if((fr=fim_fread(blk,1,sizeof(blk),fp))<0) { /* should we care about the error code ? */ return FIM_NULL; /* new */ } if(fr < sizeof(blk)) // FIXME: shall compare to min(sizeof(blk),filesize) { if(fr == 0) { std::cerr << "Reading an empty file ?\n"; // FIXME: need to handle this case. //goto ret; } else { // std::cout << "Read only " << fr << " bytes for block probing!\n"; // FIXME: tolerating and going further, for now (it might be a tiny file). // goto ret; } } fim_rewind(fp); if(read_offset_l>0) fim_fseek(fp,read_offset_l,SEEK_SET); #ifdef FIM_TRY_CONVERT if(strcmp(filename,FIM_STDIN_IMAGE_NAME)!=0) if( pc != FIM_CNS_EMPTY_STRING ) if( loader==FIM_NULL && can_pipe ) { fim::string fpc = pc; fpc.substitute("[{][}]",filename); fpc += " | convert - ppm:" + tpfn; if(vl)FIM_VERB_PRINTF("About to use: %s\n", fpc.c_str()); cc.set_status_bar(FIM_MSG_WAIT_PIPING(+fpc+), "*"); std::system(fpc); if (FIM_NULL == (fp = fim_fopen(tpfn,"r"))) cc.set_status_bar(FIM_MSG_FAILED_PIPE(+pc+), "*"); else { unlink(tpfn); loader = &ppm_loader; if(nsp) nsp->setVariable(FIM_VID_FILE_BUFFERED_FROM,tpfn); goto found_a_loader; } } #endif /* FIM_TRY_CONVERT */ #if FIM_WITH_UFRAW if (FIM_NULL == loader && filename && is_file_nonempty(filename) ) /* FIXME: this is a hack */ if(regexp_match(filename,".*NEF$") || regexp_match(filename,".*nef$")) // FIXME: use case flag { if(vl>0)FIM_VERB_PRINTF("NEF name hook.\n"); loader = &nef_loader; goto found_a_loader; } #endif /* FIM_WITH_UFRAW */ #if FIM_ALLOW_LOADER_STRING_SPECIFICATION { const fim::string ls=cc.getStringVariable(FIM_VID_FILE_LOADER); want_retry=(cc.getIntVariable(FIM_VID_RETRY_LOADER_PROBE)); if(ls!=FIM_CNS_EMPTY_STRING) if(FIM_NULL==loader)/* we could have forced one */ { if(vl)FIM_VERB_PRINTF("using user specified loader string: %s\n",ls.c_str()); list_for_each(item,&loaders) { loader = list_entry(item, struct ida_loader, list); if(vl)FIM_VERB_PRINTF("loader %s\n",loader->name); if (!strcmp(loader->name,ls.c_str())) goto found_a_loader; } #if 0 #ifdef FIM_TRY_INKSCAPE #ifdef FIM_WITH_LIBPNG if(ls=="svg") { if(vl)FIM_VERB_PRINTF("using svg loader.\n"); goto use_svg; } #endif /* FIM_WITH_LIBPNG */ #endif /* FIM_TRY_INKSCAPE */ #endif if(vl)FIM_VERB_PRINTF("user specified loader string: %s is invalid!\n",ls.c_str()); } loader = FIM_NULL; } #endif /* FIM_ALLOW_LOADER_STRING_SPECIFICATION */ #if FIM_WANT_TEXT_RENDERING { const fim_int bd=cc.getIntVariable(FIM_VID_TEXT_DISPLAY); if(bd==1) { loader = &text_loader; goto found_a_loader; } } #endif #if FIM_WANT_RAW_BITS_RENDERING { const fim_int bd=cc.getIntVariable(FIM_VID_BINARY_DISPLAY); if(bd!=0) { if(bd==1) loader = &bit1_loader; else { if(bd==24) loader = &bit24_loader; else ;// FIXME: need some error reporting } } } #endif /* FIM_WANT_RAW_BITS_RENDERING */ probe_loader: /* pick loader */ #if FIM_WANT_MAGIC_FIMDESC if (FIM_NULL == loader && 0 == strncmp(blk, FIM_CNS_MAGIC_DESC, strlen(FIM_CNS_MAGIC_DESC)) ) { if(vl>0)FIM_VERB_PRINTF("Seems like a FIM file list ..\n"); cc.set_status_bar("ok, a file list...", "*"); cc.id_.fetch(filename, fim::g_sc); cc.push_from_id(); cc.setVariable(FIM_VID_COMMENT_OI,FIM_OSW_LOAD_IMG_DSC_FILE_VID_COMMENT_OI_VAL); goto shall_skip_header; } #endif /* FIM_WANT_MAGIC_FIMDESC */ #ifdef FIM_SKIP_KNOWN_FILETYPES if (FIM_NULL == loader && (*blk==0x42) && (*(fim_byte_t*)(blk+1)==0x5a)) { if(vl>1)FIM_VERB_PRINTF("skipping BZ2 ..\n"); cc.set_status_bar("skipping 'bz2'...", "*"); goto shall_skip_header; } /* gz is another ! */ /* if (FIM_NULL == loader && (*blk==0x30) && (*(fim_byte_t*)(blk+1)==0x30)) { cc.set_status_bar("skipping 'gz'...", "*"); return FIM_NULL; }*/ #ifndef HAVE_LIBPOPPLER if (FIM_NULL == loader && (*blk==0x25) && (*(fim_byte_t*)(blk+1)==0x50 ) && FIM_NULL == loader && (*(fim_byte_t*)(blk+2)==0x44) && (*(fim_byte_t*)(blk+3)==0x46)) { cc.set_status_bar("skipping 'pdf' (use fimgs for this)...", "*"); if(vl>1)FIM_VERB_PRINTF("skipping PDF ..\n"); goto shall_skip_header; } #endif /* HAVE_LIBPOPPLER */ #ifndef HAVE_LIBSPECTRE if (FIM_NULL == loader && (*blk==0x25) && (*(fim_byte_t*)(blk+1)==0x21 ) && FIM_NULL == loader && (*(fim_byte_t*)(blk+2)==0x50) && (*(fim_byte_t*)(blk+3)==0x53)) { if(vl>1)FIM_VERB_PRINTF("skipping PostScript ..\n"); cc.set_status_bar("skipping 'ps' (use fimgs for this)...", "*"); goto shall_skip_header; } #endif /* HAVE_LIBSPECTRE */ #endif /* FIM_SKIP_KNOWN_FILETYPES */ /* TODO: should sort loaders by mlen, descendingly */ if(FIM_NULL==loader)/* we could have forced one */ list_for_each(item,&loaders) { loader = list_entry(item, struct ida_loader, list); if(loader->mlen < 1) continue; if (FIM_NULL == loader->magic) break; if(vl>1)FIM_VERB_PRINTF("probing %s ..\n",loader->name); if (0 == memcmp(blk+loader->moff,loader->magic,loader->mlen)) break; loader = FIM_NULL; } if(loader!=FIM_NULL) { if(vl)FIM_VERB_PRINTF("found loader %s by magic number\n",loader->name); goto found_a_loader; } if( loader==FIM_NULL && (!can_pipe || read_offset_l > 0) ) { if(vl)FIM_VERB_PRINTF("skipping external loading programs...\n"); goto after_external_converters; } #ifdef FIM_WITH_LIBPNG #ifdef FIM_TRY_DIA if(vl>1)FIM_VERB_PRINTF("probing " FIM_EPR_DIA " ..\n"); if (FIM_NULL == loader && (*blk==0x1f) && (*(fim_byte_t*)(blk+1)==0x8b))// i am not sure if this is the FULL signature! { /* a gimp xcf file was found, and we try to use xcftopnm (fim) */ cc.set_status_bar(FIM_MSG_WAIT_PIPING(FIM_EPR_DIA), "*"); if(FIM_NULL!=(fp=FIM_TIMED_EXECLP(FIM_EPR_DIA,filename,"-e",tpfn.c_str(),FIM_NULL))&& 0==fim_fclose (fp)) { if (FIM_NULL == (fp = fim_fopen(tpfn.c_str(),"r"))) { /* this could happen in case dia was removed from the system */ cc.set_status_bar(FIM_MSG_FAILED_PIPE(FIM_EPR_DIA), "*"); goto shall_skip_header; } else { unlink(tpfn.c_str()); loader = &png_loader; if(nsp) nsp->setVariable(FIM_VID_FILE_BUFFERED_FROM,tpfn); } } } #endif /* FIM_TRY_DIA */ #endif /* FIM_WITH_LIBPNG */ #ifdef FIM_TRY_XFIG if(vl>1)FIM_VERB_PRINTF("probing " FIM_EPR_FIG2DEV " ..\n"); if (FIM_NULL == loader && (0 == memcmp(blk,"#FIG",4))) { cc.set_status_bar(FIM_MSG_WAIT_PIPING(FIM_EPR_FIG2DEV), "*"); /* a xfig file was found, and we try to use fig2dev (fim) */ if(FIM_NULL==(fp=FIM_TIMED_EXECLP(FIM_EPR_FIG2DEV,"-L","ppm",filename,FIM_NULL))) { cc.set_status_bar(FIM_MSG_FAILED_PIPE(FIM_EPR_FIG2DEV), "*"); goto shall_skip_header; } loader = &ppm_loader; } #endif /* FIM_TRY_XFIG */ #ifdef FIM_TRY_XCFTOPNM if(vl>1)FIM_VERB_PRINTF("probing " FIM_EPR_XCFTOPNM " ..\n"); if (FIM_NULL == loader && (0 == memcmp(blk,"gimp xcf file",13))) { cc.set_status_bar(FIM_MSG_WAIT_PIPING(FIM_EPR_XCFTOPNM), "*"); /* a gimp xcf file was found, and we try to use xcftopnm (fim) */ if(FIM_NULL==(fp=FIM_TIMED_EXECLP(FIM_EPR_XCFTOPNM,filename,FIM_NULL))) { cc.set_status_bar(FIM_MSG_FAILED_PIPE(FIM_EPR_XCFTOPNM), "*"); goto shall_skip_header; } loader = &ppm_loader; } #endif /* FIM_TRY_XCFTOPNM */ //#if 0 #ifdef FIM_TRY_INKSCAPE #ifdef FIM_WITH_LIBPNG if (FIM_NULL == loader && ( (0 == memcmp(blk,xmlh,36) || (0 == memcmp(blk,"1)FIM_VERB_PRINTF("probing " FIM_EPR_INKSCAPE " ..\n"); if(FIM_NULL!=(fp=FIM_TIMED_EXECLP(FIM_EPR_INKSCAPE,filename,"--without-gui","--export-png",tpfn.c_str(),FIM_NULL))&&0==fim_fclose(fp)) { if (FIM_NULL == (fp = fim_fopen(tpfn,"r"))) { cc.set_status_bar(FIM_MSG_FAILED_PIPE(FIM_EPR_INKSCAPE), "*"); goto shall_skip_header; } else { unlink(tpfn); loader = &png_loader; if(nsp) nsp->setVariable(FIM_VID_FILE_BUFFERED_FROM,tpfn); } } } #endif /* FIM_TRY_INKSCAPE */ #if 0 /* * Warning : this is potentially dangerous and so we wait a little before working on this. * */ if((FIM_NULL == loader && (0 == memcmp(blk,"#!/usr/bin/fim",14))) || (FIM_NULL == loader && (0 == memcmp(blk,"#!/usr/sbin/fim",15))) || (FIM_NULL == loader && (0 == memcmp(blk,"#!/usr/local/bin/fim",20))) || (FIM_NULL == loader && (0 == memcmp(blk,"#!/usr/local/sbin/fim",21))) ) { cc.set_status_bar("loading Fim script file ...", "*"); cc.executeFile(filename); return FIM_NULL; } #endif #endif /* FIM_HAVE_FULL_PROBING_LOADER */ //#endif #ifdef FIM_TRY_CONVERT #if 0 // problem: pipe buffer is usually smaller than an entire ppm image :-( if (FIM_NULL == loader) { if(vl>1)FIM_VERB_PRINTF("probing " FIM_EPR_CONVERT " ..\n"); cc.set_status_bar(FIM_MSG_WAIT_PIPING(FIM_EPR_CONVERT), "*"); /* no loader found, try to use ImageMagick's convert */ if(FIM_NULL==(fp=FIM_TIMED_EXECLP(FIM_EPR_CONVERT,filename,"ppm:-",FIM_NULL))) { cc.set_status_bar(FIM_MSG_FAILED_PIPE(FIM_EPR_CONVERT), "*"); goto shall_skip_header; } loader = &ppm_loader; } #else // note: this solution happens a few times throghout the file, and should be factored if (FIM_NULL == loader) { cc.set_status_bar(FIM_MSG_WAIT_PIPING(FIM_EPR_CONVERT), "*"); if(FIM_NULL!=(fp=FIM_TIMED_EXECLP(FIM_EPR_CONVERT,filename,(std::string("ppm:")+tpfn).c_str(),FIM_NULL))&&0==fim_fclose(fp)) { if (FIM_NULL == (fp = fim_fopen(tpfn,"r"))) { cc.set_status_bar(FIM_MSG_FAILED_PIPE(FIM_EPR_CONVERT), "*"); goto shall_skip_header; } else { unlink(tpfn); loader = &ppm_loader; if(nsp) nsp->setVariable(FIM_VID_FILE_BUFFERED_FROM,tpfn); } } } #endif #endif /* FIM_TRY_CONVERT */ after_external_converters: /* external loaders failed */ #if !FIM_HAVE_FULL_PROBING_LOADER #ifdef HAVE_LIBGRAPHICSMAGICK /* FIXME: with this scheme, this is the only 0-mlen loader allowed */ if (FIM_NULL == loader && read_offset_l == 0 #if 1 && filename && is_file_nonempty(filename) /* FIXME: need an appropriate error/warning printout in this case */ #endif /* */ ) loader = &magick_loader; else ; #endif /* HAVE_LIBGRAPHICSMAGICK */ #else /* FIM_HAVE_FULL_PROBING_LOADER */ /* Incomplete: the problem is related to the descriptor: after the first probe, * the file descriptor may not be available anymore, in case of standard input, * unless some more advanced solution is found. * */ if(FIM_NULL==loader) if(rozlsl) list_for_each(item,&loaders) { loader = list_entry(item, struct ida_loader, list); if(loader->mlen > 0) continue; loader = FIM_NULL; } #endif /* FIM_HAVE_FULL_PROBING_LOADER */ if (FIM_NULL == loader) goto head_not_found; found_a_loader: /* we have a loader */ if(vl)FIM_VERB_PRINTF("using loader %s\n",loader->name); /* load image */ img = (struct ida_image*)fim_calloc(1,sizeof(*img));/* calloc, not malloc: we want zeros */ if(!img)goto errl; #ifdef FIM_EXPERIMENTAL_ROTATION /* * warning : there is a new field in ida_image_info (fim_extra_flags) * which gets cleared to 0 (default) in this way. * */ #endif /* FIM_EXPERIMENTAL_ROTATION */ // cc.set_status_bar("loading...", "*"); #if FIM_EXPERIMENTAL_IMG_NMSPC img->i.nsp = nsp; #endif /* FIM_EXPERIMENTAL_IMG_NMSPC */ data = loader->init(fp,filename,page,&img->i,0); #ifdef FIM_READ_STDIN_IMAGE if(strcmp(filename,FIM_STDIN_IMAGE_NAME)==0) { close(0); if(dup(2)){/* FIXME : should we report this ?*/}/* if the image is loaded from stdin, we close its stream */} #endif /* FIM_READ_STDIN_IMAGE */ if (FIM_NULL == data) { if(vl)FIM_VERB_PRINTF("loader failed\n"); if(FIM_DD_DEBUG()) FIM_FBI_PRINTF("loading %s [%s] FAILED\n",filename,loader->name); free_image(img); img=FIM_NULL; if(want_retry) { want_retry=0; loader=FIM_NULL; if(vl)FIM_VERB_PRINTF("retrying with probing..\n"); goto probe_loader; } goto shall_skip_header; } img->data = fim_pm_alloc(img->i.width, img->i.height); if(!img->data)goto errl; #ifndef FIM_IS_SLOWER_THAN_FBI for (y = 0; y < img->i.height; y++) { loader->read(img->data + img->i.width * 3 * y, y, data); } #else /* FIM_IS_SLOWER_THAN_FBI */ for (y = 0; y < img->i.height; y++) { FIM_FB_SWITCH_IF_NEEDED(); loader->read(img->data + img->i.width * 3 * y, y, data); } #endif /* FIM_IS_SLOWER_THAN_FBI */ #ifndef FIM_IS_SLOWER_THAN_FBI /* * this patch aligns the pixel bytes in the order they should * be dumped to the video memory, resulting in much faster image * drawing in fim than in fbi ! * */ rgb2bgr(img->data,img->i.width,y); #endif /* FIM_IS_SLOWER_THAN_FBI */ loader->done(data); #if FIM_WITH_ARCHIVE if(npages) img->i.npages = npages; /* FIXME: temporarily here */ #endif /* FIM_WITH_ARCHIVE */ #if FIM_WANT_REMEMBER_LAST_FILE_LOADER if(img && loader) { if(nsp) nsp->setVariable(FIM_VID_FILE_LOADER,loader->name); cc.setVariable(FIM_VID_LAST_FILE_LOADER,loader->name); } #endif /* FIM_WANT_REMEMBER_LAST_FILE_LOADER */ #if FIM_WANT_EXPERIMENTAL_PLUGINS if(img) fim_post_read_plugins_exec(img,filename); #endif /* FIM_WANT_EXPERIMENTAL_PLUGINS */ #if FIM_WANT_RESIZE_HUGE_AFTER_LOAD if(cc.getIntVariable(FIM_VID_RESIZE_HUGE_ON_LOAD)==1) if( cc.current_viewport() && img->i.width>0 && img->i.width>0 ) { fim_scale_t mf = 1.5; // max factor (of image to viewport) fim_scale_t ef = 1.5; // estimation factor (of max viewport to current window) fim_scale_t mswe = ef*cc.current_viewport()->viewport_width(); // max screen width estimate fim_scale_t mshe = ef*cc.current_viewport()->viewport_height(); // max screen height estimate fim_scale_t ws = FIM_INT_SCALE_FRAC(img->i.width , mf*mswe); fim_scale_t hs = FIM_INT_SCALE_FRAC(img->i.height , mf*mshe); if( ws > FIM_CNS_SCALEFACTOR_ONE && hs > FIM_CNS_SCALEFACTOR_ONE ) { // std::cout << img->i.width << " " << img->i.height << std::endl; // std::cout << ws << " " << hs << std::endl; fim_scale_t sf = floor(FIM_MIN(ws,hs)); struct ida_image *simg = FbiStuff::scale_image(img,1.0/sf,FIM_CNS_SCALEFACTOR_ONE #if FIM_WANT_MIPMAPS ,FIM_NULL #endif /* FIM_WANT_MIPMAPS */ ); if(simg) FbiStuff::free_image(img), img=simg; if(vl)FIM_VERB_PRINTF("image huge: scaled it down\n"); } } #endif /* FIM_WANT_RESIZE_HUGE_AFTER_LOAD */ goto ret; shall_skip_header: head_not_found: /* no appropriate loader found for this image */ img=FIM_NULL; if( read_offset_u > read_offset_l ) { read_offset_l++; if(vl) FIM_VERB_COUT << "file seek range adjusted to: " << read_offset_l << ":" << read_offset_u << "\n"; goto with_offset; } errl: if(img && img->data)fim_free(img->data); if(img )fim_free(img); #if FIM_SHALL_BUFFER_STDIN if(sbuf)fim_free(sbuf); #endif /* FIM_SHALL_BUFFER_STDIN */ ret: if( read_offset_l > 0 && nsp ) nsp->setVariable(FIM_VID_OPEN_OFFSET_L,read_offset_l); FIM_PR('.'); return img; } /* * crop the image to a rectangle * */ #if FIM_WANT_CROP struct ida_image* FbiStuff::crop_image(struct ida_image *src, ida_rect rect) { struct ida_image *dest; void *data; unsigned int y; struct ida_op *desc_p; dest =(ida_image*) fim_malloc(sizeof(*dest)); /* fim: */ if(!dest)goto err; fim_bzero(dest,sizeof(*dest)); desc_p=&desc_crop; data = desc_p->init(src,&rect,&dest->i,NULL); dest->data = fim_pm_alloc(dest->i.width, dest->i.height); /* fim: */ if(!(dest->data)){fim_free(dest);dest=FIM_NULL;goto err;} for (y = 0; y < dest->i.height; y++) { FIM_FB_SWITCH_IF_NEEDED(); desc_p->work(src,&rect, dest->data + 3 * dest->i.width * y, y, data); } desc_p->done(data); err: return dest; } #endif /* FIM_WANT_CROP */ /* * rotate the image 90 degrees (M_PI/2) at a time (fim) * */ struct ida_image* FbiStuff::rotate_image90(struct ida_image *src, unsigned int rotation) { /* 0: CCW, 1: CW */ struct op_resize_parm p; struct ida_rect rect; struct ida_image *dest; void *data; unsigned int y; struct ida_op *desc_p; dest =(ida_image*) fim_malloc(sizeof(*dest)); /* fim: */ if(!dest)goto err; fim_bzero(dest,sizeof(*dest)); fim_bzero(&rect,sizeof(rect)); fim_bzero(&p,sizeof(p)); p.width = src->i.width; p.height = src->i.height; p.dpi = src->i.dpi; if (0 == p.width) p.width = 1; if (0 == p.height) p.height = 1; rotation%=2; if(rotation==0){desc_p=&desc_rotate_ccw;} else {desc_p=&desc_rotate_cw ;} data = desc_p->init(src,&rect,&dest->i,&p); dest->data = fim_pm_alloc(dest->i.width, dest->i.height); /* fim: */ if(!(dest->data)){fim_free(dest);dest=FIM_NULL;goto err;} for (y = 0; y < dest->i.height; y++) { FIM_FB_SWITCH_IF_NEEDED(); desc_p->work(src,&rect, dest->data + 3 * dest->i.width * y, y, data); } desc_p->done(data); err: return dest; } struct ida_image* FbiStuff::rotate_image(struct ida_image *src, float angle) { /* * this whole code was originally (in fbi) not meant to change canvas. * */ struct op_rotate_parm p; /* fim's 20080831 */ struct ida_rect rect; struct ida_image *dest; void *data; dest = (ida_image*)fim_malloc(sizeof(*dest)); /* fim: */ if(!dest)goto err; fim_bzero(dest,sizeof(*dest)); fim_bzero(&rect,sizeof(rect)); fim_bzero(&p,sizeof(p)); /* source rectangle */ rect.x1=0; rect.x2=src->i.width; rect.y1=0; rect.y2=src->i.height; #ifdef FIM_EXPERIMENTAL_ROTATION if(! src->i.fim_extra_flags) { /* * this is code for a preliminary 'canvas' enlargement prior to image rotation. * unfinished code. * */ fim_off_t diagonal = (fim_off_t) FIM_HYPOTHENUSE_OF_INT(src->i.width,src->i.height); fim_off_t n_extra = (diagonal - src->i.height )/2; fim_off_t s_extra = (diagonal - src->i.height - n_extra ); fim_off_t w_extra = (diagonal - src->i.width )/2; fim_off_t e_extra = (diagonal - src->i.width - w_extra ); /* we allocate a new, larger canvas */ fim_byte_t * larger_data = (fim_byte_t*)fim_calloc(diagonal * diagonal * 3,1); if(larger_data) { for(fim_off_t y = n_extra; y < diagonal - s_extra; ++y ) memcpy(larger_data + (y * diagonal + w_extra )*3 , src->data + (y-n_extra) * src->i.width * 3 , src->i.width*3); src->i.width = diagonal; src->i.height = diagonal; /* source rectangle fix */ rect.x1+=w_extra; rect.x2+=e_extra; rect.y1+=n_extra; rect.y2+=s_extra; fim_free(src->data); src->data=larger_data; src->i.fim_extra_flags=1; /* to avoid this operation to repeat on square images or already rotated images */ } /* on allocation failure (e.g.: a very long and thin image) we cannot do more. * uh, maybe we could tell the user about the allocation failure..*/ else cc.set_status_bar( "rescaling failed (insufficient memory?!)", "*"); } #endif /* FIM_EXPERIMENTAL_ROTATION */ p.angle = (int) angle; data = desc_rotate.init(src,&rect,&dest->i,&p); dest->data = fim_pm_alloc(dest->i.width, dest->i.height, true); /* fim: */ if(!(dest->data)){fim_free(dest);dest=FIM_NULL;goto err;} for (fim_uint y = 0; y < dest->i.height; y++) { FIM_FB_SWITCH_IF_NEEDED(); desc_rotate.work(src,&rect, dest->data + 3 * dest->i.width * y, y, data); } desc_rotate.done(data); err: return dest; } #define FIM_OPTIMIZATION_20120129 1 #if FIM_WANT_MIPMAPS static int find_mipmap_idx(struct ida_image & msrc, const fim_mipmap_t * mmp, fim_int width, fim_int height) { int mmi; for(mmi=0;mminmm && mmp->mmw[mmi]>=width && mmp->mmh[mmi]>=height ;++mmi) { msrc.i.width = mmp->mmw[mmi]; msrc.i.height = mmp->mmh[mmi]; msrc.data = mmp->mdp + mmp->mmoffs[mmi]; } return mmi; } #endif /* FIM_WANT_MIPMAPS */ /* int is_power_of_two(float val) { int mmi = 0; if(val < 0) val = -val; if(val > 1.0) val = 1.0/val; while( val / 2.0 >= 1.0 ) val /= 2.0, --mmi; } */ struct ida_image* FbiStuff::scale_image(const struct ida_image *src, /*const fim_mipmap_t *mmp,*/ float scale, float ascale #if FIM_WANT_MIPMAPS , const fim_mipmap_t * mmp #endif /* FIM_WANT_MIPMAPS */ ) { struct op_resize_parm p; struct ida_rect rect; struct ida_image *dest=FIM_NULL; void *data=FIM_NULL; unsigned int y; #if FIM_WANT_MIPMAPS int mmi=-1; struct ida_image msrc; #endif /* FIM_WANT_MIPMAPS */ if(ascale<=0.0||ascale>=100.0) /* fim: */ ascale=1.0; dest = (ida_image*)fim_malloc(sizeof(*dest)); /* fim: */ if(!dest) goto err; fim_bzero(dest,sizeof(*dest)); fim_bzero(&rect,sizeof(rect)); fim_bzero(&p,sizeof(p)); p.width = (int)ceilf((float)src->i.width * scale * ascale); p.height = (int)ceilf((float)src->i.height * scale); p.dpi = (int)(src->i.dpi); if (0 == p.width) p.width = 1; if (0 == p.height) p.height = 1; #if FIM_WANT_MIPMAPS if(mmp && ascale == 1.0 && scale < 1.0) { msrc = *src; mmi = find_mipmap_idx(msrc, mmp, p.width, p.height); if(mmi>0) { src=&msrc; mmi--; if(FIM_WVMM) std::cout << "for scale " << scale << std::endl; if(FIM_WVMM) std::cout << "using mipmap " << mmi << " / " << mmp->nmm << std::endl; if(FIM_WVMM) std::cout << mmp->mmw[mmi] << " x " << mmp->mmh[mmi] << "" << std::endl; if(FIM_WVMM) std::cout << p.width << " x " << p.height << " -> " << std::endl; } else { if(FIM_WVMM) std::cout << "for scale " << scale << std::endl; if(FIM_WVMM) std::cout << "not using mipmap " << std::endl; } } #endif /* FIM_WANT_MIPMAPS */ data = desc_resize.init(src,&rect,&dest->i,&p); if(data==FIM_NULL) { fim_free(dest); goto err; } dest->data = fim_pm_alloc(dest->i.width, dest->i.height); if(!(dest->data)) { fim_char_t s[FIM_STATUSLINE_BUF_SIZE]; sprintf(s, "Failed allocating a %d x %d pixelmap.", dest->i.width, dest->i.height); #if FIM_ALLOW_LOADER_VERBOSITY const fim_int vl=(cc.getIntVariable(FIM_VID_VERBOSITY)); #else /* FIM_ALLOW_LOADER_VERBOSITY */ const fim_int vl=0; #endif /* FIM_ALLOW_LOADER_VERBOSITY */ if(vl>0)FIM_VERB_PRINTF("%s\n",s); fim::cout << s << "\n"; cc.set_status_bar(s, "*"); fim_free(data); fim_free(dest); goto err; } #if FIM_WANT_MIPMAPS if(mmi>=0 && msrc.i.width == dest->i.width && msrc.i.height == dest->i.height ) { if(FIM_WVMM) std::cout << "using mipmap without scaling" << std::endl; memcpy(dest->data,src->data,fbi_img_pixel_bytes(dest)); /* a special case */ goto done; } #endif /* FIM_WANT_MIPMAPS */ #if FIM_OPTIMIZATION_20120129 if(ascale==scale && ascale==1.0) memcpy(dest->data,src->data,fbi_img_pixel_bytes(dest)); /* a special case */ else #endif /* FIM_OPTIMIZATION_20120129 */ for (y = 0; y < dest->i.height; y++) { FIM_FB_SWITCH_IF_NEEDED(); desc_resize.work(src,&rect, dest->data + 3 * dest->i.width * y, y, data); } done: desc_resize.done(data); err: return dest; } #if FIM_WANT_OBSOLETE struct ida_image * fbi_image_black(fim_coo_t w, fim_coo_t h) { // TODO: use fbi_image_black in fbi_image_clone ! struct ida_image *nimg=FIM_NULL; fim_coo_t n; if(!(nimg=(ida_image*)fim_calloc(1,sizeof(struct ida_image)))) goto err; nimg->i.width=w; nimg->i.height=h; n = fbi_img_pixel_bytes(nimg); nimg->data = (fim_byte_t*)fim_calloc(1, n ); if(!(nimg->data)) { fim_free(nimg); nimg = FIM_NULL; goto err; } err: return nimg; } #endif /* FIM_WANT_OBSOLETE */ fim_pxc_t fbi_img_pixel_count(const struct ida_image *img) { if(!img) return 0; return img->i.width*img->i.height; } fim_pxc_t fbi_img_pixel_bytes(const struct ida_image *img) { return 3 * fbi_img_pixel_count(img); } struct ida_image * fbi_image_clone(const struct ida_image *img) { /* note that to fulfill free_image(), the descriptor and data couldn't be allocated together * */ struct ida_image *nimg=FIM_NULL; if(!img || !img->data) goto err; int n; if(!(nimg=(ida_image*)fim_calloc(1,sizeof(struct ida_image)))) goto err; memcpy(nimg,img,sizeof(struct ida_image)); /*note .. no checks .. :P */ n = img->i.width * img->i.height * 3; nimg->data = (fim_byte_t*)fim_malloc( n ); if(!(nimg->data)) { fim_free(nimg); nimg = FIM_NULL; goto err; } memcpy(nimg->data, img->data,n); err: return nimg; } int FbiStuff::fim_filereading_debug(void) { return FIM_DD_DEBUG(); } bool FbiStuff::want_fbi_style_debug(void) { return FIM_WANT_FBI_INNER_DIAGNOSTICS; } } /* namespace fim */ fim-0.6-rc2/src/Browser.cpp0000644000175000017500000021647114454347340012500 00000000000000/* $LastChangedDate: 2023-04-02 23:50:13 +0200 (Sun, 02 Apr 2023) $ */ /* Browser.cpp : Fim image browser (c) 2007-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include /* POSIX Standard: 2.6 Primitive System Data Types (e.g.: ssize_t) */ #include "fim.h" #ifdef HAVE_LIBGEN_H #include #endif /* HAVE_LIBGEN_H */ #define FIM_PAN_GOES_NEXT 1 #define FIM_READ_BLK_DEVICES 1 #define FIM_BROWSER_INSPECT 0 #if FIM_BROWSER_INSPECT #define FIM_PR(X) printf("BROWSER:%c:%20s: f:%d/%d p:%d/%d %s\n",X,__func__,getGlobalIntVariable(FIM_VID_FILEINDEX),getGlobalIntVariable(FIM_VID_FILELISTLEN),getGlobalIntVariable(FIM_VID_PAGE),/*(getImage()?getImage()->getIntVariable(FIM_VID_PAGES):-1)*/-1,current().c_str()); #else /* FIM_BROWSER_INSPECT */ #define FIM_PR(X) #endif /* FIM_BROWSER_INSPECT */ #define FIM_DIFFERENT_VARS FIM_WANT_PIC_LVDN && FIM_USE_CXX11 /* experimental */ #if FIM_USE_CXX11 #include /* std::swap */ #include /* std::random_device */ #include /* std::shuffle */ #else /* FIM_USE_CXX11 */ #include /* std::swap */ #endif /* FIM_USE_CXX11 */ #if FIM_WANT_FLIST_STAT #include // std::istringstream #endif /* FIM_WANT_FLIST_STAT */ #if 0 #if HAVE_WORDEXP_H #include #else /* HAVE_WORDEXP_H */ #endif /* HAVE_WORDEXP_H */ #if HAVE_GLOB_H #include #else /* HAVE_GLOB_H */ #endif /* HAVE_GLOB_H */ #if HAVE_FNMATCH_H #include #else /* HAVE_FNMATCH_H */ #endif /* HAVE_FNMATCH_H */ #endif /* 0 */ #if HAVE_TIME_H #include #endif /* HAVE_TIME_H */ #if HAVE_TIME_H && ( _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED ) #define FIM_USE_GETDATE #endif #ifdef FIM_USE_GETDATE /* TODO: shall use it like: struct tm*tmp; tmp=getdate("2009/12/28"); if(tmp) min_mtime_str=*tmp; */ #endif /* FIM_USE_GETDATE */ #define FIM_CNS_ENOUGH_FILES_TO_WARN 1000 #define FIM_WITHIN(MIN,VAL,MAX) ((MIN)<=(VAL) && (VAL)<=(MAX)) #define FIM_CNS_Ki 1000 #define FIM_CNS_MANY_DUMPED_TOKENS 1000000 #define FIM_CNS_A_FEW_DUMPED_TOKENS 20 #if FIM_EXPERIMENTAL_SHADOW_DIRS == 2 #include // c++17 on #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ namespace fim { int Browser::current_n(void)const { return flist_.cf(); } fim_cxr Browser::fcmd_list(const args_t& args) { fim::string result = FIM_CNS_EMPTY_RESULT; FIM_PR('*'); if(args.size()<1) { /* returns a string with the info about the files in list (const op) */ fim::string fileslist; for(size_t i=0;i 1) result = do_filter_cmd(args_t(args.begin()+1,args.end()),true,domark ? Mark : Unmark); else #endif /* FIM_WANT_PIC_LBFL */ cc.markCurrentFile(domark); goto ret; } else if(args[0]=="marked") { const std::string mfl = cc.marked_files_list(); if( mfl != FIM_CNS_EMPTY_STRING ) { result += "The following files have been marked by the user:\n"; result += mfl; } else result += "No files have been marked by the user.\n"; goto ret; } else if(args[0]=="dumpmarked") { std::cout << cc.marked_files_list(); goto ret; } else if(args[0]=="markall") { int marked = 0; for(size_t fi=0;fi=2) result = _sort(FIM_SYM_SORT_BV,args[1].c_str()); #if FIM_WANT_SORT_BY_STAT_INFO else if(args[0]=="sort_mtime") result = _sort(FIM_SYM_SORT_MD); else if(args[0]=="sort_fsize") result = _sort(FIM_SYM_SORT_SZ); #endif /* FIM_WANT_SORT_BY_STAT_INFO */ else if(args[0]=="reverse") result = _reverse(); else if(args[0]=="swap") result = _swap(); else if(args[0]=="pop") pop(), result = this->n_files(); else if(args[0]=="remove" && args.size()==1) pop(FIM_CNS_EMPTY_STRING,true), result = this->n_files(); else if(args[0]=="remove" && args.size()>=2) result = do_filter(args_t(args.begin()+1,args.end())/*,FullFileNameMatch,false,Delete*/); //result = flist_.pop(args.begin()[1]), // example for alternative //result = this->n_files(); else if(args[0]=="push") result = do_push(args_t(args.begin()+1,args.end())); #ifdef FIM_READ_DIRS else if(args[0]=="pushdir") { if(args.size()>=2) push_dir(args[1],FIM_FLAG_NONREC); else push_dir(".",FIM_FLAG_NONREC); result = FIM_CNS_EMPTY_RESULT; } else if(args[0]=="pushdirr") { #ifdef FIM_RECURSIVE_DIRS if(args.size()>=2) push_dir(args[1],FIM_FLAG_PUSH_REC); else push_dir(".",FIM_FLAG_PUSH_REC); result = FIM_CNS_EMPTY_RESULT; #else /* FIM_RECURSIVE_DIRS */ result = "Please recompile with +FIM_RECURSIVE_DIRS to activate pushdirr."; #endif /* FIM_RECURSIVE_DIRS */ } #endif /* FIM_READ_DIRS */ #if FIM_DIFFERENT_VARS else if(args[0]=="variables" || args[0]=="vars") { const auto min_vals = args.size()>1 ? FIM_MAX(std::atoi(args[1]),1) : 2; fim_var_id_set ids; for(const auto & ns : cc.id_.vd_) for(const auto & ip : ns.second) if(ip.first.c_str()[0]!='_') ids.insert(ip.first); // list unique vars std::map> vp; // id -> (vals count, files count) std::map> vv; // id -> {values} for(const auto & id : ids) { vp[id].second=0; for(const auto & ns : cc.id_.vd_) if(ns.second.isSetVar(id)) { vp[id].second++; Var val = ns.second.getVariable(id); vv[id].insert(val.getString()); } vp[id].first=vv[id].size(); if(vp[id].first>=min_vals) { result += id; result += ": "; result += std::to_string(vp[id].first); result += " vals / "; result += std::to_string(vp[id].second); result += " files\n"; for(const auto & val : vv[id]) result += " ", result += val, result += "\n"; } } } #endif /* FIM_DIFFERENT_VARS */ else result = FIM_CMD_HELP_LIST; } ret: FIM_PR('.'); return result; } std::ostream& Browser::print(std::ostream& os)const { #if FIM_USE_CXX11 for(auto le : flist_) os << le << FIM_CNS_NEWLINE; #else /* FIM_USE_CXX11 */ for(size_t i=0; icheck_valid() ) goto ret; default_image_ = std::move(stdin_image); #else /* FIM_USE_CXX11 */ if( !stdin_image || !stdin_image->check_valid() ) goto ret; if( default_image_ ) delete default_image_; default_image_ = stdin_image; #endif /* FIM_USE_CXX11 */ if(!cache_.setAndCacheStdinCachedImage(default_image_)) std::cerr << FIM_EMSG_CACHING_STDIN; ret: FIM_PR('.'); return; } #endif /* FIM_READ_STDIN_IMAGE */ Browser::Browser(CommandConsole& cc_): #ifdef FIM_NAMESPACES Namespace(&cc_,FIM_SYM_NAMESPACE_BROWSER_CHAR), #endif /* FIM_NAMESPACES */ #if FIM_WANT_PIC_LBFL flist_(), #endif /* FIM_WANT_PIC_LBFL */ #if FIM_WANT_PIC_LBFL tlist_(), #endif /* FIM_WANT_PIC_LBFL */ nofile_(FIM_CNS_EMPTY_STRING),commandConsole_(cc_) #if FIM_WANT_BACKGROUND_LOAD ,pcache_(cache_) #endif /* FIM_WANT_BACKGROUND_LOAD */ { } const fim::string Browser::pop_current(void) { flist_.pop_current(); setGlobalVariable(FIM_VID_FILELISTLEN,n_files()); return nofile_; } const fim::string Browser::pop(fim::string filename, bool advance) { fim::string s = nofile_; if( flist_.size() <= 1 ) goto ret; s = flist_.pop(filename,advance); setGlobalVariable(FIM_VID_FILEINDEX,current_image()); setGlobalVariable(FIM_VID_FILELISTLEN,n_files()); ret: return s; } fim::string Browser::fcmd_pan(const args_t& args) { FIM_PR('*'); if( args.size() < 1 || (!args[0].c_str()) ) goto nop; if( c_getImage() ) { fim_char_t f = tolower(*args[0].c_str()); if( f ) { FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PREPAN,current()) if( c_getImage() && viewport() ) { const bool pr = viewport()->do_pan(args); #if FIM_PAN_GOES_NEXT fim_char_t s = FIM_SYM_CHAR_NUL; s = tolower(args[0].end()[-1]); if( s != FIM_SYM_CHAR_NUL && pr == false ) { /*if( s != '+' && s != '-' ) switch(f) { case('u'): case('l'): case('e'): s='-'; break; case('d'): case('r'): case('w'): s='+'; break; }*/ if( s == '+' ) next(1); if( s == '-' ) prev(1); } #endif /* FIM_PAN_GOES_NEXT */ } FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTPAN) } } else prev(); nop: FIM_PR('.'); return FIM_CNS_EMPTY_RESULT; } #if FIM_EXPERIMENTAL_SHADOW_DIRS fim_cxr Browser::shadow_file_swap(const fim_fn_t fn) { const fim::fle_t tmp = flist_[flist_.cf()]; flist_[flist_.cf()] = fn; loadCurrentImage(); flist_[flist_.cf()] = tmp; viewport()->update_meta(true); return "Current image substituted with " + fn; } #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ fim_cxr Browser::fcmd_scale(const args_t& args) { fim::string result = FIM_CNS_EMPTY_RESULT; FIM_PR('*'); if(viewport()) { #if FIM_EXPERIMENTAL_SHADOW_DIRS if(args.size() == 1 && args[0] == "shadow") { const auto bn = std::string(fim_basename_of(current())); #if FIM_EXPERIMENTAL_SHADOW_DIRS == 1 fim::fle_t fn; for (const auto & e : hlist_) if ( bn == std::string(fim_basename_of(e)) ) { fn = e; break; } if ( fn.size() && hlist_.size() > 0 ) return shadow_file_swap(fn); #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ #if FIM_EXPERIMENTAL_SHADOW_DIRS == 2 namespace fs = std::filesystem; for ( const auto & shadow_dir: shadow_dirs_ ) if ( fs::is_directory(shadow_dir) ) for( const auto & p: fs::recursive_directory_iterator(shadow_dir) ) { if(fs::is_regular_file(p)) { const fim_fn_t cfn = p.path().string().c_str(); // candidate full name const fim_fn_t cbn = fim_basename_of(cfn); // candidate base name if (cbn == bn) return shadow_file_swap(cfn); } } #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ } else #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ result = viewport()->img_scale(args,current()); } FIM_PR('.'); return result; } #if FIM_WANT_CROP fim_cxr Browser::fcmd_crop(const args_t& args) { fim::string result = FIM_CNS_EMPTY_RESULT; FIM_PR('*'); if(viewport()) result = viewport()->img_crop(args,current()); FIM_PR('.'); return result; } #endif /* FIM_WANT_CROP */ fim_cxr Browser::fcmd_color(const args_t& args) { fim::string result = FIM_CNS_EMPTY_RESULT; FIM_PR('*'); if(viewport()) result = viewport()->img_color(args); FIM_PR('.'); return result; } fim::string Browser::do_filter_cmd(const args_t args, bool negative, enum FilterAction faction) { fim::string result = FIM_CNS_EMPTY_RESULT; /* Interprets a mark/limiting pattern. */ if(args.size()>0) { #if FIM_WANT_LIMIT_DUPBN if( args[0] == "~=" ) { // result = result + "Limiting to duplicate files\n"; result = do_filter(args,DupFileNameMatch,negative,faction); } else if( args[0] == "~^" ) { // result = result + "Limiting to first occurrences of files\n"; result = do_filter(args,FirstFileNameMatch,negative,faction); } else if( args[0] == "~$" ) { // result = result + "Limiting to last occurrences of files\n"; result = do_filter(args,LastFileNameMatch,negative,faction); } else if( args[0] == "~!" ) { // result = result + "Limiting to unique files\n"; result = do_filter(args,UniqFileNameMatch,negative,faction); } else if( args[0] == "~i" && args.size()>1 ) { // result = result + "Limiting according to list interval\n"; result = do_filter(args,ListIdxMatch,negative,faction); } else #if FIM_WANT_FLIST_STAT if( args[0] == "~d" ) { // result = result + "Limiting according to time interval\n"; result = do_filter(args,TimeMatch,negative,faction); } else if( args[0] == "~z" ) { // result = result + "Limiting according to file size\n"; result = do_filter(args,SizeMatch,negative,faction); } else #else /* FIM_WANT_FLIST_STAT */ if( args[0] == "~d" ) { result = result + "~d unsupported\n"; } else if( args[0] == "~z" ) { result = result + "~z unsupported\n"; } #endif /* FIM_WANT_FLIST_STAT */ #else /* FIM_WANT_LIMIT_DUPBN */ result = result + "Limited options unsupported.\n"; #endif /* FIM_WANT_LIMIT_DUPBN */ #if FIM_WANT_FILENAME_MARK_AND_DUMP if( args[0] == "!" ) { // result = result + "Limiting to marked files\n"; result = do_filter(args,MarkedMatch,!negative,faction); /* this is remove on filenames; need remove on comments */ } else #endif /* FIM_WANT_FILENAME_MARK_AND_DUMP */ result = do_filter(args,VarMatch,!negative,faction); /* this is remove on filenames; need remove on comments */ } return result; } #if FIM_WANT_PIC_LBFL fim_cxr Browser::fcmd_limit(const args_t& args) { fim::string result = FIM_CNS_EMPTY_RESULT; const int aoc = fim_args_opt_count(args,'-'); if( args.size()-aoc > 0 ) { const fim_int lbl = n_files(); // length before limiting const enum FilterAction faction = Delete; flist_t clist; // current list copy #if FIM_WANT_PIC_LVDN if( args.size()-aoc == 1 && aoc == 1 && ( fim_args_opt_have(args,"-list") || fim_args_opt_have(args,"-listall" ) ) ) { size_t max_vars = FIM_CNS_A_FEW_DUMPED_TOKENS; if( fim_args_opt_have(args,"-listall")) max_vars=FIM_CNS_MANY_DUMPED_TOKENS; result = cc.id_.get_values_list_for(args[1],max_vars) + string("\n"); goto nop; } #endif /* FIM_WANT_PIC_LVDN */ if(!limited_) limited_ = true, tlist_ = flist_; // a copy if( fim_args_opt_have(args,"-merge")) clist = flist_; // current list else if( fim_args_opt_have(args,"-subtract")) clist = flist_; // current list if(tlist_.size() && !fim_args_opt_have(args,"-further")) flist_ = tlist_; // limit on total list result = do_filter_cmd(args_t(args.begin()+aoc,args.end()),false,faction); if(clist.size()) { clist._sort(FIM_SYM_SORT_FN); if(fim_args_opt_have(args,"-merge")) flist_._set_union(clist); else if(fim_args_opt_have(args,"-subtract")) flist_._set_difference_from(clist); } if(n_files() != lbl) reload(); } else { #if FIM_WANT_PIC_LVDN if( args.size()-aoc == 0 && aoc == 1 && ( fim_args_opt_have(args,"-list") || fim_args_opt_have(args,"-listall" ) ) ) { size_t max_vals = FIM_CNS_A_FEW_DUMPED_TOKENS; if( fim_args_opt_have(args,"-listall")) max_vals=FIM_CNS_MANY_DUMPED_TOKENS; result = cc.id_.get_variables_id_list(max_vals) + string("\n"); goto nop; } #endif /* FIM_WANT_PIC_LVDN */ if(limited_) { // result = "Restoring the original browsable files list."; commandConsole_.set_status_bar("restoring files list", "*"); flist_ = tlist_; // original list limited_ = false; } } setGlobalVariable(FIM_VID_FILELISTLEN,n_files()); nop: return result; } #endif /* FIM_WANT_PIC_LBFL */ fim::string Browser::display_status(const fim_char_t *l) { FIM_PR('*'); if( getGlobalIntVariable(FIM_VID_DISPLAY_STATUS) == 1 ) { fim::string dss; const fim_char_t *dssp=FIM_NULL; if( cc.isSetVar(FIM_VID_DISPLAY_STATUS_FMT) ) dss = cc.getInfoCustom(cc.getStringVariable(FIM_VID_DISPLAY_STATUS_FMT).c_str()); dssp=dss.c_str(); commandConsole_.set_status_bar( (dssp && *dssp ) ? dssp : l, c_getImage()?(c_getImage()->getInfo().c_str()):"*"); } else { if( fim_bool_t wcs = cc.isSetVar(FIM_VID_WANT_CAPTION_STATUS) ) wcs = cc.set_wm_caption(FIM_NULL); } FIM_PR('.'); return FIM_CNS_EMPTY_RESULT; } #if FIM_WANT_FAT_BROWSER #if 0 fim_cxr Browser::fcmd_no_image(const args_t& args) { /* sets no image as the current one */ FIM_PR('*'); free_current_image(); FIM_PR('.'); return FIM_CNS_EMPTY_RESULT; } #endif #endif /* FIM_WANT_FAT_BROWSER */ int Browser::load_error_handle(fim::string c) { /* * assume there was a load attempt: check and take some action in case of error * * FIXME: this behaviour is BUGGY, because recursion will be killed off * by the autocommand loop prevention mechanism. (this is not true, as 20090215) * */ static int lehsof = 0; /* './fim FILE NONFILE' and hitting 'prev' will make this necessary */ int retval = 0; FIM_PR('*'); if( lehsof ) goto ret; /* this prevents infinite recursion */ if( /*c_getImage() &&*/ viewport() && ! (viewport()->check_valid()) ) { if ( cc.getIntVariable(FIM_VID_VERBOSITY) ) std::cout << "loading " << c << " has failed" << "\n"; free_current_image(false); ++ lehsof; #ifdef FIM_REMOVE_FAILED //pop(c); //removes the currently specified file from the list. (pop doesn't work in this way) #if FIM_USE_CXX11 do_filter({c}); #if FIM_WANT_GOTOLAST /* on failed load, try jumping to last meaningful file */ { const fim_int fi = getGlobalIntVariable(FIM_VID_FILEINDEX), li = getGlobalIntVariable(FIM_VID_LASTFILEINDEX); if ( fi > li && li > 0 ) setGlobalVariable(FIM_VID_FILEINDEX, li), flist_.set_cf(li-1); } #endif #else /* FIM_USE_CXX11 */ args_t args; args.push_back(c.c_str()); do_filter(args); #endif /* FIM_USE_CXX11 */ #ifdef FIM_AUTOSKIP_FAILED if(n_files()) { //next(1); reload(); /* this is effective, at least partially */ } #endif /* FIM_AUTOSKIP_FAILED */ #endif /* FIM_REMOVE_FAILED */ --lehsof; retval = 1; } ret: FIM_PR('.'); return retval; } fim::string Browser::reload(void) { if( n_files() ) #if FIM_USE_CXX11 return fcmd_reload({}); #else /* FIM_USE_CXX11 */ return fcmd_reload( args_t() ); #endif /* FIM_USE_CXX11 */ return FIM_CNS_EMPTY_RESULT; } fim_err_t Browser::loadCurrentImage(void) { // this function needs revision const fim_err_t errval = FIM_ERR_NO_ERROR; FIM_PR('*'); try { #ifdef FIM_CACHE_DEBUG if( viewport() ) std::cout << "browser::loadCurrentImage(\"" << current().c_str() << "\")\n"; #endif /* FIM_CACHE_DEBUG */ if( viewport() && !( current()!=FIM_STDIN_IMAGE_NAME && !is_file(current()) ) /* FIXME: this is an unelegant fix to prevent crashes on non-existent files. One shall better fix this by a good exception mechanism for Image::Image() and a clean approach w.r.t. e.g. free_current_image(true) */ ) { ViewportState viewportState; FIM_PR('0'); viewport()->setImage( #if FIM_WANT_BACKGROUND_LOAD pcache_. #else /* FIM_WANT_BACKGROUND_LOAD */ cache_. #endif /* FIM_WANT_BACKGROUND_LOAD */ useCachedImage(cache_key_t(current(),(current()==FIM_STDIN_IMAGE_NAME)?FIM_E_STDIN:FIM_E_FILE),&viewportState,getGlobalIntVariable(FIM_VID_PAGE)) );// FIXME viewport()->ViewportState::operator=(viewportState); } } catch(FimException e) { FIM_PR('E'); if(viewport()) viewport()->setImage( FIM_NULL ); } FIM_PR('.'); return errval; } void Browser::free_current_image(bool force) { FIM_PR('*'); if( viewport() ) viewport()->free_image(force); setGlobalVariable(FIM_VID_CACHE_STATUS,cache_.getReport()); FIM_PR('.'); } fim_cxr Browser::fcmd_prefetch(const args_t& args) { fim_int wp=1; FIM_PR('*'); FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PREPREFETCH,current()) if( args.size() > 0 ) goto ret; wp = getGlobalIntVariable(FIM_VID_WANT_PREFETCH); setGlobalVariable(FIM_VID_WANT_PREFETCH,0); #if FIM_WANT_BACKGROUND_LOAD if(wp == 2) { pcache_.asyncPrefetch(get_next_filename(1)); pcache_.asyncPrefetch(get_next_filename(-1)); goto apf; } #endif /* FIM_WANT_BACKGROUND_LOAD */ if(cache_.prefetch(cache_key_t(get_next_filename( 1).c_str(),FIM_E_FILE)))// we prefetch 1 file forward #ifdef FIM_AUTOSKIP_FAILED pop(get_next_filename( 1));/* if the filename doesn't match a loadable image, we remove it */ #else /* FIM_AUTOSKIP_FAILED */ {} /* beware that this could be dangerous and trigger loops */ #endif /* FIM_AUTOSKIP_FAILED */ if(cache_.prefetch(cache_key_t(get_next_filename(-1).c_str(),FIM_E_FILE)))// we prefetch 1 file backward #ifdef FIM_AUTOSKIP_FAILED pop(get_next_filename(-1));/* if the filename doesn't match a loadable image, we remove it */ #else /* FIM_AUTOSKIP_FAILED */ {} /* beware that this could be dangerous and trigger loops */ #endif /* FIM_AUTOSKIP_FAILED */ #if FIM_WANT_BACKGROUND_LOAD apf: /* after prefetch */ #endif /* FIM_WANT_BACKGROUND_LOAD */ FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTPREFETCH) setGlobalVariable(FIM_VID_WANT_PREFETCH,wp); if(wp != 2) display_status(""); ret: FIM_PR('.'); return FIM_CNS_EMPTY_RESULT; } fim_cxr Browser::fcmd_reload(const args_t& args) { fim::string result; FIM_PR('*'); //for(size_t i=0;i 0 ) free_current_image(true); else free_current_image(false); loadCurrentImage(); // while( n_files() && viewport() && ! (viewport()->check_valid() ) && load_error_handle(c) ); load_error_handle(_c); FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTRELOAD) result = FIM_CNS_EMPTY_RESULT; ret: FIM_PR('.'); return result; } fim_cxr Browser::fcmd_load(const args_t& args) { /* * loads the current file, if not already loaded */ fim::string result = FIM_CNS_EMPTY_RESULT; FIM_PR('*'); //for(size_t i=0;igetName() == current()) ) { result = "image already loaded\n";//warning goto ret; } if( empty_file_list() ) { result = "sorry, no image to load\n";//warning goto ret; } FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PRELOAD,current()) commandConsole_.set_status_bar("please wait while loading...", "*"); loadCurrentImage(); load_error_handle(_c); FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTLOAD) ret: FIM_PR('.'); return result; } fim_int Browser::find_file_index(const fim::string nf)const { fim_int fi = -1; for(flist_t::const_iterator fit=flist_.begin();fit!=flist_.end();++fit) if( string(*fit) == nf ) { fi = fit - flist_.begin(); goto ret; } ret: return fi; } bool Browser::present(const fim::string nf)const { bool ip = false; if( find_file_index(nf) >= 0 ) ip = true; return ip; } #ifdef FIM_READ_DIRS bool Browser::push_dir(const fim::string & nf, fim_flags_t pf, const fim_int * show_must_go_on) { DIR *dir = FIM_NULL; struct dirent *de = FIM_NULL; fim::string dn=nf; bool retval = false; FIM_PR('*'); fim::string re; if( show_must_go_on && !*show_must_go_on ) goto rret; if(cc.getIntVariable(FIM_VID_PRELOAD_CHECKS)!=1) goto nostat; /* we want a dir .. */ #ifdef HAVE_LIBGEN_H if( !is_dir( dn.c_str() ) ) dn = fim_dirname(dn); #else /* HAVE_LIBGEN_H */ if( !is_dir( dn )) goto ret; #endif /* HAVE_LIBGEN_H */ nostat: #if FIM_WANT_PROGRESS_RECURSIVE_LOADING if( pf & FIM_FLAG_PUSH_BACKGROUND ) { static int maxsize=0; const char * FIM_CLEARTERM_STRING = "\x1B\x4D"; /* man terminfo */ std::cout << FIM_CLEARTERM_STRING << "scanning: " << flist_.size()<< dn << std::endl; maxsize = FIM_MAX(dn.size(),maxsize); } #endif if ( ! ( dir = opendir(dn.c_str() ) )) goto ret; dn += FIM_CNS_DIRSEP_STRING; re = getGlobalStringVariable(FIM_VID_PUSHDIR_RE); if( re == FIM_CNS_EMPTY_STRING ) re = FIM_CNS_PUSHDIR_RE; //are we sure -1 is not paranoid ? while( ( de = readdir(dir) ) != FIM_NULL ) { if( de->d_name[0] == '.' && !de->d_name[1] ) continue; if( de->d_name[0] == '.' && de->d_name[1] == '.' && !de->d_name[2] ) continue; #if FIM_RECURSIVE_HIDDEN_DIRS_SKIP_CHECK /* We follow the convention of ignoring hidden files. */ if( (!(pf & FIM_FLAG_PUSH_HIDDEN)) && de->d_name[0] == '.' ) continue; #endif /* FIM_RECURSIVE_HIDDEN_DIRS_SKIP_CHECK */ { /* Note: Following circular links may cause memory exhaustion. */ const fim_fn_t pn = dn + fim_fn_t(de->d_name); if( is_dir( pn ) ) { #ifdef FIM_RECURSIVE_DIRS if( pf & FIM_FLAG_PUSH_REC ) retval |= push_dir( pn, pf, show_must_go_on); else #endif /* FIM_RECURSIVE_DIRS */ continue; } else { if( pn.re_match(re.c_str()) ) retval |= push_path( pn, pf | FIM_FLAG_PUSH_FILE_NO_CHECK ); } } #if FIM_WANT_BACKGROUND_LOAD if( ( pf & FIM_FLAG_PUSH_ONE ) && retval ) goto ret; #endif /* FIM_WANT_BACKGROUND_LOAD */ } ret: //retval = ( closedir(dir) == 0 ); closedir(dir); rret: FIM_PR('.'); return retval; } #endif /* FIM_READ_DIRS */ bool Browser::push_path(const fim::string & nf, fim_flags_t pf, const fim_int * show_must_go_on) { bool pec = false; // push error code #if 0 int eec = 0; // expansion error code #if HAVE_WORDEXP_H { wordexp_t p; eec = wordexp(nf.c_str(),&p,0); if( eec == 0 ) { for(size_t g=0;g= 1 && S_ISDIR(stat_s.st_mode)) { #if FIM_RECURSIVE_HIDDEN_DIRS_SKIP_CHECK if( ppd > 1 ) pf |= FIM_FLAG_PUSH_HIDDEN; #endif /* FIM_RECURSIVE_HIDDEN_DIRS_SKIP_CHECK */ goto isdir; } } //#endif /* HAVE_SYS_STAT_H */ #endif /* FIM_READ_DIRS */ /* we want a regular file .. */ if( ! S_ISREG(stat_s.st_mode) #ifdef FIM_READ_BLK_DEVICES && ! S_ISBLK(stat_s.st_mode) // NEW #endif /* FIM_READ_BLK_DEVICES */ ) { if(!lib) commandConsole_.set_status_bar((nf+" is not a regular file!").c_str(), "*"); goto ret; } #endif /* HAVE_SYS_STAT_H */ #endif /* FIM_CHECK_FILE_EXISTENCE */ } isfile: #ifdef FIM_CHECK_DUPLICATES if( ( ! ( pf & FIM_FLAG_PUSH_ALLOW_DUPS ) ) && present(nf) ) { //there could be an option to have duplicates... //std::cout << "no duplicates allowed..\n"; goto ret; } #endif /* FIM_CHECK_DUPLICATES */ flist_.push_back(nf); if(cc.getVariable(FIM_VID_DBG_COMMANDS).find('B') >= 0) std::cout << FIM_CNS_CLEARTERM << FIM_CNS_DBG_CMDS_PFX << " pushing " << nf << FIM_CNS_NEWLINE; setGlobalVariable(FIM_VID_FILELISTLEN,n_files()); retval = true; goto ret; isdir: #ifdef FIM_READ_DIRS retval = push_dir(nf,pf,show_must_go_on); #endif /* FIM_READ_DIRS */ ret: FIM_PR('.'); return retval; } #if FIM_EXPERIMENTAL_SHADOW_DIRS void Browser::push_shadow_dir(std::string fn) { #if FIM_EXPERIMENTAL_SHADOW_DIRS == 1 std::swap(flist_,hlist_); push_dir(fn,FIM_FLAG_PUSH_REC,NULL); std::swap(flist_,hlist_); #endif #if FIM_EXPERIMENTAL_SHADOW_DIRS == 2 shadow_dirs_.push_back(fn); #endif } #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ fim_int Browser::n_files(void)const { return flist_.size(); } void Browser::_unique(void) { // makes only sense if flist_ sorted. flist_._unique(); setGlobalVariable(FIM_VID_FILELISTLEN,n_files()); } fim::string Browser::_sort(const fim_char_t sc, const char*id) { flist_._sort(sc,id); return current(); } fim::string Browser::_random_shuffle(bool dts) { /* * sorts image filenames list * if dts==true, do time() based seeding * TODO: it would be cool to support a user supplied seed value */ #if FIM_USE_CXX11 std::random_device rd; std::mt19937 g(rd()); if( dts ) g.seed(time(FIM_NULL)); else g.seed(std::mt19937::default_seed); std::shuffle(flist_.begin(),flist_.end(),g); #else /* FIM_USE_CXX11 */ if( dts ) std::srand(time(FIM_NULL)); /* FIXME: AFAIK, effect of srand() on random_shuffle is not mandated by any standard. */ std::random_shuffle(flist_.begin(),flist_.end()); #endif /* FIM_USE_CXX11 */ return current(); } fim::string Browser::_clear_list(void) { flist_.erase(flist_.begin(),flist_.end()); setGlobalVariable(FIM_VID_FILELISTLEN,n_files()); return FIM_CNS_EMPTY_RESULT; } fim::string Browser::_reverse(void) { std::reverse(flist_.begin(),flist_.end()); return current(); } fim::string Browser::_swap(void) { /* * swap current with first */ if( n_files() > 1 && current_n() ) std::swap(flist_[0],flist_[current_n()]); return current(); } fim::string Browser::regexp_goto(const args_t& args, fim_int src_dir) { /* * goes to the next filename-matching file * TODO: this member function shall only find the index and return it ! */ const size_t c = current_n(),s = flist_.size(); size_t i,j; const fim::string rso = cc.isSetVar(FIM_VID_RE_SEARCH_OPTS) ? cc.getStringVariable(FIM_VID_RE_SEARCH_OPTS) : "bi"; int rsic = 1; /* ignore case */ int rsbn = 1; /* base name */ FIM_PR('*'); if ( rso && strchr(rso,'i') ) rsic = 1; else if ( rso && strchr(rso,'I') ) rsic = 0; if ( rso && strchr(rso,'b') ) rsbn = 1; else if ( rso && strchr(rso,'f') ) rsbn = 0; if( args.size() < 1 || s < 1 ) goto nop; last_regexp_ = args[0]; last_src_dir_ = src_dir; for(j=0;jis_multipage()) #else /* FIM_WANT_BDI */ if( N==1 && c_getImage() && c_getImage()->is_multipage()) #endif /* FIM_WANT_BDI */ { //if(1)std::cout<<"goto page "<img_goto_page(n); result = N; goto ret; } #if FIM_WANT_GOTOLAST if(getGlobalIntVariable(FIM_VID_LASTFILEINDEX) != current_image()) setGlobalVariable(FIM_VID_LASTFILEINDEX, current_image()); flist_.set_cf(n); #if FIM_WANT_LASTGOTODIRECTION if( ( n_files() + current_image() - getGlobalIntVariable(FIM_VID_LASTFILEINDEX) ) % n_files() > n_files() / 2 ) setGlobalVariable(FIM_VID_LASTGOTODIRECTION,"-1"); else setGlobalVariable(FIM_VID_LASTGOTODIRECTION,"+1"); #endif /* FIM_WANT_LASTGOTODIRECTION */ #endif /* FIM_WANT_GOTOLAST */ FIM_PR(' '); setGlobalVariable(FIM_VID_PAGE,0); setGlobalVariable(FIM_VID_FILEINDEX,current_image()); //setGlobalVariable(FIM_VID_FILEINDEX,cf_); setGlobalVariable(FIM_VID_FILENAME, current()); FIM_PR(' '); //loadCurrentImage(); result = n_files()?(flist_[current_n()]):nofile_; ret: FIM_PR('.'); return result; } fim::string Browser::get_next_filename(int n)const { /* * returns to the next image in the list, the mechanism * p.s.: n<>0 */ if( !flist_.size() ) return FIM_CNS_EMPTY_RESULT; return flist_[FIM_MOD(flist_.cf() + n,flist_.size())]; } fim::string Browser::next(int n) { fim::string gs = "+"; gs += fim::string(n); return goto_image_internal(gs.c_str(),FIM_X_NULL); } fim::string Browser::prev(int n) { fim::string gs = "-"; gs += fim::string(n); return goto_image_internal(gs.c_str(),FIM_X_NULL); } fim_cxr Browser::fcmd_goto(const args_t& args) { fim::string result = FIM_CNS_EMPTY_RESULT; if( args.size() > 0 ) { const fim_int cfi = current_n(); for(size_t i = 0; i=2) && ('/'==s[sl-1]) && (((sl>=3) && (c=='+' || c=='-') && s[1]=='/') ||( c=='/'))); isrj = (c=='+' || c=='-'); isdj = isrj && s[1] == '/' && ( sl == 2 || ( sl == 3 && strchr("udsbUDSB",s[2])) ); #if FIM_WANT_NEXT_ACCEL isac = !isre && isrj && isupper(s[sl-1]) && same_keypress_repeats>0; isbl = isac; #endif /* FIM_WANT_NEXT_ACCEL */ #if FIM_WANT_GOTO_DIR if( isdj ) { const int neg=(c=='-'?-1:1); std::string bcn; const char ct = sl < 3 ? 'S' : s[2]; switch(tolower(ct)) { case 'u': case 'd': case 's': bcn = fim_dirname(current()); break; case 'b': bcn = fim_basename_of(current()); break; } for(fim_int fi=0;fi bcn; break; case 'u': match = icn.length() < bcn.length() && bcn.compare(0,icn.length(),icn) == 0 ; break; case 'd': match = bcn.length() < icn.length() && icn.compare(0,bcn.length(),bcn) == 0 ; break; case 's': case 'b': match = bcn == icn; break; } if(isupper(ct)) match = ! match; if(match) { nf=idx; goto go_jump; } } } #endif /* FIM_WANT_GOTO_DIR */ #if FIM_WANT_VAR_GOTO if( isrj && s[1] && ( isalpha(s[1]) || s[1] == '_' ) ) { const char * ib = s+1, *ie = s+2; const int neg=(c=='-'?-1:1); bool ner=false; // non empty requirement std::map vals; std::vector keys; // ordered do { while(*ie && ( isalpha(*ie) || *ie == '_' || isdigit(*ie) ) ) ++ie; std::string varname(ib,ie); keys.push_back(varname); std::string varval = cc.id_.vd_[fim_basename_of(current())].getStringVariable(varname); vals[varname]=varval; } while(*ie=='|' && *(ib=++ie)); if(*ie == '+' ) ner = true; for(fim_uint fi=0;fi "< "< 0 && ( isfg || pcnt || ispg )) { l = tolower( s[ li = sl-2 ] ); if( l == '%' ) pcnt = true; if( l == 'p' ) ispg = true; if( l == 'f' ) isfg = true; } if( c=='$' || c == 'l' ) gv = mv - 1; if( (isrj) && (!isfg) && (!ispg) && pc > 1 ) { ispg = true; if(( cp == 0 && gv < 0 ) || (cp == pc-1 && gv > 0 ) ) if( fc > 1 ) isfg = true, ispg = false; } #if FIM_WANT_NEXT_ACCEL if( isac ) gv *= std::pow(2,FIM_MIN(same_keypress_repeats,12)); #endif /* FIM_WANT_NEXT_ACCEL */ if( ispg ) mv = pc; else mv = fc; if( pcnt ) { gv = FIM_INT_PCNT_OF_100(gv,mv); } if( !mv ) { goto ret; } if( isfg && ispg ) { goto err; } //if((!isre) && (!isrj))nf=gv; //if(isrj && gv<0 && cf==1){cf=0;}//TODO: this is a bugfix if( (!isrj) && gv > 0 ) gv = gv - 1;// user input is interpreted as 1-based if( !isbl ) gv = FIM_MOD(gv,mv); if( ispg ) { if( isrj ) { np = cp + gv; if( isbl ) np = FIM_MIN(FIM_MAX(np,0),mv-1); } else np = gv; } else { np = 0; /* first page -- next file's page count is unknown ! */ if( isrj ) { nf = cf + gv; if( isbl ) nf = FIM_MIN(FIM_MAX(nf,0),mv-1); } else nf = gv; } gv = FIM_MOD(gv,mv); nf = FIM_MOD(nf,fc); np = FIM_MOD(np,pc); if(0) cout << "goto: " <<" s:" << s <<" cf:" << cf <<" cp:" << cp << " nf:" << nf << " np:" << np << " gv:" << gv << " mv:" << mv << " isrj:"<img_goto_page(np); } else goto_image(nf,isfg?true:false); if(!(xflags&FIM_X_NOAUTOCMD)) { FIM_AUTOCMD_EXEC(FIM_ACM_POSTGOTO,ncf); } } } ret: errmsg = FIM_CNS_EMPTY_RESULT; err: FIM_PR('.'); return errmsg; } /* goto_image_internal */ fim_stat_t fim_get_stat(const fim_fn_t& fn, bool * dopushp); fim::string Browser::do_filter(const args_t& args, MatchMode rm, bool negative, enum FilterAction faction) { /* * TODO: introduce flags for negative (instead of a bool). * TODO: message like 'marked xxx files' ... */ fim::string result; const bool wom = (flist_.size() > FIM_CNS_ENOUGH_FILES_TO_WARN ); fim_int marked = 0; fim_bitset_t lbs(flist_.size()); // limit bitset, used for mark / unmark / delete / etc // fim_fms_t dt; FIM_PR('*'); // std::cout << "match mode:" << rm << " negation:" << negative << " faction:" << faction << "\n"; // TODO: a debug mode shall enable such printouts. if ( args.size() > 1 && rm == ListIdxMatch ) { size_t min_idx=0,max_idx=FIM_MAX_VALUE_FOR_TYPE(size_t); const std::string ss(args[1]); std::istringstream is(ss); if(is.peek()!='-') // MIN- { if(!isdigit(is.peek())) { result = "Bad MINIDX[-MAXIDX] expression ! MINIDX or MAXIDX should be a number."; goto nop; } is >> min_idx; if(tolower(is.peek())=='k') is.ignore(1), min_idx *= FIM_CNS_Ki; while(is.peek() != -1 && is.peek() != '-') is.ignore(1); if(is.peek() == -1) { max_idx=min_idx; goto parsed_idx; } } if(is.peek()=='-') // -MAX { is.ignore(1); is >> max_idx; if(tolower(is.peek())=='k') is.ignore(1), max_idx *= FIM_CNS_Ki; } parsed_idx: if(min_idx>max_idx) std::swap(min_idx,max_idx); if(min_idx>=flist_.size() || max_idx < 1) { if(wom) commandConsole_.set_status_bar("requested index range is wrong (not so many files...)", "*"); goto nop; } min_idx=FIM_MIN(FIM_MAX(min_idx,1U),flist_.size()); max_idx=FIM_MIN(FIM_MAX(max_idx,1U),flist_.size()); // std::cout << "Limiting index between " << min_idx << " and " << max_idx << " .\n"; if(min_idx==1 && max_idx>=flist_.size()) { if(wom) commandConsole_.set_status_bar("requested index limit range covers entire list.", "*"); goto nop; } if(wom) commandConsole_.set_status_bar("limiting to list index range...", "*"); /* not efficient but conceptually clean in this context */ for(size_t fi=min_idx;fi<=max_idx;++fi) lbs.set(fi-1); negative = !negative; goto rfrsh; } if ( rm == TimeMatch || rm == SizeMatch ) { #if FIM_WANT_FLIST_STAT off_t min_size=0,max_size=FIM_MAX_VALUE_FOR_TYPE(off_t); time_t min_mtime=0,max_mtime=FIM_MAX_VALUE_FOR_TYPE(time_t); const std::string ss(args[args.size()>1?1:0]); // if 0 we'll ignore this std::istringstream is(ss); if ( rm == SizeMatch ) { if(args.size()==1) { const fim_stat_t fss = fim_get_stat(current(),FIM_NULL); if( ( min_size=max_size=fss.st_size ) == 0 ) goto nop; goto parsed_limits; } if(is.peek()!='-') // MIN- { if(!isdigit(is.peek())) { result = "Bad MINSIZE[-MAXSIZE] expression ! MINSIZE or MAXSIZE should be a number followed by K or M."; goto nop; } is >> min_size; if(tolower(is.peek())=='k') is.ignore(1), min_size *= FIM_CNS_K; else if(tolower(is.peek())=='m') is.ignore(1), min_size *= FIM_CNS_M; while(is.peek() != -1 && is.peek() != '-') is.ignore(1); if(is.peek() == -1) { max_size=min_size; goto parsed_limits; } } if(is.peek()=='-') // -MAX { is.ignore(1); is >> max_size; if(tolower(is.peek())=='k') is.ignore(1), max_size *= FIM_CNS_K; else if(tolower(is.peek())=='m') is.ignore(1), max_size *= FIM_CNS_M; } } if ( rm == TimeMatch ) { if(args.size()==1) { const fim_stat_t fss = fim_get_stat(current(),FIM_NULL); if( ( min_mtime=max_mtime=fss.st_mtime ) == 0 ) goto nop; min_mtime-=60*60*24; max_mtime+=60*60*24; goto parsed_limits; } if(strchr(args[1].c_str(),'/')) { // DD/MM/YYYY format min_mtime=0; if(isdigit(is.peek())) { struct tm min_mtime_str; fim_bzero(&min_mtime_str,sizeof(min_mtime_str)); is >> min_mtime_str.tm_mday; if(is.peek() != '/') goto errpd; is.ignore(1); is >> min_mtime_str.tm_mon; min_mtime_str.tm_mon-=1; if(is.peek() != '/') goto errpd; is.ignore(1); is >> min_mtime_str.tm_year; min_mtime_str.tm_year-=1900; min_mtime=mktime(&min_mtime_str); // TODO: add check if 4-bytes time_t and after 20380119 } else ; // -MAX if(is.peek() == -1) max_mtime = min_mtime; if(is.peek() != '-') goto errpd; is.ignore(1); // eat '-' if(!isdigit(is.peek())) goto errpd; else { struct tm max_mtime_str; fim_bzero(&max_mtime_str,sizeof(max_mtime_str)); is >> max_mtime_str.tm_mday; if(is.peek() != '/') goto errpd; is.ignore(1); is >> max_mtime_str.tm_mon; max_mtime_str.tm_mon-=1; if(is.peek() != '/') goto errpd; is.ignore(1); is >> max_mtime_str.tm_year; max_mtime_str.tm_year-=1900; max_mtime=mktime(&max_mtime_str); // TODO: add check if 4-bytes time_t and after 20380119 } // std::cout << min_mtime << " .. " << max_mtime << "\n"; goto parsed_limits; } // shall proof this code once more for corner cases if(is.peek()!='-') // MIN- { if(!isdigit(is.peek())) { result = "Bad MINTIME[-MAXTIME] expression ! MINTIME or MAXTIME should be a number."; goto nop; } is >> min_mtime; while(is.peek() != -1 && is.peek() != '-') is.ignore(1); if(is.peek() == -1) { max_mtime=min_mtime; goto parsed_limits; } } if(is.peek()=='-') // -MAX { is.ignore(1); is >> max_mtime; } } parsed_limits: if(min_size>max_size) std::swap(min_size,max_size); if(min_mtime>max_mtime) std::swap(min_mtime,max_mtime); // std::cout << "Limiting size between " << min_size << " and " << max_size << " bytes.\n"; // std::cout << "Limiting time between " << min_mtime << " and " << max_mtime << " .\n"; if(wom) commandConsole_.set_status_bar("getting stat() info...", "*"); flist_.get_stat(); if ( rm == SizeMatch ) { if(wom) commandConsole_.set_status_bar("limiting to a size...", "*"); for(size_t fi=0;fi, rather than this */ for(size_t i=0;i=0) lbs.set(fi); } i=j; } negative = !negative; goto rfrsh; } #endif /* FIM_WANT_LIMIT_DUPBN */ #if FIM_WANT_FILENAME_MARK_AND_DUMP if ( rm == MarkedMatch ) { if(wom) commandConsole_.set_status_bar("limiting marked...", "*"); for(size_t i=0;i0) { args_t rlist = args; //the remove list /* * the list is unsorted. it may contain duplicates * if this software will have success, we will have indices here :) * sort(rlist.begin(),rlist.end());... */ //fim_int lf = flist_.size(); #if FIM_WANT_PIC_LVDN if ( rm == VarMatch ) if(rlist.size() < 2) rm = CmtMatch; #else if ( rm == VarMatch ) rm = FullFileNameMatch; #endif /* FIM_WANT_PIC_LVDN */ // if(wom) commandConsole_.set_status_bar("limiting matching...", "*"); if(wom) { fim::string msg = ""; switch( rm ) { case(FullFileNameMatch ): msg = "limiting to full filename match..."; break; case(PartialFileNameMatch): msg = "limiting to partial filename match..."; break; case(VarMatch ): msg = string("limiting variable \"") + string(rlist[0]) + string("\" matching value \"") + string(rlist[1]) + string("\" ..."); break; case(CmtMatch ): msg = "limiting to comment match..."; break; default: msg = ""; /* not foreseen in this branch */ } commandConsole_.set_status_bar(msg, "*"); } // dt = - getmilliseconds(); for(size_t r=0;ronRight(approx_fraction) && viewport()->onBottom(approx_fraction)) next(); else if(viewport()->onRight(approx_fraction)) { viewport()->pan("down",FIM_CNS_SCROLL_DEFAULT); while(!(viewport()->onLeft())) viewport()->pan("left",FIM_CNS_SCROLL_DEFAULT); } else viewport()->pan("right",FIM_CNS_SCROLL_DEFAULT); } else next(1); return FIM_CNS_EMPTY_RESULT; } fim_cxr Browser::scrolldown(const args_t& args) { if(c_getImage() && viewport()) { if(viewport()->onBottom()) next(); else viewport()->pan("down",FIM_CNS_SCROLL_DEFAULT); } else next(1); return FIM_CNS_EMPTY_RESULT; } fim_cxr Browser::fcmd_scroll(const args_t& args) { FIM_PR('*'); FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PREPAN,current()) if(args.size()>0 && args[0]=="forward") scrollforward(args); else scrolldown(args); FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTPAN) FIM_PR('.'); return FIM_CNS_EMPTY_RESULT; } fim_cxr Browser::fcmd_info(const args_t& args) { /* * short information in status-line format */ fim::string r = current(); FIM_PR('*'); if(c_getImage()) r += c_getImage()->getInfo(); else r += " (unloaded)"; FIM_PR('.'); return r; } #if FIM_WANT_OBSOLETE fim::string Browser::info(void) { return fcmd_info(args_t(0)); } #endif /* FIM_WANT_OBSOLETE */ fim_cxr Browser::fcmd_rotate(const args_t& args) { fim_angle_t angle; // degrees FIM_PR('*'); if( args.size() == 0 ) angle = FIM_CNS_ANGLE_ONE; else angle = fim_atof(args[0].c_str()); if( angle == FIM_CNS_ANGLE_ZERO) goto ret; if(c_getImage()) { //angle = getGlobalFloatVariable(FIM_VID_ANGLE); // FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PREROTATE,current()) FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PRESCALE,current()) if(viewport()) viewport()->img_rotate(angle); FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTSCALE) // FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTROTATE) } ret: FIM_PR('.'); return FIM_CNS_EMPTY_RESULT; } fim_cxr Browser::fcmd_align(const args_t& args) { fim::string result = FIM_CMD_HELP_ALIGN; FIM_PR('*'); if( args.size() < 1 ) goto err; if( !args[0].c_str() || !args[0].re_match("^(bottom|top|left|right|center|info)") ) goto err; if(args[0].re_match("info")) { ViewportState viewportState = *viewport(); std::ostringstream oss; oss << "alignment info:"; oss << " steps:" << viewportState.steps_; oss << " hsteps:" << viewportState.hsteps_; oss << " vsteps:" << viewportState.vsteps_; oss << " top:" << viewportState.top_; oss << " left:" << viewportState.left_; oss << " panned:" << viewportState.panned_; result = oss.str(); } else if( c_getImage() ) { FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PREPAN,current()) if(c_getImage() && viewport()) { if(args[0].re_match("top")) viewport()->align('t'); if(args[0].re_match("bottom")) viewport()->align('b'); if(args[0].re_match("left")) viewport()->align('l'); if(args[0].re_match("right")) viewport()->align('r'); if(args[0].re_match("center")) viewport()->align('c'); } FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTPAN) result = FIM_CNS_EMPTY_RESULT; } err: FIM_PR('.'); return result; } const Image* Browser::c_getImage(void)const { const Image* image = FIM_NULL; if( viewport() ) image = viewport()->c_getImage(); return image; } Viewport* Browser::viewport(void)const { return (commandConsole_.current_viewport()); } fim_fn_t Browser::current(void)const { if( empty_file_list() ) return nofile_; return flist_[flist_.cf()]; } int Browser::empty_file_list(void)const { return flist_.size() == 0; } fim::string Browser::do_push(const args_t& args) { /* push to image list */ for(size_t i=0;in_pages(); return pi; } size_t Browser::byte_size(void)const { size_t bs = 0; bs += cache_.byte_size(); bs += sizeof(*this); #if FIM_EXPERIMENTAL_SHADOW_DIRS == 1 for (const auto & e : hlist_) bs += e.capacity(); #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ /* TODO: this is incomplete ... */ return bs; } void Browser::mark_from_list(const args_t& argsc) { /* TODO: one would like to have better matching options */ if (argsc.size() ) this->do_filter(argsc,Browser::PartialFileNameMatch,false,Browser::Mark); } bool Browser::dump_desc(const fim_fn_t nf, fim_char_t sc, const bool want_all_vars, const bool want_append)const { /* Dumps descriptions of the current images list. on no comment does not touch the file. */ #if FIM_WANT_PIC_LBFL // TODO: if no nf, then standard output std::ostringstream cmtfc; // comment file contents for(size_t i=0;istat_ = fim_get_stat(*fit,FIM_NULL); #endif /* FIM_WANT_FLIST_STAT */ } flist_t::flist_t(const args_t& a):cf_(0) { /* FIXME: unused for now */ this->reserve(a.size()); for(args_t::const_iterator fit=a.begin();fit!=a.end();++fit) { bool dopush; const fim_stat_t stat_s = fim_get_stat(*fit,&dopush); if(dopush) push_back(fim::fle_t(*fit,stat_s)); } #if FIM_USE_CXX11 this->shrink_to_fit(); #else /* FIM_USE_CXX11 */ this->reserve(this->size()); #endif /* FIM_USE_CXX11 */ } const fim::string flist_t::pop(const fim::string& filename, bool advance) { fim::string s; if( filename != FIM_CNS_EMPTY_STRING ) { const size_t idx = std::find(this->begin(),this->end(),filename) - this->begin(); #if FIM_USE_CXX11 this->erase(std::remove_if(this->begin(),this->end(),[&](const fim::fle_t&fl)->bool{return fim::string(fl)==filename;}),this->end()); #else #if 0 struct flecmp { const fim::string&en; flecmp(const fim::string &fn):en(fn){} bool operator()(const fim_fn_t&r)const{return fim::string(r) == en;} }; flecmp fci(filename); this->erase(std::remove_if(this->begin(),this->end(),fci),this->end()); #else for( size_t i=0; i < this->size(); ++i ) if( fim::string((*this)[i]) == filename ) this->erase(this->begin()+i); #endif #endif if (idx < cf_) cf_--; } else if( size() ) { assert(cf_>=0); s = (*this)[cf_]; this->erase( this->begin() + cf_ ); if(cf_ && ! (advance && cf_ < size() ) ) cf_--; } return s; } void flist_t::_unique() { // this only makes sense if the list is sorted. this->erase(std::unique(this->begin(), this->end()), this->end()); adj_cf(); } void flist_t::_set_union(const flist_t & clist) { flist_t mlist; this->_sort(FIM_SYM_SORT_FN); mlist.reserve(this->size()+clist.size()); std::set_union(clist.begin(),clist.end(),this->begin(),this->end(),std::back_inserter(mlist)); #if FIM_USE_CXX11 mlist.shrink_to_fit(); #endif /* FIM_USE_CXX11 */ this->assign(mlist.begin(),mlist.end()); } void flist_t::_set_difference_from(const flist_t & clist) { flist_t mlist; this->_sort(FIM_SYM_SORT_FN); mlist.reserve(this->size()+clist.size()); std::set_difference(clist.begin(),clist.end(),this->begin(),this->end(),std::back_inserter(mlist)); #if FIM_USE_CXX11 mlist.shrink_to_fit(); #endif /* FIM_USE_CXX11 */ this->assign(mlist.begin(),mlist.end()); } void flist_t::erase_at_bitset(const fim_bitset_t& bs, fim_bool_t negative) { size_t ecount = 0; #if FIM_USE_CXX11 const auto bit=this->begin(); const auto eit=this->end(); for(auto fit=bit;fit!=eit;++fit) if(bs.at(fit-bit) != negative) this->erase(fit-ecount),ecount++; #else /* FIM_USE_CXX11 */ const size_t tsize = size(); for(size_t pos=0;poserase(this->begin()+pos-ecount),ecount++; #endif /* FIM_USE_CXX11 */ // TODO: updating cf_ here would make sense, but is redundant } fim_bool_t flist_t::pop_current(void) { if( this->size() <= 0 ) return false; this->erase( this->begin() + cf() ); return true; } flist_t flist_t::copy_from_bitset(const fim_bitset_t& bs, fim_bool_t positive) const { flist_t nlist; #if FIM_USE_CXX11 const auto bit=this->cbegin(); const auto eit=this->cend(); for(auto fit=bit;fit!=eit;++fit) if(bs.at(fit-bit) != positive ) nlist.emplace_back(*fit);// this might spare constructor //nlist.push_back(*fit); #else /* FIM_USE_CXX11 */ const size_t tsize = size(); for(size_t pos=0;posbegin()+pos)); #endif /* FIM_USE_CXX11 */ return nlist; } //std::string fle_t::operator(){return fn;} fle_t::fle_t(void) { } fle_t::fle_t(const fim_fn_t& s):fim_fn_t(s) { #if FIM_WANT_FLIST_STAT fim_bzero(&stat_,sizeof(stat_)); #endif /* FIM_WANT_FLIST_STAT */ } fle_t::fle_t(const fim_fn_t& s, const fim_stat_t & ss):fim_fn_t(s) #if FIM_WANT_FLIST_STAT ,stat_(ss) #endif /* FIM_WANT_FLIST_STAT */ { } struct FimBaseNameSorter { bool operator() (const fim_fn_t& lfn, const fim_fn_t& rfn) { const char * ls = lfn.c_str(); const char * rs = rfn.c_str(); int scr = 0; if(ls && rs) scr = (strcmp(fim_basename_of(ls),fim_basename_of(rs))); return (scr < 0); } } fimBaseNameSorter; struct FimByVarSorter { std::string id; bool operator() (const fim_fn_t& lfn, const fim_fn_t& rfn) { const char * ls = lfn.c_str(); const char * rs = rfn.c_str(); int scr = 0; const std::string lsv = cc.id_.vd_[fim_basename_of(ls)].getStringVariable(id); const std::string rsv = cc.id_.vd_[fim_basename_of(rs)].getStringVariable(id); scr = (strcmp(lsv.c_str(),rsv.c_str())); return (scr < 0); } }; #if FIM_WANT_SORT_BY_STAT_INFO #if FIM_WANT_FLIST_STAT struct FimSizeSorter { bool operator() (const fim::fle_t & lfn, const fim::fle_t & rfn) { return (lfn.stat_.st_size < rfn.stat_.st_size); } }fimSizeSorter; struct FimDateSorter { bool operator() (const fim::fle_t & lfn, const fim::fle_t & rfn) { return (lfn.stat_.st_mtime < rfn.stat_.st_mtime); } }fimDateSorter; #else /* FIM_WANT_FLIST_STAT */ struct FimDateSorter { bool operator() (const fim_fn_t& lfn, const fim_fn_t& rfn) { struct stat lstat_s; struct stat rstat_s; stat(lfn.c_str(),&lstat_s); stat(rfn.c_str(),&rstat_s); return (lstat_s.st_mtime < rstat_s.st_mtime); } }fimDateSorter; #endif /* FIM_WANT_FLIST_STAT */ #endif /* FIM_WANT_SORT_BY_STAT_INFO */ void flist_t::_sort(const fim_char_t sc, const char*id) { /* TODO: can cache sorting status, would make e.g. Browser::do_filter more efficient */ if(sc==FIM_SYM_SORT_FN) std::sort(this->begin(),this->end()); if(sc==FIM_SYM_SORT_BN) std::sort(this->begin(),this->end(),fimBaseNameSorter); if(sc==FIM_SYM_SORT_BV) { FimByVarSorter fimByVarSorter; fimByVarSorter.id=id; std::sort(this->begin(),this->end(),fimByVarSorter); } #if FIM_WANT_SORT_BY_STAT_INFO if(sc==FIM_SYM_SORT_MD) { this->get_stat(); std::sort(this->begin(),this->end(),fimDateSorter); } if(sc==FIM_SYM_SORT_SZ) { this->get_stat(); std::sort(this->begin(),this->end(),fimSizeSorter); } #endif /* FIM_WANT_SORT_BY_STAT_INFO */ } } /* namespace fim */ fim-0.6-rc2/src/Arg.h0000644000175000017500000000226214454347340011222 00000000000000/* $LastChangedDate: 2017-07-23 10:17:04 +0200 (Sun, 23 Jul 2017) $ */ /* Arg.h : argument lists (c) 2007-2017 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_ARG_H #define FIM_ARG_H #include #include "fim_string.h" namespace fim { typedef std::vector args_t; int fim_args_opt_count(const args_t& args, const char oc); bool fim_args_opt_have(const args_t& args, fim::string optname); std::ostream& operator<<(std::ostream& os, const args_t& v); } #endif /* FIM_ARG_H */ fim-0.6-rc2/src/fimgs0000755000175000017500000003114714454347340011377 00000000000000#!/bin/bash # $Id: fimgs 1921 2023-03-25 14:49:04Z dezperado $ # (c) 2007-2023 Michele Martone # This is a modified version of the original fbgs script by Gerd Hoffman. # Note: it probably won't work on bash version < 3.0. # This script uses a temporary directory to stores rendered/wget'ed files # This directory is named after the process ID # Possible improvements: # - regexp usage # - adapt to work withour rar or unzip # - give option to wget # - may add a "-o" option to specify $FIMTDPFX FIMSHMEM=/dev/shm FIMVARTD=/var/tmp if test -d ${FIMSHMEM} -a -w ${FIMSHMEM} ; then FIMTMPDIR=$FIMSHMEM else FIMTMPDIR=$FIMVARTD fi FIMTDPFX=fbps DIR="${TMPDIR-$FIMTMPDIR}/${FIMTDPFX}-$$" #GSRESOLUTION="" #GSRESOLUTION=${GSRESOLUTION:--r240x240} GSRESOLUTION=${GSRESOLUTION:-120x120} shopt -s nocasematch # we must have write permissions in that directory mkdir -p "$DIR" || exit 1 # we want that directory clean after this script execution, no matter what happens trap 'rm -rf $DIR' EXIT # useless for now :) # declare -f # useless, too # export -f # as advised in man which, for mysterious reasons ( C compatible ) # which () # { # ( alias; declare -f ; ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@ # } #export -f which FIMERRCV=255 # checks if the first supplied argument is in the current $PATH function check_in_path() { local cmd="$1"; [[ -z "$cmd" ]] && return 0 [[ -z $(which "$cmd" 2>/dev/null) ]] && return ${FIMERRCV} return 0 } # output functions function info() { echo ' [+]' "$@" 1>&2 ; } function einfo() { echo ' [-]' "$@" 1>&2 ; } function die() { einfo "ERROR : $*" 1>&2 ; exit ${FIMERRCV}; } # our favourite framebuffer viewing program :) FBI=fim check_in_path sort || die "no sort in \$PATH" check_in_path echo || die "no echo in \$PATH" check_in_path find || die "no find in \$PATH" #check_in_path wget || die "no wget in \$PATH" check_in_path gs || die "no gs (ghostscript) in \$PATH" #check_in_path xz || die "no xz in \$PATH" #check_in_path bunzip2 || die "no bunzip2 in \$PATH" check_in_path tar || die "no tar in \$PATH" check_in_path basename || die "no basename in \$PATH" check_in_path md5sum || die "no md5sum in \$PATH" #check_in_path rar || die "no rar in \$PATH" #check_in_path unzip || die "no unzip in \$PATH" #check_in_path scp || die "no scp in \$PATH" # parse options fbi_read_opts="--autotop --autowidth" fbi_default_opts="--autozoom" fbiopts="$fbi_default_opts" gsopts="-q" #passwd="" opt=1 # in this way odd filenames are kept intact, be WARNED while test "$opt" = "1" #set -- `getopt "" "$@"` #while [ ! -z "$1" ] do case "$1" in # -l) gsopts="$gsopts -r100x100" # shift # ;; # -xl) gsopts="$gsopts -r120x120" # shift # ;; # -xxl) gsopts="$gsopts -r150x150" # shift # ;; # -q | -a) # fbiopts="$fbiopts $1" # shift # ;; # -d | -m | -t | -g | -f) # fbiopts="$fbiopts $1 $2" # shift; shift # ;; # explicit option passing # -t) fbiopts="$fbiopts --no-framebuffer" # shift # ;; -r) GSRESOLUTION="$2"; shift ; shift ;; # -c) fbiopts="$fbiopts --execute-commands $2" # shift; shift # ;; # -F) fbiopts="$fbiopts --final-commands $2" # shift; shift # ;; -p) GSPASSWORD="$2" shift; shift ;; -m) shift cat << EOF .TH fimgs 1 "(c) 2007-2023 Michele Martone" .SH NAME fimgs - poor man's [http://]PostScript/pdf/dvi/cbr/rar/cbz/zip viewer based on fim .SH SYNOPSIS .B fimgs [ {fimgs-options} ] file [-- [{fim-options}]] .SH DESCRIPTION .B fimgs is a wrapper script which takes a PostScript or pdf or .cbr or .rar or .cbz or .zip or .dvi or any of the above prefixed with http:// or https:// or ssh: as input, renders the pages using ghostscript into a temporary directory and finally calls \fB $FBI\fP to display them. In case of compressed archives (in ZIP or RAR formats), the images are decompressed into a directory and displayed using \fB fim\fP. In this case, only images contained in the archive will be displayed (no nested archives or pdf's or ps's or dvi's). The temporary directory name will be of the form \$TMPDIR/$FIMTDPFX-\$\$. If the \$TMPDIR environment variable is unset, $FIMSHMEM and $FIMVARTD will be checked for existence and permissions. The \$\$ above is the script process ID. The script deletes the temporary directory when \fB fim\fP terminates. In order to uncompress RAR archives, fimgs will use 'unrar-nonfree' or 'rar' or 'unrar-free'. In order to uncompress ZIP archives, fimgs will use 'zip'. In order to uncompress BZ2 files, 'bunzip2' will be used, if present. In order to uncompress TAR.GZ or TAR.BZ2 or TAR.XZ archives, fimgs will use 'tar'. In order to fetch http:// or https:// prefixed URLS, 'wget' will be used, if present. In order to fetch ssh: prefixed host:path locations, 'scp' will be used. In case of a CBZ, CBR, PDF, PS, or DVI file, will invoke \fB fim\fP with '$fbi_read_opts'. .SH OPTIONS To pass through options to \fB fim\fP, you may specify them after "--". Default options are '$fbi_default_opts'. .B -r {resolution} Specify resolution for the 'gs' -r option (e.g.: 96x96; default $GSRESOLUTION). .TP .B -m Dump a man page for fimgs. .TP .B -p {password} Specify password for the 'gs' -p (password) option. .TP .B -h Will display a help message. .\" Additionally you can specify -l, -xl or -xxl to get the pages .\" rendered with 100, 120 or 150 dpi (default is 75). .SH SEE ALSO fim(1), fimrc(1), gs(1), fbi(1), fbgs(1), bash(1) ,zip(1), rar(1), rar-free(1), unrar-free(1), tar(1), gzip(1) .SH AUTHOR Michele Martone . EOF exit; ;; -h) #help text echo "$0 [{fimgs-options}] {files} [-- [fim-options]] " echo -e "\nNote that any file in {files} may be a (appropriately named) :" echo -e " PDF (.pdf) file" echo -e " Postscript (.ps) file" echo -e " Encapsulated Postscript (.eps) file" echo -e " DeVice Independent (.dvi) file" echo -e " TAR (.tar) archive" echo -e " BZ2 (.bz2) archive" echo -e " XZ (.xz) archive" echo -e " GZIP (.gz) archive" echo -e " https:// resource (web resource)" echo -e " http:// resource (web resource)" echo -e "\nNote that you cannot view files named like options (no -- meta-option apply to fimgs)." echo -e "\n \`man fimgs\` will give you more info." exit 1 ;; --) break;; # -- is *not* to be passed to fim *) [[ "$1" =~ ^-.* ]] && fbiopts="$fbiopts $1"; break;; # -*) echo "unknown option: $1" # exit 1 # ;; # *) opt=0 # ;; esac # shift done ############################################################################### check_in_path $FBI || die "no fim in \$PATH" ############################################################################### ## HANDLING OF CBR AND CBZ ARCHIVES ############################################################################### UNCBZ="unzip" ; # shellcheck disable=SC2089 ZOPT="-x '*/*'" # suits for Info-ZIP implementation #UNRAR="unrar-free" #UNRAR="rar" UNRAR="unrar-nonfree" check_in_path $UNRAR || UNRAR="rar" check_in_path $UNRAR || UNRAR="unrar-free" #check_in_path $UNRAR || UNRAR="unrar-nonfree" UNCBR="$UNRAR x" # suits for Alexander Roshal's RAR 3.51 UNTAR="tar xf" UNTGZ="tar xzf" UNBZ="tar xjf" UNXZ="tar xJf" #while [[ "$1" != "" ]] #while [[ "$#" -gt "0" ]] while test x"$opt" = x"1" #while shift do f="$1"; if test x"$f" = x"--" ; then shift; while test "$#" -gt "0" ; do f="$1"; fbiopts="$fbiopts $1" ; shift; done; f=/dev/null ; fi shift; [[ "$f" =~ 'https://' ]] && check_in_path wget && { fn="$DIR"/"`basename $f`" && wget "$f" -O "$fn"; f="$fn"; } [[ "$f" =~ 'http://' ]] && check_in_path wget && { fn="$DIR"/"`basename $f`" && wget "$f" -O "$fn"; f="$fn"; } [[ "$f" =~ 'ssh:' ]] && { bfn="`basename ${f/#ssh:/}`" && fn="$DIR"/"`echo $bfn | sed s/^.*://`" && scp "${f/#ssh:/}" "$fn" ; f="$fn"; } [[ -z "$f" ]] && break ; if ! [[ -e "$f" ]] ; then exit 255; fi #while [[ ! -f "$f" ]] ; do shift ; [[ "$#" -lt 0 ]] && break 2 ; done ############################################################################### ## HANDLING OF DVI,PS AND PDF FILES ############################################################################### #[[ "$f" =~ .dvi$ ]] && f="/tmp/$$.ps" && dvips -q "$f" -o "$f" ; rm -fR $DIR" EXIT #[[ -f "$f" ]] || { echo "an option!" ; fbiopts="$fbiopts $f" ; break ; } # not a file, but an option [[ "$f" =~ .dvi$ ]] && fbiopts=" -P $fbiopts" [[ "$f" =~ .pdf$ ]] && fbiopts=" -P $fbiopts" [[ "$f" =~ .ps$ ]] && fbiopts=" -P $fbiopts" [[ "$f" =~ .eps$ ]] && fbiopts=" -P $fbiopts" if ( [[ "$f" =~ .ps$ ]] || [[ "$f" =~ .pdf$ ]] ) || ( [[ "$f" =~ .eps$ ]] || [[ "$f" =~ .dvi$ ]] ) then BDIR='' if check_in_path md5sum then DIRS=$(echo "$f" | md5sum ) DIRS=${DIRS// /} DIRS=${DIRS//-/} BDIR="$DIR/$DIRS" # this means that giving duplicate input files will overwrite the original render directory... else BDIR="$DIR/"$(basename "$f") fi mkdir -p $BDIR || die "failed mkdir $BDIR" info "rendering $f to $BDIR.." #this is a workaround for gs's .. bug .. [[ "$f" =~ ^\.\. ]] && f="$PWD/$f" # note : we cannot render gs renderable documents with more than 1000 pages... gs -dSAFER -dNOPAUSE -dBATCH \ -sPDFPassword="$GSPASSWORD" \ -sDEVICE=png256 -r${GSRESOLUTION} -sOutputFile=$BDIR/ps%03d.png \ $gsopts \ "$f" || die "ghostscript failed rendering!" # still unused options : # -sDEVICE=tiffpack \ # -sOutputFile=$DIR/ps%03d.tiff # tell the user we are done :-) #echo -ne "\\007" #echo stuff : `ls -l $DIR` #echo "contents of $DIR:" #$FBI $fbiopts -P $DIR/ps*.png #$FBI $fbiopts -P $DIR/ps*.png 2>/dev/null #fbi $fbiopts -P $DIR/ps*.tiff # sanity check #pages=`ls $DIR/ 2>/dev/null | wc -l` #if test "$pages" -eq "0"; then # echo # echo "Oops: ghostscript wrote no pages ($pages)?" # echo # exit 1 #elif ( ( [[ "$f" =~ \\.cbr$ ]] || [[ "$f" =~ \\.cbz$ ]] ) || ( [[ "$f" =~ \\.rar$ ]] || [[ "$f" =~ \\.zip$ ]] ) || ( [[ "$f" =~ \\.tgz$ ]] || [[ "$f" =~ \\.tar.gz$ ]] ) || ( [[ "$f" =~ \\.tar$ ]] || [[ "$f" =~ \\.tar.bz2$ ]] ) ) && ! [[ "$f" =~ '^http://' ]] elif ( ( [[ "$f" =~ .CBR$ ]] || [[ "$f" =~ .CBZ$ ]] || [[ "$f" =~ .cbr$ ]] || [[ "$f" =~ .cbz$ ]] ) || ( [[ "$f" =~ .rar$ ]] || [[ "$f" =~ .zip$ ]] ) || ( [[ "$f" =~ .tgz$ ]] || [[ "$f" =~ .tar.gz$ ]] ) || ( [[ "$f" =~ .tar$ ]] || [[ "$f" =~ .tar.bz2$ ]] || [[ "$f" =~ .tar.xz$ ]] ) ) && ! [[ "$f" =~ 'http://' ]] && ! [[ "$f" =~ 'https://' ]] then # in the case of an archive ... # an ideal fimgs script would unpack recursively in search for interesting files.. # 20070925 there were problems with '\\.' so i put '.' only :/ [[ "$f" =~ .cbr$ ]] && ( $UNCBR "$f" "$DIR" ) #[[ "$f" =~ .CBR$ ]] && ( $UNCBR "$f" "$DIR" ) [[ "$f" =~ .rar$ ]] && ( $UNCBR "$f" "$DIR" ) # shellcheck disable=SC2086,SC2090 [[ "$f" =~ .cbz$ ]] && ( $UNCBZ "$f" $ZOPT -d "$DIR" ) # shellcheck disable=SC2086,SC2090 #[[ "$f" =~ .CBZ$ ]] && ( $UNCBZ "$f" $ZOPT -d "$DIR" ) [[ "$f" =~ .zip$ ]] && ( $UNCBZ "$f" $ZOPT -d "$DIR" ) [[ "$f" =~ .tgz$ ]] && ( $UNTGZ "$f" -C "$DIR" ) [[ "$f" =~ .tar.gz$ ]] && ( $UNTGZ "$f" -C "$DIR" ) [[ "$f" =~ .tar$ ]] && ( $UNTAR "$f" -C "$DIR" ) check_in_path bunzip2 && [[ "$f" =~ .tar.bz2$ ]] && ( $UNBZ "$f" -C "$DIR" ) check_in_path xz && [[ "$f" =~ .tar.xz$ ]] && ( $UNXZ "$f" -C "$DIR" ) function add_fbi_read_opts() { fbiopts="$fbiopts $fbi_read_opts"; } [[ "$f" =~ .cbr$ ]] && add_fbi_read_opts; [[ "$f" =~ .cbz$ ]] && add_fbi_read_opts; [[ "$f" =~ .ps$ ]] && add_fbi_read_opts; [[ "$f" =~ .dvi$ ]] && add_fbi_read_opts; [[ "$f" =~ .pdf$ ]] && add_fbi_read_opts; # ... but this fimgs script is lazy and it gets satisfied with a bare decompress ! # lone file handling.. #[[ "$?" = 0 ]] || echo "this script is not suited for file $f" else [[ -f "$DIR/`basename $f`" ]] || cp -- "$f" "$DIR" || die "problems copying $f to $DIR" fi #fi done # show pages #fbiopts= #$FBI $fbiopts -P -- $DIR/* $DIR/*/* $DIR/*/*/* $DIR/*/*/*/* $DIR/*/*/*/*/* $DIR/*/*/*/*/*/* $DIR/*/*/*/*/*/*/* #echo "options are $fbiopts" # there should be some filter to avoid feed garbage to fim ... # shellcheck disable=SC2086 find "$DIR/" -type f -iname '*.bmp' -or -iname '*.gif' -or -iname '*.jpg' -or -iname '*.jpeg' -or -iname '*.pcx' -or -iname '*.pbm' -or -iname '*.pgm' -or -iname '*.ppm' -or -iname '*.png' -or -iname '*.tif' -or -iname '*.tiff' -or -iname '*.webp' | sort -n | $FBI $fbiopts -- - # when no framebuffer device is available, we could invoke another console viewer, couldn't we ? # cacaview $DIR/* # the old syntax # $FBI $fbiopts -P `find $DIR -iname '*.png' -or -iname '*.jpg' -or -iname '*.gif' -or -iname '*.jpeg' -or -iname '*.tiff' -or -iname '*.bmp'` # or the older one .. #$FBI $fbiopts -P -- $files # or the ancient one #fbi $fbiopts -P $DIR/ps*.tiff fim-0.6-rc2/src/FbiStuffLoader.cpp0000644000175000017500000001203714454347340013704 00000000000000/* $LastChangedDate: 2022-10-15 18:45:07 +0200 (Sat, 15 Oct 2022) $ */ /* FbiStuffLoader.cpp : fbi functions for loading files, modified for fim (c) 2008-2022 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #include #include #include //#include "loader.h" #include "fim.h" #include "FbiStuffLoader.h" /* ----------------------------------------------------------------------- */ namespace fim { void load_bits_lsb(fim_byte_t *dst, fim_byte_t *src, int width, int on, int off) { int i,mask,bit; for (i = 0; i < width; i++) { mask = 1 << (i & 0x07); bit = src[i>>3] & mask; dst[0] = bit ? on : off; dst[1] = bit ? on : off; dst[2] = bit ? on : off; dst += 3; } } void load_bits_msb(fim_byte_t *dst, fim_byte_t *src, int width, int on, int off) { int i,mask,bit; for (i = 0; i < width; i++) { mask = 1 << (7 - (i & 0x07)); bit = src[i>>3] & mask; dst[0] = bit ? on : off; dst[1] = bit ? on : off; dst[2] = bit ? on : off; dst += 3; } } void load_gray(fim_byte_t *dst, fim_byte_t *src, int width) { int i; for (i = 0; i < width; i++) { dst[0] = src[0]; dst[1] = src[0]; dst[2] = src[0]; dst += 3; src += 1; } } void load_graya(fim_byte_t *dst, fim_byte_t *src, int width) { int i; for (i = 0; i < width; i++) { dst[0] = src[0]; dst[1] = src[0]; dst[2] = src[0]; dst += 3; src += 2; } } void load_rgba(fim_byte_t *dst, fim_byte_t *src, int width) { int i; for (i = 0; i < width; i++) { dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst += 3; src += 4; } } /* ----------------------------------------------------------------------- */ int load_add_extra(struct ida_image_info *info, enum ida_extype type, fim_byte_t *data, unsigned int size) { struct ida_extra *extra; extra = (struct ida_extra*)fim_malloc(sizeof(*extra)); if (FIM_NULL == extra) return -1; if(type==EXTRA_COMMENT) ++size;// dez's fim_bzero(extra,sizeof(*extra)); extra->data = (fim_byte_t*)fim_malloc(size); if (FIM_NULL == extra->data) { fim_free(extra); return -1; } extra->type = type; extra->size = size; memcpy(extra->data,data,size); if(type==EXTRA_COMMENT) extra->data[size-1]='\0';// dez's extra->next = info->extra; info->extra = extra; return 0; } struct ida_extra* load_find_extra(struct ida_image_info *info, enum ida_extype type) { struct ida_extra *extra; for (extra = info->extra; FIM_NULL != extra; extra = extra->next) if (type == extra->type) return extra; return FIM_NULL; } int load_free_extras(struct ida_image_info *info) { struct ida_extra *next; while (FIM_NULL != info->extra) { next = info->extra->next; fim_free(info->extra->data); fim_free(info->extra); info->extra = next; } return 0; } /* ----------------------------------------------------------------------- */ FIM_LIST_HEAD(loaders); FIM_LIST_HEAD(writers); void fim_load_register(struct ida_loader *loader) { list_add_tail(&loader->list, &loaders); } #ifdef USE_X11 void fim_write_register(struct ida_writer *writer) { list_add_tail(&writer->list, &writers); } #endif /* USE_X11 */ static void fim_loaders_to_buffer(char * buf) { /* FIXME: new, should be generalized */ struct list_head *item=FIM_NULL; struct ida_loader *loader = FIM_NULL; *buf = FIM_SYM_CHAR_NUL; list_for_each(item,&loaders) { loader = list_entry(item, struct ida_loader, list); if(loader->name && loader->mlen>=1) sprintf(buf+strlen(buf)," %s",loader->name); } list_for_each(item,&loaders) { loader = list_entry(item, struct ida_loader, list); if(loader->name && loader->mlen<=0) sprintf(buf+strlen(buf)," %s",loader->name); } } void fim_loaders_to_stderr(FILE * stream) { fim_char_t buf[FIM_MAXLINE_BUFSIZE]; // NOTE: a larger buffer would be ok (e.g.: user configurable)... sprintf(buf,"%s","\nSupported file loaders: "); fim_loaders_to_buffer(buf+strlen(buf)); FIM_FPRINTF(stream,"%s\n",buf); } string fim_loaders_to_string(void) { fim_char_t buf[FIM_MAXLINE_BUFSIZE]; // NOTE: a larger buffer would be ok (e.g.: user configurable)... fim_loaders_to_buffer(buf); return string(buf); } } fim-0.6-rc2/src/FontServer.cpp0000644000175000017500000002736414454347340013153 00000000000000/* $LastChangedDate: 2023-03-26 20:01:15 +0200 (Sun, 26 Mar 2023) $ */ /* FontServer.cpp : Font Server code from fbi, adapted for fim. (c) 2007-2023 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file derives from fbi, and deserves a severe reorganization. * Really. * */ #include #include "fim.h" #define FIM_FONT_DEBUG cc.getIntVariable(FIM_VID_FB_VERBOSITY) #define FIM_FDS if(FIM_FONT_DEBUG) std::cout //#define ff_stderr stdout #define ff_stderr stderr #define FIM_PSF1_MAGIC0 0x36 #define FIM_PSF1_MAGIC1 0x04 #define FIM_PSF2_MAGIC0 0x72 #define FIM_PSF2_MAGIC1 0xb5 #define FIM_PSF2_MAGIC2 0x4a #define FIM_PSF2_MAGIC3 0x86 #define FIM_MAX_FONT_HEIGHT 256 #define FIM_SAVE_CONSOLEFONTNAME(CFN) cc.setVariable(FIM_VID_FBFONT,CFN); namespace fim { #if ( FIM_FONT_MAGNIFY_FACTOR <= 0 ) fim_int fim_fmf_ = FIM_FONT_MAGNIFY_FACTOR_DEFAULT; /* FIXME */ #else /* FIM_FONT_MAGNIFY_FACTOR */ FIM_CONSTEXPR fim_int fim_fmf_ = FIM_FONT_MAGNIFY_FACTOR; #endif /* FIM_FONT_MAGNIFY_FACTOR */ FontServer::FontServer( ) { } #if 1 void FontServer::fb_text_init1(const fim_char_t *font_, struct fs_font **_f, fim_int vl) { const fim_char_t*font=(fim_char_t*)font_; const fim_char_t *fonts[2] = { font, FIM_NULL }; if (FIM_NULL == *_f) { //FIM_FDS << "before consolefont: " << "(0x"<<((void*)*_f) <<")\n"; *_f = fs_consolefont(font ? fonts : FIM_NULL, vl); if(_f && *_f) { FIM_FDS << "loaded a font\n"; return; } else { if(_f)*_f=NULL;FIM_FDS << "NOT loaded a font\n"; } //FIM_FDS << "after consolefont : " << "(0x"<<((void*)*_f) <<")\n"; } #if FIM_WANT_HARDCODED_FONT //if (FIM_NULL == *_f) // *_f =...; #endif /* FIM_WANT_HARDCODED_FONT */ #ifdef FIM_USE_X11_FONTS if (FIM_NULL == *_f && 0 == fs_connect(FIM_NULL)) *_f = fs_open(font ? font : x11_font); FIM_FDS << "after fs_open : " << "(0x"<<((void*)*_f) <<")\n"; #endif /* FIM_USE_X11_FONTS */ if (FIM_NULL == *_f) { if(vl) FIM_FPRINTF(ff_stderr, "font \"%s\" is not available\n",font); #if FIM_EXPERIMENTAL_FONT_CMD if(vl) #endif /* FIM_EXPERIMENTAL_FONT_CMD */ exit(1); } else { #if FIM_EXPERIMENTAL_FONT_CMD #if FIM_WANT_HARDCODED_FONT font=FIM_DEFAULT_HARDCODEDFONT_STRING; #endif /* FIM_WANT_HARDCODED_FONT */ if(vl>1) FIM_FPRINTF(ff_stderr, "Using font \"%s\"\n",font); #endif /* FIM_EXPERIMENTAL_FONT_CMD */ } } #if 1 static const fim_char_t *default_font[] = { /* why the heck every f*cking distribution picks another location for these fonts ??? (GK) +1 (MM) */ #ifdef FIM_DEFAULT_CONSOLEFONT FIM_DEFAULT_CONSOLEFONT, #endif /* FIM_DEFAULT_CONSOLEFONT */ "/usr/share/kbd/consolefonts/cp866-8x16.psf.gz", /* sles11 */ "/usr/share/consolefonts/Uni3-TerminusBoldVGA14.psf.gz", "/usr/lib/kbd/consolefonts/lat9-16.psf.gz",/* added for a Mandriva backport */ "/usr/share/consolefonts/lat1-16.psf", "/usr/share/consolefonts/lat1-16.psf.gz", "/usr/share/consolefonts/lat1-16.psfu.gz", "/usr/share/kbd/consolefonts/lat1-16.psf", "/usr/share/kbd/consolefonts/lat1-16.psf.gz", "/usr/share/kbd/consolefonts/lat1-16.psfu.gz", "/usr/lib/kbd/consolefonts/lat1-16.psf", "/usr/lib/kbd/consolefonts/lat1-16.psf.gz", "/usr/lib/kbd/consolefonts/lat1-16.psfu.gz", "/lib/kbd/consolefonts/lat1-16.psf", "/lib/kbd/consolefonts/lat1-16.psf.gz", "/lib/kbd/consolefonts/lat1-16.psfu.gz", /* added for Ubuntu 10, but a search mechanism or a fim user variable would be wiser */ "/lib/kbd/consolefonts/Lat2-VGA14.psf.gz", "/lib/kbd/consolefonts/Lat2-VGA16.psf.gz", "/lib/kbd/consolefonts/Lat2-VGA8.psf.gz", "/lib/kbd/consolefonts/Uni2-VGA16.psf.gz", /* end ubuntu add */ /* begin debian squeeze add */ "/usr/share/consolefonts/default8x16.psf.gz", "/usr/share/consolefonts/default8x9.psf.gz", "/usr/share/consolefonts/Lat15-Fixed16.psf.gz", "/usr/share/consolefonts/default.psf.gz", /* end debian squeeze add */ #if FIM_WANT_HARDCODED_FONT FIM_DEFAULT_HARDCODEDFONT_STRING, #endif /* FIM_WANT_HARDCODED_FONT */ FIM_NULL }; fim::string get_default_font_list(void) { fim::string dfl; const fim_char_t ** const filename=default_font; for(int i = 0; filename[i] != FIM_NULL; i++) { dfl+=filename[i]; dfl+="\n"; } return dfl; } #endif static int probe_font_file_fd(FILE *fp, const fim_char_t *fontfilename, int vl) { const int m0=fgetc(fp); const int m1=fgetc(fp); if (m0 == EOF || m1 == EOF ) { if(vl) FIM_FPRINTF(ff_stderr, "problems reading two first bytes from %s.\n",fontfilename); goto oops; } if (m0 == FIM_PSF2_MAGIC0 && m1 == FIM_PSF2_MAGIC1 ) { if(vl>1) FIM_FPRINTF(ff_stderr, "can't use font %s: first two magic bytes (0x%x 0x%x) conform to PSF version 2, which is unsupported.\n",fontfilename,m0,m1); goto oops; } if (m0 != FIM_PSF1_MAGIC0 || m1 != FIM_PSF1_MAGIC1 ) { if(vl>1) FIM_FPRINTF(ff_stderr, "can't use font %s: first two magic bytes (0x%x 0x%x) not conforming to PSF version 1\n",fontfilename,m0,m1); goto oops; } return 0; oops: return -1; } static int probe_font_file(const fim_char_t *fontfilename) { FILE *fp=FIM_NULL; if ( strlen(fontfilename)>3 && 0 == strcmp(fontfilename+strlen(fontfilename)-3,".gz")) { #ifdef FIM_USE_ZCAT /* FIXME */ fp = FIM_TIMED_EXECLP(FIM_EPR_ZCAT,fontfilename,FIM_NULL); #endif /* FIM_USE_ZCAT */ } else { fp = fopen(fontfilename, "r"); } if (FIM_NULL == fp) return -1; const int rc = probe_font_file_fd(fp,fontfilename,1); if(fp) fclose(fp); return rc; } void fim_free_fs_font(struct fs_font *f) { if(f) { if(f->eindex) fim_free(f->eindex); if(f->gindex) fim_free(f->gindex); if(f->glyphs) fim_free(f->glyphs); if(f->extents) fim_free(f->extents); fim_free(f); } } struct fs_font* FontServer::fs_consolefont(const fim_char_t **filename, fim_int vl) { /* this function is too much involved: it shall be split in pieces */ int i=0; int fr; const fim_char_t *h=FIM_NULL; struct fs_font *f_ = FIM_NULL; const fim_char_t *fontfilename=FIM_NULL; FILE *fp=FIM_NULL; fim_char_t fontfilenameb[FIM_PATH_MAX]; bool robmn=true;/* retry on bad magic numbers */ #if FIM_WANT_HARDCODED_FONT unsigned char dfontdata[] = #include "default_font_byte_array.h"/* FIXME: this is horrible practice */ #endif /* FIM_WANT_HARDCODED_FONT */ #if FIM_WANT_HARDCODED_FONT /* shortcut: no access() call required */ if (filename && *filename && 0 == strcmp(filename[0],FIM_DEFAULT_HARDCODEDFONT_STRING)) goto openhardcodedfont; #endif /* FIM_WANT_HARDCODED_FONT */ if (FIM_NULL == filename) filename = fim::default_font; #ifdef FIM_DEFAULT_CONSOLEFONT FIM_FDS << "configured with default (prioritary) consolefont: " << FIM_DEFAULT_CONSOLEFONT << "\n"; #endif /* FIM_DEFAULT_CONSOLEFONT */ scanlistforafontfile: for(i = 0; filename[i] != FIM_NULL; i++) { if (-1 == access(filename[i],R_OK)) { #if FIM_WANT_HARDCODED_FONT if (0 == strcmp(filename[i],FIM_DEFAULT_HARDCODEDFONT_STRING)) { fontfilename = FIM_NULL; FIM_FDS << "switching to hardcoded font, equivalent to: " << FIM_ENV_FBFONT << "=" << FIM_DEFAULT_HARDCODEDFONT_STRING << "\n"; goto openhardcodedfont; } #endif /* FIM_WANT_HARDCODED_FONT */ FIM_FDS << "no access to font file " << filename[i] << "\n"; fim_perror(FIM_NULL); continue; } break; } fontfilename=filename[i]; filename+=i;//new #if FIM_LINUX_CONSOLEFONTS_DIR_SCAN if(FIM_NULL == fontfilename) { FIM_FDS << "will scan " << FIM_LINUX_CONSOLEFONTS_DIR " directory for console fonts" << "\n"; fim::string nf = FIM_LINUX_CONSOLEFONTS_DIR; DIR *dir=FIM_NULL; struct dirent *de=FIM_NULL; if( !is_dir( nf.c_str() )) goto oops; if ( ! ( dir = opendir(nf.c_str() ) )) goto oops; while( ( de = readdir(dir) ) != FIM_NULL ) #ifndef __MINGW32__ if( de->d_type == DT_REG ) // not in mingw #endif if( regexp_match(de->d_name,"8x.*\\.psf") ) { nf = FIM_LINUX_CONSOLEFONTS_DIR; nf+="/"; nf+=de->d_name; if( 0 == access(nf.c_str(),R_OK) ) { strncpy(fontfilenameb,nf.c_str(),FIM_PATH_MAX-1); fontfilename=fontfilenameb; if(probe_font_file(fontfilename)==0) break; // found else fontfilename = FIM_NULL; } } closedir(dir); } #endif /* FIM_LINUX_CONSOLEFONTS_DIR_SCAN */ #if FIM_WANT_HARDCODED_FONT openhardcodedfont: if (FIM_NULL == fontfilename) { FIM_SAVE_CONSOLEFONTNAME(FIM_DEFAULT_HARDCODEDFONT_STRING) fp=fmemopen(dfontdata,sizeof(dfontdata),"r"); if(fp) goto gotafp; } #endif /* FIM_WANT_HARDCODED_FONT */ if (FIM_NULL == fontfilename) { if(vl) FIM_FPRINTF(ff_stderr, "can't find console font file\n"); goto oops; } FIM_FDS << "probing font file: " << fontfilename << "\n"; h = fontfilename+strlen(fontfilename)-3; if ( h>fontfilename && 0 == strcmp(h,".gz")) { #ifdef FIM_USE_ZCAT FIM_FDS << "uncompressing by piping " << fontfilename << " through " << FIM_EPR_ZCAT << "\n"; /* FIXME */ fp = FIM_TIMED_EXECLP(FIM_EPR_ZCAT,fontfilename,FIM_NULL); #else /* FIM_USE_ZCAT */ if(vl) FIM_FPRINTF(ff_stderr, "built with no gzip decoder!\n"); #endif /* FIM_USE_ZCAT */ } else { fp = fopen(fontfilename, "r"); } if (FIM_NULL == fp) { if(vl) FIM_FPRINTF(ff_stderr, "can't open %s: %s\n",fontfilename,strerror(errno)); goto oops; } FIM_SAVE_CONSOLEFONTNAME(fontfilename) #if FIM_WANT_HARDCODED_FONT gotafp: #endif /* FIM_WANT_HARDCODED_FONT */ // FIM_FPRINTF(ff_stderr, "using linux console font \"%s\"\n",filename[i]); if ( 0 != probe_font_file_fd(fp,fontfilename,vl) ) goto oops; f_ =(struct fs_font*) fim_calloc(1,sizeof(*f_)); if(!f_)goto aoops; fgetc(fp); f_->maxenc = 256; f_->width = 8; /* FIXME */ f_->height = fgetc(fp); if(f_->height<0 || f_->height>FIM_MAX_FONT_HEIGHT) goto oops; f_->fontHeader.min_bounds.left = 0; f_->fontHeader.max_bounds.right = f_->width; f_->fontHeader.max_bounds.descent = 0; f_->fontHeader.max_bounds.ascent = f_->height; f_->glyphs =(fim_byte_t*) fim_malloc(f_->height * 256); if(!f_->glyphs) goto aoops; f_->extents = (FSXCharInfo*)fim_malloc(sizeof(FSXCharInfo)*256); if(!f_->extents) goto aoops; fr=fread(f_->glyphs, 256, f_->height, fp); if(!fr)goto aoops;/* new */ fclose(fp);fp=FIM_NULL; f_->eindex =(FSXCharInfo**) fim_malloc(sizeof(FSXCharInfo*) * 256); if(!f_->eindex) goto aoops; f_->gindex = (fim_byte_t**)fim_malloc(sizeof(fim_byte_t*) * 256); if(!f_->gindex) goto aoops; for (i = 0; i < 256; i++) { f_->eindex[i] = f_->extents +i; f_->gindex[i] = f_->glyphs +i * f_->height; f_->eindex[i]->left = 0; f_->eindex[i]->right = 7; f_->eindex[i]->width = 8;/* FIXME */ f_->eindex[i]->descent = 0; f_->eindex[i]->ascent = f_->height; } return f_; aoops: robmn=false;/* no retry: this is a allocation-related oops */ if(f_) fim_free_fs_font(f_); oops: if(fp){fclose(fp);fp=FIM_NULL;} if(robmn && filename[0] && filename[1]){++filename;goto scanlistforafontfile;}else robmn=false; return FIM_NULL; } #endif } fim-0.6-rc2/src/defaultConfiguration.cpp0000644000175000017500000001604114454347340015220 00000000000000/* $LastChangedDate: 2022-11-27 16:57:30 +0100 (Sun, 27 Nov 2022) $ */ /* defaultConfiguration.cpp : The following code contains key bindings and aliases definitions which make up a first usable configuration for FIM. (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if FIM_DEFAULT_CONFIG #if 1 alias(FIM_FLA_MAGNIFY,FIM_FLC_MAGNIFY,"magnify the displayed image by the " FIM_VID_MAGNIFY_FACTOR " variable or " FIM_CNS_EX_ARGS_STRING ""); alias(FIM_FLA_REDUCE ,FIM_FLC_REDUCE,"reduce the displayed image by " FIM_VID_REDUCE_FACTOR " or " FIM_CNS_EX_ARGS_STRING ""); alias(FIM_FLA_NEXT,FIM_FLC_NEXT,"go to the next page or picture file"); alias(FIM_FLA_PREV,FIM_FLC_PREV,"go to the previous page or picture file"); alias(FIM_FLA_NEXT_PAGE,FIM_FLC_NEXT_PAGE,"go to the next page in the file"); alias(FIM_FLA_PREV_PAGE,FIM_FLC_PREV_PAGE,"go to the previous page in the file"); alias(FIM_FLA_NEXT_FILE,FIM_FLC_NEXT_FILE,"go to the next file in the list"); alias(FIM_FLA_PREV_FILE,FIM_FLC_PREV_FILE,"go to the previous file in the list"); #endif #if 1 alias("scale_factor_grow","scale '+*'","multiply the scale factors " FIM_VID_REDUCE_FACTOR " and " FIM_VID_MAGNIFY_FACTOR " by " FIM_VID_SCALE_FACTOR_MULTIPLIER ""); alias("scale_factor_shrink","scale '+/'","divide the scale factors " FIM_VID_REDUCE_FACTOR " and " FIM_VID_MAGNIFY_FACTOR " by " FIM_VID_SCALE_FACTOR_MULTIPLIER ""); alias("scale_factor_decrease","scale '+-'","subtract " FIM_VID_SCALE_FACTOR_DELTA " to the scale factors " FIM_VID_REDUCE_FACTOR " and " FIM_VID_MAGNIFY_FACTOR ""); alias("scale_factor_increase","scale '++'","add " FIM_VID_SCALE_FACTOR_DELTA " to the scale factors " FIM_VID_REDUCE_FACTOR " and " FIM_VID_MAGNIFY_FACTOR ""); alias('A',"'" FIM_VID_AUTOTOP "=1-" FIM_VID_AUTOTOP ";'"); #endif #if 0 alias('A',"'autotop=1-autotop;'"); alias("toggleVerbosity","verbose=1-verbose;display;"); alias("toggleKeyVerbosity","_verbose_keys=1-_verbose_keys;display;"); #endif #if 0 bind('h',FIM_FLT_HELP); bind('p',"prev;display;"); bind('r',FIM_FLT_RELOAD); bind('R',FIM_FLT_REDISPLAY); bind('m',FIM_FLC_MIRROR); bind('f',FIM_FLC_FLIP); bind(FIM_KKE_UP,"pan 'up'"); bind(FIM_KKE_RIGHT,"pan 'right'"); bind(FIM_KKE_DOWN,"pan 'down'"); bind(FIM_KKE_LEFT,"pan 'left'"); bind(' ',FIM_FLT_SCROLLDOWN); bind(FIM_KKE_PAGE_DOWN,"next"); bind(FIM_KKE_PAGE_UP,"prev"); bind('i',FIM_FLT_INFO); #endif #if 1 bind('q',FIM_FLT_QUIT); bind('n',FIM_FLC_NEXT_FILE); bind('p',FIM_FLC_PREV_FILE); bind('d',FIM_FLT_DISPLAY); bind('+',FIM_FLA_MAGNIFY); bind('-',FIM_FLA_REDUCE); //bind('k',FIM_FLC_PAN_UP); //bind('j',FIM_FLC_PAN_DOWN); bind('k',FIM_FLC_SCROLL_UP); bind('j',FIM_FLC_SCROLL_DOWN); bind('h',FIM_FLC_PAN_LEFT); bind('l',FIM_FLC_PAN_RIGHT); bind(29,"scale_factor_increase"); bind(31,"scale_factor_decrease"); bind(29,"scale_factor_grow"); bind(31,"scale_factor_shrink"); #endif #if 1 setVariable(FIM_VID_CONSOLE_KEY,FIM_SYM_CONSOLE_KEY); setVariable(FIM_VID_PUSH_PUSHES_DIRS,1); #endif #if 0 setVariable(FIM_VID_REDUCE_FACTOR,FIM_CNS_SCALEFACTOR); setVariable(FIM_VID_MAGNIFY_FACTOR,FIM_CNS_SCALEFACTOR); setVariable(FIM_VID_SCALE_FACTOR_DELTA,FIM_CNS_SCALEFACTOR_DELTA); setVariable(FIM_VID_VERBOSE_KEYS,-1); setVariable(FIM_VID_MAGNIFY_FACTOR,FIM_CNS_SCALEFACTOR); setVariable(FIM_VID_SCALE_FACTOR_MULTIPLIER,FIM_CNS_SCALEFACTOR_MULTIPLIER); #endif #endif /* * The following code binds key codes to key symbols. * In this way the user can write a configuration file * and associate actions to key configurations.. * * Note : certain key bindings (especially Control key with arrows or other non letter keys ) are known to be non working. * But by modifying this file one may experiment! */ #if FIM_DEFAULT_KEY_CONFIG /* * Standard key configuration */ fim_char_t k[4];k[1]='\0'; /* 97=0x61 to 122=0x7A */ for(fim_char_t i='a';i<='z';++i) *k=i, sym_keys_[k]=i; /* 65=0x41 to 90=0x5A (shifted keys) */ for(fim_char_t i='A';i<='Z';++i) *k=i, sym_keys_[k]=i; /* 32=0x20 to 65=0x40 */ for(fim_char_t i=' ';i<='@';++i) *k=i, sym_keys_[k]=i; /* 91=0x5B to 96=0x60 */ for(fim_char_t i='[';i<'a';++i) *k=i, sym_keys_[k]=i; /* 123=0x7B to 127=0x7F (DEL) */ for(fim_key_t i='{';i<=126;++i) *k=fim_char_t(i), sym_keys_[k]=(fim_char_t)i; // A note : DEL is not captured by the above configuration. /* * Control keys handling */ k[0]='C'; k[1]='-'; k[3]='\0'; //problem : no uppercase with control.sorry. for(fim_key_t i='a';i<='j';++i) k[2]=fim_char_t(i), sym_keys_[k]=((i-'a')+1); for(fim_key_t i='k';i<='z';++i) k[2]=fim_char_t(i), sym_keys_[k]=((i-'a')+1); // for(fim_key_t i=' ';i<='?';++i) k[2]=fim_char_t(i), sym_keys_[k]=( i+1)-'a' ; /* * The following bindings are known to be useless or bugful. */ /* for(fim_char_t i='[';i<'a';++i,k[2]=i) sym_keys_[k]=(i+1); for(int i='{';i<=127;++i,k[2]=(fim_char_t)i) sym_keys_[k]=(i+1)(fim_char_t)i; */ /* * The following means that when a decimal FIM_KKE_LEFT will be read from * the keyboard, it will be interpreted as a Left pressure. */ sym_keys_[FIM_KBD_LEFT]=FIM_KKE_LEFT; // and so on.. sym_keys_[FIM_KBD_RIGHT]=FIM_KKE_RIGHT; sym_keys_[FIM_KBD_UP]=FIM_KKE_UP; sym_keys_[FIM_KBD_DOWN]=FIM_KKE_DOWN; sym_keys_[FIM_KBD_PAGEDOWN]=FIM_KKE_PAGE_DOWN; sym_keys_[FIM_KBD_PAGEUP]=FIM_KKE_PAGE_UP; sym_keys_[FIM_KBD_ENTER]=FIM_KKE_ENTER; sym_keys_[FIM_KBD_BACKSPACE_]=FIM_KKE_BACKSPACE; sym_keys_[FIM_KBD_BACKSPACE]=FIM_KKE_BACKSPACE; sym_keys_[FIM_KBD_DEL]=FIM_KKE_DEL; sym_keys_[FIM_KBD_INS]=FIM_KKE_INSERT; sym_keys_[FIM_KBD_HOME]=FIM_KKE_HOME; sym_keys_[FIM_KBD_END] =FIM_KKE_END; sym_keys_[FIM_KBD_TAB] =9; sym_keys_[FIM_KBD_ANY] =0; /* EXPERIMENTAL */ sym_keys_[FIM_KBD_ESC] =FIM_KKE_ESC; sym_keys_[FIM_KBD_F1] =FIM_KKE_F1; sym_keys_[FIM_KBD_F2] =FIM_KKE_F2; sym_keys_[FIM_KBD_F3] =FIM_KKE_F3; sym_keys_[FIM_KBD_F4] =FIM_KKE_F4; sym_keys_[FIM_KBD_F5] =FIM_KKE_F5; sym_keys_[FIM_KBD_F6] =FIM_KKE_F6; sym_keys_[FIM_KBD_F7] =FIM_KKE_F7; sym_keys_[FIM_KBD_F8] =FIM_KKE_F8; sym_keys_[FIM_KBD_F9] =FIM_KKE_F9; sym_keys_[FIM_KBD_F10] =FIM_KKE_F10; sym_keys_[FIM_KBD_F11] =FIM_KKE_F11; sym_keys_[FIM_KBD_F12] =FIM_KKE_F12; exitBinding_ = sym_keys_[FIM_KBD_ENTER]; /* Enter will terminate loops */ // sym_keys_[" "]=' '; // sym_keys_["."]='.'; // sym_keys_[","]=','; // cc.key_syms_update(); #endif fim-0.6-rc2/src/testsuite/0000755000175000017500000000000014503655326012450 500000000000000fim-0.6-rc2/src/testsuite/fim.test/0000755000175000017500000000000014503655326014201 500000000000000fim-0.6-rc2/src/testsuite/fim.test/fim.exp0000644000175000017500000000030314454347340015405 00000000000000# stub send_user "This test file is still a stub\n" set timeout 1 set test fimversion send "" expect { -re ".*" {pass "$test"} } set test stdout send "" expect { -re ".*" {pass "$test"} } fim-0.6-rc2/src/testsuite/config/0000755000175000017500000000000014503655326013715 500000000000000fim-0.6-rc2/src/testsuite/config/unix.exp0000644000175000017500000000044514454347340015340 00000000000000# stub proc fim_version {} { global FIM set tmp [exec $FIM --version ] regexp "$prompt *(\[^\n\]*)\n.*" $tmp tmp version clone_output "[which $FIM] version $version\n" } proc fim_exit {} { } proc fim_start {arg} { global FIM spawn $FIM -c '' arg } fim_start "" fim-0.6-rc2/src/help.cpp0000644000175000017500000004766314454347340012012 00000000000000#ifdef FIM_WANT_INLINE_HELP fim_var_help_db[FIM_VID_ARCHIVE_FILES]= "[in,g:] Regular expression matching filenames to be treated as (multipage) archives. If empty, \"" FIM_CNS_ARCHIVE_RE "\" will be used. Within each archive, only filenames matching the regular expression in the " FIM_VID_PUSHDIR_RE " variable will be considered for opening." ; fim_var_help_db[FIM_VID_RANDOM]= "[out] a pseudorandom number." ; fim_var_help_db[FIM_VID_BINARY_DISPLAY]= "[in,g:] will force loading of the specified files as pixelmaps (no image decoding will be performed); if 1, using one bit per pixel; if 24, using 24 bits per pixel; otherwise will load and decode the files as usual." ; fim_var_help_db[FIM_VID_TEXT_DISPLAY]= "[in,g:] will force loading of the specified files as text files (no image decoding will be performed); if 1; otherwise will load and decode the files as usual." ; fim_var_help_db[FIM_VID_CACHE_CONTROL]= "[in,g:] string for cache control. if it starts with 'm' mipmaps will be cached; if it starts with 'M' then not. otherwise defaults will apply." ; fim_var_help_db[FIM_VID_CACHE_STATUS]= "[out,g:] string with current information on cache status." ; fim_var_help_db[FIM_VID_DISPLAY_CONSOLE]= "[in,g:] if 1, will display the output console." ; fim_var_help_db[FIM_VID_DEVICE_DRIVER]= "[out,g:] the current display device string." ; fim_var_help_db[FIM_VID_DISPLAY_STATUS]= "[in,g:] if 1, will display the status bar." ; fim_var_help_db[FIM_VID_DISPLAY_STATUS_FMT]= "[in,g:] custom info format string, displayed in the lower left corner of the status bar; if unset: full pathname; otherwise a custom format string specified just as " FIM_VID_INFO_FMT_STR"." ; fim_var_help_db[FIM_VID_PUSH_PUSHES_DIRS]= "[in,g:] if 1, the push command will also accept and push directories (using pushdir). if 2, will also push hidden files/directories, that is, ones whose names begin with a dot (.). " ; fim_var_help_db[FIM_VID_SANITY_CHECK]= "[in,experimental,g:] if 1, will execute a sanity check on startup." ; fim_var_help_db[FIM_VID_LAST_SYSTEM_OUTPUT]= "[out,experimental,g:] the standard output of the last call to the system command." ; fim_var_help_db[FIM_VID_LAST_CMD_OUTPUT]= "[out,experimental,g:] the last command output." ; fim_var_help_db[FIM_VID_LOAD_DEFAULT_ETC_FIMRC]= "[in,g:] if 1 at startup, will load the system wide initialization file." ; fim_var_help_db[FIM_VID_LOAD_HIDDEN_DIRS]= "[in,g:] if not 1, when pushing directories/files, those whose name begins with a dot (.) will be skipped." ; fim_var_help_db[FIM_VID_DEFAULT_ETC_FIMRC]= "[in,g:] string with the global configuration file name." ; fim_var_help_db[FIM_VID_IMAGE_LOAD_TIME]= "[out,i:] time taken to load the file and decode the image, in seconds." ; fim_var_help_db[FIM_VID_FILE_LOADER]= "[in,i:,g:] if not empty, this string will force a file loader (among the ones listed in the -V switch output); [out] i:" FIM_VID_FILE_LOADER " stores the loader of the current image." ; fim_var_help_db[FIM_VID_FILE_BUFFERED_FROM]= "[out,i:] if an image has been temporarily converted and decoded from a temporary file, its name is here." ; fim_var_help_db[FIM_VID_RETRY_LOADER_PROBE]= "[in,g:] if 1 and user specified a file loader and this fails, will probe for a different loader." ; fim_var_help_db[FIM_VID_NO_RC_FILE]= "[in,g:] if 1, the ~/.fimrc file will not be loaded at startup." ; fim_var_help_db[FIM_VID_NO_EXTERNAL_LOADERS]= "[in,g:] if 1, no external loading programs will be tried for piping in an unsupported type image file." ; fim_var_help_db[FIM_VID_SCRIPTOUT_FILE]= "[in,g:] the name of the file to write to when recording sessions." ; fim_var_help_db[FIM_VID_PUSHDIR_RE]= "[in] regular expression to match against when pushing files from a directory or an archive. By default this is \"" FIM_CNS_PUSHDIR_RE "\"." ; fim_var_help_db[FIM_VID_STATUS_LINE]= "[in,g:] if 1, will display the status bar." ; fim_var_help_db[FIM_VID_WANT_PREFETCH]= "[in,g:] if 1, will prefetch further files just after display of the first file; if 2 (and configured with --enable-cxx11) will load in the background." ; fim_var_help_db[FIM_VID_LOADING_IN_BACKGROUND]= "[out,g:] 1 if program has been invoked with --" FIM_OSW_BGREC " and still loading in background. " ; fim_var_help_db[FIM_VID_RESIZE_HUGE_ON_LOAD]= "[in,g:] if 1, will downscale automatically huge images at load time." ; fim_var_help_db[FIM_VID_WANT_SLEEPS]= "[in,g:] number of seconds of sleep during slideshow mode." ; fim_var_help_db[FIM_VID_WANT_EXIF_ORIENTATION]= "[in,g:] if 1, will reorient images using information from EXIF metadata (and stored in in " FIM_VID_EXIF_ORIENTATION ", " FIM_VID_EXIF_MIRRORED ", " FIM_VID_EXIF_FLIPPED" )." ; fim_var_help_db[FIM_VID_EXIF_ORIENTATION]= "[out,i:] orientation information in the same format of " FIM_VID_ORIENTATION ", read from the orientation EXIF tags (i:EXIF_Orientation)." ; fim_var_help_db[FIM_VID_EXIF_MIRRORED]= "[out,i:] mirroring information, read from the EXIF tags of a given image." ; fim_var_help_db[FIM_VID_EXIF_FLIPPED]= "[out,i:] flipping information, read from the EXIF tags of a given image." ; fim_var_help_db[FIM_VID_AUTOTOP]= "[in,g:] if 1, will align to the top freshly loaded images." ; fim_var_help_db[FIM_VID_SCALE_STYLE]= "[in,g:] if non empty, this string will be fed to the " FIM_VID_SCALE " command; see its documentation for possible values." ; fim_var_help_db[FIM_VID_FILEINDEX]= "[out,g:] the current image numeric index." ; fim_var_help_db[FIM_VID_LOOP_ONCE]= "[internal,g:] if 1 and doing a --slideshow, do it once." ; fim_var_help_db[FIM_VID_LASTFILEINDEX]= "[out,g:] the last visited image numeric index. Useful for jumping back and forth easily between two images with 'goto _lastfileindex'." ; fim_var_help_db[FIM_VID_LASTGOTODIRECTION]= "[out,g:] the last file goto direction (either string '+1' or string '-1')." ; fim_var_help_db[FIM_VID_FILELISTLEN]= "[out,g:] current image list length (number of visible images)." ; fim_var_help_db[FIM_VID_INFO_FMT_STR]= "[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets; %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set; EXP will be copied verbatim except for contained sequences of the form %:VAR:, which will be expanded to the value of variable i:VAR; this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) will be used only if present." ; fim_var_help_db[FIM_VID_FILENAME]= "[out,i:] the current file name string." ; fim_var_help_db[FIM_VID_FIM_DEFAULT_CONFIG_FILE_CONTENTS]= "[out,g:] the contents of the default (hardcoded) configuration file (executed after the minimal hardcoded config)." ; fim_var_help_db[FIM_VID_FIM_DEFAULT_GRAMMAR_FILE_CONTENTS]= "[out,g:] the contents of the default (hardcoded) grammar file." ; fim_var_help_db[FIM_VID_FRESH]= "[in,out,i:,experimental] 1 if the image was loaded, before all autocommands (autocmd) execution." ; fim_var_help_db[FIM_VID_PAGE]= "[out,experimental,g:] the current page." ; fim_var_help_db[FIM_VID_PAGES]= "[out,experimental,i:] the current number of pages of an image." ; fim_var_help_db[FIM_VID_OVERRIDE_DISPLAY]= "[internal,g:] if 1, will inhibit display." ; fim_var_help_db[FIM_VID_MAX_ITERATED_COMMANDS]= "[g:] the iteration limit for N in \"N[commandname]\" iterated command invocations." ; fim_var_help_db[FIM_VID_WANT_CAPTION_STATUS]= "[in,g:] this works only if supported by the display device (currently only SDL). if set to a number that is not 0, will show the status (or command) line in the window manager caption; if set to a non-empty string, will interpret it just as a file info format string (see " FIM_VID_INFO_FMT_STR "); if empty, will show the program version." ; fim_var_help_db[FIM_VID_WANT_MOUSE_CTRL]= "[in,g:] if at least 9 chars long, enable mouse click/movement behaviour when in SDL mode; the 9 chars will correspond to a 3x3 screen clickable grid and the equivalent command keys; clicking middle or right button will toggle on-screen usage info." ; fim_var_help_db[FIM_VID_MAGNIFY_FACTOR]= "[in,g:] the image scale multiplier used when magnifying images size." ; fim_var_help_db[FIM_VID_PWD]= "[out,g:] the current working directory; will be updated at startup and whenever the working directory changes." ; fim_var_help_db[FIM_VID_REDUCE_FACTOR]= "[in,g:] the image scale multiplier used when reducing images size." ; fim_var_help_db[FIM_VID_SCALE_FACTOR_MULTIPLIER]= "[in,g:] value used for scaling up/down the scaling factors." ; fim_var_help_db[FIM_VID_SCALE_FACTOR_DELTA]= "[in,g:] value used for incrementing/decrementing the scaling factors." ; fim_var_help_db[FIM_VID_COMMENT]= "[i:,out] the image comment, extracted from the image file (if any)." ; fim_var_help_db[FIM_VID_COMMENT_OI]= "[in,g:] if set not to 0, will display a custom comment string specified according to the value of_caption_over_image_fmt; if larger than 1, with black background; if 3, image will be drawn possibly below. It will take at most half of the screen." ; fim_var_help_db[FIM_VID_COMMENT_OI_FMT]= "[in,g:] custom info format string, displayed in a caption over the image; if unset: i:_comment; otherwise a custom format string specified just as " FIM_VID_INFO_FMT_STR"." ; fim_var_help_db[FIM_VID_EXIFTOOL_COMMENT]= "[out,g:] comment extracted via the exiftool interface; see " FIM_VID_EXIFTOOL "." ; fim_var_help_db[FIM_VID_STEPS]= "[in,g:] the default steps, in pixels, when panning images." ; fim_var_help_db[FIM_VID_PREAD]= "[in,g:] a user-specified shell command emitting an image on stdout, in a format readable by the convert utility. If the current filename matches \"" FIM_CNS_PIPEABLE_PATH_RE "\", it will be substituted to any occurrence of '{}'." ; fim_var_help_db[FIM_VID_VERSION]= "[out,g:] fim version number; may be used for keeping compatibility of fim scripts across evolving versions." ; fim_var_help_db[FIM_VID_FBFONT]= "[out,g:] The current console font file string. If the internal hardcoded font has been used, then its value is \"" FIM_DEFAULT_HARDCODEDFONT_STRING "\"." ; fim_var_help_db[FIM_VID_FBFMF]= "[in,g:] The rendered text will use a font magnified by this (integer) factor. Maximal value is \"" FIM_XSTRINGIFY(FIM_FONT_MAGNIFY_FACTOR_MAX) "\". (Only enabled if configured with --with-font-magnifying-factor=FACTOR, with FACTOR<1)." ; fim_var_help_db[FIM_VID_FBAFS]= "[in,g:] The rendered text will be scaled at least to this (integer) fraction of the screen. Disable font autoscaling with -1. (Only enabled if configured with --with-font-magnifying-factor=FACTOR, with FACTOR<1)." ; fim_var_help_db[FIM_VID_FB_VERBOSITY]= "[in,g:] if > 0, verbose font loading" ; fim_var_help_db[FIM_VID_HSTEPS]= "[in,g:] the default steps, in pixels, when panning images horizontally (overrides steps)." ; fim_var_help_db[FIM_VID_VSTEPS]= "[in,g:] the default steps, in pixels, when panning images vertically (overrides steps)." ; fim_var_help_db[FIM_VID_CONSOLE_ROWS]= "[in,g:] if >0, will set the number of displayed text lines in the console." ; fim_var_help_db[FIM_VID_CONSOLE_LINE_WIDTH]= "[in,g:] if>0, will force the output console text width." ; fim_var_help_db[FIM_VID_CONSOLE_LINE_OFFSET]= "[in,out,g:] position of the text beginning in the output console, expressed in lines." ; fim_var_help_db[FIM_VID_CONSOLE_BUFFER_LINES]= "[out,g:] the number of buffered output console text lines." ; fim_var_help_db[FIM_VID_CONSOLE_BUFFER_TOTAL]= "[out,g:] amount of memory allocated for the output console buffer." ; fim_var_help_db[FIM_VID_CONSOLE_BUFFER_FREE]= "[out,g:] amount of unused memory in the output console buffer." ; fim_var_help_db[FIM_VID_CONSOLE_BUFFER_USED]= "[out,g:] amount of used memory in the output console buffer." ; fim_var_help_db[FIM_VID_VERBOSE_KEYS]= "[in,g:] if 1, after each interactive mode key hit, the console will display the hit key raw keycode." ; fim_var_help_db[FIM_VID_CMD_EXPANSION]= "[in,g:] if 1, will enable autocompletion (on execution) of alias and command strings." ; fim_var_help_db[FIM_VID_VERBOSE_ERRORS]= "[in,g:] if 1, will display on stdout internal errors, while parsing commands." ; fim_var_help_db[FIM_VID_VERBOSITY]= "[in,experimental,g:] program verbosity." ; fim_var_help_db[FIM_VID_CONSOLE_KEY]= "[in,g:] the key binding (an integer variable) for spawning the command line; will have precedence over any other binding." ; fim_var_help_db[FIM_VID_IGNORECASE]= "[in,g:] if 1, will allow for case insensitive regexp-based match in autocommands (autocmd)." ; fim_var_help_db[FIM_VID_RE_SEARCH_OPTS]= "[in,g:] affects regexp-based searches; if an empty string, defaults will apply; if contains 'i' ('I'), case insensitive (sensitive) searches will occur; if contains 'b', will match on basename, if contains 'f' on full pathname." ; fim_var_help_db[FIM_VID_SAVE_FIM_HISTORY]= "[in,g:] if 1 on exit, will save the " FIM_CNS_HIST_COMPLETE_FILENAME " file on exit." ; fim_var_help_db[FIM_VID_LOAD_FIM_HISTORY]= "[in,g:] if 1 on startup, will load the " FIM_CNS_HIST_COMPLETE_FILENAME " file on startup." ; fim_var_help_db[FIM_VID_TERM]= "[out,g:] the environment TERM variable." ; fim_var_help_db[FIM_VID_NO_DEFAULT_CONFIGURATION]= "[in,g:] if 0, a default, hardcoded configuration will be executed at startup, after the minimal hardcoded one." ; fim_var_help_db[FIM_VID_DISPLAY_STATUS_BAR]= "[in,g:] if 1, will display the status bar." ; fim_var_help_db[FIM_VID_DISPLAY_BUSY]= "[in,g:] if 1, will display a message on the status bar when processing." ; fim_var_help_db[FIM_VID_WANT_MIPMAPS]= "[in,g:] if >0, will use mipmaps to speed up downscaling of images (this has a memory overhead equivalent to one image copy); mipmaps will not be cached. If 2, will use every fourth source pixel instead of averaging (good for photos, not for graphs)." ; fim_var_help_db[FIM_VID_EXIFTOOL]= "[in,g:] if >0 and supported, exiftool will be used to get additional information. if 1, this will be appened to _comment; if 2, will go to " FIM_VID_EXIFTOOL_COMMENT "." ; fim_var_help_db[FIM_VID_SCALE]= "[in,i:] the scale of the current image." ; fim_var_help_db[FIM_VID_ASCALE]= "[in,out,i:] the asymmetric scaling of the current image." ; fim_var_help_db[FIM_VID_ANGLE]= "[in,out,i:] a floating point number specifying the rotation angle, in degrees." ; fim_var_help_db[FIM_VID_ORIENTATION]= "[internal,i:] Orthogonal clockwise rotation (orientation) is controlled by: 'i:" FIM_VID_ORIENTATION "', 'g:" FIM_VID_ORIENTATION "' and applied on a per-image basis. In particular, the values of the three variables are summed up and the sum is interpreted as the image orientation. If the sum is 0, no rotation will apply; if it is 1, a single ( 90') rotation will apply; if it is 2, a double (180') rotation will apply; if it is 3, a triple (270') rotation will apply. If the sum is not one of 0,1,2,3, the value of the sum modulo 4 is considered. Therefore, \":i:" FIM_VID_ORIENTATION "=1\" and \":i:" FIM_VID_ORIENTATION "=5\" are equivalent: they rotate the image one time by 90'." ; fim_var_help_db[FIM_VID_WIDTH]= "[out,i:] the current image original width." ; fim_var_help_db[FIM_VID_HEIGHT]= "[out,i:] the current image original height." ; fim_var_help_db[FIM_VID_SWIDTH]= "[out,i:] the current image scaled width." ; fim_var_help_db[FIM_VID_SHEIGHT]= "[out,i:] the current image scaled height." ; fim_var_help_db[FIM_VID_AUTOFLIP]= "[in,g:] if 1, will flip images by default." ; fim_var_help_db[FIM_VID_AUTONEGATE]= "[in,g:] if 1, will negate images by default." ; fim_var_help_db[FIM_VID_AUTODESATURATE]= "[in,g:] if 1, will desaturate images by default." ; fim_var_help_db[FIM_VID_LAST_FILE_LOADER]= "[out,g:] after each image load, " FIM_VID_LAST_FILE_LOADER " will be set to the last file loader used." ; fim_var_help_db[FIM_VID_ALL_FILE_LOADERS]= "[out,g:] space-separated list of hardcoded file loaders usable with " FIM_VID_FILE_LOADER "." ; fim_var_help_db[FIM_VID_FLIPPED]= "[out,i:] 1, if the image is flipped." ; fim_var_help_db[FIM_VID_NEGATED]= "[out,i:] 1, if the image is negated." ; fim_var_help_db[FIM_VID_DESATURATED]= "[out,i:] 1, if the image is desaturated." ; fim_var_help_db[FIM_VID_FIM_BPP]= "[out,g:] the bits per pixel count." ; fim_var_help_db[FIM_VID_AUTOMIRROR]= "[in,g:] if 1, will mirror images by default." ; fim_var_help_db[FIM_VID_MIRRORED]= "[out,i:] 1, if the image is mirrored." ; fim_var_help_db[FIM_VID_WANT_AUTOCENTER]= "[in,g:] if 1, the image will be displayed centered." ; fim_var_help_db[FIM_VID_MAX_CACHED_IMAGES]= "[in,g:] the maximum number of images after which evictions will be forced. Setting this to 0 (no limits) is ok provided _max_cached_memory is set meaningfully." ; fim_var_help_db[FIM_VID_MIN_CACHED_IMAGES]= "[in,g:] the minimum number of images to keep from eviction; if less than four can lead to inefficiencies: e.g. when jumping between two images, each time an erase and a prefetch of neighboring images would trigger. default value is 4." ; fim_var_help_db[FIM_VID_MAX_CACHED_MEMORY]= "[in,g:] the maximum amount of memory (in KiB) at which images will be continued being added to the cache. Setting this to 0 (no limit) will lead to a crash (there is no protection currently)." ; fim_var_help_db[FIM_VID_CACHED_IMAGES]= "[out,g:] the number of images currently cached." ; fim_var_help_db[FIM_VID_SCREEN_WIDTH]= "[out,g:] the screen width." ; fim_var_help_db[FIM_VID_SCREEN_HEIGHT]= "[out] the screen height." ; fim_var_help_db[FIM_VID_SKIP_SCROLL]= "[int,g:] if >1, fraction of page which will be skipped in when scrolling (e.g. 'scrollforward'); if 1, auto chosen; if <1, disabled." ; fim_var_help_db[FIM_VID_DBG_AUTOCMD_TRACE_STACK]= "[in,g:] dump to stdout autocommands (autocmd) stack trace during their execution (for debugging purposes)." ; fim_var_help_db[FIM_VID_DBG_COMMANDS]= "[in,g:] debugging option string for printing out . if containing 'a', print out autocmd info; if containing 'c', print out each command; if containing 'k', print out each pressed key; if containing 'j', print interpreter internal steps; if containing 'B', clear screen and print background loading files; if containing 'C', print cache activity." ; fim_var_help_db[FIM_VID_OPEN_OFFSET_L]= "[in,optional,g:,i:] offset (specified in bytes) used when opening a file; [out] i:" FIM_VID_OPEN_OFFSET_L " will be assigned to images opened at a nonzero offset." ; fim_var_help_db[FIM_VID_OPEN_OFFSET_U]= "[in,optional,g:] number of adjacent bytes to probe in opening the file." ; fim_var_help_db[FIM_VID_SEEK_MAGIC]= "[optional,g:] will seek a 'magic' signature in the file after opening it, and will try decoding it starting within the range of that signature (use like this: fim -C '" FIM_VID_SEEK_MAGIC "=MAGIC_STRING;push filename')." ; fim_var_help_db[FIM_VID_PREFERRED_RENDERING_WIDTH]= "[in,optional,g:] if >0, bit based rendering will use this value for a default document width (instead of a default value)." ; fim_var_help_db[FIM_VID_PREFERRED_RENDERING_DPI]= "[in,optional,g:] if >0, pdf, ps, djvu rendering will use this value for a default document dpi (instead of a default value)." ; fim_var_help_db[FIM_VID_PRELOAD_CHECKS]= "[in,experimental,g:] if 1 (default), will check with stat() existence of input files before push'ing them (set this to 0 to speed up loading very long file lists; in these cases a trailing slash (/) will have to be used to tell fim a pathname is a directory). This only works after initialization (thus, after command line files have been push'ed); use --" FIM_OSW_NO_STAT_PUSH " if you wish to set this to 0 at command line files specification." ; #endif /* FIM_WANT_INLINE_HELP */ fim-0.6-rc2/src/Namespace.h0000644000175000017500000001213614454347340012406 00000000000000/* $LastChangedDate: 2017-10-07 12:14:51 +0200 (Sat, 07 Oct 2017) $ */ /* Namespace.h : Namespace class headers (c) 2007-2017 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_NAMESPACE_H #define FIM_NAMESPACE_H #include "fim.h" namespace fim { #if FIM_USE_CXX11 using fim_var_id = fim::string; //id using variables_t = std::map; //id->var //using fim_var_id_list = std::vector ; using fim_var_id_set = std::set; using fim_var_val_set = std::set; #else /* FIM_USE_CXX11 */ typedef fim::string fim_var_id; //id typedef std::map variables_t; //id->var //typedef std::vector fim_var_id_list; typedef std::set fim_var_id_set; typedef std::set fim_var_val_set; #endif /* FIM_USE_CXX11 */ class Namespace { protected: #ifndef FIM_INDEPENDENT_NAMESPACE CommandConsole*rnsp_; // root Namespace pointer #endif /* FIM_INDEPENDENT_NAMESPACE */ variables_t variables_; //id->var fim_char_t ns_char_; // ns_char_ ':' id public: #if FIM_WANT_LONG_INT int setVariable(const fim_var_id& varname,int value); unsigned int setVariable(const fim_var_id& varname,unsigned int value); #endif /* FIM_WANT_LONG_INT */ fim_int setVariable(const fim_var_id& varname,fim_int value); fim_float_t setVariable(const fim_var_id& varname,fim_float_t value); const fim_char_t* setVariable(const fim_var_id& varname,const fim_char_t* value); const Var & setVariable(const fim_var_id& varname,const Var& value); const fim::string& setVariable(const fim_var_id& varname,const fim::string& value); fim_int getIntVariable(const fim_var_id& varname)const; fim_float_t getFloatVariable(const fim_var_id& varname)const; fim::string getStringVariable(const fim_var_id& varname)const; const Var getVariable(const fim_var_id& varname)const; fim_bool_t isSetVar(const fim_var_id& varname)const; void unsetVariable(const fim_var_id& varname); fim_int setGlobalVariable(const fim_var_id& varname,fim_int value); #if FIM_WANT_LONG_INT int setGlobalVariable(const fim_var_id& varname,int value); unsigned int setGlobalVariable(const fim_var_id& varname,unsigned int value); #endif /* FIM_WANT_LONG_INT */ fim_float_t setGlobalVariable(const fim_var_id& varname,fim_float_t value); const fim_char_t* setGlobalVariable(const fim_var_id& varname,const fim_char_t* value); const fim::string& setGlobalVariable(const fim_var_id& varname, const fim::string& value); fim_bool_t isSetGlobalVar(const fim_var_id& varname)const; fim_int getGlobalIntVariable(const fim_var_id& varname)const; fim_float_t getGlobalFloatVariable(const fim_var_id& varname)const; fim::string getGlobalStringVariable(const fim_var_id& varname)const; const Var getGlobalVariable(const fim_var_id& varname)const; fim::string autocmd_exec(const fim::string& event, const fim_fn_t& fname); fim::string get_variables_list(bool with_values=false, bool fordesc=false)const; virtual size_t byte_size(void)const = 0; fim_err_t assign_ns(const Namespace& ns); explicit Namespace( #ifndef FIM_INDEPENDENT_NAMESPACE CommandConsole *rnsp = FIM_NULL, #endif /* FIM_INDEPENDENT_NAMESPACE */ const fim_char_t ns_char = FIM_SYM_NULL_NAMESPACE_CHAR ) : #ifndef FIM_INDEPENDENT_NAMESPACE rnsp_(rnsp), #endif /* FIM_INDEPENDENT_NAMESPACE */ variables_(variables_t()) ,ns_char_(ns_char) {} virtual ~Namespace(void){} fim_err_t find_matching_list(fim_cmd_id cmd, args_t& completions, bool prepend_ns)const; std::ostream& print(std::ostream& os)const; variables_t::const_iterator begin(void)const{return variables_.begin();} variables_t::const_iterator end(void)const{return variables_.end();} void get_id_list(fim_var_id_set& set)const { for(variables_t::const_iterator fit=variables_.begin();fit!=variables_.end();++fit) set.insert(fit->first); } void shrink_to_fit(void) { #if FIM_USE_CXX11 for(variables_t::iterator fit=variables_.begin();fit!=variables_.end();++fit) /* note we cannot fit->first.shrink_to_fit(), */ fit->second.shrink_to_fit(); #endif /* FIM_USE_CXX11 */ } void cleanup(void) { // erase variables whose id's begin with '_' fim_var_id_set set; get_id_list(set); for(fim_var_id_set::iterator sit=set.begin();sit!=set.end();++sit) if((*sit).c_str()[0]=='_') variables_.erase(*sit); } }; std::ostream& operator<<(std::ostream& os, const Namespace & ns); } #endif /* FIM_NAMESPACE_H */ fim-0.6-rc2/src/FbiStuffXyz.cpp0000644000175000017500000001357614454347340013301 00000000000000/* $LastChangedDate: 2022-10-30 16:13:52 +0100 (Sun, 30 Oct 2022) $ */ /* FbiStuffXyz.cpp : An example file for reading new file types with hypothetical library libxyz. (c) 2014-2018 Michele Martone based on code (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" /* If you want to include a new file format reader in fim, use this file as a playground. This is an example file decoder for our test ".xyz" file format. An *.xyz file may look like the quoted text that follows: "xyz 255 255 1 This is a sample file to be opened by the sample decoder in FbiStuffXyz.cpp." Set FIM_WITH_LIBXYZ to 1 to enable this sample decoder and be able to open *.xyz files. Then do: echo "xyz 255 255 1 This is a sample file to be opened by the sample decoder in FbiStuffXyz.cpp." > file.xyz src/fim file.xyz */ #if FIM_WITH_LIBXYZ #include #include #include #include #ifdef HAVE_ENDIAN_H #include #endif /* HAVE_ENDIAN_H */ namespace fim { extern CommandConsole cc; /* ---------------------------------------------------------------------- */ /* hypothetic libxyz routines */ static fim_err_t xyz_load_image_info_fp(FILE *fp, int * numpagesp, unsigned int *wp, unsigned int *hp) { /* gives width and height and number of pages (assuming each page same size) */ fseek(fp,3,SEEK_SET); fscanf(fp,"%d %d %d",wp,hp,numpagesp); std::cout << "Identified a " << *wp << " x " << *hp << " file with " << *numpagesp << " pages.\n"; return FIM_ERR_NO_ERROR; } static fim_err_t xyz_load_image_fp(FILE *fp, unsigned int page, unsigned char * rgb, int bytes_per_line) { int l,c,w,h,numpages; /* page starts at 0 */ fseek(fp,3,SEEK_SET); fscanf(fp,"%d %d %d",&w,&h,&numpages); std::cout << "Will read page "<< page << " of " << w << " x " << h << " file with " << numpages << " pages.\n"; if(bytes_per_line < w*3) goto err; for (l=0;lfp = fp; if(fseek(h->fp,0,SEEK_END)!=0) goto oops; fo = ftell(h->fp); h->flen = fo; /* FIXME: evil conversion */ if( fo == -1 ) goto oops; errval = xyz_load_image_info_fp(h->fp, &h->np, &i->width, &i->height); if(errval != FIM_ERR_NO_ERROR) { std::cout << "Failed xyz_load_image_info_fp !\n"; goto oops; } i->npages = 1; h->w = i->width; h->h = i->height; h->bytes_per_line = i->width * 3; h->rgb = (fim_byte_t*)fim_malloc(i->height * h->bytes_per_line ); if(!h->rgb) { std::cout << "Failed fim_malloc!\n"; goto oops; } errval = xyz_load_image_fp(h->fp, page, h->rgb, h->bytes_per_line); if(errval != FIM_ERR_NO_ERROR) { std::cout << "Failed xyz_load_image_fp!\n"; goto oops; } return h; oops: if(h) { if(h->rgb) fim_free(h->rgb); fim_free(h); } return FIM_NULL; } static void xyz_read(fim_byte_t *dst, unsigned int line, void *data) { /* this gets called every line. can be left empty if useless. */ struct xyz_state *h = (struct xyz_state *) data; int c; /* * In this example, we copy back from a buffer. * A particular file format may require a call to e.g. xyz_read_line(). * */ if(line == 0) std::cout << "Reading first line of the file..\n"; for (c=0;cw;++c) { dst[c*3+0] = h->rgb[h->bytes_per_line*line+c*3+0]; dst[c*3+1] = h->rgb[h->bytes_per_line*line+c*3+1]; dst[c*3+2] = h->rgb[h->bytes_per_line*line+c*3+2]; } if(line==h->h/2) std::cout << "Read half of the file\n"; if(line == h->h-1) std::cout << "Read the entire file\n"; } static void xyz_done(void *data) { struct xyz_state *h = (struct xyz_state *) data; std::cout << "Done! Closing the file.\n"; fclose(h->fp); fim_free(h->rgb); fim_free(h); } struct ida_loader xyz_loader = { /* * 0000000: 7879 7a2e 2e2e 202e 0a xyz... .. */ /*magic:*/ "xyz", /*moff:*/ 0, /*mlen:*/ 3, /*name:*/ "xyz", /*init:*/ xyz_init, /*read:*/ xyz_read, /*done:*/ xyz_done, }; static void fim__init init_rd(void) { fim_load_register(&xyz_loader); } } #endif /* FIM_WITH_LIBXYZ */ fim-0.6-rc2/src/CommandConsole-init.cpp0000644000175000017500000004077314454347340014717 00000000000000/* $LastChangedDate: 2023-03-26 18:08:22 +0200 (Sun, 26 Mar 2023) $ */ /* CommandConsole-init.cpp : Fim console initialization (c) 2010-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #ifdef FIM_DEFAULT_CONFIGURATION #include "conf.h" /* FIM_DEFAULT_CONFIG_FILE_CONTENTS declared here */ #endif /* FIM_DEFAULT_CONFIGURATION */ #include #include #ifdef FIM_USE_READLINE #include "readline.h" #endif /* FIM_USE_READLINE */ #if FIM_USE_CXX11 #include #endif /* FIM_USE_CXX11 */ namespace fim { #if FIM_WANT_BENCHMARKS static fim_err_t fim_bench_subsystem(Benchmarkable * bo) { fim_int qbn,qbi; fim_fms_t tbtime,btime;// ms size_t times=1; if(!bo) return FIM_ERR_GENERIC; qbn=bo->get_n_qbenchmarks(); for(qbi=0;qbiquickbench_init(qbi); do { btime=-getmilliseconds(); //fim_bench_video(bfp); bo->quickbench(qbi); btime+=getmilliseconds(); ++times; tbtime-=btime; } while(btime>=0.0 && tbtime>0.0 && times>0); --times; tbtime=1000.0-tbtime; std::cout << bo->get_bresults_string(qbi,times,tbtime); bo->quickbench_finalize(qbi); } return FIM_ERR_NO_ERROR; } #endif /* FIM_WANT_BENCHMARKS */ fim_err_t CommandConsole::init(fim::string device) { /* * TODO: move most of this stuff to the constructor, some day. */ fim_int xres=0,yres=0; bool device_failure=false; int dosso=device.find(FIM_SYM_DEVOPTS_SEP_STR); #ifdef FIM_USE_READLINE bool wcs = false; /* want cookie stream (readline but no stdin) */ #endif /* FIM_USE_READLINE */ std::string dopts; /* prevents atof, sprintf and such conversion mismatches. */ setlocale(LC_ALL,"C"); /* portable (among Linux hosts): should use dots for numerical radix separator */ //setlocale(LC_NUMERIC,"en_US"); /* lame */ //setlocale(LC_ALL,""); /* just lame */ assert(displaydevice_==FIM_NULL); if(dosso>0) dopts=device.substr(dosso+strlen(FIM_SYM_DEVOPTS_SEP_STR),device.length()).c_str(); #ifndef FIM_WITH_NO_FRAMEBUFFER if(device.find(FIM_DDN_INN_FB)==0) { extern fim_char_t *default_fbdev,*default_fbmode; /* FIXME: we don't want globals! */ extern int default_vt; extern float default_fbgamma; FramebufferDevice * ffdp=FIM_NULL; displaydevice_=new FramebufferDevice( #ifndef FIM_WANT_NO_OUTPUT_CONSOLE mc_ #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ ); const bool do_boz_patch = (dopts.size() && dopts[0]=='S')?0:(0xbabebabe==0xbabebabe); if( displaydevice_) { ffdp=((FramebufferDevice*)displaydevice_); if(default_fbdev)ffdp->set_fbdev(default_fbdev); if(default_fbmode)ffdp->set_fbmode(default_fbmode); if(default_vt!=-1)ffdp->set_default_vt(default_vt); if(default_fbgamma!=-1.0)ffdp->set_default_fbgamma(default_fbgamma); ffdp=NULL; } if(!displaydevice_ || ((FramebufferDevice*)displaydevice_)->framebuffer_init(do_boz_patch)) { if(do_boz_patch) // if not, allow for reinit cleanup(); displaydevice_=NULL; if(ffdp) delete ffdp; return FIM_ERR_GENERIC; } ffdp=((FramebufferDevice*)displaydevice_); setVariable(FIM_VID_DEVICE_DRIVER,FIM_DDN_VAR_FB); mangle_tcattr_=true; } #endif //#ifndef FIM_WITH_NO_FRAMEBUFFER #ifdef FIM_WITH_LIBIMLIB2 if(device.find(FIM_DDN_VAR_IL2)==0) { DisplayDevice *imld=FIM_NULL; imld=new Imlib2Device( #ifndef FIM_WANT_NO_OUTPUT_CONSOLE mc_, #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ dopts ); if(imld && imld->initialize(sym_keys_)!=FIM_ERR_NO_ERROR){delete imld ; imld=FIM_NULL;} if(imld && displaydevice_==FIM_NULL) { displaydevice_=imld; setVariable(FIM_VID_DEVICE_DRIVER,FIM_DDN_VAR_IL2); mangle_tcattr_=false; } else { device_failure=true; } #ifdef FIM_USE_READLINE wcs = true; #endif /* FIM_USE_READLINE */ } #endif /* FIM_WITH_LIBIMLIB2 */ #ifdef FIM_WITH_LIBSDL if(device.find(FIM_DDN_INN_SDL)==0) { DisplayDevice *sdld=FIM_NULL; fim::string fopts; #if FIM_WANT_SDL_OPTIONS_STRING fopts=dopts; #endif /* FIM_WANT_SDL_OPTIONS_STRING */ sdld=new SDLDevice( #ifndef FIM_WANT_NO_OUTPUT_CONSOLE mc_, #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ fopts ); if(sdld && sdld->initialize(sym_keys_)!=FIM_ERR_NO_ERROR){delete sdld ; sdld=FIM_NULL;} if(sdld && displaydevice_==FIM_NULL) { displaydevice_=sdld; setVariable(FIM_VID_DEVICE_DRIVER,FIM_DDN_VAR_SDL); mangle_tcattr_=false; } else { device_failure=true; } #ifdef FIM_USE_READLINE wcs = true; #endif /* FIM_USE_READLINE */ } #endif /* FIM_WITH_LIBSDL */ #ifdef FIM_WITH_LIBCACA if(device.find(FIM_DDN_INN_CACA)==0) { DisplayDevice *cacad=FIM_NULL; cacad=new CACADevice( #ifndef FIM_WANT_NO_OUTPUT_CONSOLE mc_, #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ dopts ); if(cacad && cacad->initialize(sym_keys_)!=FIM_ERR_NO_ERROR){delete cacad ; cacad=FIM_NULL;} if(cacad && displaydevice_==FIM_NULL) { displaydevice_=cacad; setVariable(FIM_VID_DEVICE_DRIVER,FIM_DDN_VAR_CACA); mangle_tcattr_=false; } else device_failure=true; } #endif /* FIM_WITH_LIBCACA */ #ifdef FIM_WITH_AALIB if(device.find(FIM_DDN_INN_AA)==0) { aad_=new AADevice( #ifndef FIM_WANT_NO_OUTPUT_CONSOLE mc_, #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ dopts ); if(aad_ && aad_->initialize(sym_keys_)!=FIM_ERR_NO_ERROR){delete aad_ ; aad_=FIM_NULL;} { if(aad_ && displaydevice_==FIM_NULL) { displaydevice_=aad_; setVariable(FIM_VID_DEVICE_DRIVER,FIM_DDN_VAR_AA); #if FIM_WANT_SCREEN_KEY_REMAPPING_PATCH /* * It seems like the keymaps get shifted when running under screen. * Regard this as a patch. * */ const fim_char_t * const term = fim_getenv(FIM_CNS_TERM_VAR); if(term && string(term).re_match("screen")) { sym_keys_[FIM_KBD_LEFT]-=3072; sym_keys_[FIM_KBD_RIGHT]-=3072; sym_keys_[FIM_KBD_UP]-=3072; sym_keys_[FIM_KBD_DOWN]-=3072; } mangle_tcattr_=false; #endif /* FIM_WANT_SCREEN_KEY_REMAPPING_PATCH */ } else device_failure=true; } } #endif /* FIM_WITH_AALIB */ if(mangle_tcattr_) tty_raw();// this inhibits unwanted key printout (raw mode), and saves the current tty state // FIXME: an error here on, leaves the terminal in raw mode, and this is not cool if( displaydevice_==FIM_NULL) { displaydevice_=&dummydisplaydevice_; setVariable(FIM_VID_DEVICE_DRIVER,FIM_DDN_VAR_DUMB); if(device_failure) { std::cerr << "Failure using the \""<width(),yres=displaydevice_->height(); displaydevice_->format_console(); #ifdef FIM_WINDOWS /* true pixels if we are in framebuffer mode */ /* fake pixels if we are in text (er.. less than!) mode */ if( xres<=0 || yres<=0 ) { std::cerr << "Unable to spawn a suitable display.\n"; return FIM_ERR_BAD_PARAMS; } try { window_ = new FimWindow( *this, displaydevice_, Rect(0,0,xres,yres) ); if(window_)window_->setroot(); } catch(FimException e) { if( e == FIM_E_NO_MEM || true ) quit(FIM_E_NO_MEM); } addCommand(Command(FIM_FLT_WINDOW,FIM_CMD_HELP_WINDOW, window_,&FimWindow::fcmd_cmd)); #else /* FIM_WINDOWS */ try { viewport_ = new Viewport(*this, displaydevice_); } catch(FimException e) { if( e == FIM_E_NO_MEM || true ) quit(FIM_E_NO_MEM); } #endif /* FIM_WINDOWS */ #ifdef FIM_NAMESPACES if(displaydevice_) setVariable(FIM_VID_FIM_BPP ,displaydevice_->get_bpp()); #endif /* FIM_NAMESPACES */ setVariable(FIM_VID_SCREEN_WIDTH, xres); setVariable(FIM_VID_SCREEN_HEIGHT,yres); /* Here the program loads initialization scripts */ FIM_AUTOCMD_EXEC(FIM_ACM_PRECONF,""); FIM_AUTOCMD_EXEC(FIM_ACM_PREHFIMRC,""); #ifndef FIM_WANT_NOSCRIPTING if(!preConfigCommand_.empty()) execute_internal(preConfigCommand_.c_str(),FIM_X_HISTORY); if(getIntVariable(FIM_VID_NO_DEFAULT_CONFIGURATION)==0 ) { #ifdef FIM_DEFAULT_CONFIGURATION /* so the user could inspect what goes in the default configuration */ setVariable(FIM_VID_FIM_DEFAULT_CONFIG_FILE_CONTENTS,FIM_DEFAULT_CONFIG_FILE_CONTENTS); execute_internal(FIM_DEFAULT_CONFIG_FILE_CONTENTS,FIM_X_QUIET); #endif /* FIM_DEFAULT_CONFIGURATION */ } FIM_AUTOCMD_EXEC(FIM_ACM_POSTHFIMRC,""); #endif /* FIM_WANT_NOSCRIPTING */ #ifndef FIM_NOFIMRC #ifndef FIM_WANT_NOSCRIPTING fim_char_t rcfile[FIM_PATH_MAX]; const fim_char_t * const e = fim_getenv(FIM_CNS_HOME_VAR); FIM_AUTOCMD_EXEC(FIM_ACM_PREGFIMRC,""); if((getIntVariable(FIM_VID_LOAD_DEFAULT_ETC_FIMRC)==1 ) && (getStringVariable(FIM_VID_DEFAULT_ETC_FIMRC)!=FIM_CNS_EMPTY_STRING) ) { string ef=getStringVariable(FIM_VID_DEFAULT_ETC_FIMRC); if(is_file(ef.c_str())) if(FIM_ERR_NO_ERROR!=executeFile(ef.c_str())) std::cerr << "Problems loading " << ef << std::endl; } /* execution of command line-set autocommands */ FIM_AUTOCMD_EXEC(FIM_ACM_POSTGFIMRC,""); FIM_AUTOCMD_EXEC(FIM_ACM_PREUFIMRC,""); #endif /* FIM_WANT_NOSCRIPTING */ #endif /* FIM_NOFIMRC */ { #ifndef FIM_WANT_NOSCRIPTING #include "grammar.h" setVariable(FIM_VID_FIM_DEFAULT_GRAMMAR_FILE_CONTENTS,FIM_DEFAULT_GRAMMAR_FILE_CONTENTS); #endif /* FIM_WANT_NOSCRIPTING */ } #ifndef FIM_NOFIMRC #ifndef FIM_WANT_NOSCRIPTING if(e && strlen(e)(),FIM_EMSG_ITE); static_assert(std::is_floating_point(),FIM_EMSG_ITE); static_assert(std::is_floating_point(),FIM_EMSG_ITE); static_assert(std::is_floating_point(),FIM_EMSG_ITE); static_assert(std::is_enum(),FIM_EMSG_ITE); static_assert(std::is_class(),FIM_EMSG_ITE); static_assert(std::is_abstract(),FIM_EMSG_ITE); static_assert(std::is_polymorphic(),FIM_EMSG_ITE); static_assert(std::is_polymorphic(),FIM_EMSG_ITE); static_assert(std::is_polymorphic(),FIM_EMSG_ITE); static_assert(*FIM_SYM_UNKNOWN_STRING==FIM_SYM_UNKNOWN_CHAR,FIM_EMSG_ICE); #else /* FIM_USE_CXX11 */ assert(*FIM_SYM_UNKNOWN_STRING==FIM_SYM_UNKNOWN_CHAR); #endif /* FIM_USE_CXX11 */ if(getIntVariable(FIM_VID_SANITY_CHECK)==1 ) { fim_err_t errval = FIM_ERR_NO_ERROR; assert( fim::string("-file").re_match("^-")); assert( fim::string("file ").re_match(" ")); assert(!fim::string("file").re_match(" ")); assert(!fim::string("file").re_match("^-")); assert(!fim::string("-file").re_match(FIM_CNS_PIPEABLE_PATH_RE)); assert(!fim::string("file ").re_match(FIM_CNS_PIPEABLE_PATH_RE)); assert( fim::string("file-").re_match(FIM_CNS_PIPEABLE_PATH_RE)); if ( fim_common_test() != 0 ) errval = FIM_ERR_GENERIC; { fim_char_t s[] = {'\\','x','4','1','\\','a','a','\\','x','4','2','b','\\','b',0}; trec(s,"ab","cd"); if ( strcmp(s, "AcaBbd") ) errval = FIM_ERR_GENERIC; } for (int si = 0; si < 3; ++si) { fim_stream stream(si); const fim_str_t t = 1; const fim_char_t*s = "s"; const fim_byte_t b = 'b'; const fim_byte_t S [] = { 'b', FIM_SYM_CHAR_NUL }; const fim_char_t c = 'c'; stream << s << " "; stream << b << " "; stream << S << " "; stream << t << " "; stream << 1 << " "; stream << 1U << " "; stream << c << " "; stream << 99.f << " "; stream << "\n"; } #if FIM_WANT_BENCHMARKS fim_bench_subsystem(displaydevice_); fim_bench_subsystem(&browser_); fim_bench_subsystem(this); { #ifndef FIM_WANT_NO_OUTPUT_CONSOLE const int tbs = 2 * mc_.byte_size(); std::vector hs(tbs,'?'); hs[tbs-1] = FIM_SYM_CHAR_NUL; CommandConsole::status_screen(hs.data()); // TODO: this is to check if DebugConsole coped with that huge string, so a status check would be in order here. displaydevice_->fb_status_screen_new("clear",false,0x01); // TODO: need to connect these to a command displaydevice_->fb_status_screen_new("scroll_down",false,0x02); displaydevice_->fb_status_screen_new("scroll_up",false,0x03); #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ } #endif /* FIM_WANT_BENCHMARKS */ if ( errval == FIM_ERR_GENERIC ) return_code_ = -1; quit(return_code_); exit(return_code_); } return FIM_ERR_NO_ERROR; } #if FIM_WANT_BENCHMARKS fim_int CommandConsole::get_n_qbenchmarks(void)const { return 1; } string CommandConsole::get_bresults_string(fim_int qbi, fim_int qbtimes, fim_fms_t qbttime)const { std::ostringstream oss; switch(qbi) { case 0: oss << "fim console random variables set/get test: " << ((float)(((fim_fms_t)qbtimes)/((qbttime)*1.e-3))) << " set/get /s\n"; } return oss.str(); } void CommandConsole::quickbench_init(fim_int qbi) { std::ostringstream oss; switch(qbi) { case 0: oss << "fim console check"; std::cout << oss.str() << ": " << "please be patient\n"; break; } } void CommandConsole::quickbench_finalize(fim_int qbi) { } void CommandConsole::quickbench(fim_int qbi) { switch(qbi) { case 0: FIM_CONSTEXPR fim_int max_sq=1024*1024; cc.setVariable(fim_rand()%(max_sq),fim_rand()); cc.getIntVariable(fim_rand()%max_sq); break; } } #endif /* FIM_WANT_BENCHMARKS */ void CommandConsole::dumpDefaultFimrc(void)const { #ifdef FIM_DEFAULT_CONFIGURATION std::cout << FIM_DEFAULT_CONFIG_FILE_CONTENTS << "\n"; #endif /* FIM_DEFAULT_CONFIGURATION */ } } fim-0.6-rc2/src/fim.cpp0000644000175000017500000025774714454347340011643 00000000000000/* $LastChangedDate: 2023-04-15 00:54:24 +0200 (Sat, 15 Apr 2023) $ */ /* fim.cpp : Fim main program and accessory functions (c) 2007-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #include #include #ifdef FIM_READLINE_H #include "readline.h" /* readline stuff */ #endif /* FIM_READLINE_H */ /* * Global variables. * */ fim::string g_fim_output_device; #if HAVE_FLEXLEXER_H FlexLexer *lexer; #endif /* HAVE_FLEXLEXER_H */ /* * (nearly) all Fim stuff is in the fim namespace. * */ namespace fim { /* * Globals : should be encapsulated. * */ #if FIM_WITH_DEBUG /* poor man's debugging mechanism */ ssize_t g_allocs_bytes{0}; ssize_t g_allocs_n{0}; std::map g_allocs; #endif fim_char_t g_sc = '\t'; /* separation character for --load-image-descriptions-file */ fim::CommandConsole cc; fim_char_t *default_fbdev=FIM_NULL,*default_fbmode=FIM_NULL; int default_vt=-1; fim_float_t default_fbgamma=-1.0; fim_stream cout/*(1)*/; fim_stream cerr(2); #if FIM_WANT_NEXT_ACCEL fim_int same_keypress_repeats=0; #endif /* FIM_WANT_NEXT_ACCEL */ } struct fim_options_t{ const fim_char_t *name; int has_arg; int *flag; int val; const fim_char_t *desc;/* this is fim specific */ const fim_char_t *optdesc;/* this is fim specific */ const fim_char_t *mandesc;/* this is fim specific */ char cVal(void)const{return static_cast(val);} }; struct fim_options_t fim_options[] = { {"autozoom", no_argument, FIM_NULL, 'a', "scale according to a best fit",FIM_NULL, "Enable autozoom. " FIM_MAN_fB("fim") " will automagically pick a reasonable zoom factor when displaying a new image (as in " FIM_MAN_fB("fbi") ")." }, {FIM_OSW_BINARY, optional_argument, FIM_NULL, 'b', "view any file as either a 1 or 24 bpp bitmap", "24|1", "Display contents of binary files (of any filetype) as these were raw 24 or 1 bits per pixel pixelmaps.\n" "Image width will not exceed the value of the " FIM_MAN_fB(FIM_VID_PREFERRED_RENDERING_WIDTH) " variable.\n" "Regard this as an easter bunny option.\n" #if !FIM_WANT_RAW_BITS_RENDERING // "(disabled)" #endif /* FIM_WANT_RAW_BITS_RENDERING */ }, {FIM_OSW_TEXT, no_argument, FIM_NULL, 0x74657874, "view any file as rendered text characters", FIM_NULL, "Display contents of files (of any filetype) as these were text.\n" "Image width will not exceed the value of the " FIM_MAN_fB(FIM_VID_PREFERRED_RENDERING_WIDTH) " variable.\n" "Non-printable characters will be displayed as \"" FIM_SYM_UNKNOWN_STRING "\".\n" "Regard this as another easter bunny option.\n" #if !FIM_WANT_RAW_BITS_RENDERING // "(disabled)" #endif /* FIM_WANT_RAW_BITS_RENDERING */ }, {"cd-and-readdir", no_argument, FIM_NULL, 0x4352, "step in the directory of first file and push other files in that directory", FIM_NULL, "Step in the directory of the first file to be loaded, push other files from that directory, and jump back to the first file." FIM_CNS_CMDSEP "Useful when invoking from a desktop environment." }, {FIM_OSW_EXECUTE_COMMANDS, required_argument, FIM_NULL, 'c', "execute {commands} after initialization", "{commands}", "Execute " FIM_MAN_fB("commands") " after reading the initialization file, just before entering the interactive mode.\n" "No semicolon (" FIM_MAN_fB(";") ") is required at the end of " FIM_MAN_fB("commands") ".\n" "Do not forget quoting " FIM_MAN_fB("commands") " in a manner suitable to your shell.\n" "So -c next is fine as it is.\n" "A more complicated example, with quotings:\n" "-c '*2;2pan_up;display;while(1){align \"bottom\";sleep \"1\" ; align \"top\"}'\n" "(with the single quotes) tells fim to: double the displayed image \n" "size, pan twice up, display the image, and finally \n" "do an endless loop consisting of bottom and top aligning, alternated.\n" }, {FIM_OSW_EXECUTE_COMMANDS_EARLY, required_argument, FIM_NULL, 'C', "execute {commands} just after initialization", "{commands}", "Similar to the " FIM_MAN_fB("--" FIM_OSW_EXECUTE_COMMANDS) " option, but " "execute " FIM_MAN_fB("commands") " earlier, just before reading the initialization file.\n" "The special 'early' form " FIM_MAN_fB("=var=val") " will assign " FIM_MAN_fB("var") " to " FIM_MAN_fB("val") " immediately, before the interpreter is started.\n" "\n" "For example,\n" "-C '" FIM_MAN_fB(FIM_VID_SCALE_STYLE) "=\" \"' starts fim no auto-scaling;\n" "the equivalent early form is:\n" "-C '=" FIM_MAN_fB(FIM_VID_SCALE_STYLE) "= '.\n" "\n" }, {"device", required_argument, FIM_NULL, 'd', "specify a {framebuffer device}", "{framebuffer device}", "Framebuffer device to use. Default is the one your vc is mapped to (as in fbi)." }, {"dump-reference-help", optional_argument /*no_argument*/, FIM_NULL, 0x6472690a, "dump reference info","man", "Dump to stdout language reference help and quit." }, {"dump-default-fimrc", no_argument, FIM_NULL, 0x64646672, "dump to standard output the default configuration", FIM_NULL,/*Before r1001,-D*/ "Dump default configuration (the one hardcoded in the fim executable) to standard output and quit." }, {FIM_OSW_EXECUTE_SCRIPT, required_argument, FIM_NULL, 'E', "execute {scriptfile} after initialization", "{scriptfile}", "Execute " FIM_MAN_fB("scriptfile") " after the default initialization file is read, and before executing " FIM_MAN_fB("--" FIM_OSW_EXECUTE_COMMANDS) " commands." }, {FIM_OSW_ETC_FIMRC, required_argument, FIM_NULL, 'f', "specify custom initialization file", "{fimrc}", "Specify an alternative system-wide initialization file (default: " FIM_CNS_SYS_RC_FILEPATH "), to be read prior to any other configuration file. " "See also " FIM_MAN_fB("--" FIM_OSW_NO_ETC_FIMRC) ". \n" }, {FIM_OSW_FINAL_COMMANDS, required_argument, FIM_NULL, 'F', "execute {commands} just before exit", "{commands}", "Similar to the " FIM_MAN_fB("--" FIM_OSW_EXECUTE_COMMANDS) " option, but " "execute " FIM_MAN_fB("commands") " after exiting the interactive mode, just before terminating the program." }, {"help", optional_argument, FIM_NULL, 'h', "print program invocation help and exit" ,FIM_HELP_EXTRA_OPTS, "Print program invocation help, and exit. Depending on the option, output can be: short, descriptive, long from man, or complete man." #if FIM_WANT_HELP_ARGS " If further arguments follow, individual help messages will be shown instead." #endif /* FIM_WANT_HELP_ARGS */ }, #if FIM_WANT_CMDLINE_KEYPRESS { FIM_OSW_KEYSYM_PRESS, required_argument, FIM_NULL, 'k', "execute any command bound to keysym at startup","{keysym}", "Execute any command bound (via the " FIM_FLT_BIND " command) to a specified keysym at startup. A keysym can be prefixed by a repetition count number. You can specify the option multiple times to simulate multiple keystrokes. " "Presses entered via " FIM_MAN_fB("--" FIM_OSW_KEYSYM_PRESS) " are processed before presses entered via " FIM_MAN_fB("--" FIM_OSW_CHARS_PRESS) ". " "See man " FIM_MAN_fR("fimrc") "(5) for a list of keysyms and the use of " FIM_FLT_BIND "." }, { FIM_OSW_CHARS_PRESS, required_argument, FIM_NULL, 'K', "input keyboard characters at startup","{chars}", "Input one or more keyboard characters at program startup (simulate keyboard presses). " "This option can be specified multiple times. " "Each additional time (or if the string is empty), a press of " FIM_KBD_ENTER " (ASCII code " FIM_XSTRINGIFY(FIM_SYM_ENTER) ") key is prepended. " "Examples: -K '' simulates press of an " FIM_KBD_ENTER "; " " -K ':next;' activates the command line and enter \"next;\" without executing it; " " -K \":next;\" -K \"next\" executes \"next\", stays in the command line and enter keys \"next\"; " " -K \":next;\" -K \"\" -K \"next\" executes \"next\", leaves the command line, and executes in sequence any command bound to keys 'n', 'e', 'x', 't'. " "Presses entered via " FIM_MAN_fB("--" FIM_OSW_CHARS_PRESS) " are processed after presses entered via " FIM_MAN_fB("--" FIM_OSW_KEYSYM_PRESS) ". " }, #endif /* FIM_WANT_CMDLINE_KEYPRESS */ #if FIM_WANT_PIC_CMTS {FIM_OSW_LOAD_IMG_DSC_FILE, required_argument, FIM_NULL, /*0x6c696466*/'D', "load image descriptions file", "{filename}", "Load image descriptions from file " FIM_MAN_fB("filename") ". Each line begins with the basename of an image file, followed by a Tab character (or a different character if specified via " FIM_MAN_fB("--" FIM_OSW_IMG_DSC_FILE_SEPC) "), then the description text. " "The description text is copied into the " FIM_MAN_fB("i:" FIM_VID_COMMENT) " variable of the image at load time, overriding the comment possibly loaded from the file (e.g. JPEG, PNG or TIFF comment)." #if FIM_WANT_DESC_VEXP " If a '@' followed by and identifier " FIM_CNS_EX_VAR_STRING " is encountered, and i:" FIM_CNS_EX_VAR_STRING " is set, its value is substituted here. If \"@#\" is encountered, the remainder of the description line is ignored." #endif /* FIM_WANT_DESC_VEXP */ #if FIM_WANT_PIC_LVDN " Special comment lines like \"#!fim:var=val\" lead i:var to be assigned value val (unquoted) at image loading time (cached variable); i:var will not be assigned if var starts with an underscore ('_')." " Special comment lines like \"#!fim:+=val\" add val to current description." " Special comment lines like \"#!fim:^=val\" set val to be the base of each description." " Special comment lines like \"#!fim:!=\" reset all cached variables." " Special comment lines like \"#!fim:/=dir\" prepend dir to each file's basename." " Special comment lines like \"#!fim:\\e=dir\" prepend dir to each file's name." /* '\e' stays for '\ ' in man pages */ #if FIM_WANT_PIC_RCMT " Special description text (to be associated to an image) begins with markers: " " with \"#!fim:=\", the last description line is reused;" " with \"#!fim:+\", what follows is appended to the last description line;" " with \"#!fim:^\", what follows is prepended to the last description line;" " with \"#!fim:s/f/t\", the last description line will be used after substitution of occurrences of substring f with string t (f and t cannot contain newlines or a '/')." #endif /* FIM_WANT_PIC_RCMT */ " If val is empty that variable is unset." #if FIM_WANT_PIC_LBFL " These variables are stored also in an internal index used by the " FIM_FLT_LIMIT " command." #endif /* FIM_WANT_PIC_LBFL */ #endif /* FIM_WANT_PIC_LVDN */ " This option sets " FIM_MAN_fB(FIM_VID_COMMENT_OI) "=" FIM_XSTRINGIFY(FIM_OSW_LOAD_IMG_DSC_FILE_VID_COMMENT_OI_VAL) ", so that a caption is displayed over the image." " A description file beginning with \"" FIM_CNS_MAGIC_DESC "\" can be loaded without specifying this switch." }, {FIM_OSW_IMG_DSC_FILE_SEPC, required_argument, FIM_NULL, /*0x69646673*/'S', "image descriptions file separator character", "{sepchar}", "A character to be used as a separator between the filename and the description part of lines specified just before a --" FIM_OSW_LOAD_IMG_DSC_FILE "." }, #endif /* FIM_WANT_PIC_CMTS */ //#ifdef FIM_READ_STDIN_IMAGE {FIM_OSW_IMAGE_FROM_STDIN, no_argument, FIM_NULL, 'i', "read an image file from standard input", FIM_NULL, "Read one single image from the standard input (the image data, not the filename). May not work with all supported file formats." "\nIn the image list, this image takes the special name \"" FIM_STDIN_IMAGE_NAME "\".\n" }, //#endif /* FIM_READ_STDIN_IMAGE */ #if FIM_WANT_PIC_CMTS {"mark-from-image-descriptions-file", required_argument, FIM_NULL, 0x6d666466, "mark files from descriptionos list file", "{filename}", "Set those files specified in " FIM_MAN_fB("filename") " (see --" FIM_OSW_LOAD_IMG_DSC_FILE " for the file format) as marked (see the " FIM_FLT_LIST " command).\n" }, #endif /* FIM_WANT_PIC_CMTS */ {"mode", required_argument, FIM_NULL, 'm', "specify a video mode", "{vmode}", "Name of the video mode to use video mode (must be listed in /etc/fb.modes). Default is not to change the video mode. In the past, the XF86 config file (/etc/X11/XF86Config) used to contain Modeline information, which could be fed to the modeline2fb perl script (distributed with fbset). On many modern xorg based systems, there is no direct way to obtain a fb.modes file from the xorg.conf file. So instead one could obtain useful fb.modes info by using the (fbmodes (no man page AFAIK)) tool, written by bisqwit. An unsupported mode should make fim exit with failure. But it is possible the kernel could trick fim and set a supported mode automatically, thus ignoring the user set mode." }, {"no-rc-file", no_argument, FIM_NULL, 'N', "do not read the personal initialization file at startup", FIM_NULL, "No personal initialization file will be read (default is " FIM_CNS_USR_RC_COMPLETE_FILEPATH ") at startup." }, {FIM_OSW_NO_ETC_FIMRC, no_argument, FIM_NULL, 0x4E4E, "do not read the system-wide initialization file at startup", FIM_NULL, "No system-wide initialization file will be read (default is " FIM_CNS_SYS_RC_FILEPATH ") at startup. " "See also " FIM_MAN_fB("--etc-fimrc") ". \n" }, {"no-internal-config", no_argument, FIM_NULL, 0x4E4E4E, "do not read the internal default configuration at startup" ,FIM_NULL, "No internal default configuration at startup (uses internal variable " FIM_MAN_fB(FIM_VID_NO_DEFAULT_CONFIGURATION) "). Will only provide a minimal working configuration. " }, {"no-commandline", no_argument, FIM_NULL, 0x4E434C, "disable internal command line", FIM_NULL, "With internal command line mode disabled." }, #if FIM_WANT_HISTORY {"no-history-save", no_argument, FIM_NULL, 0x4E4853, "do not save execution history", FIM_NULL, "Do not save execution history at finalization (uses internal variable " FIM_MAN_fB(FIM_VID_SAVE_FIM_HISTORY) "). " }, {"no-history-load", no_argument, FIM_NULL, 0x4E484C, "do not load execution history", FIM_NULL, "Do not load execution history at startup. " }, {"no-history", no_argument, FIM_NULL, 0x4E48, "do not load/save execution history", FIM_NULL, "Do not load or save execution history at startup. " }, #endif /* FIM_WANT_HISTORY */ {FIM_OSW_SCRIPT_FROM_STDIN, no_argument, FIM_NULL, 'p', "read commands from standard input", FIM_NULL, "Read commands from stdin before entering in interactive mode." }, {FIM_OSW_OUTPUT_DEVICE, required_argument, FIM_NULL, 'o', "specify the desired output driver (aka graphic mode) ", FIM_DDN_VARS, "Will use the specified \\fBdevice\\fP as fim video output device, overriding automatic checks.\n" "The available devices depend on the original configuration/compilation options, so you should\n" "get the list of available output devices issuing \\fBfim --version\\fP.\n" // #ifndef FIM_WITH_NO_FRAMEBUFFER "The " FIM_MAN_fB(FIM_DDN_INN_FB) " option selects the Linux framebuffer. Presence of option " FIM_MAN_fB("S") " (e.g. " FIM_MAN_fB("fb=S") ") makes framebuffer initialization more picky: it will not tolerate running in a screen session.\n" // #endif /* FIM_WITH_NO_FRAMEBUFFER */ //#ifdef FIM_WITH_LIBCACA "The " FIM_MAN_fB(FIM_DDN_INN_CACA) " option (coloured Ascii Art) can be specified as " FIM_MAN_fB(FIM_DDN_INN_CACA) FIM_MAN_fB("[" FIM_SYM_DEVOPTS_SEP_STR "{['w']}] ") "; if supplied, " FIM_MAN_fB("'w'") " selects windowed mode, provided libcaca is running under X; by default (or with " FIM_MAN_fB("'W'") "), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable.\n" //#endif /* FIM_WITH_LIBCACA */ //#ifdef FIM_WITH_AALIB "The " FIM_MAN_fB(FIM_DDN_INN_AA) " (monochrome Ascii Art) option can be specified as " FIM_MAN_fB(FIM_DDN_INN_AA "[" FIM_SYM_DEVOPTS_SEP_STR "{['w'|'W']}]") "; if supplied, " FIM_MAN_fB("'w'") " selects windowed mode, provided aalib is running under X; by default (or with " FIM_MAN_fB("'W'") "), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable.\n" //#endif /* FIM_WITH_AALIB */ "Please note that the readline (internal command line) functionality in " FIM_MAN_fB(FIM_DDN_INN_CACA) " and " FIM_MAN_fB(FIM_DDN_INN_AA) " modes is limited.\n" #if FIM_WANT_SDL_OPTIONS_STRING "The \\fBsdl\\fP option (graphical windowed mode) may be specified as \\fBsdl" FIM_MAN_iB FIM_SYM_DEVOPTS_SEP_STR "{['w']['m']['r']['h']['W']['M']['R']['H'][width[:height]]['%']}\\fP," " where " FIM_MAN_fB("width") " and " FIM_MAN_fB("height") " are integer numbers specifying the desired resolution " " (if " FIM_MAN_fB("height") " not specified, it takes the value of " FIM_MAN_fB("width") ");" " the " FIM_MAN_fB("'w'") " character requests windowed mode (instead of " FIM_MAN_fB("'W'") " for fullscreen);" " the " FIM_MAN_fB("'m'") " character requests mouse pointer display;" " the " FIM_MAN_fB("'h'") " character requests help grid map draw (can be repeated for variants);" " the " FIM_MAN_fB("'r'") " character requests support for window resize;" " the " FIM_MAN_fB("'%'") " character requests to treat " FIM_MAN_fB("width") " and " FIM_MAN_fB("height") " as percentage of possible window resolution." " The same letters uppercase request explicit negation of the mentioned features.\n" #endif /* FIM_WANT_SDL_OPTIONS_STRING */ //#ifdef FIM_WITH_LIBIMLIB2 "The \\fB" "imlib2" "\\fP option requests imlib2 and is unfinished -- do not use it.\n" "The " FIM_MAN_fB(FIM_DDN_INN_DUMB) " test mode is not interactive.\n" //#endif /* FIM_WITH_LIBIMLIB2 */ }, {"offset", required_argument, FIM_NULL, 0x6f66660a, "open at specified byte offset", "{bytes-offset[{:upper-offset}|{+offset-range}]}", "Use the specified \\fBoffset\\fP (in bytes) for opening the specified files. If \\fB:upper-offset\\fP is specified, further bytes until \\fBupper-offset\\fP will be probed. If \\fB+offset-range\\fP is specified instead, that many additional bytes will be probed. Use this option to search damaged file systems for image files. Appending a modifier among K,M,G (case irrelevant) to an offset number changes the unit to be respectively 2^10, 2^20, or 2^30 bytes." }, {"pread-cmd", required_argument, FIM_NULL, 0x70726561, //prea(d) "read image file in stdin from pipeline", "{cmd-filter-pipeline}", "Specify a shell command with " FIM_MAN_fB("{cmd-filter-pipeline}") ". If the current filename matches \"" FIM_CNS_PIPEABLE_PATH_RE "\", it will be substituted to any occurrence of '{}'. The resulting command output is assumed to be file data, which will be read and displayed.\n" "This works by setting the internal " FIM_MAN_fB(FIM_VID_PREAD) " variable (empty by default)." }, {"text-reading", no_argument, FIM_NULL, 'P', "enable space-based scrolling through the document", FIM_NULL, "Enable textreading mode. This has the effect that fim will display images scaled to the width of the screen, and aligned to the top. If the images you are watching are text pages, all you have to do to get the next piece of text is to press space (in the default key configuration, of course)." }, {"scroll", required_argument, FIM_NULL, 's', "set scroll variable value", "{value}", "Set scroll steps for internal variable " FIM_MAN_fB(FIM_VID_STEPS) " (default is " FIM_CNS_STEPS_DEFAULT ")." }, {"slideshow", required_argument, FIM_NULL, 0x7373, "interruptible slideshow mode", FIM_CNS_EX_NUM_STRING, "Interruptible slideshow mode. " "Wait for " FIM_MAN_fB(FIM_CNS_EX_NUM_STRING) " of seconds (assigned to the " FIM_MAN_fB(FIM_VID_WANT_SLEEPS) " variable) after each image. " "Implemented by executing " FIM_CNS_SLIDESHOW_CMD " as a first command. " "Can be interrupted by " FIM_KBD_COLON " or " FIM_KBD_ESC ". " "The other keys will execute accordingly to their function but will not interrupt the slideshow. " "Like in fbi, this will cycle forever, unless " FIM_MAN_fB("--once") " is specified." }, {"sanity-check", no_argument, FIM_NULL, 0x70617363, "only perform a sanity check", FIM_NULL, /* Was -S until r1001 */ "Perform a quick sanity check, just after the initialization, and terminate." }, /* NEW */ {"no-framebuffer", no_argument, FIM_NULL, 't', "display images in text mode (as -o " FIM_DDN_INN_AA ")",FIM_NULL, FIM_MAN_fB("fim") " Use an ASCII Art driver. If present, use either of libcaca (coloured), or aalib (monochrome). For more, see (man fimrc), (info aalib) or (apropos caca)).\n" "If no ASCII Art driver was enabled at compile time, fim will not display any image at all." }, {"vt", required_argument, FIM_NULL, 'T', "specify a virtual terminal for the framebufer", "{terminal}", "The \\fBterminal\\fP will be used as virtual terminal device file (as in fbi).\n" "See (chvt (1)), (openvt (1)) for more info about this.\n" "Use (con2fb (1)) to map a terminal to a framebuffer device.\n" }, {"reverse", no_argument, FIM_NULL, 0x7772666c, "reverse images list", FIM_NULL, "Reverse files list before browsing (can be combined with the other sorting options)." }, {"sort", no_argument, FIM_NULL, 0x736f7274, "sort images by pathname", FIM_NULL, "Sort files list before browsing according to full filename." }, {"sort-basename", no_argument, FIM_NULL, 0x736f626e, "sort images by basename", FIM_NULL, "Sort files list before browsing according to file basename's." }, //#if FIM_WANT_SORT_BY_STAT_INFO {FIM_OSW_SORT_MTIME, no_argument, FIM_NULL, 0x7369626d, "sort images by modification time", FIM_NULL, "Sort files list before browsing according to file modification time." }, {FIM_OSW_SORT_FSIZE, no_argument, FIM_NULL, 0x73696273, "sort images by file size",FIM_NULL, "Sort files list before browsing according to file size." }, //#endif /* FIM_WANT_SORT_BY_STAT_INFO */ {"random", no_argument, FIM_NULL, 'u', "randomize images order", FIM_NULL, "Randomly shuffle the files list before browsing (seed depending on time() function)." }, {"random-no-seed", no_argument, FIM_NULL, 0x7073, "randomize images order",FIM_NULL, "Pseudo-random shuffle the files list before browsing (no seeding)." }, {"verbose", no_argument, FIM_NULL, 'v', "be verbose", FIM_NULL, "Be verbose: show status bar." }, {"verbose-load", no_argument, FIM_NULL, 0x766c, "verbose file loading", FIM_NULL, "Load files verbosely (repeat option to increase verbosity)." }, {"verbose-font-load", no_argument, FIM_NULL, 0x7666, "verbose font loading", FIM_NULL, "Load font verbosely (sets " FIM_MAN_fB(FIM_VID_FB_VERBOSITY) ")." /* (repeat option to increase verbosity)." */ }, {"verbose-interpreter", no_argument, FIM_NULL, 0x76696d0a, "verbose interpreter", FIM_NULL, "Execute interpreter verbosely (Sets immediately " FIM_MAN_fB(FIM_VID_DBG_COMMANDS) "=\"" FIM_CNS_DBG_CMDS_MID "\" if specified once, " FIM_MAN_fB(FIM_VID_DBG_COMMANDS) "=\"" FIM_CNS_DBG_CMDS_MAX "\" if specified twice)." }, {"version", no_argument, FIM_NULL, 'V', "print program version", FIM_NULL, "Print to stdout program version, compile flags, enabled features, linked libraries information, supported filetypes/file loaders, and then exit." }, {"autowidth", no_argument, FIM_NULL, 'w', "scale fitting to screen width",FIM_NULL, "Scale the image according to the screen width." }, {"no-auto-scale", no_argument, FIM_NULL, '=' /*0x4E4053*/, "do not use any auto-scaling", FIM_NULL, "Do not scale the images after loading (will set '" FIM_MAN_fB(FIM_VID_SCALE_STYLE) "=\" \"';)." }, {"autowindow", no_argument, FIM_NULL, 0x61757769, "adapt window to image size",FIM_NULL, "Resize the window size (if supported by the video mode) to the image size. Don't use this with other image scaling options." }, {FIM_OSW_NO_STAT_PUSH, no_argument, FIM_NULL, 0x6e7363, "do not check file/dir existence with stat(2) at push time", FIM_NULL, "Sets " FIM_MAN_fB(FIM_VID_PRELOAD_CHECKS) "=0 before initialization, thus disabling file/dir existence checks with stat(2) at push push time (and speeding up startup)." }, {"autoheight", no_argument, FIM_NULL, 'H', "scale according to height", FIM_NULL, "Scale the image according to the screen height." }, {FIM_OSW_DUMP_SCRIPTOUT, required_argument, FIM_NULL, 'W', "will record any executed command to the a {scriptfile}", "{scriptfile}", "All the characters that you type are recorded in the file " FIM_MAN_fB("{scriptout}") ", until you exit " FIM_MAN_fB("fim") ". This is useful if you want to create a script file to be used with \"fim -c\" or \":exec\" (analogous to Vim's -s and \":source!\"). If the " FIM_MAN_fB("{scriptout}") " file exists, it will be not touched (as in Vim's -w). " }, {"read-from-file", required_argument, FIM_NULL, 'L', "read an image list from a file","{fileslistfile}", "Read file list from a file: each line one file to load (similar to " FIM_MAN_fB("--read-from-stdin") "; use " FIM_MAN_fB("--read-from-stdin-elds") " to control line breaking).\n" "\n" }, #ifdef FIM_READ_STDIN {FIM_OSW_READ_FROM_STDIN, no_argument, FIM_NULL, '-', "read an image list from standard input", FIM_NULL, "Read file list from stdin: each line one file to load; use with --read-from-stdin-elds to control line breaking).\n" "\n" "Note that these the three standard input reading functionalities (-i,-p and -) conflict : if two or more of them occur in fim invocation, fim will exit with an error and warn about the ambiguity.\n" "\n" "See the section\n" ".B INVOCATION EXAMPLES\n" "below to read some useful (and unique) ways of employing fim.\n" }, #endif /* FIM_READ_STDIN */ {"read-from-stdin-elds", required_argument, FIM_NULL, 0x72667373, "endline delimiter character for --read-from-stdin/--read-from-file", "{delimiter-char}", "Specify an endline delimiter character for breaking lines read via -/--read-from-stdin/--read-from-file (which shall be specified after this). Line text before the delimiter will be treated as names of files to load; the text after will be ignored. This is also useful e.g. to load description files (see --" FIM_OSW_LOAD_IMG_DSC_FILE ") as filename list files. Default is the newline character (0x0A)" #ifdef HAVE_GETDELIM "; to specify an ASCII NUL byte (0x00) use ''" #endif /* HAVE_GETDELIM */ ".\n" }, {"autotop", no_argument, FIM_NULL, 'A' , "align image to top border", FIM_NULL, "Align images to the top border (by setting '" FIM_MAN_fB(FIM_VID_AUTOTOP) "=1' after initialization)." }, // {"gamma", required_argument, FIM_NULL, 'g',"set gamma (UNFINISHED)","{gamma}", //" gamma correction. Can also be put into the FBGAMMA environment variable. Default is 1.0. Requires Pseudocolor or Directcolor visual, doesn't work for Truecolor." // }, {"quiet", no_argument, FIM_NULL, 'q', "quiet execution mode", FIM_NULL, "Quiet execution mode. Sets " FIM_CNS_QUIET_CMD ".\n" }, #if FIM_WANT_R_SWITCH {"resolution", required_argument, FIM_NULL, 'r', "set SDL resolution", "{width:height}", "Set resolution specification in pixels. Supported by SDL only. Will be appended to the argument to --" FIM_OSW_OUTPUT_DEVICE ". " "Shorthand value 'fullscreen' will be translated into 'W'. " }, #else /* FIM_WANT_R_SWITCH */ {"resolution", required_argument, FIM_NULL, 'r', "Set resolution (UNFINISHED).", "{width:height}", FIM_NULL }, #endif /* FIM_WANT_R_SWITCH */ #if FIM_WANT_RECURSE_FILTER_OPTION {FIM_OSW_RECURSIVE, optional_argument, FIM_NULL, 'R', "push paths recursively", "{exp}", "Push files/directories to the files list recursively. " "The expression in variable " FIM_MAN_fB(FIM_VID_PUSHDIR_RE) " (default: \"" FIM_CNS_PUSHDIR_RE "\") lists extensions of filenames which will be loaded in the list. " "You can overwrite its value by optionally passing an expression " FIM_MAN_fB("{exp}") " here as argument. " "If starting with '+' or '|', the expression following will be appended to it. " }, #else /* FIM_WANT_RECURSE_FILTER_OPTION */ {FIM_OSW_RECURSIVE, no_argument, FIM_NULL, 'R', "push paths recursively", FIM_NULL, "Push files/directories to the files list recursively. See variable " FIM_MAN_fB(FIM_VID_PUSHDIR_RE) " for extensions of filenames which will be loaded in the list. " }, #endif /* FIM_WANT_RECURSE_FILTER_OPTION */ #if FIM_WANT_NOEXTPROPIPE {FIM_OSW_NOEXTPIPLOA, no_argument, FIM_NULL, 'X', "only use built-in file decoders", FIM_NULL, "Do not load via external converter programs: only use built-in file decoders." }, #endif /* FIM_WANT_NOEXTPROPIPE */ //#if FIM_WANT_BACKGROUND_LOAD {FIM_OSW_BGREC, no_argument, FIM_NULL, 'B', "push paths recursively in background", FIM_NULL, "Push files/directories to the files list recursively, in background during program execution. Any sorting options will be ignored." " Experimental feature, unfinished." }, //#endif /* FIM_WANT_BACKGROUND_LOAD */ //#if FIM_EXPERIMENTAL_SHADOW_DIRS {"load-shadow-directory", required_argument, FIM_NULL, 0x68696768, "add shadow directory for 'scale \"shadow\"'", "{dir}", "Add " FIM_MAN_fB("{dir}") " to the shadow directory list. Then 'scale \"shadow\"' will temporarily substitute the image being displayed with that of the first same-named file located under a shadow directory. Useful to browse low-res images, but still being able to quickly view the hi-res original residing in a shadow directory. This works as intended as long as unique filenames are involved." }, //#endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ { "/", required_argument, FIM_NULL, '/', "jump to file name matching pattern", "{pattern}", "After startup jump to pattern; short for -c '" FIM_SYM_FW_SEARCH_KEY_STR "'." }, {"//", required_argument, FIM_NULL, 0x2f2f0000, "jump to file path matching pattern","{pattern}","After startup jump to pattern; as -c '" FIM_SYM_FW_SEARCH_KEY_STR "' but with search on the full path (with " FIM_MAN_fB(FIM_SYM_CMD_SLSL) ")." }, /* {"timeout", required_argument, FIM_NULL, 't',"",FIM_NULL},*/ /* timeout value */ /* fbi's */ {"once", no_argument, FIM_NULL, '1', "if running --slideshow, loop only once", FIM_NULL, "If running --slideshow, loop only once (as in fbi)." }, /* loop only once */ /* fbi's and fim's */ /* {"font", required_argument, FIM_NULL, 'f',"",FIM_NULL},*/ /* font */ /* {"edit", no_argument, FIM_NULL, 'e',"",FIM_NULL},*/ /* enable editing */ /* fbi's */ /* {"list", required_argument, FIM_NULL, 'l',"",FIM_NULL},*/ // {"backup", no_argument, FIM_NULL, 'b',"",FIM_NULL}, /* fbi's */ // {"debug", no_argument, FIM_NULL, 'D',"",FIM_NULL}, // {"preserve", no_argument, FIM_NULL, 'p',"",FIM_NULL}, /* fbi's */ /* long-only options */ // {"autoup", no_argument, &autoup, 1 }, // {"autodown", no_argument, &autodown, 1 }, // {"comments", no_argument, &comments, 1 }, {0,0,0,0,0,0} }; #if 0 // leftovers from the old man file; shall adapt these using .\" .TP .B -f font Set font. This can be either a pcf console font file or a X11 font spec. Using X11 fonts requires a font server (The one specified in the environment variable FONTSERVER or on localhost). The FBFONT environment variable is used as default. If unset, fim will fallback to 10x20 (X11) / lat1u-16.psf (console). .TP .B --autoup Like autozoom, but scale up only. .TP .B --autodown Like autozoom, but scale down only. .TP .B -u Randomize the order of the filenames. .TP .B -e Enable editing commands. .TP .B -b create backup files (when editing images). .TP .B -p preserve timestamps (when editing images). .TP .B --comments Display comment tags (if present) instead of the filename. Probaby only useful if you added reasonable comments yourself (using wrjpgcom for example), otherwise you likely just find texts pointing to the software which created the image. P pause the slideshow (if started with -t, toggle) {number}g jump to image {number} .SH EDIT IMAGE fim also provides some very basic image editing facilities. You have to start fim with the -e switch to use them. .P .nf Shift+D delete image R rotate 90 degrees clockwise L rotate 90 degrees counter-clock wise .fi .P The delete function actually wants a capital letter 'D', thus you have to type Shift+D. This is done to avoid deleting images by mistake because there are no safety bells: If you ask fim to delete the image, it will be deleted without questions asked. .P The rotate function actually works for JPEG images only because it calls the jpegtran command to perform a lossless rotation if the image. It is especially useful if you review the images of your digital camera. #endif FIM_CONSTEXPR int fim_options_count=sizeof(fim_options)/sizeof(fim_options_t); struct option options[fim_options_count]; fim::string fim_help_opt(const char*qs, const char dl) { std::ostringstream oss; if( qs && qs[0] == '-' && !qs[1] ) { oss << "The short command options of fim are: "; for(size_t i=0;i"; if(fim_options[i].optdesc) oss << " " << fim_options[i].optdesc << ""; else oss << " "; break; case optional_argument: if(fim_options[i].optdesc) oss << "[=" << fim_options[i].optdesc << "]"; else oss << "[=" << "arg" << "]"; break; default: ; } oss << slwe; oss << slom; if(helparg&&*helparg=='d') oss << "\t\t " << fim_options[i].desc; if(helparg&&*helparg=='m') { if(fim_options[i].mandesc) oss << fim_options[i].mandesc; else { oss << "\t\t "; if(fim_options[i].desc) oss << fim_options[i].desc; } } //if(helparg||*helparg!='m') oss << FIM_SYM_ENDL; oss << sloe; //if(helparg&&*helparg=='l') std::cout << "TODO: print extended help here\n"; } oss << "\n"; return oss.str(); } int fim_dump_man_page(void) { string mp= string(".\\\"\n" ".\\\" $Id""$\n" ".\\\"\n" ".TH FIM 1 \"(c) 2007-" FIM_CNS_LCY " " FIM_AUTHOR_NAME "\"\n" ".SH NAME\n" "fim - \\fBF\\fPbi (linux \\fBf\\fPrame\\fBb\\fPuffer \\fBi\\fPmageviewer) \\fBIM\\fPproved, an universal image viewer\n" ".SH SYNOPSIS\n" FIM_MAN_Bn("fim [{options}] [--] {imagepath} [{imagepaths}]") FIM_MAN_Bn("fim --" FIM_OSW_OUTPUT_DEVICE " {" FIM_DDN_VARS_NB "} ...") FIM_MAN_Bn("... | fim [{options}] [--] [{imagepaths}] -"))+ #ifdef FIM_READ_STDIN string(FIM_MAN_Bn("fim [{options}] [--] [{files}] - < {file_name_list_text_file}"))+ #endif /* FIM_READ_STDIN */ #ifdef FIM_READ_STDIN_IMAGE string(FIM_MAN_Bn("fim --" FIM_OSW_IMAGE_FROM_STDIN " [{options}] < {imagefile}"))+ #endif /* FIM_READ_STDIN_IMAGE */ #ifdef FIM_READ_STDIN string(FIM_MAN_Bn("fim --" FIM_OSW_SCRIPT_FROM_STDIN " [{options}] < {scriptfile}"))+ #endif /* FIM_READ_STDIN */ #if FIM_WANT_HELP_ARGS string(FIM_MAN_Bn("fim --help[=" FIM_HELP_EXTRA_OPTS "] [{help-item} ...] "))+ #endif /* FIM_WANT_HELP_ARGS */ string("\n" ".SH DESCRIPTION\n" ".B\nfim\nis a `swiss army knife' for displaying image files.\n" "It is capable of displaying image files using different graphical devices while offering a uniform look and feel.\n" "Key bindings are customizable and specified in an initialization file.\n" "Interaction with standard input and output is possible (especially in shell scripts).\n" "An internal scripting language specialized for image viewing allows image navigation, scaling, manipulation of internal variables, command aliases, and vim-like autocommands.\n" "The internal language can be interacted with via a command line mode capable of autocompletion and history (the readline mode).\n" "Further features are display of EXIF tags, JPEG comments, EXIF rotation/orientation, load of \"description files\", faster load via image caching, command recording, and much more.\n\n" "As a default,\n.B\nfim\ndisplays the specified file(s) on the detected, most convenient graphical device. " "This can be with SDL if running under X, an Ascii Art driver (aalib or libcaca) if running behind ssh without X forwarding, or the linux framebuffer device. " "Graphical file formats " FIM_CNS_DSFF_SN " are supported natively, while " FIM_CNS_DSFF_SL " are supported via third party libraries. \n" "Further formats are supported via external converters. \n" "For XCF (Gimp's) images, will try to use '" FIM_EPR_XCFTOPNM "'.\nFor FIG vectorial images, will try to use '" FIM_EPR_FIG2DEV "'.\nFor DIA vectorial images, will try to use '" FIM_EPR_DIA "'.\nFor SVG vectorial images, will try to use '" FIM_EPR_INKSCAPE "'.\nFor other formats will try to use ImageMagick's '" FIM_EPR_CONVERT "' executable.\n" #if FIM_HAS_TIMEOUT "The converter is given " FIM_EXECLP_TIMEOUT " seconds for the conversion before a timeout.\n" #else /* FIM_HAS_TIMEOUT */ "During conversion fim pauses for a second.\n" #endif /* FIM_HAS_TIMEOUT */ "\n")+ string("\n""If " FIM_MAN_fB("{imagepath}") " is a file, its format is guessed not by its name but by its contents. " "See the " FIM_MAN_fB(FIM_VID_FILE_LOADER) " variable to change this default.\n\n") #ifdef FIM_READ_DIRS + string("\n""If " FIM_MAN_fB("{imagepath}") " is a directory, therein contained files of supported formats will be loaded. If " FIM_MAN_fB("{imagepath}") " contains a trailing slash (" FIM_CNS_SLASH_STRING "), it will be treated as a directory; otherwise this will be checked via " FIM_MAN_fB("stat(2)") ". To change this default, see description of the " FIM_MAN_fB(FIM_VID_PUSHDIR_RE) " variable and the " FIM_MAN_fB("--" FIM_OSW_NO_STAT_PUSH) " and " FIM_MAN_fB("--" FIM_OSW_RECURSIVE) " options.\n\n") #endif /* FIM_READ_DIRS */ ; // string("Please note that a user guide of \n.B fim\nis in the " FIM_CNS_FIM_TXT " file distributed in the source package.\n\n")+ mp+=string("This man page describes \n.B fim\ncommand line options and usage.\n" "See man " FIM_MAN_fR("fimrc") "(5) for a full specification of the \n.B\nfim\nlanguage, commands, keysyms, autocommands, variables, aliases, examples for a configuration file and readline usage samples.\n" "\n" ".SH USAGE\n" "You may invoke\n.B\nfim\nfrom an interactive shell and control it with the keyboard, as you would do with any image viewer with reasonable key bindings.\n" "\n.B\nfim\nis keyboard oriented: there are no user menus or buttons available.\n" "If you need some feature or setting which is not accessible from the default keyboard configuration, you probably need a custom configuration or simply need to type a custom command. For these, you can use the internal command and configuration language.\n" "\nSee options " FIM_MAN_fB("--" FIM_OSW_READ_FROM_STDIN) ", " FIM_MAN_fB("--" FIM_OSW_SCRIPT_FROM_STDIN) ", and " FIM_MAN_fB("--" FIM_OSW_IMAGE_FROM_STDIN) " for more script-oriented usages.\n" "\nThe full commands specification is also accessible at runtime using the internal help system (typing :help).\n" "\n" "\n.SH OPTIONS\n" "Accepted command line " FIM_MAN_fB("{options}") ":\n"); mp+=fim_dump_man_page_snippets(); mp+=string(".SH PROGRAM RETURN STATUS\n"); mp+=string("The program return status is ")+string(FIM_ERR_NO_ERROR)+string(" on correct operation; "); mp+=string(FIM_PERR_UNSUPPORTED_DEVICE)+string(" on unsupported device specification; "); mp+=string(FIM_PERR_BAD_PARAMS)+string(" on bad input; "); mp+=string(FIM_PERR_GENERIC)+string(" on a generic error; "); mp+=string(FIM_PERR_OOPS)+string(" on a signal-triggered program exit; "); mp+=string(" or a different value in case of an another error.\n" " The return status may be controlled by the use of the " FIM_FLT_QUIT " command.\n" ".SH COMMON KEYS AND COMMANDS\n" ".nf\n" "The following keys and commands are hardcoded in the minimal configuration. These are working by default before any config loading, and before the hardcoded config loading (see variable " FIM_MAN_fB(FIM_VID_FIM_DEFAULT_CONFIG_FILE_CONTENTS) ").\n\n" ); //"cursor keys scroll large images\n" //"h,j,k,l scroll large images left,down,up,right\n" //"+, - zoom in/out\n" //"ESC, q quit\n" //"Tab toggle output console visualization\n" //"PgUp,p previous image\n" //"PgDn,n next image\n" //"Space next image if on bottom, scroll down instead\n" //"Return next image, write the filename of the current image to stdout on exit from the program.\n" #define FIM_SROC(VAR,VAL) { if( VAR != VAL && VAR != Nothing ) std::cerr< selection.txt") "# output the file names marked interactively with the '" FIM_FLT_LIST " \"mark\"' command in fim to a file\n" ".P\n" ".P\n" "\n" FIM_MAN_Bn("fim * | fim -") "# output the file names marked with 'm' in fim to a second instance of fim, in which these could be marked again\n" ".P\n" ".P\n" "\n" FIM_MAN_Bn("fim\n-c 'pread \"vgrabbj -d /dev/video0 -o png\";reload'") "# display an image grabbed from a webcam\n" ".P\n" ".P\n" "\n" FIM_MAN_Bn("fim\n-o " FIM_DDN_INN_AA " -c 'pread \"vgrabbj -d /dev/video0 -o png\";reload;system \"fbgrab\" \"asciime.png\"'") ".fi\n" "# if running in framebuffer mode, will save a png screenshot with an ASCII rendering of an image grabbed from a webcam\n" ".P\n" ".P\n" "\n" FIM_MAN_Bn("fim\n" "-c 'while(1){pread \"vgrabbj -d /dev/video0 -o png\";reload;sleep 1;};'\n") "# will display a sequence of images grabbed from a webcam; circa 1 per second\n" ".P\n" ".P\n" "\n" ); mp+=string( ".SH NOTES\n" "This manual page is neither accurate nor complete. In particular, issues related to driver selection shall be described more accurately. Also the accurate sequence of autocommands execution, variables application is critical to understanding fim, and should be documented.\n" #ifdef FIM_READ_STDIN_IMAGE "The filename \"" FIM_STDIN_IMAGE_NAME "\" is reserved for images read from standard input (view this as a limitation), and thus handling files with such name may incur in limitations.\n" #endif /* FIM_READ_STDIN_IMAGE */ #ifdef FIM_WITH_LIBSDL "The SDL driver is quite inefficient, for a variety of reasons. In particular, its interaction with the readline library can be problematic (e.g.: when running in sdl mode without a terminal). This shall be fixed.\n" #endif /* FIM_WITH_LIBSDL */ ); mp+=string( ".SH BUGS\n" FIM_MAN_fB("fim") " has bugs. Please read the \n" ".B BUGS\n" "file shipped in the documentation directory to discover the known ones.\n" "There are also inconsistencies in the way the internal command line works across the different graphical devices.\n" ".SH FILES\n" "\n" ".TP 15\n" ".B " FIM_CNS_DOC_PATH "\n" "The directory with " FIM_MAN_fB("fim") " documentation files.\n" ".TP 15\n" ".B " FIM_CNS_SYS_RC_FILEPATH "\n" "The system-wide " FIM_MAN_fB("fim") " initialization file (executed at startup, after executing the hardcoded configuration).\n" ".TP 15\n" ".B " FIM_CNS_USR_RC_COMPLETE_FILEPATH "\n" "The personal " FIM_MAN_fB("fim") " initialization file (executed at startup, after the system-wide initialization file).\n" ".TP 15\n" ".B " FIM_CNS_HIST_COMPLETE_FILENAME "\n" "File where to load from or save. See" " (man " FIM_MAN_fR("fimrc") "(5)," " man " FIM_MAN_fR("readline") "(3))." "\n" ".TP 15\n" ".B ~/.inputrc\n" "If " FIM_MAN_fB("fim") " is built with GNU readline support, it will be susceptible to chages in the user set ~/.inputrc configuration file contents. For details, see" " (man " FIM_MAN_fR("readline") "(3))." "\n" ); mp+=string( ".SH SEE ALSO\n" "Other " FIM_MAN_fB("fim") " man pages: " FIM_MAN_fR("fimgs") "(1), " FIM_MAN_fR("fimrc") "(1).\n" ".fi\n" "Conversion programs: " FIM_MAN_fR("convert") "(1), " FIM_MAN_fR("dia") "(1), " FIM_MAN_fR("xcftopnm") "(1), " FIM_MAN_fR("fig2dev") "(1), " FIM_MAN_fR("inkscape") "(1).\n" ".fi\n" "Related programs: " FIM_MAN_fR("fbset") "(1), " FIM_MAN_fR("con2fb") "(1), " FIM_MAN_fR("vim") "(1), " FIM_MAN_fR("mutt") "(1), " FIM_MAN_fR("exiftool") "(1), " FIM_MAN_fR("exiftags") "(1), " FIM_MAN_fR("exiftime") "(1), " FIM_MAN_fR("exifcom") "(1), " FIM_MAN_fR("fbi") "(1), " FIM_MAN_fR("fbida") "(1), " FIM_MAN_fR("feh") "(1), " FIM_MAN_fR("fbgrab") "(1).\n" ".fi\n" "Related documentation: " FIM_MAN_fR("fbdev") "(4), " FIM_MAN_fR("vcs") "(4), " FIM_MAN_fR("fb.modes") "(8), " FIM_MAN_fR("fbset") "(8), " FIM_MAN_fR("setfont") "(8)" ".\n" ".fi\n" ".SH AUTHOR\n" ".nf\n" ); mp+=string( FIM_AUTHOR " is the author of fim, \"fbi improved\". \n" ".fi\n" ".SH COPYRIGHT\n" ".nf\n" "Copyright (C) 2007-" FIM_CNS_LCY " " FIM_AUTHOR " (author of fim)\n" ".fi\n" "Copyright (C) 1999-2004 " FBI_AUTHOR " is the author of \"fbi\", upon which\n.B fim\nwas originally based. \n" ".P\n" "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.\n" ".P\n" "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.\n" ".P\n" "You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n" ); mp+=string("\n"); std::cout << mp; return 0; } FIM_NORETURN fim_perr_t help_and_exit(const fim_char_t *argv0, fim_perr_t code=FIM_PERR_NO_ERROR, const fim_char_t*helparg=FIM_NULL) { if(helparg&&*helparg=='b') { std::cout << "fim - No loadable images specified.\nUse `fim --help' for detailed usage information.\n"; goto done; } if(helparg&&*helparg=='m') { fim_dump_man_page(); goto done; } cc.printHelpMessage(argv0); std::cout << " where OPTIONS are taken from:\n"; for(size_t i=0;i"; if(fim_options[i].optdesc) std::cout << " =" << fim_options[i].optdesc; else std::cout << " ="; break; case optional_argument: if(fim_options[i].optdesc) std::cout << " " << fim_options[i].optdesc; else std::cout << "[=arg]"; break; default: ; } if(helparg&&*helparg=='d') std::cout << "\t\t " << fim_options[i].desc; if(helparg&&*helparg=='l') std::cout << "\t\t " << fim_man_to_text(fim_options[i].mandesc); std::cout << FIM_SYM_ENDL; //if(helparg&&*helparg=='l') std::cout << "TODO: print extended help here\n"; } std::cout << "\n Please read the documentation distributed with the program.\n" << " For further help, consult the online help in fim (:" FIM_FLT_HELP "), and man fim (1), fimrc (5).\n" << " Pre-configuration online help also available invoking --help {help-item}.\n" << " For bug reporting read the " FIM_CNS_BUGS_FILE " file.\n"; done: std::exit(code); return code; } static fim_err_t fim_load_filelist(const char *fn, const char sac, fim_flags_t pf) { /* TODO: move to CommandConsole */ /*cc.pre_autocmd_add(FIM_VID_DISPLAY_STATUS"=...;");*/ /* or verbose ... */ const char sa [2] = { sac ? sac : FIM_SYM_CHAR_ENDL, FIM_SYM_CHAR_NUL }; fim_char_t *lineptr=FIM_NULL; size_t bs=0; int fc=0; FILE * fd = FIM_NULL; if(fn) fd = fim_fopen(fn,"r"); else fd = stdin; if(!fd) { // note: shall print a warning std::cerr<<"Warning: the " << fn << " file could not be opened.\n"; goto ret; } while(fim_getline(&lineptr,&bs,fd,*sa)>0) { if(*sa=='\n') chomp(lineptr); // BAD if(*sa && lineptr && strstr(lineptr,sa)) *strstr(lineptr,sa) = FIM_SYM_CHAR_NUL; cc.push(lineptr,pf); // printf("%s\n",lineptr); fim_getline(&lineptr,FIM_NULL,FIM_NULL,0); // proper free lineptr=FIM_NULL; if(false) ++fc, printf("%s %d\n",FIM_CNS_CLEARTERM,fc); } fim_getline(&lineptr,FIM_NULL,FIM_NULL,0); // proper free if(fn && fd) fim_fclose(fd); ret: return 0; } void fim_args_from_desc_file(args_t& argsc, const fim_fn_t& dfn, const fim_char_t sc) { /* dfn: descriptions file name */ /* sc: separator char */ std::ifstream mfs (dfn.c_str(),std::ios::app); std::string ln; while( std::getline(mfs,ln)) { std::stringstream ls(ln); std::string fn; fim_fn_t ds; if( ls.peek() == FIM_SYM_PIC_CMT_CHAR ) ; else if(std::getline(ls,fn,sc)) argsc.push_back(fn); } } public: int main(int argc,char *argv[]) { fim_perr_t retcode=FIM_PERR_NO_ERROR; /* * an adapted version of the main function * of the original version of the fbi program */ int opt_index = 0; int i; int want_random_shuffle=0; int want_reverse_list=0; #ifdef FIM_READ_STDIN enum rsc { Nothing = 0, ImageFile = 1, FilesList = 2, Script = 3/*, Desc = 4*/ }; int read_stdin_choice = Nothing; int perform_sanity_check=0; #endif /* FIM_READ_STDIN */ int c; int ndd=0;/* on some systems, we get 'int dup(int)', declared with attribute warn_unused_result */ bool appendedPostInitCommand=false; bool appendedPreConfigCommand=false; #if FIM_WANT_NOEXTPROPIPE bool np=false; #endif /* FIM_WANT_NOEXTPROPIPE */ char sac = FIM_SYM_CHAR_ENDL; #if FIM_WANT_R_SWITCH const char * rs=FIM_NULL; #endif /* FIM_WANT_R_SWITCH */ fim_flags_t pf = FIM_FLAG_DEFAULT; /* push flags */ #if FIM_WANT_PIC_LISTUNMARK args_t argsc; #endif /* FIM_WANT_PIC_LISTUNMARK */ #if ( FIM_WANT_PIC_CMTS || FIM_WANT_PIC_LISTUNMARK ) /* TODO: shall merge the above in a FIM_WANT_PIC_DSCFILEREAD */ #endif /* FIM_WANT_PIC_CMTS */ int load_verbosity=0; int font_verbosity=0; int internal_verbosity=0; g_fim_output_device=FIM_CNS_EMPTY_STRING; setlocale(LC_ALL,""); //uhm.. { int foi; for(foi=0;foi=0 && isdigit(*optarg)) { std::ostringstream tmp; fim_int read_offset_u=0; if(strchr(optarg,':')) read_offset_u=fim_util_atoi_km2(strchr(optarg,':')+1)-read_offset_l; if(strchr(optarg,'+')) read_offset_u=fim_util_atoi_km2(strchr(optarg,'+')+1); tmp << FIM_VID_OPEN_OFFSET_L << "=" << read_offset_l << ";"; tmp << FIM_VID_OPEN_OFFSET_U << "=" << read_offset_u << ";"; cc.pre_autocmd_add(tmp.str()); } } #endif /* FIM_AUTOCMDS */ break; case 0x70726561: //fim's #ifdef FIM_TRY_CONVERT cc.setVariable(FIM_VID_PREAD,optarg); #else /* FIM_TRY_CONVERT */ std::cerr<< "warning: the use of the convert utility has been disabled at configure time\n"; #endif /* FIM_TRY_CONVERT */ break; case 'g': //fbi's default_fbgamma = fim_atof(optarg); break; case 'r': #if FIM_WANT_R_SWITCH rs=optarg; #else /* FIM_WANT_R_SWITCH */ //fbi's: //pcd_res = atoi(optarg); cout << FIM_EMSG_UNFINISHED; //fim's (different): #endif /* FIM_WANT_R_SWITCH */ break; case 'R': //fim's pf |= FIM_FLAG_PUSH_REC ; #if FIM_WANT_RECURSE_FILTER_OPTION if(optarg) { fim::string npre; if(*optarg && ( *optarg=='+' || *optarg=='|' ) && optarg[1] ) npre=fim::string( FIM_CNS_PUSHDIR_RE "|" ), optarg++; npre+=optarg; cc.setVariable(FIM_VID_PUSHDIR_RE,Var(npre)); } #endif /* FIM_WANT_RECURSE_FILTER_OPTION */ break; #if FIM_WANT_NOEXTPROPIPE case 'X': //fim's if(np == false) { np = true; #ifdef FIM_AUTOCMDS cc.pre_autocmd_add(FIM_VID_NO_EXTERNAL_LOADERS"=1;"); #endif /* FIM_AUTOCMDS */ } break; #endif /* FIM_WANT_NOEXTPROPIPE */ case 'B': //fim's pf |= FIM_FLAG_PUSH_REC ; #if FIM_WANT_BACKGROUND_LOAD pf |= FIM_FLAG_PUSH_ONE ; #else /* FIM_WANT_BACKGROUND_LOAD */ std::cerr<< "warning: background loading is not supported (need to compile with C++11 enabled for this).\n"; #endif /* FIM_WANT_BACKGROUND_LOAD */ break; case 's': if(fim_atoi(optarg)>0) { fim::string s=FIM_VID_STEPS"="; s+=optarg; s+=";"; #ifdef FIM_AUTOCMDS cc.pre_autocmd_add(s); #endif /* FIM_AUTOCMDS */ } break; // case 't': //fbi's // timeout = atoi(optarg); // FIM_FPRINTF(stderr, "sorry, this feature will be implemented soon\n"); // break; case 'u': want_random_shuffle=1; break; case 0x7073: //FIM_FPRINTF(stderr, "sorry, this feature will be implemented soon\n"); //fim's want_random_shuffle=-1; break; case 0x73696273: //fim's #if FIM_WANT_SORT_BY_STAT_INFO want_random_shuffle=c; #else /* FIM_WANT_SORT_BY_STAT_INFO */ std::cerr<< "warning: --" FIM_OSW_SORT_FSIZE " option unsupported (stat() missing).\n"; #endif /* FIM_WANT_SORT_BY_STAT_INFO */ break; case 0x7369626d: //fim's #if FIM_WANT_SORT_BY_STAT_INFO want_random_shuffle=c; #else /* FIM_WANT_SORT_BY_STAT_INFO */ std::cerr<< "warning: --" FIM_OSW_SORT_MTIME " option unsupported (stat() missing).\n"; #endif /* FIM_WANT_SORT_BY_STAT_INFO */ break; case 0x736f626e: //fim's want_random_shuffle=c; break; case 0x736f7274: //fim's want_random_shuffle=c; break; case 0x7772666c: //fim's want_reverse_list=1; break; case 'd': //fbi's default_fbdev = optarg; break; case 'i': //fim's #ifdef FIM_READ_STDIN_IMAGE FIM_SROC(read_stdin_choice,ImageFile) #else /* FIM_READ_STDIN_IMAGE */ FIM_FPRINTF(stderr, FIM_EMSG_NO_READ_STDIN_IMAGE); #endif /* FIM_READ_STDIN_IMAGE */ break; case 'm': //fbi's default_fbmode = optarg; break; //removed, editing features : /* case 'f': // fontname = optarg; break; case 'e': // editable = 1; break; case 'b': // backup = 1; break; case 'p': // preserve = 1; break;*/ // case 'l': //fbi's // flist_add_list(optarg); // FIM_FPRINTF(stderr, "sorry, this feature will be implemented soon\n"); // break; case 'T': //fbi's virtual terminal default_vt = atoi(optarg); break; case 'V': //fbi's option, but unlike fbi using stdout instead of stderr show_version(stdout); return 0; break; case 0x4352: //fim's cc.appendPostInitCommand( "if(" FIM_VID_FILELISTLEN "==1){_ffn=i:" FIM_VID_FILENAME ";" FIM_FLT_CD " i:" FIM_VID_FILENAME ";" FIM_FLT_LIST " 'remove' i:" FIM_VID_FILENAME ";" FIM_FLT_BASENAME " _ffn; _bfn='./'." FIM_VID_LAST_CMD_OUTPUT ";" FIM_FLT_LIST " 'pushdir' '.';" FIM_FLT_LIST " 'sort';" FIM_FLT_GOTO " '?'._bfn;" FIM_FLT_RELOAD ";" FIM_FLT_REDISPLAY ";}if(" FIM_VID_FILELISTLEN "==0){" FIM_FLT_STDOUT " 'No files loaded: exiting.';" FIM_FLT_QUIT " 0;}"); appendedPostInitCommand=true; break; case 'c': //fim's cc.appendPostInitCommand(std::string(optarg)); appendedPostInitCommand=true; break; case 'C': //fim's if (cc.regexp_match(optarg,"^=[_0-9A-Za-z]+=.+",true)) { const fim::string oa(optarg+1); const int ei = oa.find('='); const fim::string vi(oa.substr(0,ei)); const fim::string vv(oa.substr(ei+1)); cc.setVariable(vi,vv); } else { cc.appendPreConfigCommand(optarg); appendedPreConfigCommand=true; } break; case 'W': //fim's cc.setVariable(FIM_VID_SCRIPTOUT_FILE,optarg); #ifdef FIM_AUTOCMDS cc.pre_autocmd_add(FIM_FLT_RECORDING" 'start';"); cc.appendPostExecutionCommand(FIM_FLT_RECORDING" 'stop';"); #endif /* FIM_AUTOCMDS */ break; case 'F': //fim's cc.appendPostExecutionCommand(optarg); break; case 'E': //fim's #ifndef FIM_WANT_NOSCRIPTING cc.push_scriptfile(optarg); #else /* FIM_WANT_NOSCRIPTING */ cout << FIM_EMSG_NO_SCRIPTING; #endif /* FIM_WANT_NOSCRIPTING */ break; case 'p': //fim's (differing semantics from fbi's) #ifndef FIM_WANT_NOSCRIPTING FIM_SROC(read_stdin_choice,Script) #else /* FIM_WANT_NOSCRIPTING */ cout << FIM_EMSG_NO_SCRIPTING; #endif /* FIM_WANT_NOSCRIPTING */ break; case 0x64646672: //fim's // cc.setNoFrameBuffer(); // no framebuffer (debug) mode cc.dumpDefaultFimrc(); std::exit(0); break; case 'N': //fim's cc.setVariable(FIM_VID_NO_RC_FILE,1); break; case 0x4E4E4E:// NNN //fim's cc.setVariable(FIM_VID_NO_DEFAULT_CONFIGURATION,1); break; case 0x4E4E:// NN //fim's cc.setVariable(FIM_VID_LOAD_DEFAULT_ETC_FIMRC,0); break; case 0x4E434C:// NCL //fim's cc.setVariable(FIM_VID_CONSOLE_KEY,-1); break; #if FIM_WANT_HISTORY case 0x4E484C:// NHL //fim's cc.setVariable(FIM_VID_LOAD_FIM_HISTORY,-1); break; case 0x4E4853:// NHS //fim's cc.setVariable(FIM_VID_SAVE_FIM_HISTORY,-1); break; case 0x4E48:// NH //fim's cc.setVariable(FIM_VID_SAVE_FIM_HISTORY,-1); cc.setVariable(FIM_VID_LOAD_FIM_HISTORY,-1); break; #endif /* FIM_WANT_HISTORY */ case 't': //fim's #ifdef FIM_USE_ASCII_ART_DEFAULT g_fim_output_device=FIM_USE_ASCII_ART_DEFAULT; #else /* FIM_USE_ASCII_ART_DEFAULT */ std::cerr << "you should recompile fim with aalib or libcaca support!\n"; g_fim_output_device=FIM_DDN_INN_DUMB; #endif /* FIM_USE_ASCII_ART_DEFAULT */ break; case 'o': //fim's #ifdef FIM_WITH_LIBCACA if(optarg && optarg == strstr(optarg,"caca")) { std::cerr << "ehm, it's 'ca', not 'caca', but fine for now.\n"; optarg += 2; } #endif /* FIM_WITH_LIBCACA */ g_fim_output_device=optarg; #if FIM_WANT_OUTPUT_DEVICE_STRING_CASE_INSENSITIVE { int si=g_fim_output_device.find(FIM_SYM_DEVOPTS_SEP_STR); if(si>0);else si=g_fim_output_device.end()-g_fim_output_device.begin(); transform(g_fim_output_device.begin(), si+g_fim_output_device.begin(), g_fim_output_device.begin(),(int (*)(int))tolower); } #endif /* FIM_WANT_OUTPUT_DEVICE_STRING_CASE_INSENSITIVE */ break; case 0x6472690a: //fim's { args_t args; if(optarg) args.push_back(optarg); cc.dump_reference_manual(args); std::exit(0); } break; #if FIM_WANT_PIC_LISTUNMARK case 0x6d666466: fim_args_from_desc_file(argsc,optarg,g_sc); break; #endif /* FIM_WANT_PIC_LISTUNMARK */ #if FIM_WANT_PIC_CMTS case /*0x69646673*/'S': /* FIM_OSW_IMG_DSC_FILE_SEPC */ if(optarg) g_sc = *optarg; break; case /*0x6c696466*/'D': /* FIM_OSW_LOAD_IMG_DSC_FILE */ cc.id_.fetch(optarg,g_sc); #if FIM_WANT_PIC_CMTS_RELOAD cc.browser_.dfl_.push_back({optarg,g_sc}); #endif /* FIM_WANT_PIC_CMTS_RELOAD */ cc.setVariable(FIM_VID_COMMENT_OI,FIM_OSW_LOAD_IMG_DSC_FILE_VID_COMMENT_OI_VAL); break; #endif /* FIM_WANT_PIC_CMTS */ #ifdef FIM_READ_STDIN case '-': //fim's FIM_SROC(read_stdin_choice,FilesList) break; #endif /* FIM_READ_STDIN */ case 0x72667373: sac = *optarg; break; #ifdef FIM_READ_STDIN case 0: //fim's FIM_SROC(read_stdin_choice,FilesList) break; #endif /* FIM_READ_STDIN */ case 'L': fim_load_filelist(optarg,sac,pf); break; case '/': //fim's cc.appendPostInitCommand(string( string(FIM_SYM_FW_SEARCH_KEY_STR) + fim_shell_arg_escape(optarg,false) ).c_str()); appendedPostInitCommand=true; break; case 0x2f2f0000: //fim's cc.appendPostInitCommand( ( string ( FIM_I2BI(FIM_VID_RE_SEARCH_OPTS) "=" FIM_VID_RE_SEARCH_OPTS ";\n" FIM_SYM_CMD_SLSL ";\n" FIM_SYM_FW_SEARCH_KEY_STR) + fim_shell_arg_escape(optarg,false) + string(";\n" FIM_VID_RE_SEARCH_OPTS "=" FIM_I2BI(FIM_VID_RE_SEARCH_OPTS) "\n") ).c_str() ); appendedPostInitCommand=true; break; case 0x68696768: #if FIM_EXPERIMENTAL_SHADOW_DIRS cc.browser_.push_shadow_dir(std::string(optarg)); #else /* FIM_EXPERIMENTAL_SHADOW_DIRS */ std::cerr<< "warning: shadow dir is not supported (need to compile with C++11 enabled for this).\n"; #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ break; #if FIM_WANT_CMDLINE_KEYPRESS case 'K': cc.push_key_press(optarg); break; case 'k': cc.clkcv_.push_back(optarg); break; #endif /* FIM_WANT_CMDLINE_KEYPRESS */ default: retcode=FIM_PERR_NO_SUCH_OPTION; case 'h': #if FIM_WANT_HELP_ARGS if(optind < argc) { for (i = optind; i < argc; i++) std::cout << cc.get_help(argv[i], optarg?*optarg:'l') << std::endl; std::exit(retcode); } #endif /* FIM_WANT_HELP_ARGS */ else { return help_and_exit(argv[0],retcode,optarg); } } } // fim_fms_t dt; // dt = - getmilliseconds(); for (i = optind; i < argc; i++) { #ifdef FIM_READ_STDIN if(*argv[i]=='-'&&!argv[i][1]) read_stdin_choice = FilesList; else #endif /* FIM_READ_STDIN */ { cc.push(argv[i],pf | FIM_FLAG_PUSH_ALLOW_DUPS); } } // dt += getmilliseconds(); // std::cout << fim::string("fetched images list in ") << dt << " ms" << std::endl; #if HAVE_FLEXLEXER_H lexer=new yyFlexLexer; //used by YYLEX if(!lexer) { FIM_FPRINTF(stderr, "error while allocating the lexer!\n\n"); retcode=-1; goto ret; } #endif /* HAVE_FLEXLEXER_H */ #ifdef FIM_READ_STDIN #if FIM_WANT_OBSOLETE if( ( read_stdin_choice == FilesList ) + #ifdef FIM_READ_STDIN_IMAGE ( read_stdin_choice == ImageFile ) + #endif /* FIM_READ_STDIN_IMAGE */ ( read_stdin_choice == Script ) > 1 ) { /* FIXME: this case is now useless. Shall rather implement a warning for when -p and -i overlap. */ FIM_FPRINTF(stderr, "error : you shouldn't specify more than one standard input reading options among (-, -p" #ifdef FIM_READ_STDIN_IMAGE ", -i" #endif /* FIM_READ_STDIN_IMAGE */ ")!\n\n"); retcode=help_and_exit(argv[0],FIM_PERR_NO_ERROR,"b");/* should return 0 or -1 ? */ goto ret; } #endif /* FIM_WANT_OBSOLETE */ /* * this is Vim's solution for stdin reading * */ if( read_stdin_choice == FilesList ) { fim_load_filelist(FIM_NULL,sac,pf); close(0); ndd=dup(2); } #ifdef FIM_READ_STDIN_IMAGE else if( read_stdin_choice == ImageFile ) { #if !FIM_WANT_STDIN_FILELOAD_AFTER_CONFIG cc.fpush(fim_fread_tmpfile(stdin)); close(0); ndd=dup(2); #endif /* FIM_WANT_STDIN_FILELOAD_AFTER_CONFIG */ } #endif /* FIM_READ_STDIN_IMAGE */ else if( read_stdin_choice == Script ) { if( fim_char_t *buf = slurp_binary_fd(0,FIM_NULL) ) cc.appendPostInitCommand(buf), appendedPostInitCommand=true, // appendedPreConfigCommand=true, fim_free(buf); close(0); ndd=dup(2); } #endif #if FIM_WANT_PIC_LISTUNMARK cc.browser_.mark_from_list(argsc); #endif /* FIM_WANT_PIC_LISTUNMARK */ #ifdef FIM_CHECK_DUPLICATES if(want_random_shuffle!= 0) { // if any sorting method is requested, we use chance to sort and remove duplicates cc.browser_._sort(); cc.browser_._unique(); if( want_random_shuffle==0x736f7274 ) want_random_shuffle=0; // no need to perform this twice } #endif /* FIM_CHECK_DUPLICATES */ if(want_random_shuffle== 1) cc.browser_._random_shuffle(true); if(want_random_shuffle==-1) cc.browser_._random_shuffle(false); if(want_random_shuffle==0x736f7274) cc.browser_._sort(); if(want_random_shuffle==0x736f626e) cc.browser_._sort(FIM_SYM_SORT_BN); #if FIM_WANT_SORT_BY_STAT_INFO if(want_random_shuffle==0x7369626d) cc.browser_._sort(FIM_SYM_SORT_MD); if(want_random_shuffle==0x73696273) cc.browser_._sort(FIM_SYM_SORT_SZ); #endif /* FIM_WANT_SORT_BY_STAT_INFO */ if(want_reverse_list==1) cc.browser_._reverse(); if(ndd==-1) fim_perror(FIM_NULL); if(cc.browser_.empty_file_list() #ifndef FIM_WANT_NOSCRIPTING && !cc.with_scriptfile() #endif /* FIM_WANT_NOSCRIPTING */ && !appendedPostInitCommand && !appendedPreConfigCommand #ifdef FIM_READ_STDIN_IMAGE && ( read_stdin_choice != ImageFile ) #endif /* FIM_READ_STDIN_IMAGE */ && !perform_sanity_check ) { retcode=help_and_exit(argv[0],FIM_PERR_BAD_PARAMS,"b");goto ret; } /* output device guess */ if( g_fim_output_device==FIM_CNS_EMPTY_STRING ) { if( fim_getenv(FIM_ENV_SSH) && *fim_getenv(FIM_ENV_SSH) ) /* is this a ssh session ? */ { #ifdef FIM_WITH_AALIB g_fim_output_device=FIM_DDN_INN_AA; #endif /* FIM_WITH_AALIB */ #ifdef FIM_WITH_LIBCACA g_fim_output_device=FIM_DDN_INN_CACA; #endif /* FIM_WITH_LIBCACA */ } else #if defined(FIM_WITH_LIBSDL) || defined(FIM_WITH_LIBIMLIB2) /* check to see if we are under X */ if( fim_getenv(FIM_ENV_DISPLAY) && *fim_getenv(FIM_ENV_DISPLAY) ) { #ifdef FIM_WITH_LIBIMLIB2 g_fim_output_device=FIM_DDN_INN_IL2; #endif /* FIM_WITH_LIBIMLIB2 */ #ifdef FIM_WITH_LIBSDL g_fim_output_device=FIM_DDN_INN_SDL; #endif /* FIM_WITH_LIBSDL */ } else #endif #ifndef FIM_WITH_NO_FRAMEBUFFER g_fim_output_device=FIM_DDN_INN_FB; #else /* FIM_WITH_NO_FRAMEBUFFER */ #ifdef FIM_WITH_AALIB g_fim_output_device=FIM_DDN_INN_AA; #else /* FIM_WITH_AALIB */ #ifdef FIM_WITH_LIBCACA g_fim_output_device=FIM_DDN_INN_CACA; #else /* FIM_WITH_LIBCACA */ g_fim_output_device=FIM_DDN_INN_DUMB ; #endif /* FIM_WITH_LIBCACA */ #endif /* FIM_WITH_AALIB */ #endif //#ifndef FIM_WITH_NO_FRAMEBUFFER } // TODO : need better output device probing mechanism #if FIM_WANT_R_SWITCH if(rs) if(g_fim_output_device.find(FIM_DDN_INN_SDL)==0) { if(g_fim_output_device.find('=')==std::string::npos) g_fim_output_device+="="; if(fim::string("fullscreen")==rs) g_fim_output_device+='W'; // fullscreen else g_fim_output_device+=rs; } #endif /* FIM_WANT_R_SWITCH */ if((retcode=FIM_ERR_TO_PERR(cc.init(g_fim_output_device)))!=FIM_PERR_NO_ERROR) {goto ret;} #ifdef FIM_READ_STDIN_IMAGE #if FIM_WANT_STDIN_FILELOAD_AFTER_CONFIG if( read_stdin_choice == ImageFile ) { cc.fpush(fim_fread_tmpfile(stdin)); close(0); //fclose(stdin); ndd=dup(2); } #endif /* FIM_WANT_STDIN_FILELOAD_AFTER_CONFIG */ #endif /* FIM_READ_STDIN_IMAGE */ retcode=cc.executionCycle();/* note that this could not return */ ret: return retcode; } }; fim_perr_t main(int argc,char *argv[]) { /* * FimInstance will encapsulate all of the fim's code someday. * ...someday. * */ FimInstance fiminstance; fim::fim_var_help_db_init(); return fiminstance.main(argc,argv); } /* * The function FimInstance::show_version declared here needs the following inclusions. * Would be cleaner to move the rest of the file to a separate file. * */ #ifdef FIM_WITH_LIBPNG #include #endif /* FIM_WITH_LIBPNG */ #ifdef HAVE_LIBJPEG #include #endif /* HAVE_LIBJPEG */ #ifdef FIM_HANDLE_TIFF #include #endif /* FIM_HANDLE_TIFF */ #ifdef FIM_HANDLE_GIF #include #endif /* FIM_HANDLE_GIF */ #ifdef FIM_USE_READLINE #include "readline.h" #endif /* FIM_USE_READLINE */ #if 0 /* namespace clashes */ #ifdef HAVE_LIBGRAPHICSMAGICK #include #include #endif /* HAVE_LIBGRAPHICSMAGICK */ #endif #ifdef HAVE_LIBSPECTRE extern "C" { #include } #endif /* HAVE_LIBSPECTRE */ ///#ifdef HAVE_LIBPOPPLER //#include // getPDFMajorVersion getPDFMinorVersion //#endif /* HAVE_LIBPOPPLER */ void FimInstance::show_version(FILE * stream) { FIM_FPRINTF(stream, FIM_CNS_FIM" " #ifdef FIM_VERSION FIM_VERSION #endif /* FIM_VERSION */ #ifdef SVN_REVISION " ( repository version " SVN_REVISION " )" #else /* SVN_REVISION */ /* obsolete */ # define FIM_REPOSITORY_VERSION "$LastChangedDate: 2023-04-15 00:54:24 +0200 (Sat, 15 Apr 2023) $" # ifdef FIM_REPOSITORY_VERSION " ( repository version " FIM_REPOSITORY_VERSION " )" # endif /* FIM_REPOSITORY_VERSION */ #endif /* SVN_REVISION */ #ifdef FIM_AUTHOR ", by " FIM_AUTHOR #endif /* FIM_AUTHOR */ #define FIM_WANT_REPRODUCIBLE_BUILDS 1 #if !FIM_WANT_REPRODUCIBLE_BUILDS ", built on %s\n", __DATE__ #endif " ( based on fbi version 1.31 (c) by 1999-2004 " FBI_AUTHOR_NAME " )\n" #ifdef __cplusplus "Compiled with C++ standard: " FIM_XSTRINGIFY(__cplusplus) "\n" #else /* __cplusplus */ "" #endif /* __cplusplus */ #ifdef FIM_WITH_LIBPNG #ifdef PNG_HEADER_VERSION_STRING "Compiled with " PNG_HEADER_VERSION_STRING "" #endif /* PNG_HEADER_VERSION_STRING */ #endif /* FIM_WITH_LIBPNG */ #ifdef FIM_HANDLE_GIF #if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && defined(GIFLIB_RELEASE) "Compiled with libgif, " FIM_XSTRINGIFY(GIFLIB_MAJOR) "." FIM_XSTRINGIFY(GIFLIB_MINOR) "." FIM_XSTRINGIFY(GIFLIB_RELEASE) ".\n" #else /* GIFLIB_MAJOR GIFLIB_MINOR GIFLIB_RELEASE */ #ifdef GIF_LIB_VERSION "Compiled with libgif, " GIF_LIB_VERSION ".\n" #endif /* GIF_LIB_VERSION */ #endif /* GIFLIB_MAJOR GIFLIB_MINOR GIFLIB_RELEASE */ #endif /* FIM_HANDLE_GIF */ #ifdef HAVE_LIBJPEG #ifdef JPEG_LIB_VERSION "Compiled with libjpeg, v." FIM_XSTRINGIFY(JPEG_LIB_VERSION) ".\n" #endif /* JPEG_LIB_VERSION */ #endif /* HAVE_LIBJPEG */ #ifdef HAVE_LIBSPECTRE #ifdef SPECTRE_VERSION_STRING "Compiled with libspectre, v." SPECTRE_VERSION_STRING ".\n" #endif /* SPECTRE_VERSION_STRING */ #endif /* HAVE_LIBSPECTRE */ #if 0 /* namespace clashes */ #ifdef HAVE_LIBGRAPHICSMAGICK #ifdef MagickLibVersionText "Compiled with GraphicsMagick, v."MagickLibVersionText".\n" #endif /* MagickLibVersionText */ #endif /* HAVE_LIBGRAPHICSMAGICK */ #endif #ifdef FIM_USE_READLINE // TODO: shall use RL_READLINE_VERSION instead #if defined(RL_VERSION_MINOR) && defined(RL_VERSION_MAJOR) && ((RL_VERSION_MAJOR)>=6) "Compiled with readline, v." FIM_XSTRINGIFY(RL_VERSION_MAJOR) "." FIM_XSTRINGIFY(RL_VERSION_MINOR) ".\n" #else "Compiled with readline, version unknown.\n" #endif /* defined(RL_VERSION_MINOR) && defined(RL_VERSION_MAJOR) && ((RL_VERSION_MAJOR)>=6) */ #endif /* FIM_USE_READLINE */ // for TIFF need TIFFGetVersion #ifdef FIM_CONFIGURATION "Configuration invocation: " FIM_CONFIGURATION "\n" #endif /* FIM_CONFIGURATION */ #if FIM_WITH_DEBUG #ifdef CXXFLAGS "Compile flags: CXXFLAGS=" CXXFLAGS #ifdef CFLAGS " CFLAGS=" CFLAGS #endif /* CFLAGS */ "\n" #endif /* CXXFLAGS */ #endif /* FIM_WITH_DEBUG */ "Fim options (features included (+) or not (-)):\n" #include "version.h" /* i think some flags are missing .. */ "\nSupported output devices (for --" FIM_OSW_OUTPUT_DEVICE "): " #ifdef FIM_WITH_AALIB " " FIM_DDN_INN_AA #endif /* FIM_WITH_AALIB */ #ifdef FIM_WITH_LIBCACA " " FIM_DDN_INN_CACA #endif /* FIM_WITH_LIBCACA */ #ifdef FIM_WITH_LIBIMLIB2 " " FIM_DDN_INN_IL2 #endif /* FIM_WITH_LIBIMLIB2 */ #ifdef FIM_WITH_LIBSDL " " FIM_DDN_INN_SDL #endif /* FIM_WITH_LIBSDL */ #ifndef FIM_WITH_NO_FRAMEBUFFER " " FIM_DDN_INN_FB #endif //#ifndef FIM_WITH_NO_FRAMEBUFFER #if 1 " " FIM_DDN_INN_DUMB #endif "\n" "\nSupported file formats: " #ifdef ENABLE_PDF " pdf" #endif /* ENABLE_PDF */ #ifdef HAVE_LIBSPECTRE " ps" #endif /* HAVE_LIBSPECTRE */ #ifdef HAVE_LIBDJVU " djvu" #endif /* HAVE_LIBDJVU */ #ifdef HAVE_LIBJPEG " jpeg" #endif /* HAVE_LIBJPEG */ #ifdef FIM_HANDLE_TIFF " tiff" #endif /* FIM_HANDLE_TIFF */ #ifdef FIM_HANDLE_GIF " gif" #endif /* FIM_HANDLE_GIF */ #ifdef FIM_WITH_LIBPNG " png" #endif /* FIM_WITH_LIBPNG */ " ppm" /* no library is needed for these */ " bmp" #ifdef HAVE_MATRIX_MARKET_DECODER " mtx (Matrix Market)" #endif /* HAVE_MATRIX_MARKET_DECODER */ "\n" ); fim_loaders_to_stderr(stream); } /* FimInstance::show_version */ /* Please do not write any more code after THIS declaration */ fim-0.6-rc2/src/fim_types.h0000644000175000017500000000770614454347340012520 00000000000000/* $LastChangedDate: 2022-10-03 12:16:35 +0200 (Mon, 03 Oct 2022) $ */ /* fim_types.h : Basic Fim type declarations (c) 2011-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_TYPES_FIM_H #define FIM_TYPES_FIM_H #if defined(__GNUC__) #define FIM_RSTRCT __restrict__ #else /* defined(__GNUC__) */ #define FIM_RSTRCT #endif /* defined(__GNUC__) */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif /* HAVE_CONFIG_H */ #if FIM_WANT_LONG_INT #include #endif /* FIM_WANT_LONG_INT */ #if FIM_WANT_LONG_INT typedef int64_t fim_int; /* a type for fim's internal integer type, always signed */ #define FIM_LARGE_FIM_INT 1 /* == (sizeof(fim_int)!=sizeof(int)) */ #else /* FIM_WANT_LONG_INT */ typedef int fim_int; /* a type for fim's internal integer type, always signed */ #define FIM_LARGE_FIM_INT 0 /* == (sizeof(fim_int)!=sizeof(int)) */ #endif /* FIM_WANT_LONG_INT */ typedef unsigned int fim_uint; /* unsigned int */ typedef int fim_pan_t; /* a type for pixel offsets (neg/pos) */ typedef int fim_off_t; /* a type for pixel offsets (positive) */ typedef float fim_scale_t; /* a type for image scaling */ typedef float fim_angle_t; /* a type for angles */ typedef float fim_float_t; /* a type for floats */ typedef fim_int fim_page_t; /* a type for multipage document pages */ typedef int fim_pgor_t; /* a type for page orientation */ typedef bool fim_bool_t; /* a type for bolean expressions */ typedef int fim_coo_t; /* a type for coordinates */ typedef int fim_cc_t; /* a type for console control */ typedef int fim_flags_t; /* a type for display flags */ typedef int fim_bpp_t; /* a type for bits Per Pixel */ typedef int fim_key_t; /* a type for keycodes */ typedef int fim_err_t; /* a type for errors */ typedef int fim_perr_t; /* a type for program errors */ typedef int fim_status_t; /* a type for fim's status */ typedef int fim_cycles_t; /* a type for fim's cycles */ typedef int fim_cmd_type_t; /* a type for fim's command types */ typedef int fim_var_t; /* a type for fim's variable types */ typedef int fim_str_t; /* a type for stdin/stdout streams */ typedef int fim_sys_int; /* always int */ typedef unsigned int fim_color_t; /* >= 4 bytes */ typedef int fim_ts_t; /* a type for time, in seconds */ typedef int fim_tms_t; /* a type for time, in milliseconds */ typedef double fim_fms_t; /* a type for time, in milliseconds, floating point */ typedef unsigned long fim_tus_t; /* a type for time, in microseconds */ typedef char fim_char_t; /* a type for chars */ typedef unsigned char fim_byte_t; /* a type for bytes */ typedef size_t fim_size_t; /* always size_t */ typedef size_t fim_pxc_t; /* pixel count */ enum fim_redraw_t { FIM_REDRAW_UNNECESSARY=0, FIM_REDRAW_NECESSARY=1}; #if FIM_USE_CXX11 // TODO: move using aliases here ... #else /* FIM_USE_CXX11 */ // TODO: move typedefs here ... #endif /* FIM_USE_CXX11 */ // TODO: same also in CommandConsole.h /* we wait for variadic macros support in standard C++ */ #define FIM_FPRINTF fprintf #if FIM_USE_CXX11 #define FIM_NULL nullptr #define FIM_ENUM_BASE : fim_flags_t /* In the future might want to add the class attribute to make the enums scoped. */ #else /* FIM_USE_CXX11 */ #define FIM_NULL NULL #define FIM_ENUM_BASE #endif /* FIM_USE_CXX11 */ #endif /* FIM_TYPES_FIM_H */ fim-0.6-rc2/src/Imlib2Device.cpp0000644000175000017500000004366714454347340013320 00000000000000/* $LastChangedDate: 2023-03-26 15:47:40 +0200 (Sun, 26 Mar 2023) $ */ /* Imlib2.cpp : Imlib2 device Fim driver file (c) 2011-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * NOTES : The Imlib2 support here is INCOMPLETE * This code is horrible, inefficient, and error handling is MISSING. * Flip/mirror display is missing. * Fullscreen display is missing. * Mouse handling is missing. * We use so little of imlib2 here that it would be better to use X only. */ #include "fim.h" #ifdef FIM_WITH_LIBIMLIB2 #include "Imlib2Device.h" #include #include #define FIM_IL2_PRINTF printf #define FIM_IMLIB2_X_INPUT_MASK NoEventMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask | KeyReleaseMask #define FIM_IMLIB2_X_WINDOW_MASK NoEventMask | StructureNotifyMask #define FIM_IMLIB2_X_MASK FIM_IMLIB2_X_INPUT_MASK | ExposureMask | FIM_IMLIB2_X_WINDOW_MASK namespace fim { extern CommandConsole cc; } // FIXME: these shall become Imlib2Device members! static Display *disp=FIM_NULL; static Visual *vis=FIM_NULL; static int depth; static bool initialized=false; static Colormap cm; static Window win; #ifndef FIM_WANT_NO_OUTPUT_CONSOLE Imlib2Device::Imlib2Device(MiniConsole& mc_, fim::string opts):DisplayDevice(mc_), #else /* FIM_WANT_NO_OUTPUT_CONSOLE */ Imlib2Device::Imlib2Device( fim::string opts ):DisplayDevice(), #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ current_w_(FIM_DEFAULT_WINDOW_HEIGHT), current_h_(FIM_DEFAULT_WINDOW_WIDTH) ,want_windowed_(false) { FontServer::fb_text_init1(fontname_,&f_); // FIXME : move this outta here const fim_char_t*const os=opts.c_str(); parse_optstring(os); } fim_bpp_t Imlib2Device::get_bpp(void)const{return depth; } fim_err_t Imlib2Device::parse_optstring(const fim_char_t *os) { bool want_windowed=want_windowed_; bool want_mouse_display=want_mouse_display_; bool want_resize=want_resize_; fim_coo_t current_w=current_w_; fim_coo_t current_h=current_h_; if(os) { while(*os&&!isdigit(*os)) { bool tv=true; if(isupper(*os)) tv=false; switch(tolower(*os)){ case 'w': want_windowed=tv; break; //case 'm': want_mouse_display=tv; break; //case 'r': want_resize=tv; break; default: std::cerr<<"unrecognized specifier character \""<<*os<<"\"\n";goto err; } ++os; } if(*os) { if(2==sscanf(os,"%d:%d",¤t_w,¤t_h)) { // std::cout << w << " : "<< h<<"\n"; current_w=FIM_MAX(current_w,0); current_h=FIM_MAX(current_h,0); if(!allowed_resolution(current_w,current_h)) goto err; } else { current_w=current_h=0; std::cerr << "user specification of resolution (\""<irows ) return -2-3*100 ; if( icoff>icols ) return -3-5*100; // if( oroff>orows ) return -7-9*100;//EXP // if( ocoff>ocols ) return -8-10*100;//EXP if( oroff>height() ) return -7-9*100;//EXP if( ocoff>width()) return -8-10*100;//EXP if( icskip height() ) return -9 -99*100; if( ocols > width() ) return -10-99*100; if( ocskip < width() ) return -11-99*100; if( icskipdata:FIM_NULL;// source rgb array if(initialized==false) goto ret; clear_rect( 0, width()-1, 0, height()-1); if(!img) goto ret; if(!rgb) goto ret; ild=imlib_image_get_data(); for(oi=oroff;FIM_LIKELY(oiheight; } fim_coo_t Imlib2Device::get_chars_per_line(void)const { return width() / f_->width; } fim_coo_t Imlib2Device::width(void)const { return current_w_; } fim_coo_t Imlib2Device::height(void)const { return current_h_; } fim_sys_int Imlib2Device::get_input(fim_key_t * c, bool want_poll) { return get_input_i2l(c); } fim_sys_int Imlib2Device::get_input_i2l(fim_key_t * c) { int rc=-1; fim_key_t pk=0; updates_ = imlib_updates_init(); // if(True==XCheckMaskEvent(disp,FIM_IMLIB2_X_INPUT_MASK /*KeyPressMask,&ev_)) // if(True==XCheckMaskEvent(disp,FIM_IMLIB2_X_INPUT_MASK,&ev_)) if(True==XCheckMaskEvent(disp,KeyPressMask,&ev_)) { switch (ev_.type) { case ConfigureNotify: case ConfigureRequest: case ResizeRequest: case ResizeRedirectMask: case StructureNotifyMask: break; case KeyPress: { char buf[FIM_ATOX_BUFSIZE]; int nc=0; KeySym ks; buf[nc]=FIM_SYM_CHAR_NUL; nc=XLookupString(&ev_.xkey,buf,sizeof(buf),&ks,FIM_NULL); buf[nc]=FIM_SYM_CHAR_NUL; //FIM_IL2_PRINTF("PKEY :%d:%s:%d\n",ev_.xkey.keycode,buf,ks); if( *buf) rc=1; else break; if(nc==1) pk=*buf; else pk=ks; //if(ev_.xkey.keycode==23)pk='\t';/* FIXME */ //FIM_IL2_PRINTF("PRESSED :%d %c\n",pk,pk); ks=XLookupKeysym(&ev_.xkey,0); if(ks!=NoSymbol) ;//FIM_IL2_PRINTF("SYM :%d %c\n",ks,ks); else rc=0; } break; case KeyRelease: //FIM_IL2_PRINTF("KEY RELEASE:%d %c\n",0,0); break; case Expose: updates_=imlib_update_append_rect(updates_,ev_.xexpose.x,ev_.xexpose.y,ev_.xexpose.width,ev_.xexpose.height); break; case ButtonPress: //FIM_IL2_PRINTF("MOUSE PRESSED :%d %d\n",ev_.xbutton.x,ev_.xbutton.y); break; case MotionNotify: // FIM_IL2_PRINTF("MOTION NOTIFY:%d %c\n",0,0); break; default: break; } } updates_=imlib_updates_merge_for_rendering(updates_,current_w_,current_h_); for (current_update_=updates_; current_update_; current_update_ = imlib_updates_get_next(current_update_)) ; // FIXME; shall restructure the drawing functions sequence to use imlib_updates_merge_for_rendering if (updates_) imlib_updates_free(updates_), updates_=FIM_NULL; if(!c) rc=0; else { if(rc==1) *c=pk; } XWindowAttributes attributes; XGetWindowAttributes(disp,win,&attributes); if(current_w_!=attributes.width || current_h_!=attributes.height) { // FIXME: move outta here this check & resize (shall intercept the event first, though) current_w_=attributes.width; current_h_=attributes.height; cc.display_resize(current_w_,current_h_); } return rc; } fim_err_t Imlib2Device::fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t color) { // FIXME: this code may be not portable fim_color_t rmask=0xFF000000,gmask=0x00FF0000,bmask=0x0000FF00,amask=0x000000FF; if(initialized==false) goto ret; imlib_context_set_color((color&rmask)>>24,(color&gmask)>>16,(color&bmask)>>8,(color&amask)); imlib_image_fill_rectangle(x1,y1,x2-x1+1,y2-y1+1); imlib_render_image_on_drawable(0,0); ret: return FIM_ERR_NO_ERROR; } fim_err_t Imlib2Device::clear_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2) { // FIXME: this code may be not portable if(initialized==false) goto ret; imlib_context_set_color(0x0,0x0,0x0,0xFF); imlib_image_fill_rectangle(x1,y1,x2-x1+1,y2-y1+1); imlib_render_image_on_drawable(0,0); ret: return FIM_ERR_NO_ERROR; } void Imlib2Device::fs_render_fb(fim_coo_t x_, fim_coo_t y, FSXCharInfo *charInfo, fim_byte_t *data) { if(initialized==false) goto err; /* * These preprocessor macros should serve *only* for font handling purposes. * */ #define BIT_ORDER BitmapFormatBitOrderMSB #ifdef BYTE_ORDER #undef BYTE_ORDER #endif #define BYTE_ORDER BitmapFormatByteOrderMSB #define SCANLINE_UNIT BitmapFormatScanlineUnit8 #define SCANLINE_PAD BitmapFormatScanlinePad8 #define EXTENTS BitmapFormatImageRectMin #define SCANLINE_PAD_BYTES 1 #define GLWIDTHBYTESPADDED(bits, nBytes) \ ((nBytes) == 1 ? (((bits) + 7) >> 3) /* pad to 1 byte */\ :(nBytes) == 2 ? ((((bits) + 15) >> 3) & ~1) /* pad to 2 bytes */\ :(nBytes) == 4 ? ((((bits) + 31) >> 3) & ~3) /* pad to 4 bytes */\ :(nBytes) == 8 ? ((((bits) + 63) >> 3) & ~7) /* pad to 8 bytes */\ : 0) fim_coo_t row,bit,x; fim_sys_int bpr; DATA32 *ild; ild=imlib_image_get_data(); if(!ild)goto err; bpr = GLWIDTHBYTESPADDED((charInfo->right - charInfo->left), SCANLINE_PAD_BYTES); for (row = 0; row < (charInfo->ascent + charInfo->descent); row++) { for (x = 0, bit = 0; bit < (charInfo->right - charInfo->left); bit++) { if (data[bit>>3] & fs_masktab[bit&7]) { // WARNING ! ild[((y+row)*(current_w_)+(x_+x))]=0xFFFFFFFF; } ++x; } data += bpr; } #undef BIT_ORDER #undef BYTE_ORDER #undef SCANLINE_UNIT #undef SCANLINE_PAD #undef EXTENTS #undef SCANLINE_PAD_BYTES #undef GLWIDTHBYTESPADDED err: return; } fim_err_t Imlib2Device::fs_puts(struct fs_font *f_, fim_coo_t x, fim_coo_t y, const fim_char_t *str) { fim_err_t rc=FIM_ERR_GENERIC; fim_sys_int i,c/*,j,w*/; if(initialized==false) goto ret; for (i = 0; str[i] != '\0'; i++) { c = (fim_byte_t)str[i]; if (FIM_NULL == f_->eindex[c]) continue; fs_render_fb(x,y,f_->eindex[c],f_->gindex[c]); x += f_->eindex[c]->width; /* FIXME : SLOW ! */ if (((fim_coo_t)x) > width() - f_->width) goto derr; /* FIXME: seems like this is often triggered. */ } rc=FIM_ERR_NO_ERROR; derr: imlib_render_image_on_drawable(0,0); ret: return rc; } fim_err_t Imlib2Device::status_line(const fim_char_t *msg) { fim_coo_t y,ys=3;// FIXME if(get_chars_per_column()<1) goto done; y = height() - f_->height - ys; if(y<0 ) goto done; clear_rect(0, width()-1, y+1,y+f_->height+ys-1); fs_puts(f_, 0, y+ys, msg); fill_rect(0,width()-1, y, y, FIM_CNS_WHITE); done: return FIM_ERR_NO_ERROR; } fim_key_t Imlib2Device::catchInteractiveCommand(fim_ts_t seconds)const { // FIXME: missing handling code, here return -1; } void Imlib2Device::flush(void) { } void Imlib2Device::lock(void) { } void Imlib2Device::unlock(void) { } bool Imlib2Device::allowed_resolution(fim_coo_t w, fim_coo_t h) { return true; } fim_err_t Imlib2Device::resize(fim_coo_t w, fim_coo_t h) { if(initialized==true) XResizeWindow(disp,win,w,h), imlib_free_image(); initialized=true; buffer_=imlib_create_image(current_w_,current_h_); imlib_context_set_image(buffer_); return FIM_ERR_NO_ERROR; } fim_err_t Imlib2Device::reinit(const fim_char_t *rs) { if(parse_optstring(rs)!=FIM_ERR_NO_ERROR) goto err; return cc.display_resize(current_w_,current_h_); err: //std::cerr<<"problems!\n"; return FIM_ERR_GENERIC; } fim_err_t Imlib2Device::set_wm_caption(const fim_char_t *msg) { // FIXME: unfinished #if 1 fim_err_t rc=FIM_ERR_UNSUPPORTED; #else fim_err_t rc=FIM_ERR_NO_ERROR; if(!msg) goto err; XStoreName(disp,win,msg); err: #endif return rc; } fim_err_t Imlib2Device::reset_wm_caption(void) { // FIXME: unfinished #if 1 XStoreName(disp,win,""); return FIM_ERR_NO_ERROR; #else return FIM_ERR_UNSUPPORTED; #endif } #endif fim_coo_t Imlib2Device::status_line_height(void)const { return f_ ? border_height_ + f_->height : 0; } fim-0.6-rc2/src/Benchmarkable.h0000644000175000017500000000273414454347340013233 00000000000000/* $LastChangedDate: 2013-11-06 19:33:57 +0100 (Wed, 06 Nov 2013) $ */ /* Benchmarkable.h.h : header file for benchmarkable classes (c) 2011-2013 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_BENCHMARKABLE_H #define FIM_BENCHMARKABLE_H #include "fim.h" #if FIM_WANT_BENCHMARKS class Benchmarkable{ private: fim_int benchmarkstate; public: Benchmarkable(void){benchmarkstate=0;} virtual ~Benchmarkable(void){} virtual fim_int get_n_qbenchmarks(void)const=0; virtual void quickbench(fim_int qbi)=0; virtual string get_bresults_string(fim_int qbi, fim_int qbtimes, fim_fms_t qbttime)const=0; virtual void quickbench_init(fim_int qbi)=0; virtual void quickbench_finalize(fim_int qbi)=0; }; #endif /* FIM_WANT_BENCHMARKS */ #endif /* FIM_BENCHMARKABLE_H */ fim-0.6-rc2/src/FbiStuffPs.cpp0000644000175000017500000001313414454347340013057 00000000000000/* $LastChangedDate: 2022-11-17 18:00:39 +0100 (Thu, 17 Nov 2022) $ */ /* FbiStuffPs.cpp : fim functions for decoding PS files (c) 2008-2022 Michele Martone based on code (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * this code should be fairly correct, although unfinished * */ #include #include #include #include "FbiStuff.h" #include "FbiStuffLoader.h" #ifdef HAVE_LIBSPECTRE extern "C" { // we require C linkage for these symbols #include } /* */ namespace fim { extern CommandConsole cc; /* ---------------------------------------------------------------------- */ /* load */ struct ps_state_t { int row_stride; /* physical row width in output buffer */ fim_byte_t * first_row_dst; int w,h; SpectreDocument * sd; SpectrePage * sp; SpectreRenderContext * src; SpectreStatus ss; }; /* ---------------------------------------------------------------------- */ #define FIM_SPECTRE_DEFAULT_DPI 72 static void* ps_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { const fim_int prdv=cc.getIntVariable(FIM_VID_PREFERRED_RENDERING_DPI); const fim_int prd=prdv<1?FIM_RENDERING_DPI:prdv; const double scale = 1.0* (((double)prd)/((double)FIM_SPECTRE_DEFAULT_DPI)) ; const double rcscale = scale; struct ps_state_t * ds=FIM_NULL; if(std::string(filename)==FIM_STDIN_IMAGE_NAME){std::cerr<<"sorry, stdin multipage file reading is not supported\n";return FIM_NULL;} /* a drivers's problem */ if(fp) fclose(fp); ds = (struct ps_state_t*)fim_calloc(1,sizeof(struct ps_state_t)); if(!ds) return FIM_NULL; ds->first_row_dst = FIM_NULL; ds->sd = FIM_NULL; ds->sp = FIM_NULL; ds->src = FIM_NULL; ds->ss = SPECTRE_STATUS_SUCCESS; ds->sd = spectre_document_new(); if(!ds->sd) goto err; spectre_document_load(ds->sd,filename); ds->ss = spectre_document_status(ds->sd); if(ds->ss != SPECTRE_STATUS_SUCCESS) goto err; ds->src = spectre_render_context_new(); if(!ds->src) goto err; i->dpi = FIM_SPECTRE_DEFAULT_DPI; /* FIXME */ spectre_render_context_set_scale(ds->src,scale,scale); spectre_render_context_set_rotation(ds->src,0); spectre_render_context_set_resolution(ds->src,i->dpi,i->dpi); i->npages = spectre_document_get_n_pages(ds->sd); if(page>=i->npages || page<0)goto err; ds->sp = spectre_document_get_page(ds->sd,page);/* pages, from 0 */ if(!ds->sp) goto err; ds->ss = spectre_page_status(ds->sp); if(ds->ss != SPECTRE_STATUS_SUCCESS) goto err; spectre_page_get_size(ds->sp, (int*)(&i->width), (int*)(&i->height)); // spectre_render_context_get_page_size(ds->src, (int*)(&i->width), (int*)(&i->height)); // spectre_document_get_page_size(ds->sd, (int*)(&i->width), (int*)(&i->height)); i->width *= scale; i->height *= scale; spectre_render_context_set_page_size(ds->src, (int)(i->width), (int)(i->height)); spectre_render_context_set_scale(ds->src,rcscale,rcscale); if(i->width<1 || i->height<1) goto err; ds->w=i->width; ds->h=i->height; return ds; err: if(ds->sd )spectre_document_free(ds->sd); if(ds->sp )spectre_page_free(ds->sp); if(ds->src)spectre_render_context_free(ds->src); if(ds)fim_free(ds); return FIM_NULL; } static void ps_read(fim_byte_t *dst, unsigned int line, void *data) { struct ps_state_t *ds = (struct ps_state_t*)data; if(!ds)return; if(ds->first_row_dst == FIM_NULL) ds->first_row_dst = dst; else return; fim_byte_t *page_data=FIM_NULL; //render in RGB32 format //spectre_page_render(ds->sp,ds->src,&page_data,&ds->row_stride); spectre_page_render_slice(ds->sp,ds->src,0,0,ds->w,ds->h,&page_data,&ds->row_stride); ds->ss = spectre_page_status(ds->sp); if(ds->ss != SPECTRE_STATUS_SUCCESS) return; int i,j; for(i=0;ih;++i) for(j=0;jw;++j) { #if 0 dst[ds->w*i*3+3*j+0]=page_data[ds->row_stride*i+4*j+0]; dst[ds->w*i*3+3*j+1]=page_data[ds->row_stride*i+4*j+1]; dst[ds->w*i*3+3*j+2]=page_data[ds->row_stride*i+4*j+2]; #else dst[ds->w*i*3+3*j+2]=page_data[ds->row_stride*i+4*j+0]; dst[ds->w*i*3+3*j+1]=page_data[ds->row_stride*i+4*j+1]; dst[ds->w*i*3+3*j+0]=page_data[ds->row_stride*i+4*j+2]; #endif } free(page_data); } static void ps_done(void *data) { struct ps_state_t *ds = (struct ps_state_t*)data; if(!ds) return; if(ds->sd )spectre_document_free(ds->sd); if(ds->sp )spectre_page_free(ds->sp); if(ds->src)spectre_render_context_free(ds->src); fim_free(ds); } /* 0000000: 2521 5053 2d41 646f 6265 2d33 2e30 0a25 %!PS-Adobe-3.0.% */ static struct ida_loader ps_loader = { /*magic:*/ "%!PS-",// FI/*XME :*/ are sure this is enough ? /*moff:*/ 0, /*mlen:*/ 5, /*name:*/ "libspectre", /*init:*/ ps_init, /*read:*/ ps_read, /*done:*/ ps_done, }; static void fim__init init_rd(void) { fim_load_register(&ps_loader); } } #endif // ifdef HAVE_LIBSPECTRE fim-0.6-rc2/src/version.h0000644000175000017500000000425214503403524012167 00000000000000"+FIM_ALLOW_LOADER_STRING_SPECIFICATION " "+FIM_AUTHOR " "+FIM_AUTHOR_EMAIL " "+FIM_AUTHOR_NAME " "+FIM_AUTOCMDS " "+FIM_AUTOSKIP_FAILED " "+FIM_BOZ_PATCH " "+FIM_CHECK_DUPLICATES " "+FIM_CHECK_FILE_EXISTENCE " "+FIM_COMMAND_AUTOCOMPLETION " "+FIM_CONFIGURATION " "+FIM_DEFAULT_CONFIG " "+FIM_DEFAULT_CONFIGURATION " "+FIM_DEFAULT_KEY_CONFIG " "+FIM_EXPERIMENTAL_ROTATION " "+FIM_HANDLE_GIF " "+FIM_HANDLE_TIFF " "+FIM_HAS_TIMEOUT " "+FIM_ITERATED_COMMANDS " "+FIM_LINUX_CONSOLEFONTS_DIR_SCAN " "+FIM_NAMESPACES " "+FIM_NOFB " "+FIM_PATHS_IN_MAN " "+FIM_PIPE_IMAGE_READ " "+FIM_RANDOM " "+FIM_READ_DIRS " "+FIM_READ_STDIN " "+FIM_READ_STDIN_IMAGE " "+FIM_RECORDING " "+FIM_RECURSIVE_DIRS " "+FIM_REMOVE_FAILED " "+FIM_SKIP_KNOWN_FILETYPES " "+FIM_SMART_COMPLETION " "+FIM_SWITCH_FIXUP " "+FIM_TMP_FILENAME " "+FIM_TRY_CONVERT " "+FIM_TRY_DIA " "+FIM_TRY_INKSCAPE " "+FIM_TRY_XFIG " "+FIM_USE_READLINE " "+FIM_USE_ZCAT " "+FIM_VERSION " "+FIM_WANT_CUSTOM_INFO_STATUS_BAR " "+FIM_WANT_FILENAME_MARK_AND_DUMP " "+FIM_WANT_FONT_MAGNIFY_FACTOR " "+FIM_WANT_HARDCODED_FONT " "+FIM_WANT_LONG_INT " "+FIM_WANT_RAW_BITS_RENDERING " "+FIM_WANT_SEEK_MAGIC " "+FIM_WANT_TEXT_RENDERING " "+FIM_WINDOWS " "+FIM_WITH_AALIB " "+FIM_WITH_BMP " "+FIM_WITH_LIBCACA " "+FIM_WITH_LIBEXIF " "+FIM_WITH_LIBPNG " "+FIM_WITH_LIBSDL " "+FIM_WITH_PCX " "\n" "FIM_AUTHOR = \"Michele Martone \"\n" "FIM_AUTHOR_EMAIL = \"\"\n" "FIM_AUTHOR_NAME = \"Michele Martone\"\n" "FIM_CONFIGURATION = \"./configure CXXFLAGS=-O0\"\n" "FIM_TMP_FILENAME = \"\"\n" "FIM_VERSION = \"0.6-rc2\"\n" "-FIM_BIG_ENDIAN " "-FIM_CACHE_DEBUG " "-FIM_DEFAULT_CONSOLEFONT " "-FIM_KEEP_BROKEN_CONSOLE " "-FIM_NOFIMRC " "-FIM_NOHISTORY " "-FIM_TRY_XCFTOPNM " "-FIM_USE_DESIGNATED_INITIALIZERS " "-FIM_WANTS_SLOW_RESIZE " "-FIM_WANT_EXIFTOOL " "-FIM_WANT_FB_CONSOLE_SWITCH_WHILE_LOADING " "-FIM_WANT_NOSCRIPTING " "-FIM_WANT_NO_OUTPUT_CONSOLE " "-FIM_WANT_STATIC_BINARY " "-FIM_WITH_ARCHIVE " "-FIM_WITH_DEBUG " "-FIM_WITH_LIBIMLIB2 " "-FIM_WITH_LIBJASPER " "-FIM_WITH_LIBXYZ " "-FIM_WITH_NO_FRAMEBUFFER " "-FIM_WITH_UFRAW " fim-0.6-rc2/src/b2ba.c0000644000175000017500000000207314454347340011312 00000000000000/* (c) 2011-2017 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include // read #include int main(int argc,char *argv[]) { /* read binary data from stdin, dump a C array with byte data on stdout */ unsigned char byte=0; unsigned int bc=0; printf("{\n"); while(read(0,&byte,1)==1) printf("0x%02x,%s",byte,(++bc)%16?"":"\n"); printf("\n};\n"); return 0; } fim-0.6-rc2/src/fim.h0000644000175000017500000025005014454347340011264 00000000000000/* $LastChangedDate: 2023-04-15 00:54:24 +0200 (Sat, 15 Apr 2023) $ */ /* fim.h : Fim main header file (c) 2007-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_FIM_H #define FIM_FIM_H /* * config.h is generated by autoconf and defines some symbols used by Fim * */ #ifdef HAVE_CONFIG_H /* * when we get rid of string.h we will use , too #include */ #include "../config.h" #endif /* HAVE_CONFIG_H */ #define FIM_USE_OLDCXX ( __cplusplus<201103L ) /* */ #define FIM_USE_CXX11 ( __cplusplus>=201103L ) /* */ #define FIM_USE_CXX14 ( __cplusplus> 201402L ) /* */ #define FIM_USE_CXX17 ( __cplusplus> 201707L ) /* */ #ifdef FIM_WITH_DEBUG #else #define NDEBUG 1 /* turns off assert() functionality */ #endif /* * This is the main fim program header file. * Established 20061225 ( yes, i know what do you think about me now ) * */ #include /* standard C library definitions */ #include /* standard C buffered I/O */ #include /* standard C string manipulation functions */ #include /* C++ I/O stream manipulation ( cout,cin, ... ) */ #include /* STL (Standard Template Library) algorithm library */ #include /* STL (Standard Template Library) associative array template */ #include /* STL (Standard Template Library) stack structure template */ #include /* STL (Standard Template Library) vector structure template */ #include /* STL (Standard Template Library) queue adaptor */ #include /* STL (Standard Template Library) ? */ #include /* STL (Standard Template Library) list structure template */ #include /* STL (Standard Template Library) set structure template */ #include /* C assertions ( IEEE Std 1003.1-2001 aka Posix ) */ #define FIM_USE_CXX_REGEX FIM_USE_CXX11 && HAVE_REGEX #if FIM_USE_CXX_REGEX # include /* C++11 STL regular expressions: regex_search regex_replace */ #else /* FIM_USE_CXX_REGEX */ #if HAVE_REGEX_H #ifndef USE_GNU_REGEX # include /* the Posix (GNU implementation,not functionality) readline library */ #else # include "regex.h" /* the GNU (implementation and functionality) readline library */ #endif /* USE_GNU_REGEX */ #endif /* HAVE_REGEX_H */ #endif /* FIM_USE_CXX_REGEX */ #ifdef HAVE_CLIMITS #include /* From: * ISO C++ 14882: 18.2.2 Implementation properties: C library * we get some more stuff than limits.h. */ #else /* HAVE_CLIMITS */ #ifdef HAVE_LIMITS_H /* According to IEEE Std 1003.1-2001, * this should define _POSIX_PATH_MAX * */ #include #endif /* HAVE_LIMITS_H */ #endif /* HAVE_LIMITS_H */ #ifndef _POSIX_PATH_MAX /* I don't know in what case could arise this situation * (no limits.h nor climits : i guess a badly configured system), * but this would be the fix :*/ #define _POSIX_PATH_MAX 4096 #endif /* _POSIX_PATH_MAX */ #include /* */ #if HAVE_SYS_STAT_H #include /* stat */ #endif /* HAVE_SYS_STAT_H */ #include /* */ #ifdef FIM_WITH_PTHREADS #include /* */ #endif /* FIM_WITH_PTHREADS */ #if 0 #ifdef HAVE_UNIX_H # include # ifndef _POSIX_PATH_MAX # include # ifndef _POSIX_PATH_MAX /* a strict limit to pathname length */ # define _POSIX_PATH_MAX 4096 # endif # endif #else #endif #endif #define FIM_PATH_MAX _POSIX_PATH_MAX #if HAVE_TERMIOS_H #include /* general terminal interface (Posix) */ #endif /* HAVE_TERMIOS_H */ #include /* file descriptor manipulation interface (Posix) */ #include /* time related functionality (Posix) */ #include "common.h" /* misc FIM stuff */ /* #define FIM_USE_GPM 0 */ #ifdef FIM_USE_GPM #include /* mouse events */ #endif /* FIM_USE_GPM */ /*#include */ /* standard Posix symbolic constants and types */ /*#include */ #include #define FIM_LINE_CERR std::cerr << "fatal error" << __FILE__ << ":" << __LINE__ << "\n"; #define FIM_LINE_COUT std::cout << "in " <<__func__ << " # " << __FILE__ << ":" << __LINE__ << "\n"; #define FIM_INT_PCNT(P,L) (static_cast( ceilf(static_cast((P)*(L))/100.0))) #define FIM_FLT_PCNT(P,L) (static_cast(ceilf(static_cast((P)*(L))/100.0))) #define FIM_INT_PCNT_OF_100(P,L) static_cast( FIM_MIN(FIM_INT_PCNT(P,L),L) ) #define FIM_FLT_PCNT_OF_100(P,L) FIM_MIN(FIM_FLT_PCNT(P,L),L) #define FIM_INT_PCNT_SAFE(P,L) (FIM_INT_PCNT(FIM_MIN(100,FIM_MAX(P,0)),(L))) #define FIM_INT_DET_PCNT(P,T) (((static_cast(P))/(static_cast(T)))*100.0) #define FIM_DELIMIT_TO_100(X) FIM_MIN(FIM_MAX(X,0),100) #define FIM_INT_DET_PX(P,T,X) (((static_cast(P))/(static_cast(T)))*(1.0*X)) #define FIM_DELIMIT_TO_X(Y,X) FIM_MIN(FIM_MAX(Y,0),X) #define FIM_XOR(X,Y) ((X)^(Y)) #include "fim_types.h" #include "fim_limits.h" #include "fim_wrappers.h" #include "Arg.h" #define FIM_WANT_REMEMBER_LAST_FILE_LOADER 1 /* TODO: shall use this feature to set a i:file_loader attribute; FIXME: move this down */ #define FIM_WANT_BENCHMARKS 1 /* FIXME: move this down */ #define FIM_ALLOW_LOADER_VERBOSITY 1 #define FIM_WANT_FAT_BROWSER 1 #define FIM_WANT_BDI 1 #define FIM_WANT_TII 1 #define FIM_WANT_MIPMAPS 1 #define FIM_WANT_GOTOLAST 1 #define FIM_WANT_LASTGOTODIRECTION (FIM_WANT_GOTOLAST && 1) #define FIM_WANT_PIC_CMTS 1 #define FIM_WANT_PIC_LISTUNMARK 1 #define FIM_OSW_LOAD_IMG_DSC_FILE_VID_COMMENT_OI_VAL 2 #define FIM_WANT_PIC_LVDN 1 /* pictures load variables description namespace (FIXME: experimental) */ #define FIM_WANT_PIC_LBFL 1 /* limit browser file list (see FIM_FLT_LIMIT) */ #define FIM_WANT_PIC_RCMT 1 /* remember last comment with special "#!fim:=" syntax */ #define FIM_WANT_PIC_CCMT 1 && FIM_WANT_PIC_LVDN /* contextual last comment with special "#!fim:^=" and "#!fim:$=" syntax */ #define FIM_WANT_DESC_VEXP ( FIM_WANT_PIC_LVDN && 1 ) /* description variable expansion */ #define FIM_WANT_VAR_GOTO 1 && FIM_WANT_PIC_CCMT /* goto based on variables values */ #define FIM_WANT_CMDLINE_KEYPRESS 1 /* commandline option to execute certain keypresses at startup time */ #define FIM_WANT_FLIST_STAT ( HAVE_SYS_STAT_H && 1 ) /* stat() info in the file list */ #define FIM_WANT_SORT_BY_STAT_INFO FIM_WANT_FLIST_STAT /* using stat() info for sorting (FIXME: shall cache this info at first sort or on -R) */ #define FIM_WANT_MAGIC_FIMDESC 1 #if FIM_USE_CXX11 #define FIM_WANT_CROP 1 /* experimental, unfinished */ #else /* FIM_USE_CXX11 */ #define FIM_WANT_CROP 0 /* experimental, unfinished */ #endif /* FIM_USE_CXX11 */ #define FIM_WANT_MOUSE_CROP FIM_WANT_CROP /* experimental, unfinished */ #define FIM_EXPERIMENTAL_IMG_NMSPC 1 #define FIM_EXPERIMENTAL_VAR_EXPANDOS 1 #define FIM_FONT_MAGNIFY_FACTOR FIM_WANT_FONT_MAGNIFY_FACTOR /* Framebuffer font magnifying factor, >=1 (EXPERIMENTAL). Useful with very high resolutions and small fonts. */ #define FIM_FONT_MAGNIFY_FACTOR_MIN 1 /* Framebuffer font magnifying factor, minimal value. */ #define FIM_FONT_MAGNIFY_FACTOR_MAX 16 /* Framebuffer font magnifying factor, maximal value. */ #define FIM_FONT_MAGNIFY_FACTOR_DEFAULT ( FIM_WANT_FONT_MAGNIFY_FACTOR > 0 ? FIM_WANT_FONT_MAGNIFY_FACTOR : ( FIM_WANT_FONT_MAGNIFY_FACTOR < 0 ? -FIM_WANT_FONT_MAGNIFY_FACTOR : 1 ) ) /* Framebuffer font magnifying factor, default value. */ #if defined(__MINGW32__ ) || defined(__MINGW64__) #define FIM_USING_MINGW 1 #else #define FIM_USING_MINGW 0 #endif #define FIM_WANT_BACKGROUND_LOAD ( FIM_USE_CXX11 && !FIM_USING_MINGW ) /* FIXME: this is experimental */ #define FIM_WANT_PIC_CMTS_RELOAD ( FIM_USE_CXX11 && FIM_WANT_PIC_CMTS ) #define FIM_WANT_IMAGE_LOAD_TIME 1 #define FIM_RECURSIVE_HIDDEN_DIRS_SKIP_CHECK 1 #define FIM_WANT_PROGRESS_RECURSIVE_LOADING 0 /* print a line when loading recursively directories in background */ #define FIM_WANT_BIND_ALL 0 /* bind all keys to a specific command; FIXME: activate this */ #define FIM_WANT_RESIZE_HUGE_AFTER_LOAD 1 /* resize huge images at load time */ #define FIM_WANT_GOTO_DIR 1 #define FIM_WANT_FBI_INNER_DIAGNOSTICS false #define FIM_WANT_FBI_FBDEV_DIAGNOSTICS false #define FIM_IMG_NAKED_PTRS (!FIM_USE_CXX11) /* from C++11 onwards, use smart pointers over Image* */ #define FIM_WANT_OBSOLETE 0 /* for functionality to be removed or overhauled */ /* shadow list of high-res images to jump on demand */ #ifndef FIM_EXPERIMENTAL_SHADOW_DIRS #if HAVE_FILESYSTEM #if FIM_USE_CXX17 #define FIM_EXPERIMENTAL_SHADOW_DIRS 2 /* 1: at load time 2: at view time */ #endif /* FIM_USE_CXX17 */ #endif /* HAVE_FILESYSTEM */ #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ #ifndef FIM_EXPERIMENTAL_SHADOW_DIRS #if FIM_USE_CXX11 #if FIM_READ_DIRS #define FIM_EXPERIMENTAL_SHADOW_DIRS 1 /* 1: at load time 2: at view time */ #endif /* FIM_READ_DIRS */ #endif /* FIM_USE_CXX11 */ #endif /* FIM_EXPERIMENTAL_SHADOW_DIRS */ #define FIM_EXPERIMENTAL_FONT_CMD HAVE_DIRENT_H /* */ #define FIM_WANT_HELP_ARGS 1 /* */ #define FIM_WANT_VARIABLE_RESOLUTION_MOUSE_SCROLL 1 /* the larger the image, the more scroll steps */ #if FIM_USE_CXX11 #define FIM_NOEXCEPT noexcept #define FIM_CONSTEXPR constexpr #define FIM_OVERRIDE override #define FIM_FINAL final #define FIM_NORETURN [[noreturn]] #else /* FIM_USE_CXX11 */ #define FIM_NOEXCEPT #define FIM_CONSTEXPR const #define FIM_OVERRIDE #define FIM_FINAL #define FIM_NORETURN #endif /* FIM_USE_CXX11 */ #if FIM_USE_CXX14 #define FIM_DEPRECATED(MSG) [[deprecated(MSG)]] #else /* FIM_USE_CXX14 */ #define FIM_DEPRECATED(MSG) #endif /* FIM_USE_CXX14 */ #if FIM_USE_CXX17 #define FIM_FALLTHROUGH [[fallthrough]]; #else /* FIM_USE_CXX17 */ #define FIM_FALLTHROUGH #endif /* FIM_USE_CXX17 */ #ifdef FIM_AUTOCMDS #define FIM_AUTOCMD_EXEC autocmd_exec #define FIM_AUTOCMD_EXEC_PRE(AC,CF) { const fim_fn_t _c = CF; autocmd_exec(AC,_c); #define FIM_AUTOCMD_EXEC_POST(AC) autocmd_exec(AC,_c); } #else /* FIM_AUTOCMDS */ #define FIM_AUTOCMD_EXEC #endif /* FIM_AUTOCMDS */ fim::string fim_help_opt(const char*qs, const char dl); namespace fim { #if FIM_USE_CXX11 using fim_fn_t = string; /* file name */ using fim_ds_t = string; /* file description */ using sym_keys_t = std::map; //symbol->code using fim_cxr = fim::string; // command execution result #else /* FIM_USE_CXX11 */ typedef string fim_fn_t; /* file name */ typedef string fim_ds_t; /* file description */ typedef std::map sym_keys_t; //symbol->code typedef fim::string fim_cxr; // command execution result #endif /* FIM_USE_CXX11 */ void status(const fim_char_t *desc, const fim_char_t *info); class ViewportState { #if FIM_USE_CXX11 public: fim_off_t steps_{},hsteps_{},vsteps_{},top_{},left_{},panned_{} ; /* viewport state variables */ #else /* FIM_USE_CXX11 */ public: fim_off_t steps_,hsteps_,vsteps_,top_,left_,panned_ ; /* viewport state variables */ ViewportState(void) :steps_(0) ,hsteps_(0) ,vsteps_(0) ,top_(0) ,left_(0) ,panned_(0x0) {} #endif /* FIM_USE_CXX11 */ }; class Browser; class FontServer; class FramebufferDevice; class CommandConsole; class Command; class Image; class Var; class MiniConsole; #ifdef FIM_WINDOWS class FimWindow; #endif /* FIM_WINDOWS */ class Viewport; class fim_stream; } namespace rl { void initialize_readline (fim_bool_t with_no_display_device); } /* using GCC builtins (__GNUC__ should be defined by gcc) */ #ifndef FIM_IS_SLOWER_THAN_FBI #define FIM_UNLIKELY(expr) __builtin_expect(!!(expr),0) #define FIM_LIKELY(expr) __builtin_expect(!!(expr),1) #if FIM_USE_CXX17 && defined(__cpp_aligned_new) #define FIM_ALIGNED __attribute__((aligned (64))) #else /* FIM_USE_CXX17 */ #define FIM_ALIGNED #endif /* FIM_USE_CXX17 */ #else /* FIM_IS_SLOWER_THAN_FBI */ #define FIM_UNLIKELY(expr) (expr) #define FIM_LIKELY(expr) (expr) #define FIM_ALIGNED #endif /* FIM_IS_SLOWER_THAN_FBI */ //#define FIM_FBI_PRINTF( ... ) fprintf(stderr, __VA_ARGS__ ) /* " warning: anonymous variadic macros were introduced in C99" (here and elsewhere) */ #define FIM_WANT_FBI_PRINTF 0 #define FIM_FBI_PRINTF( ... ) {} #define FIM_VERB_PRINTF printf #define FIM_VERB_COUT std::cout namespace fim{ enum fim_image_source_t FIM_ENUM_BASE { FIM_E_FILE=-11, FIM_E_STDIN=-22}; /* these */ enum fim_xflags_t /*FIM_ENUM_BASE*/ { FIM_X_NULL=0,FIM_X_HISTORY=1,FIM_X_QUIET=2,FIM_X_NOAUTOCMD=4}; /* TODO: may introduce 'sandbox' like flags, here (for instance, for no-system/pipe-interacting executions) */ typedef std::pair cache_key_t; //the current cache key enum FimDocRefMode FIM_ENUM_BASE { Txt, Man, DefRefMode=Txt}; } #define FIM_STDIN_IMAGE_NAME "" /* should belong to a namespace different from the file name space, and possibly figuring alphabetically as the first one */ /* * Fim Symbols * */ #define FIM_SYM_CONSOLE_KEY ':' #define FIM_SYM_CONSOLE_KEY_STR ":" #define FIM_SYM_FW_SEARCH_KEY '/' #define FIM_SYM_FW_SEARCH_KEY_STR "/" #define FIM_SYM_BW_SEARCH_KEY '?' #define FIM_SYM_BW_SEARCH_KEY_STR "?" #define FIM_SYM_NULL_KEY 0x0 /* null key value for fim_key_t */ #define FIM_SYM_NAMESPACE_SEP ':' #define FIM_SYM_DEVOPTS_SEP '=' #define FIM_SYM_DEVOPTS_SEP_STR "=" #define FIM_SYM_NULL_NAMESPACE_CHAR '\0' #define FIM_SYM_NAMESPACE_BROWSER_CHAR 'b' #define FIM_SYM_NAMESPACE_IMAGE_CHAR 'i' #define FIM_SYM_NAMESPACE_IMAGE_ALL_STR "i:*" #define FIM_SYM_NAMESPACE_GLOBAL_CHAR 'g' #define FIM_SYM_NAMESPACE_WINDOW_CHAR 'w' #define FIM_SYM_NAMESPACE_VIEWPORT_CHAR 'v' /* #define FIM_SYM_NAMESPACE_PREFIXES "'i:', 'b:', 'w:', 'v:', 'g:'" */ /* #define FIM_SYM_NAMESPACE_PREFIXES_DSC "current image, browser, window, viewport, global" */ /* #define FIM_SYM_NAMESPACE_REGEX "^[givbw]:" */ #define FIM_SYM_NAMESPACE_PREFIXES "'i:'" /* removed g: because is not mandatory */ #define FIM_SYM_NAMESPACE_PREFIXES_DSC "current image, global" #define FIM_SYM_NAMESPACE_REGEX "^[gi]:" #define FIM_SYM_PROMPT_CHAR ':' #define FIM_SYM_PROMPT_SLASH '/' #define FIM_SYM_PROMPT_NUL '\0' #define FIM_SYM_CHAR_NUL '\0' #define FIM_SYM_CHAR_ENDL '\n' #define FIM_SYM_ESC 0x1B #define FIM_SYM_ENTER 0x0D #define FIM_SYM_FLIPCHAR 'F' #define FIM_SYM_MIRRCHAR 'M' #define FIM_SYM_TYPE_FLOAT 'f' #define FIM_SYM_TYPE_INT 'i' #define FIM_SYM_STRING_CONCAT '.' #define FIM_SYM_DOT_CHAR '.' #define FIM_SYM_SEMICOLON ';' #define FIM_SYM_SEMICOLON_STRING ";" #define FIM_SYM_ENDL "\n" #define FIM_SYM_PIC_CMT_CHAR '#' #define FIM_SYM_UNKNOWN_CHAR ' ' /* replacement for non-printable characters */ #define FIM_SYM_UNKNOWN_STRING " " /* *FIM_SYM_UNKNOWN_STRING == FIM_SYM_UNKNOWN_CHAR */ #define FIM_SYM_SORT_SZ 'z' #define FIM_SYM_SORT_MD 'm' #define FIM_SYM_SORT_BN 'b' #define FIM_SYM_SORT_BV 'v' #define FIM_SYM_SORT_FN 'f' #define FIM_SYM_CMD_SLSL FIM_VID_RE_SEARCH_OPTS "=\"f\"" /* * External programs used by fim. */ #define FIM_EPR_FIG2DEV "fig2dev" #define FIM_EPR_XCFTOPNM "xcftopnm" #define FIM_EPR_DIA "dia" #define FIM_EPR_INKSCAPE "inkscape" #define FIM_EPR_CONVERT "convert" #define FIM_EPR_ZCAT "zcat" /* * Some Fim (internal) error codes. */ #define FIM_ERR_NO_ERROR 0 #define FIM_ERR_GENERIC -1 #define FIM_ERR_UNSUPPORTED -2 #define FIM_ERR_BUFFER_FULL -1024 // FIXME: -2 seems in use #define FIM_ERR_UNSUPPORTED_DEVICE -4 #define FIM_ERR_BAD_PARAMS -8 #define FIM_ERR_NO_SUCH_OPTION -16 #define FIM_ERR_OOPS 42 #define FIM_ERR_TO_PERR(E) (((unsigned char)(E))) /* * Some Fim (program) error codes. */ #define FIM_PERR_NO_ERROR FIM_ERR_TO_PERR(FIM_ERR_NO_ERROR) #define FIM_PERR_GENERIC FIM_ERR_TO_PERR(FIM_ERR_GENERIC) #define FIM_PERR_UNSUPPORTED FIM_ERR_TO_PERR(FIM_ERR_UNSUPPORTED) #define FIM_PERR_NO_SUCH_OPTION FIM_ERR_TO_PERR(FIM_ERR_NO_SUCH_OPTION) //#define FIM_PERR_BUFFER_FULL FIM_ERR_TO_PERR(FIM_ERR_BUFFER_FULL) #define FIM_PERR_UNSUPPORTED_DEVICE FIM_ERR_TO_PERR(FIM_ERR_UNSUPPORTED_DEVICE) #define FIM_PERR_BAD_PARAMS FIM_ERR_TO_PERR(FIM_ERR_BAD_PARAMS) #define FIM_PERR_OOPS FIM_ERR_TO_PERR(FIM_ERR_OOPS) /* * Some Fim error messages. */ #define FIM_EMSG_NO_SCRIPTING "sorry, no scripting available!\n" #define FIM_EMSG_NO_READ_STDIN_IMAGE "sorry, the reading of images from stdin was disabled at compile time\n" #define FIM_EMSG_CACHING_STDIN "problems caching standard input image!\n" #define FIM_EMSG_OUT_OF_MEM "out of memory\n" #define FIM_EMSG_UNFINISHED "sorry, feature incomplete!\n" #define FIM_EMSG_ITE "internal type error\n" #define FIM_EMSG_ICE "internal consistency error\n" #define FIM_EMSG_DSMO "Warning: Asking to ignore already specified stdin reading option!\n" /* Command related error messages */ #define FIM_EMSG_NOMARKUNMARK "sorry, mark/unmark functionality was opted out." /* * Some environment variables used by Fim. */ #define FIM_ENV_DISPLAY "DISPLAY" #define FIM_ENV_SSH "SSH_TTY" #define FIM_ENV_FRAMEBUFFER "FRAMEBUFFER" #define FIM_ENV_FBGAMMA "FBGAMMA" #define FIM_ENV_FBFONT "FBFONT" /* * Fim Option (long) Switches * */ #define FIM_OSW_OUTPUT_DEVICE "output-device" #define FIM_OSW_BINARY "binary" #define FIM_OSW_TEXT "as-text" #define FIM_OSW_EXECUTE_COMMANDS "execute-commands" #define FIM_OSW_EXECUTE_COMMANDS_EARLY "execute-commands-early" #define FIM_OSW_EXECUTE_SCRIPT "execute-script" #define FIM_OSW_FINAL_COMMANDS "final-commands" #define FIM_OSW_SCRIPT_FROM_STDIN "script-from-stdin" #define FIM_OSW_READ_FROM_STDIN "read-from-stdin" #define FIM_OSW_IMAGE_FROM_STDIN "image-from-stdin" #define FIM_OSW_DUMP_SCRIPTOUT "write-scriptout" #define FIM_OSW_CHARS_PRESS "chars-press" #define FIM_OSW_KEYSYM_PRESS "keysym-press" #define FIM_OSW_LOAD_IMG_DSC_FILE "load-image-descriptions-file" #define FIM_OSW_IMG_DSC_FILE_SEPC "image-descriptions-file-separator" #define FIM_OSW_SORT_FSIZE "sort-fsize" #define FIM_OSW_SORT_MTIME "sort-mtime" #define FIM_OSW_BGREC "background-recursive" #define FIM_OSW_RECURSIVE "recursive" #define FIM_OSW_NOEXTPIPLOA "no-pipe-load" #define FIM_OSW_NO_STAT_PUSH "no-stat-push" #define FIM_OSW_NO_ETC_FIMRC "no-etc-fimrc-file" #define FIM_OSW_ETC_FIMRC "etc-fimrc" /* * Fim Constants * */ #define FIM_CNS_FIM "FIM - Fbi IMproved" #define FIM_CNS_LCY "2023" /* latest copyright year */ //#define FIM_CNS_FIM_TXT "FIM.TXT" #define FIM_CNS_BUGS_FILE "BUGS" #define FIM_CNS_TERM_VAR "TERM" #define FIM_CNS_HOME_VAR "HOME" #define FIM_CNS_HIST_FILENAME ".fim_history" #define FIM_CNS_HIST_COMPLETE_FILENAME "~/.fim_history" //#ifdef FIM_PATHS_IN_MAN #define FIM_CNS_SYS_RC_FILEPATH "@sysconfdir@/fimrc" #define FIM_CNS_DOC_PATH "@docdir@" //#else /* FIM_PATHS_IN_MAN */ //#define FIM_CNS_SYS_RC_FILEPATH "/etc/fimrc" //#define FIM_CNS_DOC_PATH "/usr/share/doc/fim" //#endif /* FIM_PATHS_IN_MAN */ #define FIM_CNS_USR_RC_FILEPATH ".fimrc" #define FIM_CNS_USR_RC_COMPLETE_FILEPATH "~/.fimrc" #define FIM_CNS_EXAMPLE_FILENAME "file.jpg" #define FIM_CNS_SCALEFACTOR 1.322f #define FIM_CNS_SCALEFACTOR_ONE 1.0f #define FIM_CNS_SCALE_DEFAULT FIM_CNS_SCALEFACTOR_ONE #define FIM_CNS_ANGLE_ONE 1.0f #define FIM_CNS_ANGLE_ZERO 0.0f #define FIM_CNS_ANGLE_DEFAULT FIM_CNS_ANGLE_ZERO #define FIM_CNS_GAMMA_DEFAULT 1.0 #define FIM_CNS_GAMMA_DEFAULT_STR FIM_XSTRINGIFY(FIM_CNS_GAMMA_DEFAULT) #define FIM_CNS_SCALEFACTOR_MULTIPLIER 1.1f #define FIM_CNS_SCALEFACTOR_DELTA 0.1f #define FIM_CNS_SCALEFACTOR_ZERO 0.0f //#define FIM_CNS_STEPS_DEFAULT 50 #define FIM_CNS_SCROLL_DEFAULT "90%" #define FIM_CNS_STEPS_DEFAULT_N 50 #define FIM_CNS_STEPS_DEFAULT "20%" #define FIM_CNS_STEPS_DEFAULT_P true /* FIXME */ #define FIM_CNS_STEPS_MIN 1 #define FIM_CNS_WGROW_STEPS_DEFAULT 1 #define FIM_CNS_WENLARGE_STEPS_DEFAULT 10 #define FIM_CNS_SCALEDELTA 0.01f #define FIM_CNS_EMPTY_STRING "" #define FIM_CNS_NEWLINE "\n" //#define FIM_CNS_NEWLINE std::endl #define FIM_CNS_DEFAULT_IFNAME FIM_CNS_EMPTY_STRING #define FIM_CNS_SLASH_CHAR '/' /* directory delimiter */ #define FIM_CNS_SLASH_STRING "/" /* directory delimiter */ #define FIM_CNS_QU_MA_STRING "?" /* see FIM_SYM_BW_SEARCH_KEY_STR */ #define FIM_CNS_DIRSEP_STRING FIM_CNS_SLASH_STRING #define FIM_CNS_DIRSEP_CHAR FIM_CNS_SLASH_CHAR #define FIM_CNS_FP_ZERO 0.0 #define FIM_CNS_EMPTY_FP_VAL FIM_CNS_FP_ZERO #define FIM_CNS_EMPTY_INT_VAL 0 #define FIM_CNS_ERR_QUIT 0 #define FIM_CNS_EMPTY_RESULT FIM_CNS_EMPTY_STRING #ifdef SVN_REVISION #define FIM_CNS_FIM_APPTITLE FIM_CNS_FIM ", v." PACKAGE_VERSION " (r." SVN_REVISION ")" #else /* SVN_REVISION */ #define FIM_CNS_FIM_APPTITLE FIM_CNS_FIM ", v." PACKAGE_VERSION "" #endif /* SVN_REVISION */ #ifdef SVN_REVISION_NUMBER #define FIM_REVISION_NUMBER (SVN_REVISION_NUMBER) #else /* SVN_REVISION_NUMBER */ #define FIM_REVISION_NUMBER (-1) #endif /* SVN_REVISION_NUMBER */ #define FIM_CNS_MAGIC_DESC "#!fim:desc" #define FIM_CNS_EX_KSY_STRING "{keysym}" #define FIM_CNS_EX_CMD_STRING "{command}" #define FIM_CNS_EX_FN_STRING "{filename}" #define FIM_CNS_EX_FNS_STRING "{filename(s)}" #define FIM_CNS_EX_KC_STRING "{keycode}" #define FIM_CNS_EX_ID_STRING "{identifier}" #define FIM_CNS_EX_VAR_STRING "{var}" #define FIM_CNS_EX_IDS_STRING "{identifier|identifier2...}]" #define FIM_CNS_EX_EXP_STRING "{expression}" #define FIM_CNS_EX_PAT_STRING "{pattern}" #define FIM_CNS_EX_CMDS_STRING "{commands}" #define FIM_CNS_EX_EVT_STRING "{event}" #define FIM_CNS_EX_ARGS_STRING "{args}" #define FIM_CNS_EX_DSC_STRING "{description}" #define FIM_CNS_EX_PATH_STRING "{path}" #define FIM_CNS_EX_SYSC_STRING "{syscmd}" #define FIM_CNS_EX_FCT_STRING "{factor}" #define FIM_CNS_EX_RE_STRING "{regexp}" #define FIM_CNS_EX_RES_STRING "{regexp(s)}" #define FIM_CNS_EX_NUM_STRING "{number}" #define FIM_CNS_EX_SCALE_STRING "{scale}" #define FIM_CNS_SHELL "/bin/sh" #define FIM_CNS_DSFF_SL "JPEG, PNG, GIF, TIFF, PPM, PGM, PBM" #define FIM_CNS_DSFF_SN "BMP, PCX" #if FIM_USE_CXX11 /* this default FIM_CNS_PUSHDIR_RE might be built based on build options */ #define FIM_CNS_PUSHDIR_RE R"***(\.(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$)***" #else /* FIM_USE_CXX11 */ #define FIM_CNS_PUSHDIR_RE "\\.(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$" #endif /* FIM_USE_CXX11 */ #define FIM_CNS_ARCHIVE_RE "\\.(RAR|ZIP|TAR|TAR.GZ|TGZ|TAR.BZ2|TBZ|TBZ2|CBR|CBZ|LHA|7Z|XAR|ISO)$" /* there might be more: CAB.. */ #define FIM_CNS_PIPEABLE_PATH_RE "^[/A-Za-z0-9_.][/A-Za-z0-9_.-]*$" #define FIM_CNS_BPP_INVALID 0 #define FIM_CNS_K 1024 #define FIM_CNS_M (FIM_CNS_K*FIM_CNS_K) #define FIM_CNS_LAST FIM_MAX_INT #define FIM_CNS_FIRST 0 #define FIM_CNS_VICSZ FIM_CNS_K * 64 /* viewport info cache size */ #define FIM_CNS_CSU FIM_CNS_K /* cache size unit */ #define FIM_CNS_CLEARTERM "\x1B\x4D" /* clear term char */ #define FIM_CNS_WHITE 0xFFFFFFFF /* Temporarily here. Will better need an enum or another portable solution. */ #define FIM_CNS_BLACK 0x00000000 /* Temporarily here. Will better need an enum or another portable solution. */ #define FIM_CNS_DBG_CMDS_MAX "ackCi" /* for FIM_VID_DBG_COMMANDS */ #define FIM_CNS_DBG_CMDS_MID "ackC" /* for FIM_VID_DBG_COMMANDS */ #define FIM_CNS_DBG_CMDS_PFX "#" /* for FIM_VID_DBG_COMMANDS */ #if FIM_USE_CXX14 template inline auto FIM_MIN(T x, S y) { return ((x)<(y)?(x):(y)); } template inline auto FIM_MAX(T x, S y) { return ((x)>(y)?(x):(y)); } #else /* FIM_USE_CXX14 */ #define FIM_MAX(x,y) ((x)>(y)?(x):(y)) #define FIM_MIN(x,y) ((x)<(y)?(x):(y)) #endif /* FIM_USE_CXX14 */ #define FIM_MOD(X,C) ((((X)%(C))+(C))%(C)) #define FIM_INT_FRAC(Q,D) (((Q)+((D)-1))/(D)) #define FIM_INT_SCALE_FRAC(Q,D) ((Q)/(D)) /* division of integer values by fim_scale_t */ #define FIM_INTERNAL_LANGUAGE_SHORTCUT_SHORT_HELP \ ".nf\n"\ ":" " enter command line mode\n"\ ":" FIM_CNS_EX_NUM_STRING " jump to " FIM_CNS_EX_NUM_STRING "^th image in the list\n"\ ":^ jump to first image in the list\n"\ ":$ jump to last image in the list\n"\ ":*" FIM_CNS_EX_FCT_STRING " scale the image by " FIM_CNS_EX_FCT_STRING "\n"\ ":" FIM_CNS_EX_SCALE_STRING "% scale the image to the desired " FIM_CNS_EX_SCALE_STRING "\n"\ ":+" FIM_CNS_EX_SCALE_STRING "% scale the image up to the desired percentage " FIM_CNS_EX_SCALE_STRING " (relatively to the original)\n"\ ":-" FIM_CNS_EX_SCALE_STRING "% scale the image down to the desired percentage " FIM_CNS_EX_SCALE_STRING " (relatively to the original)\n"\ "\n"\ "/" FIM_CNS_EX_RE_STRING " entering the pattern " FIM_CNS_EX_RE_STRING " (with /) makes fim jump to the next image whose filename matches " FIM_CNS_EX_RE_STRING "\n"\ "/*.png$ entering this pattern (with /) makes fim jump to the next image whose filename ends with 'png'\n"\ "/png a shortcut for /.*png.*\n"\ "\n"\ "2,4 " FIM_FLT_STDOUT " '{}' print three filenames to standard output.\n"\ "\n"\ "\n"\ "!" FIM_CNS_EX_SYSC_STRING " executes the " FIM_CNS_EX_SYSC_STRING " quoted string as an argument to the \"" FIM_FLT_SYSTEM "\" fim command.\n"\ "" #ifdef FIM_WITH_LIBCACA #define FIM_USE_ASCII_ART_DEFAULT FIM_DDN_INN_CACA #else /* FIM_WITH_LIBCACA */ #ifdef FIM_WITH_AALIB #define FIM_USE_ASCII_ART_DEFAULT FIM_DDN_INN_AA #else /* FIM_WITH_AALIB */ #undef FIM_USE_ASCII_ART_DEFAULT /*undefined */ #endif /* FIM_WITH_AALIB */ #endif /* FIM_WITH_LIBCACA */ #define FIM_MAX_MIPMAPS 32 /* pretty large ;-) */ #define FIM_HYPOTHENUSE_OF(C1,C2) sqrt( (C1)*(C1) + (C2)*(C2) ) #define FIM_HYPOTHENUSE_OF_INT(C1,C2) ceil( FIM_HYPOTHENUSE_OF(((double)(C1)),((double)(C2))) + 1.0 ) enum fim_mmo_t { FIM_MMO_NORMAL=0, FIM_MMO_FASTER=1 }; class fim_mipmap_t FIM_FINAL { public: size_t mmoffs[FIM_MAX_MIPMAPS]; /* mipmap offset */ size_t mmsize[FIM_MAX_MIPMAPS]; /* mipmap size */ fim_int mmw[FIM_MAX_MIPMAPS]; /* mipmap width */ fim_int mmh[FIM_MAX_MIPMAPS]; /* mipmap height */ int nmm; /* number of mipmaps */ size_t mmb; /* mipmap bytes (total) */ fim_byte_t* mdp; /* mipmap data pointer */ enum fim_mmo_t mmo; fim_mipmap_t(const fim_mipmap_t&mm){reset();} fim_mipmap_t(void){reset();} size_t byte_size(void)const{return mmb+sizeof(*this);} void dealloc(void){if(mdp)fim_free(mdp);reset();} ~fim_mipmap_t(void){this->dealloc();} bool ok(void)const{return mmb > 0;} private: void reset(void){nmm=0;mmb=0;mdp=FIM_NULL;} }; #include "fim_string.h" #include "Command.h" #include "Benchmarkable.h" #include "FontServer.h" #include "FbiStuff.h" #include "Var.h" #include "Namespace.h" #include "Image.h" #include "Cache.h" #include "Viewport.h" #include "FimWindow.h" #include "Browser.h" #include "DebugConsole.h" #include "DummyDisplayDevice.h" #ifdef FIM_WITH_LIBIMLIB2 #include "Imlib2Device.h" #endif /* FIM_WITH_LIBIMLIB2 */ #ifdef FIM_WITH_LIBSDL #include "SDLDevice.h" #endif /* FIM_WITH_LIBSDL */ #ifdef FIM_WITH_LIBCACA #include "CACADevice.h" #endif /* FIM_WITH_LIBCACA */ #ifdef FIM_WITH_AALIB #include "AADevice.h" #endif /* FIM_WITH_AALIB */ #include "FramebufferDevice.h" #include "CommandConsole.h" #include "fim_stream.h" namespace fim { extern fim_stream cout; extern fim_stream cerr; extern fim_char_t g_sc; } #define FIM_I2BI(VID) VID "_" /* identifier to backup identifier */ /* * Fim language variable identifiers and help comment strings (notice their format). * Please note that the prefix FIM_VID is reserved to variable identifiers exclusively. * */ //#define FIM_VID_NEWLINE "_newline" /* "" */ //#define FIM_VID_TAB "_tab" /* "" */ #define FIM_VID_ARCHIVE_FILES "_archive_files" /* "[in,g:] Regular expression matching filenames to be treated as (multipage) archives. If empty, \"" FIM_CNS_ARCHIVE_RE "\" will be used. Within each archive, only filenames matching the regular expression in the " FIM_VID_PUSHDIR_RE " variable will be considered for opening." */ #define FIM_VID_RANDOM "random" /* "[out] a pseudorandom number." */ #define FIM_VID_BINARY_DISPLAY "_display_as_binary" /* "[in,g:] will force loading of the specified files as pixelmaps (no image decoding will be performed); if 1, using one bit per pixel; if 24, using 24 bits per pixel; otherwise will load and decode the files as usual." */ #define FIM_VID_TEXT_DISPLAY "_display_as_rendered_text" /* "[in,g:] will force loading of the specified files as text files (no image decoding will be performed); if 1; otherwise will load and decode the files as usual." */ #define FIM_VID_CACHE_CONTROL "_cache_control" /* "[in,g:] string for cache control. if it starts with 'm' mipmaps will be cached; if it starts with 'M' then not. otherwise defaults will apply." */ #define FIM_VID_CROP_ONCE "_crop_once" /* "[in,g:] Unfinished." */ #define FIM_VID_CACHE_STATUS "_cache_status" /* "[out,g:] string with current information on cache status." */ #define FIM_VID_DISPLAY_CONSOLE "_display_console" /* "[in,g:] if 1, will display the output console." */ #define FIM_VID_DEVICE_DRIVER "_device_string" /* "[out,g:] the current display device string." */ #define FIM_VID_DISPLAY_STATUS "_display_status" /* "[in,g:] if 1, will display the status bar." */ #define FIM_VID_DISPLAY_STATUS_FMT "_display_status_fmt" /* "[in,g:] custom info format string, displayed in the lower left corner of the status bar; if unset: full pathname; otherwise a custom format string specified just as " FIM_VID_INFO_FMT_STR"." */ #define FIM_VID_PUSH_PUSHES_DIRS "_push_pushes_dirs" /* "[in,g:] if 1, the push command will also accept and push directories (using pushdir). if 2, will also push hidden files/directories, that is, ones whose names begin with a dot (.). " */ #define FIM_VID_SANITY_CHECK "_do_sanity_check" /* "[in,experimental,g:] if 1, will execute a sanity check on startup." */ #define FIM_VID_LAST_SYSTEM_OUTPUT "_last_system_output" /* "[out,experimental,g:] the standard output of the last call to the system command." */ #define FIM_VID_LAST_CMD_OUTPUT "_last_cmd_output" /* "[out,experimental,g:] the last command output." */ #define FIM_VID_LOAD_DEFAULT_ETC_FIMRC "_load_default_etc_fimrc" /* "[in,g:] if 1 at startup, will load the system wide initialization file." */ #define FIM_VID_LOAD_HIDDEN_DIRS "_load_hidden_dirs" /* "[in,g:] if not 1, when pushing directories/files, those whose name begins with a dot (.) will be skipped." */ #define FIM_VID_DEFAULT_ETC_FIMRC "_sys_rc_file" /* "[in,g:] string with the global configuration file name." */ #if FIM_WANT_IMAGE_LOAD_TIME #define FIM_VID_IMAGE_LOAD_TIME "_file_load_time" /* "[out,i:] time taken to load the file and decode the image, in seconds." */ #endif /* FIM_WANT_IMAGE_LOAD_TIME */ #define FIM_VID_FILE_LOADER "_file_loader" /* "[in,i:,g:] if not empty, this string will force a file loader (among the ones listed in the -V switch output); [out] i:" FIM_VID_FILE_LOADER " stores the loader of the current image." */ #define FIM_VID_FILE_BUFFERED_FROM "_buffered_in_tmpfile" /* "[out,i:] if an image has been temporarily converted and decoded from a temporary file, its name is here." */ #define FIM_VID_RETRY_LOADER_PROBE "_retry_loader_probe" /* "[in,g:] if 1 and user specified a file loader and this fails, will probe for a different loader." */ #define FIM_VID_NO_RC_FILE "_no_rc_file" /* "[in,g:] if 1, the ~/.fimrc file will not be loaded at startup." */ #define FIM_VID_NO_EXTERNAL_LOADERS "_no_external_loader_programs" /* "[in,g:] if 1, no external loading programs will be tried for piping in an unsupported type image file." */ #define FIM_VID_SCRIPTOUT_FILE "_fim_scriptout_file" /* "[in,g:] the name of the file to write to when recording sessions." */ #define FIM_VID_PUSHDIR_RE "_pushdir_re" /* "[in] regular expression to match against when pushing files from a directory or an archive. By default this is \"" FIM_CNS_PUSHDIR_RE "\"." */ #define FIM_VID_STATUS_LINE "_status_line" /* "[in,g:] if 1, will display the status bar." */ #define FIM_VID_WANT_PREFETCH "_want_prefetch" /* "[in,g:] if 1, will prefetch further files just after display of the first file; if 2 (and configured with --enable-cxx11) will load in the background." */ #define FIM_VID_LOADING_IN_BACKGROUND "_loading_in_background" /* "[out,g:] 1 if program has been invoked with --" FIM_OSW_BGREC " and still loading in background. " */ #define FIM_VID_RESIZE_HUGE_ON_LOAD "_downscale_huge_at_load" /* "[in,g:] if 1, will downscale automatically huge images at load time." */ #define FIM_VID_WANT_SLEEPS "_want_sleep_seconds" /* "[in,g:] number of seconds of sleep during slideshow mode." */ #define FIM_VID_WANT_EXIF_ORIENTATION "_want_exif_orientation" /* "[in,g:] if 1, will reorient images using information from EXIF metadata (and stored in in " FIM_VID_EXIF_ORIENTATION ", " FIM_VID_EXIF_MIRRORED ", " FIM_VID_EXIF_FLIPPED" )." */ #define FIM_VID_EXIF_ORIENTATION "__exif_orientation" /* "[out,i:] orientation information in the same format of " FIM_VID_ORIENTATION ", read from the orientation EXIF tags (i:EXIF_Orientation)." */ #define FIM_VID_EXIF_MIRRORED "__exif_mirrored" /* "[out,i:] mirroring information, read from the EXIF tags of a given image." */ #define FIM_VID_EXIF_FLIPPED "__exif_flipped" /* "[out,i:] flipping information, read from the EXIF tags of a given image." */ #define FIM_VID_AUTOTOP "_autotop" /* "[in,g:] if 1, will align to the top freshly loaded images." */ #define FIM_VID_SCALE_STYLE "_scale_style" /* "[in,g:] if non empty, this string will be fed to the " FIM_VID_SCALE " command; see its documentation for possible values." */ #define FIM_VID_FILEINDEX "_fileindex" /* "[out,g:] the current image numeric index." */ #define FIM_VID_LOOP_ONCE "_loop_only_once" /* "[internal,g:] if 1 and doing a --slideshow, do it once." */ #define FIM_VID_LASTFILEINDEX "_lastfileindex" /* "[out,g:] the last visited image numeric index. Useful for jumping back and forth easily between two images with 'goto _lastfileindex'." */ #define FIM_VID_LASTGOTODIRECTION "_lastgotodirection" /* "[out,g:] the last file goto direction (either string '+1' or string '-1')." */ #define FIM_VID_FILELISTLEN "_filelistlen" /* "[out,g:] current image list length (number of visible images)." */ #define FIM_VID_INFO_FMT_STR "_info_fmt_str" /* "[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets; %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set; EXP will be copied verbatim except for contained sequences of the form %:VAR:, which will be expanded to the value of variable i:VAR; this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) will be used only if present." */ #define FIM_VID_FILENAME "_filename" /* "[out,i:] the current file name string." */ #define FIM_VID_FIM_DEFAULT_CONFIG_FILE_CONTENTS "_fim_default_config_file_contents"/* "[out,g:] the contents of the default (hardcoded) configuration file (executed after the minimal hardcoded config)." */ #define FIM_VID_FIM_DEFAULT_GRAMMAR_FILE_CONTENTS "_fim_default_grammar_file_contents" /* "[out,g:] the contents of the default (hardcoded) grammar file." */ #define FIM_VID_FRESH "fresh" /* "[in,out,i:,experimental] 1 if the image was loaded, before all autocommands (autocmd) execution." */ #define FIM_VID_PAGE "page" /* "[out,experimental,g:] the current page." */ #define FIM_VID_PAGES "pages" /* "[out,experimental,i:] the current number of pages of an image." */ #define FIM_VID_OVERRIDE_DISPLAY "_inhibit_display" /* "[internal,g:] if 1, will inhibit display." */ #define FIM_VID_MAX_ITERATED_COMMANDS "_max_iterated_commands" /* "[g:] the iteration limit for N in \"N[commandname]\" iterated command invocations." */ #define FIM_VID_WANT_CAPTION_STATUS "_want_wm_caption_status" /* "[in,g:] this works only if supported by the display device (currently only SDL). if set to a number that is not 0, will show the status (or command) line in the window manager caption; if set to a non-empty string, will interpret it just as a file info format string (see " FIM_VID_INFO_FMT_STR "); if empty, will show the program version." */ #define FIM_VID_WANT_MOUSE_CTRL "_want_wm_mouse_ctrl" /* "[in,g:] if at least 9 chars long, enable mouse click/movement behaviour when in SDL mode; the 9 chars will correspond to a 3x3 screen clickable grid and the equivalent command keys; clicking middle or right button will toggle on-screen usage info." */ #define FIM_VID_MAGNIFY_FACTOR "_magnify_factor" /* "[in,g:] the image scale multiplier used when magnifying images size." */ #define FIM_VID_PWD "_pwd" /* "[out,g:] the current working directory; will be updated at startup and whenever the working directory changes." */ #define FIM_VID_REDUCE_FACTOR "_reduce_factor" /* "[in,g:] the image scale multiplier used when reducing images size." */ #define FIM_VID_SCALE_FACTOR_MULTIPLIER "_scale_factor_multiplier" /* "[in,g:] value used for scaling up/down the scaling factors." */ #define FIM_VID_SCALE_FACTOR_DELTA "_scale_factor_delta" /* "[in,g:] value used for incrementing/decrementing the scaling factors." */ #define FIM_VID_COMMENT "_comment" /* "[i:,out] the image comment, extracted from the image file (if any)." */ #define FIM_VID_COMMENT_OI "_caption_over_image" /* "[in,g:] if set not to 0, will display a custom comment string specified according to the value of_caption_over_image_fmt; if larger than 1, with black background; if 3, image will be drawn possibly below. It will take at most half of the screen." */ #define FIM_VID_COMMENT_OI_FMT "_caption_over_image_fmt" /* "[in,g:] custom info format string, displayed in a caption over the image; if unset: i:_comment; otherwise a custom format string specified just as " FIM_VID_INFO_FMT_STR"." */ #define FIM_VID_EXIFTOOL_COMMENT "_exiftool_comment" /* "[out,g:] comment extracted via the exiftool interface; see " FIM_VID_EXIFTOOL "." */ #define FIM_VID_STEPS "_steps" /* "[in,g:] the default steps, in pixels, when panning images." */ #define FIM_VID_PREAD "_pread_cmd" /* "[in,g:] a user-specified shell command emitting an image on stdout, in a format readable by the convert utility. If the current filename matches \"" FIM_CNS_PIPEABLE_PATH_RE "\", it will be substituted to any occurrence of '{}'." */ #define FIM_VID_VERSION "_fim_version" /* "[out,g:] fim version number; may be used for keeping compatibility of fim scripts across evolving versions." */ #define FIM_VID_FBFONT "_fbfont" /* "[out,g:] The current console font file string. If the internal hardcoded font has been used, then its value is \"" FIM_DEFAULT_HARDCODEDFONT_STRING "\"." */ #define FIM_VID_FBFMF "_fbfont_magnify_factor" /* "[in,g:] The rendered text will use a font magnified by this (integer) factor. Maximal value is \"" FIM_XSTRINGIFY(FIM_FONT_MAGNIFY_FACTOR_MAX) "\". (Only enabled if configured with --with-font-magnifying-factor=FACTOR, with FACTOR<1)." */ #define FIM_VID_FBAFS "_fbfont_as_screen_fraction" /* "[in,g:] The rendered text will be scaled at least to this (integer) fraction of the screen. Disable font autoscaling with -1. (Only enabled if configured with --with-font-magnifying-factor=FACTOR, with FACTOR<1)." */ #define FIM_VID_FB_VERBOSITY "_fbfont_verbosity" /* "[in,g:] if > 0, verbose font loading" */ #define FIM_VID_HSTEPS "_hsteps" /* "[in,g:] the default steps, in pixels, when panning images horizontally (overrides steps)." */ #define FIM_VID_VSTEPS "_vsteps" /* "[in,g:] the default steps, in pixels, when panning images vertically (overrides steps)." */ #define FIM_VID_CONSOLE_ROWS "_rows" /* "[in,g:] if >0, will set the number of displayed text lines in the console." */ #define FIM_VID_CONSOLE_LINE_WIDTH "_lwidth" /* "[in,g:] if>0, will force the output console text width." */ #define FIM_VID_CONSOLE_LINE_OFFSET "_console_offset" /* "[in,out,g:] position of the text beginning in the output console, expressed in lines." */ #define FIM_VID_CONSOLE_BUFFER_LINES "_console_lines" /* "[out,g:] the number of buffered output console text lines." */ #define FIM_VID_CONSOLE_BUFFER_TOTAL "_console_buffer_total" /* "[out,g:] amount of memory allocated for the output console buffer." */ #define FIM_VID_CONSOLE_BUFFER_FREE "_console_buffer_free" /* "[out,g:] amount of unused memory in the output console buffer." */ #define FIM_VID_CONSOLE_BUFFER_USED "_console_buffer_used" /* "[out,g:] amount of used memory in the output console buffer." */ #define FIM_VID_VERBOSE_KEYS "_verbose_keys" /* "[in,g:] if 1, after each interactive mode key hit, the console will display the hit key raw keycode." */ #define FIM_VID_CMD_EXPANSION "_command_expansion" /* "[in,g:] if 1, will enable autocompletion (on execution) of alias and command strings." */ #define FIM_VID_VERBOSE_ERRORS "_verbose_errors" /* "[in,g:] if 1, will display on stdout internal errors, while parsing commands." */ #define FIM_VID_VERBOSITY "_verbosity" /* "[in,experimental,g:] program verbosity." */ #define FIM_VID_CONSOLE_KEY "_console_key" /* "[in,g:] the key binding (an integer variable) for spawning the command line; will have precedence over any other binding." */ #define FIM_VID_IGNORECASE "_ignorecase" /* "[in,g:] if 1, will allow for case insensitive regexp-based match in autocommands (autocmd)." */ #define FIM_VID_RE_SEARCH_OPTS "_re_search_opts" /* "[in,g:] affects regexp-based searches; if an empty string, defaults will apply; if contains 'i' ('I'), case insensitive (sensitive) searches will occur; if contains 'b', will match on basename, if contains 'f' on full pathname." */ #define FIM_VID_SAVE_FIM_HISTORY "_save_fim_history" /* "[in,g:] if 1 on exit, will save the " FIM_CNS_HIST_COMPLETE_FILENAME " file on exit." */ #define FIM_VID_LOAD_FIM_HISTORY "_load_fim_history" /* "[in,g:] if 1 on startup, will load the " FIM_CNS_HIST_COMPLETE_FILENAME " file on startup." */ #define FIM_VID_TERM "_TERM" /* "[out,g:] the environment TERM variable." */ #define FIM_VID_NO_DEFAULT_CONFIGURATION "_no_default_configuration" /* "[in,g:] if 0, a default, hardcoded configuration will be executed at startup, after the minimal hardcoded one." */ #define FIM_VID_DISPLAY_STATUS_BAR "_display_status_bar" /* "[in,g:] if 1, will display the status bar." */ #define FIM_VID_DISPLAY_BUSY "_display_busy" /* "[in,g:] if 1, will display a message on the status bar when processing." */ #define FIM_VID_WANT_MIPMAPS "_use_mipmaps" /* "[in,g:] if >0, will use mipmaps to speed up downscaling of images (this has a memory overhead equivalent to one image copy); mipmaps will not be cached. If 2, will use every fourth source pixel instead of averaging (good for photos, not for graphs)." */ #define FIM_VID_EXIFTOOL "_use_exiftool" /* "[in,g:] if >0 and supported, exiftool will be used to get additional information. if 1, this will be appened to _comment; if 2, will go to " FIM_VID_EXIFTOOL_COMMENT "." */ #define FIM_VID_SCALE "scale" /* "[in,i:] the scale of the current image." */ #define FIM_VID_ASCALE "ascale" /* "[in,out,i:] the asymmetric scaling of the current image." */ #define FIM_VID_ANGLE "angle" /* "[in,out,i:] a floating point number specifying the rotation angle, in degrees." */ #define FIM_VID_ORIENTATION "_orientation" /* "[internal,i:] Orthogonal clockwise rotation (orientation) is controlled by: 'i:" FIM_VID_ORIENTATION "', 'g:" FIM_VID_ORIENTATION "' and applied on a per-image basis. In particular, the values of the three variables are summed up and the sum is interpreted as the image orientation. If the sum is 0, no rotation will apply; if it is 1, a single ( 90') rotation will apply; if it is 2, a double (180') rotation will apply; if it is 3, a triple (270') rotation will apply. If the sum is not one of 0,1,2,3, the value of the sum modulo 4 is considered. Therefore, \":i:" FIM_VID_ORIENTATION "=1\" and \":i:" FIM_VID_ORIENTATION "=5\" are equivalent: they rotate the image one time by 90'." */ #define FIM_VID_WIDTH "width" /* "[out,i:] the current image original width." */ #define FIM_VID_HEIGHT "height" /* "[out,i:] the current image original height." */ #define FIM_VID_SWIDTH "swidth" /* "[out,i:] the current image scaled width." */ #define FIM_VID_SHEIGHT "sheight" /* "[out,i:] the current image scaled height." */ #define FIM_VID_AUTOFLIP "_autoflip" /* "[in,g:] if 1, will flip images by default." */ #define FIM_VID_AUTONEGATE "_autonegate" /* "[in,g:] if 1, will negate images by default." */ #define FIM_VID_AUTODESATURATE "_autodesaturate" /* "[in,g:] if 1, will desaturate images by default." */ #if FIM_WANT_REMEMBER_LAST_FILE_LOADER #define FIM_VID_LAST_FILE_LOADER "_last_file_loader" /* "[out,g:] after each image load, " FIM_VID_LAST_FILE_LOADER " will be set to the last file loader used." */ #define FIM_VID_ALL_FILE_LOADERS "_all_file_loaders" /* "[out,g:] space-separated list of hardcoded file loaders usable with " FIM_VID_FILE_LOADER "." */ #endif /* FIM_WANT_REMEMBER_LAST_FILE_LOADER */ #define FIM_VID_FLIPPED "flipped" /* "[out,i:] 1, if the image is flipped." */ #define FIM_VID_NEGATED "negated" /* "[out,i:] 1, if the image is negated." */ #define FIM_VID_DESATURATED "desaturated" /* "[out,i:] 1, if the image is desaturated." */ #define FIM_VID_FIM_BPP "_fim_bpp" /* "[out,g:] the bits per pixel count." */ #define FIM_VID_AUTOMIRROR "_automirror" /* "[in,g:] if 1, will mirror images by default." */ #define FIM_VID_MIRRORED "mirrored" /* "[out,i:] 1, if the image is mirrored." */ #define FIM_VID_WANT_AUTOCENTER "_want_autocenter" /* "[in,g:] if 1, the image will be displayed centered." */ #define FIM_VID_MAX_CACHED_IMAGES "_max_cached_images" /* "[in,g:] the maximum number of images after which evictions will be forced. Setting this to 0 (no limits) is ok provided _max_cached_memory is set meaningfully." */ #define FIM_VID_MIN_CACHED_IMAGES "_min_cached_images" /* "[in,g:] the minimum number of images to keep from eviction; if less than four can lead to inefficiencies: e.g. when jumping between two images, each time an erase and a prefetch of neighboring images would trigger. default value is 4." */ #define FIM_VID_MAX_CACHED_MEMORY "_max_cached_memory" /* "[in,g:] the maximum amount of memory (in KiB) at which images will be continued being added to the cache. Setting this to 0 (no limit) will lead to a crash (there is no protection currently)." */ #define FIM_VID_CACHED_IMAGES "_cached_images" /* "[out,g:] the number of images currently cached." */ #define FIM_VID_SCREEN_WIDTH "_screen_width" /* "[out,g:] the screen width." */ #define FIM_VID_SCREEN_HEIGHT "_screen_height" /* "[out] the screen height." */ #define FIM_VID_SKIP_SCROLL "_scroll_skip_page_fraction" /* "[int,g:] if >1, fraction of page which will be skipped in when scrolling (e.g. 'scrollforward'); if 1, auto chosen; if <1, disabled." */ #define FIM_VID_DBG_AUTOCMD_TRACE_STACK "_autocmd_trace_stack" /* "[in,g:] dump to stdout autocommands (autocmd) stack trace during their execution (for debugging purposes)." */ #define FIM_VID_DBG_COMMANDS "_debug_commands" /* "[in,g:] debugging option string for printing out . if containing 'a', print out autocmd info; if containing 'c', print out each command; if containing 'k', print out each pressed key; if containing 'j', print interpreter internal steps; if containing 'B', clear screen and print background loading files; if containing 'C', print cache activity." */ #define FIM_VID_OPEN_OFFSET_L "_open_offset" /* "[in,optional,g:,i:] offset (specified in bytes) used when opening a file; [out] i:" FIM_VID_OPEN_OFFSET_L " will be assigned to images opened at a nonzero offset." */ #define FIM_VID_OPEN_OFFSET_U "_open_offset_retry" /* "[in,optional,g:] number of adjacent bytes to probe in opening the file." */ #define FIM_VID_SEEK_MAGIC "_seek_magic" /* "[optional,g:] will seek a 'magic' signature in the file after opening it, and will try decoding it starting within the range of that signature (use like this: fim -C '" FIM_VID_SEEK_MAGIC "=MAGIC_STRING;push filename')." */ #define FIM_VID_PREFERRED_RENDERING_WIDTH "_preferred_rendering_width" /* "[in,optional,g:] if >0, bit based rendering will use this value for a default document width (instead of a default value)." */ #define FIM_VID_PREFERRED_RENDERING_DPI "_preferred_rendering_dpi" /* "[in,optional,g:] if >0, pdf, ps, djvu rendering will use this value for a default document dpi (instead of a default value)." */ #define FIM_VID_PRELOAD_CHECKS "_push_checks" /* "[in,experimental,g:] if 1 (default), will check with stat() existence of input files before push'ing them (set this to 0 to speed up loading very long file lists; in these cases a trailing slash (/) will have to be used to tell fim a pathname is a directory). This only works after initialization (thus, after command line files have been push'ed); use --" FIM_OSW_NO_STAT_PUSH " if you wish to set this to 0 at command line files specification." */ /* * Fim Keyboard Keys Descriptions * */ #define FIM_KBD_TAB "Tab" #define FIM_KBD_ENTER "Enter" #define FIM_KBD_PAUSE "Pause" #define FIM_KBD_MENU "Menu" #define FIM_KBD_BACKSPACE "BackSpace" #define FIM_KBD_BACKSPACE_ "Backspace" #define FIM_KBD_SPACE " " #define FIM_KBD_DEL "Del" #define FIM_KBD_INS "Ins" #define FIM_KBD_HOME "Home" #define FIM_KBD_END "End" #define FIM_KBD_ANY "Any" #define FIM_KBD_ESC "Esc" #define FIM_KBD_LEFT "Left" #define FIM_KBD_RIGHT "Right" #define FIM_KBD_UP "Up" #define FIM_KBD_DOWN "Down" #define FIM_KBD_PAGEUP "PageUp" #define FIM_KBD_PAGEDOWN "PageDown" #define FIM_KBD_COLON ":" #define FIM_KBD_SEMICOLON ";" #define FIM_KBD_MOUSE_LEFT "MouseLeft" /* still unused */ #define FIM_KBD_MOUSE_RIGHT "MouseRight" /* still unused */ #define FIM_KBD_PLUS "+" #define FIM_KBD_MINUS "-" #define FIM_KBD_SLASH "/" #define FIM_KBD_ASTERISK "*" #define FIM_KBD_GT ">" #define FIM_KBD_LT "<" #define FIM_KBD_UNDERSCORE "_" #define FIM_KBD_F1 "F1" #define FIM_KBD_F2 "F2" #define FIM_KBD_F3 "F3" #define FIM_KBD_F4 "F4" #define FIM_KBD_F5 "F5" #define FIM_KBD_F6 "F6" #define FIM_KBD_F7 "F7" #define FIM_KBD_F8 "F8" #define FIM_KBD_F9 "F9" #define FIM_KBD_F10 "F10" #define FIM_KBD_F11 "F11" #define FIM_KBD_F12 "F12" /* * Fim Keyboard Keys Encodings * */ #define FIM_KKE_ENTER 10 #define FIM_KKE_ESC 27 #define FIM_KKE_BACKSPACE 127 #define FIM_KKE_LEFT 4479771 #define FIM_KKE_RIGHT 4414235 #define FIM_KKE_UP 4283163 #define FIM_KKE_DOWN 4348699 #define FIM_KKE_PAGE_UP 2117425947 #define FIM_KKE_PAGE_DOWN 2117491483 #define FIM_KKE_INSERT 2117229339 #define FIM_KKE_HOME 2117163803 #define FIM_KKE_END 2117360411 #define FIM_KKE_DEL 2117294875 #define FIM_KKE_F1 282 #define FIM_KKE_F2 283 #define FIM_KKE_F3 284 #define FIM_KKE_F4 285 #define FIM_KKE_F5 286 #define FIM_KKE_F6 287 #define FIM_KKE_F7 288 #define FIM_KKE_F8 289 #define FIM_KKE_F9 290 #define FIM_KKE_F10 291 #define FIM_KKE_F11 292 #define FIM_KKE_F12 293 /* * Fim Display Driver Names * Note: When adding a new driver, you shall update FIM_DDN_VARS as well. * p.s.: ICI = If Configured In * */ #define FIM_DDN_INN_FB "fb" #define FIM_DDN_VAR_FB "fb" #ifndef FIM_WITH_NO_FRAMEBUFFER #define FIM_DDN_ICI_FB "fb|" #else /* FIM_WITH_NO_FRAMEBUFFER */ #define FIM_DDN_ICI_FB "" #endif /* FIM_WITH_NO_FRAMEBUFFER */ #define FIM_DDN_INN_SDL "sdl" #define FIM_DDN_VAR_SDL "sdl" #ifdef FIM_WITH_LIBSDL #define FIM_DDN_ICI_SDL "sdl|" #else /* FIM_WITH_LIBSDL */ #define FIM_DDN_ICI_SDL "" #endif /* FIM_WITH_LIBSDL */ #define FIM_DDN_INN_IL2 "imlib2" #define FIM_DDN_VAR_IL2 "imlib2" #ifdef FIM_WITH_LIBIMLIB2 #define FIM_DDN_ICI_IL2 "imlib2|" #else /* FIM_WITH_LIBIMLIB2 */ #define FIM_DDN_ICI_IL2 "" #endif /* FIM_WITH_LIBIMLIB2 */ #define FIM_DDN_INN_AA "aa" #define FIM_DDN_VAR_AA "aa" #ifdef FIM_WITH_AALIB #define FIM_DDN_ICI_AA "aa|" #else /* FIM_WITH_AALIB */ #define FIM_DDN_ICI_AA "" #endif /* FIM_WITH_AALIB */ #define FIM_DDN_INN_CACA "ca" #define FIM_DDN_VAR_CACA "ca" #ifdef FIM_WITH_LIBCACA #define FIM_DDN_ICI_CACA "ca|" #else /* FIM_WITH_LIBCACA */ #define FIM_DDN_ICI_CACA "" #endif /* FIM_WITH_LIBCACA */ #define FIM_DDN_INN_DUMB "dumb" //#define FIM_DDN_VAR_DUMB "dummy" #define FIM_DDN_VAR_DUMB "dumb" #define FIM_DDN_VARS_NB FIM_DDN_INN_FB"|" FIM_DDN_INN_SDL "|" FIM_DDN_INN_CACA "|" FIM_DDN_INN_AA "|" FIM_DDN_INN_IL2 "|" FIM_DDN_INN_DUMB #define FIM_DDN_VARS "[" FIM_DDN_VARS_NB "]" #define FIM_DDN_VARS_IN "[" FIM_DDN_ICI_FB FIM_DDN_ICI_SDL FIM_DDN_ICI_CACA FIM_DDN_ICI_AA FIM_DDN_ICI_IL2 FIM_DDN_INN_DUMB "]" #define FIM_HELP_EXTRA_OPTS "s|d|l|m" /* * Fim Autocommands * FIXME: need autodocumentation for these. * */ //#define FIM_ACM_POSTSCREENRESIZE "PostScreenResize" /* "" */ //#define FIM_ACM_PRESCREENRESIZE "PreScreenResize" /* "" */ #define FIM_ACM_PRESCALE "PreScale" /* "" */ #define FIM_ACM_POSTSCALE "PostScale" /* "" */ #define FIM_ACM_PREPAN "PrePan" /* "" */ #define FIM_ACM_POSTPAN "PostPan" /* "" */ #define FIM_ACM_PREREDISPLAY "PreRedisplay" /* "" */ #define FIM_ACM_POSTREDISPLAY "PostRedisplay" /* "" */ #define FIM_ACM_PREDISPLAY "PreDisplay" /* "" */ #define FIM_ACM_POSTDISPLAY "PostDisplay" /* "" */ #define FIM_ACM_PREPREFETCH "PrePrefetch" /* "" */ #define FIM_ACM_POSTPREFETCH "PostPrefetch" /* "" */ #define FIM_ACM_PRERELOAD "PreReload" /* "" */ #define FIM_ACM_POSTRELOAD "PostReload" /* "" */ #define FIM_ACM_PRELOAD "PreLoad" /* "" */ #define FIM_ACM_POSTLOAD "PostLoad" /* "" */ #define FIM_ACM_PREGOTO "PreGoto" /* "" */ #define FIM_ACM_POSTGOTO "PostGoto" /* "" */ #define FIM_ACM_PRECONF "PreConfigLoading" /* "before loading any configuration file" */ #define FIM_ACM_POSTCONF "PostConfigLoading" /* "after loading any configuration file" */ #define FIM_ACM_PREHFIMRC "PreHardcodedConfigLoading" /* "before loading hardcoded configuration" */ #define FIM_ACM_POSTHFIMRC "PostHardcodedConfigLoading" /* "after loading hardcoded configuration" */ #define FIM_ACM_PREUFIMRC "PreUserConfigLoading" /* "before loading user configuration file" */ #define FIM_ACM_POSTUFIMRC "PostUserConfigLoading" /* "after loading user configuration file" */ #define FIM_ACM_PREGFIMRC "PreGlobalConfigLoading" /* "before loading global configuration file" */ #define FIM_ACM_POSTGFIMRC "PostGlobalConfigLoading" /* "after loading global configuration file" */ #define FIM_ACM_PREINTERACTIVECOMMAND "PreInteractiveCommand" /* "" */ #define FIM_ACM_POSTINTERACTIVECOMMAND "PostInteractiveCommand" /* "" */ #define FIM_ACM_PREEXECUTIONCYCLE "PreExecutionCycle" /* "" */ #define FIM_ACM_POSTEXECUTIONCYCLE "PostExecutionCycle" /* "" */ #define FIM_ACM_PREEXECUTIONCYCLEARGS "PreExecutionCycleArgs" /* "" */ #define FIM_ACM_PREWINDOW "PreWindow" /* "before a display reinit (after PreRedisplay)" */ #define FIM_ACM_POSTWINDOW "PostWindow" /* "after a display reinit (before PreRedisplay)" */ //#define FIM_ACM_PREROTATE "PreRotate" /* "" */ //#define FIM_ACM_POSTROTATE "PostRotate" /* "" */ /* * Fim Language Tokens * */ #define FIM_FLT_ALIAS "alias" /* not in vim */ #define FIM_FLT_ALIGN "align" /* not in vim */ #define FIM_FLT_AUTOCMD "autocmd" /* in vim */ #define FIM_FLT_AUTOCMD_DEL "autocmd_del" /* not in vim */ #define FIM_FLT_BIND "bind" /* not in vim */ #define FIM_FLT_BASENAME "basename" /* not in vim */ #define FIM_FLT_CD "cd" /* in vim */ #define FIM_FLT_CLEAR "clear" /* not in vim */ #define FIM_FLT_COLOR "color" /* not in vim */ #define FIM_FLT_COMMANDS "commands" /* not in vim */ #define FIM_FLT_CROP "crop" /* not in vim */ #define FIM_FLT_DISPLAY "display" /* in vim, with another meaning */ #define FIM_FLT_DUMP_KEY_CODES "dump_key_codes" /* not in vim */ #define FIM_FLT_DESC "desc" /* not in vim */ #define FIM_FLT_ECHO "echo" /* in vim */ #define FIM_FLT_ELSE "else" /* in vim */ #define FIM_FLT_EXEC "exec" /* not in vim */ #define FIM_FLT_EVAL "eval" /* not in vim */ #define FIM_FLT_FILE "file" /* in vim */ #define FIM_FLT_FONT "font" /* not in vim */ #define FIM_FLT_GETENV "getenv" /* not in vim */ #define FIM_FLT_GOTO "goto" /* in vim */ #define FIM_FLT_HELP "help" /* in vim */ #define FIM_FLT_IF "if" /* in vim */ #define FIM_FLT_INFO "info" /* not in vim */ #define FIM_FLT_LOAD "load" /* not in vim */ #define FIM_FLT_LIMIT "limit" /* not in vim */ #define FIM_FLT_LIST "list" /* not in vim */ #define FIM_FLT_PAN "pan" /* not in vim */ #define FIM_FLT_POPEN "popen" /* not in vim */ #define FIM_FLT_PREAD "pread" /* not in vim */ #define FIM_FLT_PREFETCH "prefetch" /* in vim */ #define FIM_FLT_PWD "pwd" /* in vim */ #define FIM_FLT_REDISPLAY "redisplay" /* not in vim */ #define FIM_FLT_RELOAD "reload" /* not in vim */ #define FIM_FLT_ROTATE "rotate" /* not in vim */ #define FIM_FLT_SCALE "scale" /* not in vim */ #define FIM_FLT_SCROLL "scroll" /* not in vim */ #define FIM_FLT_SET "set" /* in vim */ #define FIM_FLT_SET_INTERACTIVE_MODE "set_interactive_mode" /* not in vim */ #define FIM_FLT_SET_CONSOLE_MODE "set_commandline_mode" /* not in vim */ #define FIM_FLT_STATUS "status" /* not in vim */ #define FIM_FLT_STDERR "stderr" /* not in vim */ #define FIM_FLT_STDOUT "stdout" /* not in vim */ #define FIM_FLT_QUIT "quit" /* in vim */ #define FIM_FLT_RECORDING "recording" /* not in vim */ #define FIM_FLT_SYSTEM "system" /* not in vim */ #define FIM_FLT_SLEEP "sleep" /* in vim */ #define FIM_FLT_USLEEP "usleep" /* not in vim */ #define FIM_FLT_UNALIAS "unalias" /* not in vim */ #define FIM_FLT_UNBIND "unbind" /* not in vim */ #define FIM_FLT_VARIABLES "variables" /* not in vim */ #define FIM_FLT_WHILE "while" /* in vim */ #define FIM_FLT_WINDOW "window" /* not in vim */ /* composite commands or hardcoded aliases */ #define FIM_FLA_NEXT_FILE "next_file" /* not in vim */ // WAS: FIM_FLT_NEXT_PIC #define FIM_FLA_PREV_FILE "prev_file" /* not in vim */ // WAS: FIM_FLT_PREC_PIC #define FIM_FLA_NEXT_PAGE "next_page" /* not in vim */ #define FIM_FLA_PREV_PAGE "prev_page" /* not in vim */ #define FIM_FLA_NEXT "next" /* in vim */ #define FIM_FLA_PREV "prev" /* in vim */ #define FIM_FLA_MAGNIFY "magnify" /* not in vim */ #define FIM_FLA_REDUCE "reduce" /* not in vim */ #define FIM_FLC_NEXT "goto '+1'" /* in vim */ #define FIM_FLC_PREV "goto '-1'" /* in vim */ #define FIM_FLC_MIRROR "mirror" /* not in vim */ #define FIM_FLC_FLIP "flip" /* not in vim */ #define FIM_FLC_PAN_UP "pan 'up'" /* not in vim */ #define FIM_FLC_PAN_DOWN "pan 'down'" /* not in vim */ #define FIM_FLC_SCROLL_DOWN "pan 'down+'" /* not in vim */ #define FIM_FLC_SCROLL_UP "pan 'up-'" /* not in vim */ #define FIM_FLC_PAN_LEFT "pan 'left'" /* not in vim */ #define FIM_FLC_PAN_RIGHT "pan 'right'" /* not in vim */ #define FIM_FLC_NEXT_FILE "goto '+1f'" /* not in vim */ // WAS: FIM_FLT_NEXT_PIC #define FIM_FLC_PREV_FILE "goto '-1f'" /* not in vim */ // WAS: FIM_FLT_PREC_PIC #define FIM_FLC_NEXT_PAGE "goto '+1p'" /* not in vim */ #define FIM_FLC_PREV_PAGE "goto '-1p'" /* not in vim */ #define FIM_FLC_MAGNIFY "scale '+'" /* not in vim */ #define FIM_FLC_REDUCE "scale '-'" /* not in vim */ #define FIM_CMD_ACM_INFO(PREACM,POSTACM) FIM_CNS_CMDSEP "Executes autocommands for events " PREACM " and " POSTACM "." #define FIM_CNS_CMDSEP "\n" /* see CommandConsole::get_commands_reference() */ /* Help messages for Fim internal commands. */ #define FIM_CMD_HELP_ALIAS FIM_FLT_ALIAS " [" FIM_CNS_EX_ID_STRING " [" FIM_CNS_EX_CMDS_STRING " [" FIM_CNS_EX_DSC_STRING "]]]" FIM_CNS_CMDSEP "Without arguments, lists the current aliases." FIM_CNS_CMDSEP "With one, shows an identifier's assigned command." FIM_CNS_CMDSEP "With two, assigns to an identifier a user defined command or sequence of commands." FIM_CNS_CMDSEP "With three, also assigns a help string." #define FIM_CMD_HELP_ALIGN FIM_FLT_ALIGN " ['bottom'|'top'|'left'|right']: if image larger than drawing area, align one side of the image to the border." FIM_CNS_CMDSEP FIM_FLT_ALIGN " 'center': align equally far from all sides." FIM_CNS_CMDSEP FIM_FLT_ALIGN " 'info': print internal alignment information." #define FIM_CMD_HELP_AUTOCMD FIM_FLT_AUTOCMD " " FIM_CNS_EX_EVT_STRING " " FIM_CNS_EX_PAT_STRING " " FIM_CNS_EX_CMDS_STRING ": manipulate autocommands (inspired from Vim autocmd's)." FIM_CNS_CMDSEP "Without arguments, list autocommands." FIM_CNS_CMDSEP "With arguments, specifies for which type of event and which current file open, which commands to execute." FIM_CNS_CMDSEP "See the default built-in configuration files for examples." #define FIM_CMD_HELP_AUTOCMD_DEL FIM_FLT_AUTOCMD_DEL ": specify autocommands to delete." FIM_CNS_CMDSEP "Usage: " FIM_FLT_AUTOCMD_DEL " " FIM_CNS_EX_EVT_STRING " " FIM_CNS_EX_PAT_STRING " " FIM_CNS_EX_CMDS_STRING "." #define FIM_CMD_HELP_BASENAME FIM_FLT_BASENAME" {filename}: returns the basename of {filename} in the '" FIM_VID_LAST_CMD_OUTPUT "' variable." #define FIM_CMD_HELP_BIND FIM_FLT_BIND" [" FIM_CNS_EX_KSY_STRING " [" FIM_CNS_EX_CMDS_STRING "]]: bind a keyboard symbol/shortcut " FIM_CNS_EX_KSY_STRING " to " FIM_CNS_EX_CMDS_STRING "." FIM_CNS_CMDSEP FIM_CNS_RAW_KEYS_MESG FIM_CNS_CMDSEP "Key binding is dynamical, so you can rebind keys even during program's execution." FIM_CNS_CMDSEP "You can get a list of valid symbols (keysyms) by invoking " FIM_FLT_DUMP_KEY_CODES " or in the man page." #define FIM_CMD_HELP_LIST FIM_FLT_LIST ": display the files list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'random_shuffle': randomly shuffle the file list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'reverse': reverse the file list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'clear': clear the file list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort': sort the file list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort_basename': sort the file list according to base name." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort_comment': sort the file list according to the value of the " FIM_VID_COMMENT " variable." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort_var' " FIM_CNS_EX_VAR_STRING ": sort the file list according to the value of the i:" FIM_CNS_EX_VAR_STRING " variable." FIM_CNS_CMDSEP FIM_FLT_LIST " 'vars|variables': list variables in all i:* read from description file." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort_fsize': sort the file list according to file size." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort_mtime': sort the file list according to modification date. " FIM_CNS_CMDSEP FIM_FLT_LIST " 'pop': remove the current file from the files list, and step back." FIM_CNS_CMDSEP FIM_FLT_LIST " 'remove' [" FIM_CNS_EX_FNS_STRING "]: remove the current file, or the " FIM_CNS_EX_FNS_STRING ", if specified." FIM_CNS_CMDSEP FIM_FLT_LIST " 'push' " FIM_CNS_EX_FNS_STRING ": push " FIM_CNS_EX_FNS_STRING " to the back of the files list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'filesnum': display the number of files in the files list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'mark' [{args}]: mark image file names for stdout printing at exit, with {args} mark the ones matching according to the rules of the '" FIM_FLT_LIMIT "' command, otherwise the current file." FIM_CNS_CMDSEP FIM_FLT_LIST " 'unmark' [{args}]: unmark marked image file names, with {args} unmark the ones matching according to the rules of the '" FIM_FLT_LIMIT "' command, otherwise the current file." FIM_CNS_CMDSEP FIM_FLT_LIST " 'marked': show which files have been marked so far." FIM_CNS_CMDSEP FIM_FLT_LIST " 'dumpmarked': dump to stdout the marked files (you will want usually to 'unmarkall' afterwards)." FIM_CNS_CMDSEP FIM_FLT_LIST " 'markall': mark all the current list files." FIM_CNS_CMDSEP FIM_FLT_LIST " 'unmarkall': unmark all the marked files." FIM_CNS_CMDSEP FIM_FLT_LIST " 'pushdir' {dirname}: will push all the files in {dirname}, when matching the regular expression in variable " FIM_VID_PUSHDIR_RE " or, if empty, from constant regular expression '" FIM_CNS_PUSHDIR_RE "'." FIM_CNS_CMDSEP FIM_FLT_LIST " 'pushdirr' {dirname}: like pushdir, but will also push encountered directory entries recursively." FIM_CNS_CMDSEP FIM_FLT_LIST " 'swap': will move the current image filename to the first in the list (you'll have to invoke " FIM_FLT_RELOAD " to see the effect)." FIM_CNS_CMDSEP "Of the above commands, several will be temporarily non available for the duration of a background load (enabled by --" FIM_OSW_BGREC "), which will last until " FIM_VID_LOADING_IN_BACKGROUND " is 0." #define FIM_CMD_HELP_CLEAR FIM_FLT_CLEAR ": clear the virtual console." #define FIM_CMD_HELP_CROP \ FIM_FLT_CROP ": crop image to a centered rectangle, half the width and half the height.\n" \ FIM_FLT_CROP " {p}: crop image to the middle {p} horizontal percent and {p} vertical percent of the image.\n" \ FIM_FLT_CROP " {w} {h}: crop image to the middle {w} horizontal percent and {h} vertical percent of the image.\n" \ FIM_FLT_CROP " {x1} {y1} {x2} {y2}: crop image to the area between the upper left ({x1},{y1}) and lower right ({x2},{y2}) corner.\n"\ "Units are intended as percentage (0 to 100).\n" \ "Note: still experimental functionality." #define FIM_CMD_HELP_COMMANDS FIM_FLT_COMMANDS ": display the existing commands." #define FIM_CMD_HELP_COLOR \ FIM_FLT_COLOR " [desaturate]: desaturate the displayed image colors."\ FIM_CNS_CMDSEP FIM_FLT_COLOR " [negate]: negate the displayed image colors."\ FIM_CNS_CMDSEP FIM_FLT_COLOR " [colorblind|c|deuteranopia|d]: simulate a form of the deuteranopia color vision deficiency (cvd)."\ FIM_CNS_CMDSEP FIM_FLT_COLOR " [protanopia|p]: simulate a form of the protanopia cvd."\ FIM_CNS_CMDSEP FIM_FLT_COLOR " [tritanopia|t]: simulate a form of the tritanopia cvd."\ FIM_CNS_CMDSEP FIM_FLT_COLOR " [daltonize|D]: if following a cvd specification, will attempt correcting it."\ FIM_CNS_CMDSEP FIM_FLT_COLOR " [identity]: populate the image with 'RGB identity' pixels."\ FIM_CNS_CMDSEP "To get back the original you will have to reload the image." #define FIM_CMD_HELP_DUMP_KEY_CODES FIM_FLT_DUMP_KEY_CODES ": dump the active key codes (unescaped, for inspection purposes)." #define FIM_CMD_HELP_ECHO FIM_FLT_ECHO " " FIM_CNS_EX_ARGS_STRING ": print the " FIM_CNS_EX_ARGS_STRING " on console." #define FIM_CMD_HELP_ELSE FIM_CNS_IFELSE ": see " FIM_FLT_ELSE "." #define FIM_CMD_HELP_EXEC FIM_FLT_EXEC " " FIM_CNS_EX_FNS_STRING ": execute script " FIM_CNS_EX_FNS_STRING "." #define FIM_CMD_HELP_FONT \ FIM_FLT_FONT " 'scan' [{dirname}]: scan {dirname} or " FIM_LINUX_CONSOLEFONTS_DIR " looking for fonts in the internal fonts list."\ FIM_CNS_CMDSEP FIM_FLT_FONT " 'load' {filename}: load font {filename}."\ FIM_CNS_CMDSEP FIM_FLT_FONT " 'next'/'prev': load next/previous font in the internal fonts list."\ FIM_CNS_CMDSEP FIM_FLT_FONT " 'info': print current font filename." #define FIM_CMD_HELP_CD FIM_FLT_CD " " FIM_CNS_EX_PATH_STRING ": change the current directory to " FIM_CNS_EX_PATH_STRING "." FIM_CNS_CMDSEP "If " FIM_CNS_EX_PATH_STRING " is a file, use its base directory name." FIM_CNS_CMDSEP FIM_FLT_CD " '-' will change to the previous current directory (before the last ':" FIM_FLT_CD " " FIM_CNS_EX_PATH_STRING "' command)." #define FIM_CMD_HELP_GETENV FIM_FLT_GETENV " " FIM_CNS_EX_ID_STRING ": create a variable with the same value as the '" FIM_CNS_EX_ID_STRING "' environment variable, but with an identifier prefixed by 'ENV_'. So e.g. " FIM_FLT_GETENV " 'DISPLAY' creates 'ENV_DISPLAY'. Nothing is being printed; no variable is created if " FIM_CNS_EX_ID_STRING " is empty." #define FIM_CMD_HELP_IFELSE FIM_CNS_IFELSE ": see '" FIM_FLT_ELSE "'." #define FIM_CMD_HELP_INFO FIM_FLT_INFO ": display information about the current file." // #define FIM_CMD_HELP_LIMIT // missing #define FIM_CMD_HELP_LOAD FIM_FLT_LOAD ": load the image, if not yet loaded (see also '" FIM_FLT_RELOAD "')." FIM_CMD_ACM_INFO(FIM_ACM_PRELOAD,FIM_ACM_POSTLOAD) #define FIM_CMD_HELP_PAN \ FIM_FLT_PAN " {vsteps}% {hsteps}%: pan the image to {vsteps} percentage steps from the top and {hsteps} percentage steps from left. " FIM_CNS_CMDSEP \ FIM_FLT_PAN " {vsteps} {hsteps}: pan the image to {vsteps} pixels from the top and {hsteps} pixels from left. " FIM_CNS_CMDSEP \ FIM_FLT_PAN " {'down'|'up'|'left'|'right'|'ne'|'nw'|'se'|'sw'}[+-] [{steps}['%']]: pan the image {steps} pixels in the desired direction." FIM_CNS_CMDSEP "If the '%' specifier is present, {steps} will be treated as a percentage of current screen dimensions." FIM_CNS_CMDSEP "If {steps} is not specified, the '" FIM_VID_STEPS "' variable will be used." FIM_CNS_CMDSEP "If present, the '" FIM_VID_HSTEPS "' variable will be considered for horizontal panning." FIM_CNS_CMDSEP "A '+' or '-' sign at the end of the first argument will make jump to next or prev if border is reached." FIM_CNS_CMDSEP "If present, the '" FIM_VID_VSTEPS "' variable will be considered for vertical panning." FIM_CNS_CMDSEP "The variables may be terminated by the \'%\' specifier." FIM_CMD_ACM_INFO(FIM_ACM_PREPAN,FIM_ACM_POSTPAN) #define FIM_CMD_HELP_POPEN FIM_FLT_POPEN " " FIM_CNS_EX_SYSC_STRING ": pipe a command, invoking popen(): spawns a shell, invoking '" FIM_CNS_EX_SYSC_STRING "' and executing as fim commands the output of '" FIM_CNS_EX_SYSC_STRING "'." #define FIM_CMD_HELP_PREAD FIM_FLT_PREAD " " FIM_CNS_EX_ARGS_STRING ": execute " FIM_CNS_EX_ARGS_STRING " as a shell command and read the output as an image file (using '" FIM_FLT_POPEN "')." #define FIM_CMD_HELP_PREFETCH FIM_FLT_PREFETCH ": prefetch (read into the cache) the two nearby image files (next and previous), for a faster subsequent opening." FIM_CMD_ACM_INFO(FIM_ACM_PREPREFETCH,FIM_ACM_POSTPREFETCH) FIM_CNS_CMDSEP "See also the '" FIM_VID_WANT_PREFETCH "' variable." #define FIM_CMD_HELP_QUIT FIM_FLT_QUIT " [{number}]: terminate the program." FIM_CNS_CMDSEP "If {number} is specified, use it as the program return status." FIM_CNS_CMDSEP "Note that autocommand '" FIM_ACM_POSTINTERACTIVECOMMAND "' does not trigger after this command." #define FIM_CMD_HELP_RECORDING FIM_FLT_RECORDING " 'start': start recording the executed commands. " FIM_CNS_CMDSEP FIM_FLT_RECORDING " 'stop': stop recording the executed commands." FIM_CNS_CMDSEP FIM_FLT_RECORDING " 'dump': dump in the console the record buffer." FIM_CNS_CMDSEP FIM_FLT_RECORDING " 'execute': execute the record buffer." FIM_CNS_CMDSEP FIM_FLT_RECORDING " 'repeat_last': repeat the last performed action." #define FIM_CMD_HELP_REDISPLAY FIM_FLT_REDISPLAY ": re-display the current file contents." #define FIM_CMD_HELP_RELOAD FIM_FLT_RELOAD" [{arg}]: load the image into memory." FIM_CNS_CMDSEP "If {arg} is present, will force reloading, bypassing the cache (see also '" FIM_FLT_LOAD "')." FIM_CMD_ACM_INFO(FIM_ACM_PRERELOAD,FIM_ACM_POSTRELOAD) #define FIM_CMD_HELP_ROTATE FIM_FLT_ROTATE " " FIM_CNS_EX_NUM_STRING ": rotate the image the specified amount of degrees. If unspecified, by one. If you are interested in orthogonal rotations, see '" FIM_VID_ORIENTATION "' and related aliases." FIM_CMD_ACM_INFO(FIM_ACM_PRESCALE,FIM_ACM_POSTSCALE) #define FIM_CMD_HELP_SCROLL FIM_FLT_SCROLL ": scroll down the image, going next when hitting the bottom." FIM_CNS_CMDSEP FIM_FLT_SCROLL " 'forward': scroll the image as we were reading left to right (see '" FIM_VID_SKIP_SCROLL "' variable)." FIM_CMD_ACM_INFO(FIM_ACM_PREPAN,FIM_ACM_POSTPAN) #define FIM_CMD_HELP_SET_CONSOLE_MODE FIM_FLT_SET_CONSOLE_MODE ": set console mode." #define FIM_CMD_HELP_SET_INTERACTIVE_MODE FIM_FLT_SET_INTERACTIVE_MODE ": set interactive mode." #define FIM_CMD_HELP_SLEEP FIM_FLT_SLEEP " [" FIM_CNS_EX_NUM_STRING "=1]: sleep for the specified (default 1) number of seconds." #define FIM_CMD_HELP_STATUS FIM_FLT_STATUS ": set the status line to the collation of the given arguments." #define FIM_CMD_HELP_STDERR FIM_FLT_STDERR " " FIM_CNS_EX_ARGS_STRING ": writes to stderr its arguments " FIM_CNS_EX_ARGS_STRING "." #define FIM_CMD_HELP_STDOUT FIM_FLT_STDOUT " " FIM_CNS_EX_ARGS_STRING ": writes to stdout its arguments " FIM_CNS_EX_ARGS_STRING "." #define FIM_CMD_HELP_VARIABLES FIM_FLT_VARIABLES ": display the existing variables." #define FIM_CMD_HELP_UNALIAS FIM_FLT_UNALIAS " " FIM_CNS_EX_ID_STRING " | '-a': delete the alias " FIM_CNS_EX_ID_STRING " or all aliases (use '-a', not -a)." #define FIM_CMD_HELP_UNBIND FIM_FLT_UNBIND " " FIM_CNS_EX_KSY_STRING ": unbind the action associated to a specified " FIM_CNS_EX_KSY_STRING FIM_CNS_CMDSEP FIM_CNS_RAW_KEYS_MESG "" #define FIM_CMD_HELP_WHILE "while(expression){action;}: A conditional cycle construct." FIM_CNS_CMDSEP "May be interrupted by hitting the '" FIM_KBD_ESC "' or the '" FIM_KBD_COLON "' key." #define FIM_CMD_HELP_SET FIM_FLT_SET ": returns a list of variables which are set." FIM_CNS_CMDSEP FIM_FLT_SET " " FIM_CNS_EX_ID_STRING ": returns the value of variable " FIM_CNS_EX_ID_STRING "." FIM_CNS_CMDSEP FIM_FLT_SET " " FIM_CNS_EX_ID_STRING " " FIM_CNS_EX_CMDS_STRING ": sets variable " FIM_CNS_EX_ID_STRING " to value " FIM_CNS_EX_CMDS_STRING "." #define FIM_CMD_HELP_PWD FIM_FLT_PWD ": print the current directory name, and updates the '" FIM_VID_PWD "' variable." #define FIM_CMD_HELP_EVAL FIM_FLT_EVAL " " FIM_CNS_EX_ARGS_STRING ": evaluate " FIM_CNS_EX_ARGS_STRING " as commands, executing them." #define FIM_CMD_HELP_SYSTEM FIM_FLT_SYSTEM " " FIM_CNS_EX_SYSC_STRING ": get the output of executing the " FIM_CNS_EX_SYSC_STRING " system command. Uses the popen() system call. Usually popen invokes \"" FIM_CNS_SHELL " -c " FIM_CNS_EX_SYSC_STRING "\". This might not handle a multi-word command; in that case you will have to put it into a script. See 'man popen' for more." #if FIM_DISABLE_WINDOW_SPLITTING #define FIM_CMD_HELP_WINDOW FIM_FLT_WINDOW " " FIM_CNS_EX_ARGS_STRING ": this command is disabled." /*FIM_CNS_CMDSEP " It might be re-enabled in a future version."*/ #else /* FIM_DISABLE_WINDOW_SPLITTING */ #define FIM_CMD_HELP_WINDOW FIM_FLT_WINDOW " " FIM_CNS_EX_ARGS_STRING ": manipulates the window system windows; each value of " FIM_CNS_EX_ARGS_STRING " shall be one of ['split' | 'hsplit' | 'vsplit' | 'normalize' | 'enlarge' | 'venlarge' | 'henlarge' | 'up' | 'down' | 'left' | 'right' | 'close' | 'swap']." #endif /* FIM_DISABLE_WINDOW_SPLITTING */ #define FIM_CMD_HELP_GOTO FIM_FLT_GOTO " {['+'|'-']" FIM_CNS_EX_NUM_STRING "['%']['f'|'p'|'F'|'P']} | {/" FIM_CNS_EX_RE_STRING "/} | {" FIM_SYM_BW_SEARCH_KEY_STR FIM_CNS_EX_FN_STRING "} | {'+//'} | {'+/'|'-/'}[C] | {{'+'|'-'}" FIM_CNS_EX_ID_STRING "['+']}: jump to an image." FIM_CNS_CMDSEP "If " FIM_CNS_EX_NUM_STRING " is given, and not surrounded by any specifier, will go to image at index " FIM_CNS_EX_NUM_STRING "." FIM_CNS_CMDSEP "If followed by '%', the effective index will be computed as a percentage to the current available images." FIM_CNS_CMDSEP "If prepended by '-' or '+', the jump will be relative to the current index." FIM_CNS_CMDSEP "The 'f' specifier asks for the jump to occur within the files (same for 'F', but accelerates if keep pressing)." FIM_CNS_CMDSEP "The 'p' specifier asks for the jump to occur in terms of pages, within the current file (same for 'P', but accelerates if keep pressing)." FIM_CNS_CMDSEP "If /" FIM_CNS_EX_RE_STRING "/ is given, will jump to the first image matching the given /" FIM_CNS_EX_RE_STRING "/ regular expression pattern." FIM_CNS_CMDSEP "If the argument starts with " FIM_SYM_BW_SEARCH_KEY_STR ", jump to the filename following " FIM_SYM_BW_SEARCH_KEY_STR "." FIM_CNS_CMDSEP "If given '+//', will jump to the first different image matching the last given regular expression pattern." FIM_CNS_CMDSEP "With '+/'C or '-/'C will jump to next or previous file according to C: if 's' if same directory, if 'd' if down the directory hierarchy, if 'u' if down the directory hierarchy, if 'b' if same basename, if upper case match is negative, if missing defaults to 'S' (jump to file in different dir)." FIM_CNS_CMDSEP "If " FIM_CNS_EX_IDS_STRING " is encountered after a '+' or '-' sign, jump to next or previous image having a different value for any corresponding i:" FIM_CNS_EX_ID_STRING " (a trailing '+' will require a non empty value)." FIM_CNS_CMDSEP "Match will occur on both file name and description, possibly loaded via " FIM_FLT_DESC " or --" FIM_OSW_LOAD_IMG_DSC_FILE "; see also '" FIM_VID_LASTGOTODIRECTION "' and '" FIM_VID_RE_SEARCH_OPTS "'." FIM_CNS_CMDSEP " You can specify multiple arguments to " FIM_FLT_GOTO ": those after the first triggering a jump will be ignored." FIM_CMD_ACM_INFO(FIM_ACM_PREGOTO,FIM_ACM_POSTGOTO) " Keeping pressed shall accelerate images browsing." #define FIM_CMD_HELP_SCALE FIM_FLT_SCALE " {['+'|'-']{value}['%']|'*'{value}|'w'|'h'|'a'|'b'|'+[+-*/]'|['<'|'>']|'shadow'}: scale the image according to a scale {value} (e.g.: 0.5,40%,'w','h','a','b')." FIM_CNS_CMDSEP "If given '*' and a value, will multiply the current scale by that value." FIM_CNS_CMDSEP "If given 'w', will scale according to the screen width." FIM_CNS_CMDSEP "If given 'h', scale to the screen height." FIM_CNS_CMDSEP "If given 'a', to the minimum of 'w' and 'h'." FIM_CNS_CMDSEP "If given 'b', like 'a', provided that the image width exceeds 'w' or 'h'." FIM_CNS_CMDSEP "If {value} is a number, will scale relatively to the original image width." FIM_CNS_CMDSEP "If the number is followed by '%', the relative scale will be treated on a percent scale." FIM_CNS_CMDSEP "If given '++'('+-'), will increment (decrement) the '" FIM_VID_MAGNIFY_FACTOR "', '" FIM_VID_REDUCE_FACTOR "' variables by '" FIM_VID_SCALE_FACTOR_DELTA "'." FIM_CNS_CMDSEP "If given '+*'('+/'), will multiply (divide) the '" FIM_VID_MAGNIFY_FACTOR "', '" FIM_VID_REDUCE_FACTOR "' variables by '" FIM_VID_SCALE_FACTOR_MULTIPLIER "'." FIM_CNS_CMDSEP "If given '<' or '>', will shrink or magnify image using nearest mipmap (cached pre-scaled version). If given 'shadow' as a parameter, search a same-named file in one of the directories specified to --load-shadow-dir." FIM_CMD_ACM_INFO(FIM_ACM_PRESCALE,FIM_ACM_POSTSCALE) #define FIM_CMD_HELP_HELP FIM_FLT_HELP " [" FIM_CNS_EX_ID_STRING "]: provide online help, assuming " FIM_CNS_EX_ID_STRING " is a variable, alias, or command identifier." FIM_CNS_CMDSEP "If " FIM_CNS_EX_ID_STRING " begins with '" FIM_CNS_SLASH_STRING "', the search will be on the help contents and a list of matching items will be given instead." FIM_CNS_CMDSEP "A list of commands can be obtained simply invoking '" FIM_FLT_COMMANDS "'; a list of aliases with '" FIM_FLT_ALIAS "'; a list of bindings with '" FIM_FLT_BIND "'." #define FIM_FLT_HELP_DESC FIM_FLT_DESC " 'load' {filename} [{sepchar}]: load description file {filename}, using the optional {sepchar} character as separator." FIM_CNS_CMDSEP FIM_FLT_DESC " 'reload': load once again description files specified at the command line with --" FIM_OSW_LOAD_IMG_DSC_FILE ", with respective separators." FIM_CNS_CMDSEP FIM_FLT_DESC " ['-all'] ['-append'] ['-nooverw'] 'save' {filename} [{sepchar}]: save current list descriptions to file {filename}, using the optional {sepchar} character as separator, and if '-all' is present will save the variables, and if '-append' is present, will only append, and if '-nooverw' is present, will not overwrite existing files." FIM_CNS_CMDSEP "See documentation of --" FIM_OSW_LOAD_IMG_DSC_FILE " for the format of {filename}." #define FIM_FLT_HELP_DISPLAY FIM_FLT_DISPLAY " ['reinit' {string}]|'resize' {w} {h}]: display the current file contents." FIM_CNS_CMDSEP "If 'reinit' switch is supplied, the '{string}' specifier will be used to reinitialize (e.g.: change resolution, window system options) the display device." FIM_CNS_CMDSEP "See documentation for the --" FIM_OSW_OUTPUT_DEVICE " command line switch for allowed values of {string}." FIM_CNS_CMDSEP "If 'resize' and no argument, will ask the window manager to size the window like the image." FIM_CNS_CMDSEP "If 'resize' and two arguments, these will be used as width and height of window, to set." /* */ #define FIM_CNS_SLIDESHOW_CMD FIM_FLT_RELOAD "; i:fresh=1; while(" FIM_VID_FILEINDEX " <= " FIM_VID_FILELISTLEN "-" FIM_VID_LOOP_ONCE "){sleep " FIM_VID_WANT_SLEEPS "; next;} sleep " FIM_VID_WANT_SLEEPS "; " #define FIM_CNS_QUIET_CMD FIM_VID_DISPLAY_STATUS "=0;" FIM_VID_DISPLAY_BUSY "=0;" /* * Some Fim compilation defaults */ #define FIM_WANT_SDL_PROOF_OF_CONCEPT_MOUSE_SUPPORT 1 /* experimental mouse support in sdl mode */ #define FIM_WANT_SCREEN_KEY_REMAPPING_PATCH 1 #define FIM_WANT_OVERLY_VERBOSE_DUMB_CONSOLE 0 #define FIM_WANT_MILDLY_VERBOSE_DUMB_CONSOLE 1 #define FIM_WANT_SINGLE_SYSTEM_INVOCATION 1 #define FIM_WANT_SDL_OPTIONS_STRING 1 #define FIM_WANT_OUTPUT_DEVICE_STRING_CASE_INSENSITIVE 1 #define FIM_WANT_HISTORY 1 #define FIM_WANT_AVOID_FP_EXCEPTIONS 1 #define FIM_WANT_CAPTION_CONTROL 1 #define FIM_WANT_READLINE_CLEAR_WITH_ESC 1 #define FIM_WANT_DOUBLE_ESC_TO_ENTER 0 /* if enabled in the console mode, would require three presses the first time; two later on; this is non consistent, so we keep it disabled until we find a fix */ #define FIM_WANT_EXPERIMENTAL_PLUGINS 1 /* unfinished */ #define FIM_WANT_STDIN_FILELOAD_AFTER_CONFIG 1 #define FIM_WANT_KEEP_FILESIZE 1 #define FIM_WANT_DISPLAY_FILESIZE (FIM_WANT_KEEP_FILESIZE && 0) #define FIM_WANT_DISPLAY_MEMSIZE 0 #define FIM_WANT_APPROXIMATE_EXPONENTIAL_SCALING FIM_WANT_MIPMAPS && 1 #define FIM_WANT_R_SWITCH FIM_WITH_LIBSDL /* --resolution width:height switch (the fim way, differently from fbi's) */ #define FIM_WANT_RECURSE_FILTER_OPTION 1 /* Enable -R=... */ #define FIM_WANT_NOEXTPROPIPE 1 /* */ /* #define FIM_WANT_CUSTOM_INFO_STRING 1 */ #if defined(FIM_FRAMEBUFFER_DEVICE_H) && defined(FIM_WANT_FB_CONSOLE_SWITCH_WHILE_LOADING) /* only needed in Linux framebuffer device on computers loading files so slowly that we might want to switch console in between */ #define FIM_WANT_CONSOLE_SWITCH_WHILE_LOADING 1 #endif #define FIM_WANT_RELOAD_ON_FILE_CHANGE 1 /* detect file change and reload */ #define FIM_WANT_NEXT_ACCEL 1 /* keeping pressed accelerates browse speed */ #define FIM_STREAM_BUFSIZE 16*4096 #define FIM_MAXLINE_BUFSIZE 1024 #define FIM_PRINTFNUM_BUFSIZE 32 #define FIM_PRINTINUM_BUFSIZE 4*sizeof(fim_int) /* for fim_int */ #define FIM_METAINFO_BUFSIZE 256 #define FIM_EXIF_BUFSIZE FIM_METAINFO_BUFSIZE #define FIM_RL_COMPLETION_BUFSIZE 256 #define FIM_LIBERR_BUFSIZE 1024 #define FIM_LINUX_LINKFILENAME_BUFSIZE 64 #define FIM_STRING_BUFSIZE 4096 #define FIM_PIPE_BUFSIZE 1024 #define FIM_PIPE_CMD_BUFSIZE 1024 #define FIM_FILE_PROBE_BLKSIZE 512 #define FIM_CONSOLE_BLOCKSIZE 1024 #define FIM_CONSOLE_DEF_WIDTH 128 #define FIM_BITRENDERING_DEF_WIDTH 1024 #define FIM_DEFAULT_WINDOW_WIDTH 640 #define FIM_DEFAULT_WINDOW_HEIGHT 512 #define FIM_RENDERING_DPI 200 #define FIM_RENDERING_MAX_ROWS 1024 #define FIM_RENDERING_MAX_COLS 1024 #define FIM_CONSOLE_DEF_ROWS 24 #define FIM_VERBOSE_KEYS_BUFSIZE 64 #define FIM_FILE_BUF_SIZE (1024*256) #define FIM_ATOX_BUFSIZE (32) #define FIM_STATUSLINE_BUF_SIZE (2*128) #define FIM_IMG_DESC_ITEM_MAX_LEN (16*FIM_STATUSLINE_BUF_SIZE) #define FIM_FBI_PPM_LINEBUFSIZE (1024) #define FIM_LINUX_CONSOLEFONTS_DIR "/usr/share/consolefonts" #define FIM_LINUX_STDIN_FILE "/dev/stdin" #define FIM_LINUX_STDOUT_FILE "/dev/stdout" #define FIM_LINUX_RAND_FILE "/dev/urandom" #define FIM_FBDEV_FILE_MAX_CHARS 16 #define FIM_DEFAULT_FB_FILE "/dev/fb0" #define FIM_DEFAULT_AS_BINARY_BPP 24 #define FIM_DEFAULT_HARDCODEDFONT_STRING "fim://" #if __cplusplus < 201703L #define FIM_REGISTER register #else #define FIM_REGISTER #endif /* * Various Fim messages. */ #define FIM_MSG_CONSOLE_FIRST_LINE_BANNER "=== This is the fim output console. You can scroll it up and down. ===\n" #define FIM_MSG_CONSOLE_LONG_LINE "\n============================================================\n" /* * Some Fim internals flags. */ #define FIM_FLAG_MIRROR 1 #define FIM_FLAG_FLIP 2 #define FIM_FLAG_RGB2GRAY 4 #define FIM_FLAG_RGB2GRAYGRAYGRAY 8 /* FIM_XSTRINGIFY evaluates to a string with the supplied preprocessor symbol value */ #define FIM_XSTRINGIFY(X) FIM_STRINGIFY(X) /* FIM_STRINGIFY evaluates to a string with the supplied preprocessor symbol identifier */ #define FIM_STRINGIFY(X) #X #define FIM_MAN_Bn(X) ".B " X "\n.fi \n" /* bold newline */ #define FIM_MAN_fB(X) "\\fB" X "\\fP" /* bold inline */ #define FIM_MAN_fR(X) "\\fR\\fI" X "\\fR" #define FIM_MAN_iB "\\:" /* invisible break */ #endif /* FIM_FIM_H */ fim-0.6-rc2/src/DisplayDevice.h0000644000175000017500000001127314454347340013240 00000000000000/* $LastChangedDate: 2023-03-25 18:31:40 +0100 (Sat, 25 Mar 2023) $ */ /* DisplayDevice.h : virtual device Fim driver header file (c) 2008-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_DISPLAY_DEVICE_H #define FIM_DISPLAY_DEVICE_H #include "DebugConsole.h" class DisplayDevice #if FIM_WANT_BENCHMARKS : public Benchmarkable #endif /* FIM_WANT_BENCHMARKS */ { protected: fim_bool_t finalized_; #ifndef FIM_WANT_NO_OUTPUT_CONSOLE #ifndef FIM_KEEP_BROKEN_CONSOLE public: MiniConsole& mc_; #endif /* FIM_KEEP_BROKEN_CONSOLE */ #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ /* * The generalization of a Fim output device. */ public: struct fs_font *f_; const fim_char_t* fontname_; public: #ifndef FIM_WANT_NO_OUTPUT_CONSOLE DisplayDevice(MiniConsole& mc_); #else /* FIM_WANT_NO_OUTPUT_CONSOLE */ DisplayDevice(void); #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ virtual fim_err_t initialize(sym_keys_t &sym_keys)=0; virtual void finalize(void)=0; virtual fim_err_t display( const void *ida_image_img, // source image structure fim_coo_t iroff,fim_coo_t icoff, // row and column offset of the first input pixel fim_coo_t irows,fim_coo_t icols,// rows and columns in the input image fim_coo_t icskip, // input columns to skip for each line fim_coo_t oroff,fim_coo_t ocoff,// row and column offset of the first output pixel fim_coo_t orows,fim_coo_t ocols,// rows and columns to draw in output buffer fim_coo_t ocskip,// output columns to skip for each line fim_flags_t flags// some flags )=0; virtual ~DisplayDevice(void); virtual void flush(void){} virtual void lock(void){} virtual void unlock(void){} virtual fim_coo_t get_chars_per_line(void)const=0; virtual fim_coo_t get_chars_per_column(void)const=0; virtual fim_coo_t width(void)const=0; virtual fim_bpp_t get_bpp(void)const=0; virtual fim_coo_t height(void)const=0; virtual fim_coo_t status_line_height(void)const=0; virtual fim_coo_t font_height(void)const{return f_->sheight();} /* virtual fim_coo_t font_width(void)const{return 1;} */ virtual fim_err_t status_line(const fim_char_t *msg)=0; fim_err_t console_control(fim_cc_t code); virtual fim_bool_t handle_console_switch(void)=0; virtual fim_err_t clear_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2)=0; virtual fim_err_t fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t color)=0; virtual fim_sys_int get_input(fim_key_t * c, bool want_poll=false); virtual fim_key_t catchInteractiveCommand(fim_ts_t seconds)const; virtual fim_err_t format_console(void) FIM_FINAL; virtual void switch_if_needed(void){}// really, only for making happy fbdev virtual void cleanup(void){}// really, only for making happy fbdev protected: fim_redraw_t redraw_; /* expected to be FIM_REDRAW_UNNECESSARY after each display() */ public: virtual fim_bool_t need_redraw(void)const FIM_FINAL { return ( redraw_ != FIM_REDRAW_UNNECESSARY ); } virtual fim_err_t fs_puts(struct fs_font *f, fim_coo_t x, fim_coo_t y, const fim_char_t *str)=0; virtual fim_err_t fs_putc(struct fs_font *f, fim_coo_t x, fim_coo_t y, const fim_char_t c) FIM_FINAL; void fb_status_screen_new(const fim_char_t *msg, fim_bool_t draw, fim_flags_t flags);//experimental #if FIM_WANT_BENCHMARKS virtual fim_int get_n_qbenchmarks(void)const; virtual string get_bresults_string(fim_int qbi, fim_int qbtimes, fim_fms_t qbttime)const; virtual void quickbench_init(fim_int qbi); virtual void quickbench_finalize(fim_int qbi); virtual void quickbench(fim_int qbi); #endif /* FIM_WANT_BENCHMARKS */ private: virtual void console_switch(fim_bool_t is_busy){}// really, only for making happy fbdev virtual void clear_screen_locking(void) FIM_FINAL; public: virtual fim_err_t resize(fim_coo_t w, fim_coo_t h); virtual fim_err_t reinit(const fim_char_t *rs); virtual fim_err_t set_wm_caption(const fim_char_t *msg); virtual fim_coo_t suggested_font_magnification(const fim_coo_t wf, const fim_coo_t hf)const; void fs_multiline_puts(const char *str, fim_int doclear, int vw, int wh); }; #endif /* FIM_DISPLAY_DEVICE_H */ fim-0.6-rc2/src/AADevice.h0000644000175000017500000000740514454347340012116 00000000000000/* $LastChangedDate: 2022-10-03 16:04:49 +0200 (Mon, 03 Oct 2022) $ */ /* AADevice.h : aalib device Fim driver header file (c) 2008-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_AADEVICE_H #define FIM_AADEVICE_H #ifdef FIM_WITH_AALIB #include "DisplayDevice.h" #include /* * Debugging only! * */ #define FIM_AALIB_DRIVER_DEBUG 0 #define FIM_AALIB_FONT_HEIGHT 1 class AADevice FIM_FINAL:public DisplayDevice { int allow_windowed; private: aa_context *ascii_context_; //struct aa_renderparams *ascii_rndparms;//we rely on aa_defrenderparams struct aa_hardware_params ascii_hwparms_; struct aa_savedata ascii_save_; fim_char_t name_[2]; /* For ascii_save_.name */ public: #ifndef FIM_WANT_NO_OUTPUT_CONSOLE AADevice(MiniConsole& mc_, fim::string opts); #else /* FIM_WANT_NO_OUTPUT_CONSOLE */ AADevice( fim::string opts ); #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ virtual ~AADevice(void); virtual fim_err_t display( const void *ida_image_img, // source image structure (struct ida_image *)(but we refuse to include header files here!) //void* rgb,// destination gray array and source rgb array fim_coo_t iroff,fim_coo_t icoff, // row and column offset of the first input pixel fim_coo_t irows,fim_coo_t icols,// rows and columns in the input image fim_coo_t icskip, // input columns to skip for each line fim_coo_t oroff,fim_coo_t ocoff,// row and column offset of the first output pixel fim_coo_t orows,fim_coo_t ocols,// rows and columns to draw in output buffer fim_coo_t ocskip,// output columns to skip for each line fim_flags_t flags// some flags ) FIM_OVERRIDE; fim_err_t initialize(sym_keys_t &sym_keys)FIM_OVERRIDE ; void finalize(void)FIM_OVERRIDE ; fim_coo_t get_chars_per_line(void)const FIM_OVERRIDE ; fim_coo_t get_chars_per_column(void)const FIM_OVERRIDE ; fim_coo_t txt_width(void)const; fim_coo_t txt_height(void)const; fim_coo_t width(void)const FIM_OVERRIDE ; fim_coo_t height(void)const FIM_OVERRIDE ; fim_err_t status_line(const fim_char_t *msg) FIM_OVERRIDE ; //void status_screen(int desc,int draw_output){} fim_bool_t handle_console_switch(void) FIM_OVERRIDE { return false; } template fim_err_t clear_rect_( void* dst, fim_coo_t oroff,fim_coo_t ocoff, fim_coo_t orows,fim_coo_t ocols, fim_coo_t ocskip); fim_err_t clear_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1, fim_coo_t y2)FIM_OVERRIDE; fim_err_t fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t color) FIM_OVERRIDE; fim_err_t fs_puts(struct fs_font *f, fim_coo_t x, fim_coo_t y, const fim_char_t *str) FIM_OVERRIDE; void flush(void)FIM_OVERRIDE ; //fim_err_t format_console(void); fim_bpp_t get_bpp(void)const FIM_OVERRIDE { return 1; } fim_sys_int get_input(fim_key_t * c, bool want_poll=false) FIM_OVERRIDE; virtual fim_err_t reinit(const fim_char_t *rs) FIM_OVERRIDE; fim_err_t resize(fim_coo_t w, fim_coo_t h) FIM_OVERRIDE; virtual fim_coo_t status_line_height(void)const FIM_OVERRIDE; virtual fim_coo_t font_height(void)const FIM_OVERRIDE; }; #endif /* FIM_WITH_AALIB */ #endif /* FIM_AADEVICE_H*/ fim-0.6-rc2/src/Cache.cpp0000644000175000017500000004412314454347340012051 00000000000000/* $LastChangedDate: 2022-10-06 13:09:05 +0200 (Thu, 06 Oct 2022) $ */ /* Cache.cpp : Cache manager source file (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" /* #include */ #ifdef HAVE_SYS_TIME_H #include #else /* HAVE_SYS_TIME_H */ #include #endif /* HAVE_SYS_TIME_H */ #define FIM_CACHE_MIPMAP 1 #define FIM_CACHE_INSPECT 0 #if FIM_CACHE_INSPECT #define FIM_PR(X) printf("CACHE:%c:%20s:%s",X,__func__,getReport(FIM_CR_CD).c_str()); #else /* FIM_CACHE_INSPECT */ #define FIM_PR(X) #endif /* FIM_CACHE_INSPECT */ #define FIM_VERBOSE_CACHE 1 #ifdef FIM_VERBOSE_CACHE #define FIM_ALLOW_CACHE_DEBUG getGlobalVariable(FIM_VID_DBG_COMMANDS).find('C') >= 0 #else /* FIM_VERBOSE_CACHE */ #define FIM_ALLOW_CACHE_DEBUG 0 #endif /* FIM_VERBOSE_CACHE */ #if 0 #define FIM_LOUD_CACHE_STUFF FIM_PR(-10); FIM_LINE_COUT #else #define FIM_LOUD_CACHE_STUFF #endif #define FIM_VCBS(VI) ( sizeof(VI) + VI.size() * ( sizeof(vcachels_t::mapped_type) + sizeof(vcachels_t::key_type) ) ) /* TODO: maybe fim_basename_of is excessive ? */ extern CommandConsole cc; namespace fim { static fim_time_t fim_time(void) FIM_NOEXCEPT /* stand-alone function */ { #ifdef HAVE_SYS_TIME_H struct timeval tv; FIM_CONSTEXPR fim_time_t prec = 1000; /* fraction of second precision */ gettimeofday(&tv, FIM_NULL); return tv.tv_sec * prec + tv.tv_usec / ( 1000000 / prec ); #else /* HAVE_SYS_TIME_H */ return time(FIM_NULL); #endif /* HAVE_SYS_TIME_H */ } fim_time_t Cache::get_reltime(void)const { return fim_time()-time0_; } Cache::Cache(void) :Namespace(&cc) ,time0_(fim_time()) { FIM_LOUD_CACHE_STUFF; } int Cache::cached_elements(void)const { /* the count of cached images */ FIM_LOUD_CACHE_STUFF; return imageCache_.size(); } ImagePtr Cache::get_lru( bool unused )const { /* get the least recently used element. * if unused is true, only an unused image will be returned, _if any_*/ lru_t::const_iterator lrui; fim_time_t m_time(get_reltime()), l_time=0; ImagePtr l_img(FIM_NULL); cachels_t::const_iterator ci; FIM_LOUD_CACHE_STUFF; if ( cached_elements() < 1 ) goto ret; for( ci=imageCache_.begin();ci!=imageCache_.end();++ci) if( ci->second /* <- so we can call this function in some intermediate states .. */ && (l_time=last_used(ci->first)) < m_time && ( (! unused) || (used_image(ci->first)<=0) ) ) { l_img = ci->second; m_time = l_time; } ret: return l_img; } int Cache::free_some_lru(void) { /* * trigger deletion (and memory free) of cached elements * (a sort of garbage collector) */ FIM_LOUD_CACHE_STUFF; FIM_PR(' '); if ( cached_elements() < 1 ) return 0; return erase( get_lru(true) ); } int Cache::erase_clone(fim::ImagePtr oi) { /* erases the image clone from the cache */ FIM_LOUD_CACHE_STUFF; FIM_PR(' '); if(FIM_ALLOW_CACHE_DEBUG) std::cout << FIM_CNS_DBG_CMDS_PFX << "erasing clone " << fim_basename_of(oi->getName()) << "\n"; //cloneUsageCounter_.erase(oi); #if FIM_IMG_NAKED_PTRS delete oi; #else /* FIM_IMG_NAKED_PTRS */ // TBD #endif /* FIM_IMG_NAKED_PTRS */ clone_pool_.erase(oi); return 0; } bool Cache::need_free(void)const { /* whether we should free some cache .. */ /* struct mallinfo mi = mallinfo(); cout << "allocated : " << mi.uordblks << "\n"; if( mi.uordblks > getIntGlobalVariable(FIM_VID_MAX_CACHED_MEMORY) ) return true; */ const fim_int mci = getGlobalIntVariable(FIM_VID_MAX_CACHED_IMAGES); const fim_int mcm = getGlobalIntVariable(FIM_VID_MAX_CACHED_MEMORY); /* getIntGlobalVariable */ const size_t smcm = mcm > 0 ? mcm : 0; if( smcm > 0 && img_byte_size()/FIM_CNS_CSU > smcm ) goto rt; if(mci==-1) goto rf; /* return ( cached_elements() > ( ( mci>0)?mci:-1 ) ); */ if(mci > 0 && cached_elements() > mci) goto rt; rf: return false; rt: return true; } int Cache::used_image(cache_key_t key)const { FIM_LOUD_CACHE_STUFF; return ( usageCounter_.find(key)!=usageCounter_.end() ) ? (*(usageCounter_.find(key))).second : 0; } bool Cache::is_in_clone_cache(fim::ImagePtr oi)const { FIM_LOUD_CACHE_STUFF; if(!oi) return false; return ( clone_pool_.find(oi)!=clone_pool_.end() ) && ((*clone_pool_.find(oi)) == oi ); } bool Cache::is_in_cache(cache_key_t key)const { FIM_LOUD_CACHE_STUFF; return ( imageCache_.find(key)!=imageCache_.end() ) && ((*(imageCache_.find(key))).second!=FIM_NULL) ; } int Cache::prefetch(cache_key_t key) { int retval = 0; FIM_PR('*'); FIM_LOUD_CACHE_STUFF; if(is_in_cache(key)) { FIM_PR('c'); goto ret; } #if 0 if(need_free()) free_some_lru(); if(need_free()) { FIM_PR('f'); goto ret; /* skip prefetch if cache is full */ } #endif if(key.first == FIM_STDIN_IMAGE_NAME) { FIM_PR('s'); goto ret;// just a fix in the case the browser is still lame } if(FIM_ALLOW_CACHE_DEBUG) std::cout << FIM_CNS_DBG_CMDS_PFX << "cache prefetch req "<< key.first << "\n"; if( regexp_match(key.first.c_str(),FIM_CNS_ARCHIVE_RE,1) ) { /* FIXME: This is a hack. One shall determine unprefetchability othwerwise. */ FIM_PR('j'); goto ret; } if(!loadNewImage(key,0,true)) { retval = -1; if(FIM_ALLOW_CACHE_DEBUG) std::cout << FIM_CNS_DBG_CMDS_PFX << "loading failed\n"; goto ret; } else { FIM_PR('l'); } setGlobalVariable(FIM_VID_CACHED_IMAGES,cached_elements()); setGlobalVariable(FIM_VID_CACHE_STATUS,getReport()); ret: FIM_PR('.'); return retval; } ImagePtr Cache::loadNewImage(cache_key_t key, fim_page_t page, fim_bool_t delnc) { ImagePtr ni = FIM_NULL; FIM_PR('*'); FIM_LOUD_CACHE_STUFF; /* load attempt as alternative approach */ try { if( ( ni = ImagePtr( new Image(key.first.c_str(), FIM_NULL, page) ) ) ) { if(FIM_ALLOW_CACHE_DEBUG) std::cout << FIM_CNS_DBG_CMDS_PFX << "cache loaded "<cacheable() ) cacheNewImage( ni ); else if (delnc) // delete non cacheable { #if FIM_IMG_NAKED_PTRS delete ni; #else /* FIM_IMG_NAKED_PTRS */ // TBD #endif /* FIM_IMG_NAKED_PTRS */ ni = FIM_NULL; } } } catch(FimException e) { FIM_PR('E'); ni = FIM_NULL; /* not a big problem */ // if( e != FIM_E_NO_IMAGE )throw FIM_E_TRAGIC; /* hope this never occurs :P */ } FIM_PR(' '); return ni; } ImagePtr Cache::getCachedImage(cache_key_t key) { /* returns an image if already in cache. */ ImagePtr ni = FIM_NULL; FIM_LOUD_CACHE_STUFF; FIM_PR(' '); if( ( ni = this->imageCache_[key]) ) this->lru_touch(key); return ni; } bool Cache::cacheNewImage( fim::ImagePtr ni ) { FIM_LOUD_CACHE_STUFF; FIM_PR(' '); //if(FIM_ALLOW_CACHE_DEBUG) // std::cout << FIM_CNS_DBG_CMDS_PFX << "going to cache: "<< *ni /*<< " [" << ni << "]" */<< "\n"; this->imageCache_[ni->getKey()]=ni; lru_touch( ni->getKey() ); usageCounter_[ ni->getKey()]=0; // we don't assume any usage yet setGlobalVariable(FIM_VID_CACHED_IMAGES,cached_elements()); return true; } int Cache::erase(fim::ImagePtr oi) { /* erases the image from the cache */ int retval=-1; cache_key_t key; FIM_PR(' '); FIM_LOUD_CACHE_STUFF; if(!oi) goto ret; if( is_in_cache(key = oi->getKey()) ) { usageCounter_[key]=0; /* NOTE : the user should call usageCounter_.erase(key) after this ! */ if(FIM_ALLOW_CACHE_DEBUG) std::cout << FIM_CNS_DBG_CMDS_PFX << "cache erases "/*<< oi << " "*/ << oi->getName() /*<< " with timestamp " << lru_[oi->getKey()] */ << "\n"; //if(FIM_ALLOW_CACHE_DEBUG) // std::cout << FIM_CNS_DBG_CMDS_PFX << "erasing original " << fim_basename_of(oi->getName()) << "\n"; lru_.erase(key); imageCache_.erase(key); usageCounter_.erase(key); #if FIM_IMG_NAKED_PTRS delete oi; #else /* FIM_IMG_NAKED_PTRS */ // TBD #endif /* FIM_IMG_NAKED_PTRS */ setGlobalVariable(FIM_VID_CACHED_IMAGES,cached_elements()); retval = 0; } ret: return retval; } fim_time_t Cache::last_used(cache_key_t key)const { fim_time_t retval=0; FIM_LOUD_CACHE_STUFF; if(imageCache_.find(key)==imageCache_.end()) goto ret; if(lru_.find(key)==lru_.end()) goto ret; retval = lru_.find(key)->second; ret: return retval; } int Cache::lru_touch(cache_key_t key) { /* * if the specified file is cached, in this way it is marked as used, too. * the usage count is not affected, * */ FIM_LOUD_CACHE_STUFF; FIM_PR(' '); // std::cout << lru_[key] << " -> "; lru_[key]= get_reltime(); // std::cout << lru_[key] << "\n"; return 0; } bool Cache::freeCachedImage(ImagePtr image, const ViewportState *vsp, bool force) { /* * If the supplied image is cached as a master image of a clone, it is freed and deregistered. * If not, no action is performed. * */ FIM_LOUD_CACHE_STUFF; FIM_PR('*'); if( !image ) goto err; if(vsp) viewportInfo_[image->getKey()] = *vsp; if( is_in_clone_cache(image) ) { usageCounter_[image->getKey()]--; FIM_PR('c'); erase_clone(image); // we _always_ immediately delete clones setGlobalVariable(FIM_VID_CACHE_STATUS,getReport()); goto ret; } else if( is_in_cache(image->getKey()) ) { FIM_PR('-'); lru_touch( image->getKey() ); // we have been using it until now usageCounter_[image->getKey()]--; #if FIM_WANT_MIPMAPS if( getGlobalStringVariable(FIM_VID_CACHE_CONTROL).find('M') == 0 ) image->mm_free(); #endif /* FIM_WANT_MIPMAPS */ if( ( (usageCounter_[image->getKey()])==0 && image->getKey().second!=FIM_E_STDIN ) || force) { fim_int minci = getGlobalIntVariable(FIM_VID_MIN_CACHED_IMAGES); if ( minci < 1 ) minci = 4; #if 0 if( need_free() && image->getKey().second!=FIM_E_STDIN ) { cache_key_t key = image->getKey(); this->erase( image ); usageCounter_.erase(key); } #else if(FIM_ALLOW_CACHE_DEBUG && force) std::cout << FIM_CNS_DBG_CMDS_PFX << "cache forced to free "<getName()<<"\n"; if( ( need_free() && cached_elements() > minci ) || force ) { ImagePtr lrui; if(force) lrui = image; else lrui = get_lru(true); FIM_PR('o'); if( lrui ) { cache_key_t key = lrui->getKey(); if( ( FIM_VCBS(viewportInfo_) > FIM_CNS_VICSZ ) || force ) viewportInfo_.erase(key); if(( key.second != FIM_E_STDIN )) { this->erase( lrui ); } } // missing usageCounter_.erase().. } #endif } setGlobalVariable(FIM_VID_CACHE_STATUS,getReport()); goto ret; } err: FIM_PR('.'); return false; ret: FIM_PR('.'); return true; } ImagePtr Cache::useCachedImage(cache_key_t key, ViewportState *vsp, fim_page_t page) { /* * Shall rename to get(). * * The caller invokes this member function to obtain an Image object pointer. * If the object is cached and it already used, a clone is built and returned. * * If we have an unused master copy, we return that. * * Then declare this image as used and increase a relative counter. * * A freeImage action will do the converse operation (and delete). * If the image is not already cached, it is loaded, if possible. * * So, if there is no such image, FIM_NULL is returned * */ ImagePtr image = FIM_NULL; FIM_LOUD_CACHE_STUFF; FIM_PR('*'); if(FIM_ALLOW_CACHE_DEBUG) std::cout << FIM_CNS_DBG_CMDS_PFX << "cache check for"<< ( key.second == FIM_E_FILE ? " file ": " stdin ")<cacheable()) goto ret; // we keep it but don't cache it usageCounter_[key]=1; } else // is_in_cache(key) { image = getCachedImage(key);// in this way we update the LRU cache :) if(!image) { if(FIM_ALLOW_CACHE_DEBUG) std::cout << FIM_CNS_DBG_CMDS_PFX << "critical internal cache error!\n"; goto done; } if( used_image( key ) ) { // if the image was already used, cloning occurs try { //ImagePtr oi=image; image = ImagePtr ( new Image(*image) ); // cloning if(FIM_ALLOW_CACHE_DEBUG) std::cout << FIM_CNS_DBG_CMDS_PFX << " cloned image: \"" <getName())<< "\" "<< image << "\n"; //std::cout << " cloned image: \"" <getName())<< "\" "<< image << " from \""<getName()) <<"\" " << oi << "\n"; } catch(FimException e) { FIM_PR('E'); /* we will survive :P */ image = FIM_NULL; /* we make sure no taint remains */ // if( e != FIM_E_NO_IMAGE )throw FIM_E_TRAGIC; /* hope this never occurs :P */ } if(!image) goto ret; //means that cloning failed. clone_pool_.insert(image); // we have a clone //cloneUsageCounter_[image]=1; } #if FIM_WANT_MIPMAPS if( getGlobalStringVariable(FIM_VID_CACHE_CONTROL).find('M') == 0 ) image->mm_make(); #endif /* FIM_WANT_MIPMAPS */ lru_touch( key ); // if loading and eventual cloning succeeded, we count the image as used of course usageCounter_[key]++; } done: setGlobalVariable(FIM_VID_CACHE_STATUS,getReport()); ret: if(vsp && image) { *vsp = viewportInfo_[image->getKey()]; /* *vsp = viewportInfo_[key]; */ } FIM_PR('.'); return image; } ImagePtr Cache::setAndCacheStdinCachedImage(ImagePtr image) { /* Cache an image coming from stdin (that is, not reloadable). * */ const cache_key_t key(FIM_STDIN_IMAGE_NAME,FIM_E_STDIN); FIM_LOUD_CACHE_STUFF; FIM_PR('*'); if(!image) goto ret; try { image = ImagePtr ( new Image(*image) ); // cloning if(image) cacheNewImage( image ); } catch(FimException e) { FIM_PR('E'); /* we will survive :P */ image = FIM_NULL; /* we make sure no taint remains */ // if( e != FIM_E_NO_IMAGE )throw FIM_E_TRAGIC; /* hope this never occurs :P */ } if(!image) goto ret; //means that cloning failed. setGlobalVariable(FIM_VID_CACHE_STATUS,getReport()); ret: return image; //so, it could be a clone.. } fim::string Cache::getReport(int type)const { /* TODO: rename to info(). */ std::ostringstream cache_report; if(type == FIM_CR_CN || type == FIM_CR_CD) { fim_char_t buf[FIM_PRINTFNUM_BUFSIZE]; const fim_int mci = getGlobalIntVariable(FIM_VID_MAX_CACHED_IMAGES); fim_int mcm = getGlobalIntVariable(FIM_VID_MAX_CACHED_MEMORY); mcm = mcm >= 0 ? mcm*FIM_CNS_CSU:0; cache_report << " " << "count:" << cached_elements() << "/" << mci << " occupation:"; fim_snprintf_XB(buf, sizeof(buf), img_byte_size()); cache_report << buf << "/"; fim_snprintf_XB(buf, sizeof(buf), mcm); cache_report << buf << " "; for(ccachels_t::const_iterator ci=usageCounter_.begin();ci!=usageCounter_.end();++ci) if( ( type == FIM_CR_CD && ( imageCache_.find(ci->first) != imageCache_.end() ) ) || ( type == FIM_CR_CN && ( imageCache_.find(ci->first) != imageCache_.end() && ci->second) ) ) { cache_report << fim_basename_of((*ci).first.first) << ":"; cache_report << (*ci).second << ":"; fim_snprintf_XB(buf, sizeof(buf), imageCache_.find(ci->first)->second->byte_size()); cache_report << buf << "@" << last_used(ci->first) << " "; } cache_report << "\n"; goto ret; } cache_report << "cache contents : \n"; FIM_LOUD_CACHE_STUFF; #if 0 cachels_t::const_iterator ci; for( ci=imageCache_.begin();ci!=imageCache_.end();++ci) { cache_report << ((*ci).first) << " " << fim::string(usageCounter_[((*ci).first)]) << "\n"; } #else for(ccachels_t::const_iterator ci=usageCounter_.begin();ci!=usageCounter_.end();++ci) { cache_report<<((*ci).first.first) <<":" <<((*ci).first.second) <<" ,usage:" <<((*ci).second) <<"\n"; } cache_report << "clone pool contents : \n"; for(std::set< fim::ImagePtr >::const_iterator cpi=clone_pool_.begin();cpi!=clone_pool_.end();++cpi) { cache_report << fim_basename_of((*cpi)->getName()) <<" " #if FIM_IMG_NAKED_PTRS << string((int*)(*cpi)) #else /* FIM_IMG_NAKED_PTRS */ << ((int*)((*cpi).get())) #endif /* FIM_IMG_NAKED_PTRS */ <<","; } cache_report << "\n"; #endif ret: return cache_report.str(); } Cache::~Cache(void) { cachels_t::const_iterator ci; FIM_LOUD_CACHE_STUFF; for( ci=imageCache_.begin();ci!=imageCache_.end();++ci) if(ci->second) { if(FIM_ALLOW_CACHE_DEBUG) std::cout << FIM_CNS_DBG_CMDS_PFX << "cache frees " << (ci->first.first) << "\n"; #if FIM_IMG_NAKED_PTRS delete ci->second; #else /* FIM_IMG_NAKED_PTRS */ // TBD #endif /* FIM_IMG_NAKED_PTRS */ } imageCache_.clear(); /* destroy Image objects */ } size_t Cache::img_byte_size(void)const { size_t bs = 0; cachels_t::const_iterator ci; FIM_LOUD_CACHE_STUFF; for( ci=imageCache_.begin();ci!=imageCache_.end();++ci) if(ci->second) bs += ci->second->byte_size(); return bs; } size_t Cache::byte_size(void)const { size_t bs = 0; cachels_t::const_iterator ci; FIM_LOUD_CACHE_STUFF; bs += img_byte_size(); bs += sizeof(*this); bs += FIM_VCBS(viewportInfo_); /* bs += sizeof(usageCounter_); TODO: incomplete ... */ return bs; } void Cache::touch(cache_key_t key) { FIM_PR('*'); getCachedImage(key); FIM_PR('.'); } void Cache::desc_update(void) { #if FIM_WANT_PIC_CMTS cachels_t::const_iterator ci; FIM_LOUD_CACHE_STUFF; for( ci=imageCache_.begin();ci!=imageCache_.end();++ci) if(ci->second) ci->second->desc_update(); #endif /* FIM_WANT_PIC_CMTS */ } } /* namespace */ fim-0.6-rc2/src/testdir/0000755000175000017500000000000014503655326012075 500000000000000fim-0.6-rc2/src/testdir/test21.in0000644000175000017500000000041714454347340013470 00000000000000# A test for command basename. alias 'dump' "stdout _last_cmd_output; stdout '*';"; basename '/'; dump; basename '/path'; dump; basename '/path/'; dump; basename '/path/to'; dump; basename '/path/to/'; dump; basename '/path/to/foo'; dump; basename '/path/to/foo/'; dump; fim-0.6-rc2/src/testdir/test2.ok0000644000175000017500000000055314454347340013413 00000000000000integer variables evaluation works negated integer variables evaluation works double negated integer variables evaluation works triply negated integer variables evaluation works integer variables comparison works integer variables to expression comparison works integer variables works integer variables self inequality works basic integer variables test success fim-0.6-rc2/src/testdir/test15.in0000644000175000017500000000045214454347340013472 00000000000000# Recording test. stdout "this test checks recording capabilities."; stdout "it is unfinished, as recording is only supported for interactive usage."; #_debug_commands='c'; #start_recording; #stdout "you are recording, aren't you?"; #stop_recording; #execute_record_buffer; #do_dump_record_buffer; fim-0.6-rc2/src/testdir/Makefile0000644000175000017500000000315114454347340013454 00000000000000# # Makefile to run all tests for Fim (Vim-styled!) # BASE=../../ FIMPROG = $(BASE)/src/fim # Uncomment this line for using valgrind. # The output goes into a file "valgrind.$PID" (sorry, no test number). # VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --log-file=valgrind.log SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out test7.out test8.out test9.out test10.out test11.out test12.out test13.out test14.out test15.out test16.out test17.out test18.out test19.out test20.out test21.out test22.out .SUFFIXES: .in .out nongui: nolog $(SCRIPTS) @echo @cat test.log @! grep FAILED test.log @echo "[*] ALL DONE" $(SCRIPTS): $(FIMPROG) clean: -rm -rf *.out *.failed *.rej *.orig test.log tiny.fim small.fim mbyte.fim test.ok X* valgrind.pid* fiminfo .in.out: -rm -rf $*.failed test.ok test.out X* fiminfo cp $*.ok test.ok # Sleep a moment to avoid that the xterm title is messed up @-sleep .2 -$(VALGRIND) $(FIMPROG) -o dumb -c "quit;" -X -N --no-etc-fimrc-file --no-history -E $*.in $(BASE)/media/*jpg $(BASE)/media/fim.png $(BASE)/media/image.png > test.out # -$(VALGRIND) $(FIMPROG) -u unix.fim -U NONE --noplugin -s dotest.in $*.in @/bin/sh -c "if test -f test.out; then\ if diff $*.ok test.out; \ then mv -f test.out $*.out; \ else echo $* FAILED >>test.log; head -n 1 $*.in >>test.log; mv -f test.out $*.failed; \ fi \ else echo $* NO OUTPUT >>test.log; \ fi" -rm -rf X* test.ok fiminfo nolog: -echo Test results: >test.log fim-0.6-rc2/src/testdir/test1.ok0000644000175000017500000000047314454347340013413 00000000000000if construct seems working if construct seems working equality works disequality works basic integer arithmetics works basic integer arithmetics works basic integer bitwise OR works basic integer bitwise OR works basic integer bitwise AND works basic integer bitwise AND works basic integer arithmetic test success fim-0.6-rc2/src/testdir/test14.ok0000644000175000017500000000051014454347340013467 00000000000000this test will break if user configuration breaks in. so it is temporary :) #executing: echo 'ciao' #executing: goto '+1' #executing: reload #executing: getenv 'DISPLAY' #executing: redisplay #executing: scale 'b' #executing: reload #executing: getenv 'DISPLAY' #executing: redisplay #executing: scale 'b' #executing: quit fim-0.6-rc2/src/testdir/test20.in0000644000175000017500000000102714454347340013465 00000000000000# A test for the help system (will fail if using pre-C++11). # Its results need update on each help system update. alias 'dump' "stdout _last_cmd_output; stdout '*';"; echo "A test for the help system"; dump; help ''; dump; help '-'; dump; help '-h'; dump; help '--'; dump; help '--help'; dump; # #help 'commands'; #dump; commands; dump; # #help 'alias'; #dump; alias; dump; # #help 'variables'; #dump; variables; dump; # # need also something like: #variables 'g:'; #dump; #variables 'i:'; #dump; # #help 'bind'; #dump; bind; dump; # fim-0.6-rc2/src/testdir/test4.in0000644000175000017500000000042314454347340013406 00000000000000 stdout "tab in expressions works"; stdout "newline in expressions works"; if ( 1==1 ) { stdout "multiline" " and multiarg constructs ". "work" } else { stdout "multiline and multiarg constructs don't work." ; quit -1; } stdout "muiltiline and tab-based test success"; fim-0.6-rc2/src/testdir/test4.ok0000644000175000017500000000020414454347340013406 00000000000000tab in expressions works newline in expressions works multiline and multiarg constructs work muiltiline and tab-based test success fim-0.6-rc2/src/testdir/test9.in0000644000175000017500000000050514454347340013414 00000000000000# greatest common divisor autocmd "" "" ""; unalias "-a"; # this test (and 11,13 too) gives a pipe error when /dev/zero is fed as stdin to fim alias 'gcd' 'stdout "gcd(".p.",".q.")";stdout p;stdout q;while(p>q){p=p-q;if(p1){stdout "at least one file in the list.";} if(_filelistlen<1){stdout "probable problems with file browser.";quit 1;} while(_filelistlen>1){list "pop";} stdout _filelistlen; stdout "browser test ok."; fim-0.6-rc2/src/testdir/test13.ok0000644000175000017500000000006214454347340013470 00000000000000at least one file in the list. 1 browser test ok. fim-0.6-rc2/src/testdir/test5.in0000644000175000017500000000144214454347340013411 00000000000000if( "aba"."a"=="a"."ba"."a" ){stdout "string collation comparison works";} else {stdout "string collation comparison does not work"; quit -1;} if( "aba"!="a"."sba"."a" ){stdout "string collation inequality works";} else {stdout "string collation inequality does not work"; quit -1;} if( "aba"=~"a.*a" ){stdout "regular expressions operator works";} else {stdout "regular expressions operator does not work"; quit -1;} if( !("aba"=~"a.*a") ) {stdout "single negations on regular expressions don't work"; quit -1;} else {stdout "single negations on regular expressions work";} # the following doesn't work in fim 0.3. if( !(!("aba"=~"a.*a")) ){stdout "double negations on regular expressions work";} else {stdout "double negations on regular expressions don't work"; } stdout "string test success"; fim-0.6-rc2/src/testdir/test15.ok0000644000175000017500000000016114454347340013472 00000000000000this test checks recording capabilities. it is unfinished, as recording is only supported for interactive usage. fim-0.6-rc2/src/testdir/test16.in0000644000175000017500000000052214454347340013471 00000000000000# Directory load test. stdout "this is a minimal test case for directory load capability"; #stdout _filelistlen; #stdout offl; offl=_filelistlen; list "pushdir" "../../media"; #stdout _filelistlen; if(_filelistlen==ofll) { stdout "no new file loaded ?"; } if(_filelistlen!=offl) { stdout "some files loaded: ok"; } stdout "end of test"; fim-0.6-rc2/src/testdir/test7.in0000644000175000017500000000467214454347340013423 00000000000000# This script tests auto width scaling capabilities of fim. autocmd "" "" ""; alias "toggleAutoWidth" "i:autowidth=1-i:autowidth;g:auto_scale_v=0;reload;"; load; display; # after load, images should have no relationship to screeen width: stdout "i:width==i:swidth :".(i:width==i:swidth); stdout "i:height==i:sheight:".(i:height==i:sheight); if(1==0) { stdout "i:width :" .i:width; stdout "i:swidth :".i:swidth; stdout "i:height :".i:height; stdout "i:sheight:".i:sheight; } i:autowidth=0; #stdout "ii"; #i:autowidth=1; #stdout i:autowidth; #stdout i:autowidth; #stdout "ii"; toggleAutoWidth; stdout "i:autowidth=".i:autowidth." (should be 1)"; #stdout "ia:"; #toggleAutoWidth; #stdout i:autowidth; reload; display; #magnify; reload; #if(0) #{ # stdout _screen_width; # stdout i:swidth; # stdout _screen_height; # stdout i:sheight; #}; # scaled_width= ((i:width *scale)/100.0); # aalib ascale not handled here scaled_height=((i:height*scale)/100.0); if(scaled_height<1) scaled_height=1; # fix for dumb driver if(_device_string=="aalib") { scaled_width=scaled_width*2; } #stdout "_screen_width==i:swidth._screen_width:".(_screen_width==i:swidth); #stdout "_screen_height==i:sheight :".(_screen_height==i:sheight); #stdout "_screen_height="._screen_height." != i:sheight=".i:sheight." "; #stdout "_screen_height="._screen_height." != i:sheight=".scaled_height." "; #stdout "_screen_width="._screen_width." != i:swidth=".scaled_width." "; #stdout " _screen_width="._screen_width." should equal scaled_width=".scaled_width." "; #stdout "_screen_height="._screen_height." should equal scaled_height=".scaled_height." "; #if ( (scaled_width!=i:swidth) || (scaled_height!=i:sheight) ) if ( i:swidth > 2.0 ) { if ( (scaled_width!=i:swidth) || (scaled_height!=i:sheight) ) { stdout "[!]"; stdout "something went wrong..."; stdout "scaled_height:".scaled_height; stdout "scaled_width :".scaled_width; stdout "sheight :".i:sheight; stdout "swidth :".i:swidth; stdout "_screen_height:"._screen_height; stdout "_screen_width :"._screen_width; stdout "i:height :".i:height; stdout "i:width :".i:width; stdout "i:scale :".i:scale; stdout "g:scale :".g:scale; stdout "scale :".scale; } } else { stdout "auto scaling test ok"; } # auto height scaling test missing #stdout _screen_height==i:sheight; rc=0; if ( i:swidth > 2.0 ) if(_screen_width!=i:swidth)stdout "PLEASE FINISH WRITING THIS TEST"; #quit rc; fim-0.6-rc2/src/testdir/test22.ok0000644000175000017500000000113214454347340013467 00000000000000* loaded 3 files ../..//media/image.jpg ../..//media/fim.png ../..//media/image.png * * before reloads #cache check for file ../..//media/image.jpg #cache does not have ../..//media/image.jpg #cache loaded ../..//media/image.jpg * between reloads #cache forced to free ../..//media/image.jpg #cache erases ../..//media/image.jpg #cache check for file ../..//media/image.jpg #cache does not have ../..//media/image.jpg #cache loaded ../..//media/image.jpg * after reloads #cache check for file ../..//media/image.jpg #cache frees ../..//media/image.jpg fim-0.6-rc2/src/testdir/test19.ok0000644000175000017500000000035514454347340013503 00000000000000_console_buffer_total:131072 _console_buffer_free:131072 _console_buffer_use:0 _console_buffer_total:131072 _console_buffer_free:131072 _console_buffer_use:0 _console_buffer_total:131072 _console_buffer_free:131072 _console_buffer_use:0 fim-0.6-rc2/src/testdir/test11.in0000644000175000017500000000030214454347340013460 00000000000000# While loop test. stdout "square root algorithm computation with the babylonian method"; s="256.0"; r=s/2; #stdout r s; stdout r*r==s; while(r*r!=s){r=r/2+s/(2*r);} #stdout r s; stdout r*r==s; fim-0.6-rc2/src/testdir/test8.ok0000644000175000017500000000112414454347340013414 00000000000000* loaded 3 files #'next' testing: 3 2 #'goto' testing: 2 3 1 #'goto' testing first/last: 1 3 1 3 #'goto' testing percent: 1 2 3 #'goto' testing percent, with file specifier: 1 2 3 #'goto' testing percent, with page specifier: 3 3 3 #'goto' testing + relative file jump: 1 2 3 2 1 3 3 3 3 #'goto' testing - relative file jump: 2 1 3 1 2 3 3 3 3 #'goto' testing + relative page jump: 3 3 3 3 3 3 3 3 3 #'goto' testing - relative page jump: 3 3 3 3 3 3 3 3 3 #'goto ?' testing #../..//media/image.png #../..//media/image.jpg 3 1 #'goto //' and 'goto +// testing 1 1 1 1 2 3 2 3 #'goto' testing done fim-0.6-rc2/src/testdir/test8.in0000644000175000017500000000414114454347340013413 00000000000000# This script tests file browsing capabilities. stdout "* loaded "._filelistlen." files"; sep="#"; autocmd "" "" ""; alias "sn" "stdout _filename;"; alias "sf" "stdout _fileindex;"; #alias "u" "load;reload;i:fresh=1;display;redisplay;"; #alias "u" "load;reload;i:fresh=1;display;redisplay;"; alias "U" "reload;redisplay;magnify;reload;"; alias "u" "U;next '1';"; #alias "sf" "stdout _fileindex;sn;"; alias "n" "next 1;u;"; #alias "n" "next 1;sleep 1;"; stdout sep."'next' testing:"; #list; stdout _last_cmd_output; n; sf; n; sf; stdout sep."'goto' testing:"; goto 1;U;ffn=_filename; goto 1;u; sf; goto 2;u; sf; goto 3;u; sf; stdout sep."'goto' testing first/last:"; goto '^'; sf; goto '$'; sf; goto 'f'; sf; goto 'l'; sf; stdout sep."'goto' testing percent:"; goto '0%'; sf; goto '50%'; sf; goto '100%'; sf; stdout sep."'goto' testing percent, with file specifier:"; goto '0%f'; sf; goto '50%f'; sf; goto '100%f'; sf; stdout sep."'goto' testing percent, with page specifier:"; goto '0%p'; sf; goto '50%p'; sf; goto '100%p'; sf; stdout sep."'goto' testing + relative file jump:"; goto '+1f'; sf; goto '+1f'; sf; goto '+1f'; sf; goto '+2f'; sf; goto '+2f'; sf; goto '+2f'; sf; goto '+3f'; sf; goto '+3f'; sf; goto '+3f'; sf; stdout sep."'goto' testing - relative file jump:"; goto '-1f'; sf; goto '-1f'; sf; goto '-1f'; sf; goto '-2f'; sf; goto '-2f'; sf; goto '-2f'; sf; goto '-3f'; sf; goto '-3f'; sf; goto '-3f'; sf; stdout sep."'goto' testing + relative page jump:"; goto '+1p'; sf; goto '+1p'; sf; goto '+1p'; sf; goto '+2p'; sf; goto '+2p'; sf; goto '+2p'; sf; goto '+3p'; sf; goto '+3p'; sf; goto '+3p'; sf; stdout sep."'goto' testing - relative page jump:"; goto '-1p'; sf; goto '-1p'; sf; goto '-1p'; sf; goto '-2p'; sf; goto '-2p'; sf; goto '-2p'; sf; goto '-3p'; sf; goto '-3p'; sf; goto '-3p'; sf; stdout sep."'goto ?' testing"; stdout sep.""._filename; stdout sep."".ffn; goto '?'._filename;U; sf; goto '?'.ffn;U; sf; stdout sep."'goto //' and 'goto +// testing"; goto '/jpg/'; sf; goto '/jpg/'; sf; goto '+//'; sf; goto '+//'; sf; goto '/png/'; sf; goto '/png/'; sf; goto '+//'; sf; goto '+//'; sf; stdout sep."'goto' testing done"; fim-0.6-rc2/src/testdir/test10.in0000644000175000017500000000073514454347340013471 00000000000000# Scoped variables test. # we need an image in order for i: scoped variables to work load; display; reload; redisplay; stdout "-------------------"; a=77777; stdout a; stdout "-------------------"; stdout g:a; stdout "-------------------"; g:a=77778; stdout g:a; stdout "-------------------"; stdout a; stdout "-------------------"; i:a=99999; stdout i:a; stdout "-------------------"; # b: v: are not active anymore # b:a=99999; # stdout b:a; # stdout "-------------------"; fim-0.6-rc2/src/testdir/test3.ok0000644000175000017500000000100114454347340013401 00000000000000float variables evaluation works negated float variables evaluation works negated negated float variables evaluation works triply negated float variables evaluation work float variables to constant comparison works float variables to negated constant inequality works float variables to triply negated constant inequality works double negated float to constant variables comparison works float variables to constant comparison works float variables to constant inequality works basic float variables test success fim-0.6-rc2/src/testdir/test22.in0000644000175000017500000000040214454347340013463 00000000000000# A test for 'reload' stdout "* loaded "._filelistlen." files"; alias 'dump' "stdout _last_cmd_output; stdout '*';"; list; dump; _debug_commands='Cl'; stdout "* before reloads"; reload ''; stdout "* between reloads"; reload ''; stdout "* after reloads"; # fim-0.6-rc2/src/testdir/test12.ok0000644000175000017500000000006214454347340013467 00000000000000* loaded 3 files asymmetric scaling test 1 0 1 0 fim-0.6-rc2/src/testdir/test18.ok0000644000175000017500000000002614454347340013475 00000000000000"contents" 'contents' fim-0.6-rc2/src/testdir/test21.ok0000644000175000017500000000003614454347340013470 00000000000000 * path * * to * * foo * * fim-0.6-rc2/src/testdir/test3.in0000644000175000017500000000324014454347340013405 00000000000000fv=2.1; if ( fv ) { stdout "float variables evaluation works"; } else { stdout "float variables evaluation doesn't work"; quit -1; } if ( !fv ) { stdout "negated float variables evaluation doesn't work"; quit -1; } else { stdout "negated float variables evaluation works"; } if ( !!fv ) { stdout "negated negated float variables evaluation works"; } else { stdout "negated negated float variables evaluation doesn't work"; quit -1; } if ( !!!fv ) { stdout "triply negated float variables evaluation doesn't work"; quit -1; } else { stdout "triply negated float variables evaluation work"; } if ( fv == "0.0" ) { stdout "float variables to constant comparison doesn't work"; quit -1; } else { stdout "float variables to constant comparison works"; } if ( ! ( fv != "0.0" ) ) { stdout "float variables to negated constant inequality doesn't work"; quit -1; } else { stdout "float variables to negated constant inequality works"; } if ( !!! ( fv != "0.0" ) ) { stdout "float variables to triply negated constant inequality doesn't work"; quit -1; } else { stdout "float variables to triply negated constant inequality works"; } if ( !! ( fv == "0.0" ) ) { stdout "double negated float to constant variables comparison doesn't work"; quit -1; } else { stdout "double negated float to constant variables comparison works"; } if ( fv == "2.1" ) { stdout "float variables to constant comparison works"; } else { stdout "float variables to constant comparison doesn't work"; quit -1; } if ( fv != "3.0" ) { stdout "float variables to constant inequality works"; } else { stdout "float variables to constant inequality doesn't work"; quit -1; } stdout "basic float variables test success"; fim-0.6-rc2/src/testdir/test6.ok0000644000175000017500000000024514454347340013415 00000000000000{command} constructs work {command;} constructs work {command;;} constructs work please note that the 'quit' command is still untested command blocking test success fim-0.6-rc2/src/testdir/test12.in0000644000175000017500000000075614454347340013476 00000000000000# scaling and aalib test. stdout "* loaded "._filelistlen." files"; autocmd "" "" ""; #_autocmd_trace_stack=1; stdout "asymmetric scaling test"; load; i:ascale=1; i:scale=2; magnify; reduce; display; #stdout i:width; #stdout i:swidth; stdout i:swidth==i:width; stdout i:swidth==2*i:width; stdout ""; i:ascale=2; i:scale=2; if(_device_string=="aalib") { ascale=ascale*2; } # see src/fimrc's aalib specific lines magnify; reduce; display; stdout i:swidth==2*i:width; stdout i:swidth==i:width; fim-0.6-rc2/src/testdir/test20.ok0000644000175000017500000001461414454347340013476 00000000000000 * help {identifier}: provides help for {identifier}, if it is a variable, alias, key, or command. Use Tab in commandline mode to get a list of aliases and commands. Command line mode can be entered with the default key ':', and left pressing Enter. * The short command options of fim are: -a -b -c -C -d -E -f -F -h -k -K -D -S -i -m -N -p -o -P -s -t -T -u -v -V -w -= -H -W -L - -A -q -r -R -X -B -/ -1 "-" key is bound to command: reduce * -h is a fim command line option: -h[s|d|l|m], --help[=s|d|l|m] Print program invocation help, and exit. Depending on the option, output can be: short, descriptive, long from man, or complete man. If further arguments follow, individual help messages will be shown instead. * The long command options of fim are: --autozoom --binary --as-text --cd-and-readdir --execute-commands --execute-commands-early --device --dump-reference-help --dump-default-fimrc --execute-script --etc-fimrc --final-commands --help --keysym-press --chars-press --load-image-descriptions-file --image-descriptions-file-separator --image-from-stdin --mark-from-image-descriptions-file --mode --no-rc-file --no-etc-fimrc-file --no-internal-config --no-commandline --no-history-save --no-history-load --no-history --script-from-stdin --output-device --offset --pread-cmd --text-reading --scroll --slideshow --sanity-check --no-framebuffer --vt --reverse --sort --sort-basename --sort-mtime --sort-fsize --random --random-no-seed --verbose --verbose-load --verbose-font-load --verbose-interpreter --version --autowidth --no-auto-scale --autowindow --no-stat-push --autoheight --write-scriptout --read-from-file --read-from-stdin --read-from-stdin-elds --autotop --quiet --resolution --recursive --no-pipe-load --background-recursive --load-shadow-directory --/ --// --once * --help is a fim command line option: -h[s|d|l|m], --help[=s|d|l|m] Print program invocation help, and exit. Depending on the option, output can be: short, descriptive, long from man, or complete man. If further arguments follow, individual help messages will be shown instead. * alias align autocmd autocmd_del basename bind cd clear commands color crop desc display dump_key_codes echo else eval exec font getenv goto help if info limit list load pan popen pread prefetch pwd quit recording redisplay reload rotate scale scroll set set_commandline_mode set_interactive_mode sleep status stderr stdout system variables unalias unbind while window * * _TERM _all_file_loaders _cache_control _command_expansion _console_buffer_free _console_buffer_total _console_buffer_used _console_key _console_lines _console_offset _debug_commands _device_string _display_as_binary _display_busy _display_console _display_status _display_status_fmt _downscale_huge_at_load _fbfont _filelistlen _fim_bpp _fim_default_config_file_contents _fim_default_grammar_file_contents _fim_version _ignorecase _info_fmt_str _last_cmd_output _load_default_etc_fimrc _load_fim_history _max_cached_images _max_cached_memory _max_iterated_commands _min_cached_images _no_external_loader_programs _no_rc_file _push_checks _push_pushes_dirs _pwd _re_search_opts _save_fim_history _scale_style _screen_height _screen_width _scroll_skip_page_fraction _steps _sys_rc_file _use_mipmaps _verbose_keys _want_exif_orientation _want_prefetch _want_wm_caption_status _want_wm_mouse_ctrl allow_round_scroll ascale console_scroll_n _orientation angle ascale desaturated negated scale * bind "C-a" "if(_scale_style!='a'){_scale_style='a';scale 'a';}else{_scale_style='';scale '100%';}" # scale to height bind "C-b" "goto '-//'" bind "C-e" "recording 'execute'" bind "C-g" "system 'fbgrab' 'fim_'._device_string.'.png'" bind "C-h" "help" bind "Tab" "toggleVerbosity" bind "Enter" "list 'mark';goto _lastgotodirection" bind "C-k" "crop" # 0 bind "C-m" "list 'mark'" bind "C-n" "goto '+//'" bind "C-p" "goto '-//'" bind "C-r" "reload ''" bind "C-w" "if(_scale_style!='w'){_scale_style='w';scale 'w';}else{_scale_style='';scale '100%';}" # scale to width bind "C-x" "recording 'execute'" bind "Esc" "quit" bind " " "scroll 'forward'" bind '"' "scale 'shadow';i:fresh=1;redisplay;" bind "$" "$;" bind "'" "goto _lastfileindex" bind "(" "goto '^p'" bind ")" "goto '$p'" bind "*" "_display_console=0;toggleVerbosity;echo i:*" bind "+" "magnify" bind "," "_display_console=1;echo _last_system_output" bind "-" "reduce" bind "." "recording 'repeat_last'" bind "<" "rotate10_ccw;display" bind "=" "scale '100%'" bind ">" "rotate10;display" bind "A" "A" bind "B" "toggleDisplayBusy" bind "D" "diagonal_se" bind "E" "recording 'execute'" bind "F" "fliponce" bind "G" "toggleDesaturate" bind "H" "scale 'H'" bind "I" "toggleautonegate" bind "K" "if(_display_console==0){echo i:_filename.": ".i:_comment;toggleVerbosity}else{toggleVerbosity;}" bind "M" "mirroronce" bind "N" "next10" bind "P" "prev10" bind "Q" "recording 'stop'" bind "R" "rotate270" bind "S" "toggleDisplayStatus" bind "W" "display 'resize'" # if supported, resizes the window to match the current image pixels size bind "X" "diagonal_sw" bind "Y" "narrow" # shrink horizontally the image bind "Z" "sleep 1" bind "[" "font_reduce;redisplay" bind "]" "font_magnify;redisplay" bind "^" "0;" bind "_" "_scale_style='';scale '100%'" bind "`" "toggleLimitMarked" bind "a" "scale 'a'" bind "b" "prev" bind "c" "align "center"" bind "d" "diagonal_nw" bind "f" "flip" bind "g" "color 'desaturate';redisplay" bind "h" "pan_left" bind "i" "color 'negate';redisplay" bind "j" "pan_down" bind "k" "pan_up" bind "l" "pan_right" bind "m" "mirror" bind "n" "goto '+1f'" bind "o" "sort" bind "p" "goto '-1f'" bind "q" "quit" bind "r" "rotate90" bind "t" "align 'top'" bind "u" "list 'unmark'" bind "v" "toggleDisplayStatus" bind "w" "scale 'w'" bind "x" "diagonal_ne" bind "y" "widen" # widen horizontally the image bind "{" "font "prev";redisplay" bind "|" "toggle_font_auto_scale;redisplay" bind "}" "font "next";redisplay" bind "F5" "refresh" bind "F11" "if(_device_string=='sdl' && !_fullscreen){_old_sw=_screen_width;_old_sh=_screen_height;display 'reinit' 'mW0:0';_fullscreen=1;}else if(_device_string=='sdl' && _old_sw*_old_sh*_fullscreen){display 'reinit' 'rwm'._old_sw.':'._old_sh;_fullscreen=0;}" # Toggles full screen. Will show mouse cursor in full screen. bind "Up" "pan_up" bind "Down" "pan_down" bind "Right" "pan_right" bind "Left" "pan_left" bind "Home" "0;" bind "Del" "list 'remove';reload" bind "End" "$;" bind "PageUp" "if(_display_console==0){prev;}else{scu;}" bind "PageDown" "if(_display_console==0){next;}else{scd;}" * fim-0.6-rc2/src/Imlib2Device.h0000644000175000017500000000755114454347340012755 00000000000000/* $LastChangedDate: 2017-07-20 11:03:15 +0200 (Thu, 20 Jul 2017) $ */ /* Imlib2Device.h : Imlib2 device Fim driver header file (c) 2011-2017 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_IMLIB2DEVICE_H #define FIM_IMLIB2DEVICE_H #ifdef FIM_WITH_LIBIMLIB2 #include "DisplayDevice.h" #include #include class Imlib2Device FIM_FINAL:public DisplayDevice { private: XEvent ev_; Imlib_Updates updates_, current_update_; Imlib_Image buffer_; fim_coo_t current_w_; fim_coo_t current_h_; Imlib_Image image;// FIXME: -> tmpimage int w, h, text_w, text_h; // FIXME: temporary vals bool want_windowed_; bool want_mouse_display_; bool want_resize_; static const fim_coo_t border_height_=1; public: #ifndef FIM_WANT_NO_OUTPUT_CONSOLE Imlib2Device(MiniConsole& mc_, #else /* FIM_WANT_NO_OUTPUT_CONSOLE */ Imlib2Device( #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ fim::string opts ); virtual fim_err_t display( const void *ida_image_img, // source image structure (struct ida_image *)(but we refuse to include header files here!) //void* rgb,// destination gray array and source rgb array fim_coo_t iroff,fim_coo_t icoff, // row and column offset of the first input pixel fim_coo_t irows,fim_coo_t icols,// rows and columns in the input image fim_coo_t icskip, // input columns to skip for each line fim_coo_t oroff,fim_coo_t ocoff,// row and column offset of the first output pixel fim_coo_t orows,fim_coo_t ocols,// rows and columns to draw in output buffer fim_coo_t ocskip,// output columns to skip for each line fim_flags_t flags// some flags ); fim_err_t initialize(sym_keys_t &sym_keys); fim_err_t il2_initialize(void); void finalize(void) ; fim_coo_t get_chars_per_line(void)const ; fim_coo_t get_chars_per_column(void)const; fim_coo_t width(void)const; fim_coo_t height(void)const; fim_err_t status_line(const fim_char_t *msg); fim_bool_t handle_console_switch(void){return false;} fim_err_t clear_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2); fim_sys_int get_input(fim_key_t * c, bool want_poll=false); virtual fim_key_t catchInteractiveCommand(fim_ts_t seconds)const; void fs_render_fb(fim_coo_t x, fim_coo_t y, FSXCharInfo *charInfo, fim_byte_t *data); fim_err_t fs_puts(struct fs_font *f_, fim_coo_t x, fim_coo_t y, const fim_char_t *str); void flush(void); void lock(void); void unlock(void); fim_bpp_t get_bpp(void)const; virtual fim_coo_t status_line_height(void)const; private: fim_sys_int get_input_i2l(fim_key_t * c); /* TEMPORARY */ void status_screen_(int desc,int draw_output){ return ; } fim_err_t fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t color); fim_coo_t txt_width(void)const; fim_coo_t txt_height(void)const; virtual fim_err_t resize(fim_coo_t w, fim_coo_t h); private: bool allowed_resolution(fim_coo_t w, fim_coo_t h); virtual fim_err_t reinit(const fim_char_t *rs); fim_err_t parse_optstring(const fim_char_t *os); virtual fim_err_t set_wm_caption(const fim_char_t *msg); fim_err_t reset_wm_caption(void); protected: void toggle_fullscreen(void); void apply_fullscreen(void); }; #endif /* FIM_WITH_LIBIMLIB2 */ #endif /* FIM_IMLIB2DEVICE_H */ fim-0.6-rc2/src/FbiStuffPpm.cpp0000644000175000017500000001164114454347340013232 00000000000000/* $LastChangedDate: 2022-10-30 16:13:52 +0100 (Sun, 30 Oct 2022) $ */ /* FbiStuffPpm.cpp : fbi functions for PPM files, modified for fim (c) 2008-2022 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #include #include #include #include //#include "loader.h" #include "fim.h" #include "FbiStuffLoader.h" #ifdef USE_X11 #include "viewer.h" #endif /* USE_X11 */ /* ---------------------------------------------------------------------- */ /* load */ namespace fim { struct ppm_state { FILE *infile; int width,height; int Maxval; fim_byte_t *row; }; static void* pnm_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { struct ppm_state *h; fim_char_t line[FIM_FBI_PPM_LINEBUFSIZE],*fr; h = (struct ppm_state*) fim_calloc(1,sizeof(*h)); if(!h)return FIM_NULL; h->infile = fp; fr=fgets(line,sizeof(line),fp); /* Px */ if(!fr)goto oops; fr=fgets(line,sizeof(line),fp); /* width height */ if(!fr)goto oops; while ('#' == line[0]) { fr=fgets(line,sizeof(line),fp); /* skip comments */ if(!fr)goto oops; } sscanf(line,"%d %d",&h->width,&h->height); fr=fgets(line,sizeof(line),fp); /* ??? */ sscanf(line,"%d",&h->Maxval); if(!fr)goto oops; if (0 == h->width || 0 == h->height) goto oops; i->width = h->width; i->height = h->height; i->npages = 1; if( h->Maxval < 256 ) h->row = (fim_byte_t*)fim_malloc(h->width*3*1); // 1 byte read per component else h->row = (fim_byte_t*)fim_malloc(h->width*3*2); // 2 bytes read per component (but first taken) if(!h->row)goto oops; return h; oops: fim_fclose(fp); if(h->row)fim_free(h->row); if(h)fim_free(h); return FIM_NULL; } static void ppm_read(fim_byte_t *dst, unsigned int line, void *data) { struct ppm_state *h = (struct ppm_state *) data; int fr; if( h->Maxval < 256 ) fr=fim_fread(dst,h->width,3,h->infile); else { fim_byte_t *src = h->row; fr=fim_fread(src,h->width,6,h->infile); for (int x = 0; x < h->width; x++) { dst[3*x+0]=src[2*(3*x+0)]; dst[3*x+1]=src[2*(3*x+1)]; dst[3*x+2]=src[2*(3*x+2)]; } } if(fr){/* FIXME : there should be error handling */} } static void pgm_read(fim_byte_t *dst, unsigned int line, void *data) { struct ppm_state *h = (struct ppm_state *) data; fim_byte_t *src; int x,fr,inc=1; if( h->Maxval >= 256 ) inc=2; fr=fim_fread(h->row,h->width,inc,h->infile); if(!fr){/* FIXME : there should be error handling */ return ; } src = h->row; for (x = 0; x < h->width; x++) { dst[0] = src[0]; dst[1] = src[0]; dst[2] = src[0]; dst += 3; src += inc; } } static void pnm_done(void *data) { struct ppm_state *h = (struct ppm_state *) data; fim_fclose(h->infile); fim_free(h->row); fim_free(h); } struct ida_loader ppm_loader = { /*magic:*/ "P6", /*moff:*/ 0, /*mlen:*/ 2, /*name:*/ "ppm", /*init:*/ pnm_init, /*read:*/ ppm_read, /*done:*/ pnm_done, }; struct ida_loader pgm_loader = { /*magic:*/ "P5", /*moff:*/ 0, /*mlen:*/ 2, /*name:*/ "pgm", /*init:*/ pnm_init, /*read:*/ pgm_read, /*done:*/ pnm_done, }; static void fim__init init_rd(void) { fim_load_register(&ppm_loader); fim_load_register(&pgm_loader); } #ifdef USE_X11 /* ---------------------------------------------------------------------- */ /* save */ static int ppm_write(FILE *fp, struct ida_image *img) { fprintf(fp,"P6\n" "# written by ida " VERSION "\n" "# http://bytesex.org/ida/\n" "%d %d\n255\n", img->i.width,img->i.height); fwrite(img->data, img->i.height, 3*img->i.width, fp); return 0; } static struct ida_writer ppm_writer = { /*label:*/ "PPM", /*ext:*/ { "ppm", FIM_NULL}, /*write:*/ ppm_write, }; static void fim__init init_wr(void) { fim_write_register(&ppm_writer); } #endif /* USE_X11 */ } fim-0.6-rc2/src/fim_limits.h0000644000175000017500000000275014454347340012647 00000000000000/* $LastChangedDate: 2013-07-04 23:07:07 +0200 (Thu, 04 Jul 2013) $ */ /* fim_limits.h : Basic Fim types limits (c) 2011-2013 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_LIMITS_FIM_H #define FIM_LIMITS_FIM_H namespace fim { #define FIM_IS_SIGNED(T) (((T)0) > (((T)-1))) #define FIM_PROBABLY_SAME_TYPES(T1,T2) ((FIM_IS_SIGNED(T1)==FIM_IS_SIGNED(T2)) && sizeof(T1)==sizeof(T2)) #define FIM_IS_UNSIGNED(T) (!FIM_IS_SIGNED(T)) #define FIM_MAX_UNSIGNED(T) ((T)-1) #define FIM_MAX_SIGNED(T) (FIM_HALF_MAX_SIGNED(T) - 1 + FIM_HALF_MAX_SIGNED(T)) #define FIM_MIN_SIGNED(T) (-1 - FIM_MAX_SIGNED(T)) #define FIM_MAX_VALUE_FOR_TYPE(T) (FIM_IS_SIGNED(T)?FIM_MAX_SIGNED(T):FIM_MAX_UNSIGNED(T)) #define FIM_CHAR_BITS (8) #define FIM_BYTES_COUNT (1<<(sizeof(T)*FIM_CHAR_BITS)) } #endif /* FIM_LIMITS_FIM_H */ fim-0.6-rc2/src/fim_string.cpp0000644000175000017500000001541614454347340013212 00000000000000/* $LastChangedDate: 2022-11-14 00:13:27 +0100 (Mon, 14 Nov 2022) $ */ /* string.h : Fim's string type (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #include "fim_string.h" #include #define FIM_WANT_DEBUG_REGEXP 0 namespace fim { std::ostream& operator<<(std::ostream& os,const string& s) { return os << s.c_str(); } std::ostream& operator<<(std::ostream& os, const Browser& b) { return os; } string::string(const string& rhs):std::string(rhs) { } string::string(fim_char_t c) { fim_char_t buf[2]; buf[0]=c; buf[1]='\0'; append(buf); } #if FIM_WANT_LONG_INT #if FIM_USE_CXX11 string::string(int i):string(std::to_string(i)) { } #else /* FIM_USE_CXX11 */ string::string(int i) { fim_char_t buf[FIM_CHARS_FOR_INT]; snprintf(buf,FIM_CHARS_FOR_INT-1,"%d",i); buf[FIM_CHARS_FOR_INT-1]='\0'; append(buf); } #endif /* FIM_USE_CXX11 */ #endif /* FIM_WANT_LONG_INT */ #if FIM_USE_CXX11 string::string(fim_int i):string(std::to_string(i)) { } string::string(size_t i):string(std::to_string(i)) { } string::string(float i):string(std::to_string(i)) { } #else /* FIM_WANT_LONG_INT */ string::string(fim_int i) { fim_char_t buf[FIM_CHARS_FOR_INT]; fim_snprintf_fim_int(buf,i); append(buf); } string::string(size_t i) { fim_char_t buf[FIM_CHARS_FOR_INT]; #if FIM_USE_OLDCXX snprintf(buf,FIM_CHARS_FOR_INT-1,"%u",(unsigned)i); #else snprintf(buf,FIM_CHARS_FOR_INT-1,"%zd",i); #endif buf[FIM_CHARS_FOR_INT-1]='\0'; append(buf); } string::string(float i) { fim_char_t buf[FIM_ATOX_BUFSIZE]; sprintf(buf,"%f",i); assign(buf); } #endif /* FIM_USE_CXX11 */ string::string(int * i) { fim_char_t buf[FIM_CHARS_FOR_INT]; snprintf(buf,FIM_CHARS_FOR_INT-1,"%p",(void*)i); buf[FIM_CHARS_FOR_INT-1]='\0'; append(buf); } string::string(void):std::string(){} string string::operator+(const char * s)const { string res(*this); if(s) res+=s; return string(res); } string string::operator+(const string s)const { return (*this)+s.c_str(); } bool string::re_match(const fim_char_t*r)const { if( !r || !*r ) return false; return ::regexp_match(c_str(), r, true, true /* obsolete second arg */, false); } #if FIM_WANT_LONG_INT string::operator int (void)const{return atoi(this->c_str());} #endif /* FIM_WANT_LONG_INT */ string::operator fim_int (void)const{return fim_atoi(this->c_str());} string::operator float(void)const{return fim_atof(this->c_str());} #if 0 int string::find_re(const fim_char_t*r, int *mbuf)const { /* TODO: replace using */ /* * each occurrence of regular expression r will be substituted with t * * FIXME : return values could be more informative * NOTE: mbuf is int, but pmatch->rm_so and pmatch->rm_eo are regoff_t from regex.h * */ #if HAVE_REGEX_H regex_t regex; const size_t nmatch=1; regmatch_t pmatch[nmatch]; if( !r || !*r ) return -1; if( regcomp(®ex,r, 0 | REG_EXTENDED | REG_ICASE ) != 0 ) return -1; if(regexec(®ex,c_str(),nmatch,pmatch,0)==0) { regfree(®ex); if(mbuf) { mbuf[0]=pmatch->rm_so; mbuf[1]=pmatch->rm_eo; } return pmatch->rm_so; } regfree(®ex); #endif /* HAVE_REGEX_H */ return -1; } #endif void string::substitute(const fim_char_t*r, const fim_char_t* s, int flags) { /* each occurrence of regular expression r will be substituted with s */ if( !r || !*r || !s ) return; #if FIM_USE_CXX_REGEX std::string os; try { std::regex_constants::syntax_option_type mf{}; if (flags & FIM_REG_EXTENDED) mf |= std::regex_constants::extended; if (flags & FIM_REG_ICASE) mf |= std::regex_constants::icase; //mf |= std::regex_constants::format_sed; os = std::regex_replace( *this, std::regex(r, mf), s); } catch (const std::exception &) { } if(os!=*this) *this=os.c_str(); #else /* FIM_USE_CXX_REGEX */ #if HAVE_REGEX_H regex_t regex; FIM_CONSTEXPR int nmatch=1; regmatch_t pmatch[nmatch]; int off=0;//,sl=0; std::string rs =FIM_CNS_EMPTY_STRING; int ts=this->size(); int mf = 0; if (flags & FIM_REG_EXTENDED) mf |= REG_EXTENDED; if (flags & FIM_REG_ICASE) mf |= REG_ICASE; if( regcomp(®ex,r, 0 | mf ) != 0 ) { std::cerr << "Warning: " << r << " made regcomp fail!\n"; return; } //sl=strlen(s); //const int s_len=strlen(s); while(regexec(®ex,off+c_str(),nmatch,pmatch,REG_NOTBOL)==0) { /* * please note that this is not an efficient substitution implementation. * */ if(FIM_WANT_DEBUG_REGEXP)std::cerr << "rm_so :"<rm_so<< " rm_eo:"<rm_eo<<"\n"; if(FIM_WANT_DEBUG_REGEXP)std::cerr << "pasting "<rm_so<<"\n"; if(pmatch->rm_so>0) rs+=substr(off,pmatch->rm_so); if(FIM_WANT_DEBUG_REGEXP)std::cerr << "forward to "<rm_eo,ts); if(FIM_WANT_DEBUG_REGEXP)std::cerr << "match at "<rm_so << " to " << off+pmatch->rm_eo<< ", off="<rm_eo; if(FIM_WANT_DEBUG_REGEXP)std::cerr << "forward to "<off) rs+=substr(off,ts); if(FIM_WANT_DEBUG_REGEXP)std::cerr << "res is "<0); } fim::string string::line(int ln)const { /* * returns the ln'th line of the string, if found, or "" * */ const fim_char_t*s,*f; s=this->c_str(); f=s; if(ln< 0 || !s)return ""; while( ln && ((f=strchr(s,'\n'))!=FIM_NULL ) ) { --ln; s=f+1; } if(!ln) { const fim_char_t *se=s; if(!*s)se=s+strlen(s); else se=strchr(s,'\n'); fim::string rs; rs=substr(s-this->c_str(),se-s).c_str(); return rs; } return ""; } #endif /* FIM_WANT_OBSOLETE */ } fim-0.6-rc2/src/CACADevice.h0000644000175000017500000001000114454347340012306 00000000000000/* $LastChangedDate: 2022-11-02 22:15:31 +0100 (Wed, 02 Nov 2022) $ */ /* CACADevice.h : libcaca device Fim driver header file (c) 2008-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_CACADEVICE_H #define FIM_CACADEVICE_H #ifdef FIM_WITH_LIBCACA #include "DisplayDevice.h" #define FIM_WANTS_CACA_VERSION 1 #if ( FIM_WANTS_CACA_VERSION == 0 ) #include #else #include #endif #define FIM_LIBCACA_FONT_HEIGHT 1 class CACADevice FIM_FINAL:public DisplayDevice { private: fim::string dopts; #if ( FIM_WANTS_CACA_VERSION == 0 ) unsigned int r[256], g[256], b[256], a[256]; int XSIZ, YSIZ; struct caca_bitmap *caca_bitmap; fim_char_t *bitmap; #endif #if ( FIM_WANTS_CACA_VERSION == 1 ) #if FIM_USE_CXX11 caca_canvas_t *cv_; // {} pending caca_display_t *dp_; // {} pending #else /* FIM_USE_CXX11 */ caca_canvas_t *cv_; caca_display_t *dp_; #endif /* FIM_USE_CXX11 */ #endif public: #ifndef FIM_WANT_NO_OUTPUT_CONSOLE CACADevice(MiniConsole& mc_, fim::string dopts_):DisplayDevice(mc_),dopts(dopts_) #else /* FIM_WANT_NO_OUTPUT_CONSOLE */ CACADevice(fim::string dopts_):DisplayDevice(),dopts(dopts_) #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ { #if ( FIM_WANTS_CACA_VERSION == 1 ) // use default initializers as soon as C++03 is phased out cv_=FIM_NULL; dp_=FIM_NULL; #endif /* FIM_WANTS_CACA_VERSION */ } fim_err_t display( const void *ida_image_img, // source image structure (struct ida_image *)(but we refuse to include header files here!) //void* rgb,// destination gray array and source rgb array fim_coo_t iroff,fim_coo_t icoff, // row and column offset of the first input pixel fim_coo_t irows,fim_coo_t icols,// rows and columns in the input image fim_coo_t icskip, // input columns to skip for each line fim_coo_t oroff,fim_coo_t ocoff,// row and column offset of the first output pixel fim_coo_t orows,fim_coo_t ocols,// rows and columns to draw in output buffer fim_coo_t ocskip,// output columns to skip for each line fim_flags_t flags// some flags ) FIM_OVERRIDE; int initialize(sym_keys_t &sym_keys) FIM_OVERRIDE; void finalize(void) FIM_OVERRIDE; fim_coo_t get_chars_per_line(void)const FIM_OVERRIDE; int txt_width(void)const; int txt_height(void)const; int width(void)const FIM_OVERRIDE; int height(void)const FIM_OVERRIDE; fim_err_t status_line(const fim_char_t *msg) FIM_OVERRIDE; void status_screen(int desc,int draw_output){} fim_err_t console_control(fim_cc_t code); fim_bool_t handle_console_switch(void) FIM_OVERRIDE; fim_err_t clear_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2) FIM_OVERRIDE; fim_err_t fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t color) FIM_OVERRIDE {/* note: bogus implementation */ return clear_rect(x1,x2,y1,y2); } fim_err_t fs_puts(struct fs_font *f, fim_coo_t x, fim_coo_t y, const fim_char_t *str) FIM_OVERRIDE; fim_coo_t get_chars_per_column(void)const FIM_OVERRIDE; fim_bpp_t get_bpp(void)const FIM_OVERRIDE { return 1; } virtual fim_coo_t status_line_height(void)const FIM_OVERRIDE; virtual fim_coo_t font_height(void)const FIM_OVERRIDE; fim_sys_int get_input(fim_key_t * c, bool want_poll=false) FIM_OVERRIDE; fim_err_t resize(fim_coo_t w, fim_coo_t h) FIM_OVERRIDE; virtual fim_err_t set_wm_caption(const fim_char_t *msg) FIM_OVERRIDE; }; #endif /* FIM_WITH_LIBCACA */ #endif /* FIM_CACADEVICE_H */ fim-0.6-rc2/src/grammar.h0000644000175000017500000000602614503371562012137 00000000000000const fim_char_t * const FIM_DEFAULT_GRAMMAR_FILE_CONTENTS = " program: %empty\n" " | statement_list\n" "\n" " statement_list: statement\n" " | statement ';' statement_list\n" " | non_atomic_statements_block statement_list\n" " | statements_block\n" "\n" " non_atomic_statements_block: '{' statement_list '}'\n" " | INTEGER '{' statement_list '}'\n" " | conditional_statement\n" "\n" " statements_block: atomic_statements_block\n" " | non_atomic_statements_block\n" "\n" " conditional_statement: if_statement\n" " | loop_statement\n" "\n" " if_statement: 'if' '(' expression ')' statements_block\n" " | 'if' '(' expression ')' statements_block 'else' statements_block\n" "\n" " loop_statement: 'while' '(' expression ')' statements_block\n" " | 'do' statements_block 'while' '(' expression ')'\n" "\n" " atomic_statements_block: statement ';'\n" " | statement ';' ';'\n" " | statement ';' ';' ';'\n" "\n" " statement: '!' arguments\n" " | INTEGER ',' INTEGER IDENTIFIER\n" " | INTEGER ',' INTEGER IDENTIFIER arguments\n" " | INTEGER IDENTIFIER\n" " | SLASH_AND_REGEXP\n" " | '+' UNQUOTED_FLOAT '%'\n" " | '+' QUOTED_FLOAT '%'\n" " | '+' INTEGER '%'\n" " | '*' UNQUOTED_FLOAT\n" " | '*' QUOTED_FLOAT\n" " | '*' INTEGER\n" " | UNQUOTED_FLOAT '%'\n" " | QUOTED_FLOAT '%'\n" " | INTEGER '%'\n" " | '-' UNQUOTED_FLOAT '%'\n" " | '-' QUOTED_FLOAT '%'\n" " | '-' INTEGER '%'\n" " | INTEGER\n" " | '-' INTEGER\n" " | IDENTIFIER\n" " | IDENTIFIER FILE_PATH\n" " | IDENTIFIER arguments\n" " | INTEGER IDENTIFIER arguments\n" " | IDENTIFIER '=' expression\n" "\n" " arguments: expression\n" " | expression arguments\n" "\n" " expression: '(' expression ')'\n" " | expression '.' expression\n" " | '!' expression\n" " | expression '%' expression\n" " | expression '+' expression\n" " | expression '-' expression\n" " | expression '*' expression\n" " | expression '/' expression\n" " | expression '<' expression\n" " | expression '>' expression\n" " | expression '||' expression\n" " | expression BOR expression\n" " | expression '&&' expression\n" " | expression BAND expression\n" " | expression '>=' expression\n" " | expression '<=' expression\n" " | expression '!=' expression\n" " | expression '==' expression\n" " | expression '=~' expression\n" " | '-' expression\n" " | IDENTIFIER\n" " | INTEGER\n" " | QUOTED_FLOAT\n" " | UNQUOTED_FLOAT\n" " | STRING\n" ""; fim-0.6-rc2/src/Viewport.cpp0000644000175000017500000007155614454347340012677 00000000000000/* $LastChangedDate: 2023-03-25 18:31:40 +0100 (Sat, 25 Mar 2023) $ */ /* Viewport.cpp : Viewport class implementation (c) 2007-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "Viewport.h" #include // ceilf #define FIM_WANT_VIEWPORT_TRANSFORM 1 #define FIM_HSCALE_AFTER_CMT 1 namespace fim { #if FIM_WANT_BDI static Image fim_dummy_img; #endif /* FIM_WANT_BDI */ Viewport::Viewport( CommandConsole& commandConsole, DisplayDevice *displaydevice #ifdef FIM_WINDOWS ,const Rect & corners #endif /* FIM_WINDOWS */ ) : #ifdef FIM_NAMESPACES Namespace(&commandConsole,FIM_SYM_NAMESPACE_VIEWPORT_CHAR), #endif /* FIM_NAMESPACES */ psteps_(false), displaydevice_(displaydevice) #ifdef FIM_WINDOWS ,corners_(corners) #endif /* FIM_WINDOWS */ ,image_(FIM_NULL) ,commandConsole_(commandConsole) { if(!displaydevice_) throw FIM_E_TRAGIC; reset(); } Viewport::Viewport(const Viewport& rhs) : #ifdef FIM_NAMESPACES Namespace(rhs), #endif /* FIM_NAMESPACES */ psteps_(rhs.psteps_) ,displaydevice_(rhs.displaydevice_) #ifdef FIM_WINDOWS ,corners_(rhs.corners_) #endif /* FIM_WINDOWS */ ,image_(FIM_NULL) ,commandConsole_(rhs.commandConsole_) { steps_ = rhs.steps_; hsteps_ = rhs.hsteps_; vsteps_ = rhs.vsteps_; top_ = rhs.top_; left_ = rhs.left_; panned_ = rhs.panned_; #ifdef FIM_CACHE_DEBUG if(rhs.image_) std::cout << "Viewport:Viewport():maybe will cache \"" <getName() << "\" from "<check_valid()) { ViewportState viewportState; setImage( commandConsole_.browser_.cache_.useCachedImage(rhs.image_->getKey(),&viewportState) ); this->ViewportState::operator=(viewportState); } } fim_bool_t Viewport::pan_up(fim_pan_t s) { fim_bool_t rv = true; panned_ |= 0x1; if(s<0) rv = pan_down(-s); else { if(this->onTop()) return false; s=(s==0)?steps_:s; top_ -= s; } return rv; } fim_bool_t Viewport::pan_down(fim_pan_t s) { fim_bool_t rv = true; panned_ |= 0x1; if(s<0) rv = pan_up(-s); else { if(this->onBottom()) return false; s=(s==0)?steps_:s; top_ += s; } return rv; } fim_bool_t Viewport::pan_right(fim_pan_t s) { fim_bool_t rv = true; panned_ |= 0x2; if(s<0) rv = pan_left(-s); else { if(onRight()) return false; s=(s==0)?steps_:s; left_+=s; } return rv; } fim_bool_t Viewport::pan_left(fim_pan_t s) { fim_bool_t rv = true; panned_ |= 0x2; if(s<0) rv = pan_right(-s); else { if(onLeft()) return false; s=(s==0)?steps_:s; left_-=s; } return rv; } bool Viewport::onBottom(fim_coo_t approx_fraction)const { if( check_invalid() ) return false; const fim_coo_t ph = pixelable_height(); const fim_coo_t tol = approx_fraction > 1 ? ph / approx_fraction : 0; return (top_ + ph + tol >= image_->height()); } bool Viewport::onRight(fim_coo_t approx_fraction)const { if( check_invalid() ) return false; const fim_coo_t tol = approx_fraction > 1 ? viewport_width() / approx_fraction : 0; return (left_ + viewport_width() + tol >= image_->width()); } bool Viewport::onLeft(fim_coo_t approx_fraction)const { if( check_invalid() ) return false; const fim_coo_t tol = approx_fraction > 1 ? viewport_width() / approx_fraction : 0; return (left_ <= tol ); } bool Viewport::onTop(fim_coo_t approx_fraction)const { if( check_invalid() ) return false; const fim_coo_t ph = pixelable_height(); const fim_coo_t tol = approx_fraction > 1 ? ph / approx_fraction : 0; return (top_ <= tol ); } fim_coo_t Viewport::viewport_width(void)const { #ifdef FIM_WINDOWS return corners_.width(); #else /* FIM_WINDOWS */ return displaydevice_->width(); #endif /* FIM_WINDOWS */ } fim_coo_t Viewport::extra_height(void)const { const fim_coo_t eh = extra_bottom_height() + extra_top_height(); return eh; } fim_coo_t Viewport::extra_bottom_height(void)const { const fim_coo_t lh = displaydevice_->status_line_height(); const fim_coo_t ds = (getGlobalIntVariable(FIM_VID_DISPLAY_STATUS)==1?1:0); return ds * lh; } fim_coo_t Viewport::extra_top_height(void)const { fim_coo_t slh = 0; #if FIM_HSCALE_AFTER_CMT const fim_coo_t ds = (getGlobalIntVariable(FIM_VID_DISPLAY_STATUS)==1?1:0); if(ds && image_ && displaydevice_->get_bpp()) { const fim_int wcoi = getGlobalIntVariable(FIM_VID_COMMENT_OI); #if FIM_WANT_PIC_CMTS if(wcoi>=3) { const fim_coo_t fh = displaydevice_->font_height(); const std::string i = get_caption_text(); const fim_coo_t cpl = displaydevice_->get_chars_per_line(); const fim_coo_t el = ((i.size()+cpl-1)/cpl); slh=fh*el; } #endif /* FIM_WANT_PIC_CMTS */ slh = FIM_MIN(viewport_height()/2,slh); } #endif return slh; } fim_coo_t Viewport::viewport_height(void)const { #ifdef FIM_WINDOWS const fim_coo_t vph = corners_.height(); #else /* FIM_WINDOWS */ const fim_coo_t vph = displaydevice_->height(); #endif /* FIM_WINDOWS */ return vph; } fim_coo_t Viewport::pixelable_height(void)const { fim_coo_t vph = viewport_height(); vph -= extra_height(); return vph; } bool Viewport::redisplay(void) { // we 'force' a redraw should_redraw(); return display(); } fim_coo_t Viewport::xorigin(void)const { // horizontal origin coordinate (upper) #ifdef FIM_WINDOWS return corners_.xorigin(); #else /* FIM_WINDOWS */ return 0; #endif/* FIM_WINDOWS */ } fim_coo_t Viewport::yorigin(void)const { // vertical origin coordinate (upper) #ifdef FIM_WINDOWS return corners_.yorigin(); #else /* FIM_WINDOWS */ return 0; #endif/* FIM_WINDOWS */ } bool Viewport::shall_negate(void)const { return ((getGlobalIntVariable(FIM_VID_AUTONEGATE)== 1)&&(image_->check_negated()==0)); } bool Viewport::shall_desaturate(void)const { return ((getGlobalIntVariable(FIM_VID_AUTODESATURATE)== 1)&&(image_->check_desaturated()==0)); } bool Viewport::shall_mirror(void)const { return image_->shall_mirror(); } bool Viewport::shall_autotop(void)const { return /*getGlobalIntVariable(FIM_VID_AUTOTOP) |*/ image_->check_autotop() /* | getIntVariable(FIM_VID_AUTOTOP)*/; } bool Viewport::shall_flip(void)const { return image_->check_flip(); } bool Viewport::display(void) { /* * the display function draws the image in the framebuffer * memory. * no scaling occurs, only some alignment. * * returns true when some drawing occurred. */ if(! need_redraw()) return false; if( check_invalid() ) { if( displaydevice_ ) displaydevice_->clear_rect( xorigin(), xorigin()+viewport_width()-1, yorigin(), yorigin()+viewport_height()-1); return false; } fim_int autotop = shall_autotop(); const fim_pan_t vh = this->viewport_height(); const fim_pan_t ph = this->pixelable_height(); this->update_meta(false); if(shall_negate()) image_->negate(); if(shall_desaturate()) image_->desaturate(); if ( ( autotop || image_->check_autocenter()==1 ) && need_redraw() ) { if(autotop && image_->height()>=ph) { top_=autotop>0?0:image_->height()-ph; panned_ |= 0x1; // FIXME: shall do the same for l/r and introduce constants. } /* start with centered image, if larger than screen */ if (image_->width() > this->viewport_width() ) left_ = (image_->width() - this->viewport_width()) / 2; if (image_->height() > ph && autotop==0) top_ = (image_->height() - ph) / 2; image_->set_auto_props(0, 0); } { /* * Old fbi code snippets. */ if (image_->height() <= ph) { top_ = 0; } else { if (top_ < 0) top_ = 0; if (top_ + ph > image_->height()) top_ = image_->height() - ph; } if (image_->width() <= this->viewport_width()) { left_ = 0; } else { if (left_ < 0) left_ = 0; if (left_ + this->viewport_width() > image_->width()) left_ = image_->width() - this->viewport_width(); } } if( need_redraw()) { const bool mirror = shall_mirror(); const bool flip = shall_flip(); const fim_flags_t flags = (mirror?FIM_FLAG_MIRROR:0)|(flip?FIM_FLAG_FLIP:0); should_redraw(FIM_REDRAW_UNNECESSARY); image_->should_redraw(FIM_REDRAW_UNNECESSARY); #if FIM_WANT_VIEWPORT_TRANSFORM this->transform(mirror, flip); #endif /* FIM_WANT_VIEWPORT_TRANSFORM */ #ifdef FIM_WINDOWS if(displaydevice_ ) #endif /* FIM_WINDOWS */ displaydevice_->display( image_->get_ida_image(), top_, left_, image_->height(), image_->width(), image_->width(), extra_top_height()+yorigin(), xorigin(), ph, viewport_width(), viewport_width(), flags ); #if FIM_WANT_VIEWPORT_TRANSFORM this->transform(mirror, flip); #endif /* FIM_WANT_VIEWPORT_TRANSFORM */ #if FIM_WANT_PIC_CMTS /* FIXME: temporary; move to fs_puts_multiline() */ if(image_) if(fim_int wcoi = getGlobalIntVariable(FIM_VID_COMMENT_OI)) { #if 0 int fh=displaydevice_->f_ ? displaydevice_->f_->sheight():1; // FIXME : this is not clean int fw=displaydevice_->f_ ? displaydevice_->f_->swidth():1; // FIXME : this is not clean int sl = strlen(image_->getStringVariable(FIM_VID_COMMENT)), rw = viewport_width() / fw, wh = viewport_height(); for( int li = 0 ; sl > rw * li ; ++li ) if((li+1)*fhfs_puts(displaydevice_->f_, 0, fh*li, cmnts+rw*li); #else displaydevice_->fs_multiline_puts( get_caption_text().c_str(), wcoi-1, viewport_width(), vh); #endif } #endif /* FIM_WANT_PIC_CMTS */ #define FIM_WANT_BROWSER_PROGRESS_BAR 0 /* new */ #if FIM_WANT_BROWSER_PROGRESS_BAR const fim_float_t bp = commandConsole_.browser_.file_progress() * 100.0; const fim_pan_t bw = 1; // bar width const fim_pan_t vw = viewport_width(); const fim_coo_t xc = vw; // x coordinate const fim_color_t bc = FIM_CNS_WHITE; if(xc>bw) displaydevice_->fill_rect(xc-bw, xc, 0, FIM_FLT_PCNT_OF_100(bp,vh-1), bc); // if(xc>bw) displaydevice_->fill_rect(xc-bw, xc, FIM_FLT_PCNT_OF_100(bp,vh-1),vh, bc); // displaydevice_->fill_rect(0, 1, 0, FIM_FLT_PCNT_OF_100(bp,displaydevice_->height()-1), bc); // displaydevice_->fill_rect(0, FIM_FLT_PCNT_OF_100(bp,displaydevice_->width()-1), 0, 1, bc); #endif /* FIM_WANT_BROWSER_PROGRESS_BAR */ return true; } return false; } void Viewport::auto_scale(void) { fim_scale_t xs,ys; if( check_invalid() ) return; else xs = viewport_xscale(), ys = viewport_yscale(); image_->do_scale_rotate(FIM_MIN(xs,ys)); } void Viewport::auto_scale_if_bigger(void) { if( check_invalid() ) return; else { if((this->viewport_width()<(image_->original_width()*image_->ascale())) ||(this->pixelable_height() < image_->original_height())) auto_scale(); } } Image* Viewport::getImage(void)const { #if FIM_WANT_BDI if(!image_) return &fim_dummy_img; else #endif /* FIM_WANT_BDI */ #if FIM_IMG_NAKED_PTRS return image_; #else /* FIM_IMG_NAKED_PTRS */ return image_.get(); #endif /* FIM_IMG_NAKED_PTRS */ } const Image* Viewport::c_getImage(void)const { return getImage(); } void Viewport::setImage(fim::ImagePtr ni) { #ifdef FIM_CACHE_DEBUG std::cout << "setting image \""<getName()<<"\" in viewport: "<< ni << "\n\n"; #endif /* FIM_CACHE_DEBUG */ if(ni) free_image(false); reset(); image_ = ni; } void Viewport::steps_reset(void) { #ifdef FIM_WINDOWS steps_ = getGlobalIntVariable(FIM_VID_STEPS); if(steps_reset_view_props(), image_->set_auto_props(1, 0); should_redraw(); top_ = 0; left_ = 0; steps_reset(); } void Viewport::auto_height_scale(void) { fim_scale_t newscale; if( check_invalid() ) return; newscale = viewport_yscale(); image_->do_scale_rotate(newscale); } void Viewport::auto_width_scale(void) { if( check_invalid() ) return; image_->do_scale_rotate(viewport_xscale()); } void Viewport::free_image(bool force) { if(image_) commandConsole_.browser_.cache_.freeCachedImage(image_,this,force); image_ = FIM_NULL; } bool Viewport::check_valid(void)const { return ! check_invalid(); } bool Viewport::check_invalid(void)const { if(!image_) return true; else return !image_->check_valid(); } void Viewport::scale_position_magnify(fim_scale_t factor) { /* * scale image positioning variables by adjusting by a multiplying factor * */ if(factor<=0.0) return; left_ = (fim_off_t)ceilf(((fim_scale_t)left_)*factor); top_ = (fim_off_t)ceilf(((fim_scale_t)top_ )*factor); /* * should the following be controlled by some optional variable ? * */ //if(!panned_ /* && we_want_centering */ ) this->recenter(); } void Viewport::scale_position_reduce(fim_scale_t factor) { /* * scale image positioning variables by adjusting by a multiplying factor * */ if(factor<=0.0) return; left_ = (fim_off_t)ceilf(FIM_INT_SCALE_FRAC(left_,factor)); top_ = (fim_off_t)ceilf(FIM_INT_SCALE_FRAC(top_ ,factor)); //if(!panned_ /* && we_want_centering */ ) this->recenter(); } void Viewport::recenter_horizontally(void) { if(image_) left_ = (image_->width() - this->viewport_width()) / 2; } void Viewport::recenter_vertically(void) { if(image_) top_ = (image_->height() - this->pixelable_height()) / 2; } void Viewport::recenter(void) { if(!(panned_ & 0x02)) recenter_horizontally(); if(!(panned_ & 0x01)) recenter_vertically(); } Viewport::~Viewport(void) { free_image(false); } template bool Viewport::pan_to_t(const PT px, const PT py) { /* merge this with a pan function */ assert( 0 <= px && px <= 100 && 0 <= py && py <= 100 ); PT _px = px, _py = py; #if FIM_WANT_VIEWPORT_TRANSFORM if(image_ && image_->is_flipped()) _py = 100 - _py; if(image_ && image_->is_mirrored()) _px = 100 - _px; #endif /* FIM_WANT_VIEWPORT_TRANSFORM */ if(image_) { fim_pan_t ih = image_->height(); fim_pan_t iw = image_->width(); fim_pan_t vh = this->pixelable_height(); fim_pan_t vw = this->viewport_width(); fim_off_t top = top_, left = left_; if(ih>vh) top = FIM_INT_PCNT_SAFE(_py,ih-vh); if(iw>vw) left = FIM_INT_PCNT_SAFE(_px,iw-vw); if( top != top_ || left != left_ ) { top_ = top; left_ = left; should_redraw(); } } return true; } bool Viewport::pan_to(const fim_pan_t px, const fim_pan_t py) { return pan_to_t(px, py); } bool Viewport::pan_to(const double px, const double py) { return pan_to_t(px, py); } bool Viewport::pan(const fim_char_t*a1, const fim_char_t*a2) { #if FIM_USE_CXX11 if(a1 || a2) return do_pan({ (a1 ? a1 : a2 ) }); else return do_pan({}); #else /* FIM_USE_CXX11 */ args_t args; if(a1) args.push_back(a1); if(a2) args.push_back(a2); return do_pan(args); #endif /* FIM_USE_CXX11 */ } bool Viewport::do_pan(const args_t& args) { fim_pan_t hs=0,vs=0; fim_bool_t ps=false; fim_char_t f=FIM_SYM_CHAR_NUL,s=FIM_SYM_CHAR_NUL; const fim_char_t*const fs=args[0]; const fim_char_t*ss=FIM_NULL; fim_bool_t prv = true; fim_bool_t wpt = false; if(args.size()<1 || (!fs)) goto ret; f=tolower(*fs); if(!fs[0]) goto ret; s=tolower(fs[1]); steps_reset(); if(args.size()>=2) { if ( isdigit(*args[0]) && isdigit(*args[1]) ) { ps=((ss=args[0]) && *ss && ((ss[strlen(ss)-1])=='%') && (ss=args[1]) && *ss && ((ss[strlen(ss)-1])=='%')); wpt = ps; vs=(int)(args[0]); hs=(int)(args[1]); } else { ps=((ss=args[1]) && *ss && ((ss[strlen(ss)-1])=='%')); vs=hs=(int)(args[1]); } } else { ps = psteps_; vs = vsteps_; hs = hsteps_; } if(ps) { vs = FIM_INT_PCNT(pixelable_height(),vs); hs = FIM_INT_PCNT(viewport_width(), hs); } #if FIM_WANT_VIEWPORT_TRANSFORM if(image_ && image_->is_flipped()) vs=-vs; if(image_ && image_->is_mirrored()) hs=-hs; #endif /* FIM_WANT_VIEWPORT_TRANSFORM */ if (wpt) { pan_to(hs,vs); } else switch(f) { case('u'): prv=pan_up(vs); break; case('d'): prv=pan_down(vs); break; case('r'): prv=pan_right(hs); break; case('l'): prv=pan_left(hs); break; case('n'): case('s'): if(f=='n') prv=pan_up(vs); if(f=='s') prv=pan_down(vs); switch(s) { case('e'): prv=pan_left(hs); break; case('w'): prv=pan_right(hs); break; default: goto ret; } break; default: goto ret; } should_redraw(); ret: return prv; } size_t Viewport::byte_size(void)const { size_t bs = 0; bs += sizeof(*this); return bs; } int Viewport::snprintf_centering_info(char *str, size_t size)const { int vum,vlm; int hum,hlm; float va,ha; char vc='c',hc='c'; int res=0; const char*cs=FIM_NULL; const char*es=""; const float bt=99.0; const float ct=1.0; vum = top_; vlm = image_->height() - pixelable_height() - vum; hum = left_; hlm = image_->width() - viewport_width() - hum; vum = FIM_MAX(vum,0); vlm = FIM_MAX(vlm,0); hum = FIM_MAX(hum,0); hlm = FIM_MAX(hlm,0); if(vum<1 && vlm<1) { va=0.0; // res = snprintf(str+res, size-res, "-"); } else { va=((float)(vum))/((float)(vum+vlm)); va-=0.5; va*=200.0; if(va<0.0) { va*=-1.0,vc='^'; if(va>=bt) cs="top"; } else { vc='v'; if(va>=bt) cs="bot"; } if(va=bt) cs="left"; } else { hc='>'; if(ha>=bt) cs="right"; } if(haonBottom()) goto ret; if( check_valid() ) top_ = image_->height() - this->pixelable_height(); } break; case 't': { if(this->onTop()) goto ret; top_=0; } break; case 'l': left_=0; break; case 'r': left_ = image_->width() - viewport_width(); break; case 'c': //this->recenter(); this->recenter_vertically(); this->recenter_horizontally(); break; default: goto ret; } should_redraw(); ret: return; } Viewport& Viewport::operator= (const Viewport&rhs){return *this;/* a disabled assignment */} void Viewport::transform(bool mirror, bool flip) { if(mirror) { if( image_ && image_->width() > viewport_width() ) left_ = image_->width() - viewport_width() - left_; } if(flip) { if( image_ && image_->height() > pixelable_height() ) top_ = image_->height() - pixelable_height() - top_; } } fim_bool_t Viewport::need_redraw(void)const { return ( ( redraw_ != FIM_REDRAW_UNNECESSARY ) || ( image_ && image_->need_redraw() ) || ( displaydevice_ && displaydevice_->need_redraw() ) ); } void Viewport::should_redraw(enum fim_redraw_t sr) { redraw_ = sr; } fim_scale_t Viewport::viewport_xscale(void)const { assert(image_); return FIM_INT_SCALE_FRAC(this->viewport_width(),image_->original_width()*image_->ascale()); } fim_scale_t Viewport::viewport_yscale(void)const { assert(image_); const fim_coo_t ph = this->pixelable_height(); return FIM_INT_SCALE_FRAC(ph,static_cast(image_->original_height())); } fim_cxr Viewport::img_color(const args_t& args) { if( !c_getImage() ) goto nop; if(args.size()>0) { bool daltonize=false; enum fim_cvd_t cvd=FIM_CVD_NO; if( args[0] == "desaturate" ) if( getImage()->desaturate() ) goto nop; if( args[0] == "negate" ) if( getImage()->negate() ) goto nop; if( args[0] == "identity" ) if( getImage()->identity() ) goto nop; if( args.size()>1 && ( args[1] == "daltonize" || args[1] == "D" ) ) daltonize=true; if( args[0] == "c" || args[0] == "colorblind" || args[0] == "d" || args[0] == "deuteranopia" ) cvd = FIM_CVD_DEUTERANOPIA; if( args[0] == "p" || args[0] == "protanopia" ) cvd = FIM_CVD_PROTANOPIA; if( args[0] == "t" || args[0] == "tritanopia" ) cvd = FIM_CVD_TRITANOPIA ; if(cvd!=FIM_CVD_NO) if( getImage()->colorblind(cvd,daltonize) ) goto nop; } nop: return FIM_CNS_EMPTY_RESULT; } fim_err_t Viewport::img_rotate(fim_angle_t angle) { if(getImage()) return getImage()->rotate(angle); return FIM_ERR_NO_ERROR; } bool Viewport::img_goto_page(fim_page_t j) { if(getImage()) return getImage()->goto_page(j); return false; } #if FIM_WANT_CROP fim_cxr Viewport::img_crop(const args_t& args, const string ¤t) { ida_rect prect {25,25,75,75}; #if FIM_WANT_MOUSE_CROP const std::string rsv = cc.getStringVariable(FIM_VID_CROP_ONCE); if( args.size() == 0 && ! rsv.empty() ) { std::istringstream is(rsv); int x1, y1, x2, y2; is >> x1; is >> y1; is >> x2; is >> y2; const int ye = image_->height(); const int xe = image_->width(); x1 = x1 / ( xe / 100.0 ); x2 = x2 / ( xe / 100.0 ); y1 = y1 / ( ye / 100.0 ); y2 = y2 / ( ye / 100.0 ); cc.setVariable(FIM_VID_CROP_ONCE, 0); prect = {x1,y1,x2,y2}; } #endif /* FIM_WANT_MOUSE_CROP */ if(args.size() == 1) { const int ap = (int)(args[0]); const int x1 = (100-ap)/2; const int y1 = (100-ap)/2; const int x2 = 100-x1; const int y2 = 100-y1; prect = {x1,y1,x2,y2}; } if(args.size() == 2) { const int xs = (int)(args[0]); const int ys = (int)(args[1]); const int x1 = (100-xs)/2; const int y1 = (100-ys)/2; const int x2 = 100-x1; const int y2 = 100-y1; prect = {x1,y1,x2,y2}; } if(args.size() == 4) { const int x1 = (int)(args[0]); const int y1 = (int)(args[1]); const int x2 = (int)(args[2]); const int y2 = (int)(args[3]); prect = {x1,y1,x2,y2}; } if ( image_ ) { FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PRESCALE,current) image_->do_crop(prect); FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTSCALE) } return FIM_CNS_EMPTY_RESULT; } #endif /* FIM_WANT_CROP */ fim_cxr Viewport::img_scale(const args_t& args, const string ¤t) { /* * scales the image to a certain scale factor * - no user error checking -- poor error reporting for the user * - wxh / w:h syntax needed * - shall better belong to viewport */ fim_scale_t newscale = FIM_CNS_SCALEFACTOR_ZERO; fim_char_t fc = FIM_SYM_CHAR_NUL; const fim_char_t*ss = FIM_NULL; int sl = 0; bool pcsc = false; bool aes = false; // approximate exponential scaling if( args.size() < 1 || !(ss=args[0].c_str() )) goto nop; fc = tolower(*ss); sl = strlen(ss); #if FIM_WANT_APPROXIMATE_EXPONENTIAL_SCALING { if( fc == '<' ) { newscale = 0.5; fc='+'; aes = true; goto comeon; } if( fc == '>' ) { newscale = 2; fc='+'; aes = true; goto comeon; } } #endif /* FIM_WANT_APPROXIMATE_EXPONENTIAL_SCALING */ if( isalpha(fc) ) { if( !( fc == 'w' || fc == 'h' || fc == 'a' || fc == 'b' ) ) goto nop; } else { if( sl == 1 && ( fc =='+' || fc == '-' ) ) { if( fc == '+' ) newscale = getGlobalFloatVariable(FIM_VID_MAGNIFY_FACTOR); if( fc == '-' ) newscale = getGlobalFloatVariable(FIM_VID_REDUCE_FACTOR); goto comeon; } if( sl >= 2 && ( fc == '+' || fc == '-' ) ) { fim_char_t sc =ss[1]; if( fc == '+' ) { fim_scale_t vmf = getGlobalFloatVariable(FIM_VID_MAGNIFY_FACTOR); fim_scale_t vrf = getGlobalFloatVariable(FIM_VID_REDUCE_FACTOR); fim_scale_t sfd = getGlobalFloatVariable(FIM_VID_SCALE_FACTOR_DELTA); fim_scale_t sfm = getGlobalFloatVariable(FIM_VID_SCALE_FACTOR_MULTIPLIER); if( sfd <= FIM_CNS_SCALEFACTOR_ZERO ) sfd = FIM_CNS_SCALEFACTOR_DELTA; if( sfm <= FIM_CNS_SCALEFACTOR_ONE ) sfm = FIM_CNS_SCALEFACTOR_MULTIPLIER; switch(sc) { case('+'): { vrf += sfd; vmf += sfd; } break; case('-'): { vrf -= sfd; vmf -= sfd; } break; case('*'): { vrf *= sfm; vmf *= sfm; } break; case('/'): { vrf /= sfm; vmf /= sfm; } break; default: goto noplus; } setGlobalVariable(FIM_VID_REDUCE_FACTOR, vrf); setGlobalVariable(FIM_VID_MAGNIFY_FACTOR,vmf); goto nop; } noplus: if( fc == '+' || fc == '-') { newscale = fim_atof(ss+1); pcsc = (strstr(ss,"%") != FIM_NULL ); if(pcsc) newscale *= .01; if( !newscale ) goto nop; #if 1 if( fc == '+' ) newscale = 1.0 + newscale; if( fc == '-' ) newscale = 1.0 - newscale; fc = FIM_SYM_CHAR_NUL; #endif goto comeon; } goto nop; //unreachable (FIXME: this and a few others..) } if( sl ) { if(fc=='*') { ++ss; if(!*ss) goto nop; /* a '*' alone. may assign a special meaning to this... */ } newscale = fim_atof(ss); if(fc=='*') { fc = '+'; goto comeon; } pcsc = (strstr(ss,"%") != FIM_NULL ); if(pcsc) newscale *= .01; if( newscale == FIM_CNS_SCALEFACTOR_ZERO ) goto nop; pcsc = false; goto comeon; } goto nop; } comeon: #if FIM_WANT_BDI if(1) #else /* FIM_WANT_BDI */ if(c_getImage()) #endif /* FIM_WANT_BDI */ { fim_err_t errval = FIM_ERR_NO_ERROR; FIM_AUTOCMD_EXEC_PRE(FIM_ACM_PRESCALE,current) this->update_meta(false); if( c_getImage() ) switch( fc ) { case('w'): this->auto_width_scale(); break; case('h'): this->auto_height_scale(); break; case('a'): this->auto_scale(); break; case('b'): this->auto_scale_if_bigger(); break; case('-'): { if( newscale ) { if(c_getImage()) errval = getImage()->reduce(newscale); this->scale_position_reduce(newscale); } else { if(c_getImage()) errval = getImage()->reduce(); this->scale_position_reduce(); } } break; case('+'): { if( newscale ) { if(c_getImage()) errval = getImage()->magnify(newscale,aes); this->scale_position_magnify(newscale); } else { if(c_getImage()) errval = getImage()->magnify(); this->scale_position_magnify(); } } break; default: if( pcsc ) errval = getImage()->scale_multiply(newscale); else errval = getImage()->set_scale(newscale); } FIM_AUTOCMD_EXEC_POST(FIM_ACM_POSTSCALE) if( errval != FIM_ERR_NO_ERROR ) { // Here might handle reporting of an error.. } } nop: return FIM_CNS_EMPTY_RESULT; } fim_err_t Viewport::update_meta(bool fresh) { fim_err_t errval = FIM_ERR_NO_ERROR; if(c_getImage()) getImage()->update_meta(false); return errval; } std::string Viewport::get_caption_text(void)const { std::string ct; if(isSetGlobalVar(FIM_VID_COMMENT_OI_FMT)) { const fim_uint cpl = displaydevice_->get_chars_per_line(); const fim_uint maxchrs = cpl*(displaydevice_->get_chars_per_column()/2); const std::string i = commandConsole_.getInfoCustom(getGlobalStringVariable(FIM_VID_COMMENT_OI_FMT)); if(i.length()>maxchrs) { ct=i.substr(0,maxchrs); if(maxchrs>3) ct[maxchrs-1]='.', ct[maxchrs-2]='.', ct[maxchrs-3]='.'; } else ct=i; } return ct; } } /* namespace fim */ fim-0.6-rc2/src/fim_wrappers.h0000644000175000017500000000751714454347340013217 00000000000000/* $LastChangedDate: 2022-11-05 13:20:39 +0100 (Sat, 05 Nov 2022) $ */ /* fim_wrappers.h : Some wrappers (c) 2011-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_WRAPPERS_H #define FIM_WRAPPERS_H #if FIM_WITH_DEBUG #include #include #endif namespace fim { /* symbolic wrappers for memory handling calls */ #if FIM_WITH_DEBUG #define FIM_MEMDBG_EXT_DECLS extern std::map g_allocs; extern ssize_t g_allocs_n; extern ssize_t g_allocs_bytes; #define FIM_MEMDBG_VERBOSE 0 inline void * fim_calloc_debug(size_t x,size_t y) { FIM_MEMDBG_EXT_DECLS void *p=std::calloc((x),(y)); if (p) { if (FIM_MEMDBG_VERBOSE) { std::cout << " [" << p << "] "; std::cout << g_allocs_n << "/" << g_allocs_bytes; std::cout << " [" << (x*y) << "] "; std::cout << " -> "; } g_allocs[p] = (x*y); g_allocs_n++; g_allocs_bytes += (x*y); if (FIM_MEMDBG_VERBOSE) { std::cout << g_allocs_n << "/" << g_allocs_bytes; std::cout << std::endl; } } return p; } #define fim_calloc(x,y) fim_calloc_debug(x,y) #define fim_malloc(x) fim_calloc_debug(x,1) inline void * fim_free_debug(void * p) { FIM_MEMDBG_EXT_DECLS if(!p) return p; if(p) { if (g_allocs.find(p) == g_allocs.end()) { std::cout << " [" << p << "] "; std::cout << " Freeing what never allocated ?!\n"; assert(0); } if (g_allocs_n == 0) { std::cout << " Freeing more than allocated ?!\n"; } if (FIM_MEMDBG_VERBOSE) { std::cout << " [" << p << "] "; std::cout << g_allocs_n << "/" << g_allocs_bytes; std::cout << " [" << g_allocs[p] << "] "; std::cout << " -> "; } g_allocs_n--; g_allocs_bytes -= g_allocs[p]; g_allocs.erase(p); if (FIM_MEMDBG_VERBOSE) { std::cout << g_allocs_n << "/" << g_allocs_bytes; std::cout << std::endl; } } std::free(p); return p; } inline void * fim_realloc_debug(void * p, size_t sz) { FIM_MEMDBG_EXT_DECLS if(!p) return fim_malloc(sz); if(p) { ssize_t osz = g_allocs[p]; if (FIM_MEMDBG_VERBOSE) { std::cout << " [" << p << "] "; std::cout << g_allocs_n << "/" << g_allocs_bytes; std::cout << " [" << g_allocs[p] << "] "; std::cout << " -> +"; std::cout << sz-osz; std::cout << " -> "; } g_allocs_bytes += sz - osz; g_allocs.erase(p); p = realloc(p, sz); g_allocs[p]=sz; if (FIM_MEMDBG_VERBOSE) { std::cout << g_allocs_n << "/" << g_allocs_bytes; std::cout << std::endl; } } return p; } #define fim_free(x) fim_free_debug(x), x=FIM_NULL #define fim_stralloc(x) (fim_char_t*) fim_calloc((x),(1)) /* ensures that first char is NUL */ #define fim_realloc(p,sz) fim_realloc_debug(p,sz) #else /* FIM_WITH_DEBUG */ #define fim_calloc(x,y) std::calloc((x),(y)) /* may make this routine aligned in the future */ #define fim_malloc(x) std::malloc(x) #define fim_realloc(p,sz) realloc(p,sz) #define fim_free(x) std::free(x), x=FIM_NULL #define fim_stralloc(x) (fim_char_t*) std::calloc((x),(1)) /* ensures that first char is NUL */ #endif /* FIM_WITH_DEBUG */ #define fim_memset(x,y,z) std::memset(x,y,z) #define fim_bzero(x,y) fim_memset(x,0,y) /* bzero has been made legacy by POSIX.2001 and deprecated since POSIX.2004 */ } #endif /* FIM_WRAPPERS_H */ fim-0.6-rc2/src/fim_stream.cpp0000644000175000017500000000472614454347340013201 00000000000000/* $LastChangedDate: 2022-11-07 03:52:37 +0100 (Mon, 07 Nov 2022) $ */ /* fim_stream.cpp : Textual output facility (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #include "fim_stream.h" namespace fim { fim_stream::fim_stream(fim_str_t fd):fd_(fd) { } fim_stream& fim_stream::operator<<(const fim_byte_t* s) { *this<<(const fim_char_t*)s; return *this; } fim_stream& fim_stream::operator<<(const fim::string&s) { *this<<(const fim_char_t*)(s.c_str()); return *this; } fim_stream& fim_stream::operator<<(float f) { fim_char_t s[FIM_ATOX_BUFSIZE];sprintf(s,"%f",f); *this<<(const fim_char_t*)s; return *this; } fim_stream& fim_stream::operator<<(int i) { fim_char_t s[FIM_ATOX_BUFSIZE];sprintf(s,"%d",i); *this<=2) std::cerr << s ; } } } //else if(s)printf("%s",s); return *this; } } fim-0.6-rc2/src/FramebufferDevice.h0000644000175000017500000003153514454347340014062 00000000000000/* $LastChangedDate: 2023-03-25 18:31:40 +0100 (Sat, 25 Mar 2023) $ */ /* FramebufferDevice.h : Linux Framebuffer functions from fbi, adapted for fim (c) 2008-2023 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_FRAMEBUFFER_DEVICE_H #define FIM_FRAMEBUFFER_DEVICE_H /* Code in this file comes from fbi's C sources. */ #include "fim.h" #include "FontServer.h" #include "DisplayDevice.h" /* these are required by FbiStuffJpeg.cpp */ #define FIM_FBI_TRUE 1 #define FIM_FBI_FALSE 0 #ifndef FIM_WITH_NO_FRAMEBUFFER #include #include #include //pow #if HAVE_LINUX_VT_H #include #endif /* HAVE_LINUX_VT_H */ #if HAVE_LINUX_FB_H #include // fb_fix_screeninfo #endif /* HAVE_LINUX_FB_H */ #include // ptrdiff_t /* from fbtools.h */ #define FB_ACTIVE 0 #define FB_REL_REQ 1 #define FB_INACTIVE 2 #define FB_ACQ_REQ 3 namespace fim { struct DEVS { const fim_char_t *fb0; const fim_char_t *fbnr; const fim_char_t *ttynr; }; class FramebufferDevice FIM_FINAL:public DisplayDevice { long red_mult_, green_mult_; long red_dither_[256] FIM_ALIGNED; long green_dither_[256]FIM_ALIGNED; long blue_dither_[256] FIM_ALIGNED; long gray_dither_[256] FIM_ALIGNED; /* * A class providing access to a single framebuffer device. * * Let's say in future we want to be able to manage multiple framebuffer devices. * Then framebuffer variables should be incapsulated well in separate objects. * */ #if 0 void fb_text_init1(fim_char_t *font) { fim_char_t *fonts[2] = { font, FIM_NULL }; if (FIM_NULL == f_) f_ = fs_consolefont(font ? fonts : FIM_NULL); #ifdef FIM_USE_X11_FONTS if (FIM_NULL == f_ && 0 == fs_connect(FIM_NULL)) f_ = fs_open(font ? font : x11_font_); #endif /* FIM_USE_X11_FONTS */ if (FIM_NULL == f_) { fprintf(stderr,"font \"%s\" is not available\n",font); exit(1); } } #endif private: static const fim_coo_t border_height_=1; int vt_ ; int32_t lut_red_[256], lut_green_[256], lut_blue_[256]; int dither_; private: float fbgamma_ ; // FS.C unsigned int fs_bpp_, fs_black_, fs_white_; int fs_init_fb(int white8); private: int visible_ ; //fim_char_t *x11_font_ ; int ys_ ; int xs_ ; fim_bool_t debug_; void (*fs_setpixel)(void *ptr, unsigned int color); private: static void setpixel1(void *ptr, unsigned int color) { fim_byte_t *p = (fim_byte_t *) ptr; *p = color; } static void setpixel2(void *ptr, unsigned int color) { short unsigned int *p = (short unsigned int*) ptr; *p = color; } static void setpixel3(void *ptr, unsigned int color) { fim_byte_t *p = (fim_byte_t *) ptr; *(p++) = (color >> 16) & 0xff; *(p++) = (color >> 8) & 0xff; *(p++) = color & 0xff; } static void setpixel4(void *ptr, unsigned int color) { unsigned int *p = (unsigned int*) ptr; *p = color; } /* framebuffer */ fim_char_t *fbdev_; fim_char_t *fbmode_; public: fim_err_t set_fbdev(fim_char_t *fbdev) { /* only possible before init() */ if(fb_mem_) return FIM_ERR_GENERIC; if(fbdev) this->fbdev_=fbdev; return FIM_ERR_NO_ERROR; } fim_err_t set_fbmode(fim_char_t *fbmode) { /* only possible before init() */ if(fb_mem_) return FIM_ERR_GENERIC; if(fbmode) this->fbmode_=fbmode; return FIM_ERR_NO_ERROR; } int set_default_vt(int default_vt) { /* only possible before init() */ if(fb_mem_) return FIM_ERR_GENERIC; if(default_vt) this->vt_=default_vt; return FIM_ERR_NO_ERROR; } int set_default_fbgamma(float fbgamma) { /* only possible before init() */ if(fb_mem_) return FIM_ERR_GENERIC; if(fbgamma) this->fbgamma_=fbgamma; return FIM_ERR_NO_ERROR; } private: int fd_, switch_last_; unsigned short red_[256], green_[256], blue_[256]; struct fb_cmap cmap_; //were static .. struct fb_cmap ocmap_; unsigned short ored_[256], ogreen_[256], oblue_[256]; struct DEVS devs_default_; struct DEVS devs_devfs_; #ifdef FIM_BOZ_PATCH int with_boz_patch_; #endif /* FIM_BOZ_PATCH */ public: #ifndef FIM_WANT_NO_OUTPUT_CONSOLE FramebufferDevice(MiniConsole& mc_); #else /* FIM_WANT_NO_OUTPUT_CONSOLE */ FramebufferDevice(void); #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ private: /* -------------------------------------------------------------------- */ /* exported stuff */ struct fb_fix_screeninfo fb_fix_; struct fb_var_screeninfo fb_var_; fim_byte_t *fb_mem_; ptrdiff_t fb_mem_offset_; int fb_switch_state_; /* -------------------------------------------------------------------- */ /* internal variables */ int fb_,tty_; #if 0 static int bpp,black,white; #endif int orig_vt_no_; struct vt_mode vt_mode_; int kd_mode_; struct vt_mode vt_omode_; struct termios term_; struct fb_var_screeninfo fb_ovar_; public: fim_err_t framebuffer_init(const bool try_boz_patch); private: struct DEVS *devices_; void dev_init(void); int fb_init(const fim_char_t *device, fim_char_t *mode, int vt_ , int try_boz_patch=0 ); //public: void fb_memset (void *addr, int c, size_t len); void fb_setcolor(int c) { fb_memset(fb_mem_+fb_mem_offset_,c,fb_fix_.smem_len); } void fb_setvt(int vtno); int fb_setmode(fim_char_t const * const name); int fb_activate_current(int tty_); void console_switch(fim_bool_t is_busy) FIM_OVERRIDE; int fb_font_width(void)const; int fb_font_height(void)const; public: int status_line(const fim_char_t *msg) FIM_OVERRIDE ; private: void fb_text_box(int x, int y, fim_char_t *lines[], unsigned int count); void fb_line(int x1, int x2, int y1,int y2); void fb_rect(int x1, int x2, int y1,int y2); void fb_setpixel(int x, int y, unsigned int color); fim_err_t fs_puts(struct fs_font *f, fim_coo_t x, fim_coo_t y, const fim_char_t *str) FIM_OVERRIDE; void fb_clear_rect(int x1, int x2, int y1,int y2); fim_err_t clear_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2)FIM_OVERRIDE { fb_clear_rect(x1, x2, y1,y2); return 0; } public: fim_err_t fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t color) FIM_OVERRIDE {/* FIXME: bogus implementation */ return clear_rect(x1,x2,y1,y2); } void clear_screen(void); void cleanup(void) FIM_OVERRIDE; fim_err_t initialize (sym_keys_t &sym_keys)FIM_OVERRIDE {/*still unused : FIXME */ return FIM_ERR_NO_ERROR;} void finalize (void)FIM_OVERRIDE ; private: struct fs_font * fb_font_get_current_font(void) { return f_; } public: void switch_if_needed(void) FIM_OVERRIDE { handle_console_switch(); } #define FIM_FBI_TRUE 1 #define FIM_FBI_FALSE 0 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) /* * framebuffer memory offset for x pixels left and y right from the screen (fim) */ #define FB_BPP (((fb_var_.bits_per_pixel+7)/8)) #define FB_MEM_LINE_LENGTH ((fb_fix_.line_length)) #define FB_MEM_OFFSET(x,y) (( FB_BPP*(x) + FB_MEM_LINE_LENGTH * (y) )) #define FB_MEM(x,y) ((fb_mem_+FB_MEM_OFFSET((x),(y)))) //void svga_display_image_new(const struct ida_image *img, int xoff, int yoff,unsigned int bx,unsigned int bw,unsigned int by,unsigned int bh,int mirror,int flip); //void svga_display_image_new(const struct ida_image *img, int xoff, int yoff,unsigned int bx,unsigned int bw,unsigned int by,unsigned int bh,int mirror,int flip); fim_err_t display( //const struct ida_image *img, const void *ida_image_img, // source image structure fim_coo_t yoff, fim_coo_t xoff, fim_coo_t irows,fim_coo_t icols,// rows and columns in the input image fim_coo_t icskip, // input columns to skip for each line fim_coo_t by, fim_coo_t bx, fim_coo_t bh, fim_coo_t bw, fim_coo_t ocskip,// output columns to skip for each line fim_flags_t flags) FIM_OVERRIDE; void svga_display_image_new( const struct ida_image *img, int yoff, int xoff, int irows,int icols,// rows and columns in the input image int icskip, // input columns to skip for each line unsigned int by, unsigned int bx, unsigned int bh, unsigned int bw, int ocskip,// output columns to skip for each line int flags) FIM_NOEXCEPT; private: /* ---------------------------------------------------------------------- */ inline fim_byte_t * clear_line(int bpp, int line, int owidth, fim_byte_t *dst) FIM_NOEXCEPT; fim_byte_t * convert_line(int bpp, int line, int owidth, fim_byte_t *dst, fim_byte_t *buffer, int mirror) FIM_NOEXCEPT;/*fim mirror patch*/ fim_byte_t * convert_line_8(int bpp, int line, int owidth, fim_byte_t *dst, fim_byte_t *buffer, int mirror) FIM_NOEXCEPT;/*fim mirror patch*/ void init_dither(int shades_r, int shades_g, int shades_b, int shades_gray); inline void dither_line(fim_byte_t *src, fim_byte_t *dst, int y, int width,int mirror) FIM_NOEXCEPT; void dither_line_gray(fim_byte_t *src, fim_byte_t *dst, int y, int width); void fb_switch_release(void); void fb_switch_acquire(void); int fb_switch_init(void); public: void fb_switch_signal(int signal); private: int fb_text_init2(void); void svga_dither_palette(int r, int g, int b) { int rs, gs, bs, i; rs = 256 / (r - 1); gs = 256 / (g - 1); bs = 256 / (b - 1); for (i = 0; i < 256; i++) { red_[i] = calc_gamma(rs * ((i / (g * b)) % r), 255); green_[i] = calc_gamma(gs * ((i / b) % g), 255); blue_[i] = calc_gamma(bs * ((i) % b), 255); } } unsigned short calc_gamma(int n, int max) { int ret =(int)(65535.0 * pow((float)n/(max), 1 / fbgamma_)); if (ret > 65535) ret = 65535; if (ret < 0) ret = 0; return ret; } void linear_palette(int bit) { int i, size = 256 >> (8 - bit); for (i = 0; i < size; i++) red_[i] = green_[i] = blue_[i] = calc_gamma(i,size); } void lut_init(int depth) { if (fb_var_.red.length && fb_var_.green.length && fb_var_.blue.length) { /* fb_var_.{red|green|blue} looks sane, use it */ init_one(lut_red_, fb_var_.red.length, fb_var_.red.offset); init_one(lut_green_, fb_var_.green.length, fb_var_.green.offset); init_one(lut_blue_, fb_var_.blue.length, fb_var_.blue.offset); } else { /* fallback */ int i; switch (depth) { case 15: for (i = 0; i < 256; i++) { lut_red_[i] = (i & 0xf8) << 7; /* bits -rrrrr-- -------- */ lut_green_[i] = (i & 0xf8) << 2; /* bits ------gg ggg----- */ lut_blue_[i] = (i & 0xf8) >> 3; /* bits -------- ---bbbbb */ } break; case 16: for (i = 0; i < 256; i++) { lut_red_[i] = (i & 0xf8) << 8; /* bits rrrrr--- -------- */ lut_green_[i] = (i & 0xfc) << 3; /* bits -----ggg ggg----- */ lut_blue_[i] = (i & 0xf8) >> 3; /* bits -------- ---bbbbb */ } break; case 24: for (i = 0; i < 256; i++) { lut_red_[i] = i << 16; /* byte -r-- */ lut_green_[i] = i << 8; /* byte --g- */ lut_blue_[i] = i; /* byte ---b */ } break; } } } void init_one(int32_t *lut, int bits, int shift) { int i; if (bits > 8) for (i = 0; i < 256; i++) lut[i] = (i << (bits + shift - 8)); else for (i = 0; i < 256; i++) lut[i] = (i >> (8 - bits)) << shift; } public: int width(void)const FIM_OVERRIDE { return fb_var_.xres; } int height(void)const FIM_OVERRIDE { return fb_var_.yres; } fim_coo_t get_chars_per_column(void)const FIM_OVERRIDE { return fb_var_.yres / fb_font_height(); } fim_coo_t get_chars_per_line(void)const FIM_OVERRIDE { return fb_var_.xres / fb_font_width(); } fim_bool_t handle_console_switch(void) FIM_OVERRIDE { if (switch_last_ == fb_switch_state_) return false; console_switch(true); return true; } private: void fs_render_fb(fim_byte_t *ptr, int pitch, FSXCharInfo *charInfo, fim_byte_t *data); public: fim_bpp_t get_bpp(void)const FIM_OVERRIDE{return fb_var_.bits_per_pixel; } virtual ~FramebufferDevice(void); virtual fim_coo_t status_line_height(void)const FIM_OVERRIDE; }; } #endif /* FIM_WITH_NO_FRAMEBUFFER */ #endif /* FIM_FRAMEBUFFER_DEVICE_H */ fim-0.6-rc2/src/fim_stream.h0000644000175000017500000000326514454347340012643 00000000000000/* $LastChangedDate: 2022-10-22 00:37:29 +0200 (Sat, 22 Oct 2022) $ */ /* fim_stream.h : Textual output facility (c) 2007-2022 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_FIM_STREAM_H #define FIM_FIM_STREAM_H #include "fim.h" namespace fim { /* * this class is a stream used in Fim and should output to an internal console. * * TODO: error and to file dump. maybe, some day. * move here the console handling functionalities. * TODO: introduce an enum for output selection * */ class fim_stream { fim_str_t fd_; public: fim_stream(fim_str_t fd=-1); fim_stream& operator<<(const fim_char_t* s); fim_stream& operator<<(const fim_char_t c); fim_stream& operator<<(const fim_byte_t* s); fim_stream& operator<<(const fim::string&s); fim_stream& operator<<(float f); #if FIM_WANT_LONG_INT fim_stream& operator<<(fim_int i); #endif /* FIM_WANT_LONG_INT */ fim_stream& operator<<(int i); fim_stream& operator<<(unsigned int i); }; } #endif /* FIM_FIM_STREAM_H */ fim-0.6-rc2/src/Makefile.am0000644000175000017500000001711014454347340012372 00000000000000# $Id: Makefile.am 1963 2023-04-07 17:59:40Z dezperado $ subdir = src AUTOMAKE_OPTIONS = no-dependencies dejagnu subdir-objects #AUTOMAKE_OPTIONS+= nostdinc SUBDIRS = check_PROGRAMS = fim bin_PROGRAMS = fim bin_SCRIPTS = fimgs doc_DATA = fimrc LFLAGS = -+ # --nounistd YFLAGS = -v -d #lex.yy.cc : lex.lex lex.yy.cc: lex.lex yacc.tab.cpp $(LEX) $(LFLAGS) $< # @$(ECHO) "Applying a horrible hack to avoid the flex non-throwing isatty() redeclaration in 'extern "C" int isatty (int );'" # $(SED) -i 's/^.*extern.*isatty.*int.*$$//g' $@ yacc.tab.hpp: yacc.tab.cpp yacc.tab.cpp: yacc.ypp lex.lex LC_ALL=C $(YACC) $(YFLAGS) $< -o $@ # FIM_LIB_OBJECTS = yacc.tab.$(OBJEXT) lex.yy.$(OBJEXT) conf.h: fimrc $(ECHO) 'const fim_char_t * const FIM_DEFAULT_CONFIG_FILE_CONTENTS =' > $@ $(SED) 's/\\/\\\\/g;s/"/\\\"/g;s/^/"/g;s/$$/\\n"/g;' $< | $(GREP) -v '^.###' >> $@ $(ECHO) '"";' >> $@ grammar.h: yacc.tab.cpp yacc.output if WITH_FLEXLEXER $(ECHO) 'const fim_char_t * const FIM_DEFAULT_GRAMMAR_FILE_CONTENTS =' > $@ $(AWK) -f $(top_srcdir)/scripts/maintenance/yacc2grammar.awk yacc.output | $(CPP) -include $(top_srcdir)/scripts/maintenance/yacc2grammar.h | $(GREP) -v '^#' | $(SED) 's/"/\\\"/g;s/^/"/g;s/$$/\\n"/g;' >> $@ $(ECHO) '"";' >> $@ endif examples.h: ../scripts/example/oneline.fim $(ECHO) 'const fim_char_t * const FIM_DEFAULT_EXAMPLE_FILE_CONTENTS =' > $@ $(SED) 's/"/\\\"/g;s/^/"/g;s/$$/\\n"/g;' $< >> $@ $(ECHO) '"";' >> $@ CommandConsole-help.$(OBJEXT): CommandConsole-help.cpp help-acm.cpp help.cpp examples.h grammar.h if FIM_WANT_HARDCODED_CONSOLEFONT FontServer.$(OBJEXT): default_font_byte_array.h endif SDLDevice.$(OBJEXT): default_icon_byte_array.h # in the following : for some freebsd oddity, i was forced to replace ..0-9_]\+ with ..0-9_]* version.h: ../config.h $(GREP) define $< | $(GREP) FIM | LC_ALL=C $(SORT) | $(SED) 's/^#//g;s/define //g;s/^\([A-Za-z0-9_]*\).*$$/+\1 /g;s/^/\"/g;s/$$/\"/g' > $@ $(ECHO) "\"\n\"" >> $@ $(GREP) define $< | $(GREP) FIM.*'"' | LC_ALL=C $(SORT) | $(SED) 's/^#//g;s/define //g;s/^\([A-Za-z0-9_]*\) "\(.*\)"$$/"\1 = \\"\2\\"\\n"/g' >> $@ $(GREP) undef $< | $(GREP) FIM | LC_ALL=C $(SORT) | $(SED) 's/^#//g;s/.*undef //g;s/^\([A-Za-z0-9_]*\).\+$$/-\1 /g;s/^/\"/g;s/$$/\"/g' >> $@ if WITH_DEBUG $(ECHO) '"\n'CXXFLAGS=$(CXXFLAGS)'\n"' >> $@ endif help.cpp: fim.h $(ECHO) -e "#ifdef FIM_WANT_INLINE_HELP\n" > $@ $(GREP) '^#define FIM_VID' $< | $(SED) 's/^#define //g;s/\(^[A-Z0-9_]\+\)\s\+\("[^ ]*"\)\s*\/\*\(.*\)\*\/$$/fim_var_help_db[\1]=\3;/g' >> $@ $(ECHO) '#endif /* FIM_WANT_INLINE_HELP */' >> $@ help-acm.cpp: fim.h $(ECHO) -e "//#ifdef FIM_WANT_INLINE_HELP\n" > $@ $(ECHO) -e '#define FIM_AUTOCOMMANDS_LIST \' >> $@ $(GREP) '^#define FIM_ACM' $< | $(SED) 's/^#define //g;s/\(^[A-Z0-9_]\+\)\s\+\("[^ ]*"\)\s*\/\*\(.*\)\*\/$$/\1", "/g'|tr '\n' ' ' >> $@ $(ECHO) ' '>> $@ $(ECHO) '//#endif' >> $@ b2ba$(EXEEXT): b2ba.c $(CC) -o $@ $< if HAVE_RUNNABLE_TESTS if FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT default_font_byte_array.h: $(FIM_CUSTOM_HARDCODED_CONSOLEFONT) b2ba$(EXEEXT) ./b2ba$(EXEEXT) < $< > $@ else default_font_byte_array.h: ../var/fonts/Lat15-Terminus16.psf b2ba$(EXEEXT) ./b2ba$(EXEEXT) < $< > $@ endif endif # the following sources are built at make time # old bison versions could have problems with this (e.g.: generating yacc.tab.cpp.h instead of yacc.tab.hpp) BUILT_SOURCES = if WITH_FLEXLEXER BUILT_SOURCES += lex.yy.cc yacc.tab.cpp conf.h yacc.tab.hpp else yacc.output: touch $@ endif # this hook triggers on 'make dist' .PHONY: dist-hook dist-hook: -for file in $(BUILT_SOURCES) ; do $(RM) -f $(distdir)/$$file ; done EXTRA_fim_SOURCES = # The following files are marked as source files by configure.ac EXTRA_fim_SOURCES += FbiStuffGif.cpp EXTRA_fim_SOURCES += FbiStuffJasPer.cpp EXTRA_fim_SOURCES += FbiStuffJpeg.cpp EXTRA_fim_SOURCES += FbiStuffTiff.cpp EXTRA_fim_SOURCES += FbiStuffPng.cpp EXTRA_fim_SOURCES += FbiStuffDjvu.cpp EXTRA_fim_SOURCES += FbiStuffMagick.cpp EXTRA_fim_SOURCES += FbiStuffPdf.cpp EXTRA_fim_SOURCES += FbiStuffPs.cpp EXTRA_fim_SOURCES += Imlib2Device.cpp EXTRA_fim_SOURCES += FbiStuffXyz.cpp EXTRA_fim_SOURCES += FbiStuffPcx.cpp EXTRA_fim_SOURCES += FbiStuffBmp.cpp CLEANFILES=$(BUILT_SOURCES) yacc.output b2ba$(EXEEXT) #CPP_FLAGS="$CPP_FLAGS -D X_DISPLAY_MISSING" #AM_CPPFLAGS= fim_DEPENDENCIES = @FIM_LIB_OBJECTS@ @LIBOBJS@ $(INTLDEPS) fim_LDADD = @FIM_LIB_OBJECTS@ @LIBOBJS@ $(FIMLIBS) #fim_LDADD = @FIM_LIB_OBJECTS@ @LIBOBJS@ $(FIMLIBS) $(LEXLIB) fim_SOURCES = $(BUILT_SOURCES) \ $(srcdir)/fim.cpp \ $(srcdir)/fim.h \ $(srcdir)/fim_types.h \ $(srcdir)/fim_limits.h \ $(srcdir)/fim_plugin.h \ $(srcdir)/fim_plugin.cpp \ $(srcdir)/fim_wrappers.h \ $(srcdir)/default_font_byte_array.h \ $(srcdir)/default_icon_byte_array.h \ $(srcdir)/AADevice.h \ $(srcdir)/Benchmarkable.h \ $(srcdir)/CACADevice.h \ $(srcdir)/SDLDevice.h \ $(srcdir)/Arg.h \ $(srcdir)/Browser.h \ $(srcdir)/Cache.h \ $(srcdir)/Command.h \ $(srcdir)/CommandConsole.h \ $(srcdir)/DebugConsole.h \ $(srcdir)/DisplayDevice.h \ $(srcdir)/DummyDisplayDevice.h \ $(srcdir)/FbiStuff.h \ $(srcdir)/FbiStuffList.h \ $(srcdir)/FbiStuffFbtools.h \ $(srcdir)/FbiStuffLoader.h \ $(srcdir)/FontServer.h \ $(srcdir)/FramebufferDevice.h \ $(srcdir)/Imlib2Device.h \ $(srcdir)/Image.h \ $(srcdir)/Namespace.h \ $(srcdir)/Var.h \ $(srcdir)/Viewport.h \ $(srcdir)/FimWindow.h \ $(srcdir)/common.h \ $(srcdir)/fim_interpreter.h \ $(srcdir)/conf.h \ $(srcdir)/help.cpp \ $(srcdir)/help-acm.cpp \ $(srcdir)/version.h \ $(srcdir)/grammar.h \ $(srcdir)/examples.h \ $(srcdir)/fim.h \ $(srcdir)/fim_stream.h \ $(srcdir)/fim_stream.cpp \ $(srcdir)/fimgs \ $(srcdir)/lex.h \ $(srcdir)/readline.h \ $(srcdir)/readline.cpp \ $(srcdir)/fim_string.h \ $(srcdir)/AADevice.cpp \ $(srcdir)/CACADevice.cpp \ $(srcdir)/SDLDevice.cpp \ $(srcdir)/Arg.cpp \ $(srcdir)/Browser.cpp \ $(srcdir)/Cache.cpp \ $(srcdir)/Command.cpp \ $(srcdir)/CommandConsole.cpp \ $(srcdir)/CommandConsole-cmd.cpp \ $(srcdir)/CommandConsole-var.cpp \ $(srcdir)/CommandConsole-init.cpp \ $(srcdir)/CommandConsole-help.cpp \ $(srcdir)/DebugConsole.cpp \ $(srcdir)/DisplayDevice.cpp \ $(srcdir)/FbiStuff.cpp \ $(srcdir)/FbiStuffFbtools.cpp \ $(srcdir)/FbiStuffLoader.cpp \ $(srcdir)/FbiStuffPpm.cpp \ $(srcdir)/FbiStuffBit1.cpp \ $(srcdir)/FbiStuffBit24.cpp \ $(srcdir)/FbiStuffText.cpp \ $(srcdir)/FbiStuffMatrixMarket.cpp \ $(srcdir)/FontServer.cpp \ $(srcdir)/FramebufferDevice.cpp \ $(srcdir)/Image.cpp \ $(srcdir)/Namespace.cpp \ $(srcdir)/Var.cpp \ $(srcdir)/Viewport.cpp \ $(srcdir)/FimWindow.cpp \ $(srcdir)/common.cpp \ $(srcdir)/fim_interpreter.cpp \ $(srcdir)/fim_string.cpp Command.$(OBJEXT): Command.h Viewport.$(OBJEXT): Viewport.h Browser.$(OBJEXT): Browser.h Image.$(OBJEXT): Image.h CommandConsole.$(OBJEXT): defaultConfiguration.$(OBJEXT) fim.h CommandConsole-cmd.$(OBJEXT): fim.h CommandConsole-help.$(OBJEXT): conf.h defaultConfiguration.$(OBJEXT) CommandConsole-init.$(OBJEXT): conf.h defaultConfiguration.$(OBJEXT) help.$(OBJEXT): conf.h defaultConfiguration.$(OBJEXT) fim.$(OBJEXT): version.h help.cpp grammar.h examples.h Var.$(OBJEXT): help.cpp fim.cpp: version.h help.cpp grammar.h examples.h lex.yy.$(OBJEXT): lex.yy.cc # regex.c is work in progress and awaits for integration EXTRA_DIST = lex.lex yacc.ypp fimrc defaultConfiguration.cpp fimgs \ testdir/*ok testdir/*in testdir/Makefile \ testsuite/*/* \ regex.c b2ba.c RUNTESTDEFAULTFLAGS = --tool ./fim$(EXEEXT) FIM=$$srcdir/./fim$(EXEEXT) --srcdir $$srcdir/testsuite #RUNTESTDEFAULTFLAGS = --all --tool ./fim$(EXEEXT) FIM=$$srcdir/./fim$(EXEEXT) --tool_opts=$$srcdir/../media/fim.png --srcdir $$srcdir/testsuite fim-0.6-rc2/src/lex.h0000644000175000017500000000365714454347340011312 00000000000000/* $LastChangedDate: 2016-02-10 23:49:58 +0100 (Wed, 10 Feb 2016) $ */ /* lex.h : Lexer (lex) header file (c) 2007-2016 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_LEX_H #define FIM_LEX_H #include "fim_types.h" typedef enum { intCon, floatCon, typeOpr, stringCon,vId } nodeEnum; /* constants */ typedef struct { fim_int value; /* value of constant */ } conNodeType; /* identifiers */ typedef struct { fim_char_t *s; /* subscript to sym array */ } stringNodeType; typedef struct { float f; /* subscript to sym array */ } fidNodeType; /* operators */ typedef struct { int i; /* subscript to sym array */ } idNodeType; /* operators */ typedef struct { int oper; /* operator */ int nops; /* number of operands */ struct nodeTypeTag *op[1]; /* operands (expandable) */ } oprNodeType; typedef struct nodeTypeTag { nodeEnum type; /* type of node */ int typeHint; /* WARNING : THIS COULD BE HARMFUL, DUE TO C HACKS.. */ /* union must be last entry in nodeType */ /* because operNodeType may dynamically increase */ union { conNodeType con; /* constants */ stringNodeType scon; /* string constant */ fidNodeType fid; /* identifiers */ idNodeType id; /* identifiers */ oprNodeType opr; /* operators */ }; } nodeType; extern int sym[26]; #endif /* FIM_LEX_H */ fim-0.6-rc2/src/FbiStuffPcx.cpp0000644000175000017500000005121414454347340013230 00000000000000/* $LastChangedDate: 2023-03-25 18:31:40 +0100 (Sat, 25 Mar 2023) $ */ /* FbiStuffPcx.cpp : Code for reading PCX files. (c) 2014-2023 Michele Martone The functions pcx_load_image_fp and pcx_load_image_info_fp are (c) 2014-2014 Mohammed Isam. Originally based on code (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fim.h" #if FIM_WITH_PCX #include #include #include #include #ifdef HAVE_ENDIAN_H #include #endif /* HAVE_ENDIAN_H */ namespace fim { extern CommandConsole cc; typedef int pcx_err_t; #define PCX_ERR_NO_ERROR 0 #define PCX_ERR_GENERIC -1 typedef char BOOL; #ifdef HAVE_STDINT_H typedef uint8_t UBYTE; //define UNSIGNED BYTE as 1 byte typedef uint16_t UWORD; //define UNSIGNED WORD as 2 bytes typedef uint32_t UDWORD; //define UNSIGNED DOUBLE WORD as 4 bytes #else /* HAVE_STDINT_H */ typedef __u8 UBYTE; //define UNSIGNED BYTE as 1 byte typedef __u16 UWORD; //define UNSIGNED WORD as 2 bytes typedef __u32 UDWORD; //define UNSIGNED DOUBLE WORD as 4 bytes #endif /* HAVE_STDINT_H */ #if BYTE_ORDER == BIG_ENDIAN UWORD swap_word(UWORD x) { return ((x>>8)&0xff) | // move byte 1 to byte 0 ((x<<8)&0xff00); // move byte 0 to byte 1 } #endif /* BYTE_ORDER == BIG_ENDIAN */ typedef struct { unsigned char red; unsigned char green; unsigned char blue; unsigned char alpha; } urgb; typedef struct { char red; char green; char blue; } colormap_rgb_s; typedef struct { fim_byte_t manufacturer; fim_byte_t version; fim_byte_t encoding; fim_byte_t bpp; UWORD xstart, ystart, xend, yend; UWORD hres, vres; colormap_rgb_s colormap[16]; //amounts to 48 bytes fim_byte_t reserved; fim_byte_t planes; UWORD bpl; UWORD paletteinfo; fim_byte_t filler[58]; }PCX_HEADER_S; PCX_HEADER_S PCX_HEADER; bool PALETTE_DEFINED; bool COLORMAP_DEFINED; #define PCX_RETURN_ERROR(x) \ { \ fprintf(stderr, "%s@%d:",__FILE__,__LINE__); \ fprintf(stderr, x); \ goto err; \ } /* ---------------------------------------------------------------------- */ /* libpcx routines */ static pcx_err_t pcx_load_image_info_fp(FILE *fp, int * numpagesp, unsigned int *wp, unsigned int *hp) { if(fseek(fp,0,SEEK_SET) != 0) PCX_RETURN_ERROR("Error setting file pointer\n") if(fread(&PCX_HEADER, 128, 1, fp) != 1) PCX_RETURN_ERROR("Error reading first 128 bytes of PCX file\n") if(fseek(fp,0,SEEK_SET) != 0) PCX_RETURN_ERROR("Error setting file pointer\n") if(fread(&PCX_HEADER, 128, 1, fp) != 1) PCX_RETURN_ERROR("Error reading file header\n") if(PCX_HEADER.manufacturer != 10) PCX_RETURN_ERROR("Not a PCX image\n") if(PCX_HEADER.encoding != 1) PCX_RETURN_ERROR("Invalid encoding\n") /* PCX is little-endian. If machine is big-endian, swap bytes.. */ #if BYTE_ORDER == BIG_ENDIAN PCX_HEADER.xend = swap_word(PCX_HEADER.xend); PCX_HEADER.xstart = swap_word(PCX_HEADER.xstart); PCX_HEADER.yend = swap_word(PCX_HEADER.yend); PCX_HEADER.ystart = swap_word(PCX_HEADER.ystart); PCX_HEADER.hres = swap_word(PCX_HEADER.hres); PCX_HEADER.vres = swap_word(PCX_HEADER.vres); PCX_HEADER.bpl = swap_word(PCX_HEADER.bpl); PCX_HEADER.paletteinfo = swap_word(PCX_HEADER.paletteinfo); #endif /* BYTE_ORDER == BIG_ENDIAN */ //Calculate the width and height *wp = (PCX_HEADER.xend-PCX_HEADER.xstart)+1; *hp = (PCX_HEADER.yend-PCX_HEADER.ystart)+1; *numpagesp = 1; return PCX_ERR_NO_ERROR; err: return PCX_ERR_GENERIC; } static pcx_err_t pcx_load_image_fp(FILE *fp, unsigned int page, unsigned char * rgb, int bytes_per_line) { urgb palette[256]; long pos2; int tmp = 0; int h; long line_bytes; int image_w; int image_h; long bitmap_size; int padding; long pos, count; unsigned char repeat, value; const int FLAG_MASK = 192; //11000000 const int REVERSE_MASK = 63; //00111111 int plane, i; if(fseek(fp,0,SEEK_SET) != 0) PCX_RETURN_ERROR("Error setting file pointer\n") if(fread(&PCX_HEADER, 128, 1, fp) != 1) PCX_RETURN_ERROR("Error reading file header\n") if(PCX_HEADER.manufacturer != 10) PCX_RETURN_ERROR("Not a PCX image\n") if(PCX_HEADER.encoding != 1) PCX_RETURN_ERROR("Invalid encoding\n") /* PCX is little-endian. If machine is big-endian, swap bytes.. */ #if BYTE_ORDER == BIG_ENDIAN PCX_HEADER.xend = swap_word(PCX_HEADER.xend); PCX_HEADER.xstart = swap_word(PCX_HEADER.xstart); PCX_HEADER.yend = swap_word(PCX_HEADER.yend); PCX_HEADER.ystart = swap_word(PCX_HEADER.ystart); PCX_HEADER.hres = swap_word(PCX_HEADER.hres); PCX_HEADER.vres = swap_word(PCX_HEADER.vres); PCX_HEADER.bpl = swap_word(PCX_HEADER.bpl); PCX_HEADER.paletteinfo = swap_word(PCX_HEADER.paletteinfo); #endif /* BYTE_ORDER == BIG_ENDIAN */ PALETTE_DEFINED = 0; COLORMAP_DEFINED = 0; pos2 = ftell(fp); if(fseek(fp, -769, SEEK_END) != 0) PCX_RETURN_ERROR("Error setting file pointer\n") h = fread(&tmp, 1, 1, fp); if(h != 1) PCX_RETURN_ERROR("Error reading from file\n") if(tmp == 12) { //fprintf(stderr, "Reading palette\n"); //check the first color is black h = fread(&palette[0].red, 1, 1, fp); if(h != 1) PCX_RETURN_ERROR("Error reading palette information\n") h = fread(&palette[0].green, 1, 1, fp); if(h != 1) PCX_RETURN_ERROR("Error reading palette information\n") h = fread(&palette[0].blue, 1, 1, fp); if(h != 1) PCX_RETURN_ERROR("Error reading palette information\n") if(palette[0].red == 0 && palette[0].blue == 0 && palette[0].green == 0) { for(h = 1; h < 256; h++) { if(fread(&palette[h].red, 1, 1, fp) != 1) PCX_RETURN_ERROR("Error reading palette information\n") if(fread(&palette[h].green, 1, 1, fp) != 1) PCX_RETURN_ERROR("Error reading palette information\n") if(fread(&palette[h].blue, 1, 1, fp) != 1) PCX_RETURN_ERROR("Error reading palette information\n") } PALETTE_DEFINED = 1; //file_size -= 769; //exclude palette data from image data } } if(fseek(fp, pos2, SEEK_SET) != 0) PCX_RETURN_ERROR("Error setting file pointer\n") line_bytes = PCX_HEADER.bpl*PCX_HEADER.planes; image_w = (PCX_HEADER.xend-PCX_HEADER.xstart)+1; image_h = (PCX_HEADER.yend-PCX_HEADER.ystart)+1; bitmap_size = image_w*image_h*3; padding = (line_bytes*(8/PCX_HEADER.bpp))-(image_w*PCX_HEADER.planes); //fprintf(stderr, "padding=%d, size=%d\n", padding, bitmap_size); pos = 0; count = 0; if(PCX_HEADER.planes != 1) plane = 0; //0=RED 1=GREEN 2=BLUE 3=ALPHA 4=SINGLE PLANE else plane = 4; while(pos < bitmap_size) { h = fread(&value, 1, 1, fp); //fprintf(stderr, "size=%d, pos=%d\n", bitmap_size, pos); if(h != 1) value = 0; //PCX_RETURN_ERROR("Error reading pixel value from file\n") if((value & FLAG_MASK) == FLAG_MASK) //RLE code { repeat = (value & REVERSE_MASK); h = fread(&value, 1, 1, fp); if(h != 1) PCX_RETURN_ERROR("Error reading pixel value from file\n") for(h = 0; h < repeat; h++) { switch(PCX_HEADER.bpp) { ///////////////////////////////////// //8 bits per pixel //////////////////////////////////// case(8): if(plane == 0) *(rgb+pos ) = value; //red else if(plane == 1) *(rgb+pos+1) = value; //green else if(plane == 2) *(rgb+pos+2) = value; //blue else if(plane == 3) ; //alpha-not used else if(plane == 4) { if(COLORMAP_DEFINED) { *(rgb+pos ) = PCX_HEADER.colormap[value].red; *(rgb+pos+1) = PCX_HEADER.colormap[value].green; *(rgb+pos+2) = PCX_HEADER.colormap[value].blue; } else if(PALETTE_DEFINED) { *(rgb+pos ) = palette[value].red; *(rgb+pos+1) = palette[value].green; *(rgb+pos+2) = palette[value].blue; } else { *(rgb+pos ) = value; *(rgb+pos+1) = value; *(rgb+pos+2) = value; } } pos+=3; count++; if(count >= image_w) { if(plane < PCX_HEADER.planes-1) { plane++; pos -= (image_w*3); } else if(plane == PCX_HEADER.planes-1) { if(pos >= bitmap_size) break; if(padding) h += padding; plane = 0; } else { //fprintf(stderr, "h=%d, repeat=%d, pos=%d, count=%d\n", h, repeat, pos, count); if(pos >= bitmap_size) break; if(padding) h += padding; } count = 0; } break; ///////////////////////////////////// //4 bits per pixel //////////////////////////////////// case(4): if(COLORMAP_DEFINED) { *(rgb+pos ) = PCX_HEADER.colormap[value&240].red; *(rgb+pos+1) = PCX_HEADER.colormap[value&240].green; *(rgb+pos+2) = PCX_HEADER.colormap[value&240].blue; *(rgb+pos+3) = PCX_HEADER.colormap[value&15].red; *(rgb+pos+4) = PCX_HEADER.colormap[value&15].green; *(rgb+pos+5) = PCX_HEADER.colormap[value&15].blue; } else if(PALETTE_DEFINED) { *(rgb+pos ) = palette[value&240].red; *(rgb+pos+1) = palette[value&240].green; *(rgb+pos+2) = palette[value&240].blue; *(rgb+pos+3) = palette[value&15].red; *(rgb+pos+4) = palette[value&15].green; *(rgb+pos+5) = palette[value&15].blue; } pos+=6; count+=2; if(count >= image_w) { if(pos >= bitmap_size) break; if(padding) h += padding; count = 0; } break; ///////////////////////////////////// //2 bits per pixel //////////////////////////////////// case(2): if(COLORMAP_DEFINED) { *(rgb+pos ) = PCX_HEADER.colormap[value&192].red; *(rgb+pos+1 ) = PCX_HEADER.colormap[value&192].green; *(rgb+pos+2 ) = PCX_HEADER.colormap[value&192].blue; *(rgb+pos+3 ) = PCX_HEADER.colormap[value&48].red; *(rgb+pos+4 ) = PCX_HEADER.colormap[value&48].green; *(rgb+pos+5 ) = PCX_HEADER.colormap[value&48].blue; *(rgb+pos+6 ) = PCX_HEADER.colormap[value&12].red; *(rgb+pos+7 ) = PCX_HEADER.colormap[value&12].green; *(rgb+pos+8 ) = PCX_HEADER.colormap[value&12].blue; *(rgb+pos+9 ) = PCX_HEADER.colormap[value&3].red; *(rgb+pos+10) = PCX_HEADER.colormap[value&3].green; *(rgb+pos+11) = PCX_HEADER.colormap[value&3].blue; } else if(PALETTE_DEFINED) { *(rgb+pos ) = palette[value&192].red; *(rgb+pos+1 ) = palette[value&192].green; *(rgb+pos+2 ) = palette[value&192].blue; *(rgb+pos+3 ) = palette[value&48].red; *(rgb+pos+4 ) = palette[value&48].green; *(rgb+pos+5 ) = palette[value&48].blue; *(rgb+pos+6 ) = palette[value&12].red; *(rgb+pos+7 ) = palette[value&12].green; *(rgb+pos+8 ) = palette[value&12].blue; *(rgb+pos+9 ) = palette[value&3].red; *(rgb+pos+10) = palette[value&3].green; *(rgb+pos+11) = palette[value&3].blue; } pos+=12; count+=4; if(count >= image_w) { if(pos >= bitmap_size) break; if(padding) h += padding; count = 0; } break; ///////////////////////////////////// //1 bit per pixel //////////////////////////////////// case(1): *(rgb+pos ) = (value & 128) ? 255 : 0; //pixel 1 RED *(rgb+pos+3 ) = (value & 64) ? 255 : 0; //pixel 2 RED *(rgb+pos+6 ) = (value & 32) ? 255 : 0; //... *(rgb+pos+9 ) = (value & 16) ? 255 : 0; *(rgb+pos+12) = (value & 8) ? 255 : 0; *(rgb+pos+15) = (value & 4) ? 255 : 0; *(rgb+pos+18) = (value & 2) ? 255 : 0; *(rgb+pos+21) = (value & 1) ? 255 : 0; *(rgb+pos+1 ) = *(rgb+pos ); //pixel 1 GREEN *(rgb+pos+4 ) = *(rgb+pos+3 ); //pixel 2 GREEN *(rgb+pos+7 ) = *(rgb+pos+6 ); //... *(rgb+pos+10) = *(rgb+pos+9 ); *(rgb+pos+13) = *(rgb+pos+12); *(rgb+pos+16) = *(rgb+pos+15); *(rgb+pos+19) = *(rgb+pos+18); *(rgb+pos+22) = *(rgb+pos+21); *(rgb+pos+2 ) = *(rgb+pos ); //pixel 1 BLUE *(rgb+pos+5 ) = *(rgb+pos+3 ); //pixel 2 BLUE *(rgb+pos+8 ) = *(rgb+pos+6 ); //... *(rgb+pos+11) = *(rgb+pos+9 ); *(rgb+pos+14) = *(rgb+pos+12); *(rgb+pos+17) = *(rgb+pos+15); *(rgb+pos+20) = *(rgb+pos+18); *(rgb+pos+23) = *(rgb+pos+21); pos+=24; count+=8; if(count >= image_w) { if(pos >= bitmap_size) break; if(padding) h += padding; count = 0; } break; } }//end for } else { switch(PCX_HEADER.bpp) { ///////////////////////////////////// //8 bits per pixel //////////////////////////////////// case(8): if(plane == 0) *(rgb+pos ) = value; //red else if(plane == 1) *(rgb+pos+1) = value; //green else if(plane == 2) *(rgb+pos+2) = value; //blue else if(plane == 3) ; //alpha - not used else if(plane == 4) { if(COLORMAP_DEFINED) { *(rgb+pos ) = PCX_HEADER.colormap[value].red; *(rgb+pos+1) = PCX_HEADER.colormap[value].green; *(rgb+pos+2) = PCX_HEADER.colormap[value].blue; } else if(PALETTE_DEFINED) { *(rgb+pos ) = palette[value].red; *(rgb+pos+1) = palette[value].green; *(rgb+pos+2) = palette[value].blue; } else { *(rgb+pos ) = value; *(rgb+pos+1) = value; *(rgb+pos+2) = value; } } pos+=3; count++; if(count >= image_w) { if(plane < PCX_HEADER.planes-1) { plane++; pos -= (image_w*3); } else if(plane == PCX_HEADER.planes-1) { if(pos >= bitmap_size) break; if(padding) for(i = 0; i < padding; i++) { if(fread(&value, 1, 1, fp) != 1) PCX_RETURN_ERROR("Error reading from file\n") } plane = 0; } else { //fprintf(stderr, "size=%d, pos=%d, count=%d\n", bitmap_size, pos, count); if(pos >= bitmap_size) break; /*if(padding) for(i = 0; i < padding; i++) { if(fread(&value, 1, 1, fp) != 1) PCX_RETURN_ERROR("Error reading from file\n") }*/ } count = 0; } break; ///////////////////////////////////// //4 bits per pixel //////////////////////////////////// case(4): if(COLORMAP_DEFINED) { *(rgb+pos ) = PCX_HEADER.colormap[value&240].red; *(rgb+pos+1) = PCX_HEADER.colormap[value&240].green; *(rgb+pos+2) = PCX_HEADER.colormap[value&240].blue; *(rgb+pos+3) = PCX_HEADER.colormap[value&15].red; *(rgb+pos+4) = PCX_HEADER.colormap[value&15].green; *(rgb+pos+5) = PCX_HEADER.colormap[value&15].blue; } else if(PALETTE_DEFINED) { *(rgb+pos ) = palette[value&240].red; *(rgb+pos+1) = palette[value&240].green; *(rgb+pos+2) = palette[value&240].blue; *(rgb+pos+3) = palette[value&15].red; *(rgb+pos+4) = palette[value&15].green; *(rgb+pos+5) = palette[value&15].blue; } pos+=6; count+=2; if(count >= image_w) { if(pos >= bitmap_size) break; /*if(padding) for(i = 0; i < padding; i++) { if(fread(&value, 1, 1, fp) != 1) PCX_RETURN_ERROR("Error reading from file\n") }*/ count = 0; } break; ///////////////////////////////////// //2 bits per pixel //////////////////////////////////// case(2): if(COLORMAP_DEFINED) { *(rgb+pos ) = PCX_HEADER.colormap[value&192].red; *(rgb+pos+1 ) = PCX_HEADER.colormap[value&192].green; *(rgb+pos+2 ) = PCX_HEADER.colormap[value&192].blue; *(rgb+pos+3 ) = PCX_HEADER.colormap[value&48].red; *(rgb+pos+4 ) = PCX_HEADER.colormap[value&48].green; *(rgb+pos+5 ) = PCX_HEADER.colormap[value&48].blue; *(rgb+pos+6 ) = PCX_HEADER.colormap[value&12].red; *(rgb+pos+7 ) = PCX_HEADER.colormap[value&12].green; *(rgb+pos+8 ) = PCX_HEADER.colormap[value&12].blue; *(rgb+pos+9 ) = PCX_HEADER.colormap[value&3].red; *(rgb+pos+10) = PCX_HEADER.colormap[value&3].green; *(rgb+pos+11) = PCX_HEADER.colormap[value&3].blue; } else if(PALETTE_DEFINED) { *(rgb+pos ) = palette[value&192].red; *(rgb+pos+1 ) = palette[value&192].green; *(rgb+pos+2 ) = palette[value&192].blue; *(rgb+pos+3 ) = palette[value&48].red; *(rgb+pos+4 ) = palette[value&48].green; *(rgb+pos+5 ) = palette[value&48].blue; *(rgb+pos+6 ) = palette[value&12].red; *(rgb+pos+7 ) = palette[value&12].green; *(rgb+pos+8 ) = palette[value&12].blue; *(rgb+pos+9 ) = palette[value&3].red; *(rgb+pos+10) = palette[value&3].green; *(rgb+pos+11) = palette[value&3].blue; } pos+=12; count+=4; if(count >= image_w) { if(pos >= bitmap_size) break; /*if(padding) for(i = 0; i < padding; i++) { if(fread(&value, 1, 1, fp) != 1) PCX_RETURN_ERROR("Error reading from file\n") }*/ count = 0; } break; ///////////////////////////////////// //1 bit per pixel //////////////////////////////////// case(1): *(rgb+pos ) = (value & 128) ? 255 : 0; //pixel 1 RED *(rgb+pos+3 ) = (value & 64) ? 255 : 0; //pixel 2 RED *(rgb+pos+6 ) = (value & 32) ? 255 : 0; //... *(rgb+pos+9 ) = (value & 16) ? 255 : 0; *(rgb+pos+12) = (value & 8) ? 255 : 0; *(rgb+pos+15) = (value & 4) ? 255 : 0; *(rgb+pos+18) = (value & 2) ? 255 : 0; *(rgb+pos+21) = (value & 1) ? 255 : 0; *(rgb+pos+1 ) = *(rgb+pos ); //pixel 1 GREEN *(rgb+pos+4 ) = *(rgb+pos+3 ); //pixel 2 GREEN *(rgb+pos+7 ) = *(rgb+pos+6 ); //... *(rgb+pos+10) = *(rgb+pos+9 ); *(rgb+pos+13) = *(rgb+pos+12); *(rgb+pos+16) = *(rgb+pos+15); *(rgb+pos+19) = *(rgb+pos+18); *(rgb+pos+22) = *(rgb+pos+21); *(rgb+pos+2 ) = *(rgb+pos ); //pixel 1 BLUE *(rgb+pos+5 ) = *(rgb+pos+3 ); //pixel 2 BLUE *(rgb+pos+8 ) = *(rgb+pos+6 ); //... *(rgb+pos+11) = *(rgb+pos+9 ); *(rgb+pos+14) = *(rgb+pos+12); *(rgb+pos+17) = *(rgb+pos+15); *(rgb+pos+20) = *(rgb+pos+18); *(rgb+pos+23) = *(rgb+pos+21); pos+=24; count+=8; if(count >= image_w) { if(pos >= bitmap_size) break; /*if(padding) for(i = 0; i < padding; i++) { if(fread(&value, 1, 1, fp) != 1) PCX_RETURN_ERROR("Error reading from file\n") }*/ count = 0; } break; } } }//end while return PCX_ERR_NO_ERROR; err: return PCX_ERR_GENERIC; } /* ---------------------------------------------------------------------- */ /* load */ struct pcx_state { FILE *fp; int w; /* image width: 1... */ int h; /* image height: 1... */ int np; /* number of pages: 1... */ size_t flen; /* file length */ fim_byte_t*rgb; /* pixels, from upper left to lower right, line by line */ int bytes_per_line; /* rgb has bytes_per_line bytes per line */ }; static void* pcx_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { /* it is safe to ignore filename, page, thumbnail */ struct pcx_state *h = FIM_NULL; pcx_err_t errval = PCX_ERR_GENERIC; h = (struct pcx_state *)fim_calloc(1,sizeof(*h)); if(!h) goto oops; h->fp = fp; if(fseek(h->fp,0,SEEK_END)!=0) goto oops; if((h->flen=ftell(h->fp))==(unsigned)-1) goto oops; errval = pcx_load_image_info_fp(h->fp, &h->np, &i->width, &i->height); if(errval != PCX_ERR_NO_ERROR) { std::cerr << "Failed pcx_load_image_info_fp !\n"; goto oops; } i->npages = 1; h->w = i->width; h->h = i->height; h->bytes_per_line = i->width * 3; h->rgb = (fim_byte_t*)fim_malloc(i->height * h->bytes_per_line ); if(!h->rgb) { std::cerr << "Failed fim_malloc!\n"; goto oops; } errval = pcx_load_image_fp(h->fp, page, h->rgb, h->bytes_per_line); if(errval != PCX_ERR_NO_ERROR) { std::cerr << "Failed pcx_load_image_fp!\n"; goto oops; } return h; oops: if(h) { if(h->rgb) fim_free(h->rgb); fim_free(h); } return FIM_NULL; } static void pcx_read(fim_byte_t *dst, unsigned int line, void *data) { struct pcx_state *h = (struct pcx_state *) data; int c; for (c=0;cw;++c) { dst[c*3+0] = h->rgb[h->bytes_per_line*line+c*3+0]; dst[c*3+1] = h->rgb[h->bytes_per_line*line+c*3+1]; dst[c*3+2] = h->rgb[h->bytes_per_line*line+c*3+2]; } } static void pcx_done(void *data) { struct pcx_state *h = (struct pcx_state *) data; fclose(h->fp); fim_free(h->rgb); fim_free(h); } struct ida_loader pcx_loader = { /* * 0000000: 0a05 0108 0000 0000 ff03 5702 2c01 2c01 ..........W.,.,. */ /*magic:*/ "\012", /*moff:*/ 0, /*mlen:*/ 1, /*name:*/ "pcx", /*init:*/ pcx_init, /*read:*/ pcx_read, /*done:*/ pcx_done, }; static void fim__init init_rd(void) { fim_load_register(&pcx_loader); } } #endif /* FIM_WITH_PCX */ fim-0.6-rc2/src/SDLDevice.h0000644000175000017500000001172314454357130012253 00000000000000/* $LastChangedDate: 2023-07-15 01:46:31 +0200 (Sat, 15 Jul 2023) $ */ /* SDLDevice.h : sdllib device Fim driver header file (c) 2008-2023 Michele Martone This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FIM_SDLDEVICE_H #define FIM_SDLDEVICE_H #ifdef FIM_WITH_LIBSDL #define FIM_WITH_LIBSDL_VERSION FIM_WITH_LIBSDL #include "DisplayDevice.h" #include #if (FIM_WITH_LIBSDL_VERSION == 2) #include #endif class SDLDevice FIM_FINAL :public DisplayDevice { private: SDL_Surface *screen_; #if (FIM_WITH_LIBSDL_VERSION == 1) #else SDL_Texture *texture_; #endif SDL_Event event_; #if (FIM_WITH_LIBSDL_VERSION == 1) const SDL_VideoInfo* vi_; SDL_VideoInfo bvi_; #else SDL_Window* wi_; SDL_Renderer *re_; #endif fim_coo_t current_w_; fim_coo_t current_h_; fim_bpp_t Bpp_,bpp_; fim::string opts_; static const fim_coo_t border_height_=1; bool want_windowed_; bool want_mouse_display_; bool want_resize_; #if (FIM_WITH_LIBSDL_VERSION == 1) SDL_Rect ** modes_; #else int numDisplayModes_; #endif void get_modes_list(void); fim_err_t get_resolution(const char spec, fim_coo_t & w, fim_coo_t & h) const; public: #if (FIM_WITH_LIBSDL_VERSION == 2) fim_sys_int get_input_inner(fim_key_t * c, SDL_Event*eventp, fim_sys_int *keypressp, bool want_poll) const; #endif #ifndef FIM_WANT_NO_OUTPUT_CONSOLE SDLDevice(MiniConsole& mc_, fim::string opts); #else /* FIM_WANT_NO_OUTPUT_CONSOLE */ SDLDevice( fim::string opts); #endif /* FIM_WANT_NO_OUTPUT_CONSOLE */ virtual fim_err_t display( const void *ida_image_img, // source image structure (struct ida_image *)(but we refuse to include header files here!) //void* rgb,// destination gray array and source rgb array fim_coo_t iroff,fim_coo_t icoff, // row and column offset of the first input pixel fim_coo_t irows,fim_coo_t icols,// rows and columns in the input image fim_coo_t icskip, // input columns to skip for each line fim_coo_t oroff,fim_coo_t ocoff,// row and column offset of the first output pixel fim_coo_t orows,fim_coo_t ocols,// rows and columns to draw in output buffer fim_coo_t ocskip,// output columns to skip for each line fim_flags_t flags// some flags ) FIM_OVERRIDE; fim_err_t initialize(sym_keys_t &sym_keys)FIM_OVERRIDE; void finalize(void) FIM_OVERRIDE; fim_coo_t get_chars_per_line(void)const FIM_OVERRIDE; fim_coo_t get_chars_per_column(void)const FIM_OVERRIDE; fim_coo_t width(void)const FIM_OVERRIDE; fim_coo_t height(void)const FIM_OVERRIDE; fim_err_t status_line(const fim_char_t *msg) FIM_OVERRIDE; fim_bool_t handle_console_switch(void) FIM_OVERRIDE { return false; } fim_err_t clear_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2) FIM_NOEXCEPT FIM_OVERRIDE; fim_sys_int get_input(fim_key_t * c, bool want_poll=false) FIM_OVERRIDE; virtual fim_key_t catchInteractiveCommand(fim_ts_t seconds)const FIM_OVERRIDE; void fs_render_fb(fim_coo_t x, fim_coo_t y, FSXCharInfo *charInfo, fim_byte_t *data) FIM_NOEXCEPT; fim_err_t fs_puts(struct fs_font *f_, fim_coo_t x, fim_coo_t y, const fim_char_t *str) FIM_NOEXCEPT FIM_OVERRIDE ; void flush(void)FIM_OVERRIDE; void lock(void) FIM_OVERRIDE ; void unlock(void) FIM_OVERRIDE ; fim_bpp_t get_bpp(void)const FIM_OVERRIDE { return bpp_; } bool sdl_window_update(void); virtual fim_coo_t status_line_height(void)const FIM_OVERRIDE; private: inline void setpixel(SDL_Surface *screen_, fim_coo_t x, fim_coo_t y, Uint8 r, Uint8 g, Uint8 b) FIM_NOEXCEPT; void status_screen_(int desc,int draw_output){ return ; } fim_err_t fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t color) FIM_NOEXCEPT FIM_OVERRIDE; fim_err_t fill_rect(fim_coo_t x1, fim_coo_t x2, fim_coo_t y1,fim_coo_t y2, fim_color_t icolor, fim_color_t ocolor) FIM_NOEXCEPT; fim_coo_t txt_width(void)const ; fim_coo_t txt_height(void)const ; virtual fim_err_t resize(fim_coo_t w, fim_coo_t h) FIM_OVERRIDE ; bool allowed_resolution(fim_coo_t w, fim_coo_t h) const; virtual fim_err_t reinit(const fim_char_t *rs) FIM_OVERRIDE; fim_err_t parse_optstring(const fim_char_t *os); virtual fim_err_t set_wm_caption(const fim_char_t *msg) FIM_OVERRIDE; fim_err_t reset_wm_caption(void)const; fim_err_t post_wmresize(void); fim_err_t draw_help_map(void); #if (FIM_WITH_LIBSDL_VERSION == 2) void sdl2_redraw(void)const; #endif }; #endif /* FIM_WITH_LIBSDL */ #endif /* FIM_SDLDEVICE_H */ fim-0.6-rc2/src/FbiStuffJpeg.cpp0000644000175000017500000005066114454347340013370 00000000000000/* $LastChangedDate: 2023-04-09 16:02:31 +0200 (Sun, 09 Apr 2023) $ */ /* FbiStuffJpeg.cpp : fbi functions for JPEG files, modified for fim (c) 2007-2023 Michele Martone (c) 1998-2006 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file comes from fbi, and will undergo severe reorganization. * */ #include #include #if 0 #ifdef HAVE_STDLIB_H //#undef HAVE_STDLIB_H #define HAVE_STDLIB_H_BACKUP HAVE_STDLIB_H #endif /* HAVE_STDLIB_H */ #endif /* 0 */ #include //#include //#include #include "FbiStuff.h" #include "FbiStuffLoader.h" //#include "loader.h" //#define FIM_WITH_LIBEXIF 1 #ifdef FIM_WITH_LIBEXIF #include #define HAVE_NEW_EXIF 1 #endif /* FIM_WITH_LIBEXIF */ // extern "C" { // we require C linkage for these symbols #include } #ifndef HAVE_BOOLEAN #ifndef TRUE #define TRUE 1 #endif #endif /* HAVE_BOOLEAN */ #define FIM_JPEGLIB_TRUE TRUE /* jpeglib 8.0 uses 'boolean' */ /* From fbi's misc.h : */ #if 0 #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (fim_char_t *)__mptr - offsetof(type,member) );}) #define array_size(x) (sizeof(x)/sizeof(x[0])) #endif /* */ #ifdef USE_X11 #include #include #include #include #include #include "RegEdit.h" #include "ida.h" #include "viewer.h" #endif /* USE_X11 */ namespace fim { #if HAVE_NEW_EXIF extern CommandConsole cc; #endif /* HAVE_NEW_EXIF */ int fim_jerr=0; /* ---------------------------------------------------------------------- */ /* load */ struct jpeg_state { FILE * infile; /* source file */ struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; JSAMPARRAY buffer; /* Output row buffer */ int row_stride,linelength; /* physical row width in output buffer */ fim_byte_t *image,*ptr; /* thumbnail */ fim_byte_t *thumbnail; unsigned int tpos, tsize; struct ida_image_info *i; /* here for load_free_extras */ }; /* ---------------------------------------------------------------------- */ /* data source manager for thumbnail images */ /*static void thumbnail_src_init(struct jpeg_decompress_struct *cinfo) { struct jpeg_state *h = container_of(cinfo, struct jpeg_state, cinfo); cinfo->src->next_input_byte = h->thumbnail; cinfo->src->bytes_in_buffer = h->tsize; }*/ static int thumbnail_src_fill(struct jpeg_decompress_struct *cinfo) { FIM_FBI_PRINTF("jpeg: panic: no more thumbnail input data\n"); exit(1); } static void thumbnail_src_skip(struct jpeg_decompress_struct *cinfo, long num_bytes) { cinfo->src->next_input_byte += num_bytes; } static void thumbnail_src_term(struct jpeg_decompress_struct *cinfo) { /* nothing */ } //!! //see jpeg_init static struct jpeg_source_mgr thumbnail_mgr ; /* static struct jpeg_source_mgr thumbnail_mgr = { .init_source = thumbnail_src_init, .fill_input_buffer = thumbnail_src_fill, .skip_input_data = thumbnail_src_skip, .resync_to_restart = jpeg_resync_to_restart, .term_source = thumbnail_src_term, }; */ //!! static void fim_error_exit (j_common_ptr cinfo) { /* FIM : NEW, UNFINISHED (if used now, it would break things) read jpeglib's docs to finish this :) */ /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */ // my_error_ptr myerr = (my_error_ptr) cinfo->err; /* Always display the message. */ /* We could postpone this until after returning, if we chose. */ std::cerr << "jpeglib:"<<"\n"; (*cinfo->err->output_message) (cinfo); /* Return control to the setjmp point */ // longjmp(myerr->setjmp_buffer, 1); fim_jerr=1; } #ifdef FIM_WITH_LIBEXIF static void fim_ExifContentForeachEntryFunc (ExifEntry *entry, void * user_data) { fim_char_t buffer[FIM_EXIF_BUFSIZE]; Namespace *nsp = (Namespace*) ((void**)user_data)[0]; ExifContent *c = (ExifContent *) ((void**)user_data)[1]; const fim_char_t * const value = exif_entry_get_value(entry, buffer, sizeof(buffer)); ExifIfd ifd = exif_content_get_ifd (c); const fim_char_t * const title = exif_tag_get_name_in_ifd (entry->tag,ifd); /* exif_tag_get_name() is deprecated */ if(nsp) /* std::cout << "|" << title << "|\n", */ nsp->setVariable(string("EXIF_") + string(title),value); } static void fim_ExifDataForeachContentFunc (ExifContent *content, void * user_data) { void * user_data2[] = {user_data,content}; exif_content_foreach_entry (content, fim_ExifContentForeachEntryFunc, user_data2); } static void dump_exif(FILE *out, ExifData *ed, Namespace *nsp = FIM_NULL) { /* FIXME: temporarily here; shall transfer keys/values to a Namespace object */ #if HAVE_NEW_EXIF if(nsp) exif_data_foreach_content (ed, fim_ExifDataForeachContentFunc, nsp); #endif /* HAVE_NEW_EXIF */ /* #if HAVE_NEW_EXIF */ #if 0 for (int i = 0; i < EXIF_IFD_COUNT; i++) { fim_char_t buffer[FIM_EXIF_BUFSIZE]; const fim_char_t *value=FIM_NULL; ExifEntry *ee=FIM_NULL; /* values of EXIF_TAG_* in libexif/exif-tag.h */ //for (i = 0; i < 1; i++) { // first only std::cout << "EXIF_IFD_COUNT " << i << " " << EXIF_IFD_COUNT << "\n"; if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_ORIENTATION)){ // value can be of the form "X - Y", with X and Y in // {top,bottom,left,right} // here we handle only // on: http://sylvana.net/jpegcrop/exif_orientation.html // we got the following combinations: // Value 0th Row 0th Column // 1 top left side // 2 top right side // 3 bottom right side // 4 bottom left side // 5 left side top // 6 right side top // 7 right side bottom // 8 left side bottom // // neatly depicted in an F letter example: // // 1 2 3 4 5 6 7 8 // // 888888 888888 88 88 8888888888 88 88 8888888888 // 88 88 88 88 88 88 88 88 88 88 88 88 // 8888 8888 8888 8888 88 8888888888 8888888888 88 // 88 88 88 88 // 88 88 888888 888888 // // note that (in this order): // 2,3,5,7 want a mirror transformation // 4,3 want a flip transformation // 7,8 want a cw rotation // 5,6 want a ccw rotation // bool shouldmirror,shouldrotatecw,shouldrotateccw,shouldflip; fim_char_t r,c;const fim_char_t *p;fim_char_t f; value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(!value || ((p=strstr(value," - "))==FIM_NULL))goto uhmpf; r=tolower(value[0]); c=tolower(p[3]); switch(r) { case 't': switch(c){ case 'l':f=1; break; case 'r':f=2; break; default: f=0; } break; case 'b': switch(c){ case 'r':f=3; break; case 'l':f=4; break; default: f=0; } break; case 'l': switch(c){ case 't':f=5; break; case 'b':f=8; break; default: f=0; } break; case 'r': switch(c){ case 't':f=6; break; case 'b':f=7; break; default: f=0; } break; default: f=0; } //if(f==0)goto uhmpf; shouldmirror=(f==2 || f==4 || f==5 || f==7); shouldflip=(f==4 || f==3); shouldrotatecw=(f==5 || f==6); shouldrotateccw=(f==7 || f==8); // std::cout << "EXIF_TAG_ORIENTATION FOUND !\n", // std::cout << "VALUE: " <<(int)f << r<< c<< // shouldmirror<< shouldrotatecw<< shouldrotateccw<< shouldflip, // std::cout << "\n"; if(shouldrotateccw)cc.setVariable("exif_orientation",1); if(shouldrotatecw)cc.setVariable("exif_orientation",3); if(shouldmirror)cc.setVariable("exif_mirrored",1); if(shouldflip)cc.setVariable("exif_flipped",1); // FIXME: should complete this code by setting up some mechanism for recovering this rotation/flip info uhmpf: 1; } /* FIXME: shall rationalize the following: */ if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_DATE_TIME)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_DATE_TIME",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_DATE_TIME_ORIGINAL)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_DATE_TIME_ORIGINAL",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_DATE_TIME_DIGITIZED)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_DATE_TIME_DIGITIZED",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_EXPOSURE_TIME)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_EXPOSURE_TIME",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_FNUMBER)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_FNUMBER",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_BATTERY_LEVEL)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_BATTERY_LEVEL",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_APERTURE_VALUE)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_APERTURE_VALUE",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_METERING_MODE)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_METERING_MODE",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_EXPOSURE_PROGRAM)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_EXPOSURE_PROGRAM",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_ISO_SPEED_RATINGS)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_ISO_SPEED_RATINGS",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_MODEL)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_MODEL",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_TIME_ZONE_OFFSET)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_TIME_ZONE_OFFSET",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_IMAGE_UNIQUE_ID)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_IMAGE_UNIQUE_ID",value); } if( ee=exif_content_get_entry(ed->ifd[i],EXIF_TAG_SHARPNESS)){ value=exif_entry_get_value(ee, buffer, sizeof(buffer)); if(nsp) nsp->setVariable("EXIF_TAG_SHARPNESS",value); } // ... EXIF_TAG_XP_TITLE EXIF_TAG_XP_COMMENT EXIF_TAG_XP_AUTHOR EXIF_TAG_XP_KEYWORDS EXIF_TAG_XP_SUBJECT } #endif /* HAVE_NEW_EXIF */ #if 0 for (i = 0; i < EXIF_IFD_COUNT; i++) { fprintf(out," ifd %s\n", exif_ifd_get_name (i)); for (tag = 0; tag < 0xffff; tag++) { title = exif_tag_get_title(tag); if (!title) continue; ee = exif_content_get_entry (ed->ifd[i], tag); if (FIM_NULL == ee) continue; #ifdef HAVE_NEW_EXIF value = exif_entry_get_value(ee, buffer, sizeof(buffer)); #else /* HAVE_NEW_EXIF */ value = exif_entry_get_value(ee); #endif /* HAVE_NEW_EXIF */ fprintf(out," 0x%04x %-30s %s\n", tag, title, value); } } if (ed->data && ed->size) fprintf(out," thumbnail\n %d bytes data\n", ed->size); #endif } #endif /* FIM_WITH_LIBEXIF */ /* ---------------------------------------------------------------------- */ /* jpeg loader */ static void* jpeg_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida_image_info *i, int thumbnail) { struct jpeg_state *h; jpeg_saved_marker_ptr mark; fim_jerr=0; #ifdef FIM_WITH_LIBEXIF //std::cout << "EXIF is not implemented, really :) \n"; #endif /* FIM_WITH_LIBEXIF */ h = (struct jpeg_state *)fim_calloc(1,sizeof(*h)); if(!h) goto oops; h->infile = fp; h->i = i; h->jerr.error_exit=FIM_NULL; // ? h->cinfo.err = jpeg_std_error(&h->jerr); /* FIXME : should use an error manager of ours (this one exits the program!) */ h->jerr.error_exit = fim_error_exit; /* FIXME : should use an error manager of ours (this one exits the program!) */ //h->jerr.error_exit = FIM_NULL ; /* FIXME : should use an error manager of ours (this one exits the program!) */ if(fim_jerr /*&& h->jerr.msg_code*/)goto oops; jpeg_create_decompress(&h->cinfo); /*if(h->jerr.msg_code)goto oops;*/ if(fim_jerr /*&& h->jerr.msg_code*/)goto oops; jpeg_save_markers(&h->cinfo, JPEG_COM, 0xffff); /* comment */ if(fim_jerr /*&& h->jerr.msg_code*/)goto oops; jpeg_save_markers(&h->cinfo, JPEG_APP0+1, 0xffff); /* EXIF */ jpeg_save_markers(&h->cinfo, JPEG_APP0+13, 0xffff); /* ?? */ if(fim_jerr /*&& h->jerr.msg_code*/)goto oops; jpeg_stdio_src(&h->cinfo, h->infile); if(fim_jerr /*&& h->jerr.msg_code*/)goto oops; // if(jpeg_read_header(&h->cinfo, FIM_JPEGLIB_TRUE)==0) goto oops; jpeg_read_header(&h->cinfo, FIM_JPEGLIB_TRUE); if(fim_jerr /*&& h->jerr.msg_code*/)goto oops; // if(h->jerr.msg_code)goto oops; // this triggers with apparently good file for (mark = h->cinfo.marker_list; FIM_NULL != mark; mark = mark->next) { switch (mark->marker) { case JPEG_COM: if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("jpeg: comment found (COM marker) [%.*s]\n", (int)mark->data_length, mark->data); load_add_extra(i,EXTRA_COMMENT,mark->data,mark->data_length); break; case JPEG_APP0 +1: if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("jpeg: exif data found (APP1 marker)\n"); /* load_add_extra(i,EXTRA_COMMENT,mark->data,mark->data_length); */ #if HAVE_NEW_EXIF #ifdef FIM_WITH_LIBEXIF { ExifData *ed=exif_data_new_from_data(mark->data,mark->data_length); if(ed) #if FIM_EXPERIMENTAL_IMG_NMSPC dump_exif(stdout,ed,i->nsp); #else /* FIM_EXPERIMENTAL_IMG_NMSPC */ dump_exif(stdout,ed,FIM_NULL); #endif /* FIM_EXPERIMENTAL_IMG_NMSPC */ exif_data_unref(ed); } #endif /* FIM_WITH_LIBEXIF */ #endif /* HAVE_NEW_EXIF */ #ifdef FIM_WITH_LIBEXIF_nonono if (thumbnail) { ExifData *ed; ed = exif_data_new_from_data(mark->data,mark->data_length); if (ed->data && ed->data[0] == 0xff && ed->data[1] == 0xd8) { if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("jpeg: exif thumbnail found\n"); /* save away thumbnail data */ h->thumbnail = fim_malloc(ed->size); if(!h->thumbnail) goto oops; h->tsize = ed->size; memcpy(h->thumbnail,ed->data,ed->size); } exif_data_unref(ed); } #endif /* FIM_WITH_LIBEXIF_nonono */ break; case JPEG_APP0 +13: if (FbiStuff::fim_filereading_debug()) printf("jpeg: exif data found (APP13 marker)\n"); /* load_add_extra(i,EXTRA_COMMENT,mark->data,mark->data_length); */ break; default: printf("jpeg: unknown marker\n"); } } // !! thumbnail_mgr.init_source = /*thumbnail_src_init*/ FIM_NULL /* it is not useful, and breaks c++98 standard C++ compilation */; thumbnail_mgr.fill_input_buffer = thumbnail_src_fill; thumbnail_mgr.skip_input_data = thumbnail_src_skip; thumbnail_mgr.resync_to_restart = jpeg_resync_to_restart; thumbnail_mgr.term_source = thumbnail_src_term; // !! if (h->thumbnail) { /* save image size */ i->thumbnail = 1; i->real_width = h->cinfo.image_width; i->real_height = h->cinfo.image_height; /* re-setup jpeg */ jpeg_destroy_decompress(&h->cinfo); if(fim_jerr)goto oops; // if(h->jerr.msg_code)goto oops; // this triggers with apparently good files fim_fclose(h->infile); h->infile = FIM_NULL; jpeg_create_decompress(&h->cinfo); if(fim_jerr)goto oops; // if(h->jerr.msg_code)goto oops; h->cinfo.src = &thumbnail_mgr; jpeg_read_header(&h->cinfo, FIM_JPEGLIB_TRUE); if(fim_jerr)goto oops; // if(h->jerr.msg_code)goto oops; } h->cinfo.out_color_space = JCS_RGB; jpeg_start_decompress(&h->cinfo); if(fim_jerr)goto oops; // if(h->jerr.msg_code)goto oops; i->width = h->cinfo.image_width; i->height = h->cinfo.image_height; i->npages = 1; switch (h->cinfo.density_unit) { case 0: /* unknown */ break; case 1: /* dot per inch */ i->dpi = h->cinfo.X_density; break; case 2: /* dot per cm */ i->dpi = res_cm_to_inch(h->cinfo.X_density); break; } return h; oops: std::cerr << "OOPS: problems decoding "<< filename <<"...\n"; if( h ) jpeg_destroy_decompress (&h->cinfo); if( h && h->thumbnail) fim_free(h->thumbnail); if( h ) fim_free(h); fim_jerr=0;/* ready for the next */ return FIM_NULL; } static void jpeg_read(fim_byte_t *dst, unsigned int line, void *data) { struct jpeg_state *h = (struct jpeg_state*)data; JSAMPROW row = dst; // if(h->jerr.msg_code)goto oops; jpeg_read_scanlines(&h->cinfo, &row, 1); // oops: return; } static void jpeg_done(void *data) { struct jpeg_state *h = (struct jpeg_state*)data; jpeg_destroy_decompress(&h->cinfo); if (h->infile) fim_fclose(h->infile); if (h->thumbnail) fim_free(h->thumbnail); load_free_extras(h->i); fim_free(h); } static struct ida_loader jpeg_loader = { /*magic:*/ "\xff\xd8", /*moff:*/ 0, /*mlen:*/ 2, /*name:*/ "libjpeg", /*init:*/ jpeg_init, /*read:*/ jpeg_read, /*done:*/ jpeg_done, }; static void fim__init init_rd(void) { fim_load_register(&jpeg_loader); } #ifdef USE_X11 /* ---------------------------------------------------------------------- */ /* jpeg writer */ static Widget jpeg_shell; static Widget jpeg_text; static int jpeg_quality = 75; static void jpeg_button_cb(Widget widget, XtPointer clientdata, XtPointer call_data) { XmSelectionBoxCallbackStruct *cb = call_data; if (XmCR_OK == cb->reason) { jpeg_quality = atoi(XmTextGetString(jpeg_text)); do_save_print(); } XtUnmanageChild(jpeg_shell); } static int jpeg_conf(Widget parent, struct ida_image *img) { fim_char_t tmp[32]; if (!jpeg_shell) { /* build dialog */ jpeg_shell = XmCreatePromptDialog(parent,"jpeg",FIM_NULL,0); XmdRegisterEditres(XtParent(jpeg_shell)); XtUnmanageChild(XmSelectionBoxGetChild(jpeg_shell,XmDIALOG_HELP_BUTTON)); jpeg_text = XmSelectionBoxGetChild(jpeg_shell,XmDIALOG_TEXT); XtAddCallback(jpeg_shell,XmNokCallback,jpeg_button_cb,FIM_NULL); XtAddCallback(jpeg_shell,XmNcancelCallback,jpeg_button_cb,FIM_NULL); } sprintf(tmp,"%d",jpeg_quality); XmTextSetString(jpeg_text,tmp); XtManageChild(jpeg_shell); return 0; } static int jpeg_write(FILE *fp, struct ida_image *img) { struct jpeg_compress_struct cinfo; struct jpeg_error_mgr jerr; fim_byte_t *line; unsigned int i; cinfo.err = jpeg_std_error(&jerr); jpeg_create_compress(&cinfo); jpeg_stdio_dest(&cinfo, fp); cinfo.image_width = img->i.width; cinfo.image_height = img->i.height; if (img->i.dpi) { cinfo.density_unit = 1; cinfo.X_density = img->i.dpi; cinfo.Y_density = img->i.dpi; } cinfo.input_components = 3; cinfo.in_color_space = JCS_RGB; jpeg_set_defaults(&cinfo); jpeg_set_quality(&cinfo, jpeg_quality, FIM_JPEGLIB_TRUE); jpeg_start_compress(&cinfo, FIM_JPEGLIB_TRUE); for (i = 0, line = img->data; i < img->i.height; i++, line += img->i.width*3) jpeg_write_scanlines(&cinfo, &line, 1); jpeg_finish_compress(&(cinfo)); jpeg_destroy_compress(&(cinfo)); return 0; } struct ida_writer jpeg_writer = { /*label:*/ "JPEG", /* ext: */ { "jpg", "jpeg", FIM_NULL}, /*write:*/ jpeg_write, /*conf: */ jpeg_conf, }; static void fim__init init_wr(void) { fim_write_register(&jpeg_writer); } #endif /* USE_X11 */ #if 0 #ifdef HAVE_STDLIB_H_BACKUP #define HAVE_STDLIB_H HAVE_STDLIB_H_BACKUP #undef HAVE_STDLIB_H_BACKUP #endif /* HAVE_STDLIB_H_BACKUP */ #endif } fim-0.6-rc2/VERSION0000644000175000017500000000001014503371456010606 000000000000000.6-rc2 fim-0.6-rc2/depcomp0000644000175000017500000003177314454347340011134 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. This file always lives in the current directory. # Also, the AIX compiler puts `$object:' at the start of each line; # $object doesn't have directory information. stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" outname="$stripped.o" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi 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,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Must come before tru64. # Intel's C compiler understands `-MD -MF file'. However # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # 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: "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; 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 tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a space and a tab in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0