./0000700000175000017500000000000015051153266007737 5ustar korykory./TODO0000600000175000017500000001734215051153244010434 0ustar korykoryBasic things: * Middle ellipsis breaks search highlighting. * Improve ga and gA commands. (partially done) * Queueing of file operations. * Backgrounding of commands with job control (pause/resume/kill). (partially done) * Display parsing errors in dialog that indicate the error, don't rely on status bar. (partially done) * Remove trash option, since we have two commands for deletion. * Filtering in menus. * Process shell pause request for running in %s. * Responsive TUI during blocking operations. * Better failed operation messages. (partially done) * Make status bar able to display error and info messages at the same time. * Command to create multiple copies of selected file. Documentation: * State the need of *nix tools on Windows more explicitly. * Document single and double quotes treating in the command-line mode. * Divide docs into several files (as it's quite big now). * Document name conflict resolution options. * Add separate section on bookmarks. Vi(m) specific features: * Add support for directory completion for some of :set options. * 'wildignore' ('wig') option * Think about dot normal mode command. * Completion based on global (when one enters pattern, e.g. *.c). * Add support of n flag for :substitute command. * :let mapleader and support. * Ctrl-W F key. * Add support of [count] for Ctrl-E/Ctrl-Y/H/M/L. * nrformats option as in Vim. * Better ranges (add support for search patterns). * :map without arguments. * Consider adding support for sequences like \. * Completion of first argument for :map commands. * Make gU2U and similar commands work as in Vim. * Change file list filters to use fold levels. * /, ?, n, N as selectors. * Fix '' to go back to all jumps G gg links (in one directory?). * Maybe make zf and zd more Vim-like. * Kinda macros like in Vim (qa ... q). * Add =~ and !~ operators to expressions. * Add titleold option. * Support hex and octal numbers in :set. * Maybe add %p macro to rulerformat option. Windows: * Make properties dialog change file attributes recursively. * Setup automatic Windows builds for master branch. (partially done) * Make :chmod accept arguments. * Add command to create .lnk files. * Sort completion items ignoring their case on Windows. * Handle numpad keys better, just like corresponding non-numpad keys. * Make 'fastrun' understand file extensions on Windows (to ignore them). * Make 'slowfs' option available on Windows * Support more of pdcurses specific keys (e.g. , ). * Read first bytes of files and treat '#!' files as executable. Possible things to add: * Add macros for marks. * Make package for Cygwin. * Position macros for user defined commands (%1, %2, ..., %9). * Improve sorting (iext; choosing multiple sorting keys in dialog). (partially done) * Merged directory history for both panes. * Wrapping of lines in the menus. * Something like :g/.../com and :v/.../com in Vim. * Don't reread config files on :restart for --no-configs session. * Better renaming keys. * Quad/multiple-views * Add a general file preview script. * A more convenient shortcut for the :filter command (at least :filt). * Multiselect for items (menu and/or file list). * inotify support on Linux. (partially done) * :filter !filter-tool * Use system wide mimetypes file. /etc/mailcap? * Add "|" command to menu to process list with external tool. * "Blow directory" command to replace directory with its content. * Emacs like Dired or Helm incremental search and complete * $_ env var and Alt-T combination as in bash shell. * Templates for :touch. * Reverse searching * Add g/ and g? commands (search, but don't select files). * Parse escape sequences in menus as in preview. * Virtual File System - currently vifm can use FUSE to mount most file systems. * Something to control behaviour of menu picks. * Like gv but to select just pasted files (gp?). * g~ and g?. * Add trashes bang to list empty trashes or all of them. * 'wildmode' option. * Try to make it work in monochrome terminal. * Support of command line arguments like ~/some.ssh/server/path (for FUSE). * Treat `:filter pattern` as `:filter \`. * Add search history for less-like mode. * "Rename existing file" option on name conflicts. * Make use of new job information in :jobs menu. * Update visible symlinks in the other pane on updating current pane. * Mouse support. (partially done) * Possibility to make colorful background per column. * Add a key to menu mode to repeat command and update menu. * Consider preserving more on file copy (ACL, sparse files). * File access history. * Make :alink, :copy, ... accept globs (e.g. :co *.c). * Highlight first line of command-editing buffer in different color. * Output numbers on :hi if it were numbers in color scheme. Questionable things: * Full client-server operation of vifm (separate core from TUI). * Maybe re-position cursor after :!ls%u. * Remove items from :history command menu? * Maybe use @path syntax to load custom views. * Add + and - commands to undo by commands, not command groups. * Modify marks on rename operations. * Remove delay on file overwrite. * Make :undolist more interactive. * Add GUI interface one day. * Use custom title for fuse mounts * Option to trigger completion on slash in command-line. * :edit - select the file after exiting editor? * Ability to enter a mount with multiple vifm instances without reunpacking/reconnecting. * Consider conflict resolution for :move and alike. * Make directory stack menu interactive? * Tree-like view with support of foldings (for each directory). (partially done) * Consider adding "da" to remove all elements in :bmarks menu. * Command like :run[ &]. * Add :set to menu mode command-line. * Consider asking more often before performing file operations. * Termcap or terminfo support for keybindings * Shorten home path to ~ in item origins? * Add :increment and :decrement commands. * Consider changing "dd" to "d" in menus. * Consider caching directory sizes in vifminfo. * Shell alias execution (and completion) (partially done) * Decide whether redefining command shortcuts like :fil should be allowed. * Add a flag to 'grepprg' to enable parsing of `ag -H ...` output. * Ability to hide command line when not active. * Add tags to angle bracket maps in vimdoc. * :alias * Live preview of color schemes. * A way to scroll suggestion results. * More customizable trash. * Add :toupper and :tolower functions. * More trash-like trash. * Accept regexps as second argument of :colo command. Code improvements: * Write more tests. (partially done) * Consider mentioning libncursesw5-dev in configuration error for Debian-based systems. * Reduce number of magic numbers. (partially done) * Create separate utilities for engine/ part to make them self-contained. * Fix code duplication related to composing of undo messages. * Allow limiting input length for command-line prompt submode. * Get rid of repeatable `menu->win_rows - 3` in menu.c. * Separate filelist data from view data (extract into separate structure). * Improve logging (print back trace in some cases, increase verbosity). * Try reimplementing cmd_core.c:line_pos by calling dispatch_line. * Write syscalls implementation of chgrp, chmod and chown. * Sane asynchronous signals handling. * Move startup and init code out of config.c and vifm.c to separate file. * Consider using curses panes, not just windows. * Show "An error occurred" message on fail to build menus. * Consider not using {} initializer. * Use timeout command to set time limit for tests on CI. * Logging levels. ./configure.ac0000600000175000017500000012151115051153266012230 0ustar korykorydnl Process this file with autoconf to produce a configure script. AC_INIT([vifm],[0.14.3],[xaizek@posteo.net],[vifm],[https://vifm.info]) AC_CONFIG_SRCDIR(src/vifm.c) AC_CONFIG_AUX_DIR(build-aux) AC_CONFIG_MACRO_DIR(build-aux/m4) AM_INIT_AUTOMAKE([no-dist-gzip dist-bzip2]) AC_CONFIG_HEADERS(build-aux/config.h) AC_DEFINE([VERSION_NUM], [1403], [Program version as a comparable integer.]) AC_DEFINE([PACKAGE_SYSCONF_DIR], [], [Configuration directory of the package.]) AC_DEFINE([PACKAGE_DATA_DIR], [], [Data directory of the package.]) AC_DEFINE([PACKAGE_SOURCE_DIR], [], [Source directory of the package.]) dnl Request some additional extensions. The macro makes it possible to use dnl features of Posix that are extensions to C, as well as platform extensions dnl not defined by Posix. AC_USE_SYSTEM_EXTENSIONS AC_PROG_CC AM_PROG_CC_C_O AM_SILENT_RULES([yes]) AC_LANG(C) dnl Determine host machine type. AC_CANONICAL_HOST dnl Require $host variable presence. AC_MSG_CHECKING([host]) AC_MSG_RESULT([$host]) dnl Define $OSX_HOST variable for OS X case "$host_os" in macos* | darwin*) OSX_HOST=1 ;; *) OSX_HOST= ;; esac dnl pass some CFLAGS to tests (TESTS_CFLAGS is also extended below) TESTS_CFLAGS="$CFLAGS" AC_SUBST([TESTS_CFLAGS]) AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [Define to 1 to enable wide functions of ncurses in some environments.]) AC_DEFINE([UTF8PROC_STATIC], [1], [Make it so that utf8proc does not think it is a library.]) dnl Check for system headers. AC_CHECK_HEADERS([alloca.h], [AC_DEFINE([HAVE_ALLOCA_H], [1], [alloca.h header is available.])]) AC_CHECK_HEADERS([malloc.h], [AC_DEFINE([HAVE_MALLOC_H], [1], [malloc.h header is available.])]) AC_CHECK_HEADER([assert.h], [], [AC_MSG_ERROR([assert.h header not found.])]) AC_CHECK_HEADER([ctype.h], [], [AC_MSG_ERROR([ctype.h header not found.])]) AC_CHECK_HEADER([dirent.h], [], [AC_MSG_ERROR([dirent.h header not found.])]) AC_CHECK_HEADER([errno.h], [], [AC_MSG_ERROR([errno.h header not found.])]) AC_CHECK_HEADER([fcntl.h], [], [AC_MSG_ERROR([fcntl.h header not found.])]) AC_CHECK_HEADER([grp.h], [], [AC_MSG_ERROR([grp.h header not found.])]) AC_CHECK_HEADER([inttypes.h], [], [AC_MSG_ERROR([inttypes.h header not found.])]) AC_CHECK_HEADER([limits.h], [], [AC_MSG_ERROR([limits.h header not found.])]) AC_CHECK_HEADER([locale.h], [], [AC_MSG_ERROR([locale.h header not found.])]) AC_CHECK_HEADER([math.h], [], [AC_MSG_ERROR([math.h header not found.])]) AC_CHECK_HEADERS([mntent.h], [HAVE_MNTENT_H=1]) AC_CHECK_HEADER([pwd.h], [], [AC_MSG_ERROR([pwd.h header not found.])]) AC_CHECK_HEADER([signal.h], [], [AC_MSG_ERROR([signal.h header not found.])]) AC_CHECK_HEADER([stdarg.h], [], [AC_MSG_ERROR([stdarg.h header not found.])]) AC_CHECK_HEADER([stddef.h], [], [AC_MSG_ERROR([stddef.h header not found.])]) AC_CHECK_HEADER([stdint.h], [], [AC_MSG_ERROR([stdint.h header not found.])]) AC_CHECK_HEADER([stdio.h], [], [AC_MSG_ERROR([stdio.h header not found.])]) AC_CHECK_HEADER([stdlib.h], [], [AC_MSG_ERROR([stdlib.h header not found.])]) AC_CHECK_HEADER([string.h], [], [AC_MSG_ERROR([string.h header not found.])]) AC_CHECK_HEADER([sys/ioctl.h], [], [AC_MSG_ERROR([sys/ioctl.h header not found.])]) AC_CHECK_HEADER([sys/stat.h], [], [AC_MSG_ERROR([sys/stat.h header not found.])]) AC_CHECK_HEADER([sys/time.h], [], [AC_MSG_ERROR([sys/time.h header not found.])]) AC_CHECK_HEADER([sys/types.h], [], [AC_MSG_ERROR([sys/types.h header not found.])]) AC_CHECK_HEADER([sys/wait.h], [], [AC_MSG_ERROR([sys/wait.h header not found.])]) AC_CHECK_HEADER([termios.h], [], [AC_MSG_ERROR([termios.h header not found.])]) AC_CHECK_HEADER([time.h], [], [AC_MSG_ERROR([time.h header not found.])]) AC_CHECK_HEADER([unistd.h], [], [AC_MSG_ERROR([unistd.h header not found.])]) AC_CHECK_HEADER([wchar.h], [], [AC_MSG_ERROR([wchar.h header not found.])]) AC_CHECK_HEADER([wctype.h], [], [AC_MSG_ERROR([wctype.h header not found.])]) dnl Headers required for breaking too long command-lines. AC_CHECK_HEADERS([sys/sysmacros.h sys/param.h sys/user.h linux/binfmts.h], [], [], [[#if HAVE_SYS_PARAM_H # include #endif ]]) if test "$ac_cv_header_sys_user_h" = yes -a "$ac_cv_header_linux_binfmts_h" = yes; then AC_COMPILE_IFELSE([AC_LANG_SOURCE( [[#include #include #include #ifndef PAGE_SIZE #define PAGE_SIZE sysconf(_SC_PAGESIZE) #endif int main() { (void)MAX_ARG_STRLEN; return 0; } ]])], [AC_DEFINE([HAVE_MAX_ARG_STRLEN], [1], [MAX_ARG_STRLEN is available.])]) fi dnl Check for various system types. AC_CHECK_TYPE([uid_t]) AC_CHECK_TYPE([gid_t]) AC_CHECK_TYPE([mode_t]) AC_CHECK_TYPE([off_t]) AC_CHECK_TYPE([time_t]) AC_CHECK_TYPE([uint64_t]) AC_CHECK_TYPE([direntry_t]) if test -n "$HAVE_MNTENT_H" ; then AC_CHECK_TYPE([mntent]) else AC_CHECK_FUNC([getmntinfo], [AC_DEFINE([HAVE_GETMNTINFO], [1], [getmntinfo() function is available.])], [], [[ #include #include #include ]]) fi AC_CHECK_TYPE([stat]) AC_CHECK_TYPE([FILE]) AC_CHECK_TYPE([wchar_t]) dnl Check for various system functions. AC_CHECK_FUNC([access], [], [AC_MSG_ERROR([access() function not found.])]) AC_CHECK_FUNC([atof], [], [AC_MSG_ERROR([atof() function not found.])]) AC_CHECK_FUNC([atoi], [], [AC_MSG_ERROR([atoi() function not found.])]) AC_CHECK_FUNC([calloc], [], [AC_MSG_ERROR([calloc() function not found.])]) AC_CHECK_FUNC([chdir], [], [AC_MSG_ERROR([chdir() function not found.])]) AC_CHECK_FUNC([close], [], [AC_MSG_ERROR([close() function not found.])]) AC_CHECK_FUNC([closedir], [], [AC_MSG_ERROR([closedir() function not found.])]) AC_CHECK_FUNC([dup], [], [AC_MSG_ERROR([dup() function not found.])]) AC_CHECK_FUNC([dup2], [], [AC_MSG_ERROR([dup2() function not found.])]) AC_CHECK_FUNC([execve], [], [AC_MSG_ERROR([execve() function not found.])]) AC_CHECK_FUNC([execvp], [], [AC_MSG_ERROR([execvp() function not found.])]) AC_CHECK_FUNC([exit], [], [AC_MSG_ERROR([exit() function not found.])]) AC_CHECK_FUNC([fdatasync], [AC_DEFINE([HAVE_FDATASYNC], [1], [fdatasync() is available.])], []) AC_CHECK_FUNC([fclose], [], [AC_MSG_ERROR([fclose() function not found.])]) AC_CHECK_FUNC([fdopen], [], [AC_MSG_ERROR([fdopen() function not found.])]) AC_CHECK_FUNC([feof], [], [AC_MSG_ERROR([feof() function not found.])]) AC_CHECK_FUNC([fgetc], [], [AC_MSG_ERROR([fgetc() function not found.])]) AC_CHECK_FUNC([fgets], [], [AC_MSG_ERROR([fgets() function not found.])]) AC_CHECK_FUNC([fork], [], [AC_MSG_ERROR([fork() function not found.])]) AC_CHECK_FUNC([fprintf], [], [AC_MSG_ERROR([fprintf() function not found.])]) AC_CHECK_FUNC([fputc], [], [AC_MSG_ERROR([fputc() function not found.])]) AC_CHECK_FUNC([fputs], [], [AC_MSG_ERROR([fputs() function not found.])]) AC_CHECK_FUNC([free], [], [AC_MSG_ERROR([free() function not found.])]) AC_CHECK_FUNC([fwrite], [], [AC_MSG_ERROR([fwrite() function not found.])]) AC_CHECK_FUNC([getcwd], [], [AC_MSG_ERROR([getcwd() function not found.])]) AC_CHECK_FUNC([getenv], [], [AC_MSG_ERROR([getenv() function not found.])]) AC_CHECK_FUNC([geteuid], [], [AC_MSG_ERROR([geteuid() function not found.])]) AC_CHECK_FUNC([getgrent], [], [AC_MSG_ERROR([getgrent() function not found.])]) AC_CHECK_FUNC([getgrgid], [], [AC_MSG_ERROR([getgrgid() function not found.])]) AC_CHECK_FUNC([getgrgid_r], [], [AC_MSG_ERROR([getgrgid_r() function not found.])]) AC_CHECK_FUNC([getgrnam], [], [AC_MSG_ERROR([getgrnam() function not found.])]) AC_CHECK_FUNC([getpid], [], [AC_MSG_ERROR([getpid() function not found.])]) AC_CHECK_FUNC([getppid], [], [AC_MSG_ERROR([getppid() function not found.])]) AC_CHECK_FUNC([getpwent], [], [AC_MSG_ERROR([getpwent() function not found.])]) AC_CHECK_FUNC([getpwnam], [], [AC_MSG_ERROR([getpwnam() function not found.])]) AC_CHECK_FUNC([getpwuid], [], [AC_MSG_ERROR([getpwuid() function not found.])]) AC_CHECK_FUNC([getpwuid_r], [], [AC_MSG_ERROR([getpwuid_r() function not found.])]) AC_CHECK_FUNC([ioctl], [], [AC_MSG_ERROR([ioctl() function not found.])]) AC_CHECK_FUNC([iswalnum], [], [AC_MSG_ERROR([iswalnum() function not found.])]) AC_CHECK_FUNC([iswdigit], [], [AC_MSG_ERROR([iswdigit() function not found.])]) AC_CHECK_FUNC([iswprint], [], [AC_MSG_ERROR([iswprint() function not found.])]) AC_CHECK_FUNC([iswspace], [], [AC_MSG_ERROR([iswspace() function not found.])]) AC_CHECK_FUNC([iswupper], [], [AC_MSG_ERROR([iswupper() function not found.])]) AC_CHECK_FUNC([kill], [], [AC_MSG_ERROR([kill() function not found.])]) AC_CHECK_FUNC([localtime], [], [AC_MSG_ERROR([localtime() function not found.])]) AC_CHECK_FUNC([malloc], [], [AC_MSG_ERROR([malloc() function not found.])]) AC_CHECK_FUNC([mbstowcs], [], [AC_MSG_ERROR([mbstowcs() function not found.])]) AC_CHECK_FUNC([memcmp], [], [AC_MSG_ERROR([memcmp() function not found.])]) AC_CHECK_FUNC([memcpy], [], [AC_MSG_ERROR([memcpy() function not found.])]) AC_CHECK_FUNC([memccpy], [], [AC_MSG_ERROR([memccpy() function not found.])]) AC_CHECK_FUNC([memmove], [], [AC_MSG_ERROR([memmove() function not found.])]) AC_CHECK_FUNC([memset], [], [AC_MSG_ERROR([memset() function not found.])]) AC_CHECK_FUNC([mkdir], [], [AC_MSG_ERROR([mkdir() function not found.])]) AC_CHECK_FUNC([mkstemp], [], [AC_MSG_ERROR([mkstemp() function not found.])]) AC_CHECK_FUNC([opendir], [], [AC_MSG_ERROR([opendir() function not found.])]) AC_CHECK_FUNC([pathconf], [], [AC_MSG_ERROR([pathconf() function not found.])]) AC_CHECK_FUNC([pause], [], [AC_MSG_ERROR([pause() function not found.])]) AC_CHECK_FUNC([pclose], [], [AC_MSG_ERROR([pclose() function not found.])]) AC_CHECK_FUNC([perror], [], [AC_MSG_ERROR([perror() function not found.])]) AC_CHECK_FUNC([pipe], [], [AC_MSG_ERROR([pipe() function not found.])]) AC_CHECK_FUNC([popen], [], [AC_MSG_ERROR([popen() function not found.])]) AC_CHECK_FUNC([printf], [], [AC_MSG_ERROR([printf() function not found.])]) AC_CHECK_FUNC([puts], [], [AC_MSG_ERROR([puts() function not found.])]) AC_CHECK_FUNC([qsort], [], [AC_MSG_ERROR([qsort() function not found.])]) AC_CHECK_FUNC([rand], [], [AC_MSG_ERROR([rand() function not found.])]) AC_CHECK_FUNC([read], [], [AC_MSG_ERROR([read() function not found.])]) AC_CHECK_FUNC([readlink], [], [AC_MSG_ERROR([readlink() function not found.])]) AC_CHECK_FUNC([realloc], [], [AC_MSG_ERROR([realloc() function not found.])]) AC_CHECK_FUNC([realpath], [], [AC_MSG_ERROR([realpath() function not found.])]) AC_CHECK_FUNC([rename], [], [AC_MSG_ERROR([rename() function not found.])]) AC_CHECK_FUNC([rmdir], [], [AC_MSG_ERROR([rmdir() function not found.])]) AC_CHECK_FUNC([select], [], [AC_MSG_ERROR([select() function not found.])]) AC_CHECK_FUNC([setenv], [], [AC_MSG_ERROR([setenv() function not found.])]) AC_CHECK_FUNC([setgrent], [], [AC_MSG_ERROR([setgrent() function not found.])]) AC_CHECK_FUNC([setlocale], [], [AC_MSG_ERROR([setlocale() function not found.])]) AC_CHECK_FUNC([setpgid], [], [AC_MSG_ERROR([setpgid() function not found.])]) AC_CHECK_FUNC([setpwent], [], [AC_MSG_ERROR([setpwent() function not found.])]) AC_CHECK_FUNC([setsid], [], [AC_MSG_ERROR([setsid() function not found.])]) AC_CHECK_FUNC([setvbuf], [], [AC_MSG_ERROR([setvbuf() function not found.])]) AC_CHECK_FUNC([sigaction], [], [AC_MSG_ERROR([sigaction() function not found.])]) AC_CHECK_FUNC([sigaddset], [], [AC_MSG_ERROR([sigaddset() function not found.])]) AC_CHECK_FUNC([sigemptyset], [], [AC_MSG_ERROR([sigemptyset() function not found.])]) AC_CHECK_FUNC([signal], [], [AC_MSG_ERROR([signal() function not found.])]) AC_CHECK_FUNC([snprintf], [], [AC_MSG_ERROR([snprintf() function not found.])]) AC_CHECK_FUNC([sprintf], [], [AC_MSG_ERROR([sprintf() function not found.])]) AC_CHECK_FUNC([srand], [], [AC_MSG_ERROR([srand() function not found.])]) AC_CHECK_FUNC([strcasecmp], [], [AC_MSG_ERROR([strcasecmp() function not found.])]) AC_CHECK_FUNC([strcasestr], [AC_DEFINE([HAVE_STRCASESTR], [1], [strcasestr() is available.])], []) AC_CHECK_FUNC([strcat], [], [AC_MSG_ERROR([strcat() function not found.])]) AC_CHECK_FUNC([strchr], [], [AC_MSG_ERROR([strchr() function not found.])]) AC_CHECK_FUNC([strcmp], [], [AC_MSG_ERROR([strcmp() function not found.])]) AC_CHECK_FUNC([strcpy], [], [AC_MSG_ERROR([strcpy() function not found.])]) AC_CHECK_FUNC([strdup], [], [AC_MSG_ERROR([strdup() function not found.])]) AC_CHECK_FUNC([strerror], [], [AC_MSG_ERROR([strerror() function not found.])]) AC_CHECK_FUNC([strftime], [], [AC_MSG_ERROR([strftime() function not found.])]) AC_CHECK_FUNC([strlen], [], [AC_MSG_ERROR([strlen() function not found.])]) AC_CHECK_FUNC([strncasecmp], [], [AC_MSG_ERROR([strncasecmp() function not found.])]) AC_CHECK_FUNC([strncat], [], [AC_MSG_ERROR([strncat() function not found.])]) AC_CHECK_FUNC([strncmp], [], [AC_MSG_ERROR([strncmp() function not found.])]) AC_CHECK_FUNC([strncpy], [], [AC_MSG_ERROR([strncpy() function not found.])]) AC_CHECK_FUNC([strpbrk], [], [AC_MSG_ERROR([strpbrk() function not found.])]) AC_CHECK_FUNC([strrchr], [], [AC_MSG_ERROR([strrchr() function not found.])]) AC_CHECK_FUNC([strspn], [], [AC_MSG_ERROR([strspn() function not found.])]) AC_CHECK_FUNC([strstr], [], [AC_MSG_ERROR([strstr() function not found.])]) AC_CHECK_FUNC([strtok_r], [], [AC_MSG_ERROR([strtok_r() function not found.])]) AC_CHECK_FUNC([strtol], [], [AC_MSG_ERROR([strtol() function not found.])]) AC_CHECK_FUNC([strtoll], [], [AC_MSG_ERROR([strtoll() function not found.])]) AC_CHECK_FUNC([strverscmp], [AC_DEFINE([HAVE_STRVERSCMP_FUNC], [1], [strverscmp() function is available.])]) AC_CHECK_FUNC([sysconf], [], [AC_MSG_ERROR([sysconf() function not found.])]) AC_CHECK_FUNC([time], [], [AC_MSG_ERROR([time() function not found.])]) AC_CHECK_FUNC([tolower], [], [AC_MSG_ERROR([tolower() function not found.])]) AC_CHECK_FUNC([toupper], [], [AC_MSG_ERROR([toupper() function not found.])]) AC_CHECK_FUNC([towupper], [], [AC_MSG_ERROR([towupper() function not found.])]) AC_CHECK_FUNC([ungetc], [], [AC_MSG_ERROR([ungetc() function not found.])]) AC_CHECK_FUNC([unlink], [], [AC_MSG_ERROR([unlink() function not found.])]) AC_CHECK_FUNC([unsetenv], [], [AC_MSG_ERROR([unsetenv() function not found.])]) AC_CHECK_FUNC([utimes], [], [AC_MSG_ERROR([utimes() function not found.])]) AC_CHECK_FUNC([vfprintf], [], [AC_MSG_ERROR([vfprintf() function not found.])]) AC_CHECK_FUNC([vsnprintf], [], [AC_MSG_ERROR([vsnprintf() function not found.])]) AC_CHECK_FUNC([vswprintf], [], [AC_MSG_ERROR([vswprintf() function not found.])]) AC_CHECK_FUNC([waitpid], [], [AC_MSG_ERROR([waitpid() function not found.])]) AC_CHECK_FUNC([wcscat], [], [AC_MSG_ERROR([wcscat() function not found.])]) AC_CHECK_FUNC([wcscmp], [], [AC_MSG_ERROR([wcscmp() function not found.])]) AC_CHECK_FUNC([wcscpy], [], [AC_MSG_ERROR([wcscpy() function not found.])]) AC_CHECK_FUNC([wcslen], [], [AC_MSG_ERROR([wcslen() function not found.])]) AC_CHECK_FUNC([wcsncmp], [], [AC_MSG_ERROR([wcsncmp() function not found.])]) AC_CHECK_FUNC([wcsncpy], [], [AC_MSG_ERROR([wcsncpy() function not found.])]) AC_CHECK_FUNC([wcstof], [], [AC_MSG_ERROR([wcstof() function not found.])]) AC_CHECK_FUNC([wcstol], [], [AC_MSG_ERROR([wcstol() function not found.])]) AC_CHECK_FUNC([wcstombs], [], [AC_MSG_ERROR([wcstombs() function not found.])]) AC_CHECK_FUNC([wcswidth], [], [AC_MSG_ERROR([wcswidth() function not found.])]) AC_CHECK_FUNC([wcwidth], [], [AC_MSG_ERROR([wcwidth() function not found.])]) AC_CHECK_FUNCS([futimens]) AC_CHECK_FUNCS([random srandom]) AC_CHECK_FUNCS([reallocarray]) if test -n "$HAVE_MNTENT_H" ; then AC_CHECK_FUNC([endmntent], [], [AC_MSG_ERROR([endmntent() function not found.])]) AC_CHECK_FUNC([getmntent], [], [AC_MSG_ERROR([getmntent() function not found.])]) AC_CHECK_FUNC([setmntent], [], [AC_MSG_ERROR([setmntent() function not found.])]) fi AC_CHECK_DECLS([_PC_CASE_SENSITIVE], [], [], [[#include ]]) dnl Check for regex.h header, its functions, types and macros. AC_CHECK_HEADER([regex.h], [], [AC_MSG_ERROR([regex.h header not found.])]) AC_CHECK_FUNC([regcomp], [], [AC_MSG_ERROR([regcomp() function not found.])]) AC_CHECK_FUNC([regerror], [], [AC_MSG_ERROR([regerror() function not found.])]) AC_CHECK_FUNC([regexec], [], [AC_MSG_ERROR([regexec() function not found.])]) AC_CHECK_FUNC([regfree], [], [AC_MSG_ERROR([regfree() function not found.])]) AC_CHECK_TYPE([regex_t], [], [AC_MSG_ERROR([regex_t type not found in regex.h])], [[#include ]]) AC_CHECK_DECL([REG_EXTENDED], [], [AC_MSG_ERROR([REG_EXTENDED not found in regex.h])], [[#include ]]) AC_CHECK_DECL([REG_ICASE], [], [AC_MSG_ERROR([REG_ICASE not found in regex.h])], [[#include ]]) AC_CHECK_DECL([REG_NOMATCH], [], [AC_MSG_ERROR([REG_NOMATCH not found in regex.h])], [[#include ]]) AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [[ #include #include #include ]]) AC_CHECK_MEMBERS([struct dirent.d_type], [], [], [[ #include ]]) AC_SYS_LARGEFILE AC_FUNC_FSEEKO AC_TYPE_OFF_T dnl At least on AIX `st_atim` and `st_mtim` might not match `struct timespec`. if test "$ac_cv_member_struct_stat_st_mtim" = yes; then AC_COMPILE_IFELSE([AC_LANG_SOURCE( [[#include #include #include int main() { struct stat st; struct timespec ts[2] = { st.st_atim, st.st_mtim }; return 0; } ]])], [AC_DEFINE([HAVE_CONSISTENT_TIMESPEC], [1], [timespec is good.])]) fi dnl ---------------------------------------------------------------------------- dnl check for available tools/applications dnl ---------------------------------------------------------------------------- AC_CHECK_PROG(HAVE_FILE_PROG, file, 1) if test "x${HAVE_FILE_PROG}" = 'x1' ; then AC_DEFINE_UNQUOTED(HAVE_FILE_PROG, 1, [Define if file program present]) fi dnl Use either groff or mandoc for generating plain text help from manual page. AC_CHECK_PROGS(MANGEN_PROG, [groff mandoc], []) dnl col might be used for filtering out terminal escape sequences AC_CHECK_PROG(COL_PROG, col, col) dnl awk is used to generate source with list of documentation tags AC_CHECK_PROG(AWK_PROG, awk, awk) dnl sed is used to make plain text documentation AC_CHECK_PROG(SED_PROG, sed, sed) dnl perl is used to generate tags from documentation AC_CHECK_PROG(PERL_PROG, perl, perl) dnl vim is a fallback for generating documentation tags when perl isn't there AC_CHECK_PROG(VIM_PROG, vim, vim) if test "x${PERL_PROG}${VIM_PROG}" == 'x'; then AC_MSG_ERROR([Either perl or Vim is necessary to generate tags for documentation in Vim's format.]) fi dnl check if we're building inside git repository AC_CHECK_PROG(GIT_PROG, git, git) if test "x${GIT_PROG}" != 'x' -a -d .git/; then IN_GIT_REPO=1 fi AC_SUBST([IN_GIT_REPO]) dnl ---------------------------------------------------------------------------- dnl setup various package/compilation settings dnl ---------------------------------------------------------------------------- dnl Set PACKAGE_SYSCONF_DIR in config.h. if test "x${sysconfdir}" = 'x${prefix}/etc'; then if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(PACKAGE_SYSCONF_DIR, "${ac_default_prefix}/etc/${PACKAGE}") else AC_DEFINE_UNQUOTED(PACKAGE_SYSCONF_DIR, "${prefix}/etc/${PACKAGE}") fi else AC_DEFINE_UNQUOTED(PACKAGE_SYSCONF_DIR, "${sysconfdir}/${PACKAGE}") fi dnl Set PACKAGE_DATA_DIR in config.h. if test "x${datadir}" = 'x${prefix}/share'; then if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}") else AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}") fi else if test "x${datadir}" = 'x${datarootdir}'; then if test "x${datarootdir}" = 'x${prefix}/share'; then if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}") else AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}") fi fi else AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}") fi fi dnl Setup suffix for data files. if test -n "$OSX_HOST" ; then DATA_SUFFIX=-osx fi AC_SUBST([DATA_SUFFIX]) dnl Set PACKAGE_SOURCE_DIR in config.h. packagesrcdir=`cd $srcdir && pwd` AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}") dnl Use -Wall if available. AX_CHECK_COMPILE_FLAG([-Wall], [ case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac ]) dnl Define _DARWIN_C_SOURCE macro while compiling on OS X. if test -n "$OSX_HOST" ; then AC_DEFINE([_DARWIN_C_SOURCE], [1], [Enable extensions in header files on OS X.]) fi dnl Use 64-bit off_t type AC_DEFINE([_FILE_OFFSET_BITS], [64], [Enable large file processing on 32-bit systems.]) dnl Use math library if present (standard doesn't require it to be separated dnl from libc) AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"]) dnl Enable POSIX shared memory AC_CHECK_LIB(rt, shm_open, [LIBS="$LIBS -lrt"]) dnl Use pthread library AX_PTHREAD([ LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" TESTS_CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC" ], [ AC_MSG_ERROR([pthread not found]) ]) dnl Check for all required elements in pthread.h. AC_CHECK_FUNC([pthread_create], [], [AC_MSG_ERROR([pthread_create() function not found.])]) AC_CHECK_FUNC([pthread_getspecific], [], [AC_MSG_ERROR([pthread_getspecific() function not found.])]) AC_CHECK_FUNC([pthread_key_create], [], [AC_MSG_ERROR([pthread_key_create() function not found.])]) AC_CHECK_FUNC([pthread_mutex_lock], [], [AC_MSG_ERROR([pthread_mutex_lock() function not found.])]) AC_CHECK_FUNC([pthread_mutex_unlock], [], [AC_MSG_ERROR([pthread_mutex_unlock() function not found.])]) AC_CHECK_FUNC([pthread_setspecific], [], [AC_MSG_ERROR([pthread_setspecific() function not found.])]) AC_CHECK_FUNC([pthread_detach], [], [AC_MSG_ERROR([pthread_detach() function not found.])]) AC_CHECK_FUNC([pthread_self], [], [AC_MSG_ERROR([pthread_self() function not found.])]) AC_CHECK_TYPE([pthread_t], [], [AC_MSG_ERROR([pthread_t type not found in pthread.h])], [[#include ]]) AC_CHECK_TYPE([pthread_key_t], [], [AC_MSG_ERROR([pthread_key_t type not found in pthread.h])], [[#include ]]) AC_CHECK_TYPE([pthread_mutex_t], [], [AC_MSG_ERROR([pthread_mutex_t type not found in pthread.h])], [[#include ]]) AC_CHECK_TYPE([pthread_cond_t], [], [AC_MSG_ERROR([pthread_cond_t type not found in pthread.h])], [[#include ]]) AC_CHECK_DECL([PTHREAD_MUTEX_INITIALIZER], [], [AC_MSG_ERROR([PTHREAD_MUTEX_INITIALIZER not found in pthread.h])], [[#include ]]) AC_CHECK_DECL([PTHREAD_COND_INITIALIZER], [], [AC_MSG_ERROR([PTHREAD_COND_INITIALIZER not found in pthread.h])], [[#include ]]) dnl Name of curses library file. curses_lib_name=ncursesw AC_ARG_WITH(curses-name, [ --with-curses-name=NAME name of curses library file @<:@default=ncursesw@:>@], [curses_lib_name=$withval]) dnl AC_CHECK_LIB(XCurses, initscr) vifm_cv_curses=/usr AC_ARG_WITH(curses, [ --with-curses=DIR where ncurses is installed ], [if test $withval != yes; then vifm_cv_curses=$withval fi if test x$vifm_cv_curses != x/usr; then LDFLAGS="-L${vifm_cv_curses}/lib $LDFLAGS" CPPFLAGS="$CPPFLAGS -I${vifm_cv_curses}/include -I${vifm_cv_curses}/include/${curses_lib_name}" fi]) dnl Try to find ncurses library. ncurses_found=no dnl Firstly check for lib${curses_lib_name}. AC_CHECK_LIB(${curses_lib_name}, initscr, [LIBS="$LIBS -l${curses_lib_name}" if test x$vifm_cv_curses = x/usr -a -d /usr/include/${curses_lib_name}; then CPPFLAGS="$CPPFLAGS -I/usr/include/${curses_lib_name}" fi ncurses_found=yes] AC_SEARCH_LIBS([curs_set], [tinfow],, AC_MSG_ERROR(could not find a library providing curs_set))) dnl If libncursesw is not found on OS X, check for libncurses. On OS X it has dnl support of wide characters. if test -n "$OSX_HOST" -a "x$ncurses_found" != "xyes"; then AC_CHECK_LIB(ncurses, initscr, [LIBS="$LIBS -lncurses" if test x$vifm_cv_curses = x/usr -a -d /usr/include/ncurses; then CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses" fi ncurses_found=yes]) fi dnl Quit with appropriate error message if ncurses library wasn't found. if test "x$ncurses_found" != "xyes"; then if test -z "$OSX_HOST"; then AC_MSG_ERROR([libncursesw not found]) else AC_MSG_ERROR([libncursesw and libncurses not found]) fi fi LIBS=$LIBS $GUI_LINK_OPTS_TERM dnl Check for curses.h header and all its required elements. AC_CHECK_HEADER([curses.h], [], [AC_MSG_ERROR([curses.h header not found.])]) AC_CHECK_DECL([A_ITALIC], [AC_DEFINE([HAVE_A_ITALIC_DECL], [1], [A_ITALIC attribute is available.])], [], [[#include ]]) AC_CHECK_DECL([COLORS], [], [AC_MSG_ERROR([COLORS not found in curses.h])], [[#include ]]) AC_CHECK_DECL([TABSIZE], [], [AC_MSG_ERROR([TABSIZE not found in curses.h])], [[#include ]]) AC_CHECK_FUNC([curs_set], [], [AC_MSG_ERROR([curs_set() function not found.])]) AC_CHECK_FUNC([def_prog_mode], [], [AC_MSG_ERROR([def_prog_mode() function not found.])]) AC_CHECK_FUNC([doupdate], [], [AC_MSG_ERROR([doupdate() function not found.])]) AC_CHECK_FUNC([endwin], [], [AC_MSG_ERROR([endwin() function not found.])]) AC_CHECK_FUNC([flushinp], [], [AC_MSG_ERROR([flushinp() function not found.])]) AC_CHECK_FUNC([getcchar], [], [AC_MSG_ERROR([getcchar() function not found.])]) AC_CHECK_FUNC([has_colors], [], [AC_MSG_ERROR([has_colors() function not found.])]) AC_CHECK_FUNC([init_pair], [], [AC_MSG_ERROR([init_pair() function not found.])]) AC_CHECK_FUNC([initscr], [], [AC_MSG_ERROR([initscr() function not found.])]) AC_CHECK_FUNC([isendwin], [], [AC_MSG_ERROR([isendwin() function not found.])]) AC_CHECK_FUNC([keypad], [], [AC_MSG_ERROR([keypad() function not found.])]) AC_CHECK_FUNC([mvwin], [], [AC_MSG_ERROR([mvwin() function not found.])]) AC_CHECK_FUNC([mvwprintw], [], [AC_MSG_ERROR([mvwprintw() function not found.])]) AC_CHECK_FUNC([newwin], [], [AC_MSG_ERROR([newwin() function not found.])]) AC_CHECK_FUNC([noecho], [], [AC_MSG_ERROR([noecho() function not found.])]) AC_CHECK_FUNC([nonl], [], [AC_MSG_ERROR([nonl() function not found.])]) AC_CHECK_FUNC([raw], [], [AC_MSG_ERROR([raw() function not found.])]) AC_CHECK_FUNC([reset_prog_mode], [], [AC_MSG_ERROR([reset_prog_mode() function not found.])]) AC_CHECK_FUNC([resize_term], [], [AC_MSG_ERROR([resize_term() function not found.])]) AC_CHECK_FUNC([resizeterm], [], [AC_MSG_ERROR([resizeterm() function not found.])]) AC_CHECK_FUNC([scrollok], [], [AC_MSG_ERROR([scrollok() function not found.])]) AC_CHECK_FUNC([set_escdelay], [AC_DEFINE([HAVE_SET_ESCDELAY_FUNC], [1], [set_escdelay() function is available.])]) AC_CHECK_FUNC([setcchar], [], [AC_MSG_ERROR([setcchar() function not found.])]) AC_CHECK_FUNC([start_color], [], [AC_MSG_ERROR([start_color() function not found.])]) AC_CHECK_FUNC([use_default_colors], [], [AC_MSG_ERROR([use_default_colors() function not found.])]) AC_CHECK_FUNC([waddch], [], [AC_MSG_ERROR([waddch() function not found.])]) AC_CHECK_FUNC([waddnstr], [], [AC_MSG_ERROR([waddnstr() function not found.])]) AC_CHECK_FUNC([waddnwstr], [], [AC_MSG_ERROR([waddnwstr() function not found.])]) AC_CHECK_FUNC([wattr_set], [], [AC_MSG_ERROR([wattr_set() function not found.])]) AC_CHECK_FUNC([wbkgrndset], [], [AC_MSG_ERROR([wbkgrndset() function not found.])]) AC_CHECK_FUNC([wborder], [], [AC_MSG_ERROR([wborder() function not found.])]) AC_CHECK_FUNC([wclrtoeol], [], [AC_MSG_ERROR([wclrtoeol() function not found.])]) AC_CHECK_FUNC([werase], [], [AC_MSG_ERROR([werase() function not found.])]) AC_CHECK_FUNC([wget_wch], [], [AC_MSG_ERROR([wget_wch() function not found.])]) AC_CHECK_FUNC([wgetch], [], [AC_MSG_ERROR([wgetch() function not found.])]) AC_CHECK_FUNC([wmove], [], [AC_MSG_ERROR([wmove() function not found.])]) AC_CHECK_FUNC([wnoutrefresh], [], [AC_MSG_ERROR([wnoutrefresh() function not found.])]) AC_CHECK_FUNC([wprintw], [], [AC_MSG_ERROR([wprintw() function not found.])]) AC_CHECK_FUNC([wredrawln], [], [AC_MSG_ERROR([wredrawln() function not found.])]) AC_CHECK_FUNC([wrefresh], [], [AC_MSG_ERROR([wrefresh() function not found.])]) AC_CHECK_FUNC([wresize], [], [AC_MSG_ERROR([wresize() function not found.])]) AC_CHECK_FUNC([wtimeout], [], [AC_MSG_ERROR([wtimeout() function not found.])]) AC_CHECK_FUNC([wtouchln], [], [AC_MSG_ERROR([wtouchln() function not found.])]) dnl ---------------------------------------------------------------------------- dnl check for extended colors/pairs dnl ---------------------------------------------------------------------------- use_extended_colors=yes AC_CHECK_FUNC([extended_pair_content], [], [use_extended_colors=no], [[#include ]]) AC_CHECK_FUNC([pair_content], [], [use_extended_colors=no], [[#include ]]) if test "$use_extended_colors" = "yes"; then AC_DEFINE([HAVE_EXTENDED_COLORS], [1], [extended curses colors are present]) fi dnl ---------------------------------------------------------------------------- dnl check for inotify dnl ---------------------------------------------------------------------------- AC_CHECK_HEADER([sys/inotify.h], [use_inotify=yes], [use_inotify=no]) if test "$use_inotify" = "yes"; then AC_CHECK_DECL([IN_NONBLOCK], [], [use_inotify=no], [[#include ]]) AC_CHECK_DECL([IN_CLOEXEC], [], [use_inotify=no], [[#include ]]) AC_CHECK_DECL([IN_ATTRIB], [], [use_inotify=no], [[#include ]]) AC_CHECK_DECL([IN_MODIFY], [], [use_inotify=no], [[#include ]]) AC_CHECK_DECL([IN_CREATE], [], [use_inotify=no], [[#include ]]) AC_CHECK_DECL([IN_DELETE], [], [use_inotify=no], [[#include ]]) AC_CHECK_DECL([IN_MOVED_FROM], [], [use_inotify=no], [[#include ]]) AC_CHECK_DECL([IN_MOVED_TO], [], [use_inotify=no], [[#include ]]) AC_CHECK_DECL([IN_EXCL_UNLINK], [], [use_inotify=no], [[#include ]]) AC_CHECK_DECL([IN_CLOSE_WRITE], [], [use_inotify=no], [[#include ]]) AC_CHECK_DECL([IN_Q_OVERFLOW], [], [use_inotify=no], [[#include ]]) AC_CHECK_FUNC([inotify_init1], [], [use_inotify=no]) AC_CHECK_FUNC([inotify_add_watch], [], [use_inotify=no]) AC_CHECK_TYPE([struct inotify_event], [], [use_inotify=no], [[#include ]]) if test "$use_inotify" = "yes"; then AC_DEFINE([HAVE_INOTIFY], [1], [inotify is available]) fi fi dnl ---------------------------------------------------------------------------- dnl check for extended file attributes dnl ---------------------------------------------------------------------------- AC_CHECK_HEADER([sys/xattr.h], [use_xattrs=yes], [use_xattrs=no]) if test "$use_xattrs" = "yes"; then AC_CHECK_FUNC([lgetxattr], [], [use_xattrs=no], [[ #include #include ]]) AC_CHECK_FUNC([llistxattr], [], [use_xattrs=no], [[ #include #include ]]) AC_CHECK_FUNC([lsetxattr], [], [use_xattrs=no], [[ #include #include ]]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include #include int main() { return XATTR_CREATE; } ]])], [], [use_xattrs="no"]) if test "$use_xattrs" = "yes"; then AC_DEFINE([HAVE_XATTRS], [1], [extended file attributes are available]) fi fi dnl ---------------------------------------------------------------------------- dnl check for gnu coreutils version dnl ---------------------------------------------------------------------------- version="$(mv --version 2> /dev/null | sed -ne 's/^.*(GNU coreutils) //p')" major="${version%.*}" minor="${version#*.}" if test "x$major" != "x" -a "x$minor" != "x" ; then if test $major -eq 7 -a $minor -ge 1 -o $major -gt 7; then AC_DEFINE([SUPPORT_NO_CLOBBER], [1], [-n option is available for cp and mv]) fi if test $major -eq 7 -a $minor -ge 6 -o $major -gt 7; then AC_DEFINE([SUPPORT_REFLINK_AUTO], [1], [--reflink=auto option is available for cp]) fi fi dnl ---------------------------------------------------------------------------- dnl checks for external libraries dnl ---------------------------------------------------------------------------- AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], [use GLib2 to determine mimetypes if available @<:@default=yes@:>@]), [use_glib=$withval], [use_glib=yes]) dnl for backward compatibility AC_ARG_WITH(gtk, AS_HELP_STRING([--with-gtk], [(obsolete name of --with-glib) use GLib2 to determine mimetypes if available @<:@default=yes@:>@]), [use_gtk=$withval], [use_gtk=use_glib]) if test "x$use_gtk" != "xuse_glib"; then AC_MSG_WARN(["--with(out)-gtk flag is obsolete, please use --with(out)-glib instead"]) use_glib=$use_gtk fi AC_ARG_WITH(libmagic, AS_HELP_STRING([--with-libmagic], [use libmagic to determine mimetypes if available @<:@default=yes@:>@]), [use_libmagic=$withval], [use_libmagic=yes]) AC_ARG_WITH(X11, AS_HELP_STRING([--with-X11], [use libX11 to determine terminal emulator title @<:@default=yes@:>@]), [use_libX11=$withval], [use_libX11=yes]) AC_ARG_WITH(dyn-X11, AS_HELP_STRING([--with-dyn-X11], [load libX11 dynamically @<:@default=yes@:>@]), [use_dyn_libX11=$withval], [use_dyn_libX11=yes]) dnl ---------------------------------------------------------------------------- dnl checks for mimetype detection dnl ---------------------------------------------------------------------------- if test "$use_glib" = "yes"; then if test "x$(which pkg-config)" != "x"; then if pkg-config --exists glib-2.0 gio-2.0; then CFLAGS="$CFLAGS $(pkg-config --cflags glib-2.0 gio-2.0)" LIBS="$LIBS $(pkg-config --libs glib-2.0 gio-2.0)" AC_CHECK_HEADER([gio/gio.h], [], [AC_MSG_ERROR([gio/gio.h header not found.])], [[#include ]]) AC_CHECK_HEADER([glib.h], [], [AC_MSG_ERROR([glib.h header not found.])], [[#include ]]) AC_CHECK_FUNC([g_file_info_get_content_type], [], [AC_MSG_ERROR([g_file_info_get_content_type() function not found.])]) AC_CHECK_FUNC([g_file_new_for_path], [], [AC_MSG_ERROR([g_file_new_for_path() function not found.])]) AC_CHECK_FUNC([g_file_query_info], [], [AC_MSG_ERROR([g_file_query_info() function not found.])]) AC_CHECK_FUNC([g_object_unref], [], [AC_MSG_ERROR([g_object_unref() function not found.])]) AC_DEFINE([HAVE_GLIB], [1], [use glib2 to determine mime type]) else AC_MSG_WARN(["Could not find glib-2.0/gio-2.0 via pkg-config. No GLib support."]) fi else AC_MSG_WARN(["Could not find pkg-config. No GLib support."]) fi fi if test "$use_libmagic" = "yes"; then AC_CHECK_LIB(magic, magic_open, [LIBS="$LIBS -lmagic" AC_CHECK_FUNC([magic_close], [], [AC_MSG_ERROR([magic_close() function not found.])]) AC_CHECK_FUNC([magic_file], [], [AC_MSG_ERROR([magic_file() function not found.])]) AC_CHECK_FUNC([magic_load], [], [AC_MSG_ERROR([magic_load() function not found.])]) AC_CHECK_FUNC([magic_open], [], [AC_MSG_ERROR([magic_open() function not found.])]) AC_CHECK_HEADER([magic.h], [], [AC_MSG_ERROR([magic.h header not found.])]) AC_CHECK_DECLS([MAGIC_MIME_TYPE], [], [], [[#include ]]) AC_DEFINE([HAVE_LIBMAGIC], [1], [Define to 1 if you have the `magic' library (-lmagic).])]) fi dnl ---------------------------------------------------------------------------- dnl handle options dnl ---------------------------------------------------------------------------- AC_ARG_ENABLE(extended_keys, AS_HELP_STRING( [--disable-extended-keys], [disable extended keys (like arrows, home etc.). Without it will be no delay after pressing escape @<:@default=enabled@:>@ ]), [extended_keys=$enableval], [extended_keys=yes]) AC_ARG_ENABLE(desktop_files, AS_HELP_STRING( [--disable-desktop-files], [disable parsing of *.desktop files found on your system to get a list of programs associated with filetypes @<:@default=enabled@:>@ ]), [desktop_files=$enableval], [desktop_files=yes]) AC_ARG_ENABLE(remote_cmds, AS_HELP_STRING( [--enable-remote-cmds], [enable remote command sending. @<:@default=enabled@:>@ ]), [remote_cmds=$enableval], [remote_cmds=yes]) AC_ARG_ENABLE(developer, AS_HELP_STRING( [--enable-developer], [enables features of interest to developers @<:@default=disabled@:>@ ]), [developer=$enableval], [developer=no]) AC_ARG_ENABLE(werror, AS_HELP_STRING( [--enable-werror], [pass -Werror flag to compiler @<:@default=disabled@:>@ ]), [werror=$enableval], [werror=no]) AC_ARG_ENABLE(coverage, AS_HELP_STRING( [--enable-coverage], [enables coverage information generation @<:@default=disabled@:>@ ]), [coverage=$enableval], [coverage=no]) AC_ARG_ENABLE(build-timestamp, AS_HELP_STRING( [--disable-build-timestamp], [disables embedding build-timestamp information into executable @<:@default=enabled@:>@ ]), [build_timestamp=$enableval], [build_timestamp=yes]) AC_ARG_WITH(sanitize, AS_HELP_STRING( [--with-sanitize=basic|thread|leak], [enables sanitizers, "basic" means address and undefined sanitizers @<:@default=@:>@ ]), [sanitize=$withval]) if test "$extended_keys" = "yes"; then AC_DEFINE([ENABLE_EXTENDED_KEYS], [1], [enables extended keys (arrows etc.)]) fi if test "$desktop_files" = "yes"; then AC_DEFINE([ENABLE_DESKTOP_FILES], [1], [parsing of .desktop files]) fi if test "$remote_cmds" = "yes"; then AC_DEFINE([ENABLE_REMOTE_CMDS], [1], [executing commands remotely]) fi if test "$use_dyn_libX11" = "yes"; then ORIG_LIBS="$LIBS" AC_CHECK_LIB(dl, dlopen, [ use_dyn_libX11=yes LIBS="$LIBS -ldl" ], [use_dyn_libX11=no]) AC_CHECK_HEADER([dlfcn.h], [], [use_dyn_libX11=no]) AC_CHECK_FUNC([dlsym], [], [use_dyn_libX11=no]) AC_CHECK_FUNC([dlclose], [], [use_dyn_libX11=no]) if test "$use_dyn_libX11" != "yes"; then LIBS="$ORIG_LIBS" AC_MSG_WARN(["libdl seems to don't work as expected. No dynamic X11."]) fi fi if test "$use_libX11" = "yes"; then AC_CHECK_LIB(X11, XOpenDisplay, [ AC_CHECK_HEADER([X11/Xlib.h], [], [AC_MSG_ERROR([X11/Xlib.h header not found.])]) AC_CHECK_HEADER([X11/Xutil.h], [], [AC_MSG_ERROR([X11/Xutil.h header not found.])]) AC_DEFINE([HAVE_X11], [1], [use X11 to determine terminal emulator title]) if test "$use_dyn_libX11" = "yes"; then AC_DEFINE([DYN_X11], [1], [load libX11 dynamically]) else LIBS="$LIBS -lX11" fi ]) fi WERROR_TUNING="-Wno-error=deprecated-declarations -Werror=sign-compare -Wno-unused-parameter" if test "$developer" = "yes"; then CFLAGS="$CFLAGS -g -O0 -Werror $WERROR_TUNING" TESTS_CFLAGS="$TESTS_CFLAGS -Werror $WERROR_TUNING" fi if test "$werror" = "yes"; then CFLAGS="$CFLAGS -Werror $WERROR_TUNING" TESTS_CFLAGS="$TESTS_CFLAGS -Werror $WERROR_TUNING" fi if test "$coverage" = "yes"; then CFLAGS="$CFLAGS -O0 --coverage" LDFLAGS="$LDFLAGS --coverage" fi if test "$build_timestamp" = "yes"; then AC_DEFINE([WITH_BUILD_TIMESTAMP], [1], [Define to 1 to embed compilation date into executable.]) fi dnl Handle sanitizers options if test -n "$sanitize" -a "$sanitize" != "basic" -a "$sanitize" != "thread" -a \ "$sanitize" != "leak"; then AC_MSG_ERROR([Unknown type of sanitizing: $sanitize]) fi if test "$sanitize" = "basic"; then SANITIZERS_CFLAGS="-fsanitize=address -fsanitize=undefined" fi if test "$sanitize" = "thread"; then SANITIZERS_CFLAGS="-fsanitize=thread -fPIC" LDFLAGS="$LDFLAGS -pie" fi if test "$sanitize" = "leak"; then LDFLAGS="$LDFLAGS -fsanitize=leak" fi dnl The flags should be available separately for fetching on building tests. AC_SUBST([SANITIZERS_CFLAGS]) CFLAGS="$CFLAGS $SANITIZERS_CFLAGS" LDFLAGS="$LDFLAGS $SANITIZERS_CFLAGS" dnl Include config.h in all translation units implicitly CFLAGS="$CFLAGS -include ../build-aux/config.h" AC_CONFIG_FILES([ Makefile src/Makefile ]) AC_OUTPUT ./HACKING.md0000600000175000017500000004165015051153244011331 0ustar korykory## Contributing ## It's a good idea to describe what it is you would like to implement before starting it. The are multiple reasons for this: - new feature might interact with other features in unexpected ways; - not all ways of implementing a feature are equal, some might be preferred just for the sake of keeping things consistent; - the code base is quite large and stuff that's already there might save you some time. Changes can be sent as a pull request on [github] or as a patch via [email]. Some information on development is available on the [wiki]. [github]: https://github.com/vifm/vifm/pulls [email]: mailto:xaizek@posteo.net [wiki]: https://wiki.vifm.info/index.php?title=Development#Code_repositories ## Setup for development ## To avoid possible issues with `autoconf` caused by skewed timestamps after `git clone` or `git checkout` execute `scripts/fix-timestamps`. Configure the project with `--enable-developer` flag to compile in debug mode and with `-Werror` (there is also `--enable-werror` that doesn't enable debug mode). Undo this if it breaks the build from `master` because of unexpected warnings. After making changes, don't forget to run tests (see below) to make sure they pass. It might be a good idea to start by running tests as well to see that they succeed without any changes. ## Tests ## Tests can be run with `make check` in the root, `src/` or `tests/` directory. When inside `tests/` directory, there are multiple ways to run specific tests in several different modes, see top comment of the `Makefile` file there for instructions. To use the same modes from `src/` directory (including when building out of tree, which is especially useful), auto-generated `./runtests` script can be used instead. ## ChangeLog format ## Releases are listed in newest to oldest order. Beta versions are considered to be separate releases, otherwise one would have to edit entries rather than add new ones on recording changes done since beta. Within each release entries are organized in groups of 4 kinds in this order: 1. Changed ... 2. Added ... 3. Everything else 4. Fixed ... A new entry is added at the end of a group, resulting in a chronological order of changes of each kind. ## Package contents ## . | |-- build-aux/ - part of autotools' machinery | |-- data/ - documentation, sample vifmrc, icons, etc. | | | |-- colors/ - sample color schemes | |-- graphics/ - icons and screenshots | |-- man/ - manual pages | |-- shell-completion/ - scripts implementing shell completion | `-- vim/ - plugin for Vim | |-- patches/ - patches for software vifm depends on | |-- pkgs/ - package build-scripts | |-- scripts/ - utility scripts for development | |-- src/ - the source code of vifm | | | |-- cfg/ - code related to configuration | | | | | |-- config.c - reads scripts and manages configuration | | |-- hist.c - convenient history list abstraction | | `-- info.c - read and write vifminfo | | | |-- compat/ - implementation of features that are missing on some OSes | | | | | |-- curses.c - emulation of some wide functions for OpenBSD | | |-- dentry.c - emulation of d_entry field of struct direntry | | |-- getopt.c - part of glibc to have getopt_long() everywhere | | |-- getopt1.c - getopt.c public interface implementation | | |-- mntent.c - compatibility file for FreeBSD-like systems | | |-- os.c - very thin abstraction layer over basic OS facilities | | |-- pthread.c - spinlock shim for OS X | | |-- reallocarray.c - more convenient and safe realloc() for arrays | | `-- wcwidth.c - wcwidth() implementation for Windows | | | |-- engine/ - the core of vi[m]-like functionality | | | | | |-- abbrevs.c - implementation of abbreviations | | |-- autocmds.c - implementation of autocommands | | |-- cmds.c - command line parsing core | | |-- completion.c - provides means to fill and get completion list | | |-- functions.c - provides support for builtin functions | | |-- keys.c - analyzes users input | | |-- mode.c - generic mode related routines | | |-- options.c - :set command | | |-- parsing.c - parses expressions | | |-- var.c - all needed to work with variables | | `-- variables.c - handles :let and :unlet commands | | | |-- int/ - integration with environment/external tools | | | | | |-- desktop.c - code that parses *.desktop files on *nix systems | | |-- ext_edit.c - managing of state related to external renaming | | |-- file_magic.c - determines programs associated with file using its | | | mime-type | | |-- fuse.c - provides support of FUSE filesystems | | |-- path_env.c - parses and modifies PATH environment variables | | |-- term_title.c - terminal title updates | | `-- vim.c - contains Vim integration functionality | | | |-- io/ - file system operations implementation | | | | | |-- private/ - internal part of i/o | | | | | | | |-- ioc.c - implementation of common i/o routines | | | |-- ioeta.c - internal part of i/o estimations | | | |-- ionotif.c - internal part of i/o notifications | | | `-- traverser.c - file system traversing routine | | | | | |-- ioeta.c - i/o estimations management | | |-- iop.c - implementation of i/o primitive | | `-- ior.c - implementation of recursive i/o operations | | | |-- lua/ - Lua interface | | | | | |-- lua/ - Lua 5.4.6 sources | | |-- common.c - common code for Lua API implementation | | |-- vifm.c - implementation of `vifm` | | |-- vifm_abbrevs.c - implementation of `vifm.abbrevs` | | |-- vifm_cmds.c - implementation of `vifm.cmds` | | |-- vifm_events.c - implementation of `vifm.events` | | |-- vifm_handlers.c - implementation of `vifm.addhandler` | | |-- vifm_tabs.c - implementation of `vifm.tabs` | | |-- vifm_viewcolumns.c - implementation of `vifm.addcolumntype` | | |-- vifmentry.c - implementation of VifmEntry | | |-- vifmjob.c - implementation of VifmJob | | |-- vifmtab.c - implementation of VifmTab | | |-- vifmview.c - implementation of VifmView | | |-- vlua.c - main Lua interface unit | | |-- vlua_cbacks.c - manager of callback functions | | `-- vlua_state.c - management of state of vlua.c unit | | | |-- menus/ - implementation of all menus | | | | | |-- apropos_menu.c - handles :apropos menu | | |-- bmarks_menu.c - handles :bmarks menu | | |-- cabbrevs_menu.c - handles :cabbrev and :cnoreabbrev menus | | |-- chistory_menu.c - handles :chistory menu | | |-- colorscheme_menu.c - handles :colorscheme menu | | |-- commands_menu.c - handles :command menu | | |-- dirhistory_menu.c - handles :history menu | | |-- dirstack_menu.c - handles :dirs menu | | |-- filetypes_menu.c - handles :file menu | | |-- find_menu.c - handles :file menu | | |-- grep_menu.c - hanldes :grep menu | | |-- history_menu.c - handles :history command menus except directory | | | history | | |-- jobs_menu.c - handles :jobs menu | | |-- locate_menu.c - handles :locale menu | | |-- trash_menu.c - handles :lstrash menu | | |-- trashes_menu.c - handles :trashes menu | | |-- map_menu.c - handles :map menu | | |-- marks_menu.c - handles :marks menu | | |-- media.c - handles :media menu | | |-- menus.c - handles all kinds of menus | | |-- plugins_menu.c - handles :plugins menu | | |-- registers_menu.c - handles :registers menu | | |-- undolist_menu.c - handles :undolist menu | | |-- users_menu.c - handles menus created by %m or %M macros | | |-- vifm_menu.c - handles :vifm (or :version) menu | | `-- volumes_menu.c - handles :volumes menu on MS Windows systems | | | |-- modes/ - implementation of all modes | | | | | |-- dialogs/ - dialog modes | | | | | | | |-- attr_dialog_nix.c - file permissions dialog for *nix systems | | | |-- attr_dialog_win.c - file properties dialog for MS Windows | | | | systems | | | |-- change_dialog.c - change dialog | | | |-- msg_dialog.c - information/error/prompt messages | | | `-- sort_dialog.c - dialog to choose sort type | | | | | |-- cmdline.c - command line mode | | |-- file_info.c - Control+G | | |-- menu.c - handles commands in menus | | |-- modes.c - general code (e.g. before and after key pressed) for | | | modes | | |-- more.c - more mode that views too much output on status bar | | |-- normal.c - normal mode commands | | |-- view.c - view mode commands | | `-- visual.c - implementation of visual mode commands | | | |-- ui/ - most of ui related code | | | | | |-- private/ - internal headers of ui | | |-- cancellation.c - managing operation cancellation | | |-- color_manager.c - manager of curses color pairs | | |-- color_scheme.c - color schemes | | |-- colored_line.c - text with %x* highlighting | | |-- column_view.c - column formatting unit | | |-- escape.c - escape sequences related stuff | | |-- fileview.c - display/redraw/manage file view | | |-- quickview.c - implementation of quick view | | |-- statusbar.c - managing status bar | | |-- statusline.c - status line formatting | | |-- tabs.c - implementation of tabs | | `-- ui.c - ui initialization and other ui related functions | | | |-- utils/ - miscellaneous utility functions and data types | | | | | |-- private/ - internal headers of utilities | | |-- cancellation.c - kind of cancellation token | | |-- darray.c - macros for managin dynamic arrays | | |-- dynarray.c - array reallocation with fewer memory copies | | |-- env.c - environment variables related functions | | |-- event_nix.c - pipe() wrapper to interrupt selector | | |-- event_win.c - event object of manual reset kind to interrupt | | | selector | | |-- fs.c - functions to deal with file system objects | | |-- fsdata.c - maps arbitrary data onto file system tree | | |-- fsddata.c - fsdata wrapper that takes care of dynamic memory | | |-- fswatch_nix.c - watches path in file system for changes on *nix | | |-- fswatch_win.c - watches path in file system for changes on Windows | | |-- file_streams.c - file stream reading related functions | | |-- filemon.c - file monitoring "object" | | |-- filter.c - small abstraction over filter driven by a regexp | | |-- globs.c - provides support of glob patterns | | |-- gmux_nix.c - implementation of named mutex on *nix | | |-- gmux_win.c - implementation of named mutex on Windows | | |-- int_stack.c - int stack "object" | | |-- log.c - primitive logging | | |-- matcher.c - file path/name matcher (glob/regexp/mime-type) | | |-- matchers.c - list of matchers (which are ANDed together) | | |-- mem.c - simple memory/array manipulation utilities | | |-- path.c - various functions to work with paths | | |-- regexp.c - regexp related | | |-- selector_nix.c - waiting for file descriptors to become readable | | |-- selector_win.c - waiting for file handles to become readable | | |-- shmem_nix.c - implementation of named shared memory on *nix | | |-- shmem_win.c - implementation of named shared memory on Windows | | |-- str.c - various string functions | | |-- string_array.c - functions to work with arrays of strings | | |-- trie.c - 3-way trie implementation | | |-- utf8.c - functions to handle utf8 strings | | |-- utf8proc.c - third-party implementation of UTF-8 Unicode handling | | |-- utils.c - various utilities | | |-- utils_nix.c - various utilities for *nix systems | | |-- utils_win.c - various utilities for MS Windows | | `-- xxhash.c - fast hashing algorithm | | | |-- args.c - command-line arguments parsing and processing | |-- background.c - runs commands in background | |-- bmarks.c - management of (named) bookmarks | |-- bracket_notation.c - list of bracket notation entries | |-- cmd_actions.c - reusable parts of action-like functionality | |-- cmd_completion.c - handles command line completion | |-- cmd_core.c - command line parsing | |-- cmd_handlers.c - handlers for command line commands | |-- compare.c - implementation of directory comparison | |-- dir_stack.c - for :pushd and :popd commands | |-- event_loop.c - event dispatching loop | |-- filelist.c - fill/update list of files | |-- filename_modifiers.c - expands filename modifiers | |-- filetype.c - stores filetype information from vifmrc | |-- filtering.c - managing file filters | |-- flist_hist.c - file list history related code | |-- flist_pos.c - most of file list scrolling/cursor positioning code | |-- flist_sel.c - most of file list selection handling code | |-- fops_common.c - shared functionality of high-level file operations | |-- fops_cpmv.c - copying/moving/linking of files | |-- fops_misc.c - most of high-level operations on files | |-- fops_put.c - putting of files | |-- fops_rename.c - renaming files in various ways | |-- instance.c - manages generic state of the instance | |-- ipc.c - handles communication across instances of vifm | |-- macros.c - code of macros expansion | |-- marks.c - stores information about marked directories | |-- ops.c - most of operations performed on file system | |-- opt_handlers.c - initialization of options and option change handlers | |-- plugins.c - plugin management | |-- registers.c - implementation of registers | |-- running.c - code of handing file and commands running | |-- search.c - code for / and ? commands of normal mode | |-- signals.c - handlers for different signals | |-- sort.c - sort function | |-- status.c - definition of global status structure | |-- tags.c - tags for :h completion | |-- trash.c - code that handles list of files in trash | |-- types.c - internal file type detection and conversions | |-- undo.c - stores and handles the undo list | |-- vcache.c - cache of viewers' output | |-- version.c - git hash and other version information | |-- viewcolumns_parser.c - contains code for parsing 'viewcolumns' option | |-- vifm.c - contains main initialization/termination code | `-- win_helper.c - needed for temporary rights elevation on Windows | |-- tests/ - testing infrastructure and test suites | |-- abbrevs/ - tests of src/engine/abbrevs.c | |-- autocmds/ - tests of src/engine/autocmds.c | |-- bmarks/ - tests of src/bmarks.c | |-- cmds/ - tests of src/engine/cmds.c | |-- colmgr/ - tests of src/ui/color_manager.c | |-- column_view/ - tests of src/ui/column_view.c | |-- commands/ - tests of src/cmd_*.c | |-- completion/ - tests of src/engine/completion.c | |-- escape/ - tests of src/ui/escape.c | |-- fileops/ - tests of src/fops_*.c | |-- filetype/ - tests of src/filetype.c | |-- filter/ - tests of src/utils/filter.c | |-- fuzz/ - fuzzy tests, built but not run (need a test driver) | |-- ioeta/ - tests of src/io/ioeta.c | |-- ionotif/ - tests of src/io/ionotif.h | |-- iop/ - tests of src/io/iop.c | |-- ior/ - tests of src/io/ior.c | |-- keys/ - tests of src/engine/keys.c | |-- lua/ - tests of src/lua/*.c | |-- menus/ - tests of src/menus/*.c | |-- misc/ - tests of things without a dedicated test suite | |-- options/ - tests of src/engine/options.c | |-- parsing/ - tests of src/engine/parsing.c | |-- regs_shmem_app/ - a helper for tests/misc/registers_shared_memory.c | |-- test-data/ - files used by tests in run-time | |-- test-support/ - test framework (stic) and common test functions | |-- text_buffer/ - tests of src/engine/text_buffer.c | |-- undo/ - tests of src/undo.c | |-- utils/ - tests of src/utils/*.c | |-- variables/ - tests of src/engine/variables.c | `-- viewcolumns_parser/ - tests of src/viewcolumns_parser.c | |-- AUTHORS - list of code contributors |-- BUGS - some of known issues |-- ChangeLog - list of changes |-- FAQ - some common questions |-- HACKING.md - this file |-- INSTALL - building instructions |-- NEWS - like the ChangeLog, but in more human-readable format |-- README - readme used for distribution |-- README.md - readme to be displayed by code hosting services |-- THANKS - thanks to people that help to improve vifm `-- TODO - what still needs to be implemented ./ChangeLog0000600000175000017500000074026215051153266011526 0ustar korykory0.14.2 to 0.14.3 (2025-06-04) Provided more details on file handlers and viewers in sample vifmrc files. Say "primary" instead of "default" in the title of :colorscheme menu. Improved documentation on the use registers. Thanks to aleksejrs. Fixed picking trash directory when rooted trash is included in 'trashdir' and root is writable. Regression in v0.14.2. Fixed unlimited growth of directory histories when 'history' is set to its default value or not set at all in vifmrc. Thanks to zoj613. Fixed abort due to assertion on displaying a statusbar message with a newline when 'shortmess' includes "T". Thanks to agguser. 0.14.1 to 0.14.2 (2025-05-07) Fixed build issue with musl due to use of non-standard LONG_LONG_MAX. Thanks to NRK. Fixed user-specific trash directory (absolute path, `%u` and no `%r`) created on setting 'trashdir' not having reduced set of permissions. Fixed treating a failure to create a trash directory on a read-only file-system in a Unix environment as a success. Thanks to feekApp. Fixed odd sorting with musl caused by its buggy strverscmp(). The ordering shouldn't depend on libc in use. 0.14 to 0.14.1 (2025-05-02) Made documentation on which :commands can have comments a bit more verbose. Made `%i` keep access to the terminal instead of acting like `%i &` . This restores the behavior prior to v0.12.1-beta (can be considered a regression as this breaks several use cases). Thanks to an anonymous at Vifm Q2A site. Documented extra information on file copying. Patch by EA1A87. Improved/extended/updated documentation on cancelling operations, compare and custom views. Updated .desktop-file to add localizations and be more up-to-date with modern recommendations. Patch by Matěj Cepl (a.k.a. mcepl). Extended range of numbers Ctrl-A/Ctrl-X can deal with from [-2**31; 2**31) to [-2**63; 2**63). Thanks to CaptainFantastic. Fixed 'trashdir' with "%r" on BSD-like systems (those with getmntinfo() instead of getmntent() API). The regression was apparently introduced in v0.9.1-beta. Thanks to sublimal. Fixed a crash on drawing a tree-view when {ext} or {fileext} follows {name}, {iname}, {root} or {fileroot}. Thanks to aw-cloud. Fixed unintended (and incorrect) highlighting of search matches in {ext} and {fileext} columns. Fixed setting 'timeoutlen' to zero resulting in high CPU use and ignoring user input. Fixed trailing slash at the bottom of overwrite confirmation dialog displayed on merging directories. Fixed :restart not resetting abbreviations. Fixed crashes in terminals that handle ANSI output on Windows when previewing binary or some complicated UTF-8 text files. Thanks to Phil Runninger. Fixed `:restart full` ignoring `set tabscope=...` in vifmrc which is how :restart behaves. Thanks to martinengelke (a.k.a. sHii). Fixed tabulation breaking parsing of :set command. Thanks to martinengelke (a.k.a. sHii). Fixed :file[x]type commands being run in startup directory instead of view's directory when file was passed on command-line. Thanks to ThePlaguebump. Fixed false-positive on detecting ambiguity of commands with numbers in their names. Thanks to CaptainFantastic. Fixed Escape not cancelling waiting for the next input key. Thanks to an anonymous at Vifm Q2A site. Fixed a crash after `:winrun , normal e` followed by `q`. Fixes of typos and groff syntax in documentation. Patch by Kirill Rekhov. Fixed ruler in menu mode not growing in size to accommodate its content. Thanks to CaptainFantastic. Fixed a memory leak on formatting tab line when there is not enough space. Fixed an unlikely memory leak on parsing of malformed 'viewcolumns'. Fixed truncating wide characters on drawing columns broken on introducing column-specific highlighting in 0.14-beta. Thanks to Snake52996. Fixed :clone producing weird results on trying to increment numbers greater than `2**31 - 1`. Thanks to CaptainFantastic. 0.14-beta to 0.14 (2025-02-08) Improved documentation on zh/zl menu keys a bit. Corrected documentation on how the use of different preview macros affects classification of a previewer. Say "changed" when describing the meaning of "showdifferent" of :compare. Thanks to aleksejrs. Improved wording of descriptions for :compare's show* parameters. Fixed absolute paths comparing equal to similar relative paths (regression in 0.14-beta). Fixed single quotes escaping for completion of option values via `opt='` (related to a change in 0.14-beta). Fixed quotes not being escaped on completion of option values via `opt=`. Fixed output of :highlight command truncating names of some colors. 0.13 to 0.14-beta (2025-01-19) Changed --with-gtk flag to --with-glib (old name is still available). GTK was pulled in by mistake, only GIO/GLib was ever used... Changed %N macro to not be mutually exclusive with most of other macros (the limitation wasn't documented and didn't make much sense). Thanks to James Dietrich. Changed handling of Ctrl-Z to not suspend the application if a corresponding user mapping exists. Patch 高浩亮 (a.k.a. haolian9). Changed behaviour on failure to evaluate an expression of :if or :elseif. Previously this resulted in trying to execute any commands until and including :endif (all branches taken). Now everything up to :endif will not be executed (no branches taken). Thanks to Ed Pavlov. Changed default value of 'findprg' to avoid the use of syntax specific to GNU find. The only difference is that now one can see "Permission denied" errors which weren't displayed before. Sample vifmrc files contain detection of GNU find on startup. Thanks to Jose Riha (a.k.a. jose1711). Changed initialization to not create a copy of rendered man page at $VIFM/vifm-help.txt, :help now opens the original file. Thanks to intelfx. Changed filetype() to accept path in its first parameter. This means that passing it something like "15abc" will no longer be interpreted as 15. Thanks to MikeLemon. Added command-line history to menu mode. Added "mchistory" value to 'vifminfo' and 'sessionoptions' option. It manages storing of command-line history of menus. Added ":history mcmd" menu for displaying command-line history of menus. Added :col[der] and :cnew[er] commands to menu mode to traverse history of navigation menus. Added :chi[story] command that opens a menu of saved menus. Added :chi[story] command to menu mode. Added 'hloptions' option to configure which view colums get affected by file highlighting. Thanks to qsmodo. Added "column:{name}" form of argument to :highlight command to specify style of a separate column. Thanks to Anton Gepting. Added "millersep:" value to 'fillchars' that allows customizing the border between miller columns. Thanks to Shuo (a.k.a. shenqshuoh). Added :gr[ep] command to menu mode. Allows (re)running grep command on the same set of files without leaving the mode. Added :fin[d] command to menu mode. Allows (re)running find command on the same set of files without leaving the mode. Added middle view column alignment (specified by "^" in 'viewcolumns' option). Part of the text is replaced with ellipsis to keep both start and end visible. Patch by Vadim Curcă. Added escape() builtin function to escape specific characters in strings. Thanks to The Cyberduck. Added :wingo command to navigate to a view by substring matching against its title or path. Thanks to iSeeU816 and Alexandre Viau. Added :cal[l] command to run a function discarding its return value. Thanks to anyone asking about simply running a function. Added :o[pen] command to open current file, selection or range as if Enter was pressed. Thanks to Safal Piya (a.k.a. mrsafalpiya). Added 'wildinc' option that defines which :commands should be completed as they are edited. Added WildBox highlight group. It can be used to set background of completion window. Added a statusbar message and a dialog to warn about an upcoming fix for strings in conditional expressions (e.g., `if $VAR` checks for `$VAR` being non empty instead of converting it to an integer). Thanks to justpretending2. Added handling of Enter/Escape keys to prompts and error dialogs. Thanks to laur89, Alexandre Viau and multiple other users who asked about this. Added global variables (with "g:" prefix) to avoid using environment variables in their place as a workaround. Added inode number to File Info dialog. Added selected() builtin function which returns number of currently selected files. Added [S and ]S shortcuts as wrapping versions of [s and ]s. Thanks to aksr. Added v:version builtin variable that exposes version as an integer which can be meaningfully compared. Thanks to an anonymous at Vifm Q2A site. Added a way to insert "}" inside of %{expr} macro of 'statusline'. Thanks to vuenn. Added 'uioptions' option with possible "iodetails" value to display progress dialog by default. Thanks to Ralf Schmitt. Don't draw right padding on a truncated rightmost column of a transposed ls-like view. Made register's content being listed in normal rather then reversed order in :registers/:display menu. Don't attempt clearing graphics when menu-like mode is active. The graphics should have been hidden on entering the mode. Allowed wild menu popup to take up up to 40% of the screen. Made documentation of 'vifminfo' more readable. Rewrote "Menus and dialogs" part of the documentation. Increase line length limit used during formatting output of :highlight command to allow longer strings. Display number of color pairs in use in :version/:vifm menu. Don't show a message at the end of 'incsearch' if the cursor was moved not by the search. Patch by filterfalse. Clarified documentation on column literals and escaping. Thanks to chelovechishko. Allow and skip !/!! prefix of custom external :commands for more macros (%S, %q, %i, %m, %M, %s, %v, %u, %U, %Iu, %IU). Slightly expanded documentation on %N macro. Thanks to James Dietrich. Made Tab and Shift-Tab in interactive search prompts (including when navigating) move cursor to next/previous search match. Thanks to David Sierra DiazGranados (a.k.a. davidsierradz). Somewhat improved documentation on functional keys. Updated autotools scripts to their newer versions. Thanks to phanium (a.k.a. phanen). Perform sorting of completion items after doing Unicode normalization. Perform sorting of file names after doing Unicode normalization. Thanks to hacksenwerk. Made :compare treat non-regular files (pipes, sockets, etc.) as empty. Slightly improved performance of comparing files by content. Configure 'vifminfo' in sample vifmrcs to store most of the things in vifminfo by default (add missing histories and tabs). Thanks to Christoph Schmidpeter. Adjusted heuristic for determining previewer type to allow use of %px and %py with %pd without any implications. Thanks to iambumblehead. Document how the use of different preview macros affects classification of a previewer. Thanks to iambumblehead. When processing multiple files in background, show current position in the list on the job bar. Shorten home directory in paths shown on the job bar. Commented out one of MC-like shortcuts in sample vifmrc files, Ctrl-U, to avoid confusing Vim users with default configuration. Thanks to midrare. Made vifm-media not offer partitioned drives as they aren't mountable as a whole. Extended vifm-media script to support MTP devices if simple-mtpfs tool is installed. Thanks to FlyCat (a.k.a. yanwh0311) and Alexandre Viau. Allowed moving files via :rename (requires an interactive confirmation). Thanks to aleksejrs. Made completion of an option with its current value work not only on `opt=`, but also on `opt='` and `opt="`. Thanks to aleksejrs. Provide numerical value of a color as a description of a completion item for it. Made :goto preserve custom and tree views. Thanks to Svetlozar Iliev (a.k.a. asmodeus812). Improved error message on trying to :unlet a builtin variable. Extended logging on spawning a command via a shell. Thanks to Henrik Holst (a.k.a. hholst80). Expand environment variables in the arguments of :mark command. Thanks to an anonymous at Vifm Q2A site. Improved detection and reporting of invalid mark name by :mark command. Updated ncurses in AppImage to 6.5. Don't overwrite $TERMINFO in AppImage, set/append to $TERMINFO_DIRS instead. Thanks to anonymous at Vifm Q2A site. Upgraded to PDCurses 3.9 (was 3.8) for Windows. Combined with some other changes this improves the situation with handling of CJK characters. Thanks to zzx41375004, vodbyte, Jeremy Yuan and others. Constrained background error dialogs to appear only in normal mode when not much is going on. Fixed line number column not including padding to the left of it. Fixed local options not being loaded on Ctrl-W x. Fixed graphics of view mode not being hidden on activating menu, more or file info modes. Fixed descriptions of exit :commands in menus (visible during popup completion). Fixed statusbar output not being preserved on running commands from :history menus. Fixed not being able to pick a symbolic link to a directory via --choose-files or --on-choose by selecting and opening it. Fixed 'slowfs' option not being applied to targets of symbolic links on operations related to directory sizes. Thanks to rok (a.k.a. aca). Fixed running long shell commands when fish is used. Caused by its inability to understand that "${var}" is the same as "$var". Thanks to aleksejrs. Fixed a historical omission of Ctrl-G not being available in some prompts: file rename on conflict; owner, group and symbolic link target change. Thanks to Branislav Gerazov. Fixed display issues or a crash when using a terminal with more than 32768 color pairs. Thanks to iboggs and itshog. Fixed performance degradation after preview consumes lots of color pairs. Fixed running tests with musl libc. Thanks to Henrik Holst (a.k.a. hholst80). Fixed IPC payloads larger than 8155 bytes. Patch by Marcin Kurczewski (a.k.a. rr-). Fixed abort on instance sending something over IPC to itself. Thanks to Marcin Kurczewski (a.k.a. rr-). Fixed "N files selected" message appearing in menus on waiting for multikey input (regression in 0.12-beta). Fixed %a 'statusline' macro on FreeBSD producing wrong values. Patch by voh9eepah. Fixed %a 'statusline' macro producing wrong values on non-Linux Unix-like systems. Thanks to voh9eepah. Fixed graphics not being cleared on switching to single-pane view. Thanks to ret2src. Fixed merging directories on copying not asking for overwrite confirmations. Thanks to aleksejrs. Fixed skipping of file move during merging aborting the whole operation. Thanks to aleksejrs. Fixed expansion of abbrevs that leave command-line mode. Patch by filterfalse. Fixed completion of :cabbrev not using bracket notation in expansion. Fixed `<` not being turned to `` on displaying right-hand sides. Fixed description of empty abbreviations being empty instead of ``. Fixed tiny memory leak on trying to list abbreviations when there are none. Fixed `:[un]select !` treating "" as an external command. Fixed !! not affecting commands that include %s or %v macro. Thanks to James Dietrich. Fixed parsing of comma-separated lists hanging on empty last element and skipping leading commas. Fixed output formatting of :autocmd (pattern negation broke column alignment and wrapping). Fixed environment variables not being expanded on checking that a :file[x]type or :fileviewer command exists in $PATH. Thanks to Ben Elan. Fixed search match highlighting when the match is cut off due lack of space. Patch by Vadim Curcă. Fixed running tests with locales that use comma for decimal point. Thanks to PRESFIL. Fixed foreign commands missing from `:command {prefix}` output. Patch by 高浩亮 (a.k.a. haolian9). Fixed foreign commands missing from completion of `:[del]command {prefix}`. Patch by 高浩亮 (a.k.a. haolian9). Fixed documentation on yy, Y, dd and DD not mentioning how "s" flag of 'cpoptions' affects their behaviour. Thanks to James Dietrich. Fixed FUSE mounter error message dialog missing newlines (regression in 0.13-beta). Fixed "Querying... (??%)" message on :compare having an extra space in parenthesis. Fixed potential integer overflows on sorting. Fixed weird sorting of filenames with non-Latin characters when 'sortnumbers' option is set and strverscmp() is not provided by the system (like on Windows). Fixed :compare hanging on trying to compare non-regular files like pipes by contents. Fixed :compare reporting identical files as changed when there were more than a couple of files with identical size and 4096-byte prefix. A regression in 0.13-beta. Thanks to Alexandr Keyp (a.k.a. IAmKapuze). Fixed stream redirection issues with background jobs on Windows (those created via `:!cmd &` or in Lua) if the application was closing one of standard streams. Fixed colors sometimes (rarely) changing in seemingly random ways. Fixed :jobs showing some already dead jobs as running. Fixed running external commands which start with a dash. Patch by Ivan Shapovalov. Fixed absolute paths not being completed when 'autocd' option is enabled. Mind that it can't work on Windows due to ambiguity between a command and a full path there. Thanks to Taras Halturin (a.k.a. halturin). Fixed individual error messages when 'syscalls' is on lacking system error string which is present when errors are aggregated at the end of an operation. Thanks to an anonymous at Vifm Q2A site. Fixed `data/vifmrc` next to vifm.exe being used as global vifmrc file on Windows. Thanks to midrare. Fixed vifm-media script not listing external drives with udevil and udisks. Fixed vifm-media script not listing removable drives with udisks marked as non-removable by udisks. Fixed incorrectly determining whether a directory is writable on Windows (primarily C:\ could be reported as non-writable). Thanks to theorlangur and bitraid. Fixed :substitute, :tr, gu* and gU* detecting a non-existent target name conflict when rename in a custom view would produce an identically named files in different directories. Thanks to aleksejrs. Fixed lack of a redraw after running :substitute, :tr, gu* or gU* in a custom view. Fixed a leak of error message string when using `:rename new-names...`. Fixed :rename not recognizing identical paths in source and destination lists if they were edited (e.g., to contain extra slashes, "./" or "../"). Fixed weird character appearing on Ctrl-Space combination in command-line mode. Fixed :restart leaving histories disabled unless 'history' is set to a non-default value in vifmrc. Thanks to James Dietrich. Fixed processing of file names and paths that undergo escaping in the UI, like inability to externally rename them (regression in 0.12.1 beta). Thanks to jc-SpaceXp. Fixed rules for handling of selection by :file[x]type not taking %"c/%"C/%"f/%"F macros into account (relevant mostly to Windows). Thanks to smoothdad. Fixed unreliable internal checks for %pd, %px, %py, %pc and %r macros. Previously they could be found in something like "%%pd", which should not be interpreted as %pd. Fixed registers' content of multiple instances not being synchronized on use of %"r macro. Fixed a crash after a memory corruption when running an external command via expansion of an environment variable when 'fastrun' is set (e.g., `!$EDITOR`). Thanks to Quaddroo. Fixed :elseif evaluating its expression even if an earlier conditional branch was already taken. Fixed loading a session with global tabs when 'tabscope' is "pane" resulting in global tabs being invisible. Fixed statusline having invalid colors when 'wildstyle' is "bar" and completion is initiated by Shift-Tab. Fixed Ctrl-A and Ctrl-E in command-line mode not stopping completion unlike other similar keys. Fixed directories not being accounted for in estimates. Thanks to justpretending2. Fixed global version of 'viewcolumns' not validating its value. Thanks to Vadim Curcă. Fixed `&&` operator which was acting as binary `&` (in terms of evaluation, the result was properly boolean). Thanks to justpretending2. Fixed use of environment variables in :if in sample vifmrc file. Checking for an empty string should be done explicitly with `==` or `!=`. Thanks to justpretending2. Fixed Escape being handled as Ctrl-C in prompts which suppresses future errors. Fixed outdated documentation on the behaviour of n/N when 'hlsearch' is enabled since the introduction of highlighting of search matches. Thanks to James Dietrich. Fixed /usr/share/terminfo not being consulted when running from an AppImage. Thanks to anonymous at Vifm Q2A site. Fixed system() and term() not taking 'shell'/'shellcmdflag' into account on Windows. Thanks to spence91. Fixed a race condition on displaying errors of a job in :jobs menu. 0.13-beta to 0.13 (2023-04-04) Made "withicase" and "withrcase" affect how files are sorted before comparison, otherwise they might not produce the intended effect. Reduced cursor flickering during incremental search in visual mode. Patch by filterfalse. Fixed segfault on trying to expand "~username" path prefix with a huge length of the user name. Fixed user mappings replacing a mapping from Lua in an incomplete way which could lead to assertion or some unpredictable behaviour. Fixed map menus not listing mappings that accept a selector. Fixed handling mouse events in normal and view modes in single pane mode. Fixed :hideui not hiding anything on Windows. Thanks to Ed Pavlov. Fixed segfaults on changing sibling directory or previewing directories in miller view while global sorting by groups is active. Patch by filterfalse. Fixed cl processing selection it was used previously on instead of file under cursor when you run it twice in succession. Fixed graphics from miller view preview remaining visible when displaying dialogs, entering menus, switching tabs, activating more or file info modes. Fixed "rpreview:" of 'milleroptions' not being copied to new tabs. Fixed selection not being stashed by do and dp. Fixed memory issues inside ncurses when dialog is displayed in menu mode after resizing the terminal. 0.12.1 to 0.13-beta (2023-03-17) Changed implementation of `:compare grouppaths` to juxtapose only files with identical relative paths. Patch by Alexandr Keyp (a.k.a. IAmKapuze). Changed use of `$(filter-out)` in src/Makefile.am to `$(var:from=to)` substitution to get rid of a warning on configuration. Changed how pthread support is detected by configure script to handle more cases. Thanks to Markus Elfring (a.k.a. elfring). Changed configure script to fail if neither perl nor vim is available instead of failing to generate tags for Vim-style documentation. Thanks to Sergei Trofimovich (a.k.a. trofi). Changed %N macro to also not start a process group for a command. Thanks to Oskar Grunning (a.k.a. sQVe). Changed error reporting for some of the :commands such that now their failures cause a dialog to appear on sourcing, previously those errors were printed only to status bar. Added "withicase" and "withrcase" to :compare that force ignoring and respecting case respectively on comparing file names and paths. Thanks to Jose Riha (a.k.a. jose1711). Added printing stats while in :compare mode. Patch by Alexandr Keyp (a.k.a. IAmKapuze). Added "columncount:" value to 'lsoptions' to always display fixed number of columns. Thanks to Aleksandr Vysotskiy (a.k.a. loki1368). Added show* arguments to :compare command to control/switch which sets of files are displayed (toggling is done by :compare!). Patch by Alexandr Keyp (a.k.a. IAmKapuze). Added builtin handling of mouse events. Patch by 高浩亮 (a.k.a. haolian9). Thanks to ranousse, Sergei Shilovsky and user451421541757324. Added 'mouse' option to control when mouse input is handled (not handled by default). Added input() builtin function to prompt user for input. Thanks to Artur F. (a.k.a. arturfabriciohahaedgy). Added ETA to detailed progress dialog. Thanks to Jose Riha (a.k.a. jose1711). Added `--plugins-dir` command-line option which allows specifying additional places to look for plugins. Thanks to 高浩亮 (a.k.a. haolian9). Added Ctrl-Y key to command-line mode. It activates fast navigation that allows entering deep paths by a series of searches for individual path components. Thanks to Henrik Holst (a.k.a. hholst80) and dmocek. Added Ctrl-J key to command-line navigation. It leaves the mode without opening a file/directory. Thanks to filterfalse. Added Ctrl-O key to command-line navigation that goes to parent directory. Added Ctrl-N/P keys to command-line navigation to move view cursor up/down. Thanks to Henrik Holst (a.k.a. hholst80) and dmocek. Added Arrows/Home/End/Page Up/Page Down keys to command-line navigation to move view cursor. Thanks to Henrik Holst (a.k.a. hholst80) and dmocek. Added :amap, :anoremap and :aunmap commands to configure mappings in navigation mode. Thanks to Henrik Holst (a.k.a. hholst80) and dmocek. Added 'navoptions' option to allow tweaking navigation mode a bit. Thanks to filterfalse. Added "rpreview:files" to 'milleroptions'. Thanks to aksr. Added r key to :jobs menu, which reloads the list of jobs. Thanks to Sylwia Ptasinska (a.k.a. SylEleuth). Added :regedit command for external editing of register contents. Thanks to Daniel J. Perry (BioBox). Patch by Rostislav Tolushkin (a.k.a. nullptr-deref). Added additional User10..User20 highlight groups and corresponding %10*-%20* macros. Thanks to Sylwia Ptasinska (a.k.a. SylEleuth). Added 'tabline' option to specify format of the tab line. Added filereadable() builtin function mainly as a way to check file's presence. Reduced amount of memory consumed by `:compare groupids`. Made `:compare bycontents` not bother reading content of files which have unique size. Provide basic instructions in the documentation on how mappings work. Thanks to dmocek. Extended do and dp keys to process selection. Thanks to Mark S. (a.k.a. Markuzcha). Apply file highlighting to "ext" and "fileext" view columns. Thanks to aleksejrs. Made instances running inside AppImage consider contents of `/etc/vifm`. Thanks to aleksejrs. Made Ctrl-E/Ctrl-Y scroll transposed ls-like view horizontally by one column. Install icons also to ${prefix}/share/icons. It's not clear that using ${prefix}/share/pixmaps will always be handled properly. Thanks to Szilárd Andai. Made feedback after pressing dd in :jobs more prominent. Thanks to Sylwia Ptasinska (a.k.a. SylEleuth). Merged file conflict comparison dialog into the main conflict dialog. Thanks to aleksejrs. Made file conflict more concise. Thanks to aleksejrs. Update Default-256 to differentiate between more file types. Thanks to aleksejrs. Don't move cursor on search failure during search with a count. Patch by filterfalse. Specified a few more cases when to show a search message with search highlighting turned on: if found a match, if wrapping is turned on, and in visual mode. Patch by filterfalse. A regular search logic showing messages is applied to n/N. Patch by filterfalse. Made aborting deletion abort the operation on the rest of files when deleting multiple files. Fixed segfault on trying to use pipe from Lua after its parent VifmJob object was garbage-collected. Thanks to PRESFIL. Fixed check for broken symlinks in :edit command. Fixed positioning hardware cursor in transposed ls-like view. Fixed width of file names that don't fit into ls-like column being larger than the width of other files. Fixed ellipses being lost in side columns of miller view. Fixed 'previewprg' not being respected on switching to view mode (regression in 0.12-beta). Thanks to Sitaram Chamarty. Fixed $VIFM_APPDIR_ROOT being ignored by :help command, which made it not work properly from AppImage. Thanks to infinitewhileloop. Fixed escaping of file paths when using 'vicmd' or 'vixcmd' to open a file on Windows. Thanks to Phil Runninger. Fixed :locate never escaping its arguments (should be done unless the first one starts with a dash). This is a regression in 0.7.6. Fixed trash directory being created at default location on :restart. Fixed abort due to assertion failure on using zx normal mode key after leaving tree in some cases. Thanks to Mark S. (a.k.a. Markuzcha). Fixed asynchronous previewing of symbolic links, which required manual redraw. Thanks to Alexandre Viau. Fixed fish completion not completing paths for `--choose-files` and `--choose-dir` options. Fixed a "benign" data race on ga/gA. Fixed error of :cunabbrev not being visible to the user. Fixed segfault on passing invalid tag to :delbmarks. Fixed :echo printing previous message when invoked without arguments. Fixed Ctrl-E in visual mode not doing anything when view is scrolled to its top. Fixed 'milleroptions' not recovering value of "rpreview:" on error. Fixed FUSE mounting assuming `2>` redirection is supported by the shell, which isn't true at least for csh and tcsh. Thanks to Evgeniy (a.k.a. iron-udjin). Fixed :media not redrawing on reloading ("r" key) and also wasn't repositioning cursor properly when menu length shrinks as a result of a reload. Fixed stashing visual mode selection on transition from visual amend mode to regular visual mode (av -> v). Patch by filterfalse. Fixed dropping normal selection on incremental search in visual amend mode. Patch by filterfalse. Fixed input bar not being updated in visual mode if any status bar message has been shown. Patch by filterfalse. Fixed error/prompt dialogs not reaching maximum allowed height. Fixed "<>" message in dialogs reporting wrong number of lines and sometimes hiding a single line. Fixed dialogs not handling non-latin characters well. Fixed :source producing too many errors when specified path doesn't exist. Fixed n/N not moving the cursor without prior search in visual mode. Patch by filterfalse. Fixed showing wrong match number instead of error message on search in visual mode. Patch by filterfalse. Fixed resetting 'hlsearch' during incremental search in visual mode. Patch by filterfalse. Fixed dropping selected files on empty input during incremental search in visual mode. Patch by filterfalse. Fixed resetting count to 1 during incremental search in normal mode. Patch by filterfalse. Fixed description of %i macro in the documentation to mention that it runs command in background. Fixed the last search direction not being saved on search performed from non-normal mode. Patch by filterfalse. 0.12.1-beta to 0.12.1 (2022-09-21) Added shell completion for fish shell. Patch by Hoang Nguyen (a.k.a. FollieHiyuki). Permit directories with trailing slashes supplied by external commands in `:[un]select !cmd`. Patch by filterfalse. Fixed prefix mappings being left after removing a key (e.g., "a" remaining after mapping and unmapping "ab"). Patch by filterfalse. Fixed infinite loop on restoring visual selection after changing the order of files to the opposite (`:invert o`). Patch by filterfalse. Fixed 'sort' and 'sortorder' string representations not being updated after `:invert o`. Patch by filterfalse. Fixed memory leak on using 'cdpath'. Fixed NULL pointer dereference on parsing desktop files, if no MIME type recognizers are available. Patch by filterfalse. Fixed "load" subcommand of :plugin not being completed. Fixed not being highlighted after :cnoremap and :cmap. Fixed parts of graphics being left on entering menu mode. Fixed %i without " &" preventing some applications from running by closing their standard output and error. Thanks to Daniel J. Perry (a.k.a. BioBox). 0.12 to 0.12.1-beta (2022-09-05) Changed conflict dialog to offer "Merge all" option even for files if there are some directories left to process. Thanks to dalvand. Changed how location of trash directory is determined. Now starting `vifm --no-configs` won't mess anything up if you're using `~/.vifm`. Can potentially cause some trouble for existing configurations, but shouldn't. Changed [c and ]c to also traverse added/missing entries. Thanks to qsmodo. Added 'autocd' option. Makes invalid :commands be interpreted as an implicit :cd command. Thanks to Taras Halturin (a.k.a. halturin). Added %N macro that prevents detaching viewers from current session. Thanks to emorozov. Added cl key visual mode (similar to its function in normal mode). Added handling of "-" in :session for switching to a previous session. Added %pu macro that disables caching of viewer's output. Thanks to b0x4it. Added comparison action to conflict resolution dialog. Thanks to anonymous at Vifm Q2A site and dalvand. Added :keepsel command. Changes default behaviour after running a :command to not reset selection of a view. Thanks to dalvand and sharklasers996. Added -skip parameter to :copy/:move/:alink/:rlink. Makes the commands automatically skip files that exist at destination instead of refusing to proceed. Thanks to Jose Riha (a.k.a. jose1711). Added "datasync" value to 'iooptions' option to configure whether writes on file copying when 'syscalls' is on are synchronized periodically. Thanks to Andrew Savchenko and Afz. Added angle-bracket notation for alpha keys with Alt and Shift modifiers (<[am]-s-[a-z]>, ). Thanks to Reece Petersen. Added angle-bracket notation for numeric keys with Alt modifier (<[am]-[0-9]>). Thanks to anonymous at Vifm Q2A site. Added expression pseudo-register (Ctrl-R =) for command-line mode. Thanks to Marcos Cruz and Jiji from Vifm Q2A site. Added "ehistory" value to 'vifminfo' and 'sessionoptions' option. It manages storing of expression register history. Added ":history exprreg" menu for displaying history of expression register values. Added optional border for horizontal split layout controlled by newly added "hborder" in 'fillchars'. Patch by qsmodo. Added "maxtreedepth" value to 'previewoptions' option, which allows limiting depths of the displayed tree. Thanks to Afz. Added %o macro to 'statusline', which expands to Unix permissions in octal form (and to nothing on Windows). Thanks to iSeeU816. Added initial support for Yori shell on Windows (not everything might work well at this point). Thanks to LinArcX. Added angle-bracket notation for some shifted grey keys: , , , , , , , , , . Patch by M Kelly. Added %l/%"l and %L/%"L macros for the list of selected files. %f is not empty if there is no selection, which is not always desirable. Thanks to ratnamhof. Added parsing of \c and \C sequences in regular expressions to force case ignoring or matching respectively. Thanks to filterfalse and Safal Piya (a.k.a. mrsafalpiya). Added :PeditVifm command (and corresponding :PeditVim) to the plugin. Thanks to Mukund Mauji (a.k.a. maujim). Added CmpUnmatched and CmpBlank highlight groups. Thanks to qsmodo. Extended optimizations for globs to cover `something*` and `some*thing` cases. Updated xxHash to 0.8.0 and switched to XXH3 variant. Extended has() builtin function to check for Lua handlers. Extended cl normal mode key to handle selection of multiple files. Thanks to aleksejrs. Hide graphics when displaying dialogs or entering menus, more or file info modes. Thanks to heelsleeh and PRESFIL. More consistent spelling of "status bar" and "status line" in documentation. Thanks to tcftbl. Document that key might correspond to . Thanks to dalvand. Don't expand() macros in environment variables. Patch by filterfalse. Try several editors and then $EDITOR for 'vim' option in sample vifmrc files. Thanks to Janek (a.k.a. xeruf) and Muhammed Zakir. Include unprintable Unicode code points in the set of characters escaped in file names and start escaping them in file view. Patch by MadMaverick9. Escape unreadable characters in menus, command-line mode, dialogs and statusbar messages. Thanks to MadMaverick9. Set `title` option by default if $TERM is foot* as its terminfo entry might lack tsl and fsl attributes. Thanks to nobodyatandnothing. Display permissions in octal form in File Info dialog and group them with owner/group info. Thanks to iSeeU816. Made gs normal mode key remember selection for up to 10 last entered directories. Thanks to ratnamhof and Matthias Braun (a.k.a. mb720). Reformat File Info dialog to be more compact. Thanks to chelovechishko. Do not reset selection on :view command. Thanks to Alexandre Viau. Fixed cursor appearing at random places on entering command-line mode. Fixed flicker and loosing parts of input on incremental search in menus. Fixed ruler flickering on typing during incremental search in menus. Fixed severe performance degradation after measuring size of large directory trees. Fixed building when fdatasync() call isn't available. Thanks to Schrijvers Luc (a.k.a. Begasus). Fixed flicker of status line on editing in command-line mode. Fixed resolving symlinks to symlinks on checks for regular file. Thanks to Olmo Kramer. Fixed :goto command not positioning cursor correctly if provided on command-line. Thanks to Toan Nguyen (a.k.a. toan2406). Fixed --remote and --remote-expr failing if $TERM isn't valid (regression in 0.11-beta). Thanks to b0x4it. Fixed `:compare listunique` yielding different results depending on which view is active due to not processing bottom files in the current view in some situations. Fixed information about implicit file selection (count or ranges) being lost due to the use of expand() builtin function in 'statusline'. It was fixed previously, but the fix got undone prior to the release. Thanks to dalvand. Fixed expand() requiring backslashes to be escaped twice (once for environment variable expansion and once for macro expansion), which isn't convenient nor intuitive. Fixed truncation of the dollar sign during expansion of non-existent environment variables. Patch by filterfalse. Fixed assertion failure on processing mappings with RHS of the form "{mapping with selector}{something else}". Thanks to dalvand. Fixed search and local filter values set from :history menu being split at bar (|) and each piece applied in turn. Fixed losing visual mode selection after executing two command-line commands where the first one enters visual mode and the second one implicitly resets selection. Thanks to dalvand. Fixed background :copy/:move handling broken symlinks as non-existent files during the operation (which wasn't happening if such file was there initially). Fixed write to a pipe of a closed process in Lua causing SIGPIPE and termination of the application. Fixed :. incorrectly checking for one path being parent of another and producing weird results ("/pa" was considered parent of "/path", with "th" being the result). Thanks to Dennis Preiser (a.k.a. 0xDP). Fixed displaying empty matches at the start/end of menu items. Fixed displaced search highlighting when horizontal scrolling hid multi byte text. Fixed completion of broken filenames (those for which encoding to wide character fails) causing memory corruption. Fixed running :set from autocommands triggered during processing of vifmrc changing options for all views. Thanks to Alexandre Viau. Fixed handling errors on :mkdir with 'syscalls' set. They weren't displayed and retry/ignore/abort prompt wasn't presented. Fixed segfault on ignoring an error from :touch with 'syscalls' set. Fixed operations ignored via retry/ignore/abort prompt still being added to undo history. Fixed graphics not being cleared properly on switching between viewers in view mode. Fixed externally edited prompt not being saved to history. Fixed completion of command-line prompts breaking input at pipe symbol (|). Fixed resetting 'fillchars' option and separate values. Again, this one is cursed. Fixed borders not being filled after loading an empty color scheme. Fixed directory preview resetting after detaching from it. Thanks to Luka Markušić (a.k.a. mark2185). Fixed conflict dialog offering merging on rl and al normal mode commands. Fixed :restart creating trash directory in incorrect location on Windows in some cases. Fixed argument escaping issues for foreground programs on Windows. Thanks to fohrums. Fixed slashes being doubled in macros like %"c on Windows with cmd.exe as a shell. Thanks to Toby Hawkins (a.k.a. HawkinsT). Fixed auto-detection of GUI programs on Windows, which prevents Vifm from waiting on them to finish. Thanks to Azin Sharaf. Fixed 'trashdir' expanding ~ only of the first entry. Fixed `start` in file[x]type commands on Windows not being considered as present. Fixed selection created prior to running av in normal mode showing up after switching to a regular visual mode via v key and moving cursor over it. Fixed processing of extended keys on OpenBSD. Fixed memory error in :media menu on an unlikely error path. Thanks to dcb314. Fixed memory leak from bar in progress dialog. Fixed checking version of GNU coreutils at build time. 0.12-beta to 0.12 (2021-09-29) Made :VifmCs of the plugin handle 24-bit colors. Collect desktop files also from ~/.local/share/applications. Thanks to Jose Riha (a.k.a. jose1711). Align output of :highlight better. Fixed maximum number of arguments for :highlight command. Thanks to Yuriy Artemyev (a.k.a. anuvyklack). Fixed binary data messing up TUI. Fixed new "combine" highlight attribute not being completed or displayed by :highlight command. Fixed garbage being printed sometimes after doing search in a menu. Fixed miller preview blinking too much. Thanks to filterfalse. 0.11 to 0.12-beta (2021-09-15) Changed semantics of light* color groups to add bold attribute only for terminals with less than 16 colors. Aligns the behaviour with Vim. Affects you only if you relied on that implicit bold attribute. Thanks to Jose Riha (a.k.a. jose1711). Added experimental Lua plugins support. Added :plugins command that opens plugins menu. Added %P macro to 'rulerformat' (and thus to 'statusline'), which expands to All, Top, xx% or Bot to indicate position within the view. Thanks to iSeeU816. Added progress indication to the ruler of the view mode (corresponds to new %P macro of 'rulerformat'). Thanks to iSeeU816. Added i view mode key that toggles raw mode (ignoring of defined viewers). Thanks to j-xella. Added a and A view mode keys that switch to next and previous viewer of current file correspondingly. Thanks to j-xella. Added 'previewoptions' option to allow tweaking graphics preview a bit. Thanks to Joshua Jensch (a.k.a. patroclos) and flux242. Added "toptreestats" value to 'previewoptions' option, which makes stats appear before the tree. Patch by qsmodo. Added :plugin command that manages plugins. Added network mount and `subst` targets to :volumes menu. Patch by Phil Runninger. Added "combine" pseudo-attribute to "cterm" parameter of :highlight command. It changes behaviour from overwriting attributes of a parent highlight group (within their hierarchy) to appending to it. Thanks to Andrew Savchenko. Added literal values to 'viewcolumns' option. Thanks to Jose Riha (a.k.a. jose1711), chelovechishko, DieSpinne and rwtallant13. Added shortcuts for toggling flags in permissions dialog on *nix. Patch by qsmodo. Added %v macro for vertical splitting in terminal multiplexers. Patch by qsmodo. Added %Pl and %Pz macros for redirecting list of files to standard input of commands. Thanks to PRESFIL. Added %N macro to 'statusline' option, which adds a line break and increases height of the status line. Thanks to Jose Riha (a.k.a. jose1711), qsmodo and jcarreja. Added interactive re-editing of file names in external editor. Format now supports comments for displaying last error and original file names. Thanks to Jose Riha (a.k.a. jose1711) and Diogo Lemos (a.k.a. dmlemos). Added "l" and "r" flags to the 'tuioptions' option. It controls truncation of view titles. Patch by qsmodo. Added periodic forced flushing of data on copying data when 'syscalls' is set. Thanks to Matthias Braun (a.k.a. mb720). Added :st[op] command that behaves like Ctrl-Z. It's to be used in mappings. Thanks to GummyGun. Added zx normal mode key to fold/unfold directories in tree views. The implementation is not optimal at this moment though. Thanks to filterfalse, Ben Lu (a.k.a. ayroblu), RR0925 and Alexandre Viau. Added "depth=N" parameter to the :tree command. Thanks to filterfalse. Added support for direct/"true"/24-bit colors for ncurses 6.0 or later. Thanks to Anton Kochkov (a.k.a. XVilka) and IvanBarsukov. Added "gui", "guifg" and "guibg" parameters to :highlight command. Added some additional information about instance to the :version/:vifm menu. Added %c 'statusline' macro that displays size of current file-system. Thanks to Jose Riha (a.k.a. jose1711). Made :VifmCs of the plugin fail when 'termguicolors' produces a 24-bit color value. Thanks to AtomToast. Don't list inaccessible instances on --server-list. Made contents of map menus easier to comprehend by adding captions. Include shortcut prefix in title of map menus. Document how %i macro affects background jobs. Made it possible to build AppImage for Vifm. Patch by michaellee8. Started using quickview's cache in view mode. Extended cache of viewer's output to contain multiple entries (initial version of the cache was added to skip redrawing graphics). Implemented asynchronous previewing for textual and pass-through (think sixel) viewers. Thanks to StillSteal, laur89, Joshua Jensch (a.k.a. patroclos) and p-kolacz. Run background programs detached from a terminal. Thanks to Miguel Madrid Mencía (a.k.a. mimame). Allow exploring empty files or output of viewers. Thanks to Andrew Savchenko. Allow user-defined commands to include numbers in their names. Thanks to anonymous at Vifm Q2A site. Make :compare obey file name filters. Patch by qsmodo. Always display UID/GID in numeric form in File Info dialog (in parenthesis if the id was resolved to a string). Updated logo of the project. Thanks to Hescalalu for making it. Detect broken links on preview and report them as such. Fixed pointing 'trashdir' to a symbolic link to a directory causing issues. Thanks to ChongChong He. Fixed lack of error message when overwriting of file fails with 'syscalls' turned off. Thanks to anonymous on SourceForge discussion forum. Fixed an issue with packaging on one system (Linux in this case) and building on the other (OS X). Thanks to chenrui333. Fixed information about implicit file selection (count or ranges) being lost due to the use of expand() builtin function in 'statusline'. Thanks to DieSpinne. Fixed presence of %q macro causing second round of macro expansion. Fixed quickview not being redrawn after leaving File Info dialog or more mode. Fixed pane tabs being created after the last one instead of after current tab. Thanks to anonymous and n.e. at Vifm Q2A site. Fixed hang on using previewer that takes over control over the terminal (like 7z does to read password). Thanks to PRESFIL. Fixed inability to map escape sequences due to extended keys in terminfo database. Patch by M Kelly. Fixed not being able to view really long file names in full in File Info dialog. Thanks to 702b. Fixed compilation on AIX. Thanks to Jose Riha (a.k.a. jose1711). Fixed mounting and directory replacement not being detected as directory change when inotify is used. Thanks to Jakob Helmecke and PRESFIL. Fixed :empty leaving empty directories on Windows. Thanks to Grueslayer. Fixed losing files as a result of executing ":copy! &" or ":move! &" when both panes show the same directory. Thanks to Hans Bieshaar. Fixed a memory leak possible on formatting tab titles and status line. Fixed possible crash after changing 'classify' and then switching to inactive tab. Fixed attempts to complete nonsensical arguments to :set removing those arguments. Fixed some scrolling keys in view mode when there is only one visible line. Fixed backward search of view mode not reporting failure if there was a match at the very first line. Fixed running tests as root user. Thanks to Michka Popoff (a.k.a. iMichka). Fixed graphical preview of files in the right column of miller view not being properly cleared on directory change. Thanks to CosmosAtlas. Fixed vifm-convert-dircolors dropping copies of entries that differ only by case. Thanks to flux242. Fixed permission dialog on *nix systems not showing all information correctly after a redraw. Fixed incorrect colors on redrawing wild menu popup on terminal resize. Fixed order of checks on :copy?/:move?/:alink?/:rlink?. Now custom view is checked for duplicates before prompting for list of files. Fixed refusing to :copy/move/alink/rlink identically-named files from custom views even if list of new names is supplied. Fixed cw key of visual mode not being documented. Fixed copying of executable files not working on FreeBSD. Thanks to makijato. Fixed :chmod lacking a reload, which is needed because attribute change might not be detected. Fixed :goto not working with backslashes on Windows. Thanks to Grueslayer. Fixed full path patterns ({{globs}} and //regexp//) not working in tree views. Fixed number of filtered files not being updated in tree views on pressing zf key. Fixed "Building tree..." message not restoring contents of status bar in command-line mode. Thanks to filterfalse. Fixed issues with displaying composite characters. Thanks to Dennis Preiser (a.k.a. 0xDP). Fixed some file operations not being blocked in custom trees even though they can't handle them (custom views in general can't). Thanks to filterfalse. Fixed graphical preview of files in the right column of miller view not being properly cleared on switching to a directory preview. Thanks to TheMystifyingCharacter. Fixed sample :zip command to work with multiple files. Thanks to Branislav Gerazov. Fixed handling of broken links that exist at destination on putting files. Thanks to aleksejrs. Fixed zj not working before the last entry if it's an empty directory. Thanks to filterfalse. Fixed processing of keypad keys on Windows. Thanks to Roland. 0.11-beta to 0.11 (2020-09-24) Recommend against setting 'shellcmdflag' to "-ic" value. Made it possible to escape commas in patterns (as usual, by doubling). Thanks to filterfalse. Don't display number of hard links in File Info dialog on Windows. It's always zero there. Follow targets of .lnk-files on Windows on gF. Fixed ga and gA on symlinks to directories on their own (regression in 0.11-beta) and as part of selection. Thanks to filterfalse. Fixed an issue with undesired cache invalidation for symbolic link to directories, which caused performance issue (regression in 0.11-beta). Fixed `:sync! all` not synchronizing local filter of a tree with `set cvoptions=localfilter`. Thanks to filterfalse. Fixed documentation in Vim format linking section about globs instead of section on patterns in the description of :filetype, :filextype and :fileviewer commands. Fixed zd adding ".." directory even with 'dotdirs' not containing "treeleafsparent". Fixed tab labels of pane tabs being messed up (regression in 0.11-beta). Fixed highlighting of search matches in preview (regression in 0.11-beta). 0.10.1 to 0.11-beta (2020-09-10) Added :VifmCs command to the plugin for "converting" Vim's color scheme into a Vifm's one. Patch by Roman Plášil (a.k.a. Quiark). Added references to "Menus and dialogs" section of documentation from :commands and keys which open menus and dialogs detailed there. Added "tabs" value to 'vifminfo' option. It enables persistent tabs. Thanks to Cosmin Popescu (a.k.a. cosminadrianpopescu), filterfalse and Neil Griffin (a.k.a. ngriffin7a). Added :tabo[nly] command that closes all tabs but the current one. Added "v" flag to the 'tuioptions' option. It controls whether width of middle border is adjusted to equalize view sizes. Thanks to Matthias Braun (a.k.a. mb720). Added 'tablabel' option that specifies format of a single tab's label when non-empty. Thanks to aleksejrs. Added three MC-like shortcuts to sample vifmrc files (Alt-I, Alt-O and Ctrl-U). Thanks to Hans Bieshaar. Added HardLink highlight group for regular files with more than one hard link. Patch by Hans Bieshaar. Added 'sessionoptions' option, which is an alternative to 'vifminfo' for session files. Added :session and :delsession commands to manage sessions. Thanks to Marcos Cruz. Added v:session builtin variable that provides name of current session or is set to an empty string. Added global Default-256 color scheme to be used in terminals that support 256-color palette (automatically in sample vifmrc). Thanks to Shakil Akhtar. Added rate and progress bar to progress dialog. Patch by Alborz Jafari. Added "treeleafsparent" value to 'dotdirs' option. Thanks to filterfalse and Melandel. Added LineNr highlight group for highlighting line number column of views. Thanks to Anton Gepting. Added OddLine highlight group for highlighting every second entry line of a pane. Thanks to iSeeU816. Added v:jobcount builtin variable that provides number of active jobs (number of lines in :jobs menu). Thanks to iSeeU816. Added basic support for using PowerShell on Windows (pausing doesn't work). Thanks to Fang (a.k.a. peromage). Added 'tabprefix' and 'tabsuffix' options that allow customizing tabline separators. Thanks to CoreCube. Added real (fully resolved) path to the File Info dialog. Thanks to Alexandre Viau. Added number of hard links to the File Info dialog. Added gF normal mode key which acts like gf, but goes all the way to the ultimate target of the chain of symbolic links. Thanks to Alexandre Viau. Added optional "full" parameter for the :restart command, which makes it discard essentially all context. This is useful with persistent tabs. Thanks to Yusuf Aktepe. Made documentation of :command more comprehensible. Explicitly documented that macros are expanded in user defined commands. Thanks to gcmt. Clean up tests directory on "make clean" in the top of the tree. Avoid interposing system's reallocarray(), when it's present. Thanks to Ben Boeckel (a.k.a. mathstuf). Install only one version of sample config and media script, the one which corresponds to operating system being used. Thanks to Michael Vetter (a.k.a. jubalh) and Ondrej Novy (a.k.a. onovy). Don't force view reload after every :command that resets selection when there was non-empty selection. This might make metadata of files less up-to-date, but should increase overall performance. Thanks to Jose Riha (a.k.a. jose1711). Avoid reloading source file list after copy or move operation when possible. Thanks to Jose Riha (a.k.a. jose1711). Document that user must disable netrw plugin on his own when enabling g:vifm_replace_netrw. Vifm's plugin can't do it, because it's loaded after plugins shipped with Vim. Significantly improved performance of adding files to registers that contain thousands of files. As a result contents of registers is sorted now. Thanks to Typo. Significantly improved performance of adding files to trash that contains thousands of files. As a result contents of trash is sorted now. Thanks to Typo. Documented how selection is handled on launching files (like on l or Enter keys). Don't reset histories of views in inactive tabs on :restart. Invalidate textual quickview cache if it contains fewer lines than window height and is incomplete. Do not require "dhistory" to be present in 'vifminfo' for "savedirs" to work. Abort menu, more or file information modes before processing remote commands. Thanks to kangshugang. Improve navigation on gf key. Do fewer refreshes and disable filters to make target visible. Follow targets of .lnk-files on Windows. Thanks to Alexandre Viau. Display targets of .lnk-files in file information dialog on Windows. Limit length of custom file list title to 80 character positions. Thanks to filterfalse. Make displaying of spaces in mappings more intelligent by using at the start or end of lhs or rhs. Prevent internally selected files (e.g., via a range of a :command) from appearing selected in user interface. Thanks to filterfalse. Make 'title' option work in all terminals which contain "tsl" and "fsl" capabilities. Thanks to m-kru. Use global color scheme for preview on the other pane ignoring its directory-specific color scheme. Improve documentation on "bycontents" of :compare. Thanks to maxigaz. Make comparing files by contents (`:compare bycontents`) somewhat faster. Thanks to maxigaz. Use the same label for :grep and :find custom lists as the one used for :grep and :find menus. Thanks to filterfalse. Use unexpanded command for title of custom file lists produced using %u or %U macros. Thanks to filterfalse. Use unexpanded command for title of a menus produced using %m or %M macros. Update terminal title when in menus. Thanks to filterfalse. Escape some characters as ^X in view and tab titles, custom menu titles, on status line and in terminal title. Thanks to filterfalse. Use name of user-defined command in titles of custom views and menus. Thanks to filterfalse. Preserve more information in the title on turning custom view into tree using :tree. Thanks to filterfalse. Decrease number of UI updates on file operation to prevent cursor flickering. Improve cursor positioning after file operations. More sensible merging of histories from multiple instances in vifminfo file. Improved handling of long or unknown escape sequences in previews. Thanks to bratekarate. Significantly improved speed of sourcing files (includes processing configuration on startup and :restart). Significantly improved speed of handling typical globs (and therefore mime-type matchers) and reduced amount of memory they take up. Thanks to yanzhang0219. Implemented capturing output of background applications on Windows. Thanks to Gene Zharov. Detect being run under Wayland (relevant for :filextype commands). Thanks to mhdzli. Somewhat improved documentation on 'ignorecase' and 'smartcase' options. Thanks to filterfalse. Invalidate cached directory information (size or number of files) on inode change. Thanks to Jose Riha (a.k.a. jose1711). Invalidate cached directory size when using it to compute size of some parent directory. Reduce width of top line when side borders are hidden (`set tuioptions-=s`). Thanks to Svyatoslav Mishyn (a.k.a. juef). Create $VIFM/colors directory with default color scheme only on the first run. Thanks to ranousse. Improve differentiation between association and list forms of :colorscheme command on startup. This is important if list contains name of color scheme that doesn't exist. Try harder to preserve position of the splitter. Avoid its drift on terminal resizes and preserve ratio of windows on startup and tab switches. Thanks to Shakil Akhtar. Improve performance of mime-type detection by caching the results. Deduplicate elements of the :file menu. Use mime-types in associations in sample vifmrc. Thanks to Shakil Akhtar. Fixed symbolic link as FUSE mount point not being removed on systems with FreeBSD kernel. Thanks to Ondrej Novy (a.k.a. onovy). Fixed confirmation dialog not working on systems with unsigned char. Thanks to nandox. Fixed crash on trying to do descending sorting by groups. Thanks to rafasc. Fixed descending sorting by groups not being implemented. Thanks to rafasc. Fixed `:move subdir &` renaming file in the process and doing weird stuff to multiple files. Thanks to 45jqlakjrf87ayte7hy34ter4nguijauzl4eitk. Fixed gf key on relative symbolic links when current path has symbolic links in it. Thanks to emarsk. Fixed gf key on symbolic links that point to broken symbolic links. Fixed incorrect displaying of size of files larger than 4 GiB on Windows. Got broken in 0.8.1. Thanks to Allison McNulty (a.k.a. allora). Fixed positioning of hardware cursor after startup and switching panes. Got broken in 0.10.1. Thanks to Daniel Mueller (a.k.a. d-e-s-o). Fixed test for very long file name hitting dynamic file-system limit on file name length. Thanks to ovk. Fixed UI glitches on top left and right when top line got hidden by status bar or status line on status line taking up all or all but one lines of the screen. Fixed Alt key combinations being broken on Windows since v0.9. Fixed running non-cmd shells on Windows broken by adding 'shellcmdflag' in 0.10.1. Fixed issues with non-tiny 'shellcmdflag' on Windows. Patch by Bas Bossink (a.k.a. basbossink). Fixed adding files with spaces in their names as e-mail attachments in the plugin. Thanks to Stephen Horst (a.k.a. sjhorst). Fixed trash "forgetting" about deleted file when there it already contains a file deleted at the same path. Fixed printing "Terminal is too small message." on startup, when TUI was already initialized and wasn't disabled for printing. Fixed generation of :highlight command for OtherWin on writing $VIFM/colors/Default.vifm. The bug caused white background of inactive pane. Thanks to Stas Malavin. Fixed confusing printing of attributes of OtherLine, OtherWin, AuxWin and User1..User9 highlight groups by :highlight command. Fixed documentation on external background commands. Thanks to Gene Zharov. Fixed possible crash after changing 'history' when there are inactive tabs and then populating history of those tabs. Fixed local options being copied on creating tabs even when target path is different. Fixed DirEnter autocommand not being called on creating tabs. Fixed pane tabs of inactive pane reappearing after changing 'tabscope' to "global" and then back to "pane". Fixed it being possible to activate view mode while in a single pane mode. Thanks to filterfalse. Fixed 'title' messing up the TUI on very long title by limiting its maximum length. Thanks to filterfalse. Fixed command-line commands not being saved in history when command-line mode was entered and left by two different mappings (as opposed to a single mapping in which case this behaviour is expected). Thanks to filterfalse. Fixed detection of non-regular files in quickview, when previewing symbolic links. Thanks to m-kru. Fixed directory-specific color scheme not being applied to newly created tabs. Fixed selection being lost or incorrectly preserved on changes of local filter in custom views. Thanks to filterfalse. Fixed status bar message not being cleared sometimes. Thanks to filterfalse. Fixed graphics preview not being cleared on switching tabs or starting external applications (including on :shell). Fixed number of selected files not being updated after filtering files out using zd normal mode key. Fixed omission in details about keys in documentation on 'runexec' option. Thanks to m-kru. Fixed invalid background in more mode after opening a menu. Thanks to filterfalse. Fixed mapped keys being reinterpreted as builtin keys if RHS of the mapping failed at some point (e.g., contained an unmapped key). Thanks to Seok Won Lee (a.k.a. ijleesw). Fixed issues with the plugin when Vim has no :drop command. Thanks to Normen Hansen (a.k.a. normen). Fixed use of :catch in Vim plugin. Thanks to Normen Hansen (a.k.a. normen). Fixed %a 'statusline' macro on OS X producing wrong values. Thanks to yanzhang0219. Fixed 'z mark being treated as a special pane-specific mark (like '< and '>). Thanks to Marcos Cruz. Fixed '< and '> marks being shared by views in different tabs. Fixed exploring files on pseudo file systems which reported "Nothing to explore" despite quickview showed file contents fine. Fixed local filter not obeying updated values of 'ignorecase' and 'smartcase' options when 'incsearch' is off. Thanks to filterfalse. Fixed dialogs not being visible when UI updates are silenced via mappings. Fixed Default color scheme not being available on processing sample vifmrc on first run of the application. Fixed `:highlight {new-pattern}` not being immediately applied due to caching. Fixed detecting presence of :file[x]type commands on Windows when backslashes are present in path. Thanks to anonymous and n.e. at Vifm Q2A site. Fixed running tests on OS X, which were broken due to `/home/` being a symbolic link. Thanks to Jason Dreisbach (a.k.a. jtdreisb). Fixed opening non-top-level ".." in a :tree incorrectly behaving as `:cd ..`. Fixed user mappings not being resolved for suggestions. Thanks to TornaxO7. Fixed selectors not being suggested if there are matches among commands. Thanks to iSeeU816. Fixed commented line following `fileviewer *.ext` not being highlighted appropriately. Fixed panic on some redraw operations mixing with file operations during terminal resizing. Thanks to aca. Fixed highlighting of `fileviewer .*/,*/` as if it contains a pattern. Fixed highlighting of status line being shifted due to unmatched `%[`. Fixed weird tabline layout on very large number of tabs. Fixed highlighting of regex patterns. They could consume too much and would stop at `\/`. Fixed highlighting of multiline matchers for :filetype, :filextype and :fileviewer commands. Fixed only one level of symbolic links being resolved for mime-type detection. Fixed :wincmd being affected by mappings (e.g., of Ctrl-W key). Thanks to Philipp at Vifm Q2A site. Fixed columns in a :file menu being misaligned for mix of entries with and without description. Fixed creating symbolic links on Windows with 'syscalls' being turned on. Fixed creating symbolic links on Windows with spaces in source or target paths. Fixed 'chaselinks' on Windows (symbolic links weren't resolved). Fixed highlighting of comments after some commands. Fixed %p macro of 'findprg' missing from Vim version of the documentation. 0.10.1-beta to 0.10.1 (2019-07-29) Added "space" and "nospace" values to 'sizefmt' option. Patch by zsugabubus. Added autodetection of *.vifm files as files with "vifm" filetype to the plugin. Patch by Anton Kochkov (a.k.a. XVilka). Made udisks2 part of vifm-media script compatible with python3. Patch by zsugabubus. Assume that any $TERM value that starts with "xterm-", "rxvt-" or "screen-" supports terminal title. Thanks to Matthias Braun (a.k.a. mb720). Documented $TERM values for which 'title' option works. Thanks to Matthias Braun (a.k.a. mb720). Fixed assertion failure on resetting 'classify' option when 'millerview' is on (reproducing it is harder than that, but that's the idea). Patch by zsugabubus. Fixed info= not having higher priority than label= in 'mediaprg'. Fixed item not being redrawn on the screen after pressing t key to toggle its selection. Fixed missing screen update after some startup commands. Thanks to zsugabubus. 0.10 to 0.10.1-beta (2019-07-15) Added example of using xsel to sample vifmrc file. Thanks to chelovechishko. Added "fileroot" view column, which displays full name of directories and symbolic links to directories and only root of name for everything else. Thanks to chelovechishko. Added :cds command that navigates to path obtained by substitution in the current path. Thanks to j-xella. Added one more invocation format of :colorscheme command, which picks the first available color scheme that is supported by the terminal. Thanks to Jose Riha (a.k.a. jose1711). Added :hideui command that hides interface to show previous commands' output. Thanks to dikiy. Added 'shellcmdflag' option that allows customizing how shell is invoked. Enables running it in interactive mode, which can make shell aliases and functions work. Thanks to Ink (a.k.a. inknoir), John Shea (a.k.a. coachshea) and randomizedthinking. Added "L" flag to 'shortmess' option to display only last directory in tab line instead of full path. Thanks to chelovechishko. Added caching to quickview for a single file to avoid fileviewer being called more often than needed. Thanks to agguser. Added "rpreview:" key to 'milleroptions' option that allows enabling preview of files. Thanks to Svadkos and Tom Jansen. Added ^= operation for string list options. Thanks to SearyBlue. Added ^= operation for options of set kind. Added %pd macro that makes preview output directly affect terminal circumventing curses, which could be used to display sixel images. Thanks to Tom Jansen. Added :Vifm command to the plugin as an alias for :EditVifm. Patch by rbong. Added optional splitting of the embedded terminal in the plugin (g:vifm_embed_split). Has support for Vim's and . Patch by rbong. Added option to the plugin to synchronize working directory of the embedded instance of vifm with the Vim host (g:vifm_embed_cwd). Patch by rbong. Added ability to the plugin to replace netrw with vifm (g:vifm_replace_netrw and g:vifm_replace_netrw_cmd). Patch by rbong. Added OtherWin highlight group for highlighting inactive pane. Thanks to John Fred Fadrigalan (a.k.a. cevhyruz). Added indication of entry's availability to :file, :file[x]type and :fileviewer menus. Added udisks2 backend to vifm-media script (bundled script for managing media). Requires python and dbus module for it to be installed (because udisks2 and dbus are too shitty to be used on command-line). Thanks to Tykin. Added FUSE_MOUNT3 filetype format, which is equivalent to FUSE_MOUNT, but doesn't perform unmounting. Helpful to use with something like avfs. Thanks to Jose Riha (a.k.a. jose1711). Added "info=" field to parser of 'mediaprg' output. It provides custom message for the media. Patch by zsugabubus. Added [ and ] bindings to :media menu that provide navigation between devices. Patch by zsugabubus. Added decorations to :media menu. Patch by zsugabubus. Added extcached() builtin function, which can be used to improve performance of file queries by caching results of external commands. Thanks to Matthias Braun (a.k.a. mb720). Added %p macro to 'findprg' option. It works as a mix between %a and %A macros: usually contains arguments passed to :find command, but unlike %a doesn't include any predicates. Thanks to Sitaram Chamarty and Tuan Bui (a.k.a. tuanbass). Added vifm-media-osx script that is configured to be used (via 'mediaprg') on OS X. Patch by Von Welch. Resolve symbolic links for mime-type matchers. Thanks to Vigi. Try to preserve symbolic links in current path when starting vifm by checking value of $PWD. Thanks to Vigi. Better documentation for TabLine and TabLineSel highlighting groups. Thanks to mwgkgk. Always preserve tabs on :restart. Thanks to mwgkgk. Clearer documentation/description for :*unmap commands and 'vicmd'/'vixcmd' options. Thanks to chelovechishko. Preserve extended attributes on copying files. Thanks to hutou. Improved to do not forcefully update screen after the mapping if no screen updates were skipped. Try to avoid superfluous screen updates related to cursor position. Improve documentation of patterns and globs. Thanks to afsheenb. Don't throw away errors that were ignored by the user, display them at the end of operation. Complete user name in paths after initial tilde (e.g., `:cd ~r` => `:cd ~root`). Consume input during foreground file operations. Otherwise it remains buffered and is processed after the operation is over, which might not be the intent of the user. Drop leading space implicitly added to time columns in views. Thanks to laggardkernel. Try to determine widths of printed character more accurately. Reduce number of options available on file conflict when source and destination are the same to avoid confusion (options that overwrite do nothing in this case). Thanks to aleksejrs. Refuse to compare directory against itself via :compare command. Thanks to Jose Riha (a.k.a. jose1711) Generate faster regular expressions by vifm-convert-dircolors. Thanks to Gomme Bidule. Remember when file doesn't match any file-specific highlighting groups for better performance. Thanks to Gomme Bidule. Renamed filename filter to "permanent filter" consisting of "explicit" (ex-manual) and "implicit" (ex-automatic) parts. Thanks to Sitaram Chamarty. Improved documentation on filters. Thanks to Sitaram Chamarty. Do not add leading comma to string list options on `set opt+=item`. Clear preview before displaying suggestions. Thanks to ks1c. Do not check for view changes while suggestions are visible. It can mess up TUI, especially in combination with preview. Thanks to ks1c. Do not complain about empty output of a graphics previewer for view mode. Upgraded to PDCurses 3.8 (was 3.4) for Windows. This allows using 256 colors inside ConEmu. Note that ConEmu has issues processing 256 colors on the last line of the screen, so avoid using them for status line. Thanks to dancread. Enable 'vimhelp' in sample vifmrc file by default. Changed file rename prompt to indicate whether full name or only its root is being changed. Removed empty line from :file and similar menus for case when vifm was configured with --disable-desktop-files flag (second time). Document more details about expansion of FUSE macros. Properly remove FUSE mount points if they are symbolic links. Don't create trash directory on startup if 'trash' is off. Patch by zsugabubus. Don't error on trash creation failure due to read-only file system. Patch by zsugabubus. Error stream from 'mediaprg' isn't considered anymore when deciding if mounting/unmounting was successful. While technically an incompatible change, it's unlikely to cause any issues. Spawn 'mediaprg' in foreground to allow interactions with the user, like providing a password. Patch by zsugabubus. React to Enter in :media menu on device lines, mount on "not mounted" line and do nothing otherwise. Patch by zsugabubus. Show empty lines in :media only if there is enough vertical space. Patch by zsugabubus. Make documentation of 'findprg' more readable. Fixed `:tabnew ..` not working due to use of uninitialized data. Fixed access to uninitialized memory on clearing view after graphical preview. Fixed possible crashes after certain patterns of using view mode and closing tabs. Fixed some resources (like output pipe for --choose-files and --choose-dir) being inherited by child processes. Thanks to Vigi. Fixed CWD of the process not always matching current view right after startup. Patch by Daniel Mueller. Fixed global substitution with patterns beginning with a caret again. Fixed cursors not being synchronized in compare view when scrolling one of them with Ctrl-U or Ctrl-D. Fixed command-line completion with non-latin characters. Thanks to dikiy. Fixed crashes when starting vifm with an empty environment (no environment variables set). Fixed directory-specific color scheme being turn into primary color scheme on copying from pane with directory-specific cs. Fixed directory-specific color scheme being lost on switching location of views. Fixed incorrect cursor positioning on reloading view with directory-specific color scheme. Fixed :siblnext/:siblprev not updating quickview. Fixed file move confirmation being shown twice in some cases. Fixed vifm not making use of large number of color pairs when they are available. Thanks to Jose Riha (a.k.a. jose1711) and Hans Petter Jansson (a.k.a. hpjansson). Fixed completion of :tabnew listing files instead of only directories. Fixed postponed view redrawing or reloading being skipped sometimes on multiple simultaneous requests. Fixed DirEnter autocommand not being called on entering a custom view even with 'cvoptions' containing "autocmds". Fixed textual output of graphical previewers not being displayed in view mode. Thanks to agguser. Fixed graphics leftovers after leaving explore mode. Fixed DirEnter autocommand being called with view being in a mixed state of old and new location. Thanks to Kendrick Taylor (a.k.a. sixcircuit). Fixed issues (could lead to crash) on resizing on Windows. Thanks to Tim Schaeffer (a.k.a. Numeromancer). Fixed wrapped lines in quickview/view mode sometimes losing their colorization. Fixed occasional test failures due to use of uninitialized curses. Thanks to Diogo Lemos (a.k.a. dmlemos). Fixed losing files on failed move operation. Source files were deleted assuming they were copied successfully, even when errors regarding some of them were ignored by the user. Thanks to zsugabubus. Fixed building incorrect relative paths on symlinking, when path being operated on contain symlinks. Resolve to real paths before computing relative path. Thanks to zsugabubus. Fixed highlighting of the first file entry being used to fill empty part of miller columns. Thanks to Konst Mayer (a.k.a. cdlscpmv). Fixed reading file list from standard input (`dir /b /s | vifm -`) on Windows 10. Thanks to dancread. Fixed crash on startup on trying to show a menu in vifmrc (didn't show up in most setups). Thanks to Christian Fillion (a.k.a. cfillion). Fixed documentation incorrectly stating that background operations can't be cancelled. Thanks to Jose Riha (a.k.a. jose1711). Fixed color pairs being exhausted on Windows when "default" color ends up being used often, this caused highlighting to go awry. Thanks to dancread. Fixed assertion failure on removing items from file-specific highlighting with some tabs that use it being hidden. Fixed :finish inside :if statements causing a warning on sourcing files. Fixed last character of borders in vertical layout not being drawn when global tab line is visible. Fixed retrying file overwrite on :copy! not overwriting a file after reason why it can't be deleted is gone. Fixed outdated comment about 'vimhelp' in sample vifmrc file. Thanks to Tiago. Fixed status bar clearing messages when inside directories with directory-specific color scheme. Fixed reading data past initialized region on printing control message of dialogs. Patch by zsugabubus. Fixed syntax highlighting of angle-bracket notation inside right-hand side of mappings that contain some :commands (they were highlighted, but for fewer number of commands). Fixed missing syntax highlighting of :let command in right-hand side of mappings. 0.10-beta to 0.10 (2018-11-11) Display list of files in removal confirmation dialog. Thanks to ovk. Support embedded terminal in the plugin for newer Vim. Return "broken" from filetype({fnum}, 1) for inaccessible link target. Thanks to filterfalse. Avoid unnecessary reloading file list after pressing "=" to enter local filter. Fixed crash on pasting elements of paths that contain broken UTF-8 sequences into command-line using Ctrl-X + key. Thanks to Jose Riha (a.k.a. jose1711). Fixed extra unlisted buffer beeing kept around in neovim on :*Vifm commands. Thanks to randomizedthinking. Fixed invalid treatment of numerical arguments of filetype(). Thanks to filterfalse. Fixed crash on previewing contents of directory without execute right in miller view. Thanks to filterfalse. Fixed status line highlighting being broken by wide characters. 0.9.1 to 0.10-beta (2018-10-28) Added support for arbitrary expressions in 'statusline': '%{...}', e.g. '%{&sort}' evaluates to the value of the sort option. Patch by Dmitry Frank (a.k.a. dimonomid). Added TabLine highlight group for highlighting tab line. Added 'tabscope' option that controls style of tabs. Thanks to Cosmin Popescu (a.k.a. cosminadrianpopescu). Added :tabnew command that creates a new tab. Thanks to Cosmin Popescu (a.k.a. cosminadrianpopescu). Added :tabname command that updates name of the current tab. Added :tabc[lose] command that closes current tab unless it's the last one. Added :qa[ll], :wqa[ll] and :xa[ll] commands that always try to exit vifm no matter how many tabs are open. Added gt and gT normal mode shortcuts that switch between tabs in both directions. Added 'showtabline' option that controls visibility of tab line. Added TabLineSel highlight group for highlighting tip of the selected tab on the tab line. Added :goto command that navigates to specified file/directory. Thanks to mateusz28 and Dmitry Frank (a.k.a. dimonomid). Added addition and subtraction operations to the parser. Added tabpagenr() function that retrieves number of current or last tab page. Thanks to filterfalse. Added :tabm[ove] command that moves tabs. Thanks to filterfalse. Added "M" flag to 'shortmess' option to control shortening of titles in windows of terminal multiplexers created by vifm down to file name instead of using full path. Thanks to mateusz28. Added 'histcursor' option that gives partial control over when cursor is positioned in accordance with record of directory history. Thanks to filterfalse and Dmitry Frank (a.k.a. dimonomid). Added 'quickview' option that controls visibility of quick view (:view). Thanks to Jochen Schweizer (a.k.a. durcheinandr). Added fnameescape() builtin function, which can be used to escape paths on construction of :commands. Thanks to filterfalse. Added 'syncregs' option which defines group of instances that share registers. Patch by Ma_Sys.ma. Added angle bracket notation. Thanks to j-xella. Added r key to :undolist menu, which resets position in the undo list to group under the cursor. Thanks to mini-turtle. Added grouping via parentheses to expressions. Thanks to Konst Mayer (a.k.a. cdlscpmv). Added User1..User9 highlight groups and corresponding %[0-9]* 'statusline' macro, which makes it possible to colorize parts of status line differently. Thanks to GeorgeHJ. Added :*map argument that postpones UI updates until RHS is completely processed. Probably not all updates are postponed, to be improved as unhandled cases are discovered. Added angle bracket notation making it possible to map Ctrl-Space key. Thanks to anonymous at Vifm Q2A site. Added second optional parameter to filetype() builtin function that is treated as a boolean and specifies whether symbolic links should be resolved. Added :*map argument, which resolves prefix conflicts of user-defined mappings and builtin keys in favour of user-defined mappings. Thanks to Paweł Smolak (a.k.a. psmolak). Added :regular command that leaves custom view. Thanks to gammaray. Added :media menu that can list and perform basic operations on removable media (requires helper to be available, see 'mediaprg'). Only for *nix systems. Thanks to Bruce Hunsaker (a.k.a. hunsakerbn) and others. Added 'mediaprg' option that can be used to specify helper for managing removable media. One such helper with support of udevil and udisks is provided. Only for *nix systems. Added :tabn[ext] and :tabp[revious] commands, which work as gt and gT normal mode shortcuts correspondingly. Thanks to Cosmin Popescu (a.k.a. cosminadrianpopescu). :quit, :wq, :exit, :xit, ZZ and ZQ now try to close current tab before closing the application. More explicit documentation about leaving custom views. Thanks to tagwint. Use historical cursor position upon startup by default when 'autochpos' is on, this is now independent from "savedirs" in 'vifminfo' option. Thanks to filterfalse. Use historical cursor position on navigating to a mark that doesn't specify a file by default when 'autochpos' is on. Thanks to filterfalse. Sort entries of :bmarks menu. Thanks to anonymous at Vifm Q2A site. Drop unfinished if-else statements on leaving command-line mode. Thanks to Marcin Kurczewski (a.k.a. rr-). Move cursor after p and P to one of files that were moved or to a cause of last conflict. Thanks to filterfalse and ranousse. Less strict parsing of output of external command by :[un]select commands. Similar to %u/%U and menus allow [:[:[:]] ] format. Thanks to j-xella. Support italics in quickview/view mode and in :highlight when curses implementation provides corresponding extension. PDCurses doesn't implement it on Windows. Fallback is to use "reversed" attribute. Thanks to GeorgeHJ. Escape "=" at the beginning of paths (has special meaning in zsh). Thanks to agguser. More accurate error message on handling non directories passed to :cd. Slightly better formatting in :undolist menu. Report missing closing quote for ""-strings in expressions. Make :echo and :execute report parsing errors in more detail than just "invalid expression". Update status line when cursor is moved on typing local filter when 'incsearch' is on. Empty input stream before asking user for return on :!! or when :!command ends with an error. Correct terminal state before asking user to press return after execution of an external command. Thanks to Jose Riha (a.k.a. jose1711). Do not reset selection before executing a :command from :commands menu. Thanks to Jose Riha (a.k.a. jose1711). Allow passing numerical positions to filetype() function. Try to preserve file owner/group on copying. Thanks to willemw12. Disallow registering user-defined commands with "!" or "?" suffix that won't be called, due to existence of a builtin that accepts custom separators (they have higher priority than user-defined commands). Issue a warning if file system lists several files with identical names in the same directory. It used to be assumed that it can't happen. Thanks to Jose Riha (a.k.a. jose1711). Make :cabbrev and :cnoreabbrev always treat bar (`|`) as part of their arguments, just like :*map commands do. Thanks to filterfalse. Make :tree! toggle view in and out of tree mode. Thanks to gammaray. Fixed preview command not being run with correct working directory on startup (e.g., when preview was on in vifminfo). Fixed completion for commands that follow "|" when they are preceded by commands with complicated syntax like :substitute. Fixed "|" not preceded with space being ignored as command separator for some commands. Fixed memory leak on `:highlight clear {file-specific-group}`. Fixed file-specific highlighting being added even when :highlight command contains syntax error. Fixed highlight group being partially updated by :highlight command with incorrect syntax. Fixed parsing of :highlight command when tabulation is used to separate arguments. Thanks to Robert Pergl (a.k.a. perglr). Fixed number of elements in a directory ("nitems") not being updated. Thanks to filterfalse. Fixed local filter not being applied to the view after q=. Thanks to filterfalse. Fixed hang of a remote instance after receiving at least two consecutive packages that cause an error message to be displayed. Thanks to filterfalse. Fixed absence of error on doing `--remote` to a server that doesn't exist. Fixed flickering on Windows. Thanks to Alexandre Viau and randomizedthinking. Fixed other view sometimes not being updated on scrolling via Ctrl-F/B keys in cases like compare view or when quickview is on. Thanks to Alexandre Viau. Fixed other view not being updated in visual mode in cases like compare view or when quickview is on. Fixed search highlight in menu not being reset after clearing the pattern. Fixed doubling of "%" on expanding environment variables in arguments of :commands. Thanks to filterfalse. Fixed canonicalization of paths that include entries that end with multiple dots. `/dir../..` was not turned into `/` since 0.8.2. Thanks to aleksejrs. Fixed part of dialog messages being still visible in quickview after dialog was closed. Thanks to Alexandre Viau. Fixed ruler not being displayed when cursor is on a fake entry in :compare view. Fixed crash due to linking to wrong version of libtinfo. Thanks to Ruslan Osmanov (a.k.a. rosmanov) and Chema Alonso Josa (a.k.a. nimiux). Fixed stdin stream not being closed for commands run for obtaining their output since previous release (e.g. `!read i%q` would wait for input). Also close it the same way on Windows too. Fixed graphical applications on Windows not being detected as such, which caused vifm to wait until they finish running. Was broken since 0.9. Thanks to r0ck. Fixed cursor marker in inactive window not being highlighted according to CmpMismatch highlight group in :compare mode. Fixed missing quote in an expression error message not displaying the broken string. Fixed syntax highlighting of strings in double quotes and comments in :let statements. Fixed status line showing information about previously selected file after clearing search pattern when 'incsearch' is on. Fixed status bar mode message not being changed from "-- VISUAL --" to "-- VISUAL (append) --" on pressing av in visual mode. Thanks to Paweł Smolak (a.k.a. psmolak). Fixed memory corruption on clearing user defined :commands from a user defined command. Thanks to Jose Riha (a.k.a. jose1711). Fixed selection issues in some terminals when in command-line mode. Thanks to Jose Riha (a.k.a. jose1711). Fixed slowed down directory traversal due to listing contents of directories internally. Thanks to Coco 17dec. Fixed assertion failure on parsing lists of expressions with broken syntax. Thanks to Jose Riha (a.k.a. jose1711). Fixed parsing state not being properly reinitialized, which could cause unstable parsing outcome for lists of expressions. Thanks to Jose Riha (a.k.a. jose1711). Fixed error messages from put operation being postponed until the next put operation. Got broken in 0.9. Fixed memory leak on d/D normal mode keys if deletion wasn't confirmed. Fixed confirmation not being requested on :delete. Thanks to anonymous at Vifm Q2A site. Fixed 'relativenumber' being effectively ignored in inactive pane on UI redraw from active pane. Thanks to filterfalse. Fixed bar (`|`) being treated as command separator in /pattern/ passed to :[un]select. Thanks to filterfalse. Fixed abbreviations of :commands with `!` or `?` as custom separator (e.g. `:s!a!b!`) being resolved incorrectly. Fixed bar (`|`) being treated as command separator in /pattern/ passed to :commands using custom separators (e.g., in `:s!//|//!`). Fixed bar (`|`) not being treated as command separator in commands which can take /pattern/ arguments. Fixed crash on feeding multi-byte string to :commands that fail to convert it to wide representation. Thanks to Jose Riha (a.k.a. jose1711). Fixed non-empty read-only directories not being deleted by :empty command. 0.9.1-beta to 0.9.1 (2018-02-05) Fixed :clone and :copy refusing to copy broken symbolic links, even though C and p keys copy them. Fixed C key not checking readability of a single unselected file, like :clone does. Fixed possible crash on `:highlight clear {pattern}` and highlights not being updated. Fixed reported free space on *nix. (make it consistent with what 'df' reports). Patch by Dmitry Frank (a.k.a. dimonomid). 0.9 to 0.9.1-beta (2018-01-22) Added "inode" sorting key, which sorts entries by inode number. Thanks to eco0414. Added retry/ignore/abort prompt for file copying and directory/file/symlink creation when 'syscalls' is on. Thanks to einhander. Added AuxWin highlight group for highlighting auxiliary parts of windows. Added 'millerview' option that enables cascading columns interface for the view. Thanks to sudo-nice. Added 'milleroptions' option that configures miller view. Added [r/]r/[R/]R normal mode shortcuts that map to :siblprev and :siblnext with and without wrapping correspondingly. Thanks to filterfalse. Added 'lsoptions' option that allows to get transposed grid in ls-like view. Thanks to Dmitry Frank (a.k.a. dimonomid). Added ability to remove filename-specific highlighting rules with `:highlight clear {pattern}`. Thanks to aleksejrs. Added completion of filename-specific highlight groups for :highlight command. Added term() builtin function, which differs from system() only by its ability to run interactive applications without confusing vifm's interactions with the terminal. Thanks to Dmitry Frank (a.k.a. dimonomid). Added 'previewprg' option, which can be used to override :fileviewer commands either temporarily or permanently. Thanks to svenn71. Added v:count and v:count1 builtin variables. They are assigned to count passed to : command. Added %x macro to 'rulerformat' (and thus to 'statusline') as new name for %-, which conflicts with alignment specification and requires explicit width specifier (%0-). Thanks to Marcos Cruz. Added :histnext/:histprev commands, which are analogous to Ctrl-I/Ctrl-O. Patch by Dmitry Frank (a.k.a. dimonomid). Added {root} key to 'viewcolumns' option (complements {ext}). Thanks to Oleg Gordienko (a.k.a. gordio). Added "u" flag to the 'tuioptions' option. It enables use of Unicode characters in the TUI (Unicode ellipsis instead of "..."). Thanks to Oleg Gordienko (a.k.a. gordio). Added "foldsubkeys" value to the 'suggestoptions' option. It folds multiple suggestions with common prefix into one entry. Thanks to AndreaHasani. Added `--remote-expr` command-line option, which gives ability to query state of an instance. Thanks to Marcin Kurczewski (a.k.a. rr-). Changed :filter command to accept pattern (//, ////, {} or {{}}). Thanks to rbong. Improved parsing of optional numbers in vifminfo. Thanks to Aris Fergadis (a.k.a. afergadis). Indicate preview created with %q with "Command: cmd". Better detection of write errors on file copying. The error was reported, but it wasn't treated as a hard error in a specific case related to caching. Made :siblnext and :siblprev commands respect dot and name filters. Disabled spell checking of vifm files in Vim except for comments. H/M/L keys in ls-like view now account for columns. Made :siblnext and :siblprev accept [count] range. Thanks to filterfalse. Made :tree pick up list of files from custom view. Thanks to filterfalse. Do not go to start of line on Ctrl-U/Ctrl-D/Ctrl-F/Ctrl-B/G in ls-like view. Documented more details about 'vicmd' and 'vixcmd' options. Thanks to Sebastian Cyprych. Made :highlight update file-specific group on exact match of the pattern instead of appending new rule. Thanks to aleksejrs. Extend width of the cursor in ls-like view to the width of the cell. Thanks to Dmitry Frank (a.k.a. dimonomid). Don't trigger DirEnter event with previous directory on startup when list of files is specified on stdin. Thanks to filterfalse. Improved performance of mime-type detection when using libmagic (now might be about seven times faster by avoiding reinitialization of the library). Don't force file list reload after `:!` and rely on change detection. This should result in somewhat better performance. Thanks to opennota. Duplicate status bar error in dialog that reports sourcing error. Will need to get rid of errors on status bar later. Instead of invalidating directory size previously calculated via ga/gA on detecting changes in the directory recalculate its size and propagate update through its parents. Thanks to filterfalse. Remove empty directories which are specified in 'trashdir' with %r and/or %u automatically on :empty. Thanks to Marcin Kurczewski (a.k.a. rr-). Fixed positioning cursor in directory :history when inside custom view. Thanks to filterfalse. Fixed compilation of modes/view.c when build is configured with `--disable-extended-keys`. Thanks to Bearcat M. Şándor (a.k.a. bearcatsandor). Fixed crashes discovered via fuzzing, most of which require rather unusual kind of input. Fixed running commands with arguments on Windows when 'shell' isn't cmd.exe. Fixed ".." not being preserved in path loaded into custom view. Thanks to filterfalse. Fixed directory size in status line. Patch by Dmitry Frank (a.k.a. dimonomid). Fixed extra width of inactive cursor in ls-like view when 'classify' contains Unicode characters. Fixed stopping of put operation after copying symbolic link that's broken on destination. Thanks to filterfalse. Fixed formatting of root directory in custom view, it displayed too many slashes. Thanks to filterfalse. Fixed not recording last visited directory on leaving custom view. Thanks to filterfalse. Fixed displaying of wild menu popup when status bar is more than single line in height. Fixed weird view scrolling after zO (hard to notice) and Ctrl-A/X. Fixed assertion failure on renaming files with Ctrl-A/Ctrl-X when cursor is positioned on certain file from the range. Fixed a "race" with file system when we could load outdated file list and thus miss some file system updates. Fixed hardware cursor blinking in view for interactive queries. Fixed handling Tab and Shift-Tab on search prompt as if they are command prompts. Fixed horrible flickering of multiline status bar for interactive queries. Fixed :normal command resetting selection. Thanks to filterfalse. Fixed consuming 100% of CPU on certain pattern of running background processes. Thanks to petRUShka. Fixed losing error message from a short-lived background processes when long-lived one is present. Fixed centering title of attributes change dialog (cp normal mode command) for non-ascii file names. Fixed turning quickview into explore view when preview command doesn't contain macros. Was broken since 0.8. Fixed the plugin in neovim. Patch by John Shea (a.k.a. coachshea). Fixed CWD of the process not matching current view after vifm picked up change in file system. Patch by Daniel Mueller (a.k.a. d-e-s-o). Fixed cloning of files like `.name` to produce `.name(1)` instead of `(1).name`. Thanks to filterfalse. 0.9-beta to 0.9 (2017-06-18) Escape $ and ` in %" macros on *nix systems. Thanks to filterfalse. Don't use :filextype in sample vifmrc for OS X, we can't tell whether graphical system is running. Thanks to piotryordanov. Do not add extra slash to path on picking files in the root. Thanks to filterfalse. Properly escape newline when passing things into shell. Thanks to filterfalse. View current directory on ".." for quickview/view mode only if no viewer matches such entry. Expand macros in :[un]select !{command}. Thanks to Michael Corvin. Update the other view after file deletion (that file might be visible there too). Execute startup commands in directory of current pane. Fixed ruler being updated when it shouldn't even be visible. Thanks to filterfalse. Fixed incorrect existence check for files that end with forward slash on *nix. Thanks to filterfalse. Fixed treating `--select -` as `-` on command-line. Thanks to filterfalse. Fixed ignoring `-` when `--no-configs` is specified. Thanks to filterfalse. Fixed choosing files in custom views with --on-choose. Fixed redrawing view after loading custom list in case when cursor is positioned on ".." entry. Thanks to filterfalse. Fixed restoring of excluded items from custom view if local filter isn't empty. Thanks to filterfalse. Fixed incorrect cursor positioning on removing elements from custom view with local filter. 0.8.2 to 0.9-beta (2017-06-04) Removed -Werror in tests from non-developer builds. Added tree view. Thanks to filterfalse and Kornel. Added :tree command that converts current view into a tree. Added :dmap, :dnoremap and :dunmap commands to configure mappings in dialogs. Thanks to Sassan Haradji (a.k.a. sassanh). Added "tree" parameter to :sync! that enables synchronization of tree view. Thanks to filterfalse. Added :compare command to perform comparison in one or two directory trees. Thanks to anonymous on SourceForge discussion forum and aleksejrs. Added CmpMismatch highlight group for highlighting mismatched files on side-by-side comparison. Added %Iu and %IU macros, which are %u and %U equivalents, but work better if external command is interactive and changes terminal state. Added v:servername variable, which provides access to server name of the running instance used by --remote feature. Thanks to Marcin Kurczewski (a.k.a. rr-). Added dd key to :jobs menu, which requests cancellation of background operation. Background :put, :copy, :move, :delete, size calculation with ga and gA as well as applications started in background can be cancelled this way. Thanks to blurm. Added 'dotfiles' (local) option, which exposes dot files filter as an option. Thanks to filterfalse. Added %q macro that redirects command output into quick view. Thanks to svenn71. Added shell completion for bash and zsh. Patches by filterfalse. Added e key to :jobs menu that displays list of errors issues by that jobs, if any. h key goes back to :jobs menu. Added :copen command to restore last menu that supports navigation. Thanks to Sassan Haradji (a.k.a. sassanh). Added % key to menu mode, which navigates to [count]-th percent of the list. Added 'caseoptions' option that enables more fine-grained control over case sensitivity. Thanks to Alexandru Geana (a.k.a. alegen). Added [d and ]d shortcuts to navigate to previous/next directory entry. Thanks to filterfalse. Added [s and ]s shortcuts to navigate to previous/next selected entry. Thanks to filterfalse. Added [z and ]z shortcuts to navigate to first/last sibling in a tree. Thanks to filterfalse. Added zj and zk shortcuts to navigate to next/previous directory sibling in a tree. Thanks to filterfalse. Added [c and ]c shortcuts to navigate to previous/next mismatch in directory comparison view. Thanks to filterfalse. Added :screen! form that enables terminal multiplexers support (instead of toggling it as :screen does). Thanks to Marcos Cruz. Added do and dp keys to compare views for applying changes in files. Thanks to filterfalse. Added %f 'statusline' macro that inserts relative path of the entry, which might be useful for non-regular views. Thanks to filterfalse. Added meaning to [count] of cp shortcut, which is now processed as numerical argument for non-recursive `chmod` command. Thanks to sudo-nice. Added 'sizefmt' option that configures formatting of human-friendly size. Thanks to sudo-nice. Added :siblnext and :siblprev commands. They change directory to next or previous sibling directories of current path (in global sorting order of current pane). Thanks to sudo-nice. Added %D 'statusline' macro that displays path of the other pane in single-pane layout. Thanks to sudo-nice. Added %T 'statusline' macro that displays symbolic link target. Thanks to sudo-nice. Added %a 'statusline' macro that displays amount of free space available at current partition. Thanks to sudo-nice. Changed size formatting to round from zero (matches behaviour of e.g. `ls`). Enable restoring files from trash from custom views. View current directory on ".." for quickview/view mode. Thanks to filterfalse. Make :put, :touch and :mkdir accept [line] range, which can be used to specify target position in tree-view. Thanks to filterfalse. Enable cancellation of tree preview construction. Thanks to filterfalse. Partially return progress report for menus. Was disabled by introduction of null byte heuristic. Accept paths in :touch, not just file names. Thanks to filterfalse. Consider trailing slash for directories or symbolic links that point to directories in 'classify' patterns by file name (e.g., this works now: `[::*/::]`). Do not resolve symbolic links in directory preview. Thanks to filterfalse. getpanetype() got new value ("tree") to indicate tree-view. Thanks to filterfalse. Disallow applying :chmod on ".." entry. Disallow moving/copying/linking files into custom view (put is forbidden, so makes sense to forbid these too). Disallow selecting ".." entry with :select command. Display path to the conflicting file in conflict resolution dialog. Provide better messages on i/o errors with 'syscalls'. Thanks to Behrooz. Remove background commands from the :jobs list when corresponding processes get terminated by a signal. Use /data/colors as global storage of color schemes on Windows. Thanks to r44083. Don't disable preview on `--remote --select` if it doesn't hide updated pane. Thanks to Marcin Kurczewski (a.k.a. rr-). Handle terminal resize on Windows 10. Thanks to randomizedthinking. Escape first tilde in paths that go to the shell. Thanks to Marius Schmidl. Make +{num} and similar options work (actually affect cursor of the view). Thanks to filterfalse. Treat "+" option the same way as Vim (like :$). Thanks to filterfalse. Read error output of background commands independently of main thread (prevents blocking of tools which produce huge amount of output). Thanks to Stas Malavin. Limited maximum height of message popup, just print how many lines we're skipping. No vifminfo merging if file change isn't detected. Might result in faster quitting in some cases. Not accounting for some changes is still possible when multiple instances quit simultaneously, but same could happen without this change. Improve performance of startup and exit by omitting file existence checks. The cost is possibly old files staying in the state, but it should be for long time. Thanks to Marcin Kurczewski (a.k.a. rr-). Resolve symbolic link for listing associated programs from desktop-files. Thanks to filterfalse. Don't move cursor off "../" before start of local filtering. Thanks to filterfalse. Put hardware cursor according to current mode and cursor within it. Thanks to Tyler Spivey. Made search consider trailing slash for directories and symbolic links that point to directories. Thanks to filterfalse. Made IPC unit more fault-tolerant regarding inability to create files. Thanks to filterfalse. Make temporary rename files accessible only by the user. Thanks to aleksejrs. Better handling of setting 'fillchars' to incorrect or excessive value. Prevent clearing filters on zM if there were no zO preceding it. Thanks to sudo-nice. Work around :drop command being disabled in the plugin. Thanks to Phil Runninger. Try harder to move files by not giving up on getting permission error, which isn't always a reliable indication of actual permission error. Only when 'syscalls' is on. Thanks to Marcin Kurczewski (a.k.a. rr-). Improved sorting performance in the presence of huge amount of symbolic links. Thanks to Marcin Kurczewski (a.k.a. rr-). Properly recover from invalid/strange UNC root on Windows. Don't end up with empty filelist. Fixed redirecting stdout of background commands to /dev/null, which could be unwritable descriptor. Thanks to c02y. Fixed inconsistent file name demangling on moving files from trash in custom view. Fixed decreasing number of selected files after zd operation. Fixed wrong whole value completion of string list options if entered value contains a comma (,). Fixed displaying of previous status bar message on 'hlsearch' 'noincsearch' when match occurs. Thanks to filterfalse. Fixed incorrect completion of non-first option name of the :set command. Fixed assertion failure on file rename of specific pattern (renaming files 1, 2 via `:rename 2 3` is the shortest example). Thanks to aleksejrs. Fixed rejecting to clone files in custom view, when name is specified explicitly (form without arguments was properly disabled before). Fixed changing attributes of files in custom views on Windows. Fixed counting selected files after `:invert s` if there is ".." entry. Fixed :pushd and :dirs in custom views. Fixed ruler update on `--remote --select`. Thanks to Marcin Kurczewski (a.k.a. rr-). Fixed small leak after aborting on name conflict. Fixed possible data loss on moving/copying files over their own parent or child directories via p, P, :move, :copy, :alink and :rlink. Thanks to Marius Schmidl. Fixed concatenation of error lists without separator (newline). Thanks to Behrooz. Fixed possible memory leak on querying file mime-type (when it wasn't obtained). Fixed buffer overflow on obtaining file mime-type. Thanks to Abdó Roig-Maranges (a.k.a. aroig). Fixed previewing symbolic links, which not always were resolved to their target (even reachable one). Thanks to Abdó Roig-Maranges (a.k.a. aroig). Fixed bogus "fuse mount was cancelled" message on %FOREGROUND mount failing. Fixed determining location of distributed files on Windows (help file and sample vifmrc weren't installed). Thanks to r44083. Fixed drawing file list in single-pane layout when 'scrollbind' set (parts of the other view were visible when 'relativenumber' is set). Thanks to filterfalse. Fixed resetting custom view title to "(null)" when loading another custom view in the same pane failed. Fixed restoring custom list on removing or changing local filter when 'incsearch' is off. Fixed losing original custom list of files after failed load of new custom list if local filter isn't empty. Fixed some blinking on redrawing screen when middle border isn't visible. Fixed cloning of broken links. Fixed assertion renaming of file into name of broken link. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed F, f, ; and , keys in visual mode. Fixed detection of too-small-terminal state. Fixed memory leak of forgotten history entries after going back in history. Fixed updating progress when performing operations on empty files. Fixed selection of current file on cancelled go or gp. Thanks to filterfalse. Fixed treating characters like š and ć (with low Unicode values, just above 0x100) as functional keys on input. Thanks to granderil. Fixed recursive permanent removal of directories on Windows when 'syscalls' isn't set, which could fail for no reason. Fixed inconsistency of using environment variables from different sources (internal state versus runtime). Thanks to Jochen Schweizer (a.k.a. durcheinandr). Fixed n/N not restarting search in custom views. Fixed full path patterns ({{globs}} and //regexp//) not working with file highlighting in :highlight. Thanks to granderil. Fixed view columns when column with dynamic alignment is not the first one. Fixed :pwd in custom views to make it display main directory (didn't display anything). Thanks to filterfalse. Fixed :noremap, which didn't accept ! and didn't reject less than two arguments. Fixed backslash in arguments for :*[un]map commands (required \ to be written as \\). Thanks to filterfalse. Fixed use of uninitialized memory on parsing commands that end with backslash. Fixed 'wordchars' parsing to process range end as inclusive. Thanks to filterfalse. Fixed 'wordchars' parsing to handle non-ascii input without memory violation. Fixed incorrect 'sort' state after :restart. Thanks to sudo-nice. Fixed possible skewing of relative files positions in history by :restart. Fixed off-by-one error on reducing history size, which could led to loosing last directory history element. Fixed parsing of 'classify' when it includes an entry with empty prefix. Thanks to filterfalse. Fixed navigation from menus on Windows. Fixed tilde expansion and expansion of environment variables when checking command existence. Thanks to sudo-nice. Fixed displaying separator in `:*map prefix` menus. Thanks to nicodebo. Fixed truncation of file names of length NAME_MAX in some cases. Thanks to aleksejrs. Fixed crash due to assertion on answering y/n/Enter/Ctrl-C in prompt dialog that doesn't provide such options. Thanks to aleksejrs. Fixed inconsistent behaviour of :EditVifm in plugin with regard to "[No Name]" buffer. Thanks to Phil Runninger. Fixed operations which involve changing current working directory on Windows when path includes non-latin characters. Thanks to khaoos-abominable. Fixed processing of non-latin characters provided in command-line options on Windows. Fixed processing of environment variables containing non-latin characters on Windows. Fixed printing ^L character for --choose-dir on Windows. Thanks to Phil Runninger. Fixed updating CWD on switching views. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed plugin in versions of Vim where :argadd without argument doesn't work. Thanks to eco0414. 0.8.2-beta to 0.8.2 (2016-07-16) Added support for matchit to filetype plugin. Patch by filterfalse. Fixed processing of root directory (completion, :cd). Thanks to filterfalse. Fixed completion of commands after :!. Thanks to filterfalse. Fixed formatting/wording/outdated notes in documentation. Patches by filterfalse. 0.8.1a to 0.8.2-beta (2016-07-02) Added highlighting of search matches in menus. Added :noh[lsearch] command to menu mode. Added quick shortcuts to dialogs. Patch by oo-. Added 'wildstyle' option to control the way wild menu is displayed. Enables displaying it as a menu with one item per line. Thanks to santhoshr and octos. Added 'suggestoptions' option to control displaying of suggestions. Added description of builtin keys to :map menus. Added SuggestBox highlight group for key suggestion box. Added :write command to menus, that writes all menu lines into specified file. Thanks to gtors. Added support of patterns to 'classify' option, so that files can now be decorated based on their names. Thanks to elricbk. Added "filelist" parameter to :sync! that enables synchronization of custom view. Thanks to filterfalse. Added 'cvoptions' option to control when entering/leaving custom views is considered to be equal to entering/leaving directories. Thanks to filterfalse. Added "target" sorting key, which sorts files by symbolic link targets. Thanks to Marcos Cruz. Added negation to patterns with explicitly specified type (surrounded by {} or //). Put exclamation mark to invert pattern match. Thanks to Marcos Cruz. Added :select and :unselect commands. Thanks to filterfalse, Russell Urquhart and Marcos Cruz. Added chooseopt() builtin function that retrieves various parameters of file choosing. Thanks to Von Welch. Added mime type patterns ([!]). Thanks to Ross Hadden (a.k.a. rosshadden). Added %z 'statusline' macro that inserts text of a short tip picked at random. Thanks to qinghao (a.k.a. haobug). Added pattern ANDing. Just list decorated patterns one after another and such composite pattern will much when each of them matches. Thanks to filterfalse. Added pattern ORing for :file[x]type and :fileviewer commands implemented as a comma-separated list. Thanks to filterfalse. Added heuristic that uses null byte as separator for file lists if there is at least one such byte, otherwise normal line separators are used. This affects :[un]select, `vifm -`, %u, %U, %m and %M. Thanks to filterfalse. Added cancellation (handling of Ctrl-C) for quick view and view mode loading. Thanks to kalterfive. Added completion of :wincmd argument. Added indication of wrong pattern and absence of matches to command-prompt for interactive search/filtering. Changed order of initialization to perform autocommands before startup commands on launch. Changed type of 'confirm' option. Now it's a set that picks which operations should be confirmed. Thanks to Losiara and mvucBmM0. Changed ga/gA effect on ".." entry to calculate size of current directory. Thanks to aleksejrs. Do not reset completion on terminal resize. Expand environment variables for :edit. Thanks to filterfalse. Don't print just table header on `:cabbr something`, print message that no matches found instead. Display as only at the beginning of key sequence. Better terminal buffer title for plugin in neovim. Thanks to randomizedthinking. Enabled wildmenu for menus. Skip UTF-8 BOM for file preview. Allow suffixes and prefixes in 'classify' to be of up to eight characters in length. Thanks to elricbk. Use original (before custom view) cursor position on :sync! in custom views. Thanks to filterfalse. Never add parent entry (..) to very custom view (%U). Thanks to filterfalse. Removed caret escaping on Windows... Thanks to Reva Revadigar. Silently ignore tries to remove parent entry (..). Thanks to aleksejrs. A bit better delete confirmation messages with number of files to be deleted. Improved syntax highlighting of patterns. Automatically update custom view entries on rename of their parent directory in the same custom view. Some corrections of when completion happens for :find and :grep. Avoid displaying useless search messages about incorrect pattern during interactive search in menus (those that user can't see, but that are shown in :messages). Fixed kind of a duplicate of first history element on =. Fixed displaying size for symbolic links to directories on changing views and determining whether they point to a directory in custom views. Fixed backward search in menus, which was performed in the opposite direction. Fixed hanging on sudden terminal loss. Thanks to aleksejrs. Fixed crash on using extremely long function name. Fixed overwriting files after editing destination file name. Thanks to rbong. Fixed querying file information on 64-bit Windows. Thanks to santhoshr. Fixed crash on very long option value on :set. Thanks to aleksejrs. Fixed displaying non-latin characters in LHS of mapping in map menus. Thanks to filterfalse. Fixed updating view columns after local options synchronization via :sync!. Thanks to filterfalse. Fixed possible crash on Windows on displaying job bar (e.g. after :empty). Thanks to Reva Revadigar. Fixed escaping on Windows when opening files via :edit. Fixed UTF8 <-> UTF16 conversion on Windows, which didn't always work (on surrogate characters it seems). Thanks to Reva Revadigar. Fixed possible unexpectedly long timeouts when waiting for a key on Windows (due to limitation of pdcurses). Fixed displaying of wide (CJK) characters in pdcurses on Windows. Thanks to Reva Revadigar. Fixed functioning on architectures on which `char` is unsigned by default. Thanks to Ondrej Novy (a.k.a. onovy). Fixed unconditional resetting of executable permission when using cp dialog. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed updating view columns on leaving very custom view (%U) which set sort option. Thanks to filterfalse. Fixed remote feature on cygwin. Thanks to Cosmin Popescu (a.k.a. cosminadrianpopescu). Fixed search match highlighting of non-ascii characters in right aligned file names. Fixed capturing output of external applications on Windows when 'shell' is "cmd". Was broken since v0.8 in an attempt to make cmd work better with Unicode (but its /U flag affects only input and output streams). Fixed completion of command-line of this format: `:!~/...`. Fixed epic bug in processing selectors followed by other commands in a mapping. Command which accepted selector was called after tail of sequence is processed. Fixed possible issues with escaping on retrieving file type/mime-type using `file` utility. Thanks to filterfalse. Fixed cutting off path prefix from :!~/path/exec when 'fastrun' is on. Fixed putting unmatched %[ into status line at wrong position. Fixed incorrect work with symbolic links in paths to custom view entries, on completion of paths, changing directory via :cd or :sync, processing arguments of :mkdir, :bmarks, :delbmarks, :colorscheme, :clone. Fixed weird completion effects for :colorscheme, :sync!, :delbmark, :bmark!. Fixed changing owner/group in custom views. Fixed small memory leak on using %u/%U with :grep, :find or :locate. Fixed possible off cursor after cmdline insertions of text with wide characters via Ctrl-X combinations or dot completion. Fixed quite strange behaviour if command-line is too fill the whole screen (it's less strange now, resized to maximum). 0.8.1 to 0.8.1a (2016-02-10) Added c key to menus that inserts parts of menu line into command-line. Thanks to filterfalse. Added { and } keys to normal and visual modes. They act similar to ( and ), but always consider whether entry is a file or directory. Thanks to octos. Apply local filter on picking element of `:history filter` menu. Added --disable-build-timestamp option to configure script to perform reproducible build. Thanks to Hendrik Jaeger (a.k.a. henk). Display more meaningful message on failure to extract option name (unknown option: string). Handle register specified for gs normal mode command. Select files listed in that register. Thanks to filterfalse. More accurate parsing of bar not surrounded with whitespace. Be consistent with regard to when local state is changed and do not reset neither local options nor local filter on entering/leaving custom view. Thanks to filterfalse. Disallow adding duplicated filetype/fileviewer entries (just ignore them as they wouldn't be used due to order priority anyway). Expand tilde in first argument of :bmark! command. Thanks to Marcos Cruz. Truncate menu titles that don't feet the screen. Thanks to aleksejrs. Fixed redrawing message dialog when 'relativenumber' option is on. Thanks to aleksejrs. Fixed resetting status bar contents on displaying message dialog. Fixed parsing background mark after quote (as in `:put " &`). Fixed using plugin in neovim, which has broken `system()` and :! commands. Thanks to Artur Shaik (a.k.a. artur-shaik). Fixed polluting screen of server with messages about invalid arguments. Fixed duplicated filetype entries in vifminfo. Thanks to aleksejrs. Fixed switching views via :wincmd. Thanks to fogine. Fixed executing commands on new view after switching it (related to sequences of commands separated via bar symbol). Fixed --with-dyn-x11 configuration option, which failed to enable dynamic use of the library. Thanks to Badalisc and Hendrik Jaeger (a.k.a. henk). Fixed handling of doubled commas on reading/writing filetypes from/to vifminfo. Fixed displaying of extra file line in quick view when 'tuioptions' doesn't contain "p" flag. Thanks to aleksejrs. Fixed description of 'sort' to reflect rename of "type" into "dir". Thanks to Marcos Cruz. Fixed tab completion for single-executable Windows build, which didn't work in the last release and could cause crash. Thanks to Reva Revadigar. Fixed memory leak on resolving symlinked path on Windows. Thanks to Hendrik Jaeger (a.k.a. henk). Fixed TUI glitches in the form of borders after shrinking terminal to smallest possible height and restoring it back. Fixed processing of path regexps for filetypes when operating on selection. Thanks to aleksejrs. Fixed running multiple files in custom view. 0.8.1-beta to 0.8.1 (2016-01-17) Added summary to builtin tree implementation. Thanks to aleksejrs. Added more filetype definitions into sample vifmrc. Thanks to aleksejrs. Added 'title' option to control whether title of terminal should be set. Enabled by default if old title can be restored. Thanks to Svyatoslav Mishyn (a.k.a. juef). Case insensitive completion of autocommand name for :autocmd command. Allow /**/ in :autocmd pattern to match end of the path. Thanks to aleksejrs. Don't trigger DirEnter on exiting custom-view (when we technically stay in the same directory). Thanks to aleksejrs. Somewhat align options in conflict resolution dialog. Patch by Svyatoslav Mishyn (a.k.a. juef). Copy timestamps and permissions on merging directories. Thanks to willemw12. Less blinking on resorting. Annoying if directory is resorted from autocommand. Fixed reopening controlling terminal across users. Thanks to aleksejrs. Fixed :autocmd being not whole line command (was terminated by |). Thanks to aleksejrs. Fixed possible crash on writing vifminfo file on exiting. Fixed memory corruption on handling empty matches of searches in view mode. Thanks to filterfalse. Fixed secondary column of very custom view (%U). Thanks to filterfalse. Fixed reopening terminal for output, read-only mode somehow caused hangs. Thanks to aleksejrs. Fixed possible (effectively) hang on reading directory change events. Fixed parsing of commands which names are not followed by spaces with regard to pipe symbols (|). Thanks to aleksejrs. Fixed extending second :tr argument, which could cause failure in build with assertions. Thanks to octos. 0.8 to 0.8.1-beta (2016-01-02) Turned remote commands back on by default after their rewrite using named pipes instead of insecure UDP sockets. Removed vifmrc-converter. It's been around for four years and not needed any more. Thanks to filterfalse. Removed contents of autoconf.sh, autoreconf covers what was there (there is a notice in that script now about it just in case). Thanks to Hendrik Jaeger (a.k.a. henk). Changed 'fusehome' default from temporary directory to data directory (that is $XDG_DATA_HOME/.local/share/fuse/ or $VIFM/fuse/ depending on which parent directory exists, the second one exists by definition, but first might not). Thanks to aleksejrs and to Hendrik Jaeger (a.k.a. henk). Added :winc[md] command-line command. Thanks to fogine. Added layoutis() builtin function that answers queries about current interface configuration. Thanks to fogine. Added paneisat() builtin function that answers queries about current pane position. Thanks to fogine. Added %pc macro that splits preview command in two pices: preview command and clear command. Thanks to Tomek K. (a.k.a. TomiCode). Added set of :*Vim commands to vifm run from Vim plugin, which overrule initial :*Vifm command behaviour. Thanks to Ross Hadden (a.k.a. rosshadden). Added special treatment for "*" as value of 'slowfs', which might be useful in case of very slow handling of requests to mounts enumeration. Patch by Cosmin Popescu (a.k.a. cosminadrianpopescu). Added handling of "-" command-line argument specified in place of directory path as instruction to read list of files from stdin. Added B key to menus, which acts like b, but creates unsorted (very custom) view. Thanks to filterfalse. Added match numbers to search messages on status bar. Patch by Cosmin Popescu (a.k.a. cosminadrianpopescu). Added exclamation mark to :shell to suppress spawning new teminal multiplexer pane. Patch by Cosmin Popescu (a.k.a. cosminadrianpopescu). Added fileext sorting key, which sorts files by extensions and directories by name. Patch by Cosmin Popescu (a.k.a. cosminadrianpopescu). Added :setl[ocal] and :setg[lobal] commands to manage values of local options that are specific to current directory and are reset on directory change, similar to local options of Vim. Added zr normal mode key to reset local filter. Thanks to filterfalse. Added named bookmarks (paths are associated with tags). This adds :bmark, :bmarks, :bmgo and :delbmarks command-line commands. Also there is new "bmarks" value for 'vifminfo'. Thanks to Schmalzhaf Stefan. Added handling of dd in :trashes, :trashes? and :lstrashes, which either deletes an item in trash or empties trash. Thanks to Svyatoslav Mishyn (a.k.a. juef). Added dynamic view column alignment (specified by "*", just like "-" for left alignment). Patch by Cosmin Popescu (a.k.a. cosminadrianpopescu). Added --server-list and --server-name command-line options that enumerates names of currently running vifm servers and sets name of target/this instance respectively. Added optional %u and %U macros to 'findprg', 'grepprg', and 'locateprg' that allow immediate redirection of command output into custom view without opening a menu. Thanks to filterfalse. Added builtin directory preview. Thanks to Damian Ariel Perticone and Alexandre Viau. Added :pu[t] command that inserts files into current directory. Thanks to mvucBmM0. Added --with-sanitize=basic|thread|leak option to configure script. Added "more" mode that is used to handle status bar content that doesn't fit on the screen. Thanks to Bruce Hunsaker (a.k.a. hunsakerbn) and Svyatoslav Mishyn (a.k.a. juef). Added 'dirsize' option to control how size of directories is displayed in file views. This enables one to see number of files in a directory rather than its size. Thanks to Martin Fischer. Added missing script that's necessary for %s macro in GNU screen. Was lost for a long time. Added retry/ignore/abort prompt for file/directory removal when 'syscalls' is on. Thanks to Robert Sarkozi. Added "nitems" sorting, which sorts by number of items in a directory. Thanks to filterfalse. Added getpanetype() builtin function that retrieves type of current pane. Thanks to filterfalse. Added 'iooptions' option to configure file system operations. Contains only "fastfilecloning" for btrfs so far. Thanks to aleksejrs. Added "v" key to menu mode that loads current contents into quickfix list of editor (Vim compatible one is assumed). Thanks to filterfalse. Added && and || operators to expression parser. Thanks to filterfalse. Added autocommands (DirEnter event and :au[tocmd] command). Thanks to filterfalse. Added 'sortgroups' option and "groups" sorting key, which allow sorting by parts of file names. Thanks to aleksejrs. Added "nlinks" sorting key to display number of hard links to a file on *nix systems. Thanks to filterfalse. Added 'deleteprg' option, which specifies program to run on files that are permanently removed. Added inline comments to allow less verbose commenting in configuration. Added :elseif command. Thanks to filterfalse. Added :set foo+=bar syntax for string options (append value). Added &option syntax for :let command. Added optional argument for --logging parameter that specifies path to startup log. Thanks to Cosmin Popescu (a.k.a. cosminadrianpopescu). Added handling of "%u" in trash specification on *nix, which is replaced with real user ID. Thanks to Regis. Changed default value of 'trashdir' on *nix again, this time to "%r/.vifm-Trash-%u,$VIFM/Trash,%r/.vifm-Trash". This way it's safer for privacy, although using %r is not very safe in general. Thanks to Regis. Do not finish argument parsing after finding --help or --version, continue and validate the rest of command-line. Thanks to Svyatoslav Mishyn (a.k.a. juef). Warn about --remote command being disabled at build-time. Thanks to Svyatoslav Mishyn (a.k.a. juef). Make --select option more prominent in documentation. Thanks to Svyatoslav Mishyn (a.k.a. juef). Accept [count] for "h" and "gh". Normalize surrounding spaces in menu and dialog titles. Work around compilation on systems where MAX_ARG_STRLEN is defined, but unusable. Thanks to Marcin Juszkiewicz (a.k.a. hrw), Michel Normand and Michael Vetter (a.k.a. jubalh). Document %= for 'statusline' and 'rulerformat'. Proper recovery from loading of color scheme unsupported by the terminal at startup. Thanks to Svyatoslav Mishyn (a.k.a. juef). Automatically create ~/.vifm/scripts containing small README file if the directory doesn't exist on startup. Thanks to fogine. Consider control message when deciding width for a dialog, also don't let it disappear on narrow terminals. Provide conflict resolution options in a dialog rather than on the command-line, which is hard to read with so many options. Choose "middle" of the list of even length closer to the top (M key). Thanks to Svyatoslav Mishyn (a.k.a. juef). Update cursor position on file disappearing in more predictable way. Use the closes file to the previously active one that still exists. Thanks to ranousse. Make :set, :filter and :normal zo (and alike) in vifmrc affect all views, thus obsoleting use of :winrun or :windo for this purpose (they still work, the new way is a simpler and more obvious one). This is related to commands executed during vifmrc processing (not those in the right-hand side of mappings, commands, etc.). Display lower bound on item count in status bar progress messages (e.g. on :grep). Do not shrink progress dialog (only make it wider), this is more predictable and easier to follow. Thanks to Robert Sarkozi. More hints for Debian-based systems on installation. Thanks to Bernhard Grotz. Expand "~" in menus on navigation. Use `-f` on calling editor instead of `--nofork` (should be more universal). Thanks to kazufukurou. Changed default colorscheme to invert colors of the current line. Display directory size on Windows more correctly. Lower minimum supported terminal width and height from 30x10 to 20x5. Preserve file timestamps on copying files with 'syscalls' on. Thanks to mvucBmM0. Employ inotify on GNU/Linux for more precise watching directories for changes. Display incomplete file name on rename instead of failing with error on Unicode conversion issues. Assume UTF-8 sequences can be broken. Thanks to Svyatoslav Mishyn (a.k.a. juef). Check file system sensitivity on OS X. Thanks to loongw. Allow 'shell' to specify a shell argument on *nix. Thanks to loongw. Make "p" in 'tuioptions' affect padding in quick view and view mode. Documented difference between paths in menu with and without trailing slash. Thanks to filterfalse. Save location before loading custom view into view directory history. Thanks to filterfalse. Invalidate directory size (calculated via ga/gA) if noticed that directory was changed. This affects all parent directories as well, way easier to see what needs recalculation after file moving/removal. Ctrl-W | and Ctrl-W _ now can set window size to given count. Thanks to filterfalse. Make sure confirmation dialog doesn't appear for background operations. Display confirmation on ":delete! &" before initiating the operation. Somewhat more informative error titles on issues during file operations. Made setting title inside terminal multiplexers (when terminal type is "screen*") work. Make use of file cloning feature of btrfs when possible and enabled in 'iooptions'. Thanks to aleksejrs. Changed plugin to do not depend on location of vifm. g:vifm_home is ignored from now on. Thanks to aleksejrs. Rewrote expression parser to prevent side-effects from occurring until syntax is checked. Put right-hand side of user-defined commands into separate scope of if-else-endif expressions. This prevents affecting of regular input by malformed user-defined command. Fixed resetting "vborder" of 'fillchars' after it has been set to something (as in `:set fillchars=vborder:\* fillchars&`). Fixed crash after color scheme load failure possible in scenarios where file name specific highlights are used. Fixed use of uninitialized value which could affect whether pattern is matches whole path or only its name part. Fixed tests failures when run with root privileges. Thanks to Ondrej Novy (a.k.a. onovy). Fixed running backgrounded commands with non-latin characters on Windows (that end with " &", should be OK to just drop it on Windows and get correct behaviour on 0.8). Thanks to Stas Malavin. Fixed running of executables with spaces in paths on Windows with cmd. Thanks to Stas Malavin. Fixed choosing user vs. default shell on Windows (was reversed), related to %S, %i and alike macros. Fixed losing view sorting on failed attempt to load custom view. Thanks to filterfalse. Fixed not restoring 'sort' value on leaving unsorted custom view. Fixed possible crash on startup when 'vifminfo' includes "options". Thanks to Aurelio Sanabria (a.k.a. Sufrostico). Fixed checking for symbolic link target on target change commands in custom view. Fixed slashes type on Windows on loading custom view with relative paths. Fixed unstable extension sorting for dot files. Patch by Cosmin Popescu (a.k.a. cosminadrianpopescu). Fixed check for availability of FUSE mount point. Thanks to fogine. Fixed small memory leak and possible corruption after :sync! localopts. Fixed checking for changes in charset options on :set (without arguments), used to print unchanged options as if they were changed. Fixed estimation text in dialog (was almost single line). Fixed recovery after a try to assign ill-formed value to 'viewcolumns' option. Fixed unintentional filters resetting on menu navigation to paths that have trailing slash. Fixed losing name of controlling terminal on reopening it. Thanks to Dennis Hamester. Fixed one command in sample vifmrc, which is not supported in Windows version. Thanks to Alexandre Viau. Fixed possible vifminfo shrinking (some data were removed from it) if an error occurs during initialization. Fixed highlight not being updated after file rename. Fixed possible hang during startup on Windows after removal of last visited directory. Fixed running background commands on Windows that require shell expansions. Fixed swapped absolute/relative link creation on :alink/:rlink commands. Patch by MadMaverick9. Fixed dialog box redraw in menu after terminal resize. Fixed leaving background threads in zombie state. Fixed check for broken link existence in custom views (were dereferenced). Fixed missing check for duplicated source file names in custom views on file operations. Thanks to filterfalse. Fixed navigation to broken link from a menu. Fixed group completion for :chown command. Fixed cursor positioning in custom view with identically named files on local filter updates. Fixed restoring selection in custom view in presence of identically named files. Thanks to filterfalse. Fixed navigation to file in custom view in presence of identically named files there. Thanks to filterfalse. Fixed remapping of builtin keys that are followed by selectors (e.g. `:nnoremap d y`). Thanks to mvucBmM0. Fixed 'chaselinks' causing invalid path resolution on going directory up (".."). Thanks to filterfalse. Fixed :mkdir! on absolute paths, used to create relative paths anyway. Thanks to filterfalse. Fixed `:cd one two` to use current directory as base for both relative paths. Thanks to filterfalse. Fixed ranges for :yank. Thanks to Marius Schmidl. Fixed enabling sorting on loading regular custom view after very custom view. Fixed turning of very custom view into sorted one after :restart. Fixed memory leak related to :colorscheme command. Fixed redraw of invisible pane on :sync! on single-pane mode. Thanks to filterfalse. Fixed Ctrl-W _ in top panel, which hid the bottom panel completely. Thanks to filterfalse. Fixed crash on copy-like operations that move several files into subdirectory of another view. Thanks to Marius Schmidl. Fixed running external commands when custom view is active and vifm is running inside GNU screen. Fixed running vifm on Windows 10. Thanks to th1rdey3. Fixed leaking memory on collecting error messages on file operations via system calls. Fixed navigation back in history from custom view. Fixed tokens mangling inside strings ('!=' turned into '='). Fixed creation of intermediate directories on merging directories. Thanks to willemw12. Fixed inconsistency in processing | escapes for whole line commands (e.g. for :!). Fixed incorrect treating of files with colons in their names for menus and custom views. Thanks to aleksejrs. Fixed not squashing double commas in description of :file[x]type commands. Fixed ".." item of a custom view having empty directory (can be seen via File Info dialog). Thanks to filterfalse. Fixed small leak on :write (on exit too, but leaks before exit don't matter). Fixed processing if-statements with multiple else branches. Fixed accepting non-alpha first character for environment variable name in :let command. Fixed completion of &-terms, which didn't always list all found matches. Fixed silent (effectively) ignoring of incomplete regexp argument (as in :filter/something, this is different from :s/a). Fixed forgetting of broken symbolic links that went into trash. Fixed silent ignoring of unmatched quote among :set arguments. Fixed picking wrong partition for deletion under symlinked paths. Thanks to aleksejrs. 0.8-beta to 0.8 (2015-07-09) Added handling of Ctrl-L to sort dialog. Thanks to filterfalse. Added device id (major and minor numbers) to file info dialog. Added script to update timestamps, so that build system won't be regenerated without real reason. One might want to run it when building from git checkout, which doesn't preserve correct timestamps. Append unused space in view columns to the last one with percent sizing type if any. Thanks to fogine. Drastically increased performance of custom view composing. Be more accurate when deciding whether view displays graphics, particularly rely on %px and %py, because %pw and %ph might be useful for text viewers as well. Thanks to Svyatoslav Mishyn (a.k.a. juef). Less flicker on preview window update. Clean occasional graphics leftovers after disabling preview. Ignore file decorations ('classify') on sorting custom views. Thanks to filterfalse. Do not invoke vifmrc-converter to update color scheme names if no color schemes were found. Display 2822 date without time zone in file info. Thanks to Svyatoslav Mishyn (a.k.a. juef). Disallow creating user-defined command with "?" or "!" suffix if this would hide builtin command. Redefining commands without suffixes is not allowed, thus this shouldn't be allowed too. Better "all" pseudo-option parsing and support of resetting it. Do not display same path twice in detailed progress information (after both "file" and "from"). Shorten paths in "file" and "from" in progress dialog. Sync approximate and accurate forms of progress dialogs. Fixed pane titles update on switching panes. Fixed build on OpenBSD. Patch by Brian Callahan (a.k.a. ibara). Fixed redrawing of dialogs requested via startup commands. Thanks to filterfalse. Fixed removal of original directories during merging with 'syscalls' on. Thanks to willemw12. Fixed directory merging when 'syscalls' is off. Thanks to willemw12. Fixed option completion to do not provide completion for "noall" or "invall", which isn't valid. Fixed dialog message centering which could be off by one. Fixed work on OpenBSD (at least to some degree that curses implementation there allows). There are still some troubles with non-ascii characters. Thanks to hofheinz. Fixed possible constant view reload when built on some systems. Thanks to hofheinz. Fixed error reporting on builtin function argument parsing in rhs of :let expression. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed truncating viewed file on 'wrap', 'tabstop' > 2 and line wrapping caused by tabulation. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed copying of fifo, socket and device files with 'syscalls' enabled. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed compilation with musl. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed build on FreeBSD. Thanks to bsdmp. Fixed not drawing local colorscheme once after setting global one. Fixed priority of abbreviations for user-defined commands with trailing "!" or "?", which shouldn't be preferred over corresponding builtin abbreviation. Fixed "(n + 1) of n" in detailed progress dialog. Fixed infinite loop or crash on empty match on search in view mode (e.g. on /$). Fixed crash/leak on processing of background jobs. Thanks to Christian Fillion (a.k.a. cfillion). Fixed several memory access errors and leaks. 0.7.8 to 0.8-beta (2015-06-19) Removed per-view last search pattern. Don't worry, you probably won't even notice it: this doesn't affect regular use case, rather more exotic one, which is hard to notice. Map and to different key codes. Thanks to fogine. Added angle bracket notation (less-than character, '<'). Thanks to filterfalse. Added K mapping to Vim plugin (quick navigation to documentation, e.g. from vifmrc). Patch by filterfalse. Aligned columns in :jobs menu. Added 'chaselinks' option to automatically expand all symbolic links in path of a view (might not work on Windows). Thanks to filterfalse. Added %FOREGROUND FUSE mounting option, which supersedes %CLEAR and fixes issue with passing input to FUSE mounter. Thanks to Johannes (a.k.a. johannesmeng). Added %[ and %] macros for status line/ruler. Thanks to ranousse. Added single-argument form of :file[x]type and :fileviewer commands that lists (in menu mode) currently registered patterns that match specified file name. Added filename specific highlight. Thanks to Ink (a.k.a. inknoir), filterfalse and Michael Maddern (a.k.a. madders). Added dircolors -> vifm conversion script. Thanks to Ink (a.k.a. inknoir), Hendrik Jaeger (a.k.a. henk) and Michael Maddern (a.k.a. madders). Added F key to less-like (file view) mode, which acts similar to `tail -F` or F key in less. Thanks to Daniel Dettlaff (a.k.a. dmilith). Added 'mintimeout' option. It enables controlling responsiveness on external events by Vifm. Thanks to hofheinz. Added Ctrl-X / (slash) key to command-line mode that inserts last search pattern into current cursor position. Thanks to filterfalse. Added custom views, which contrary to regular views can contain files that do not belong to the same directory. Added b key to menu mode that creates custom view filled with menu items filtering out those that are not paths. Added zd normal and visual modes key to exclude items from custom views. Added %u and %U macros to redirect command output directly into custom view. The second one allows for more customization of file list, which is absence of sorting for now. Thanks to filterfalse. Added --delimiter command-line option. Configures delimiter string on writing out list of paths (like on `-f` switch). Thanks to Jeet Sukumaran (a.k.a. jeetsukumaran). Added --choose-files and --choose-dir command-line switches to specify output location for names of selected files or last visited directory respectively. Thanks to Jeet Sukumaran (a.k.a. jeetsukumaran). Added :cq[uit] command to exit with non-zero exit code and also abort directory choosing. Thanks to Jeet Sukumaran (a.k.a. jeetsukumaran). Added --on-choose command-line switch to execute a command on selection rather than opening it. Thanks to Ross Hadden (a.k.a. rosshadden). Added system() builtin function that executes command via shell and returns its output. Added Ctrl-] command-line key to trigger abbreviation expansion. Added 'wordchars' option to specify which characters in command-line mode should be considered as part of a word. Thanks to filterfalse. Added command-line mode abbreviations and :cabbrev, :cnoreabbrev and :cunabbrev commands to manage them. Thanks to filterfalse. Added per-file overwrite confirmation on directory merging. Thanks to willemw12. Added optional per-file progress in dialog mode activated by hitting "i" while operation is being performed. Added OS X version of sample vifmrc file. Now this one will be used on first run on OS X. Thanks to Larry Hynes (a.k.a. larryhynes). Added --enable-coverage option to configure script. Added ^= operation for charset options. Added job bar that displays backgrounded file operations if any. Thanks to geo909. Added JobLine highlight group for the job bar. Added :redr[aw] command to force immediate redraw. Thanks to filterfalse. Added search match highlight for file names. Thanks to Svyatoslav Mishyn (a.k.a. juef) and willemw12. Added fallback to use "XDG Base Directory Specification" when failed to find configuration in other places. Thanks to Miodrag Tokić (a.k.a. loonies). Added %px, %py, %pw and %ph macros that describe location and dimensions of preview area to use in external commands. Thanks to Stephano (a.k.a. cao). Added lookup for mandoc on *nix to perform manual page to plain text transformation. Thanks to Svyatoslav Mishyn (a.k.a. juef). Added :trashes? to display sizes of each non-empty trash directories. Thanks to Svyatoslav Mishyn (a.k.a. juef). Added global configuration {prefix}/etc/vifm/vifmrc and color schemes {prefix}/etc/vifm/colors/*. Thanks to astrell and Michael Vetter (a.k.a. jubalh). Added one more light color scheme to assets (in two variations astrell-root and astrell-user). Thanks to astrell. Added regexp patterns to :file[x]type and :fileviewer commands. Thanks to filterfalse. Added full path patterns ({{globs}} and //regexp//). Thanks to astrell. Added detailed list of errors when 'syscalls' is used. Thanks to willemw12. Added .vifm extension to color schemes (initial rename is performed automatically). Thanks Michael Vetter (a.k.a. jubalh). Allowed having multiple file viewers with same rules for choosing them at run-time as for file associations. Thanks to filterfalse. Added "p" to 'shortmess' option to control tilde shortening of paths in view titles. Thanks to Martin Fischer. Changed default value of 'trashdir' from "$VIFM/Trash" to "%r/.vifm-Trash,$VIFM/Trash". Thanks to Joseph LP (a.k.a. ootput). Made calculation of directory size visible in :jobs menu. Made tests less dependent on environment. Thanks to Hendrik Jaeger (a.k.a. henk). Removed unnecessary command existence checks from vifm.vim. Thanks to filterfalse. Auto-resize position field on the status bar to fit the text. Thanks to ranousse. Switch to utf-8 internal representation of paths on Windows. This fixes issues when file name encoding doesn't match system encoding. Thanks to Stas Panteleev. Made leaving wrong (unexpectedly removed) directory more robust. Thanks to willemw12. Significantly reduced amount of work performed by Vifm in idle state. Thanks to hofheinz. Made message dialogs interact better with everything else on the screen. E.g. redraw properly after terminal resize. United last pattern of :substitute command with search history. Thanks to filterfalse. Made configure script lookup curs_set in libtinfo. Redirect both standard output and error streams from viewers (already was the case for Windows). Don't lose previously saved filter on repeated resetting (pressing zO twice in a row caused previous filter values to be lost). Extended :sync command to support selective synchronization (user can choose among location, cursor position, local options and filters). Thanks to filterfalse. Automatically install sample vifmrc and help file on first start on Windows. Redraw UI on resize during file operation when 'syscalls' is set. Quit fast on --help/--version. Thanks to Svyatoslav Mishyn (a.k.a. juef). Parse paths that start with plus sign as command-line arguments more carefully (don't treat them as startup commands). Moved checks for build-time tools existence from Makefile to configure script. Report signal that killed Vifm when that happens. Thanks to Svyatoslav Mishyn (a.k.a. juef). Report error on wrong expression in :if statement and misplaced :else/:endif on file sourcing. Define $VIFM_FUSE_FILE environment variable for external commands to communicate path to file used to initiate FUSE mounting of directory we're in. Thanks to astrell. Allow non-printable characters to be arguments of :commands. Thanks to filterfalse. Prevent inserting odd characters on terminal resize while in command-line mode. Throw away dead directories in directory histories on merging vifminfo files. Otherwise clearing such directories on :history is almost useless. Display calculated size of directory for symbolic links that point to it. Handle commands that are too long to be passed directly to the shell by breaking them into list of arguments if possible. Thanks to filterfalse. Install AUTHORS, COPYING, ChangeLog, INSTALL, NEWS, README and TODO to {prefix}/share/doc/vifm. Install color schemes to {prefix}/share/vifm/colors. Otherwise these are not available after installation. Break ties on case insensitive sort deterministically. Dynamic dialog dimensions (minimum %30 percent of the screen rather than screen-wide all the time). Thanks to Svyatoslav Mishyn (a.k.a. juef). Try harder to start in valid directory (go upwards if last visited one doesn't have search permission) or leave the one that's not available anymore. Do not depend on UTF-8 locale on making plain text version of documentation. Thanks to Svyatoslav Mishyn (a.k.a. juef). Normalized sorting keys/view column names: "type" -> "dir", display real mode in octal for "mode", make "type" actually display file type (as "mode" did before). Thanks to Michal Belica (a.k.a. beli-sk). Complete `clear` subcommand of :highlight. Parse output of mandoc version of apropos in :apropos. Thanks to Svyatoslav Mishyn (a.k.a. juef). Error on wrong combinations of macros and background mark in commands. No more unjustified inconsistency in processing macros in :! and :file[x]type commands. Thanks to Miodrag Tokić (a.k.a. loonies). Manual page fixes/improvements. Thanks to Svyatoslav Mishyn (a.k.a. juef). Wrapped option names with single quotes in the man page to make it easier to search for options by their names. Display error on failed conversion to Unicode (say if file name includes broken UTF-8 sequence). Thanks to Svyatoslav Mishyn (a.k.a. juef). Do not move cursor on trying to go one directory up in root of the file system. Thanks to Martin Fischer. Fixed search messages in menus (nth time...). Fixed automatic finishing in some situation when no terminal is available. Thanks to tYGjQCsvVI. Fixed crash on navigation to end of line in command-line mode. Thanks to Christian Fillion (a.k.a. cfillion). Fixed quite rare UI glitch right after updating 'classify'. Fixed UI glitch related to considering 'classify' option for ".." entry in directories without files. Fixed 'lsview' layout calculation for non-ascii names, which used too much space. Fixed 'lsview' entry highlight minor glitch related to symbolic links to directories. Fixed `:help` (no arguments) when 'vimhelp' is on and automatically installed Vim documentation is used. Thanks to ranousse. Fixed occasional file skipping on moving files from trash directory. Fixed gf normal mode key on following symbolic links that target files by path that has symbolic links to directories. Thanks to filterfalse. Fixed failing with error on changing case (gu*/gU*) when target file exists. Fixed undesired file removal on overwriting them with themselves (data loss after confirmation of overwriting files when destination matches source). Thanks to Сергей Соловьёв (Sergej Soloviov). Fixed parsing of %E without field width in 'statusline'. Thanks to willemw12. Fixed 'syscalls' documentation, which inverted its meaning. Thanks to willemw12. Fixed current file number in progress message on moving files across file systems when 'syscalls' is on. Thanks to filterfalse. Fixed memory leak related to list of filetypes. Fixed unexpected path resolution on Windows under path containing symbolic links. Fixed case change renames on Windows when 'syscalls' is set. Fixed file name case change undoing/redoing on Windows. Fixed view background update on ":highlight Win ...". Thanks to hofheinz. Fixed nesting of if-else statements with file sourcing. Thanks to filterfalse. Fixed segmentation faults on displaying binary files in menu mode. Fixed counting number of filtered out files. Local filter reset number of files filtered out by other filters. Thanks to filterfalse. Fixed exponential percent sign escaping on command line completion. Thanks to filterfalse. Fixed percent sign escaping on completion with no input (e.g. :cd ). Fixed absence of "Z" drive in :volumes menu on Windows. Thanks to obtroston. Fixed invalid FUSE mounter exit code on OS X and added lookup for `fusermount` command availability (should use `umount` on OS X). Thanks to Michael Maddern, a.k.a. madders. Fixed compilation on systems where __USE_BSD is defined and WEXITSTATUS() uses compound literals. Thanks to Jeet Sukumaran (a.k.a. jeetsukumaran). Fixed missing "r" characters on generating vifm-help.txt file on some systems. Thanks to Jeet Sukumaran (a.k.a. jeetsukumaran). Fixed current line highlight glitch on scrolling in ls-like view. Fixed completion of file names which start with a space. Fixed command execution in network share on Windows. cmd.exe fails for UNC paths, trick it by running command in temporary directory. Thanks to Robert Sarkozi. Fixed UI glitch when one could notice cursor blinking in the view while typing search pattern on the command-line with 'incsearch' being set. Fixed crash on :sync! when filters of two panels differ and resulting number of files is not the same. Thanks to filterfalse. Fixed navigation to the bottom of the screen with non-zero 'scrolloff', which lifted cursor when it shouldn't. Fixed inconsistency in running :!commands where %i, %m, %M or %S caused command to be executed with default system shell (/bin/sh) rather than with 'shell'. Thanks to filterfalse. Fixed completion of executables by full paths after :!. Thanks to filterfalse. Fixed menu drawing after commands like ":win something !cmd%m". Thanks to filterfalse. Fixed "[a]ppend" shortcut for name conflict resolution, which was still using "p" from older "a[p]pend". Fixed sorting change in ls-like view with empty 'viewcolumns'. Thanks to filterfalse. Fixed estimation calculation on file putting after cancellation. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed wrong single character drawing in ls-like view. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed displaying ls-like view as list of dots after :restart. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed title UI glitch with disappearing last character on disabled side borders. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed small view title glitch in CJK directories. Fixed some command-line cursor positioning issues related to non-printable characters. Fixed crash on starting command-line completion with Shift-Tab after stopping on completion item with lower number during previous completion. Fixed last space trimming in user defined commands (quite unusual use case). Thanks to filterfalse. Fixed *nix 'shell' default, was "sh", but as kernel doesn't perform search is $PATH, it would never work. Luckily $SHELL is defined everywhere, so this probably didn't cause any trouble. Fixed background mark truncation for :commands in user-defined commands. Fixed ":vs .." which used to use wrong base directory. Fixed gU, gu and ignore case name sort on filenames with non-latin characters. Fixed missing error messages related to command parsing on sourcing files. Thanks to Damian Ariel Perticone. Fixed placing right aligned ellipsis for CJK characters in one case. Fixed assertion on including "type" in 'viewcolumns' value. Thanks to Michal Belica (a.k.a. beli-sk). Fixed writing current color scheme as the default one, should use builtin colors instead. Thanks to Karol M. Langner (a.k.a. langner). Fixed running filetype commands with background mark and no macros. Thanks to Martin Fischer. Fixed displaying in :map menu (it's new line, which was treated in a special way). Thanks to fogine. 0.7.8-beta to 0.7.8 (2014-10-25) Added ga and gA keys to visual mode. Thanks to geo909. Added "[S]kip all" conflict resolution option. Thanks to Miodrag Tokić (a.k.a. loonies). Highlight "highlight clear". Returned accidentally lost "Merge all" (from message only) conflict resolution message. Made "make clean" remove "tags" files for Vim documentation generated during build. Thanks to Hendrik Jaeger (a.k.a. henk). Taught ga/gA commands to handle selection. Thanks to geo909. More accurate scheduling of view updates. Updated how tags are generated on build. Thanks to Hendrik Jaeger (a.k.a. henk). Updated sample vifmrc file. Fixed extension extraction for column view (wasn't consistent with filename modifiers). Thanks to ranousse. Fixed navigation to filtered-out files (e.g. from menus). Cursor wasn't moved to the file. Fixed parsing of ":cmd &|cmd" pattern on the command-line. Fixed error handling regarding vifmrc-converter. Thanks to Hendrik Jaeger (a.k.a. henk). Fixed dumping Default colorscheme with regard to OtherLine highlight group. Fixed ignoring just installed sample vifmrc on first run. Fixed cursor update in inactive view (say, after ga/gA finished). 0.7.7 to 0.7.8-beta (2014-10-11) Removed ltmain.sh script, which is part of libtool, which is not used anymore. Thanks to Hendrik Jaeger (a.k.a. henk). Added executable() builtin function that checks whether executable exists at given path or in one of directories listed in $PATH. Added one more :if command example to documentation. Thanks to John Magolske. Added more human-friendly (xterm-like) names for 256 colors. Thanks to Michael Vetter (a.k.a. jubalh). Added i and I flags to :filter command to control filter case sensitivity. Thanks to filterfalse. Added filter flags to output of :filter? command and formatted output as a table. Added cancellation (handling of Ctrl-C) for FUSE mounting (but not unmounting). Added multiblock "selection" (in quotes because it's also block deselection and inversion of selection for completeness). Thanks to ranousse, Michelle Bonk (a.k.a. unixtechie). Added av normal mode shortcut that activates selection amending mode. Added/updated av/v/V visual mode keys to switch type of current visual mode. Added Ctrl-G key to visual selection amending mode, which switches kind of amending (append/remove/invert). Added ":highlight clear" to reset to builtin colors. This balances change in resetting color scheme to default one. Useful for building color schemes that are partially based on the builtin one. Added full command names to the manual page to ease searching them. Thanks to y2kbugger. Added 'syscalls' boolean option. It makes Vifm prefer to perform file-system operations with external applications on rather then with system calls. {EXPERIMENTAL}, {WORK-IN-PROGRESS}. The option will be eventually removed. Mostly *nix-like systems are affected. Added implementation for directory and file removal, copying, moving, file, directory and symbolic link creation with system calls. Advanced stuff like ACL is not supported at least not at the moment. Available only if 'syscalls' option is set. Added 'cdpath' option. Thanks to Bruce Hunsaker (a.k.a. hunsakerbn). Added progress for file system operations. Available only if 'syscalls' option is set. Added =pattern special form of user-defined command that sets local filter to the given value (alike "/pattern" and "filter value"). Thanks to filterfalse. Added "[a]ppend the end" conflict resolution option (appends the rest of file, e.g. if previous operation was terminated). Available only if 'syscalls' option is set. Thanks to Sergei Shilovsky. Added OtherLine highlight group for cursor of inactive pane. Thanks to Svyatoslav Mishyn (a.k.a. juef). Added 'tuioptions' option. Controls padding of file lists in panels and visibility of side borders. Thanks to Bruce Hunsaker (a.k.a. hunsakerbn) and Svyatoslav Mishyn (a.k.a. juef). Added 'fillchars' option. Configures fill character for vertical borders. Thanks Svyatoslav Mishyn (a.k.a. juef). Added Vim plugin directory to share/vifm/vim on `make install`. Thanks Svyatoslav Mishyn (a.k.a. juef). Added has() builtin function that checks whether particular property is enabled (two properties for now: "unix" and "win"). Thanks to filterfalse. Added logical NOT unary operator ("!"). Added function name completion on command-line. Added file renaming filetype plugin for Vim. It displays list of original file names in a vertical split. Thanks to Factorial Prime. Added file additional mail filetype plugin for Vim. It allows one to pick attachments via Vifm on a shortcut. Thanks to Pavneet Arora. Added merge all option for name conflict resolution. Same as "merge", but remember the choice for future conflicts of directories. Thanks to willemw12. Highlight environment variables in :source command. Do not highlight option names in the right-hand side of assignments of :set command. Highlight numbers and all operators (most were missing) in expressions. Highlight wrapped :! commands properly. Various syntax highlight improvements related to handling of command arguments. Make Vim plugin use cmd.exe as default shell on Windows. Thanks to Jonathan Da Silva. Provided additional repository for Vim plugin (see the README for URL). Documented how to use 256 colors in :highlight command. Thanks to Michael Vetter (a.k.a. jubalh). Rewrote trash content removal with system calls in background thread to omit unportable invocation of shells. It's also visible in :jobs menu. Thanks to lyuts and ckester. Ignore trailing whitespace after background mark (" &") in command-line mode. Made :filter command consider trailing slash for symbolic links that point to directories. Thanks to filterfalse. Do not reset selection on navigating to a mark in current directory. Thanks to filterfalse. Display error on encountering unknown values assigned to 'sort' option. Allowed use of :filter syntax in user-defined filter commands (e.g. "command conf filter/.*\.cfg$/"). Do not reset color scheme to default one on :restart if another existing one is stored in vifminfo file. Allowed tabulation to be used as arguments separators in command-line commands. Thanks to y2kbugger. Renamed "default color scheme" to "primary color scheme" in documentation to avoid confusion. Separate visual selection marks ('<' and '>'), which allows to restore it via "gv" in both panes. Thanks to filterfalse. Reset search results on toggling 'hlsearch' to apply new option value on the next search query (/, ?, n, N). Include regular expression in search error message that says that it's wrong. Avoid displaying useless search messages (those that user can't see, but that are shown in :messages). Implement "(" and ")" keys for "perms" and "type" sorting keys. Thanks to filterfalse. Smart paths completion that allows completion of quoted arguments (both ' and " types of quotes) and considers argument type context by performing escaping when needed. Documented environment variables used by vifm separately as usually done in documentation for other applications. Made +/- operands after semicolon in command-line range adjust base range end position rather than base cursor position as Vim does. Thanks to filterfalse. Documented connection between local filter and 'incsearch'. Thanks to filterfalse. Repeat search with last used search pattern on empty pattern of the search mode. Automatically remove non-existent directories from directory history on :history command to speed up future operations (this clean up is very cheap on composing menu). Optimized speed of checking existence of a directory (important on displaying directory history). Skip nonexistent directories on Ctrl-O/Ctrl-I. Extended 'slowfs' option format to allow path prefixes (in particular, it's useful for autofs). Thanks to Евгений Жаров (a.k.a. ezharov). Renamed configure.in to configure.ac. Thanks to Hendrik Jaeger (a.k.a. henk). Made it possible to hide Vifm's documentation from Vim when it's not run by Vifm's :help command. Thanks to ranousse. Separated Vifm's vimdoc from plugin documentation. Do not store temporary messages of command-line in history (progress messages). Hidden misleading error message from git during successful build. Made expand() builtin function expand environment variables. Thanks to filterfalse. Do not show dead entries in :lstrash menu. Hide files from previously used trash directories in :lstrash. Thanks to filterfalse. Changed "overwrite all" key from "a" to "O" for consistency. Thanks to willemw12. Fixed odd creation of ~/.vifm/Trash directory even when it's redefined in vifmrc using 'trashdir' option. Fixed segmentation fault on running vifm with single argument if restored cursor is in the right pane. Thanks to Svyatoslav Mishyn (a.k.a. juef). Fixed visual glitch for long wide character (CJK) file names with disabled cropping. Thanks to anonymous from linux.org.ru. Fixed trash emptying when csh-like shell is in use. Thanks to lyuts. Fixed "$APPDATA/Vifm" directory existence check for Vim plugin on Windows. Thanks to Jonathan Da Silva. Fixed running external commands with long titles inside terminal multiplexers. Invoked shell in current directory. Fixed processing of marks command followed by anything in right-hand side of a mapping. Thanks to filterfalse. Fixed a minor UI glitch with drawing rightmost character position of the stat window after startup. Fixed segmentation fault during startup in a small terminal on OS X. Thanks to Daniel Dettlaff (a.k.a. dmilith). Fixed right aligned cropping for CJK (e.g. viewcolumns={name}..,{} could print one more character position or fail due to assertion). Fixed unexpectedly broken compilation on FreeBSD. Thanks to Daniel Dettlaff (a.k.a. dmilith). Fixed view update after :restart in some cases. Thanks to filterfalse. Fixed UI glitches and most of flickering of the TUI on :restart. Fixed check for wrong color number in :highlight. Thanks to y2kbugger. Fixed :highlight command recovery. Thanks to y2kbugger. Fixed :!! command, seems to be not working for a while. Fixed segmentation fault on no view history and ":set autochpos" in vifmrc. Thanks to ranousse. Fixed small visual multiline status bar update issue. Thanks to ranousse. Fixed non-updated single character of status line for multiline status bar. Fixed processing file names with sharp sign for some shells. Thanks to Flaviu Tamas (a.k.a. flaviut). Fixed message about wrong search pattern regular expression. Fixed Ctrl-C detection, false positives occurred on resizing terminal (both come as signals into program). Fixed some small issues and UI glitches related to 'lsview' and 'viewcolumns' options. Fixed operations with directories that have very long names. Fixed stripping special sequences from vifm-help.txt on OS X. Thanks to Stephen L. Holtz (a.k.a. stephenholtz). Fixed ga and gA commands for files bigger than 4 GiB on 32-bit operating systems. Thanks to filterfalse. Fixed some buffer overrun bugs discovered on OS X and made tests more BSD-utils friendly. Fixed segmentation fault on Alt-. command in command-line mode (since 0.7.7). Fixed wrong single file selection after applying local filter (also wrong number of selected files on status bar). Thanks to filterfalse. Fixed tracking of files in trash on Windows. Thanks to filterfalse. 0.7.7-beta to 0.7.7 (2014-05-16) Improved documentation on :file[x]type commands and time sorting keys. Thanks to Stas Malavin. Updated zenburn color scheme (by Svyatoslav Mishyn, a.k.a. juef). Fixed drawing "*" mark for cursor in inactive pane. Thanks to Svyatoslav Mishyn, a.k.a. juef. Fixed selecting file on navigation from menus with filelists. Fixed processing of backward slashes in menus with filelists on Windows. Fixed navigation to menu items with full paths on Windows. Thanks to Robert Sarkozi. Fixed following overwrite all option on file operation conflict resolution. Thanks to Stas Malavin. 0.7.6 to 0.7.7-beta (2014-04-30) Added Ctrl-W z key to normal and view modes, which closes preview pane or view modes. Thanks to filterfalse. Added %A macro to 'findprg' and 'grepprg' options, which is expanded to unmodified list of arguments. Thanks to Robert Sarkozi. Added handling of paths with backward slashes for :find/:locate/:grep/%M menus on Windows. Thanks to Robert Sarkozi. Added sample light color scheme. Patch by Daniel R. (a.k.a. reicheltd). Added :lstrash command-line command, which displays list of files in trash. Thanks to Sergei Shilovsky. Added :trashes command-line command, which lists all non-empty trash directories. Thanks to Sergei Shilovsky. Added cancellation handling for file system operations and invocations of external applications (works best on *nix systems). Thanks to Milan Svoboda, a.k.a. tex. Added "type" key to the 'sort' option to allow controlling grouping of directories. Thanks to Daniel R. (a.k.a. reicheltd). Added &option syntax for expressions (returns value of an option). Added angle bracket notation. Thanks to filterfalse. Added 'number', 'relativenumber' and 'numberwidth' options to control displaying of file numbers. Thanks to filterfalse and greye. Added "gf" (go to file) and "e" (open in editor) keys to :grep, :find, :locate and user menu with navigation (%M macro). Added --enable-remote-cmd switch to configure script disabled by default, as current implementation of the feature is insecure. Thanks to astrell. Added Ctrl-X a/c/d/e/m/r/t/= keys to command-line mode that insert parts of file names and values of filters (see related documentation). Thanks to ranousse and filterfalse. Added %n macro which suppresses using of terminal multiplexer in a command (user-defined :command, :!command or :file[x]type action). Added sample dark solarized color scheme (provided by Stéphane, a.k.a. istib). Added zenburn color scheme (provided by Svyatoslav Mishyn, a.k.a. juef). Extended 'trashdir' to handle list of path, some of which can specify location of trash directories local to each mount point. Thanks to smpolymen and Sergei Shilovsky. Extended parser to support integer number constants and unary minus and plus operators. Extended parser to support <, <=, >= and > comparison operators for strings and integers. Treat semicolon (";") as a valid range separator for command-line commands. Allow empty ranges for command without name (as in :4). Don't reset view selection on :if and :else commands. Optimized file name comparison on sorting. Improved documentation on bookmarks (documented special bookmarks). Don't select parent directory automatically for local filter. Thanks to filterfalse and jtbm37. Display error message when :delmarks! is followed by arguments. Made bookmarks merging smarter by storing timestamps. Removing bookmarks now works as expected. Bookmarks overwriting by another instance shouldn't happen anymore. Thanks to Michael Maddern, a.k.a. madders. Disabled command-line commands auto-completion in local filter prompt. Allowed disabling quickview while its pane is hidden. Display value of local filter in the output of :filter? command. Handle backspace in preview window as a terminal. Thanks to Svenn Are Bjerkem, a.k.a. svenn. Do not use terminal multiplexer for internal edit operations (editing of file names or command-line). Skip empty and whitespace only error messages, they are of no use. Highlight environment variables in :unlet command. Thanks to filterfalse. Fixed file descriptor leak on finishing background tasks. Thanks to anonymous from linux.org.ru. Fixed displaying of search messages in menus. Fixed check for whether temporary files with list of file names is changed during bulk rename operation. Thanks to Daniel R (a.k.a. reicheltd). Fixed reset of charset options (like 'cpoptions'), which could result in segmentation faults. Fixed memory leaks on :restart command. Fixed format arguments parsing on displaying "Invalid expression" error message for :echo and :execute commands. Fixed overwrite of previously visited directory on view update (made `:cd -` and '' useless after, for instance, switching panes). Fixed error message on navigating to a wrong bookmark. Fixed possible removing files at destination on restoring files from trash manually. Fixed ignoring command-line commands that entered by a mapping: ignore only commands entirely entered by a mapping, not finished by one. Thanks to Евгений Жаров (a.k.a. ezharov). Fixed segmentation failure when invalid bookmark name is used with quote command as a motion. Fixed processing of some forms of nested :if statements. Fixed segmentation fault for operating systems that have gigantic maximum length of argument list. Thanks to Jiri Wiesner. Fixed situation when oldest elements of histories were not available even though they were present in vifminfo file. Fixed number of selected files after ":invert s" command. Thanks to filterfalse. Fixed q= which displayed history of search by mistake. Thanks to filterfalse. Fixed merging directories on delete then paste. Fixed wrong file name cropping on moving/copying files from trash. Thanks to kazufukurou. Fixed extra escaping on prompt filename completion on Windows. Fixed drawing of hidden view in explore mode over active one. Thanks to filterfalse. Fixed missing title of quickview pane after entering view mode (e.g. with Ctrl-W W). Fixed titles update when one of panes is in view mode (active and inactive highlighting wasn't always right). Fixed segmentation fault caused by uninitialized type field of filelist entry (shared directory in virtual machine in this case). Thanks to Milan Svoboda, a.k.a. tex. Fixed navigation to non-readable directories from a menu. Fixed selection borders UI glitch. Thanks to Svyatoslav Mishyn, a.k.a. juef. Fixed issues discovered by cppcheck, Clang static analyzer and Coverity scan tools. Fixed updating terminal title for some environments. Thanks to filterfalse. Fixed extending filetypes that are missing macro on Windows when cmd.exe shell is used. Thanks to Daniel Polanco, a.k.a. dlpolanco. Fixed work with filenames contining special symbols on Windows with cmd.exe shell. Thanks to Daniel Polanco, a.k.a. dlpolanco. Fixed testing whether application uses GUI on Windows when path contains spaces. Fixed crash on a sequence of :let/:unlet statements. Thanks to filterfalse. 0.7.6-beta2 to 0.7.6 (2013-10-31) Removed check for stdscr from the configure. Thanks to jtbm37. Made command name column of the :command menu automatically expand for long names. Thanks to MadMaverick9. Provided better error messages on entering view mode. Made local filter work when 'incsearch' is not set. Fixed partial displaying of binary data in view mode. Fixed displaying of non-printable characters in preview and view mode. Fixed redrawing ruler on terminal resize while being in explore mode. Fixed small drawing issue with menu lines containing Control+x characters. Fixed search result highlighting of view mode on line edges. Fixed backward search in view mode for the first line. Fixed view mode highlighting for multi-byte characters. Thanks to filterfalse. Fixed segmentation fault on exploring same file in both views. Thanks to filterfalse. Fixed unexpected view redraw on :sync command with view mode active in the other pane. Thanks to filterfalse. 0.7.6-beta to 0.7.6-beta2 (2013-10-24) Made building for Windows64 platform possible. Consider initial filter inversion value in user defined filter command. Thanks to filterfalse. Several minor fixes/updates in documentation and sample vifmrc. Thanks to filterfalse. Display error after sourcing file with unmatched :if/:endif statements. Thanks to filterfalse. Fixed displaying of barely visible false error messages on the status bar on some rename operations. Fixed running executables without specifying their extension on Windows. Thanks to filterfalse. Fixed viewing of files with custom viewers on Windows. Thanks to filterfalse. Fixed issues with reading files on Windows. Thanks to Robert Sarkozi. 0.7.5 to 0.7.6-beta (2013-10-17) Added "f" flag to 'cpoptions' option. It controls initial state of filename filter inversion for :filter[!] {regex} command (in other words, it inverts meaning of exclamation mark). Thanks to filterfalse. Added helptags for 'cpoptions' flags in documentation in Vim format. Added --with-curses-name=NAME option to the configure script to allow specifying name of the curses library to link against. Thanks to Russell Urquhart. Added "Globs" section to the documentation. Added 'aproposprg', 'findprg', 'grepprg' and 'locateprg' options to specify external commands format. Added optional argument for :invert command. Thanks to filterfalse. Added editing command-line using Vim (like command window in Vim). Thanks to filterfalse. Added Ctrl-G command-line key to start editing command-line in external editor (for editing command, search pattern and new file names). Added q:, q/, q? and q= normal and visual modes keys (except q=, which is defined for normal mode only) to prompt for command-line in external editor. Added local to directory temporary file name filter. Thanks to Alexandre Viau and filterfalse. Added "=" normal mode key, which activates file name filtering. Added "fhistory" to 'vifminfo', which controls storing of local filter history. Added "=" and "filter" values for :history command, to show history of local filter. Added integration with tmux. Thanks to Seth VanHeulen (a.k.a. svanheulen). Added merge option for name conflict resolution, which allows merging two directories overwriting files with matching names. Added desktop entry file. Thanks to Richard Benson. Updated application icon. Thanks to Richard Benson for making it. Updated config.guess and config.sub files to their latest versions. Thanks to Hendrik Jaeger (a.k.a. henk). Removed deprecated acconfig.h file. Thanks to Hendrik Jaeger (a.k.a. henk). Replace compile symbolic link with actual file. Distinguish files and directories in filename filter by appending a slash to names of directories. Use last search pattern as filename filter when :filter command gets an empty argument (:filter//, :filter"", :filter''). Thanks to filterfalse. Don't complete commands like :filter, :tr, :substitute, etc. Match only filename against global in :fileviewer instead of full path. Removed check for WINDOW type in curses.h from configure script (didn't work for OS X and cygwin). Thanks to filterfalse. Updated syntax file to ignore non-sense characters in front of some commands (e.g. :set, :let, :highlight). Thanks to filterfalse. Updated syntax file to highlight arguments of the :execute command as expressions. Updated syntax file to highlight arguments of all map and for :command commands smarter than before. Filter in case insensitive way on Windows. Updated syntax file to highlight . Thanks to filterfalse. Updated syntax file to highlight and environment variables in argument list of the :cd command. Thanks to filterfalse. Updated syntax file to highlight :normal when it's not first in the line and treat its arguments as command-line if it starts with a colon. Thanks to filterfalse. Updated syntax file to do not highlight anything inside quoted strings except when they are part of an expression. Remove escape-codes from generated plain-text documentation on cygwin. Thanks to filterfalse. Do not reset selection on search when 'hlsearch' is reset. Thanks to filterfalse. Preserve current cursor position on view resort. Don't let completion of the :history command eat all available memory. Made all Ctrl-W x keys available in view mode. Thanks to filterfalse. Expand environment variables in values of the 'fusehome' and 'trashdir' options. Thanks to filterfalse. Provided more adequate reaction on setting 'trashdir' variable to wrong value. From now on not absolute paths for the 'fusehome' options are rejected. Separated file name filter into manual and automatic mainly for convenience. Use AC_GNU_SOURCE macro in configure.in, which is the correct way to request for GNU extensions across various operating systems. Check whether current directory is writable on :mkdir command. Check destination path existence before changing directory to it on :sync command. Consider 'classify' option on displaying file name in the status bar. Don't overwrite directory stack stored in vifminfo on exit unless it was changed in current session. Better error messages on application run failure on Windows. Don't wait finishing of GUI applications on Windows. Thanks to Robert Sarkozi. Store cancelled prompt input in prompt history. Better order of command-line command checks. Show better error message on unmatched quotes in command arguments. Force split-view when two paths are specified on command-line. Thanks to filterfalse. Corrected view switching when vifm gets only one argument on command-line (didn't switch if pane was already at specified path). Process [count] passed to gUU, gU, gUgU, gu, guu and gugu commands. Changed meaning of the R key in view mode from redrawing view to reloading it preserving scroll position. Thanks to Robert Sarkozi. Documented how | is treated on command line by some commands. Thanks to Roger Bongers. Increased performance of (re)loading content for view mode. Thanks to Robert Sarkozi. Fixed configuration when set_escdelay() function is not available. Thanks to Russell Urquhart. Fixed building when wcscasecmp() and wcsncasecmp() functions are not available (just don't use those functions). Thanks to Russell Urquhart. Fixed reserving of about 1 GiB piece of memory on 256-color terminals. Fixed hanging on previewing files with long lines and code highlighting. Fixed running of executable with symbols that require escaping in their name (*nix only). Fixed terminal hang after executing several external commands in a row. Thanks to filterfalse. Fixed "No matches..." message for :apropos command, which accessed freed memory. Fixed displaying of search results message for different combinations of 'wrapscan' and 'hlsearch' options states. Fixed real/potential issues discovered using Coverity scanner. Fixed search of the first element in file list when displaying of parent directory is disabled. Fixed small memory leak in expression parser. Fixed local options after startup (could be loaded for wrong pane). Thanks to filterfalse. Fixed fails on using absolute path to executables when 'fastrun' option is on. Thanks to MadMaverick9. Fixed running external commands with 'fastrun' option set, in case when there are more than one executable with given name. Fixed cursor position of the other view after switching quick view off right after startup. Fixed storing directories passed as command-line parameters in directory history. Thanks to filterfalse. Fixed compilation for systems, where coreutils doesn't support -n flag. 0.7.5-beta to 0.7.5 (2013-05-10) Better Makefile for tests. Thanks to Hendrik Jaeger (a.k.a. henk). Make running tests of color manager depend less on type of terminal. Thanks to Hendrik Jaeger (a.k.a. henk). Don't link against libdl when it's not used. Thanks to Hendrik Jaeger (a.k.a. henk). Commit src/Makefile.in file as it is (do not remove odd trailing whitespace characters), it could cause issues with automated building. Thanks to Hendrik Jaeger (a.k.a. henk). Set locale for tests that rely on it explicitly. Thanks to Hendrik Jaeger (a.k.a. henk). Don't accept arguments to the :help command when 'vimhelp' option is off. Pause on Windows on failed execution of a help command. Thanks to filterfalse. Pause on Windows, when executing of shell command fails. Resize terminal window back to its original size after :help on Windows. Thanks to filterfalse. Fixed generation of vifm-help.txt file on Windows (all occurrences of the "[m" sequence were removed). Thanks to Sebastian Cyprych. Fixed cd'ing to a directory after showing "Directory Access Error" message. Fixed mapping of and on Windows. Thanks to filterfalse. Fixed Tab key description in documentation, the part related to 'cpoptions' flag. Thanks to filterfalse. Fixed potential issues pointed out by clang static analyzer. Fixed calling Vim on :help command without arguments on Windows. Thanks to filterfalse. Fixed calling Vim on :help command with 'vimhelp' option turned off and a path with spaces in vifm's configuration directory. Thanks to filterfalse. Fixed resetting of 'lines' and 'columns' options to their default values. Thanks to filterfalse. 0.7.4b to 0.7.5-beta (2013-04-22) Added Gentoo ebuild. Thanks to Oleg Gordienko (a.k.a. gordio). Added parsing of escape codes in the preview pane. Added parsing of escape codes in explore (less-like) mode. Added "perms" sorting key on *nix (proposed by Daniel Dettlaff, a.k.a. dmilith). Added sample color schemes (proposed by Daniel Dettlaff, a.k.a. dmilith). Added expand() builtin function to expand macros (thanks to Sebastian Cyprych for the use case). Allowed exclamation mark for the :sync command (to force synchronization of cursor position when used without arguments). Added macros that are expanded to register's content (thanks to Florian Baumann, a.k.a. derflob). Added 'shortmess' option and its first flag: "T" to shorten long status bar messages. Added --without/[with]-dyn-X11 flag to the configure script to control static/dynamic linking against libX11 library. Thanks to Hendrik Jaeger (a.k.a. henk) for the idea. Don't use libtool in build process on *nix platforms (thanks to Merovius). Less-like mode now highlights multiple matches in a line. Less-like mode is now updated immediately when one changes 'wrap' option. Don't redraw file list for explore window on resize. Less updates for window in explore mode on resize. Don't fallback to default colors on try to switch to a colorscheme, which is not supported by terminal. Made 'slowfs' option actually work on OS X (thanks to Daniel Dettlaff, a.k.a. dmilith). Made :execute process its arguments just like :echo command (thanks to Daniel Dettlaff, a.k.a. dmilith, which made me discover old behaviour). Save dot files filter state in vifminfo (thanks to Daniel Dettlaff, a.k.a. dmilith). Slightly updated plugin related documentation. Don't store last command-line command for the dot normal mode command between sessions. Also it doesn't depend on command-line history anymore and can be used with completely disabled history. Changed the way title of the permissions dialog is composed. Fixed configuration on OS X and FreeBSD because of unavailable mntent.h header and strverscmp() function. Thanks to Daniel R. (a.k.a. r1chelt) and Daniel Dettlaff (a.k.a. dmilith). Fixed configuration when libmagic is not available, but selected (tried to check its symbols). Fixed configuration on OS X when libncursesw is installed as libncurses. Now configure script checks for libncurses if libncursesw is not found. Thanks to Daniel R. (a.k.a. r1chelt). Fixed vifminfo file update on Windows (wasn't updated at all). Fixed "Press return..." message appearing always on OSX (yes, again; hope this is final fix). Thanks to Daniel R. (aka r1chelt). Fixed buffer overflow on composing very long list of sorting keys. Thanks to Christoph (a.k.a. informationen). Fixed reading very long lines from vifminfo file. Thanks to Christoph (a.k.a. informationen). Fixed displaying of very long lines correctly in explore mode when 'wrap' is off. Fixed displaying of very long lines correctly in menu mode. Fixed using of extra memory for menu items that are read from other program's output. Fixed segmentation fault on adding new elements to history after decreasing 'history' option. Thanks to Oleg Gordienko (a.k.a. gordio). Fixed determining of executable files on Windows (particularly parsing the last item of $PATHEXT environment variable). Fixed message displayed on invalid search pattern in explore mode. Fixed highlighting of search results that cross virtual line boundary in explorer mode when wrapping is on. Fixed file preview pane update on Ctrl-W X. Fixed segmentation fault on < or g keys in explore mode when file is fully visible. Fixed displaying of last lines in explore mode with wrapping turned on for texts that contain characters taking more than one character position. Fixed displaying of pane title for paths that contain characters taking more than one character position. Fixed displaying of bookmark menu for paths that contain characters taking more than one character position. Fixed displaying of status line for file names that contain characters taking more than one character position. Fixed displaying of menus for lines that contain characters taking more than one character position. Fixed screen update after v in explore mode. Fixed Ctrl-W H/J/K/L keys in less-like mode activated by . Fixed Ctrl-W H/J/K/L/X keys in normal mode when explore mode is active in the other pane. Fixed initial cursor position in the :colorscheme menu. Fixed mappings of sequences containing non-ascii characters (thanks to ksandr1v). Fixed strange behaviour of Ctrl-U on top of file list in visual and normal modes. Fixed a bug with loading multiline commands containing bars ('|') from a vifmrc file (thanks to Sebastian Cyprych). Fixed a bug with trailing characters on loading multiline commands containing bars ('|') from a vifmrc file. Fixed a very small issue with positioning of cursor mark in the other pane, which happened after starting vifm with another size of the terminal. Fixed a macro expansion in command-line on Windows when 'shell' is set to "cmd" (thanks to Sebastian Cyprych). Fixed a typo in configure.in file, which didn't allow to specify custom location of curses library. Fixed setting of value of $CPPFLAGS in configure.in, which didn't allow to specify custom location of curses library. Fixed cursor position right after entering fuse mount point when old cursor position is recalled from history and view has too few rows. Fixed occasional reset of cursor color to default after pane switching operations. Fixed displaying of search results message when 'incsearch' option is on. Fixed destination file name existence on rename operation. Fixed very rare crash on :chmod (thanks to Marton Balazs, a.k.a. balmar). Fixed chmod on files with long names (they were truncated and appended by ellipsis). Fixed processing of incomplete escape sequences in command-line (used to crash vifm). Thanks to Denis Protivenskiy. 0.7.4a to 0.7.4b (2013-01-21) Removed screen title forcing for shell commands. Fixed 'z' (thus 'Z') register, which was unavailable (apparently since 0.6.3). Fixed using of register name argument in :yank command (was ignored). Fixed error message on command errors in user defined command-line commands (e.g. on `:foo` after `:command foo :bar`). Fixed displaying of title of the other pane in one view mode. Fixed displaying of file names in Chinese and other languages that can have characters taking more than one position on the screen. Fixed command-line cursor positioning for Chinese and other languages that can have characters taking more than one position on the screen. Fixed segmentation fault on :colorscheme command with no color schemes installed. Fixed enumeration of colorschemes for some file systems. Fixed handling of doubled single quote in single quoted command argument. Fixed small bug with sorting numbers with and without leading zeroes. Fixed applying of 'classify' option to symbolic links to directories. Fixed running of external commands using screen on l or Enter key in the normal mode. Fixed Meta-. on Windows (didn't work because of pdcurses). Fixed `:cd ........` command on Windows (looks more like a Windows issue). Fixed silent ignoring issues on running executables on Windows. Fixed races on writing vifminfo file. 0.7.4 to 0.7.4a (2012-10-22) Don't redraw statbar until end of :restart command. Don't ignore wrong number of arguments in function calls, show an error. Don't build sources separately for tests. Better processing of count given to "!!" normal mode command. Handle integer overflow of huge count correctly. Make commands like d2d, y2y and D2D work as in Vim. Use linux native console specific settings if $TERM ends with "linux" (not only equals it). Check TMPDIR, TEMP, TEMPDIR and TMP environment variables to determine location of directory for temporary files. Made processing of value of 'fusehome' option more error prone. Fixed autotools configuration files. Fixed terminal size resetting after :restart. Fixed 'dotdirs' option on Windows. Fixed repetition of `bar` in `foo | bar` on "." command. Fixed segmentation faults on passing to big count to DD, dd or yy normal mode commands. Fixed displaying of filenames with non-latin characters in the view on Windows. 0.7.3a to 0.7.4 (2012-10-18) Removed compile-time compatibility mode (the compatibility-mode switch), now "f" flag in 'cpoptions' does the same. Replaced gl normal mode mapping for Windows with gr because of conflict. Added Ctrl-W H/J/K/L normal mode keys. Added status bar messages for :apropos, :find and :locate commands. Added 'viewcolumns' local option to control view columns. Added completion for :set option= even for options without variants. Added Ctrl-T handling in command line to swap characters. Added Meta-. handling in command line to paste last parts of previous commands. Added --without/[with]-X11 configure script option. Added 'lsview' option to control ls-like view look. Added gh, gj, gk and gl keys for normal and visual modes. Added 0, ^ and $ keys for normal and visual modes, which also work as selectors in normal mode. Added %E 'statusline' option macro, which means size of all selected files or current file, if no files are selected. Added light versions of color names. Added mapping commands for view and menu modes. Added :echo command. Added support for builtin functions and filetype() as the first one. Added support for `==` and `!=` operators. Added :if, :else and :endif commands. Added man pages for vifm-pause script and vifmrc-converter. Added :normal command. Added 'dotdirs' option to control displaying of "../" directory. Added "t" flag to 'cpoptions' option. Added 'classify' option to set prefixes and suffixes for different file types. Try the rest of the programs for an association when the default isn't found. Allow paths in :file[x]type command that contain spaces to be doublequoted on Windows. Escape pipe character during :file completion. Expand macros for user defined commands. Changed relative path base for :split and :vsplit commands. Complete only directory names for :split and :vsplit commands. Check current view of other pane on leaving FUSE mount directory an don't unmount if that file system is still in use. Complete :set for short and full option names like Vim does (e.g. 'so' should be expanded to 'sort', not only 'scrolloff'). Reduce delay between terminal resize and TUI redrawing. Check for used curses symbols in ./configure script. Check for libpthread presence in ./configure script. Check for pthread.h header and all its required elements in ./configure script. Check for magic.h header and required libmagic functions in ./configure script. Check for regex.h header and all functions, macro and types connected with it in ./configure script. Check for GTK headers and all related in ./configure script. Check for socket related headers and function in ./configure script. Check for a bunch of system headers, types and functions in ./configure script. Flicker less on :restart command. Don't show Ctrl-C part in information message boxes where it doesn't make sense. Remove automatically generated files on `make clean`. Don't pause on '0' after Ctrl-W (count cannot start with zero). Multiply counts in front and in the middle of commands with Ctrl-W (as Vim does). Multiply counts in front of command and its selector (as Vim does). Reduced memory consumption of view histories. Fixed background bold (light) colors in linux native console. Fixed segmentation fault on running vifm with one path in the argument list. Fixed directory content update on chain execution of several commands in mappings. Fixed partial drawing of file list over status line after expanding one line status bar to multiple lines. Fixed artifacts with bottom of the TUI after shrinking multiline status bar to one line. Fixed file overwriting issue. Fixed appearance of an empty filename in the :marks menu. Fixed filter resetting on following bookmarks. Fixed mapping of . Fixed "Press return..." message appearing always on OSX. Fixed segmentation fault on :move command with path containing slash. Fixed segmentatino fault on :restart during prompt history load. Fixed eternal looping on "(" or ")" in normal or visual mode and iname sort. Fixed segfault on `:set all=` completion try. Fixed displaying of 'columns' and 'lines' option values. Fixed ga and gA over sshfs. Fixed small issues with other pane position and mark update on startup and terminal resizing. Fixed extra slash in :registers menu for files in root directory. Fixed file viewer matching when symbolic link target is a directory. Fixed checks for required headers in ./configure script. Fixed checks for required functions in ./configure script. Fixed check for git command presence in src/Makefile.am. Fixed cursor position in menus, when 'scrolloff' is set. Fixed utf-8 issue in :marks menu. Fixed dd in :commands menu. Fixed invoking of menus from command-line (with -c or + argument). Fixed Ctrl-F and Ctrl-B in menus again (they probably didn't work correctly ever until now). Fixed unexpected file list drawing on switching between panes in one pane mode with view active. Fixed small issue with sorting files with numbers in names on *nix. Fixed parsing of double single quote in single quoted strings. Fixed description of installation to $HOME in the INSTALL file. Fixed assignment of empty value to a option of set type. Fixed small memory leak on restoring files from trash and putting files. Fixed small memory leak related to :messages command. Fixed small memory leak related to implicit single file selection. 0.7.3 to 0.7.3a (2012-06-23) Added a section about color schemes to the documentation. Added checks for correct value of 'tabstop' option. Added checks for correct value of 'timeoutlen' option. Expand tilde in the second argument of :colorscheme command. Better completion for :colorscheme command. Forbid relative paths in :colorscheme command until vifm is completely loaded. Documented that %m, %M, %s, %S and %i have bigger priority than &. Documented that %m, %M, %s, %S and %i are mutually exclusive. Allowed whitespace after option name in :set command. Documented treating of whitespace around option names in :set command. Reset value of 'columns' option to real number of columns. Reset value of 'lines' option to real number of lines. Reset value of 'scrolloff' option to zero on attempt to assign a negative value to it. Faster Ctrl-W x, Ctrl-W o, Ctrl-W s, Ctrl-W v, Ctrl-W =, Ctrl-W <, Ctrl-W >, Ctrl-W -, Ctrl-W +, Ctrl-W |, Ctrl-W _. Faster redraw on terminal resizing. Faster execution of `:set sort=foo sortorder sortnumbers` in vifmrc. Made file filtering using regular expressions work faster (matters when directory contains several thousands files). Draw quickview on startup only once. Faster redrawing of status bar with "-- VISUAL --" message after "Press Enter message". Show correct number of selected files in visual mode after n and N keys. Pass range given to alias to an aliased command. Fixed unexpected resetting of dot filter on following mark to root directory. Fixed loading file associations from vifminfo. Fixed small memory leak on displaying :file menu. Fixed saving of x file associations to vifminfo. Fixed segmentation fault on :file command on files without associations and vifm built with --enable-desktop-files. Fixed going to top of selection after Ctrl-A/X, C, i and zf in visual mode if visual mode was activated at least once before that. Fixed compilation with ncurses prior to 5.7 version. Fixed compilation warnings about unused result of fscanf. Fixed merging of directory history in vifminfo file (loosed relative positions of directories absent in history of running instance). Fixed history size issue, when real histories size diverged with the value of 'history' option. Fixed displaying of non-latin characters when panel width is only one character. Fixed selection of ../ directory on gv key. Fixed visual selection of the first file in the root directory. Fixed memory leak on `:[ncv]map foo`. Fixed restoring of file name filters. Fixed restoring of cursor position in the other view if quick view was opened too. Fixed selection of files on search in visual mode with 'incsearch' option turned off or n and N keys regardless of 'incsearch' state. Fixed search repeat in visual mode. Fixed search update with 'incsearch' on Ctrl- keys in search prompt. 0.7.2 to 0.7.3 (2012-06-03) Removed possibility of moving items in :file menu. Removed empty line from :file menu for case when vifm was configured with --disable-desktop-files flag. Added description for :filetype, :filextype and :fileviewer commands. Added --enable-desktop-files (enabled by default) configure option. Added completion for :touch command. Added macros expanding for :mkdir command. Added macros expanding for :touch command. Added completion for :clone command. Added completion for :copy, :move, :alink and :rlink commands. Added completion for :mkdir command. Added completion for :split and :vsplit commands. Added completion for :rename command. Added size of file in bytes in file info mode (Ctrl-G). Added "Y" key to visual mode as an alias for "yy". Added :finish command to use in sourced scripts. Added %i macro to completely ignore output of external commands. Added notes about automatic FUSE mounts to the documentation. Added Ctrl-L handling in file info (Ctrl-G) mode. Added vifm version and last modification date to vim documentation file. Added q key to close menus. Leave leading zeros on Ctrl-A/X commands. Check coreutils version on configuring to omit using of -n option with coreutils of versions prior to 7.1. Allow bookmarking of host names on Windows (e.g. //ZX-SPECTRUM). Show host's root in history menu (e.g. //ZX_SPECTRUM). Made :fileviewer command work on Windows. Open selected directories with l or Enter keys. Changed the way 'fastrun' works. Replace home directory with the tilde in terminal title. Improved :let command (allowed using of expressions at the right side of the statement). Properly handle when user alters PATH environment variable using :let command. Now vifm removes scripts ($VIFM/scripts/**) from PATH for :shell command. Less blinking of the screen in various scenarios. Corrected status bar messages about failed search. Use common search history for normal, visual and menu modes. Save last typed but not executed command in command-line mode (this also includes searches). Better handling of multiline messages in status bar. Increased directory modification stamp precision on *nix. Documented ./configure script options in the INSTALL file. Fixed bug with running Ctrl-A/Ctrl-X commands on directories. Fixed undoing of previous operation on error in current one. Fixed updating of views when they are in view mode. Fixed bug with failed assertion on not complete macro. Fixed error reporting on Ctrl-A/Ctrl-X commands on selection. Fixed work of Ctrl-A and Ctrl-X commands on selection. Fixed small issue with tabs in quick view and 'nowrap'. Fixed displaying of wrong drive paths in history menu ("d:" or "c:"). Fixed bug with plugin and parenthesis. Fixed getting list of associated programs using .desktop files when the file utility is used to obtain mime-type of a file. Fixed result of applying :p filename modifier in root of file system. Fixed opening of tagged (selected) symbolic links to a directory. Fixed problem with leaving socket alive on crash. Fixed compilation using cygwin. Fixed memory errors connected with Ctrl-A and Ctrl-X commands. Fixed using of uninitialized memory on :substitute. Fixed global substitution of patterns beginning with a caret. Fixed :cd (so and :pushd) with absolute path as second argument. Fixed case insensitive renames using :rename command on Windows. Fixed message about failed rename operation. Fixed renaming of files on Windows (sometimes files could be moved). Fixed infinite loop of filter inverting. Fixed adding of ellipsis into view title when it's actually don't needed. Fixed handling of equal sign after variable names in :unlet command. Fixed automatic refresh of view on Windows. Fixed displaying of cached directory size. Fixed trash elements duplication in vifminfo file. Fixed memory corruption if :restart command is called from key mapping. Fixed deadlock issue that caused vifm to freeze after running external commands in certain cases. Fixed wrong resizing of file info mode. Fixed saving of partially typed search pattern with 'incsearch' on. Fixed searching in visual mode with 'incsearch' on. Fixed artifacts at the bottom of screen on FUSE mountings. Fixed check for file existence on file running. Fixed running 'vicmd' on :rename and similar commands with ending \s+&. Fixed appearing of cursor in stat line on resize with active wildmenu. Fixed unexpected appearing of wildmenu on terminal resizing. Fixed running when /etc/mtab file doesn't exist. Fixed compiling with file tool (libmagic) of version 4.21 or older. Fixed work of ga/gA commands with huge files on Windows. Fixed terminal freezing on Ctrl-Z in vim launched from vifm. Fixed blinking of file list in the menu mode while working with command line with 'hlsearch' and 'incsearch' set. Fixed clearing of selection on search cancel in menus with 'hlsearch' and 'incsearch' set. Fixed selection of created directory on `:mkdir! dir1/dir2`. Fixed case of letters of Ctrl-W combinations in the documentation. Fixed copying of vifm-help.txt and sample vifmrc to ~/.vifm directory. 0.7.1 to 0.7.2 (2012-02-19) Added --select command line argument. Added g:vifm_exec_args variable for the plugin. Added write permissions to current directory on :touch. Added 'rulerformat' option. Added 'statusline' option. Added optional argument for the :sync command. Added support for character classes in globals. Added . Added support for running :cmap, :nmap and :vmap with one argument. Added :u filename modifier for UNC computer name (Windows only). Added --remote command line argument. Added recursive mode for :rename command. Added 'columns' and 'lines' options. Added :let and :unlet commands to work with environment variables. Added $VIFM and $MYVIFMRC environment variables. Added embedded icon on Windows. Added file properties dialog on Windows. Added file attributes in status bar and file info view. Added ctrl-w p, ctrl-w b and ctrl-w t normal mode keys. Added :windo and :winrun commands. Added 'trashdir' option. Restore terminal title on exit. Reset dot and filename filters if they hide bookmarked file. Show "Sorting directory..." message only for big directories on Windows. Now vifm will add all subdirectories of ~/.vifm/scripts to PATH. Made vifm react faster on external changes. Change console title on Windows. Made determining of home directory on Windows more intelligent. Better check for old-style color schemes file. Mention cterm :highlight command argument in generated color scheme files. Changed square brackets in yes/no of confirmation dialog. Made 'sortnumbers' work on Windows. Avoid unnecessary directory view updates on Windows (like after C key). Allow using of backward slashes in :rename command on Windows. Let :s and :gs filename modifiers change slash type on Windows. Never change active view on :restart command. Properly quit vifm on console closing on Windows. Removed odd sorting keys on Windows. Allowed using of macros with :clone command. Set left panel as active with one path passed as an argument. Fixed bug with fixed-length buffer for :grep command (when many files are selected). Fixed completion of ":set sort" (didn't complete 'sortnumbers' and 'sortorder'). Fixed several memory overflows and leaks. Fixed "Change" time, which is "Creation" time on Windows. Fixed creation of Trash dir if it doesn't exist in ~/.vifm/. Fixed status bar message after Ctrl-A/Ctrl-X on Windows. Fixed bug with drawing extra character after file list redraw (e.g. on za). Fixed bug with segfault on running background operation (e.g. :copy &). Fixed compilation on Mac OS X. Fixed running gvim on commands like :rename. Fixed renaming on Windows when only letter case is changed. Fixed terminal title blinking on startup. Fixed status bar attributes for searching. Fixed view update when 'incsearch' is on and user removes and types again one character. Fixed blinking of number of selected files on Escape key in search mode with 'hlsearch' turned on. Fixed redrawing of other view on 'sortnumbers' option toggle. Fixed misleading message about pattern not found on first search using n or N keys. Fixed bug with going to upper bound of visual selection. Fixed bug with :rename and 'vicmd' (or 'vixcmd') option with backgrounding. Fixed bug with :rename and screen support turned on. Fixed picking view on which ctrl_w+* keys operate in view mode. Fixed Ctrl-U/D/F/B keys in visual and menu modes one again. Fixed a typo in status bar message after :mkdir. Fixed sorting with ignoring case. Fixed read-only file removal on Windows. Fixed adding of "(1)" to name passed to :clone. Fixed messages about background operations in :jobs menu. Fixed %S macro and no command output. Fixed filtering of selected files with special symbols in their name. Fixed title in permission change dialog and files with long names. Fixed leaving inexistent directory on Windows. Fixed :empty command on Windows. Fixed delay after pressing Escape on *nix and ncurses. Fixed viewing of file with end-of-lines different from standard on running system. Fixed navigation to file (e.g. after :touch) when 'scrolloff' isn't 0. Fixed segfault on small window on Windows. Fixed bug with unfinished :s or :gs filename modifier. Fixed dumb black screen on :shell command after :screen when vifm is not running inside screen. 0.7.0 to 0.7.1 (2011-11-15) Added 'scrollbind' option. Added 'wrapscan' option. Added 'incsearch' option. Added support for more angle bracket notations in mappings (, , , , , , , , , , , , , , , ..., ). Added :split! to toggle between only and split view. Added :file to quick run one of associated commands. Added '(' and ')' keys for normal and visual modes. Added g:vifm_exec variable for the plugin. Added backgrounding of :copy, :move and :delete commands. Added Ctrl-n (j) and Ctrl-p (k) keys. Added 'cpoptions' option. Added 'laststatus' option. Added year in the file info dialog (on Ctrl-G). Added :delete!. Added , ..., , , ..., , , ..., , only for Windows. Added kind of portable mode on Windows. Added support for :substitute command without arguments. Added horizontal splitting of views (changed :split command, added :vsplit command, changed Ctrl-w s mapping). Added Ctrl-w j and Ctrl-w k keys. Added Ctrl-w <, Ctrl-w >, Ctrl-w + and Ctrl-w - keys. Added Ctrl-w | and Ctrl-w _ keys. Added completion of environment variables (:cd, :pushd, :! and :!!). Added support for using environment variables as :cd or :pushd arguments. Added Ctrl-A and Ctrl-X keys (normal and visual modes). Added as synonyms for (where X is a key). Added notation to run internal vifm commands from user defined commands. Added angle bracket notation and as synonyms for . Added Ctrl + Alt + letter combinations, only for *nix. Added view mode (see documentation). Added e key for normal mode. Added -c and + command line arguments. Added :source command. Added zh, zl, zH and zL keys for the menus (horizontal scrolling). Added ftdetect plugin for vim (now there is no need for modelines or changing .vimrc). Added more tags to the documentation in vim-help format. Added ZQ and ZZ keys to close menus and dialogs. Added 'tabstop' option. Added support of [count] for / and ?. Added :execute command. Make macros expand to paths with forward slashes on Windows. Clean selection after i key in normal mode. Don't clear terminal title on exit. Warn about symbolic links are not available. Make 'ignorecase' and 'smartcase' affect f and F. Don't show current file as selected after executing a :command and resizing terminal while it works. Show progress message (e.g. on :copy) after terminal is resized. Don't use position in the view on ' key, when 'autochpos' is off. Better check if directory was changed on Windows. Made ga and gA work in background. Don't change file extension on cloning. Better cW command. Show all shares on Windows (including private ones). Move cursor to clone of current file after file cloning. Smarter file name generation on cloning. Made i key work in visual mode. Allowed question mark for :mark command (to prevent bookmark overwriting). Made C command accept count. Made some messages about operations more correct. Allowed arguments for plugin's commands. Allowed exclamation mark for :view command (to prevent view closing). Fixed bug with stat window in the menu mode (for example after n of N keys). Fixed bug with disappearing of number of selected files in visual mode. Fixed leaving visual mode on cp key. Fixed clearing selection after :file menu. Fixed asterisk as first character in a global. Fixed running of user defined commands in the background. Fixed running external commands on Windows when 'shell' is 'cmd.exe'. Fixed bug with displaying bookmarks in the :marks menu on Windows. Fixed bug with saving bookmarks to vifminfo file. Fixed directory copying on Windows XP. Fixed permission check on copying files from a network on Windows. Fixed copying files from a network on Windows. Fixed removing of directories on Windows (at least on XP). Fixed plugin on Windows. Fixed a/c/m file time on Windows. Fixed displaying of local chars in C-G dialog on Windows. Fixed command-line shortcuts with Alt key and pdcurses library. Fixed redrawing in the :only mode. Fixed algorithm of finding vifm configuration directory on Windows. Fixed setting of numeric bookmarks (0-9). Fixed displaying of local chars in other window's title on Windows. Fixed check of directory write permissions on Windows. Fixed pausing on :!! on Windows. Fixed completion after // on Windows. Fixed quick view of files (printed "Cannot open file" sometimes). Fixed bug with processing keys (functional on Windows XP in particular). Fixed bug with showing quick view after :only command. Fixed with pdcurses. Fixed some bugs with UNC paths on Windows. Fixed displaying of local chars in the wild menu on Windows. Fixed parsing path arguments on Windows. Fixed small issue with sorting directory names. Fixed some issues with shell escaping. Fixed bug with showing name conflict message 2nd time. Fixed viewing files with UNC paths on Windows. Fixed bug with applying :s or :gs filename modifiers several times. Fixed loading long histories (search, prompt or command) from vifminfo file. Fixed gf command on Windows. Fixed some issues with zt/zb and 'scrolloff' in menus. Fixed copying of hidden and system files on Windows. Fixed Ctrl-C handling on Windows. 0.6.3 to 0.7.0 (2011-09-29) Removed :cmdhistory command. Use :history cmd or :history :. Removed 'savelocation' option. Use set vifminfo+=dhistory. Removed support of startup file, all commands will be moved to vifmrc. Removed '<,'> range from command line in visual mode (all work without this range, because files are selected). Removed CURR color from color schemes (was unused). Returned Change dialog. Added 'wildmenu' option. Added 'ignorecase' option. Added 'smartcase' option. Added support for multi line commands in startup file. Added 'hlsearch' option. Added abbreviations for :set options. Added check for broken links of selection on :edit. Added gf command (find link destination). Added :mark command. Added :delmarks command. Added :comclear command. Added :unmap, :cunmap, :nunmap and :vunmap commands. Added :noremap, :cnoremap, :nnoremap and :vnoremap commands. Added :filetype and :fileviewer commands. Added 'vifminfo' option. Added :filextype command. Added 'shell' option. Added 'vixcmd' option. Added :find command. Added broken link color to color schemes. Added top line and status line colors to color schemes. Added al command for symbolic links with absolute paths. Added rl command for symbolic links with relative paths. Added g:vifm_term variable for the plugin. Added :substitute command (for quick file rename operations). Added filename modifiers (:p, :~, :., :h, :t, :r, :e, :s and :gs). Added gs command to work with t selection like gv with visual mode selection. Added cl command to modify symbolic link target. Added :restart command. Added %M macro. Added prompt (cw, co, cg, name conflicts) history. Added :grep command. Added vifmrc syntax and filetype files for Vim. Added 'd' state for execute flags in permission dialog. Added search and prompt history to :history command. Added argument completion for :history command. Added 'autochpos' option. Added --no-configs argument. Added :tr command. Added q key to permissions, sort and fileinfo dialogs. Added 'timeoutlen' option. Added gu and gU commands (and their variations). Added :clone command. Added :copy command. Added :move command. Added :alink and :rlink commands. Added 'scrolloff' option. Added support for using ':' instead of '=' in :set command. Added Ctrl-_ command-line key to reject completion. Added :volumes command (only for MS-Windows). Added :version command as another name for :vifm. Added FIFO color to color scheme. Added color scheme color for error messages in status bar. Added :mkdir command. Added :touch command. Added support of question mark for :colorscheme command. Added :highlight command. Added 'gdefault' option. Added black hole register ("_). Added UNC names support (MS-Windows). Added TopLineSel highlight group. Added :chmod command. Added :chown command. Added macros that are expanded to paths enclosed in double quotes (%"c, %"C, %"f, %"F, %"b, %"d and %"D) Added completion for co and cg commands. Added %S macro. Added completion for cw and cW commands. Added 'slowfs' option. Added :messages command. Added gl normal mode key (only for MS-Windows). Added support for :set all. Added support for :set command without arguments. Now spaces between option name and '?' or '!' are allowed in :set command. Handle multi line output of :set command (for example, ":set confirm? fastrun?"). Corrected size units to be like in *nix utilities (KB = 1000, K = 1024...) Update more items on ga and gA. Changed file size format. Sort completion items. Shift-Tab command line key to perform completion in reversed order. Now vifm also accepts paths to files as the startup arguments. Let user go through directories with execute access, but no read access. Now users can place scripts for vifm to ~/.vifm/scripts, vifm modifies it's PATH environment variable to let user run scripts without specifying full path. Changed format of :delete and :yank (:cmd reg count). :filter?, :invert? and :screen? to display state. Made :display and :registers accept argument (like in Vim). Now vifm understands user name after tilde in paths. Made filetype understand star as in globals. Changed format of ~/.vifm/vifmrc and ~/.vifm/vifminfo files. Removed duplicates from command and directory history. Made C handle selection, check read permission and work in visual mode. Made /, ?, n and N work in visual mode. Moved file name from quick view window to view title. Made directory history persistent (when 'vifminfo' contains dhistory). Made command line history persistent (when 'vifminfo' contains chistory). Made search history persistent (when 'vifminfo' contains shistory). Made :locate and :find without arguments repeat last search. Changed the way l key handles selection. Made dirstack persistent (when 'vifminfo' contains dirstack). Made :! accept ranges. Made l key work in visual mode. Made registers persistent (when 'vifminfo' contains registers). Documented which commands accept ranges. Made :cd and :pushd accept two arguments or an exclamation mark. Made :set command understand &. Show search matches in the menus. Made :split accept path. Made Ctrl-W in command line mode work like in Vim. Made 'vicmd' and 'vixcmd' understand & at the end. Don't quit when terminal is too small (print message and ignore input). Better ranges (added support for '+' and '-'). Handle %m, %M and %s in the :! command. Modified pushd to accept empty argument list. Made :dirs menu interactive. Now keys can be used in mappings. Now case of color names in the colorscheme file is ignored. Documented command line keys. Handle color schemes with too many colors for terminal right. Made :apropos command accept empty argument list. Made :rename accept a list of new file names. Ownership is not preserved on copy operations anymore. Made F, f, ;, comma, n and N commands accept count. Better 'sort' option (support of multiple sort keys, added iname key). Let user use short forms of user-defined commands with "!". Made ':set option' equivalent to ':set option?' for all types of options except boolean. Made 'history' option control search, command line and prompt histories. Modify terminal emulator title. Fixed bug with name conflict of files and directories in the Trash. Fixed bug with broken symbolic links in the Trash. Fixed bug with stat_win in the menus. Fixed D when 'confirm' enabled. Fixed '< and '> after Enter key in visual mode. Fixed ga and gA bug with root directory size. Fixed bug with ":1 command". Fixed bug with gv in visual mode when '< and '> are undefined. Fixed bug with 'sortnumbers'. Fixed bug with f, F, comma and ;. Fixed bug with invalid value of %f for :udf. Fixed bug with shrinking of status bar. Fixed bug with displaying "1024 K". Fixed command line resizing in the menu mode. Fixed bug with :view and infinite loop. Fixed zR. Fixed color schemes problems. Fixed vifm freezing. Fixed bug with bookmarks. Fixed bug with undolist. Fixed :rename. Fixed cursor position after leaving directory mounted with FUSE_MOUNT2. Fixed Ctrl-D, Ctrl-U, Ctrl-F and Ctrl-B (made them work like in vim). Fixed utf8 characters treating on Ctrl-W and similar. 0.6.2 to 0.6.3 (2011-07-20) Added another format for filetype (FUSE_MOUNT2). Added %CLEAR FUSE mount parameter (see vifmrc for details). Added %c and %C macros (current file of current and other directories, not selected file or files). Added :rename command. Added undo list (u, Ctrl-R and :undolist commands; 'undolevels' option). Added small FAQ. Added gA command (like ga, but forces update). Added support for whole line comments (that start with double quote symbol). Added 'sortnumbers' option (natural sort of (version) numbers in filenames). Added :dirs command (shows directory stack). Added 'savelocation' option (start vifm in the last visited directory) which is off be default thus returning old behaviour when vifm is started with no argument. Added 'followlinks' option. Added 'fusehome' option. Added 'history' option. Added dialog to ask user about backwards range in command. Added primitive logging. Added :TabVifm command in Vim plugin. Added 'confirm' option. Added gv command for visual mode. Added :restore command. Added !! and ! normal mode commands. Enter key in visual mode will leave it saving selection. Visual mode now remembers direction of the last selection. Let builtin keys be remapped. Don't cancel file renaming if user presses backspace and line is empty. Don't change directory on unsuccessful FUSE mount. Don't change cursor position of other directory after disabling quick view. Hide file group and owner names when they collide with message about filtered files. Don't show error message when trying to delete something from Trash directory. Don't replace escape sequences for :! and :!! commands. Use only executables for :!./ completion. Complete :pushd like :cd. Now location of panes is saved in ~/.vifm/vifminfo instead of ~/.vifm/vifmrc Don't filter anything when filter is set to an empty string. Show message when :delcommand is called with no arguments. Handle broken links. :edit command can accept arguments now. :map don't affect command line mode, but :map! does. Let ranges modify %f macro for user defined commands. Skip spaces between numbers in range and a command. Skip colons and spaces at the begging of cmdline command. Filter string is empty by default now. Made f and F work with wide characters. | after ! means pipe, not command separator. | after com means pipe, not command separator. Made option parser handle quotes. Mapped Ctrl-W, S to :split. Made :cd - work like in shell. Now filter regular expression can be enclosed in slashes. Don't add additional spaces before %f, %F, %c and %C macros. Don't try to :cd into directory if we cannot. Leave visual mode when leaving cmdline mode started from visual mode. , keys to move through history like in Vim. No more cycling in history. Don't loose input when going through history. Rename files in Trash (to avoid name conflicts). Don't terminate background processes on vifm exit. Remove files that are in the Trash on :empty command from all registers. Don't ignore Ctrl-Z. Don't clear screen on shellout. Handle Ctrl-U, Ctrl-D, Ctrl-E, Ctrl-Y, H, L, M, zz, zt, zb, g and G in the menus. Let %, f, F, ;, comma and ' be used as selectors in normal mode. %, zb, zt, zz, gg, G, Ctrl+e, Ctrl+y, Ctrl+d, /Ctrl+u, f, F, ;, comma and ' in visual mode. Replaced pauseme script with vifm-pause. Replace /home/login by ~ in the view title. Handle multiple files in Vim plugin. Improved user mappings (mapping on k in k and k). Made : in normal mode accept count. Update " register on each yank/delete operation. Fixed %F, accidentally broken in v0.6.2. Fixed segmentation fault on %f or %F expanding. Fixed bug with Ctrl+W, X and quick view. Fixed bug with yanking the ".." directory (it shouldn't be possible). Fixed %b macro (added space between file names). Fixed directory leaving after FUSE error (go to mounted file, not just up). Fixed bug with selection and segmentation fault. Fixed reaction on Ctrl+C for error messages from background processes. Fixed ga command (skip symbolic links). Fixed processing of files with percent sign in their name. Fixed memory leak in directory stack module. Fixed bug when options from startup file were not applied after startup. Fixed bugs with color schemes. Fixed problem when vifm hanged without terminal. Fixed bug about truncation of the last character with selection and :e %f. Fixed some bugs with files with single and double quotes in their names. Yes, again. Fixed bug with sorting symbolic links by name. Fixed bug with losing selection before running command from visual mode. Fixed bugs with registers and segmentation fault. Fixed :d command, it is an abbreviation to :delete now. Fixed bug with :n Fixed bug with selecting last file in the view in visual mode. Fixed but with :delcommand. Fixed redraw of fileinfo dialog. Fixed some bugs with filters. Fixed :cmap. Fixed expanding of %d and %D macros in commands (quotes, again). Fixed refreshing after some commands. Fixed commands like :'<'>!echo %f Fixed one number ranges for command line commands (:2d, :4y). Fixed bug with too small inner buffer for shell commands. Fixed skipped range number (it should mean current position). Fixed p (it should move files from trash, not copy them). Fixed bug with user commands and exclamation mark. Fixed running of commands from :cmdhistory menu. Fixed execution of FUSE mount commands from :file menu. Fixed zb in normal mode (when pos < number on lines in a view). Fixed map menus (added user commands). Fixed recursion in user mappings. Fixed opening files containing spaces in their names using Vim plugin. Fixed command line size when initial message doesn't fit in one line. 0.6.1 to 0.6.2 (2011-06-19) Added map menus (run :cmap, :vmap, :nmap commands without arguments). Added :cmdhistory command. Added 'fastrun' option. Added o and O keys for Visual mode (go to other end of selection). Added gv normal mode command. Added support for spaces and functional keys in mappings ( and - ). Added mimetype to fileinfo dialog. Added %b command macro. Made filetype menu editable. Restore SIGINT (Ctrl+C) default behaviour on shellout. Replace escape sequences in quick view output with ^foo. Give options if a file already exists in destination directory. Implemented :colorscheme command. Unmount all FUSE mounts on exit. Implemented :vifm command. More verbose --version (and -v) output. Added Ctrl+C key handling to error message dialog. Implemented :yank command. Made command completion work with marks. Use file command when GTK+ and libmagic are disabled. Made :cd %D work. Better error messages. Use ga command results to sort by size. Fixed '< and '> marks handling. Fixed :!./ completion. Fixed paths in config.c to work with non standard install prefix. Fixed a bug with ':!!echo foo'. Fixed some title related small bugs. Fixed terminal resize when error message visible. Fixed yy when compatibility mode is off. Fixed some bugs with files with quotes in their names. Fixed segmentation fault on FUSE mount. Fixed missed status bar messages. 0.6 to 0.6.1 (2011-06-11) Added :set command. Added caching for results of ga command. Don't reload pane on ctrl-c or escape, just clean selection. Store commands separated by | as one history item. Don't add duplicates into command history. Don't add commands from startup file and mappings to command history. Use ! with :quit or :x to discard configuration changes. Use checksum to determine if configuration file has been modified. :write! will write config even if no setting was changed. Always save pane locations on exit except on :q!, :quit! and ZQ. Don't switch active pane on Ctrl+W X. Fixed bug with sorting (using sort type of invalid pane). Bug Fix. Don't change selected items on terminal resize. Fixed a couple of segmentation faults on unsuccessful FUSE mount. Fixed n and N commands (used to repeat wrong search pattern). Fixed a bug with relative paths in arguments. 0.5 to 0.6 (2011-06-10) Added :wq command. Added ZZ and ZQ commands. Added Ctrl+D and Ctrl+U commands. Added zb, zt and zz commands. Added Ctrl+E and Ctrl+Y commands. Added Ctrl+W W, Ctrl+W O, Ctrl+W V and Ctrl+W X commands. Added i command to force file opening even for executables. Added IEC abbreviations. Added Ctrl+U, Ctrl+N, Ctrl+P, Ctrl+K, Ctrl+W, Meta+F and Meta+B in command line mode. Added Home and End keys support in command line mode. Added backward search (?). Added :map, :nmap, :cmap, :vmap commands. Added co (change owner), cg (change group) and cp (change permissions) commands. Added utf8 support. Added support for motions with d and y commands. Added startup file. Added f, F, ; and normal mode commands. Added group to stat line. Added custom viewers for files. Added D normal mode command (deletes files omitting trash directory). Added P normal mode command (moves yanked files). Added :write command (write config file) with alias :w. Added progress messages for putting and deleting. Added users command completion for :delcommand and :command. Added a, s and S file selectors. Added --enable-extended-keys and --enable-compatibility-mode configure options. Added Ctrl+o and Ctrl+i normal mode commands to traverse through history. Added ! and !! completion. Added support for multiple commands per line (with | as delimiter). Added ga command (calculate directory size). Added cW command (change only name of file and leave old extension). Added :pushd and :popd commands. Added detection of file handlers with GTK+ or libmagic and .desktop files (it works only for :file command). Added C command (clone file). Changed keys input handling. Changed force dot files appear at the beginning of file list. Changed command line length limit. Changed history of visited directories. Changed ascending/descending sort for all types of criteria. Changed behavior of filename cell in stat line (automatic expands now). Changed :cd completion to use only directories. Changed permissions dialog to work with selected files. Fixed segmentation fault caused by newwin. Fixed segmentation fault caused by bookmarks menu. Fixed now view is updated after several commands. Fixed bug with empty command line. Fixed file renaming. Fixed ranges handling. Fixed behavior of n and N commands for different search directions. Fixed filename completion. Fixed user commands completion. Fixed memory allocation for history. Fixed work with registers. Fixed bug with disappearing pane cursor (for example after shellout). Fixed bug when trailing slash wasn't cut from directory name on macro expanding. Fixed running executables with spaces in their names. 0.4 to 0.5 (2009-08-07) Changed the file size to a human friendly notation. Added ascending and descending sort types. Changed the way symbolic directories are handled. Fixed possible buffer overflow in colorschemes. Fixed transparency in colorschemes. Changed writing to vifmrc file to query user if they would like to overwrite a file that has been modified. Added filetype settings for mounting files with fuse-zip. Pauseme script was changed to report errors. Command line input now accepts wide characters and tab completion now cycles through all possible matches. ncursesw is now required to build vifm. 0.3a to 0.4 (2008-06-16) Color schemes added - required a change to the vifmrc file. UTF-8 support Quick view of current file with :view command. Hopefully fixed bug when starting vifm with a directory on the command line. Changed executable file to check for filetypes. If you have vifm set to not run executable files, it will now first check for a filetype setting and if present will use the program you set to open the file. If no filetype is set it will open the file in vi. Fixed delete command when dd in :com window. 0.3 to 0.3a (2005-08-17) Files with % in the name should work now. The symlinks in the tarball were replaced with the actual scripts. 0.2 to 0.3 (2005-07-18) Added error message for shell commands that are too long. Added :split, :only for one window view. Added :ls command for screen and %s macro. Added . to repeat last command. This currently only works with :commands. When deleting or putting files the process is backgrounded but it now waits for the process to return so that the changes show up quicker in the file lists. Removed the code to change the xterm title. User commands and the builtin commands now work with expansion. :! and :!! now work with tab expansion. Changed waitpid to a loop. Removed the timing thread. Redirected error messages of processes run in the background. :jobs command shows menu of backgrounded processes. :!! segfault fixed by Dmitry Suzdalev. Readline like expansion of files now escapes the filename. Fixed menu scrolling bug when the menu list was the same size as window rows. 0.1 to 0.2 (2003-05-06) File names are now escaped before going to the shell. The menus are now searchable with / or ? and basic commands :45 or :quit. The current position was changed to a solid bar instead of an arrow. Basic readline file completion. Command and pattern history. Colors are now configurable. cw can be used to rename files. Added a keys pressed window in the status bar to show the first d of dd, numbers for 12G or 33j movement commands, and first y of yy. User commands are now sorted in alphabetical order so that they may be used in the shortest form that does not match another command. The :command parsing was rewritten. The default action on an executable file was changed to a configurable option. The default is now to view the file instead of executing it. New :commands :locate command uses locate. :apropos command - shows list of man pages in menu window. :sync command - changes the other panel to the same directory as the current panel. New Key bindings Normal mode: M - move to the middle of the window. L - move to the bottom of the window. H - move to the top of the window. V - switch to visual mode. Y - yank the currently selected files. Visual mode: M - select from the current position to the middle of the list. L - select from the current position to the bottom of the list. H - select from the current position to the top of the list. The bookmarks code was rewritten. The automatic updating of the file lists was rewritten. ./COPYING0000600000175000017500000004325415051153244011000 0ustar korykory 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 Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 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) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. ./FAQ0000600000175000017500000001266715051153244010303 0ustar korykoryQ: Vifm fails to display some files which present on file system, is it a bug? A: Most likely reason for missing files are name filters. Use `:filter?` command to see their state or try pressing zR shortcut to disable all filters (undo that with zM). You got there probably by pressing zf on a file by accident at some point. In this case the file will be missing only in one of the panes. If you don't have :filter in your vifmrc and 'vifminfo' includes "state" value, such accidental filtering will persist across restarts of Vifm until you use :filter command or press a key like zO that resets permanent filter. -------------------------------------------------------------------------------- Q: Vifm doesn't run executables, what's wrong with it? A: Nothing. Just set 'runexec' option on. It's off by default. -------------------------------------------------------------------------------- Q: How can I use SSH with Vifm? A: Follow this steps: 1) Download and install sshfs 2) Register an extension that will be used for connections over SSH. The format is: :filetype extensions FUSE_MOUNT2|some_mount_command using %PARAM and %DESTINATION_DIR variables A sample line might look like this: :filetype *.ssh FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %PARAM and %DESTINATION_DIR are filled in by Vifm at runtime. %PARAM value is filled from the first line of file (whole line). You can also add %CLEAR if you want to clear screen before running FUSE program. 3) Create a file with ssh extension that contains connection parameters in the first line. A sample first line could be: root@127.0.0.1:/ -------------------------------------------------------------------------------- Q: How to browse FTP in Vifm? A: Use CurlFTPFS FUSE filesystem on *nix, which you can find here: http://curlftpfs.sourceforge.net/ And on Windows you need to use FTPDrive, which will mount an FTP remote as a drive for you. Get it here: http://www.killprog.com/fdrve.html -------------------------------------------------------------------------------- Q: How can I customize Vifm? A: There are several ways to do that: - using vifmrc file (run `:goto $MYVIFMRC` to find it) This file can contain any of Vifm commands. You probably would like to set mappings and options here. Vifm will never change this file (it's similar to ~/.vimrc). - changing color scheme (run `:cd $VIFM/colors` to find color schemes) You can change colors of different TUI elements in existing color schemes or add a new one. -------------------------------------------------------------------------------- Q: What operations can be undone/redone? A: List of currently supported operations: - rename - move - copy - non-permanent removal (i.e., deletion to trash) - change of permissions (chmod) - owner change - group change - creation of symbolic links with absolute or relative paths - creation of directories -------------------------------------------------------------------------------- Q: How to execute Vifm commands after using :! ? A: The only way to do this is using :execute command. Example: :execute ':!shell command' | some-other-command-here -------------------------------------------------------------------------------- Q: Is there a way to copy/paste without sending to trash first? A: Yes, to do that, one should yank (copy) files as usual, but use "P" key (not "p") to put (paste) them into current directory. -------------------------------------------------------------------------------- Q: Vifm expands macros in a wrong way in user defined commands with Vifm's commands (like in `:command com :mkdir ~/tmp/%c:e | cd ~/tmp/%c:e`). How to fix it? A: Just double percent sign (%%). Why? Because user commands containing Vifm's command-line commands are parsed twice. First time to replace %a macro, and second time during command execution. So doubled percent sign will be parsed with single % during first parse and a %x macro will be expanded during second parse. -------------------------------------------------------------------------------- Q: Vifm expands range in a wrong way in user defined commands (like in `:command com :%yank`) and shows "Invalid command name" message. How to fix it? A: See answer to the previous question. -------------------------------------------------------------------------------- Q: How to make shell aliases and functions work in Vifm when running them like ":!foo"? A: Here is a solution for bash, other shells should allow to do something similar. 1. Add the following lines to ~/.bashrc shopt -s expand_aliases unset BASH_ENV 2. Add the following line to ~/.vifm/vifmrc let $BASH_ENV = '~/.bashrc' After following the steps above aliases and functions should work the same way as if they were typed in interactive shell by user. However, they won't be completed by completion. -------------------------------------------------------------------------------- Q: How can I help Vifm? A: Just use it and report any problems, bugs or suggestions to its developers by email or in bug trackers. You can also send your configuration and colorscheme files to developers. They can be collected and published on Vifm's web-site. Examples of configuration files can also show how Vifm is typically used and suggest improvements of common use cases. ./configure0000700000175000017500000131066315051153266011660 0ustar korykory#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for vifm 0.14.3. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 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 ${ZSH_VERSION+y} && (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 e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; 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 # 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # 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'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 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 \${ZSH_VERSION+y} && (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 e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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 case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || 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 case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi ;; esac fi 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'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and xaizek@posteo.net $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi ;; esac 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=`printf "%s\n" "$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 || printf "%s\n" 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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$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 || printf "%s\n" 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 ' t clear :clear 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" || { printf "%s\n" "$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 } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. 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 # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated 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='vifm' PACKAGE_TARNAME='vifm' PACKAGE_VERSION='0.14.3' PACKAGE_STRING='vifm 0.14.3' PACKAGE_BUGREPORT='xaizek@posteo.net' PACKAGE_URL='https://vifm.info' ac_unique_file="src/vifm.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= enable_year2038=no ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS SANITIZERS_CFLAGS PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CXX PTHREAD_CC ax_pthread_config CPP SED DATA_SUFFIX IN_GIT_REPO GIT_PROG VIM_PROG PERL_PROG SED_PROG AWK_PROG COL_PROG MANGEN_PROG HAVE_FILE_PROG TESTS_CFLAGS host_os host_vendor host_cpu host build_os build_vendor build_cpu build am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__xargs_n am__rm_f_notfound AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir 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_silent_rules enable_dependency_tracking enable_largefile with_curses_name with_curses with_glib with_gtk with_libmagic with_X11 with_dyn_X11 enable_extended_keys enable_desktop_files enable_remote_cmds enable_developer enable_werror enable_coverage enable_build_timestamp with_sanitize enable_year2038 ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # 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 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=`printf "%s\n" "$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=`printf "%s\n" "$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=`printf "%s\n" "$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=`printf "%s\n" "$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. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$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" ;; *) printf "%s\n" "$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 || printf "%s\n" 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 vifm 0.14.3 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/vifm] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of vifm 0.14.3:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-largefile omit support for large files --disable-extended-keys disable extended keys (like arrows, home etc.). Without it will be no delay after pressing escape [default=enabled] --disable-desktop-files disable parsing of *.desktop files found on your system to get a list of programs associated with filetypes [default=enabled] --enable-remote-cmds enable remote command sending. [default=enabled] --enable-developer enables features of interest to developers [default=disabled] --enable-werror pass -Werror flag to compiler [default=disabled] --enable-coverage enables coverage information generation [default=disabled] --disable-build-timestamp disables embedding build-timestamp information into executable [default=enabled] --enable-year2038 support timestamps after 2038 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-curses-name=NAME name of curses library file [default=ncursesw] --with-curses=DIR where ncurses is installed --with-glib use GLib2 to determine mimetypes if available [default=yes] --with-gtk (obsolete name of --with-glib) use GLib2 to determine mimetypes if available [default=yes] --with-libmagic use libmagic to determine mimetypes if available [default=yes] --with-X11 use libX11 to determine terminal emulator title [default=yes] --with-dyn-X11 load libX11 dynamically [default=yes] --with-sanitize=basic|thread|leak enables sanitizers, "basic" means address and undefined sanitizers [default=] 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 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 . vifm home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$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 configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. 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 printf "%s\n" "$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 vifm configure 0.14.3 generated by GNU Autoconf 2.72 Copyright (C) 2023 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 conftest.beam 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\"" printf "%s\n" "$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 printf "%s\n" "$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 case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac 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_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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) eval "$3=yes" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # 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.beam 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\"" printf "%s\n" "$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 printf "%s\n" "$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 case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 (void); below. */ #include #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 (void); /* 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 (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR # ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_check_decl # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else case e in #( e) eval "$4=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member # 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\"" printf "%s\n" "$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 printf "%s\n" "$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 case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac 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 vifm $as_me 0.14.3, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "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=`printf "%s\n" "$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=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## 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_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$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 printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$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 printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (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; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* 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 do not provoke an error unfortunately, instead are silently treated as an "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 is necessary to write \x00 == 0 to get something that is 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 **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}/build-aux" # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; esac 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. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 printf "%s\n" "$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=`printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.18' # 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. 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 ;; esac fi if test ${ac_cv_path_install+y}; 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$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' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 printf %s "checking whether sleep supports fractional seconds... " >&6; } if test ${am_cv_sleep_fractional_seconds+y} then : printf %s "(cached) " >&6 else case e in #( e) if sleep 0.001 2>/dev/null then : am_cv_sleep_fractional_seconds=yes else case e in #( e) am_cv_sleep_fractional_seconds=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 printf %s "checking filesystem timestamp resolution... " >&6; } if test ${am_cv_filesystem_timestamp_resolution+y} then : printf %s "(cached) " >&6 else case e in #( e) # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `ls -t conftest.ts[12]` && { test "$*" != "X conftest.ts1 conftest.ts2" || test "$*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # 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". printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment. See 'config.log' for more details" "$LINENO" 5; } fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$2" = conftest.ts3 && test "$3" = conftest.ts2 && test "$4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } # This check should not be cached, as it may vary across builds of # different projects. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "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]*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } 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). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 printf "%s\n" "$am_build_env_is_sane" >&6; } if test "$am_build_env_is_sane" = no; then as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi # 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 test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 then : else case e in #( e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ;; esac 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=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 ('*'coreutils) '* | \ *'BusyBox '* | \ '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 ;; esac fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use plain mkdir -p, # in the hope it doesn't have the bugs of ancient mkdir. MKDIR_P='mkdir -p' fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 AM_DEFAULT_VERBOSITY=1 # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else case e in #( e) if printf "%s\n" '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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } AM_BACKSLASH='\' am__rm_f_notfound= if (rm -f && rm -fr && rm -rf) 2>/dev/null then : else case e in #( e) am__rm_f_notfound='""' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 printf %s "checking xargs -n works... " >&6; } if test ${am_cv_xargs_n_works+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3" then : am_cv_xargs_n_works=yes else case e in #( e) am_cv_xargs_n_works=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 printf "%s\n" "$am_cv_xargs_n_works" >&6; } if test "$am_cv_xargs_n_works" = yes then : am__xargs_n='xargs -n' else case e in #( e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' ;; esac fi 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='vifm' VERSION='0.14.3' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # 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 plaintar pax cpio none' # 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` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } if test x$am_uid = xunknown; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&5 printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&2;} elif test $am_uid -le $am_max_uid; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } _am_tools=none fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } if test x$gm_gid = xunknown; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&5 printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&2;} elif test $am_gid -le $am_max_gid; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } _am_tools=none fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 printf %s "checking how to create a ustar tar archive... " >&6; } # 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_ustar-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -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 ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -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_ustar}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 (cat conftest.dir/file) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if test ${am_cv_prog_tar_ustar+y} then : printf %s "(cached) " >&6 else case e in #( e) am_cv_prog_tar_ustar=$_am_tool ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi ac_config_headers="$ac_config_headers build-aux/config.h" printf "%s\n" "#define VERSION_NUM 1403" >>confdefs.h printf "%s\n" "#define PACKAGE_SYSCONF_DIR /**/" >>confdefs.h printf "%s\n" "#define PACKAGE_DATA_DIR /**/" >>confdefs.h printf "%s\n" "#define PACKAGE_SOURCE_DIR /**/" >>confdefs.h DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "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.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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. printf "%s\n" "$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 -version; 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\"" printf "%s\n" "$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 printf "%s\n" "$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 (void) { ; 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$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+y} && 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 case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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 case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$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 case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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; } ;; esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$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 (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$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 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$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 case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; 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 ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _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 conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac 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_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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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 # aligned with autoconf, so not including core; see bug#72225. rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$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 depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 thus: # 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test ${ac_cv_safe_to_define___extensions__+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_safe_to_define___extensions__=yes else case e in #( e) ac_cv_safe_to_define___extensions__=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } if test ${ac_cv_should_define__xopen_source+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_should_define__xopen_source=no if test $ac_cv_header_wchar_h = yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE 500 #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_should_define__xopen_source=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h if test $ac_cv_header_minix_config_h = yes then : MINIX=yes printf "%s\n" "#define _MINIX 1" >>confdefs.h printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h else case e in #( e) MINIX= ;; esac fi if test $ac_cv_safe_to_define___extensions__ = yes then : printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h fi if test $ac_cv_should_define__xopen_source = yes then : printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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. printf "%s\n" "$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 -version; 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\"" printf "%s\n" "$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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; 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 ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _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 conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac 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_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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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 # aligned with autoconf, so not including core; see bug#72225. rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$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 depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 thus: # 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$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 AM_DEFAULT_VERBOSITY=0 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 # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host" >&5 printf %s "checking host... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $host" >&5 printf "%s\n" "$host" >&6; } case "$host_os" in macos* | darwin*) OSX_HOST=1 ;; *) OSX_HOST= ;; esac TESTS_CFLAGS="$CFLAGS" printf "%s\n" "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h printf "%s\n" "#define UTF8PROC_STATIC 1" >>confdefs.h for ac_header in alloca.h do : ac_fn_c_check_header_compile "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default" if test "x$ac_cv_header_alloca_h" = xyes then : printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h fi done for ac_header in malloc.h do : ac_fn_c_check_header_compile "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" if test "x$ac_cv_header_malloc_h" = xyes then : printf "%s\n" "#define HAVE_MALLOC_H 1" >>confdefs.h printf "%s\n" "#define HAVE_MALLOC_H 1" >>confdefs.h fi done ac_fn_c_check_header_compile "$LINENO" "assert.h" "ac_cv_header_assert_h" "$ac_includes_default" if test "x$ac_cv_header_assert_h" = xyes then : else case e in #( e) as_fn_error $? "assert.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "$ac_includes_default" if test "x$ac_cv_header_ctype_h" = xyes then : else case e in #( e) as_fn_error $? "ctype.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default" if test "x$ac_cv_header_dirent_h" = xyes then : else case e in #( e) as_fn_error $? "dirent.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" if test "x$ac_cv_header_errno_h" = xyes then : else case e in #( e) as_fn_error $? "errno.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_fcntl_h" = xyes then : else case e in #( e) as_fn_error $? "fcntl.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default" if test "x$ac_cv_header_grp_h" = xyes then : else case e in #( e) as_fn_error $? "grp.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_inttypes_h" = xyes then : else case e in #( e) as_fn_error $? "inttypes.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes then : else case e in #( e) as_fn_error $? "limits.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = xyes then : else case e in #( e) as_fn_error $? "locale.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" if test "x$ac_cv_header_math_h" = xyes then : else case e in #( e) as_fn_error $? "math.h header not found." "$LINENO" 5 ;; esac fi for ac_header in mntent.h do : ac_fn_c_check_header_compile "$LINENO" "mntent.h" "ac_cv_header_mntent_h" "$ac_includes_default" if test "x$ac_cv_header_mntent_h" = xyes then : printf "%s\n" "#define HAVE_MNTENT_H 1" >>confdefs.h HAVE_MNTENT_H=1 fi done ac_fn_c_check_header_compile "$LINENO" "pwd.h" "ac_cv_header_pwd_h" "$ac_includes_default" if test "x$ac_cv_header_pwd_h" = xyes then : else case e in #( e) as_fn_error $? "pwd.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" if test "x$ac_cv_header_signal_h" = xyes then : else case e in #( e) as_fn_error $? "signal.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" if test "x$ac_cv_header_stdarg_h" = xyes then : else case e in #( e) as_fn_error $? "stdarg.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" if test "x$ac_cv_header_stddef_h" = xyes then : else case e in #( e) as_fn_error $? "stddef.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes then : else case e in #( e) as_fn_error $? "stdint.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" if test "x$ac_cv_header_stdio_h" = xyes then : else case e in #( e) as_fn_error $? "stdio.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes then : else case e in #( e) as_fn_error $? "stdlib.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes then : else case e in #( e) as_fn_error $? "string.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes then : else case e in #( e) as_fn_error $? "sys/ioctl.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" if test "x$ac_cv_header_sys_stat_h" = xyes then : else case e in #( e) as_fn_error $? "sys/stat.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes then : else case e in #( e) as_fn_error $? "sys/time.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" if test "x$ac_cv_header_sys_types_h" = xyes then : else case e in #( e) as_fn_error $? "sys/types.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" if test "x$ac_cv_header_sys_wait_h" = xyes then : else case e in #( e) as_fn_error $? "sys/wait.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes then : else case e in #( e) as_fn_error $? "termios.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" if test "x$ac_cv_header_time_h" = xyes then : else case e in #( e) as_fn_error $? "time.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes then : else case e in #( e) as_fn_error $? "unistd.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" if test "x$ac_cv_header_wchar_h" = xyes then : else case e in #( e) as_fn_error $? "wchar.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default" if test "x$ac_cv_header_wctype_h" = xyes then : else case e in #( e) as_fn_error $? "wctype.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "#if HAVE_SYS_PARAM_H # include #endif " if test "x$ac_cv_header_sys_sysmacros_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SYSMACROS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "#if HAVE_SYS_PARAM_H # include #endif " if test "x$ac_cv_header_sys_param_h" = xyes then : printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/user.h" "ac_cv_header_sys_user_h" "#if HAVE_SYS_PARAM_H # include #endif " if test "x$ac_cv_header_sys_user_h" = xyes then : printf "%s\n" "#define HAVE_SYS_USER_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "linux/binfmts.h" "ac_cv_header_linux_binfmts_h" "#if HAVE_SYS_PARAM_H # include #endif " if test "x$ac_cv_header_linux_binfmts_h" = xyes then : printf "%s\n" "#define HAVE_LINUX_BINFMTS_H 1" >>confdefs.h fi if test "$ac_cv_header_sys_user_h" = yes -a "$ac_cv_header_linux_binfmts_h" = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #ifndef PAGE_SIZE #define PAGE_SIZE sysconf(_SC_PAGESIZE) #endif int main() { (void)MAX_ARG_STRLEN; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : printf "%s\n" "#define HAVE_MAX_ARG_STRLEN 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" if test "x$ac_cv_type_uid_t" = xyes then : fi ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" if test "x$ac_cv_type_gid_t" = xyes then : fi ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes then : fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : fi ac_fn_c_check_type "$LINENO" "time_t" "ac_cv_type_time_t" "$ac_includes_default" if test "x$ac_cv_type_time_t" = xyes then : fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default" if test "x$ac_cv_type_uint64_t" = xyes then : fi ac_fn_c_check_type "$LINENO" "direntry_t" "ac_cv_type_direntry_t" "$ac_includes_default" if test "x$ac_cv_type_direntry_t" = xyes then : fi if test -n "$HAVE_MNTENT_H" ; then ac_fn_c_check_type "$LINENO" "mntent" "ac_cv_type_mntent" "$ac_includes_default" if test "x$ac_cv_type_mntent" = xyes then : fi else ac_fn_c_check_func "$LINENO" "getmntinfo" "ac_cv_func_getmntinfo" if test "x$ac_cv_func_getmntinfo" = xyes then : printf "%s\n" "#define HAVE_GETMNTINFO 1" >>confdefs.h fi fi ac_fn_c_check_type "$LINENO" "stat" "ac_cv_type_stat" "$ac_includes_default" if test "x$ac_cv_type_stat" = xyes then : fi ac_fn_c_check_type "$LINENO" "FILE" "ac_cv_type_FILE" "$ac_includes_default" if test "x$ac_cv_type_FILE" = xyes then : fi ac_fn_c_check_type "$LINENO" "wchar_t" "ac_cv_type_wchar_t" "$ac_includes_default" if test "x$ac_cv_type_wchar_t" = xyes then : fi ac_fn_c_check_func "$LINENO" "access" "ac_cv_func_access" if test "x$ac_cv_func_access" = xyes then : else case e in #( e) as_fn_error $? "access() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "atof" "ac_cv_func_atof" if test "x$ac_cv_func_atof" = xyes then : else case e in #( e) as_fn_error $? "atof() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "atoi" "ac_cv_func_atoi" if test "x$ac_cv_func_atoi" = xyes then : else case e in #( e) as_fn_error $? "atoi() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "calloc" "ac_cv_func_calloc" if test "x$ac_cv_func_calloc" = xyes then : else case e in #( e) as_fn_error $? "calloc() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "chdir" "ac_cv_func_chdir" if test "x$ac_cv_func_chdir" = xyes then : else case e in #( e) as_fn_error $? "chdir() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "close" "ac_cv_func_close" if test "x$ac_cv_func_close" = xyes then : else case e in #( e) as_fn_error $? "close() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir" if test "x$ac_cv_func_closedir" = xyes then : else case e in #( e) as_fn_error $? "closedir() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "dup" "ac_cv_func_dup" if test "x$ac_cv_func_dup" = xyes then : else case e in #( e) as_fn_error $? "dup() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2" if test "x$ac_cv_func_dup2" = xyes then : else case e in #( e) as_fn_error $? "dup2() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "execve" "ac_cv_func_execve" if test "x$ac_cv_func_execve" = xyes then : else case e in #( e) as_fn_error $? "execve() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "execvp" "ac_cv_func_execvp" if test "x$ac_cv_func_execvp" = xyes then : else case e in #( e) as_fn_error $? "execvp() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "exit" "ac_cv_func_exit" if test "x$ac_cv_func_exit" = xyes then : else case e in #( e) as_fn_error $? "exit() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync" if test "x$ac_cv_func_fdatasync" = xyes then : printf "%s\n" "#define HAVE_FDATASYNC 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fclose" "ac_cv_func_fclose" if test "x$ac_cv_func_fclose" = xyes then : else case e in #( e) as_fn_error $? "fclose() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "fdopen" "ac_cv_func_fdopen" if test "x$ac_cv_func_fdopen" = xyes then : else case e in #( e) as_fn_error $? "fdopen() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "feof" "ac_cv_func_feof" if test "x$ac_cv_func_feof" = xyes then : else case e in #( e) as_fn_error $? "feof() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "fgetc" "ac_cv_func_fgetc" if test "x$ac_cv_func_fgetc" = xyes then : else case e in #( e) as_fn_error $? "fgetc() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "fgets" "ac_cv_func_fgets" if test "x$ac_cv_func_fgets" = xyes then : else case e in #( e) as_fn_error $? "fgets() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "fork" "ac_cv_func_fork" if test "x$ac_cv_func_fork" = xyes then : else case e in #( e) as_fn_error $? "fork() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "fprintf" "ac_cv_func_fprintf" if test "x$ac_cv_func_fprintf" = xyes then : else case e in #( e) as_fn_error $? "fprintf() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "fputc" "ac_cv_func_fputc" if test "x$ac_cv_func_fputc" = xyes then : else case e in #( e) as_fn_error $? "fputc() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "fputs" "ac_cv_func_fputs" if test "x$ac_cv_func_fputs" = xyes then : else case e in #( e) as_fn_error $? "fputs() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "free" "ac_cv_func_free" if test "x$ac_cv_func_free" = xyes then : else case e in #( e) as_fn_error $? "free() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "fwrite" "ac_cv_func_fwrite" if test "x$ac_cv_func_fwrite" = xyes then : else case e in #( e) as_fn_error $? "fwrite() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" if test "x$ac_cv_func_getcwd" = xyes then : else case e in #( e) as_fn_error $? "getcwd() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getenv" "ac_cv_func_getenv" if test "x$ac_cv_func_getenv" = xyes then : else case e in #( e) as_fn_error $? "getenv() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "geteuid" "ac_cv_func_geteuid" if test "x$ac_cv_func_geteuid" = xyes then : else case e in #( e) as_fn_error $? "geteuid() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getgrent" "ac_cv_func_getgrent" if test "x$ac_cv_func_getgrent" = xyes then : else case e in #( e) as_fn_error $? "getgrent() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getgrgid" "ac_cv_func_getgrgid" if test "x$ac_cv_func_getgrgid" = xyes then : else case e in #( e) as_fn_error $? "getgrgid() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getgrgid_r" "ac_cv_func_getgrgid_r" if test "x$ac_cv_func_getgrgid_r" = xyes then : else case e in #( e) as_fn_error $? "getgrgid_r() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getgrnam" "ac_cv_func_getgrnam" if test "x$ac_cv_func_getgrnam" = xyes then : else case e in #( e) as_fn_error $? "getgrnam() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getpid" "ac_cv_func_getpid" if test "x$ac_cv_func_getpid" = xyes then : else case e in #( e) as_fn_error $? "getpid() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getppid" "ac_cv_func_getppid" if test "x$ac_cv_func_getppid" = xyes then : else case e in #( e) as_fn_error $? "getppid() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getpwent" "ac_cv_func_getpwent" if test "x$ac_cv_func_getpwent" = xyes then : else case e in #( e) as_fn_error $? "getpwent() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getpwnam" "ac_cv_func_getpwnam" if test "x$ac_cv_func_getpwnam" = xyes then : else case e in #( e) as_fn_error $? "getpwnam() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getpwuid" "ac_cv_func_getpwuid" if test "x$ac_cv_func_getpwuid" = xyes then : else case e in #( e) as_fn_error $? "getpwuid() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getpwuid_r" "ac_cv_func_getpwuid_r" if test "x$ac_cv_func_getpwuid_r" = xyes then : else case e in #( e) as_fn_error $? "getpwuid_r() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "ioctl" "ac_cv_func_ioctl" if test "x$ac_cv_func_ioctl" = xyes then : else case e in #( e) as_fn_error $? "ioctl() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "iswalnum" "ac_cv_func_iswalnum" if test "x$ac_cv_func_iswalnum" = xyes then : else case e in #( e) as_fn_error $? "iswalnum() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "iswdigit" "ac_cv_func_iswdigit" if test "x$ac_cv_func_iswdigit" = xyes then : else case e in #( e) as_fn_error $? "iswdigit() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "iswprint" "ac_cv_func_iswprint" if test "x$ac_cv_func_iswprint" = xyes then : else case e in #( e) as_fn_error $? "iswprint() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "iswspace" "ac_cv_func_iswspace" if test "x$ac_cv_func_iswspace" = xyes then : else case e in #( e) as_fn_error $? "iswspace() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "iswupper" "ac_cv_func_iswupper" if test "x$ac_cv_func_iswupper" = xyes then : else case e in #( e) as_fn_error $? "iswupper() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "kill" "ac_cv_func_kill" if test "x$ac_cv_func_kill" = xyes then : else case e in #( e) as_fn_error $? "kill() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "localtime" "ac_cv_func_localtime" if test "x$ac_cv_func_localtime" = xyes then : else case e in #( e) as_fn_error $? "localtime() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "malloc" "ac_cv_func_malloc" if test "x$ac_cv_func_malloc" = xyes then : else case e in #( e) as_fn_error $? "malloc() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "mbstowcs" "ac_cv_func_mbstowcs" if test "x$ac_cv_func_mbstowcs" = xyes then : else case e in #( e) as_fn_error $? "mbstowcs() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "memcmp" "ac_cv_func_memcmp" if test "x$ac_cv_func_memcmp" = xyes then : else case e in #( e) as_fn_error $? "memcmp() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "memcpy" "ac_cv_func_memcpy" if test "x$ac_cv_func_memcpy" = xyes then : else case e in #( e) as_fn_error $? "memcpy() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "memccpy" "ac_cv_func_memccpy" if test "x$ac_cv_func_memccpy" = xyes then : else case e in #( e) as_fn_error $? "memccpy() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" if test "x$ac_cv_func_memmove" = xyes then : else case e in #( e) as_fn_error $? "memmove() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" if test "x$ac_cv_func_memset" = xyes then : else case e in #( e) as_fn_error $? "memset() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" if test "x$ac_cv_func_mkdir" = xyes then : else case e in #( e) as_fn_error $? "mkdir() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" if test "x$ac_cv_func_mkstemp" = xyes then : else case e in #( e) as_fn_error $? "mkstemp() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir" if test "x$ac_cv_func_opendir" = xyes then : else case e in #( e) as_fn_error $? "opendir() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pathconf" "ac_cv_func_pathconf" if test "x$ac_cv_func_pathconf" = xyes then : else case e in #( e) as_fn_error $? "pathconf() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pause" "ac_cv_func_pause" if test "x$ac_cv_func_pause" = xyes then : else case e in #( e) as_fn_error $? "pause() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pclose" "ac_cv_func_pclose" if test "x$ac_cv_func_pclose" = xyes then : else case e in #( e) as_fn_error $? "pclose() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "perror" "ac_cv_func_perror" if test "x$ac_cv_func_perror" = xyes then : else case e in #( e) as_fn_error $? "perror() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pipe" "ac_cv_func_pipe" if test "x$ac_cv_func_pipe" = xyes then : else case e in #( e) as_fn_error $? "pipe() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "popen" "ac_cv_func_popen" if test "x$ac_cv_func_popen" = xyes then : else case e in #( e) as_fn_error $? "popen() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "printf" "ac_cv_func_printf" if test "x$ac_cv_func_printf" = xyes then : else case e in #( e) as_fn_error $? "printf() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "puts" "ac_cv_func_puts" if test "x$ac_cv_func_puts" = xyes then : else case e in #( e) as_fn_error $? "puts() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "qsort" "ac_cv_func_qsort" if test "x$ac_cv_func_qsort" = xyes then : else case e in #( e) as_fn_error $? "qsort() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "rand" "ac_cv_func_rand" if test "x$ac_cv_func_rand" = xyes then : else case e in #( e) as_fn_error $? "rand() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "read" "ac_cv_func_read" if test "x$ac_cv_func_read" = xyes then : else case e in #( e) as_fn_error $? "read() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "readlink" "ac_cv_func_readlink" if test "x$ac_cv_func_readlink" = xyes then : else case e in #( e) as_fn_error $? "readlink() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "realloc" "ac_cv_func_realloc" if test "x$ac_cv_func_realloc" = xyes then : else case e in #( e) as_fn_error $? "realloc() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" if test "x$ac_cv_func_realpath" = xyes then : else case e in #( e) as_fn_error $? "realpath() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "rename" "ac_cv_func_rename" if test "x$ac_cv_func_rename" = xyes then : else case e in #( e) as_fn_error $? "rename() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "rmdir" "ac_cv_func_rmdir" if test "x$ac_cv_func_rmdir" = xyes then : else case e in #( e) as_fn_error $? "rmdir() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" if test "x$ac_cv_func_select" = xyes then : else case e in #( e) as_fn_error $? "select() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv" if test "x$ac_cv_func_setenv" = xyes then : else case e in #( e) as_fn_error $? "setenv() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "setgrent" "ac_cv_func_setgrent" if test "x$ac_cv_func_setgrent" = xyes then : else case e in #( e) as_fn_error $? "setgrent() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" if test "x$ac_cv_func_setlocale" = xyes then : else case e in #( e) as_fn_error $? "setlocale() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "setpgid" "ac_cv_func_setpgid" if test "x$ac_cv_func_setpgid" = xyes then : else case e in #( e) as_fn_error $? "setpgid() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "setpwent" "ac_cv_func_setpwent" if test "x$ac_cv_func_setpwent" = xyes then : else case e in #( e) as_fn_error $? "setpwent() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "setsid" "ac_cv_func_setsid" if test "x$ac_cv_func_setsid" = xyes then : else case e in #( e) as_fn_error $? "setsid() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "setvbuf" "ac_cv_func_setvbuf" if test "x$ac_cv_func_setvbuf" = xyes then : else case e in #( e) as_fn_error $? "setvbuf() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction" if test "x$ac_cv_func_sigaction" = xyes then : else case e in #( e) as_fn_error $? "sigaction() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "sigaddset" "ac_cv_func_sigaddset" if test "x$ac_cv_func_sigaddset" = xyes then : else case e in #( e) as_fn_error $? "sigaddset() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "sigemptyset" "ac_cv_func_sigemptyset" if test "x$ac_cv_func_sigemptyset" = xyes then : else case e in #( e) as_fn_error $? "sigemptyset() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "signal" "ac_cv_func_signal" if test "x$ac_cv_func_signal" = xyes then : else case e in #( e) as_fn_error $? "signal() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = xyes then : else case e in #( e) as_fn_error $? "snprintf() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "sprintf" "ac_cv_func_sprintf" if test "x$ac_cv_func_sprintf" = xyes then : else case e in #( e) as_fn_error $? "sprintf() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "srand" "ac_cv_func_srand" if test "x$ac_cv_func_srand" = xyes then : else case e in #( e) as_fn_error $? "srand() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes then : else case e in #( e) as_fn_error $? "strcasecmp() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" if test "x$ac_cv_func_strcasestr" = xyes then : printf "%s\n" "#define HAVE_STRCASESTR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strcat" "ac_cv_func_strcat" if test "x$ac_cv_func_strcat" = xyes then : else case e in #( e) as_fn_error $? "strcat() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strchr" "ac_cv_func_strchr" if test "x$ac_cv_func_strchr" = xyes then : else case e in #( e) as_fn_error $? "strchr() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strcmp" "ac_cv_func_strcmp" if test "x$ac_cv_func_strcmp" = xyes then : else case e in #( e) as_fn_error $? "strcmp() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strcpy" "ac_cv_func_strcpy" if test "x$ac_cv_func_strcpy" = xyes then : else case e in #( e) as_fn_error $? "strcpy() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes then : else case e in #( e) as_fn_error $? "strdup() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes then : else case e in #( e) as_fn_error $? "strerror() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" if test "x$ac_cv_func_strftime" = xyes then : else case e in #( e) as_fn_error $? "strftime() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strlen" "ac_cv_func_strlen" if test "x$ac_cv_func_strlen" = xyes then : else case e in #( e) as_fn_error $? "strlen() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" if test "x$ac_cv_func_strncasecmp" = xyes then : else case e in #( e) as_fn_error $? "strncasecmp() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strncat" "ac_cv_func_strncat" if test "x$ac_cv_func_strncat" = xyes then : else case e in #( e) as_fn_error $? "strncat() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strncmp" "ac_cv_func_strncmp" if test "x$ac_cv_func_strncmp" = xyes then : else case e in #( e) as_fn_error $? "strncmp() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strncpy" "ac_cv_func_strncpy" if test "x$ac_cv_func_strncpy" = xyes then : else case e in #( e) as_fn_error $? "strncpy() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strpbrk" "ac_cv_func_strpbrk" if test "x$ac_cv_func_strpbrk" = xyes then : else case e in #( e) as_fn_error $? "strpbrk() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strrchr" "ac_cv_func_strrchr" if test "x$ac_cv_func_strrchr" = xyes then : else case e in #( e) as_fn_error $? "strrchr() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strspn" "ac_cv_func_strspn" if test "x$ac_cv_func_strspn" = xyes then : else case e in #( e) as_fn_error $? "strspn() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" if test "x$ac_cv_func_strstr" = xyes then : else case e in #( e) as_fn_error $? "strstr() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r" if test "x$ac_cv_func_strtok_r" = xyes then : else case e in #( e) as_fn_error $? "strtok_r() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" if test "x$ac_cv_func_strtol" = xyes then : else case e in #( e) as_fn_error $? "strtol() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll" if test "x$ac_cv_func_strtoll" = xyes then : else case e in #( e) as_fn_error $? "strtoll() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "strverscmp" "ac_cv_func_strverscmp" if test "x$ac_cv_func_strverscmp" = xyes then : printf "%s\n" "#define HAVE_STRVERSCMP_FUNC 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" if test "x$ac_cv_func_sysconf" = xyes then : else case e in #( e) as_fn_error $? "sysconf() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "time" "ac_cv_func_time" if test "x$ac_cv_func_time" = xyes then : else case e in #( e) as_fn_error $? "time() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "tolower" "ac_cv_func_tolower" if test "x$ac_cv_func_tolower" = xyes then : else case e in #( e) as_fn_error $? "tolower() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "toupper" "ac_cv_func_toupper" if test "x$ac_cv_func_toupper" = xyes then : else case e in #( e) as_fn_error $? "toupper() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "towupper" "ac_cv_func_towupper" if test "x$ac_cv_func_towupper" = xyes then : else case e in #( e) as_fn_error $? "towupper() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "ungetc" "ac_cv_func_ungetc" if test "x$ac_cv_func_ungetc" = xyes then : else case e in #( e) as_fn_error $? "ungetc() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "unlink" "ac_cv_func_unlink" if test "x$ac_cv_func_unlink" = xyes then : else case e in #( e) as_fn_error $? "unlink() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" if test "x$ac_cv_func_unsetenv" = xyes then : else case e in #( e) as_fn_error $? "unsetenv() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "utimes" "ac_cv_func_utimes" if test "x$ac_cv_func_utimes" = xyes then : else case e in #( e) as_fn_error $? "utimes() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "vfprintf" "ac_cv_func_vfprintf" if test "x$ac_cv_func_vfprintf" = xyes then : else case e in #( e) as_fn_error $? "vfprintf() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" if test "x$ac_cv_func_vsnprintf" = xyes then : else case e in #( e) as_fn_error $? "vsnprintf() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "vswprintf" "ac_cv_func_vswprintf" if test "x$ac_cv_func_vswprintf" = xyes then : else case e in #( e) as_fn_error $? "vswprintf() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" if test "x$ac_cv_func_waitpid" = xyes then : else case e in #( e) as_fn_error $? "waitpid() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wcscat" "ac_cv_func_wcscat" if test "x$ac_cv_func_wcscat" = xyes then : else case e in #( e) as_fn_error $? "wcscat() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wcscmp" "ac_cv_func_wcscmp" if test "x$ac_cv_func_wcscmp" = xyes then : else case e in #( e) as_fn_error $? "wcscmp() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wcscpy" "ac_cv_func_wcscpy" if test "x$ac_cv_func_wcscpy" = xyes then : else case e in #( e) as_fn_error $? "wcscpy() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wcslen" "ac_cv_func_wcslen" if test "x$ac_cv_func_wcslen" = xyes then : else case e in #( e) as_fn_error $? "wcslen() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wcsncmp" "ac_cv_func_wcsncmp" if test "x$ac_cv_func_wcsncmp" = xyes then : else case e in #( e) as_fn_error $? "wcsncmp() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wcsncpy" "ac_cv_func_wcsncpy" if test "x$ac_cv_func_wcsncpy" = xyes then : else case e in #( e) as_fn_error $? "wcsncpy() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wcstof" "ac_cv_func_wcstof" if test "x$ac_cv_func_wcstof" = xyes then : else case e in #( e) as_fn_error $? "wcstof() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wcstol" "ac_cv_func_wcstol" if test "x$ac_cv_func_wcstol" = xyes then : else case e in #( e) as_fn_error $? "wcstol() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wcstombs" "ac_cv_func_wcstombs" if test "x$ac_cv_func_wcstombs" = xyes then : else case e in #( e) as_fn_error $? "wcstombs() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wcswidth" "ac_cv_func_wcswidth" if test "x$ac_cv_func_wcswidth" = xyes then : else case e in #( e) as_fn_error $? "wcswidth() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wcwidth" "ac_cv_func_wcwidth" if test "x$ac_cv_func_wcwidth" = xyes then : else case e in #( e) as_fn_error $? "wcwidth() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "futimens" "ac_cv_func_futimens" if test "x$ac_cv_func_futimens" = xyes then : printf "%s\n" "#define HAVE_FUTIMENS 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random" if test "x$ac_cv_func_random" = xyes then : printf "%s\n" "#define HAVE_RANDOM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "srandom" "ac_cv_func_srandom" if test "x$ac_cv_func_srandom" = xyes then : printf "%s\n" "#define HAVE_SRANDOM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "reallocarray" "ac_cv_func_reallocarray" if test "x$ac_cv_func_reallocarray" = xyes then : printf "%s\n" "#define HAVE_REALLOCARRAY 1" >>confdefs.h fi if test -n "$HAVE_MNTENT_H" ; then ac_fn_c_check_func "$LINENO" "endmntent" "ac_cv_func_endmntent" if test "x$ac_cv_func_endmntent" = xyes then : else case e in #( e) as_fn_error $? "endmntent() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getmntent" "ac_cv_func_getmntent" if test "x$ac_cv_func_getmntent" = xyes then : else case e in #( e) as_fn_error $? "getmntent() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "setmntent" "ac_cv_func_setmntent" if test "x$ac_cv_func_setmntent" = xyes then : else case e in #( e) as_fn_error $? "setmntent() function not found." "$LINENO" 5 ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" # This test program should *not* compile successfully. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { (void) strchr; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the # off chance that they somehow elicit warnings. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include extern void ac_decl (int, char *); int main (void) { (void) ac_decl (0, (char *) 0); (void) ac_decl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' else case e in #( e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; esac fi break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; esac ac_fn_check_decl "$LINENO" "_PC_CASE_SENSITIVE" "ac_cv_have_decl__PC_CASE_SENSITIVE" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl__PC_CASE_SENSITIVE" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL__PC_CASE_SENSITIVE $ac_have_decl" >>confdefs.h ac_fn_c_check_header_compile "$LINENO" "regex.h" "ac_cv_header_regex_h" "$ac_includes_default" if test "x$ac_cv_header_regex_h" = xyes then : else case e in #( e) as_fn_error $? "regex.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "regcomp" "ac_cv_func_regcomp" if test "x$ac_cv_func_regcomp" = xyes then : else case e in #( e) as_fn_error $? "regcomp() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "regerror" "ac_cv_func_regerror" if test "x$ac_cv_func_regerror" = xyes then : else case e in #( e) as_fn_error $? "regerror() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "regexec" "ac_cv_func_regexec" if test "x$ac_cv_func_regexec" = xyes then : else case e in #( e) as_fn_error $? "regexec() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "regfree" "ac_cv_func_regfree" if test "x$ac_cv_func_regfree" = xyes then : else case e in #( e) as_fn_error $? "regfree() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_type "$LINENO" "regex_t" "ac_cv_type_regex_t" "#include " if test "x$ac_cv_type_regex_t" = xyes then : else case e in #( e) as_fn_error $? "regex_t type not found in regex.h" "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "REG_EXTENDED" "ac_cv_have_decl_REG_EXTENDED" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_REG_EXTENDED" = xyes then : else case e in #( e) as_fn_error $? "REG_EXTENDED not found in regex.h" "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "REG_ICASE" "ac_cv_have_decl_REG_ICASE" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_REG_ICASE" = xyes then : else case e in #( e) as_fn_error $? "REG_ICASE not found in regex.h" "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "REG_NOMATCH" "ac_cv_have_decl_REG_NOMATCH" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_REG_NOMATCH" = xyes then : else case e in #( e) as_fn_error $? "REG_NOMATCH not found in regex.h" "$LINENO" 5 ;; esac fi ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" " #include #include #include " if test "x$ac_cv_member_struct_stat_st_mtim" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_MTIM 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct dirent" "d_type" "ac_cv_member_struct_dirent_d_type" " #include " if test "x$ac_cv_member_struct_dirent_d_type" = xyes then : printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h fi # Check whether --enable-largefile was given. if test ${enable_largefile+y} then : enableval=$enable_largefile; fi if test "$enable_largefile,$enable_year2038" != no,no then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 printf %s "checking for $CC option to enable large file support... " >&6; } if test ${ac_cv_sys_largefile_opts+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CC="$CC" ac_opt_found=no for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do if test x"$ac_opt" != x"none needed" then : CC="$ac_save_CC $ac_opt" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef FTYPE # define FTYPE off_t #endif /* Check that FTYPE can represent 2**63 - 1 correctly. We can't simply define LARGE_FTYPE to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 && LARGE_FTYPE % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_opt" = x"none needed" then : # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. CC="$CC -DFTYPE=ino_t" if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) CC="$CC -D_FILE_OFFSET_BITS=64" if ac_fn_c_try_compile "$LINENO" then : ac_opt='-D_FILE_OFFSET_BITS=64' fi rm -f core conftest.err conftest.$ac_objext conftest.beam ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam fi ac_cv_sys_largefile_opts=$ac_opt ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test $ac_opt_found = no || break done CC="$ac_save_CC" test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } ac_have_largefile=yes case $ac_cv_sys_largefile_opts in #( "none needed") : ;; #( "supported through gnulib") : ;; #( "support not detected") : ac_have_largefile=no ;; #( "-D_FILE_OFFSET_BITS=64") : printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h ;; #( "-D_LARGE_FILES=1") : printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h ;; #( "-n32") : CC="$CC -n32" ;; #( *) : as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; esac if test "$enable_year2038" != no then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 printf %s "checking for $CC option for timestamps after 2038... " >&6; } if test ${ac_cv_sys_year2038_opts+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CPPFLAGS="$CPPFLAGS" ac_opt_found=no for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do if test x"$ac_opt" != x"none needed" then : CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that time_t can represent 2**32 - 1 correctly. */ #define LARGE_TIME_T \\ ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 && LARGE_TIME_T % 65537 == 0) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_year2038_opts="$ac_opt" ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test $ac_opt_found = no || break done CPPFLAGS="$ac_save_CPPFLAGS" test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } ac_have_year2038=yes case $ac_cv_sys_year2038_opts in #( "none needed") : ;; #( "support not detected") : ac_have_year2038=no ;; #( "-D_TIME_BITS=64") : printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h ;; #( "-D__MINGW_USE_VC2005_COMPAT") : printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h ;; #( "-U_USE_32_BIT_TIME_T"*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It will stop working after mid-January 2038. Remove _USE_32BIT_TIME_T from the compiler flags. See 'config.log' for more details" "$LINENO" 5; } ;; #( *) : as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declarations of fseeko and ftello" >&5 printf %s "checking for declarations of fseeko and ftello... " >&6; } if test ${ac_cv_func_fseeko_ftello+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __hpux && !defined _LARGEFILE_SOURCE # include # if LONG_MAX >> 31 == 0 # error "32-bit HP-UX 11/ia64 needs _LARGEFILE_SOURCE for fseeko in C++" # endif #endif #include /* for off_t */ #include int main (void) { int (*fp1) (FILE *, off_t, int) = fseeko; off_t (*fp2) (FILE *) = ftello; return fseeko (stdin, 0, 0) && fp1 (stdin, 0, 0) && ftello (stdin) >= 0 && fp2 (stdin) >= 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_func_fseeko_ftello=yes else case e in #( e) ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE=1" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __hpux && !defined _LARGEFILE_SOURCE # include # if LONG_MAX >> 31 == 0 # error "32-bit HP-UX 11/ia64 needs _LARGEFILE_SOURCE for fseeko in C++" # endif #endif #include /* for off_t */ #include int main (void) { int (*fp1) (FILE *, off_t, int) = fseeko; off_t (*fp2) (FILE *) = ftello; return fseeko (stdin, 0, 0) && fp1 (stdin, 0, 0) && ftello (stdin) >= 0 && fp2 (stdin) >= 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_func_fseeko_ftello="need _LARGEFILE_SOURCE" else case e in #( e) ac_cv_func_fseeko_ftello=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fseeko_ftello" >&5 printf "%s\n" "$ac_cv_func_fseeko_ftello" >&6; } if test "$ac_cv_func_fseeko_ftello" != no then : printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h fi if test "$ac_cv_func_fseeko_ftello" = "need _LARGEFILE_SOURCE" then : printf "%s\n" "#define _LARGEFILE_SOURCE 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : else case e in #( e) printf "%s\n" "#define off_t long int" >>confdefs.h ;; esac fi if test "$ac_cv_member_struct_stat_st_mtim" = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main() { struct stat st; struct timespec ts[2] = { st.st_atim, st.st_mtim }; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : printf "%s\n" "#define HAVE_CONSISTENT_TIMESPEC 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # Extract the first word of "file", so it can be a program name with args. set dummy file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_HAVE_FILE_PROG+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$HAVE_FILE_PROG"; then ac_cv_prog_HAVE_FILE_PROG="$HAVE_FILE_PROG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_FILE_PROG="1" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi HAVE_FILE_PROG=$ac_cv_prog_HAVE_FILE_PROG if test -n "$HAVE_FILE_PROG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HAVE_FILE_PROG" >&5 printf "%s\n" "$HAVE_FILE_PROG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x${HAVE_FILE_PROG}" = 'x1' ; then printf "%s\n" "#define HAVE_FILE_PROG 1" >>confdefs.h fi for ac_prog in groff mandoc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANGEN_PROG+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$MANGEN_PROG"; then ac_cv_prog_MANGEN_PROG="$MANGEN_PROG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_MANGEN_PROG="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi MANGEN_PROG=$ac_cv_prog_MANGEN_PROG if test -n "$MANGEN_PROG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANGEN_PROG" >&5 printf "%s\n" "$MANGEN_PROG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$MANGEN_PROG" && break done # Extract the first word of "col", so it can be a program name with args. set dummy col; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_COL_PROG+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$COL_PROG"; then ac_cv_prog_COL_PROG="$COL_PROG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_COL_PROG="col" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi COL_PROG=$ac_cv_prog_COL_PROG if test -n "$COL_PROG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $COL_PROG" >&5 printf "%s\n" "$COL_PROG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "awk", so it can be a program name with args. set dummy awk; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK_PROG+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AWK_PROG"; then ac_cv_prog_AWK_PROG="$AWK_PROG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_PROG="awk" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AWK_PROG=$ac_cv_prog_AWK_PROG if test -n "$AWK_PROG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK_PROG" >&5 printf "%s\n" "$AWK_PROG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_SED_PROG+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$SED_PROG"; then ac_cv_prog_SED_PROG="$SED_PROG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_SED_PROG="sed" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi SED_PROG=$ac_cv_prog_SED_PROG if test -n "$SED_PROG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SED_PROG" >&5 printf "%s\n" "$SED_PROG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PERL_PROG+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$PERL_PROG"; then ac_cv_prog_PERL_PROG="$PERL_PROG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_PERL_PROG="perl" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi PERL_PROG=$ac_cv_prog_PERL_PROG if test -n "$PERL_PROG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL_PROG" >&5 printf "%s\n" "$PERL_PROG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "vim", so it can be a program name with args. set dummy vim; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_VIM_PROG+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$VIM_PROG"; then ac_cv_prog_VIM_PROG="$VIM_PROG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_VIM_PROG="vim" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi VIM_PROG=$ac_cv_prog_VIM_PROG if test -n "$VIM_PROG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $VIM_PROG" >&5 printf "%s\n" "$VIM_PROG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x${PERL_PROG}${VIM_PROG}" == 'x'; then as_fn_error $? "Either perl or Vim is necessary to generate tags for documentation in Vim's format." "$LINENO" 5 fi # Extract the first word of "git", so it can be a program name with args. set dummy git; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_GIT_PROG+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$GIT_PROG"; then ac_cv_prog_GIT_PROG="$GIT_PROG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_GIT_PROG="git" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi GIT_PROG=$ac_cv_prog_GIT_PROG if test -n "$GIT_PROG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GIT_PROG" >&5 printf "%s\n" "$GIT_PROG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x${GIT_PROG}" != 'x' -a -d .git/; then IN_GIT_REPO=1 fi if test "x${sysconfdir}" = 'x${prefix}/etc'; then if test "x${prefix}" = "xNONE"; then printf "%s\n" "#define PACKAGE_SYSCONF_DIR \"${ac_default_prefix}/etc/${PACKAGE}\"" >>confdefs.h else printf "%s\n" "#define PACKAGE_SYSCONF_DIR \"${prefix}/etc/${PACKAGE}\"" >>confdefs.h fi else printf "%s\n" "#define PACKAGE_SYSCONF_DIR \"${sysconfdir}/${PACKAGE}\"" >>confdefs.h fi if test "x${datadir}" = 'x${prefix}/share'; then if test "x${prefix}" = "xNONE"; then printf "%s\n" "#define PACKAGE_DATA_DIR \"${ac_default_prefix}/share/${PACKAGE}\"" >>confdefs.h else printf "%s\n" "#define PACKAGE_DATA_DIR \"${prefix}/share/${PACKAGE}\"" >>confdefs.h fi else if test "x${datadir}" = 'x${datarootdir}'; then if test "x${datarootdir}" = 'x${prefix}/share'; then if test "x${prefix}" = "xNONE"; then printf "%s\n" "#define PACKAGE_DATA_DIR \"${ac_default_prefix}/share/${PACKAGE}\"" >>confdefs.h else printf "%s\n" "#define PACKAGE_DATA_DIR \"${prefix}/share/${PACKAGE}\"" >>confdefs.h fi fi else printf "%s\n" "#define PACKAGE_DATA_DIR \"${datadir}/${PACKAGE}\"" >>confdefs.h fi fi if test -n "$OSX_HOST" ; then DATA_SUFFIX=-osx fi packagesrcdir=`cd $srcdir && pwd` printf "%s\n" "#define PACKAGE_SOURCE_DIR \"${packagesrcdir}\"" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wall" >&5 printf %s "checking whether C compiler accepts -Wall... " >&6; } if test ${ax_cv_check_cflags___Wall+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Wall" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ax_cv_check_cflags___Wall=yes else case e in #( e) ax_cv_check_cflags___Wall=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wall" >&5 printf "%s\n" "$ax_cv_check_cflags___Wall" >&6; } if test "x$ax_cv_check_cflags___Wall" = xyes then : case " $CFLAGS " in *\ \ -Wall\ \ *) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac else case e in #( e) : ;; esac fi if test -n "$OSX_HOST" ; then printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h fi printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 printf %s "checking for pow in -lm... " >&6; } if test ${ac_cv_lib_m_pow+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pow (void); int main (void) { return pow (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_m_pow=yes else case e in #( e) ac_cv_lib_m_pow=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 printf "%s\n" "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = xyes then : LIBS="$LIBS -lm" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shm_open in -lrt" >&5 printf %s "checking for shm_open in -lrt... " >&6; } if test ${ac_cv_lib_rt_shm_open+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shm_open (void); int main (void) { return shm_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_rt_shm_open=yes else case e in #( e) ac_cv_lib_rt_shm_open=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_shm_open" >&5 printf "%s\n" "$ac_cv_lib_rt_shm_open" >&6; } if test "x$ac_cv_lib_rt_shm_open" = xyes then : LIBS="$LIBS -lrt" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "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 test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" 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. # 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. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac 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 case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac 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 ;; esac fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$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. # 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. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac 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 case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac 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 case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 printf %s "checking for egrep -e... " >&6; } if test ${ac_cv_path_EGREP_TRADITIONAL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "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_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_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_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then : fi else ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi if test "$ac_cv_path_EGREP_TRADITIONAL" then : ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "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_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_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_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; 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_TRADITIONAL=$EGREP_TRADITIONAL fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL 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 ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then ax_pthread_save_CC="$CC" ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" if test "x$PTHREAD_CC" != "x" then : CC="$PTHREAD_CC" fi if test "x$PTHREAD_CXX" != "x" then : CXX="$PTHREAD_CXX" fi CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pthread_join (void); int main (void) { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 printf "%s\n" "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi CC="$ax_pthread_save_CC" CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items with a "," contain both # C compiler flags (before ",") and linker flags (after ","). Other items # starting with a "-" are C compiler flags, and remaining items are # library names, except for "none" which indicates that we try without # any flags at all, and "pthread-config" which is a program returning # the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 # (Note: HP C rejects this with "bad form for `-t' option") # -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads and # -D_REENTRANT too), HP C (must be checked before -lpthread, which # is present but should not be used directly; and before -mthreads, # because the compiler interprets this as "-mt" + "-hreads") # -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case $host_os in freebsd*) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) ax_pthread_flags="-kthread lthread $ax_pthread_flags" ;; hpux*) # From the cc(1) man page: "[-mt] Sets various -D flags to enable # multi-threading and also sets -lpthread." ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" ;; openedition*) # IBM z/OS requires a feature-test macro to be defined in order to # enable POSIX threads at all, so give the user a hint if this is # not set. (We don't define these ourselves, as they can affect # other portions of the system API in unpredictable ways.) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) AX_PTHREAD_ZOS_MISSING # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} fi rm -rf conftest* ;; solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (N.B.: The stubs are missing # pthread_cleanup_push, or rather a function called by this macro, # so we could check for that, but who knows whether they'll stub # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" ;; esac # Are we compiling with Clang? { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 printf %s "checking whether $CC is Clang... " >&6; } if test ${ax_cv_PTHREAD_CLANG+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Note: Clang 2.7 lacks __clang_[a-z]+__ */ # if defined(__clang__) && defined(__llvm__) AX_PTHREAD_CC_IS_CLANG # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 then : ax_cv_PTHREAD_CLANG=yes fi rm -rf conftest* fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; } ax_pthread_clang="$ax_cv_PTHREAD_CLANG" # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) # Note that for GCC and Clang -pthread generally implies -lpthread, # except when -nostdlib is passed. # This is problematic using libtool to build C++ shared libraries with pthread: # [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 # [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 # [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 # To solve this, first try -pthread together with -lpthread for GCC if test "x$GCC" = "xyes" then : ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags" fi # Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first if test "x$ax_pthread_clang" = "xyes" then : ax_pthread_flags="-pthread,-lpthread -pthread" fi # The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled case $host_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; aix*) ax_pthread_check_macro="_THREAD_SAFE" ;; *) ax_pthread_check_macro="--" ;; esac if test "x$ax_pthread_check_macro" = "x--" then : ax_pthread_check_cond=0 else case e in #( e) ax_pthread_check_cond="!defined($ax_pthread_check_macro)" ;; esac fi if test "x$ax_pthread_ok" = "xno"; then for ax_pthread_try_flag in $ax_pthread_flags; do case $ax_pthread_try_flag in none) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 printf %s "checking whether pthreads work without any flags... " >&6; } ;; *,*) PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"" >&5 printf %s "checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"... " >&6; } ;; -*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 printf %s "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ax_pthread_config+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_ax_pthread_config="yes" printf "%s\n" "$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_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" fi ;; esac fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 printf "%s\n" "$ax_pthread_config" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ax_pthread_config" = "xno" then : continue fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 printf %s "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif static void *some_global = NULL; static void routine(void *a) { /* To avoid any unused-parameter or unused-but-set-parameter warning. */ some_global = a; } static void *start_routine(void *a) { return a; } int main (void) { pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 printf "%s\n" "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xyes" then : break fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Clang needs special handling, because older versions handle the -pthread # option in a rather... idiosyncratic way if test "x$ax_pthread_clang" = "xyes"; then # Clang takes -pthread; it has never supported any other flag # (Note 1: This will need to be revisited if a system that Clang # supports has POSIX threads in a separate library. This tends not # to be the way of modern systems, but it's conceivable.) # (Note 2: On some systems, notably Darwin, -pthread is not needed # to get POSIX threads support; the API is always present and # active. We could reasonably leave PTHREAD_CFLAGS empty. But # -pthread does define _REENTRANT, and while the Darwin headers # ignore this macro, third-party headers might not.) # However, older versions of Clang make a point of warning the user # that, in an invocation where only linking and no compilation is # taking place, the -pthread option has no effect ("argument unused # during compilation"). They expect -pthread to be passed in only # when source code is being compiled. # # Problem is, this is at odds with the way Automake and most other # C build frameworks function, which is that the same flags used in # compilation (CFLAGS) are also used in linking. Many systems # supported by AX_PTHREAD require exactly this for POSIX threads # support, and in fact it is often not straightforward to specify a # flag that is used only in the compilation phase and not in # linking. Such a scenario is extremely rare in practice. # # Even though use of the -pthread flag in linking would only print # a warning, this can be a nuisance for well-run software projects # that build with -Werror. So if the active version of Clang has # this misfeature, we search for an option to squash it. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 printf %s "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second # step ax_pthread_save_ac_link="$ac_link" ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' ax_pthread_link_step=`printf "%s\n" "$ac_link" | sed "$ax_pthread_sed"` ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do if test "x$ax_pthread_try" = "xunknown" then : break fi CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" ac_link="$ax_pthread_save_ac_link" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void){return 0;} _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_link="$ax_pthread_2step_ac_link" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void){return 0;} _ACEOF if ac_fn_c_try_link "$LINENO" then : break fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done ac_link="$ax_pthread_save_ac_link" CFLAGS="$ax_pthread_save_CFLAGS" if test "x$ax_pthread_try" = "x" then : ax_pthread_try=no fi ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in no | unknown) ;; *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; esac fi # $ax_pthread_clang = yes # Various other checks: if test "x$ax_pthread_ok" = "xyes"; then ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 printf %s "checking for joinable pthread attribute... " >&6; } if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { int attr = $ax_pthread_attr; return attr /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ test "x$ax_pthread_joinable_attr_defined" != "xyes" then : printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR" >>confdefs.h ax_pthread_joinable_attr_defined=yes fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 printf %s "checking whether more special flags are required for pthreads... " >&6; } if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ test "x$ax_pthread_special_flags_added" != "xyes" then : PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" ax_pthread_special_flags_added=yes fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; } if test ${ax_cv_PTHREAD_PRIO_INHERIT+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { int i = PTHREAD_PRIO_INHERIT; return i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_PTHREAD_PRIO_INHERIT=yes else case e in #( e) ax_cv_PTHREAD_PRIO_INHERIT=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ test "x$ax_pthread_prio_inherit_defined" != "xyes" then : printf "%s\n" "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h ax_pthread_prio_inherit_defined=yes fi CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then case $host_os in aix*) case "x/$CC" in #( x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : #handle absolute path differently from PATH based program lookup case "x$CC" in #( x/*) : if as_fn_executable_p ${CC}_r then : PTHREAD_CC="${CC}_r" fi if test "x${CXX}" != "x" then : if as_fn_executable_p ${CXX}_r then : PTHREAD_CXX="${CXX}_r" fi fi ;; #( *) : for ac_prog in ${CC}_r do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PTHREAD_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_PTHREAD_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 printf "%s\n" "$PTHREAD_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" if test "x${CXX}" != "x" then : for ac_prog in ${CXX}_r do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PTHREAD_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$PTHREAD_CXX"; then ac_cv_prog_PTHREAD_CXX="$PTHREAD_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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_PTHREAD_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX if test -n "$PTHREAD_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CXX" >&5 printf "%s\n" "$PTHREAD_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$PTHREAD_CXX" && break done test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" fi ;; esac ;; #( *) : ;; esac ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" TESTS_CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC" : else ax_pthread_ok=no as_fn_error $? "pthread not found" "$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 ac_fn_c_check_func "$LINENO" "pthread_create" "ac_cv_func_pthread_create" if test "x$ac_cv_func_pthread_create" = xyes then : else case e in #( e) as_fn_error $? "pthread_create() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pthread_getspecific" "ac_cv_func_pthread_getspecific" if test "x$ac_cv_func_pthread_getspecific" = xyes then : else case e in #( e) as_fn_error $? "pthread_getspecific() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pthread_key_create" "ac_cv_func_pthread_key_create" if test "x$ac_cv_func_pthread_key_create" = xyes then : else case e in #( e) as_fn_error $? "pthread_key_create() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pthread_mutex_lock" "ac_cv_func_pthread_mutex_lock" if test "x$ac_cv_func_pthread_mutex_lock" = xyes then : else case e in #( e) as_fn_error $? "pthread_mutex_lock() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pthread_mutex_unlock" "ac_cv_func_pthread_mutex_unlock" if test "x$ac_cv_func_pthread_mutex_unlock" = xyes then : else case e in #( e) as_fn_error $? "pthread_mutex_unlock() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pthread_setspecific" "ac_cv_func_pthread_setspecific" if test "x$ac_cv_func_pthread_setspecific" = xyes then : else case e in #( e) as_fn_error $? "pthread_setspecific() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pthread_detach" "ac_cv_func_pthread_detach" if test "x$ac_cv_func_pthread_detach" = xyes then : else case e in #( e) as_fn_error $? "pthread_detach() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pthread_self" "ac_cv_func_pthread_self" if test "x$ac_cv_func_pthread_self" = xyes then : else case e in #( e) as_fn_error $? "pthread_self() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_type "$LINENO" "pthread_t" "ac_cv_type_pthread_t" "#include " if test "x$ac_cv_type_pthread_t" = xyes then : else case e in #( e) as_fn_error $? "pthread_t type not found in pthread.h" "$LINENO" 5 ;; esac fi ac_fn_c_check_type "$LINENO" "pthread_key_t" "ac_cv_type_pthread_key_t" "#include " if test "x$ac_cv_type_pthread_key_t" = xyes then : else case e in #( e) as_fn_error $? "pthread_key_t type not found in pthread.h" "$LINENO" 5 ;; esac fi ac_fn_c_check_type "$LINENO" "pthread_mutex_t" "ac_cv_type_pthread_mutex_t" "#include " if test "x$ac_cv_type_pthread_mutex_t" = xyes then : else case e in #( e) as_fn_error $? "pthread_mutex_t type not found in pthread.h" "$LINENO" 5 ;; esac fi ac_fn_c_check_type "$LINENO" "pthread_cond_t" "ac_cv_type_pthread_cond_t" "#include " if test "x$ac_cv_type_pthread_cond_t" = xyes then : else case e in #( e) as_fn_error $? "pthread_cond_t type not found in pthread.h" "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "PTHREAD_MUTEX_INITIALIZER" "ac_cv_have_decl_PTHREAD_MUTEX_INITIALIZER" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_PTHREAD_MUTEX_INITIALIZER" = xyes then : else case e in #( e) as_fn_error $? "PTHREAD_MUTEX_INITIALIZER not found in pthread.h" "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "PTHREAD_COND_INITIALIZER" "ac_cv_have_decl_PTHREAD_COND_INITIALIZER" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_PTHREAD_COND_INITIALIZER" = xyes then : else case e in #( e) as_fn_error $? "PTHREAD_COND_INITIALIZER not found in pthread.h" "$LINENO" 5 ;; esac fi curses_lib_name=ncursesw # Check whether --with-curses-name was given. if test ${with_curses_name+y} then : withval=$with_curses_name; curses_lib_name=$withval fi vifm_cv_curses=/usr # Check whether --with-curses was given. if test ${with_curses+y} then : withval=$with_curses; if test $withval != yes; then vifm_cv_curses=$withval fi if test x$vifm_cv_curses != x/usr; then LDFLAGS="-L${vifm_cv_curses}/lib $LDFLAGS" CPPFLAGS="$CPPFLAGS -I${vifm_cv_curses}/include -I${vifm_cv_curses}/include/${curses_lib_name}" fi fi ncurses_found=no as_ac_Lib=`printf "%s\n" "ac_cv_lib_${curses_lib_name}""_initscr" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for initscr in -l${curses_lib_name}" >&5 printf %s "checking for initscr in -l${curses_lib_name}... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-l${curses_lib_name} $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char initscr (void); int main (void) { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else case e in #( e) eval "$as_ac_Lib=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : LIBS="$LIBS -l${curses_lib_name}" if test x$vifm_cv_curses = x/usr -a -d /usr/include/${curses_lib_name}; then CPPFLAGS="$CPPFLAGS -I/usr/include/${curses_lib_name}" fi ncurses_found=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing curs_set" >&5 printf %s "checking for library containing curs_set... " >&6; } if test ${ac_cv_search_curs_set+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char curs_set (void); int main (void) { return curs_set (); ; return 0; } _ACEOF for ac_lib in '' tinfow 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_c_try_link "$LINENO" then : ac_cv_search_curs_set=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_curs_set+y} then : break fi done if test ${ac_cv_search_curs_set+y} then : else case e in #( e) ac_cv_search_curs_set=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_curs_set" >&5 printf "%s\n" "$ac_cv_search_curs_set" >&6; } ac_res=$ac_cv_search_curs_set if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else case e in #( e) as_fn_error $? "could not find a library providing curs_set" "$LINENO" 5 ;; esac fi fi if test -n "$OSX_HOST" -a "x$ncurses_found" != "xyes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5 printf %s "checking for initscr in -lncurses... " >&6; } if test ${ac_cv_lib_ncurses_initscr+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char initscr (void); int main (void) { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ncurses_initscr=yes else case e in #( e) ac_cv_lib_ncurses_initscr=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5 printf "%s\n" "$ac_cv_lib_ncurses_initscr" >&6; } if test "x$ac_cv_lib_ncurses_initscr" = xyes then : LIBS="$LIBS -lncurses" if test x$vifm_cv_curses = x/usr -a -d /usr/include/ncurses; then CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses" fi ncurses_found=yes fi fi if test "x$ncurses_found" != "xyes"; then if test -z "$OSX_HOST"; then as_fn_error $? "libncursesw not found" "$LINENO" 5 else as_fn_error $? "libncursesw and libncurses not found" "$LINENO" 5 fi fi LIBS=$LIBS $GUI_LINK_OPTS_TERM ac_fn_c_check_header_compile "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" if test "x$ac_cv_header_curses_h" = xyes then : else case e in #( e) as_fn_error $? "curses.h header not found." "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "A_ITALIC" "ac_cv_have_decl_A_ITALIC" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_A_ITALIC" = xyes then : printf "%s\n" "#define HAVE_A_ITALIC_DECL 1" >>confdefs.h fi ac_fn_check_decl "$LINENO" "COLORS" "ac_cv_have_decl_COLORS" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_COLORS" = xyes then : else case e in #( e) as_fn_error $? "COLORS not found in curses.h" "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "TABSIZE" "ac_cv_have_decl_TABSIZE" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_TABSIZE" = xyes then : else case e in #( e) as_fn_error $? "TABSIZE not found in curses.h" "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "curs_set" "ac_cv_func_curs_set" if test "x$ac_cv_func_curs_set" = xyes then : else case e in #( e) as_fn_error $? "curs_set() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "def_prog_mode" "ac_cv_func_def_prog_mode" if test "x$ac_cv_func_def_prog_mode" = xyes then : else case e in #( e) as_fn_error $? "def_prog_mode() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "doupdate" "ac_cv_func_doupdate" if test "x$ac_cv_func_doupdate" = xyes then : else case e in #( e) as_fn_error $? "doupdate() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "endwin" "ac_cv_func_endwin" if test "x$ac_cv_func_endwin" = xyes then : else case e in #( e) as_fn_error $? "endwin() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "flushinp" "ac_cv_func_flushinp" if test "x$ac_cv_func_flushinp" = xyes then : else case e in #( e) as_fn_error $? "flushinp() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "getcchar" "ac_cv_func_getcchar" if test "x$ac_cv_func_getcchar" = xyes then : else case e in #( e) as_fn_error $? "getcchar() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "has_colors" "ac_cv_func_has_colors" if test "x$ac_cv_func_has_colors" = xyes then : else case e in #( e) as_fn_error $? "has_colors() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "init_pair" "ac_cv_func_init_pair" if test "x$ac_cv_func_init_pair" = xyes then : else case e in #( e) as_fn_error $? "init_pair() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "initscr" "ac_cv_func_initscr" if test "x$ac_cv_func_initscr" = xyes then : else case e in #( e) as_fn_error $? "initscr() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "isendwin" "ac_cv_func_isendwin" if test "x$ac_cv_func_isendwin" = xyes then : else case e in #( e) as_fn_error $? "isendwin() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "keypad" "ac_cv_func_keypad" if test "x$ac_cv_func_keypad" = xyes then : else case e in #( e) as_fn_error $? "keypad() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "mvwin" "ac_cv_func_mvwin" if test "x$ac_cv_func_mvwin" = xyes then : else case e in #( e) as_fn_error $? "mvwin() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "mvwprintw" "ac_cv_func_mvwprintw" if test "x$ac_cv_func_mvwprintw" = xyes then : else case e in #( e) as_fn_error $? "mvwprintw() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "newwin" "ac_cv_func_newwin" if test "x$ac_cv_func_newwin" = xyes then : else case e in #( e) as_fn_error $? "newwin() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "noecho" "ac_cv_func_noecho" if test "x$ac_cv_func_noecho" = xyes then : else case e in #( e) as_fn_error $? "noecho() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "nonl" "ac_cv_func_nonl" if test "x$ac_cv_func_nonl" = xyes then : else case e in #( e) as_fn_error $? "nonl() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "raw" "ac_cv_func_raw" if test "x$ac_cv_func_raw" = xyes then : else case e in #( e) as_fn_error $? "raw() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "reset_prog_mode" "ac_cv_func_reset_prog_mode" if test "x$ac_cv_func_reset_prog_mode" = xyes then : else case e in #( e) as_fn_error $? "reset_prog_mode() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "resize_term" "ac_cv_func_resize_term" if test "x$ac_cv_func_resize_term" = xyes then : else case e in #( e) as_fn_error $? "resize_term() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "resizeterm" "ac_cv_func_resizeterm" if test "x$ac_cv_func_resizeterm" = xyes then : else case e in #( e) as_fn_error $? "resizeterm() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "scrollok" "ac_cv_func_scrollok" if test "x$ac_cv_func_scrollok" = xyes then : else case e in #( e) as_fn_error $? "scrollok() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "set_escdelay" "ac_cv_func_set_escdelay" if test "x$ac_cv_func_set_escdelay" = xyes then : printf "%s\n" "#define HAVE_SET_ESCDELAY_FUNC 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "setcchar" "ac_cv_func_setcchar" if test "x$ac_cv_func_setcchar" = xyes then : else case e in #( e) as_fn_error $? "setcchar() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "start_color" "ac_cv_func_start_color" if test "x$ac_cv_func_start_color" = xyes then : else case e in #( e) as_fn_error $? "start_color() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "use_default_colors" "ac_cv_func_use_default_colors" if test "x$ac_cv_func_use_default_colors" = xyes then : else case e in #( e) as_fn_error $? "use_default_colors() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "waddch" "ac_cv_func_waddch" if test "x$ac_cv_func_waddch" = xyes then : else case e in #( e) as_fn_error $? "waddch() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "waddnstr" "ac_cv_func_waddnstr" if test "x$ac_cv_func_waddnstr" = xyes then : else case e in #( e) as_fn_error $? "waddnstr() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "waddnwstr" "ac_cv_func_waddnwstr" if test "x$ac_cv_func_waddnwstr" = xyes then : else case e in #( e) as_fn_error $? "waddnwstr() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wattr_set" "ac_cv_func_wattr_set" if test "x$ac_cv_func_wattr_set" = xyes then : else case e in #( e) as_fn_error $? "wattr_set() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wbkgrndset" "ac_cv_func_wbkgrndset" if test "x$ac_cv_func_wbkgrndset" = xyes then : else case e in #( e) as_fn_error $? "wbkgrndset() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wborder" "ac_cv_func_wborder" if test "x$ac_cv_func_wborder" = xyes then : else case e in #( e) as_fn_error $? "wborder() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wclrtoeol" "ac_cv_func_wclrtoeol" if test "x$ac_cv_func_wclrtoeol" = xyes then : else case e in #( e) as_fn_error $? "wclrtoeol() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "werase" "ac_cv_func_werase" if test "x$ac_cv_func_werase" = xyes then : else case e in #( e) as_fn_error $? "werase() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wget_wch" "ac_cv_func_wget_wch" if test "x$ac_cv_func_wget_wch" = xyes then : else case e in #( e) as_fn_error $? "wget_wch() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wgetch" "ac_cv_func_wgetch" if test "x$ac_cv_func_wgetch" = xyes then : else case e in #( e) as_fn_error $? "wgetch() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wmove" "ac_cv_func_wmove" if test "x$ac_cv_func_wmove" = xyes then : else case e in #( e) as_fn_error $? "wmove() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wnoutrefresh" "ac_cv_func_wnoutrefresh" if test "x$ac_cv_func_wnoutrefresh" = xyes then : else case e in #( e) as_fn_error $? "wnoutrefresh() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wprintw" "ac_cv_func_wprintw" if test "x$ac_cv_func_wprintw" = xyes then : else case e in #( e) as_fn_error $? "wprintw() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wredrawln" "ac_cv_func_wredrawln" if test "x$ac_cv_func_wredrawln" = xyes then : else case e in #( e) as_fn_error $? "wredrawln() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wrefresh" "ac_cv_func_wrefresh" if test "x$ac_cv_func_wrefresh" = xyes then : else case e in #( e) as_fn_error $? "wrefresh() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wresize" "ac_cv_func_wresize" if test "x$ac_cv_func_wresize" = xyes then : else case e in #( e) as_fn_error $? "wresize() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wtimeout" "ac_cv_func_wtimeout" if test "x$ac_cv_func_wtimeout" = xyes then : else case e in #( e) as_fn_error $? "wtimeout() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "wtouchln" "ac_cv_func_wtouchln" if test "x$ac_cv_func_wtouchln" = xyes then : else case e in #( e) as_fn_error $? "wtouchln() function not found." "$LINENO" 5 ;; esac fi use_extended_colors=yes ac_fn_c_check_func "$LINENO" "extended_pair_content" "ac_cv_func_extended_pair_content" if test "x$ac_cv_func_extended_pair_content" = xyes then : else case e in #( e) use_extended_colors=no ;; esac fi ac_fn_c_check_func "$LINENO" "pair_content" "ac_cv_func_pair_content" if test "x$ac_cv_func_pair_content" = xyes then : else case e in #( e) use_extended_colors=no ;; esac fi if test "$use_extended_colors" = "yes"; then printf "%s\n" "#define HAVE_EXTENDED_COLORS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" if test "x$ac_cv_header_sys_inotify_h" = xyes then : use_inotify=yes else case e in #( e) use_inotify=no ;; esac fi if test "$use_inotify" = "yes"; then ac_fn_check_decl "$LINENO" "IN_NONBLOCK" "ac_cv_have_decl_IN_NONBLOCK" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IN_NONBLOCK" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_check_decl "$LINENO" "IN_CLOEXEC" "ac_cv_have_decl_IN_CLOEXEC" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IN_CLOEXEC" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_check_decl "$LINENO" "IN_ATTRIB" "ac_cv_have_decl_IN_ATTRIB" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IN_ATTRIB" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_check_decl "$LINENO" "IN_MODIFY" "ac_cv_have_decl_IN_MODIFY" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IN_MODIFY" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_check_decl "$LINENO" "IN_CREATE" "ac_cv_have_decl_IN_CREATE" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IN_CREATE" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_check_decl "$LINENO" "IN_DELETE" "ac_cv_have_decl_IN_DELETE" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IN_DELETE" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_check_decl "$LINENO" "IN_MOVED_FROM" "ac_cv_have_decl_IN_MOVED_FROM" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IN_MOVED_FROM" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_check_decl "$LINENO" "IN_MOVED_TO" "ac_cv_have_decl_IN_MOVED_TO" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IN_MOVED_TO" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_check_decl "$LINENO" "IN_EXCL_UNLINK" "ac_cv_have_decl_IN_EXCL_UNLINK" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IN_EXCL_UNLINK" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_check_decl "$LINENO" "IN_CLOSE_WRITE" "ac_cv_have_decl_IN_CLOSE_WRITE" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IN_CLOSE_WRITE" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_check_decl "$LINENO" "IN_Q_OVERFLOW" "ac_cv_have_decl_IN_Q_OVERFLOW" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IN_Q_OVERFLOW" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1" if test "x$ac_cv_func_inotify_init1" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_c_check_func "$LINENO" "inotify_add_watch" "ac_cv_func_inotify_add_watch" if test "x$ac_cv_func_inotify_add_watch" = xyes then : else case e in #( e) use_inotify=no ;; esac fi ac_fn_c_check_type "$LINENO" "struct inotify_event" "ac_cv_type_struct_inotify_event" "#include " if test "x$ac_cv_type_struct_inotify_event" = xyes then : else case e in #( e) use_inotify=no ;; esac fi if test "$use_inotify" = "yes"; then printf "%s\n" "#define HAVE_INOTIFY 1" >>confdefs.h fi fi ac_fn_c_check_header_compile "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$ac_includes_default" if test "x$ac_cv_header_sys_xattr_h" = xyes then : use_xattrs=yes else case e in #( e) use_xattrs=no ;; esac fi if test "$use_xattrs" = "yes"; then ac_fn_c_check_func "$LINENO" "lgetxattr" "ac_cv_func_lgetxattr" if test "x$ac_cv_func_lgetxattr" = xyes then : else case e in #( e) use_xattrs=no ;; esac fi ac_fn_c_check_func "$LINENO" "llistxattr" "ac_cv_func_llistxattr" if test "x$ac_cv_func_llistxattr" = xyes then : else case e in #( e) use_xattrs=no ;; esac fi ac_fn_c_check_func "$LINENO" "lsetxattr" "ac_cv_func_lsetxattr" if test "x$ac_cv_func_lsetxattr" = xyes then : else case e in #( e) use_xattrs=no ;; esac fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main() { return XATTR_CREATE; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) use_xattrs="no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$use_xattrs" = "yes"; then printf "%s\n" "#define HAVE_XATTRS 1" >>confdefs.h fi fi version="$(mv --version 2> /dev/null | sed -ne 's/^.*(GNU coreutils) //p')" major="${version%.*}" minor="${version#*.}" if test "x$major" != "x" -a "x$minor" != "x" ; then if test $major -eq 7 -a $minor -ge 1 -o $major -gt 7; then printf "%s\n" "#define SUPPORT_NO_CLOBBER 1" >>confdefs.h fi if test $major -eq 7 -a $minor -ge 6 -o $major -gt 7; then printf "%s\n" "#define SUPPORT_REFLINK_AUTO 1" >>confdefs.h fi fi # Check whether --with-glib was given. if test ${with_glib+y} then : withval=$with_glib; use_glib=$withval else case e in #( e) use_glib=yes ;; esac fi # Check whether --with-gtk was given. if test ${with_gtk+y} then : withval=$with_gtk; use_gtk=$withval else case e in #( e) use_gtk=use_glib ;; esac fi if test "x$use_gtk" != "xuse_glib"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: \"--with(out)-gtk flag is obsolete, please use --with(out)-glib instead\"" >&5 printf "%s\n" "$as_me: WARNING: \"--with(out)-gtk flag is obsolete, please use --with(out)-glib instead\"" >&2;} use_glib=$use_gtk fi # Check whether --with-libmagic was given. if test ${with_libmagic+y} then : withval=$with_libmagic; use_libmagic=$withval else case e in #( e) use_libmagic=yes ;; esac fi # Check whether --with-X11 was given. if test ${with_X11+y} then : withval=$with_X11; use_libX11=$withval else case e in #( e) use_libX11=yes ;; esac fi # Check whether --with-dyn-X11 was given. if test ${with_dyn_X11+y} then : withval=$with_dyn_X11; use_dyn_libX11=$withval else case e in #( e) use_dyn_libX11=yes ;; esac fi if test "$use_glib" = "yes"; then if test "x$(which pkg-config)" != "x"; then if pkg-config --exists glib-2.0 gio-2.0; then CFLAGS="$CFLAGS $(pkg-config --cflags glib-2.0 gio-2.0)" LIBS="$LIBS $(pkg-config --libs glib-2.0 gio-2.0)" ac_fn_c_check_header_compile "$LINENO" "gio/gio.h" "ac_cv_header_gio_gio_h" "#include " if test "x$ac_cv_header_gio_gio_h" = xyes then : else case e in #( e) as_fn_error $? "gio/gio.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "glib.h" "ac_cv_header_glib_h" "#include " if test "x$ac_cv_header_glib_h" = xyes then : else case e in #( e) as_fn_error $? "glib.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "g_file_info_get_content_type" "ac_cv_func_g_file_info_get_content_type" if test "x$ac_cv_func_g_file_info_get_content_type" = xyes then : else case e in #( e) as_fn_error $? "g_file_info_get_content_type() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "g_file_new_for_path" "ac_cv_func_g_file_new_for_path" if test "x$ac_cv_func_g_file_new_for_path" = xyes then : else case e in #( e) as_fn_error $? "g_file_new_for_path() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "g_file_query_info" "ac_cv_func_g_file_query_info" if test "x$ac_cv_func_g_file_query_info" = xyes then : else case e in #( e) as_fn_error $? "g_file_query_info() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "g_object_unref" "ac_cv_func_g_object_unref" if test "x$ac_cv_func_g_object_unref" = xyes then : else case e in #( e) as_fn_error $? "g_object_unref() function not found." "$LINENO" 5 ;; esac fi printf "%s\n" "#define HAVE_GLIB 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: \"Could not find glib-2.0/gio-2.0 via pkg-config. No GLib support.\"" >&5 printf "%s\n" "$as_me: WARNING: \"Could not find glib-2.0/gio-2.0 via pkg-config. No GLib support.\"" >&2;} fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: \"Could not find pkg-config. No GLib support.\"" >&5 printf "%s\n" "$as_me: WARNING: \"Could not find pkg-config. No GLib support.\"" >&2;} fi fi if test "$use_libmagic" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for magic_open in -lmagic" >&5 printf %s "checking for magic_open in -lmagic... " >&6; } if test ${ac_cv_lib_magic_magic_open+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lmagic $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char magic_open (void); int main (void) { return magic_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_magic_magic_open=yes else case e in #( e) ac_cv_lib_magic_magic_open=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_magic_magic_open" >&5 printf "%s\n" "$ac_cv_lib_magic_magic_open" >&6; } if test "x$ac_cv_lib_magic_magic_open" = xyes then : LIBS="$LIBS -lmagic" ac_fn_c_check_func "$LINENO" "magic_close" "ac_cv_func_magic_close" if test "x$ac_cv_func_magic_close" = xyes then : else case e in #( e) as_fn_error $? "magic_close() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "magic_file" "ac_cv_func_magic_file" if test "x$ac_cv_func_magic_file" = xyes then : else case e in #( e) as_fn_error $? "magic_file() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "magic_load" "ac_cv_func_magic_load" if test "x$ac_cv_func_magic_load" = xyes then : else case e in #( e) as_fn_error $? "magic_load() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "magic_open" "ac_cv_func_magic_open" if test "x$ac_cv_func_magic_open" = xyes then : else case e in #( e) as_fn_error $? "magic_open() function not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "magic.h" "ac_cv_header_magic_h" "$ac_includes_default" if test "x$ac_cv_header_magic_h" = xyes then : else case e in #( e) as_fn_error $? "magic.h header not found." "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "MAGIC_MIME_TYPE" "ac_cv_have_decl_MAGIC_MIME_TYPE" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_MAGIC_MIME_TYPE" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_MAGIC_MIME_TYPE $ac_have_decl" >>confdefs.h printf "%s\n" "#define HAVE_LIBMAGIC 1" >>confdefs.h fi fi # Check whether --enable-extended_keys was given. if test ${enable_extended_keys+y} then : enableval=$enable_extended_keys; extended_keys=$enableval else case e in #( e) extended_keys=yes ;; esac fi # Check whether --enable-desktop_files was given. if test ${enable_desktop_files+y} then : enableval=$enable_desktop_files; desktop_files=$enableval else case e in #( e) desktop_files=yes ;; esac fi # Check whether --enable-remote_cmds was given. if test ${enable_remote_cmds+y} then : enableval=$enable_remote_cmds; remote_cmds=$enableval else case e in #( e) remote_cmds=yes ;; esac fi # Check whether --enable-developer was given. if test ${enable_developer+y} then : enableval=$enable_developer; developer=$enableval else case e in #( e) developer=no ;; esac fi # Check whether --enable-werror was given. if test ${enable_werror+y} then : enableval=$enable_werror; werror=$enableval else case e in #( e) werror=no ;; esac fi # Check whether --enable-coverage was given. if test ${enable_coverage+y} then : enableval=$enable_coverage; coverage=$enableval else case e in #( e) coverage=no ;; esac fi # Check whether --enable-build-timestamp was given. if test ${enable_build_timestamp+y} then : enableval=$enable_build_timestamp; build_timestamp=$enableval else case e in #( e) build_timestamp=yes ;; esac fi # Check whether --with-sanitize was given. if test ${with_sanitize+y} then : withval=$with_sanitize; sanitize=$withval fi if test "$extended_keys" = "yes"; then printf "%s\n" "#define ENABLE_EXTENDED_KEYS 1" >>confdefs.h fi if test "$desktop_files" = "yes"; then printf "%s\n" "#define ENABLE_DESKTOP_FILES 1" >>confdefs.h fi if test "$remote_cmds" = "yes"; then printf "%s\n" "#define ENABLE_REMOTE_CMDS 1" >>confdefs.h fi if test "$use_dyn_libX11" = "yes"; then ORIG_LIBS="$LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : use_dyn_libX11=yes LIBS="$LIBS -ldl" else case e in #( e) use_dyn_libX11=no ;; esac fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes then : else case e in #( e) use_dyn_libX11=no ;; esac fi ac_fn_c_check_func "$LINENO" "dlsym" "ac_cv_func_dlsym" if test "x$ac_cv_func_dlsym" = xyes then : else case e in #( e) use_dyn_libX11=no ;; esac fi ac_fn_c_check_func "$LINENO" "dlclose" "ac_cv_func_dlclose" if test "x$ac_cv_func_dlclose" = xyes then : else case e in #( e) use_dyn_libX11=no ;; esac fi if test "$use_dyn_libX11" != "yes"; then LIBS="$ORIG_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: \"libdl seems to don't work as expected. No dynamic X11.\"" >&5 printf "%s\n" "$as_me: WARNING: \"libdl seems to don't work as expected. No dynamic X11.\"" >&2;} fi fi if test "$use_libX11" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 printf %s "checking for XOpenDisplay in -lX11... " >&6; } if test ${ac_cv_lib_X11_XOpenDisplay+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (void); int main (void) { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_X11_XOpenDisplay=yes else case e in #( e) ac_cv_lib_X11_XOpenDisplay=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 printf "%s\n" "$ac_cv_lib_X11_XOpenDisplay" >&6; } if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes then : ac_fn_c_check_header_compile "$LINENO" "X11/Xlib.h" "ac_cv_header_X11_Xlib_h" "$ac_includes_default" if test "x$ac_cv_header_X11_Xlib_h" = xyes then : else case e in #( e) as_fn_error $? "X11/Xlib.h header not found." "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "X11/Xutil.h" "ac_cv_header_X11_Xutil_h" "$ac_includes_default" if test "x$ac_cv_header_X11_Xutil_h" = xyes then : else case e in #( e) as_fn_error $? "X11/Xutil.h header not found." "$LINENO" 5 ;; esac fi printf "%s\n" "#define HAVE_X11 1" >>confdefs.h if test "$use_dyn_libX11" = "yes"; then printf "%s\n" "#define DYN_X11 1" >>confdefs.h else LIBS="$LIBS -lX11" fi fi fi WERROR_TUNING="-Wno-error=deprecated-declarations -Werror=sign-compare -Wno-unused-parameter" if test "$developer" = "yes"; then CFLAGS="$CFLAGS -g -O0 -Werror $WERROR_TUNING" TESTS_CFLAGS="$TESTS_CFLAGS -Werror $WERROR_TUNING" fi if test "$werror" = "yes"; then CFLAGS="$CFLAGS -Werror $WERROR_TUNING" TESTS_CFLAGS="$TESTS_CFLAGS -Werror $WERROR_TUNING" fi if test "$coverage" = "yes"; then CFLAGS="$CFLAGS -O0 --coverage" LDFLAGS="$LDFLAGS --coverage" fi if test "$build_timestamp" = "yes"; then printf "%s\n" "#define WITH_BUILD_TIMESTAMP 1" >>confdefs.h fi if test -n "$sanitize" -a "$sanitize" != "basic" -a "$sanitize" != "thread" -a \ "$sanitize" != "leak"; then as_fn_error $? "Unknown type of sanitizing: $sanitize" "$LINENO" 5 fi if test "$sanitize" = "basic"; then SANITIZERS_CFLAGS="-fsanitize=address -fsanitize=undefined" fi if test "$sanitize" = "thread"; then SANITIZERS_CFLAGS="-fsanitize=thread -fPIC" LDFLAGS="$LDFLAGS -pie" fi if test "$sanitize" = "leak"; then LDFLAGS="$LDFLAGS -fsanitize=leak" fi CFLAGS="$CFLAGS $SANITIZERS_CFLAGS" LDFLAGS="$LDFLAGS $SANITIZERS_CFLAGS" CFLAGS="$CFLAGS -include ../build-aux/config.h" ac_config_files="$ac_config_files Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # 'ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$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+y} || &/ 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$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=`printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac 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 if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${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 # Check whether --enable-year2038 was given. if test ${enable_year2038+y} then : enableval=$enable_year2038; fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$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 ${ZSH_VERSION+y} && (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 e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; 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 # 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac 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 || printf "%s\n" 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 # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. 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 # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' 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=`printf "%s\n" "$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 || printf "%s\n" 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated 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 vifm $as_me 0.14.3, which was generated by GNU Autoconf 2.72. 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 . vifm home page: ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ vifm config.status 0.14.3 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 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 ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$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=`printf "%s\n" "$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 ) printf "%s\n" "$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 \printf "%s\n" "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 printf "%s\n" "$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 "build-aux/config.h") CONFIG_HEADERS="$CONFIG_HEADERS build-aux/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || 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=`printf "%s\n" "$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 '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$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 || printf "%s\n" 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$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@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$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"; } && { printf "%s\n" "$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 printf "%s\n" "$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 { printf "%s\n" "/* $configure_input */" >&1 \ && 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$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 printf "%s\n" "/* $configure_input */" >&1 \ && 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 || printf "%s\n" 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) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$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=`printf "%s\n" "$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 || printf "%s\n" 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 || printf "%s\n" 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 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ./INSTALL0000600000175000017500000002005315051153244010766 0ustar korykoryInstallation ~~~~~~~~~~~~ On *nix you need: A working version of ncursesw-compatible library. Hints for building on Debian-based systems (Debian/Ubuntu/Linux Mint): * ncurses package you need to build vifm is called "libncursesw5-dev" * also install either perl interpreter or vim to generate tags (done during build) * additional (optional) tools used in sample vifmrc: - sudo aptitude install sshfs curlftpfs fuse fuse-zip fusefat fuseiso - for a support of .rar-archive files see: https://gist.github.com/enberg/84710b619bdb0b10e945 *nix Installation (Cygwin emulates *nix environment, so follow these steps when building with Cygwin): If you checkout sources from git, run scripts/fix-timestamps script first to suppress any spurious build files regeneration. ./configure make ("su" if you don't have access to /usr/local/bin) make install ./configure has the following options (the value in square brackets is the default one): --disable/[enable]-extended-keys - controls whether to build vifm with support of extended keys (like arrows, home, end, etc.). If it's disabled, there absence of a delay after pressing escape is guaranteed for all curses implementations. --disable/[enable]-desktop-files - controls whether vifm will parse *.desktop files found on your system to get a list of programs associated with mimetype of a file. --disable/[enable]-remote-cmds - enable remote command sending. --[disable]/enable-developer - enables features of interest to developers: - debug information - debug-friendly optimizations - treating compilation warnings as errors --[disable]/enable-werror - pass -Werror flag to compiler. --[disable]/enable-coverage - enables code coverage generation. --disable/[enable]-build-timestamp - disables embedding compilation date into executable. --with-sanitize=basic|thread|leak - enables address and undefined, thread or leaks sanitizers respecitively. --without/[with]-glib - use GLib2/GIO to determine mimetypes if available. --without/[with]-gtk - old (incorrect) name of --without/[with]-glib. --without/[with]-libmagic - use libmagic to determine mimetypes if available. --without/[with]-X11 - use libX11 to get terminal window title before changing it to restore it on exit. --without/[with]-dyn-X11 - load libX11 dynamically --with-curses=[/usr] - path to installation root of curses library --with-curses-name=[ncursesw] - name of the curses library You can install vifm in your ~/ directory if you prefer. To do this manually copy the vifm and vifm-pause executables from the src/ directory to where you want to run them. Another possibility is to pass --prefix argument to the ./configure script, with path under the home directory, e.g. --prefix=$HOME/local. The first approach might cause vifm to find some files which are normally installed under /usr/ directory, but the application will be operational. After you start vifm for the first time, you can edit the configuration file. It will be at ~/.config/vifm/vifmrc unless ~/.vifm/ exists. See help for description of other files in configuration directory. On OS X you need: Some compatible curses implementation usually comes with the system. If not, get and install libscursesw or libncursesw. Proceed like in *nix Installation section. You might also want to pass --with-glib=no argument to ./configure script to omit unwanted error message when vifm starts. On Windows you need: Mingw The following libraries installed from dev-packages for Mingw (they should include DLL's): - Pdcurses for Mingw (with applied patches under patches/pdcurses*/) - Regex for Mingw - pthreads for Windows Cross-compiling for Windows using MXE (http://mxe.cc/): Required MXE packages: - gcc - pdcurses (put patches from patches/pdcurses*/ to src/ directory of MXE) - libgnurx - pthreads To build vifm using i686-pc-mingw32 toolchain: - add usr/bin/ directory of MXE to the PATH environment variable, e.g. PATH="$MXE_ROOT/usr/bin/:$PATH" - cd src/ - make -f Makefile.win CROSS=i686-pc-mingw32- Windows Installation (using Windows native API, not Cygwin): cd src (uncomment some lines in Makefile.win below 'config:' if you want) make -f Makefile.win Copy vifm.exe and win_helper.exe to where you want to run them (but they all should be in the same directory). You will also need to copy vifm help files and vifmrc file to %HOME%/.vifm/ or APPDATA%/Vifm/. In case you want to be able to create symbolic links, you should set a "Run as Administrator" attribute for the win_helper.exe. Note: symbolic links are supported on Windows starting from Windows Vista. If you use *nix shells copy vifm-pause to some directory that is included in the %PATH%. The better solution is to put it into %HOME%/.vifm/scripts or %APPDATA%/Vifm/scripts. On Windows you can also use vifm in a portable way (e.g. keep it on a removable device). To do that just put your vifmrc file where vifm.exe is and all configuration files will be stored there. Vim Specific Options: vim/ directory referred to below is: - {install_prefix}/share/vifm/vim/ on *nix-like systems; - data/vim/ on Windows. Recommended way of installing Vifm-Vim integration is to point Vim's 'runtimepath' option to the vim/ directory, like this set runtimepath+=/usr/share/vifm/vim/ in your .vimrc file. Such setup has an additional benefit of Vifm help being not visible unless Vim is started via :help command from Vifm. If it's not what you desire, just add vim-doc/ directory in a similar manner: set runtimepath+=/usr/share/vifm/vim-doc/ Alternatively, you can install whole vim/ directory into Vim or only some parts of it as described below. vim/doc/vifm.txt file should go to your ~/.vim/doc directory or the system vim/doc directory. Then launch Vim and give the command :helptags ~/.vim/doc or :helptags path/to/system/vim/doc depending on where you installed the vifm.txt file. Note that you have to have write permission to corresponding directory. You will also need to set 'vimhelp' option in ~/.vifm/vifmrc as the default setting is to use the plain text file. If you want to use syntax highlighting and file type plugin for vifmrc file and on editing command line command externally, copy vim/syntax/vifm.vim, vim/ftdetect/vifm.vim and all files in vim/ftplugin/ appropriately to either system wide or user syntax/ and ftplugin/ directories of Vim. One can also add to .vimrc file commands like, but using ftdetect/ directory is a cleaner way to achieve the same: autocmd BufNewFile,BufRead vifmrc :set filetype=vifm autocmd BufNewFile,BufRead ~/.vifm/colors/* :set filetype=vifm or when parsing of mode lines is enabled in Vim, add the following as the first or last line to configuration file and color schemes: " vim: set filetype=vifm : To use vifm.vim plugin install vim/plugin/vifm.vim script to Vim in the same way as described above. The script allows you to use Vifm from Vim to select files and open them in different ways (e.g. in splits, tabs). Note: you need at least Vim 7.3 to use it. Building with broken wide curses: OpenBSD used to have perverted ncursesw library, which had stubs with infinite loops instead of real wide functions. Vifm had a workaround for it. The situation on OpenBSD has improved since then and the workaround is now disabled by default. If you still need it to build on older OpenBSD or for some other system, run ./configure with "CFLAGS=-DBROKEN_WIDE_CURSES" argument. Mind that this is a workaround and it probably best works with Latin characters. ./pkgs/0000700000175000017500000000000015051153244010677 5ustar korykory./pkgs/AppImage/0000700000175000017500000000000015051153266012366 5ustar korykory./pkgs/AppImage/genappimage.sh0000700000175000017500000000545215051153266015210 0ustar korykory#!/bin/bash # Contributed by michaellee8 in 2020 set -x set -e set -u # Reference: https://docs.appimage.org/packaging-guide/from-source/native-binaries.html#id2 # building in temporary directory to keep system clean # use RAM disk if possible (as in: not building on CI system # like Travis, and RAM disk is available) # DISABLED: It seems that linuxdeploy won't be executable on shared memory, # maybe /dev/shm is marked as non-executable? if [ -z "${CI:-}" ] && [ -d /dev/shm ] && false; then TEMP_BASE=/dev/shm else TEMP_BASE=/tmp fi BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" appimage-build-XXXXXX) VERSION=$(git describe | sed 's/-g.*$//') # make sure to clean up build dir, even if errors occur cleanup() { if [ -d "$BUILD_DIR" ]; then rm -rf "$BUILD_DIR" fi } trap cleanup EXIT OLD_CWD=$(readlink -f .) cd "$(git rev-parse --show-toplevel)" git archive HEAD | tar -C "$BUILD_DIR" -xf - cd "$BUILD_DIR" mkdir -p "$BUILD_DIR/AppDir/usr" # Obtain and compile libncursesw6 so that we get 256 color support wget http://ftp.gnu.org/gnu/ncurses/ncurses-6.5.tar.gz tar -xf ncurses-6.5.tar.gz NCURSES_DIR="$PWD/ncurses-6.5" pushd "$NCURSES_DIR" ./configure --without-shared --enable-widec --prefix=/usr \ --without-normal --without-debug --without-cxx --without-cxx-binding \ --without-ada --without-manpages --without-tests make -j"$(nproc)" make DESTDIR="$PWD/build" install popd # Configure vifm to use our libncursesw6 ./configure --sysconfdir=/etc --prefix=/usr \ --with-curses="$NCURSES_DIR/build/usr" \ --without-glib --without-X11 --without-libmagic make -j"$(nproc)" make DESTDIR="$BUILD_DIR/AppDir" install # Setup root files cp "$BUILD_DIR/pkgs/AppImage/AppRun" "$BUILD_DIR/AppDir/" cp "$BUILD_DIR/data/graphics/vifm.svg" "$BUILD_DIR/AppDir/" ln -s usr/share/applications/vifm.desktop "$BUILD_DIR/AppDir/" # Copy the AppData file to AppDir manually mkdir -p "$BUILD_DIR/AppDir/usr/share/metainfo" cp "$BUILD_DIR/data/vifm.appdata.xml" "$BUILD_DIR/AppDir/usr/share/metainfo" # Copy terminfo database cp -r "$NCURSES_DIR/build/usr/share/terminfo" "$BUILD_DIR/AppDir/usr/share" # Prepare the binary strip "$BUILD_DIR/AppDir/usr/bin/vifm" mkdir -p "$BUILD_DIR/AppDir/usr/lib" ldd "$BUILD_DIR/AppDir/usr/bin/vifm" | grep '=> /' | cut -d' ' -f3 | grep -v -e '/libc\.' -e '/libm\.' -e '/libpthread\.' -e '/librt\.' \ -e '/libdl\.' -e '/libz\.' -e '/libresolv\.' | xargs -I {} cp -f {} "$BUILD_DIR/AppDir/usr/lib" # Make AppImage cd "$OLD_CWD" if gpg --list-secret-keys xaizek@posteo.net > /dev/null; then appimagetool --sign "$BUILD_DIR/AppDir" "vifm-$VERSION-x86_64.AppImage" \ --updateinformation 'gh-releases-zsync|vifm|vifm|latest|vifm-*x86_64.AppImage.zsync' else appimagetool "$BUILD_DIR/AppDir" "vifm-$VERSION-x86_64.AppImage" fi ./pkgs/AppImage/AppRun0000700000175000017500000000153615051153244013522 0ustar korykory#!/bin/bash # This is to avoid $ARGV0 issues when used with zsh # Reference: https://github.com/neovim/neovim/blob/master/scripts/genappimage.sh # Reference: https://github.com/neovim/neovim/issues/9341 unset ARGV0 # Load bundled libraries. export LD_LIBRARY_PATH="$APPDIR/usr/lib:$LD_LIBRARY_PATH" # Tell Vifm it's used from an AppImage and what it's root directory is. export VIFM_APPDIR_ROOT=$APPDIR # Make ncurses look into the bundled terminfo. Using $TERMINFO_DIRS is better # than $TERMINFO as it allows preserving any already specified paths. See the # "ENVIRONMENT" section of `man ncurses` for more details including priority of # the lookup. if [ -z "$TERMINFO_DIRS" ]; then export TERMINFO_DIRS="$APPDIR/usr/share/terminfo" else export TERMINFO_DIRS="$TERMINFO_DIRS:$APPDIR/usr/share/terminfo" fi exec "$APPDIR/usr/bin/vifm" ${@+"$@"} ./pkgs/Gentoo/0000700000175000017500000000000015051153244012132 5ustar korykory./pkgs/Gentoo/app-misc/0000700000175000017500000000000015051153244013643 5ustar korykory./pkgs/Gentoo/app-misc/vifm/0000700000175000017500000000000015051153244014604 5ustar korykory./pkgs/Gentoo/app-misc/vifm/vifm-9999.ebuild0000600000175000017500000000347115051153244017363 0ustar korykory# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=5 EGIT_REPO_URI="git://github.com/vifm/vifm.git" if [[ ${PV} == "9999" ]]; then KEYWORDS="" GIT_ECLASS="git-2" else KEYWORDS="~x86 ~amd64 ~x86-fbsd ~x86-linux ~amd64-linux ~arm ~ppc ~s390" GIT_ECLASS="" SRC_URI="mirror://sourceforge/vifm/${P}.tar.bz2" fi inherit 'base' 'vim-doc' ${GIT_ECLASS} DESCRIPTION="Console file manager with vi(m)-like keybindings" HOMEPAGE="https://vifm.info/" LICENSE="GPL-2" SLOT="0" IUSE="X +extended-keys gtk +magic vim vim-syntax" DEPEND=" >=sys-libs/ncurses-5.7-r7 magic? ( sys-apps/file ) gtk? ( dev-libs/glib ) X? ( x11-libs/libX11 ) " RDEPEND=" ${DEPEND} vim? ( || ( app-editors/vim app-editors/gvim ) ) " DOCS=( AUTHORS TODO README ) src_configure() { econf \ $(use_enable extended-keys) \ $(use_with magic libmagic) \ $(use_with gtk) \ $(use_with X X11) } src_install() { base_src_install if use vim; then local t for t in doc plugin; do insinto /usr/share/vim/vimfiles/"${t}" doins "${S}"/data/vim/"${t}"/"${PN}".* done fi if use vim-syntax; then local t for t in ftdetect ftplugin syntax; do insinto /usr/share/vim/vimfiles/"${t}" doins "${S}"/data/vim/"${t}"/"${PN}".vim done fi } pkg_postinst() { if use vim; then update_vim_helptags if [[ -n ${REPLACING_VERSIONS} ]]; then elog elog "You don't need to copy or link any files for" elog " the vim plugin and documentation to work anymore." elog "If you copied any vifm files to ~/.vim/ manually" elog " in earlier vifm versions, please delete them." fi elog elog "To use vim in vifm to view the documentation" elog " edit ~/.vifm/vifmrc and set vimhelp instead of novimhelp" elog fi } pkg_postrm() { use vim && update_vim_helptags } ./BUGS0000600000175000017500000000270615051153266010431 0ustar korykory* Better to check for existence of $HOME. * Duplicate detection lags in custom views on :substitute. * filextype is useless on OS X. * :clone! is useless. * Hard copies of files are counted multiple times for ga/gA. * Paths beyond MAX_PATH limit are not processed with 'syscalls'. * :change->Name renames only one file even when several are selected. * There is no sshfs like FUSE for servers that provide only scp. * inotify fails to recognize change of replaced directory. * Trailing "\ " in :map commands prevents cutting of the space. * noremap shows wrong keys? * "*" at the beginning of a glob doesn't match empty string. * :filetype checks don't expand ~ and environment variables. * 'chaselinks' resolves mount points on Windows, should it? * :apropos command doesn't escape its arguments. * gid/uid are displayed as -1 on some file systems. * Command-line doesn't work well with file names in encoding that doesn't match locale when they fail to convert to wide encoding. * On systems with BSD-like chmod, setting executable bit for directories only doesn't work. * Access time of directories might not be preserved on OpenBSD on copying when 'syscalls' is on, this is some subtle issue, because the code looks fine. * Commands starting with a dash don't work in fish shell and maybe some other non-POSIX shells which have `-c` option accept a value. * Incrementing/decrementing file names doesn't work as expected for numbers outside [-2**63; -2**63) range. ./aclocal.m40000600000175000017500000014020415051153266011602 0ustar korykory# generated automatically by aclocal 1.18 -*- Autoconf -*- # Copyright (C) 1996-2025 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.72],, [m4_warning([this file was generated for autoconf 2.72. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2025 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.18' 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.18], [], [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.18])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-2025 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-2025 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-2025 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 thus: # 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-2025 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. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also 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-2025 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 m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])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_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([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_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])], [_AM_PROG_TAR([ustar])])])]) _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 ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) 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 AC_REQUIRE([_AM_PROG_RM_F]) AC_REQUIRE([_AM_PROG_XARGS_N]) 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-2025 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-2025 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])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2025 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-2025 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 MISSING="\${SHELL} '$am_aux_dir/missing'" 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-2025 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-2025 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 # aligned with autoconf, so not including core; see bug#72225. rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM 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) 2022-2025 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_RM_F # --------------- # Check whether 'rm -f' without any arguments works. # https://bugs.gnu.org/10828 AC_DEFUN([_AM_PROG_RM_F], [am__rm_f_notfound= AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) AC_SUBST(am__rm_f_notfound) ]) # Copyright (C) 2001-2025 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-2025 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_SLEEP_FRACTIONAL_SECONDS # ---------------------------- AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl AC_CACHE_CHECK([whether sleep supports fractional seconds], am_cv_sleep_fractional_seconds, [dnl AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], [am_cv_sleep_fractional_seconds=no]) ])]) # _AM_FILESYSTEM_TIMESTAMP_RESOLUTION # ----------------------------------- # Determine the filesystem's resolution for file modification # timestamps. The coarsest we know of is FAT, with a resolution # of only two seconds, even with the most recent "exFAT" extensions. # The finest (e.g. ext4 with large inodes, XFS, ZFS) is one # nanosecond, matching clock_gettime. However, it is probably not # possible to delay execution of a shell script for less than one # millisecond, due to process creation overhead and scheduling # granularity, so we don't check for anything finer than that. (See below.) AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) AC_CACHE_CHECK([filesystem timestamp resolution], am_cv_filesystem_timestamp_resolution, [dnl # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `[ls -t conftest.ts[12]]` && { test "$[]*" != "X conftest.ts1 conftest.ts2" || test "$[]*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # 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_ECHO_UNQUOTED( ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], [AS_MESSAGE_LOG_FD]) AC_MSG_FAILURE([ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment.]) fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$[]2" = conftest.ts3 && test "$[]3" = conftest.ts2 && test "$[]4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ])]) # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) # This check should not be cached, as it may vary across builds of # different projects. 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_RESULT([no]) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_RESULT([no]) 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). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[]*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$[]2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done AC_MSG_RESULT([$am_build_env_is_sane]) if test "$am_build_env_is_sane" = no; then AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ]) 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-2025 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 # ---------------- # Enable less verbose build rules support. AC_DEFUN([_AM_SILENT_RULES], [AM_DEFAULT_VERBOSITY=1 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 ]) 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]) 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 dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls dnl to AM_SILENT_RULES to change the default value. AC_CONFIG_COMMANDS_PRE([dnl case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac 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 ])dnl ]) # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or # empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_REQUIRE([_AM_SILENT_RULES]) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])m4_newline dnl We intentionally force a newline after the assignment, since a) nothing dnl good can come of more text following, and b) that was the behavior dnl before 1.17. See https://bugs.gnu.org/72267. ]) # Copyright (C) 2001-2025 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-2025 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-2025 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 x$am_uid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) elif 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 x$gm_gid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) elif 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 # Copyright (C) 2022-2025 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_XARGS_N # ---------------- # Check whether 'xargs -n' works. It should work everywhere, so the fallback # is not optimized at all as we never expect to use it. AC_DEFUN([_AM_PROG_XARGS_N], [AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' ])dnl AC_SUBST(am__xargs_n) ]) m4_include([build-aux/m4/ax_check_compile_flag.m4]) m4_include([build-aux/m4/ax_pthread.m4]) ./ChangeLog.LuaAPI0000600000175000017500000002442515051153244012570 0ustar korykoryThe API is experimental and having a change log is useful to have for adjusting plugins as the implementation changes. During development of the API things should stay fairly stable to not cause breakage too often, but while stabilizing for v1.0 a bunch of breaking changes can happen at once. API sections marked {deprecated} will be removed. After that all changes will be documented in the regular ChangeLog. 0.13 to 0.14-beta (2025-01-19) Bumped API version to v0.2.0. Upgraded Lua from 5.4.4 to 5.4.7. Deprecated VifmView.currententry field in favour of VifmView.cursor.pos. Patch by filterfalse. Deprecated vifm.makepath() field in favour of vifm.fs.mkdir(). Added VifmView.cursor.pos that provides an index of an entry under the cursor. Patch by filterfalse. Added VifmView.cursor:entry() that provides VifmEntry under the cursor. This is a shortcut to VifmView:entry(VifmView.cursor.pos). Patch by filterfalse. Added ability to move the cursor within a view by assigning an integer to VifmView.cursor.pos. Patch by filterfalse. Added cursorpos field to selectors that moves the cursor within a view. Patch by filterfalse. Added vifm.abbrevs.add() that registers command-line abbreviations. Patch by filterfalse. Added vifm.stdout() to return stream to which Vifm's output was redirected (if it was redirected, i.e. original output wasn't connected to a TTY or character device on Windows). Thanks to gruvw. Added VifmJob:pid() to retrieve process ID of a job. Thanks to The Cyberduck and PRESFIL. Added VifmJob:terminate() to forcefully finish a job. Thanks to The Cyberduck. Added "pwd" parameter to vifm.startjob() that specifies initial directory of the process. Thanks to PRESFIL. Added vifm.cmds.add({ withrange }) flag which allows :commands implemented in Lua to handle ranges. Thanks to Moin Khan. Added vifm.fs table with file-system related operations: vifm.fs.cp(), vifm.fs.ln(), vifm.fs.mkdir(), vifm.fs.mkfile(), vifm.fs.mv(), vifm.fs.rm(), vifm.fs.rmdir(). Added VifmView:selected() that returns an iterator over selected entries. Added VifmView:entries() that returns an iterator over all entries. Added VifmView:focus() that makes the view the current one. Added VifmView:gotopath() that navigates to a file (like :goto or --select). Added VifmView:loadcustom() that sets list of paths as a custom view. Added index of Lua API to the documentation for easier overview/lookup. Added vifm.menus.loadcustom() that makes a menu out of a list of strings. Made VifmJob:errors() wait for receiving errors if the job has finished. Fixed jobs created via vifm.startjob() being displayed with "UNKNOWN" for description on the job bar. 0.13-beta to 0.13 (2023-04-04) Added VifmView:select() and VifmView:unselect() that select and unselect entries by indexes. 0.12.1 to 0.13-beta (2023-03-17) Bumped API version to v0.1.0 due to bug fixes and various additions. Additions to enabled standard libraries: * os.getenv() New things Lua can be used for: * write a 'tabline' generator * running code before exit and when a file operation is done * starting background jobs to do something when they're over Changed description of VifmTab:getview() without arguments to return active pane of a global tab, which is what it was actually doing. Added vifm.executable() that check for an executable file or command in $PATH. Added "onexit" callback for VifmJob. Added vifm.input() that prompts user for input via command-line prompt. Added events.listen() that registers a handler for an event. Added "app.exit" event that occurs before Vifm exits normally. Added "app.fsop" event that occurs after a successful execution of a file-system operation. Added VifmEntry.isdir field which is true if an entry is either a directory or a symbolic link to a directory. Added VifmView.custom table with information about custom file list. Close Lua job streams when job is done. Closed _G loophole a plugin could use to mess environment for other plugins. Protected against metatable manipulations in Lua. Fixed incorrect path in Lua's editor handler on Windows. Fixed VifmTab:getview() mistreating "pane" input field. Fixed modules loaded via vifm.plugin.require() not having `vifm` defined. 0.12 to 0.12.1 (2022-09-21) Upgraded Lua from 5.4.3 to 5.4.4. Additions to enabled standard libraries: * os.tmpname() New things Lua can be used for: * fully integrate an arbitrary editor by using a handler in 'vicmd' or 'vixcmd' * defining custom keys and selectors Added vifm.escape() that escapes input to make it suitable for use in an external command for current value of the 'shell' option. Added vifm.run() that runs an external command similar to :!. Added vifm.keys.add() that registers a user-defined key or selector. Added vifm.sessions.current() that retrieves name of the current session. Added vifm.tabs.get() that retrieves a tab. Added vifm.tabs.getcount() that retrieves number of open tabs. Added vifm.tabs.getcurrent() that retrieves index of current tab. Added VifmEntry:mimetype() that gets a MIME type. Added VifmTab:getlayout() that retrieves layout of a global tab or shared TUI state for a pane tab. Added VifmTab:getname() that retrieves name of the tab if it was set. Added VifmTab:getview() that returns view managed by the tab. Completors of a Lua-defined :command can now provide descriptions of completion items. 0.11 to 0.12 (2021-09-29) The following standard libraries are enabled: * basic (core global functions) * table manipulation (`tbl` table) * package library (`require` global and `package` table) * string manipulation (`string` table) * input and output (`io` table) * mathematical functions (`math` table) * time subset of OS facilities (`clock`, `date`, `difftime` and `time` elements of `os` table) This is what one can do by using Lua at the moment: * commands with completion * save and reset options (e.g., some kind of presets) * custom columns * filetype/filextype/fileviewer/%q handlers * 'statusline' generator * starting background jobs that appear on a job bar Added vifm.addcolumntype() that registers a new view column type to be used in 'viewcolumns' option. Added vifm.addhandler() that registers a new handler that will be accessible in viewers. Added vifm.currview() that retrieves a reference to current view. Added vifm.otherview() that retrieves a reference to other view. Added vifm.errordialog() that displays error dialog. Added vifm.expand() that expands environment variables and macros in a string. Added vifm.fnamemodify() that changes path according to modifiers. Added vifm.exists() that checks existence of a path without resolving symbolic links. Added vifm.makepath() that creates target path and missing intermediate directories. Added vifm.startjob() that launches an external command. Added vifm.cmds.add() that registers a new :command of a kind that's equivalent to builtin commands. Added vifm.cmds.command() that registers a new :command that works exactly as those registered using :command builtin command. Added vifm.cmds.delcommand() that removes :command added by vifm.cmds.command(), basically being an equivalent of :delcommand builtin command. Added vifm.opts.global table that provides access to global options. Added vifm.plugin.name field that provides name of the plugin. Added vifm.plugin.path field that provides full path to plugin's root directory. Added vifm.plugin.require() that serves as plugin-specific `require`, which loads Lua modules relative to plugin's root. Added vifm.plugins.all table that contains all plugins indexed by their names. Added vifm.sb.info() that displays a regular message on statusbar. Added vifm.sb.error() that displays an error message on statusbar. Added vifm.sb.quick() that displays a quick message on statusbar. Added vifm.version.app.str field that provides version of Vifm as a string. Added vifm.version.api.major field that provides major version of Lua API. Added vifm.version.api.minor field that provides minor version of Lua API. Added vifm.version.api.patch field that provides patch version of Lua API. Added vifm.version.api.has() that will check presence of features some day. Added vifm.version.api.atleast() that checks version of Lua API. Added VifmEntry.classify table that describes name decorations. Added VifmEntry.name field that provides name of the file. Added VifmEntry.location field that provides location of the file. Added VifmEntry.size field that provides size of the file in bytes. Added VifmEntry.atime field that provides file access time (e.g., read, executed). Added VifmEntry.ctime field that provides file change time (changes in metadata, like mode). Added VifmEntry.mtime field that provides file modification time (when file contents is changed). Added VifmEntry.type field that provides type of the entry. Added VifmEntry.folded field that shows whether this entry is folded. Added VifmEntry.selected field that shows whether this entry is selected. Added VifmEntry.match field that shows whether this entry is a search match. Added VifmEntry.matchstart field that provides start position of a substring found in file's name. Added VifmEntry.matchend field that provides end position of a substring found in file's name. Added VifmEntry:gettarget() that gets target of a symbolic link (not to be confused with real path resolution). Added VifmJob:wait() that waits for the job to finish. Added VifmJob:exitcode() that retrieves exit code of the job. Added VifmJob:stdin() that retrieves stream associated with standard input of the job. Added VifmJob:stdout() that retrieves stream associated with standard output of the job. Added VifmJob:errors() that retrieves data collected from error stream of the job. Added VifmView.locopts table of location-specific values of view-specific options. Added VifmView.viewopts table of "global" values of view-specific options. Added VifmView.currententry field that provides index of the current entry. Added VifmView.cwd field that provides location of the current view. Added VifmView.entrycount field that provides number of entries in the view. Added VifmView:cd() that changes location of the view. Added VifmView:entry() that retrieves an entry by index. ./THANKS0000600000175000017500000001360515051153266010661 0ustar korykoryPeople named in this file helped make Vifm better, less buggy and more portable by providing their ideas, suggestions, bug reports and time for testing. Names (or nick names) are in alphabetical order. Special thanks go to these individuals who actively participated in development and testing of large number of features: * Alexandre Viau * Colin Cartade * filterfalse * Svyatoslav Mishyn (juef) 45jqlakjrf87ayte7hy34ter4nguijauzl4eitk 702b Abdó Roig-Maranges (aroig) AERDU afsheenb Afz agguser aksr Alborz Jafari Alejandro Pulver (alepulver) Aleksandr Vysotskiy (loki1368) aleksejrs Alexandr Keyp (IAmKapuze) Alexandru Geana (alegen) Allan Neal (akneal) Allison McNulty (allora) AndreaHasani Andrew Lannan Andrew Savchenko Anton Gepting Anton Kochkov (XVilka) Artur F. (arturfabriciohahaedgy) Artur Shaik (artur-shaik) astrell AtomToast Aurelio Sanabria (Sufrostico) aw-cloud Azin Sharaf b0x4it Badalisc Bas Bossink (basbossink) Bearcat M. Şándor (bearcatsandor) Behrooz Ben Boeckel (mathstuf) Ben Elan Ben Lu (ayroblu) Bernhard Grotz bitraid blurm Branislav Gerazov bratekarate Brian Callahan (ibara) Bruce Hunsaker (hunsakerbn) bsdmp c02y Canute (canute24) CaptainFantastic Carl Mueller (carlmuller) Carlos Pita Charles Kauffman chelovechishko Chema Alonso Josa (nimiux) chenrui333 ChongChong He Christian Fillion (cfillion) Christian Herdtweck Christoph (informationen) Christoph Schmidpeter ckester Coco 17dec CoreCube Cosmin Popescu (cosminadrianpopescu) CosmosAtlas dalvand Damian Ariel Perticone dancread Daniel Dettlaff (dmilith) Daniel J. Perry (BioBox) Daniel Mueller (d-e-s-o) Daniel Polanco (dlpolanco) Daniel R. (reicheltd) David Sierra DiazGranados (davidsierradz) dcb314 Denis Protivenskiy Dennis Hamester Dennis Preiser (0xDP) DieSpinne dikiy Diogo Lemos (dmlemos) Dmitry Frank (dimonomid) dmocek eco0414 Ed Pavlov Egor Gumenyuk (boo1ean) einhander elricbk emarsk emorozov Evgeniy (iron-udjin) Factorial Prime Fang (peromage) feekApp Flaviu Tamas (flaviut) Florian Baumann (derflob) flux242 FlyCat (yanwh0311) fogine fohrums gammaray gcmt Gene Zharov geo909 GeorgeHJ ggbari Gomme Bidule granderil greye Grueslayer gruvw gtors GummyGun hacksenwerk Hans Bieshaar Hans Kristian Otnes Berge Hans Petter Jansson (hpjansson) heelsleeh Hendrik Jaeger (henk) Henrik Holst (hholst80) hofheinz hutou iambumblehead iboggs infinitewhileloop Ink (inknoir) intelfx iSeeU816 itshog IvanBarsukov j-xella J. Reis Jakob Helmecke James Dietrich Janek (xeruf) Jason Dreisbach (jtdreisb) Jason W. Ryan jc-SpaceXp jcarreja Jeet Sukumaran (jeetsukumaran) Jeffrey C. Albro (jalbro) Jeremy Yuan Jiji Jing Liu Jiri Wiesner (jiriwiesner) Jochen Schweizer (durcheinandr) Johannes (johannesmeng) John Fred Fadrigalan (cevhyruz) John Magolske John Shea (coachshea) Jose Riha (jose1711) Joseph LP (ootput) Josh Wainwright (joshaw) Joshua Jensch (patroclos) jsmith51 (metal.lunchbox) justpretending2 kalterfive kangshugang Karol M. Langner (langner) kazufukurou Ken Allen (cardboard42) Kendrick Taylor (sixcircuit) khaoos-abominable Konst Mayer (cdlscpmv) Kornel ks1c ksandr1v laggardkernel landhar Larry Hynes (larryhynes) laur89 lcj LinArcX Lomov Vladimir (lomov_vl) loongw Losiara Luka Markušić (mark2185) lyuts M Kelly m-fonseca m-kru Ma_Sys.ma MadMaverick9 makijato Marcin Juszkiewicz (hrw) Marcin Kurczewski (rr-) Marcos Cruz Marius Schmidl Mark S. (Markuzcha) Markus Elfring (elfring) Martin Fischer Marton Balazs (balmar) mateusz28 Matt Alexander (mattalexx) Matthias Braun (mb720) maxigaz Melandel Merovius mhdzli Michael Corvin Michael Kopp Michael Maddern (madders) Michael Vetter (jubalh) michaellee8 Michal Belica (beli-sk) Michel Normand Michelle Bonk (unixtechie) Michka Popoff (iMichka) midrare Miguel Madrid Mencía (mimame) MikeLemon Milan Svoboda (tex) Miles (pkordy) mini-turtle Miodrag Tokić (loonies) mrajner Muhammed Zakir Mukund Mauji (maujim) mvucBmM0 mwgkgk nandox nicodebo nobodyatandnothing Normen Hansen (normen) NRK obtroston octos Oleg Gordienko (gordio) Olmo Kramer Ondrej Novy (onovy) oo- opennota Oskar Grunning (sQVe) ovk p-kolacz Pavel (neoascetic) Pavel Platto (hinidu) Pavneet Arora Paweł Smolak (psmolak) Peter Barnes petRUShka phanium (a.k.a. phanen) phijor Phil Runninger Philipp Philipp Glira (pglira) Pierre Dorbais (chdorb) Pierric82 piotryordanov PRESFIL qadzek qinghao (haobug) qsmodo Quaddroo r0ck r44083 rafasc Rainer Suhm Ralf Schmitt randomizedthinking ratnamhof rbong Reece Petersen Regis ret2src RetekBacsi Reva Revadigar Richard Benson Robert Pergl (perglr) Robert Sarkozi Roger Bongers rok (aca) Roland Roman Plášil (Quiark) Ross Hadden (rosshadden) RR0925 Ruslan Osmanov (rosmanov) Russell Urquhart rwtallant13 Safal Piya (mrsafalpiya) SanLe santhoshr Sassan Haradji (sassanh) Schmalzhaf Stefan Schrijvers Luc (Begasus) SearyBlue Sebastian Cyprych Seok Won Lee (ijleesw) Sergei Shilovsky Sergei Trofimovich (trofi) Seth VanHeulen (svanheulen) Shakil Akhtar sharklasers996 Shawn Young (drphys) Shuo (shenqshuoh) sirex (sirexas) Sitaram Chamarty smoothdad smpolymen Snake52996 spence91 Stas Malavin Stas Panteleev Stephano (cao) Stephen Horst (sjhorst) Stephen L. Holtz (stephenholtz) StillSteal Stéphane (istib) sublimal sudo-nice Svadkos Svenn Are Bjerkem (svenn) svenn71 Svetlozar Iliev (asmodeus812) Sylwia Ptasinska (SylEleuth) Szilárd Andai tagwint Taras Halturin (halturin) tcftbl th1rdey3 The Cyberduck TheMystifyingCharacter theorlangur ThePlaguebump Thomas Nemeth Tiago Tim Schaeffer (Numeromancer) Toan Nguyen (toan2406) TobiSGD Toby Hawkins (HawkinsT) Tom Jansen Tomek K. (TomiCode) TornaxO7 Tuan Bui (tuanbass) tYGjQCsvVI Tykin Tyler Spivey Typo user451421541757324 Vadim Curcă Valery Ushakov (nbuwe) verdult Vigi Vlad Glagolev (Stealth) vodbyte Von Welch vuenn vzel willemw12 Xirui Zhao (xiruizhao) y2kbugger Yang Zou yanzhang0219 Yuriy Artemyev (anuvyklack) Yusuf Aktepe Zeng (Bekaboo) zoj613 zpxue Zsolt Udvari (uzsolt) zsugabubus zzx41375004 Евгений Жаров (ezharov) Сергей Соловьёв (Sergej Soloviov) 高浩亮 (haolian9) ./README0000600000175000017500000000403615051153266010624 0ustar korykoryVifm - Vim-like file manager 2001 - 2025 Version: 0.14.3 This file last updated: 04 June 2025 Brief Description Vifm is a Vim-like file manager with curses interface extended with some useful ideas from mutt. If you use Vim, Vifm gives you complete keyboard control over your files without having to learn a new set of commands. It goes not just about Vim-like keybindings, but also about modes, options, registers, commands and other things you might already like in Vim. Just like Vim, Vifm tries to adhere to the Unix philosophy. So instead of working solutions which are set in stone user is provided with a set of means for customization of Vifm to one's likings. Though builtin functionality should be enough for most of use cases. Contacts Website: https://vifm.info/ Wiki: https://wiki.vifm.info/ Q&A: https://q2a.vifm.info/ Bugs and feature requests can be reported at: * https://github.com/vifm/vifm/issues * https://sourceforge.net/p/vifm/_list/tickets The preferred way of posting usage questions is Q&A site: * https://q2a.vifm.info/ Bugs, suggestions and comments can also be communicated via email: * xaizek@posteo.net Read-only and very low traffic news mailing list is at: * vifm-announce@lists.sourceforge.net Subscription form for it is here: * https://lists.sourceforge.net/lists/listinfo/vifm-announce Repositories: * https://sourceforge.net/projects/vifm/ * https://github.com/vifm/vifm Vim plugin: * https://github.com/vifm/vifm.vim Collection of color schemes is available at: * https://github.com/vifm/vifm-colors Their previews can be found at: * https://vifm.info/colorschemes.shtml Configurations for iconic fonts: * https://github.com/cirala/vifm_devicons * https://github.com/yanzhang0219/dotfiles/tree/master/.config/vifm Preview scripts: * https://github.com/cirala/vifmimg * https://github.com/eylles/vifm-sixel-preview * https://github.com/iambumblehead/thu.sh ./tests/0000700000175000017500000000000015051153245011076 5ustar korykory./tests/text_buffer/0000700000175000017500000000000015051153245013413 5ustar korykory./tests/text_buffer/append_linef.c0000600000175000017500000000063015051153245016204 0ustar korykory#include #include "../../src/engine/text_buffer.h" TEST(new_line_is_inserted_between_lines) { vle_textbuf *str = vle_tb_create(); vle_tb_append_linef(str, "%s", "a"); vle_tb_append_linef(str, "%s", "b"); assert_string_equal("a\nb", vle_tb_get_data(str)); vle_tb_free(str); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/text_buffer/suite.c0000600000175000017500000000024015051153245014706 0ustar korykory#include DEFINE_SUITE(); /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/completion/0000700000175000017500000000000015051153245013247 5ustar korykory./tests/completion/completion.c0000600000175000017500000002057015051153245015572 0ustar korykory#include #include /* free() */ #include /* strcmp() */ #include "../../src/engine/completion.h" #include static int reverse_sorter(const char a[], const char b[]); SETUP_ONCE() { try_enable_utf8_locale(); } TEST(general) { char *buf; assert_int_equal(0, vle_compl_add_match("abc", "first")); assert_int_equal(0, vle_compl_add_match("acd", "second")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_match("a")); assert_int_equal(3, vle_compl_get_count()); assert_string_equal("abc", vle_compl_get_items()[0].text); assert_string_equal("first", vle_compl_get_items()[0].descr); assert_string_equal("acd", vle_compl_get_items()[1].text); assert_string_equal("second", vle_compl_get_items()[1].descr); assert_string_equal("a", vle_compl_get_items()[2].text); assert_string_equal("", vle_compl_get_items()[2].descr); assert_int_equal(-1, vle_compl_get_pos()); buf = vle_compl_next(); assert_string_equal("abc", buf); free(buf); assert_int_equal(0, vle_compl_get_pos()); buf = vle_compl_next(); assert_string_equal("acd", buf); free(buf); assert_int_equal(1, vle_compl_get_pos()); buf = vle_compl_next(); assert_string_equal("a", buf); free(buf); assert_int_equal(2, vle_compl_get_pos()); buf = vle_compl_next(); assert_string_equal("abc", buf); free(buf); assert_int_equal(0, vle_compl_get_pos()); buf = vle_compl_next(); assert_string_equal("acd", buf); free(buf); } TEST(sorting) { char *buf; assert_int_equal(0, vle_compl_add_match("acd", "")); assert_int_equal(0, vle_compl_add_match("abc", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_match("a")); buf = vle_compl_next(); assert_string_equal("abc", buf); free(buf); buf = vle_compl_next(); assert_string_equal("acd", buf); free(buf); buf = vle_compl_next(); assert_string_equal("a", buf); free(buf); buf = vle_compl_next(); assert_string_equal("abc", buf); free(buf); } TEST(custom_sorter) { char *buf; vle_compl_set_sorter(&reverse_sorter); assert_int_equal(0, vle_compl_add_match("a", "")); assert_int_equal(0, vle_compl_add_match("b", "")); assert_int_equal(0, vle_compl_add_match("c", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_match("x")); buf = vle_compl_next(); assert_string_equal("c", buf); free(buf); buf = vle_compl_next(); assert_string_equal("b", buf); free(buf); buf = vle_compl_next(); assert_string_equal("a", buf); free(buf); buf = vle_compl_next(); assert_string_equal("x", buf); free(buf); buf = vle_compl_next(); assert_string_equal("c", buf); free(buf); } TEST(one_element_completion) { char *buf; vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_match("a", "")); buf = vle_compl_next(); assert_string_equal("a", buf); free(buf); buf = vle_compl_next(); assert_string_equal("a", buf); free(buf); buf = vle_compl_next(); assert_string_equal("a", buf); free(buf); buf = vle_compl_next(); assert_string_equal("a", buf); free(buf); } TEST(one_unambiguous_completion) { char *buf; assert_int_equal(0, vle_compl_add_match("abcd", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_match("a")); buf = vle_compl_next(); assert_string_equal("abcd", buf); free(buf); buf = vle_compl_next(); assert_string_equal("abcd", buf); free(buf); } TEST(rewind_one_unambiguous_completion) { char *buf; assert_int_equal(0, vle_compl_add_match("abcd", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_match("a")); buf = vle_compl_next(); assert_string_equal("abcd", buf); free(buf); buf = vle_compl_next(); assert_string_equal("abcd", buf); free(buf); vle_compl_rewind(); buf = vle_compl_next(); assert_string_equal("a", buf); free(buf); buf = vle_compl_next(); assert_string_equal("abcd", buf); free(buf); } TEST(rewind_completion) { char *buf; assert_int_equal(0, vle_compl_add_match("acd", "")); assert_int_equal(0, vle_compl_add_match("abc", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_match("a")); buf = vle_compl_next(); assert_string_equal("abc", buf); free(buf); vle_compl_rewind(); free(vle_compl_next()); buf = vle_compl_next(); assert_string_equal("abc", buf); free(buf); buf = vle_compl_next(); assert_string_equal("acd", buf); free(buf); vle_compl_rewind(); free(vle_compl_next()); buf = vle_compl_next(); assert_string_equal("abc", buf); free(buf); buf = vle_compl_next(); assert_string_equal("acd", buf); free(buf); buf = vle_compl_next(); assert_string_equal("a", buf); free(buf); buf = vle_compl_next(); assert_string_equal("abc", buf); free(buf); } TEST(direction) { char *buf; assert_int_equal(0, vle_compl_add_match("aa", "")); assert_int_equal(0, vle_compl_add_match("az", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_match("a")); vle_compl_set_reversed(1); buf = vle_compl_next(); assert_string_equal("az", buf); free(buf); buf = vle_compl_next(); assert_string_equal("aa", buf); free(buf); buf = vle_compl_next(); assert_string_equal("a", buf); free(buf); } TEST(umbiguous_begin) { char *buf; assert_int_equal(0, vle_compl_add_match("sort", "")); assert_int_equal(0, vle_compl_add_match("sortorder", "")); assert_int_equal(0, vle_compl_add_match("sortnumbers", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_match("sort")); buf = vle_compl_next(); assert_string_equal("sort", buf); free(buf); buf = vle_compl_next(); assert_string_equal("sortnumbers", buf); free(buf); buf = vle_compl_next(); assert_string_equal("sortorder", buf); free(buf); buf = vle_compl_next(); assert_string_equal("sort", buf); free(buf); buf = vle_compl_next(); assert_string_equal("sort", buf); free(buf); } TEST(two_matches) { char *buf; assert_int_equal(0, vle_compl_add_match("mountpoint", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_match("mount", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_match("mount")); buf = vle_compl_next(); assert_string_equal("mountpoint", buf); free(buf); buf = vle_compl_next(); assert_string_equal("mount", buf); free(buf); buf = vle_compl_next(); assert_string_equal("mount", buf); free(buf); buf = vle_compl_next(); assert_string_equal("mountpoint", buf); free(buf); } TEST(removes_duplicates) { char *buf; assert_int_equal(0, vle_compl_add_match("mou", "")); assert_int_equal(0, vle_compl_add_match("mount", "")); assert_int_equal(0, vle_compl_add_match("mount", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_match("m")); buf = vle_compl_next(); assert_string_equal("mou", buf); free(buf); buf = vle_compl_next(); assert_string_equal("mount", buf); free(buf); buf = vle_compl_next(); assert_string_equal("m", buf); free(buf); buf = vle_compl_next(); assert_string_equal("mou", buf); free(buf); } TEST(unicode_sorting, IF(utf8_locale)) { /* Hex-coded names are öäüßÖÄÜ written with and without compount * characters. */ const char *compounds = "\x6f\xcc\x88\x61\xcc\x88\x75\xcc\x88\xc3\x9f\x4f\xcc\x88\x41\xcc\x88\x55" "\xcc\x88"; const char *non_compounds = "\xc3\xb6\xc3\xa4\xc3\xbc\xc3\x9f\xc3\x96\xc3\x84\xc3\x9c"; assert_int_equal(0, vle_compl_add_match("a", "")); assert_int_equal(0, vle_compl_add_match("A", "")); assert_int_equal(0, vle_compl_add_match(compounds, "")); assert_int_equal(0, vle_compl_add_match(non_compounds, "")); assert_int_equal(0, vle_compl_add_match("ß", "")); assert_int_equal(0, vle_compl_add_match("Ö", "")); assert_int_equal(0, vle_compl_add_match("ö", "")); assert_int_equal(0, vle_compl_add_match("p", "")); vle_compl_finish_group(); char *buf; buf = vle_compl_next(); assert_string_equal("A", buf); free(buf); buf = vle_compl_next(); assert_string_equal("Ö", buf); free(buf); buf = vle_compl_next(); assert_string_equal("a", buf); free(buf); buf = vle_compl_next(); assert_string_equal("ö", buf); free(buf); buf = vle_compl_next(); assert_string_equal(compounds, buf); free(buf); buf = vle_compl_next(); assert_string_equal(non_compounds, buf); free(buf); buf = vle_compl_next(); assert_string_equal("p", buf); free(buf); } static int reverse_sorter(const char a[], const char b[]) { int r = strcmp(a, b); return (r < 0 ? 1 : (r > 0 ? -1 : 0)); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/completion/add_hook.c0000600000175000017500000000534715051153245015176 0ustar korykory#include #include /* NULL */ #include /* free() */ #include "../../src/engine/completion.h" #include "../../src/utils/str.h" static char * add_dquotes(const char match[]) { return format_str("\"%s\"", match); } TEST(set_add_path_hook_sets_hook) { char *match; vle_compl_set_add_path_hook(&add_dquotes); assert_int_equal(0, vle_compl_add_path_match("a b c")); assert_int_equal(0, vle_compl_add_path_match("a b")); assert_int_equal(0, vle_compl_add_path_match("a")); vle_compl_finish_group(); assert_int_equal(3, vle_compl_get_count()); match = vle_compl_next(); assert_string_equal("\"a b c\"", match); free(match); match = vle_compl_next(); assert_string_equal("\"a b\"", match); free(match); match = vle_compl_next(); assert_string_equal("\"a\"", match); free(match); vle_compl_set_add_path_hook(NULL); } TEST(set_add_path_hook_resets_hook) { char *match; vle_compl_set_add_path_hook(&add_dquotes); assert_int_equal(0, vle_compl_add_path_match("a b")); assert_int_equal(0, vle_compl_add_path_match("x y")); vle_compl_set_add_path_hook(NULL); assert_int_equal(0, vle_compl_add_path_match("a b c")); vle_compl_finish_group(); assert_int_equal(3, vle_compl_get_count()); match = vle_compl_next(); assert_string_equal("\"a b\"", match); free(match); match = vle_compl_next(); assert_string_equal("\"x y\"", match); free(match); match = vle_compl_next(); assert_string_equal("a b c", match); free(match); } TEST(last_match_is_pre_processed) { char *match; vle_compl_set_add_path_hook(&add_dquotes); assert_int_equal(0, vle_compl_add_path_match("a b")); assert_int_equal(0, vle_compl_add_path_match("a b c")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_path_match("a")); assert_int_equal(3, vle_compl_get_count()); match = vle_compl_next(); assert_string_equal("\"a b c\"", match); free(match); match = vle_compl_next(); assert_string_equal("\"a b\"", match); free(match); match = vle_compl_next(); assert_string_equal("\"a\"", match); free(match); } TEST(set_add_path_hook_does_not_affect_non_path_functions) { char *match; vle_compl_set_add_path_hook(&add_dquotes); assert_int_equal(0, vle_compl_add_match("a b", "")); assert_int_equal(0, vle_compl_add_match("a b c", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_last_match("a")); assert_int_equal(3, vle_compl_get_count()); match = vle_compl_next(); assert_string_equal("a b", match); free(match); match = vle_compl_next(); assert_string_equal("a b c", match); free(match); match = vle_compl_next(); assert_string_equal("a", match); free(match); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/completion/groups_unite.c0000600000175000017500000000273415051153245016146 0ustar korykory#include #include #include "../../src/engine/completion.h" TEST(unite_removes_duplicates) { char *buf; assert_int_equal(0, vle_compl_add_match("echo", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_match("ec", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_match("echo", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_match("e", "")); assert_int_equal(4, vle_compl_get_count()); vle_compl_unite_groups(); assert_int_equal(3, vle_compl_get_count()); buf = vle_compl_next(); assert_string_equal("e", buf); free(buf); buf = vle_compl_next(); assert_string_equal("ec", buf); free(buf); buf = vle_compl_next(); assert_string_equal("echo", buf); free(buf); } TEST(unite_sorts) { char *buf; assert_int_equal(0, vle_compl_add_match("ecz", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_match("ecj", "")); vle_compl_finish_group(); assert_int_equal(0, vle_compl_add_match("eca", "")); vle_compl_finish_group(); assert_int_equal(3, vle_compl_get_count()); vle_compl_unite_groups(); assert_int_equal(3, vle_compl_get_count()); buf = vle_compl_next(); assert_string_equal("eca", buf); free(buf); buf = vle_compl_next(); assert_string_equal("ecj", buf); free(buf); buf = vle_compl_next(); assert_string_equal("ecz", buf); free(buf); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/completion/suite.c0000600000175000017500000000040315051153245014543 0ustar korykory#include #include #include "../../src/engine/completion.h" DEFINE_SUITE(); TEARDOWN() { vle_compl_reset(); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/ionotif/0000700000175000017500000000000015051153245012545 5ustar korykory./tests/ionotif/invoked.c0000600000175000017500000000622715051153245014361 0ustar korykory#include #include /* chmod() */ #include /* NULL */ #include "../../src/io/ioeta.h" #include "../../src/io/ionotif.h" #include "../../src/io/iop.h" #include "../../src/io/ior.h" static void progress_changed(const io_progress_t *progress); static int invoked_eta; static int invoked_progress; static ioeta_estim_t *estim; SETUP() { const io_cancellation_t no_cancellation = {}; estim = ioeta_alloc(NULL, no_cancellation); invoked_eta = 0; invoked_progress = 0; ionotif_register(&progress_changed); } TEARDOWN() { ionotif_register(NULL); ioeta_free(estim); } static void progress_changed(const io_progress_t *progress) { switch(progress->stage) { case IO_PS_ESTIMATING: ++invoked_eta; break; case IO_PS_IN_PROGRESS: ++invoked_progress; break; } } TEST(cp_file_invokes_ionotif) { ioeta_calculate(estim, TEST_DATA_PATH "/read/binary-data", 0); { io_args_t args = { .arg1.src = TEST_DATA_PATH "/read/binary-data", .arg2.dst = SANDBOX_PATH "/binary-data", .estim = estim, }; assert_int_equal(IO_RES_SUCCEEDED, ior_cp(&args)); } assert_int_equal(1, invoked_eta); assert_true(invoked_progress >= 1); } /* Relies on the previous test. */ TEST(mv_file_invokes_ionotif) { ioeta_calculate(estim, SANDBOX_PATH "/copy-of-binary-data", 0); { io_args_t args = { .arg1.src = SANDBOX_PATH "/binary-data", .arg2.dst = SANDBOX_PATH "/copy-of-binary-data", .estim = estim, }; assert_int_equal(IO_RES_SUCCEEDED, ior_mv(&args)); } assert_int_equal(1, invoked_eta); assert_true(invoked_progress >= 1); } /* Relies on the previous test. */ TEST(rm_file_invokes_ionotif) { ioeta_calculate(estim, SANDBOX_PATH "/copy-of-binary-data", 0); { io_args_t args = { .arg1.path = SANDBOX_PATH "/copy-of-binary-data", .estim = estim, }; assert_int_equal(IO_RES_SUCCEEDED, ior_rm(&args)); } assert_int_equal(1, invoked_eta); assert_true(invoked_progress >= 1); } TEST(cp_dir_invokes_ionotif) { ioeta_calculate(estim, TEST_DATA_PATH "/read", 0); { io_args_t args = { .arg1.src = TEST_DATA_PATH "/read", .arg2.dst = SANDBOX_PATH "/read", .estim = estim, }; assert_int_equal(IO_RES_SUCCEEDED, ior_cp(&args)); } assert_int_equal(7, invoked_eta); assert_true(invoked_progress >= 1); } /* Relies on the previous test. */ TEST(mv_dir_invokes_ionotif) { ioeta_calculate(estim, SANDBOX_PATH "/moved-read", 0); { io_args_t args = { .arg1.src = SANDBOX_PATH "/read", .arg2.dst = SANDBOX_PATH "/moved-read", .estim = estim, }; assert_int_equal(IO_RES_SUCCEEDED, ior_mv(&args)); } assert_int_equal(1, invoked_eta); assert_true(invoked_progress >= 1); } /* Relies on the previous test. */ TEST(rm_dir_invokes_ionotif) { ioeta_calculate(estim, SANDBOX_PATH "/moved-read", 0); assert_success(chmod(SANDBOX_PATH "/moved-read", 0700)); { io_args_t args = { .arg1.path = SANDBOX_PATH "/moved-read", .estim = estim, }; assert_int_equal(IO_RES_SUCCEEDED, ior_rm(&args)); } assert_int_equal(7, invoked_eta); assert_true(invoked_progress >= 1); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/ionotif/suite.c0000600000175000017500000000024015051153245014040 0ustar korykory#include DEFINE_SUITE(); /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/0000700000175000017500000000000015051153266012702 5ustar korykory./tests/commands/colorscheme.c0000600000175000017500000001271215051153245015353 0ustar korykory#include #include /* free() snprintf() */ #include /* strcpy() */ #include #include "../../src/cfg/config.h" #include "../../src/compat/fs_limits.h" #include "../../src/ui/color_scheme.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/ui.h" #include "../../src/utils/fs.h" #include "../../src/utils/path.h" #include "../../src/cmd_core.h" static char *saved_cwd; SETUP() { curr_view = &lwin; other_view = &rwin; cmds_init(); saved_cwd = save_cwd(); cs_load_defaults(); make_abs_path(cfg.colors_dir, sizeof(cfg.colors_dir), TEST_DATA_PATH, "color-schemes/", saved_cwd); } TEARDOWN() { vle_cmds_reset(); restore_cwd(saved_cwd); cs_load_defaults(); } TEST(current_colorscheme_is_printed) { strcpy(cfg.cs.name, "test-scheme"); ui_sb_msg(""); assert_failure(cmds_dispatch("colorscheme?", &lwin, CIT_COMMAND)); assert_string_equal("test-scheme", ui_sb_last()); } TEST(unknown_colorscheme_is_not_loaded) { strcpy(cfg.cs.name, "test-scheme"); cfg.cs.color[WIN_COLOR].fg = 1; cfg.cs.color[WIN_COLOR].bg = 2; cfg.cs.color[WIN_COLOR].attr = 3; assert_failure(cmds_dispatch("colorscheme bad-cs-name", &lwin, CIT_COMMAND)); assert_string_equal("test-scheme", cfg.cs.name); assert_int_equal(1, cfg.cs.color[WIN_COLOR].fg); assert_int_equal(2, cfg.cs.color[WIN_COLOR].bg); assert_int_equal(3, cfg.cs.color[WIN_COLOR].attr); cs_load_primary("bad-cs-name"); assert_string_equal("test-scheme", cfg.cs.name); assert_int_equal(1, cfg.cs.color[WIN_COLOR].fg); assert_int_equal(2, cfg.cs.color[WIN_COLOR].bg); assert_int_equal(3, cfg.cs.color[WIN_COLOR].attr); } TEST(good_colorscheme_is_loaded) { strcpy(cfg.cs.name, "test-scheme"); cfg.cs.color[WIN_COLOR].fg = 1; cfg.cs.color[WIN_COLOR].bg = 2; cfg.cs.color[WIN_COLOR].attr = 3; assert_success(cmds_dispatch("colorscheme good", &lwin, CIT_COMMAND)); assert_string_equal("good", cfg.cs.name); assert_int_equal(-1, cfg.cs.color[WIN_COLOR].fg); assert_int_equal(-1, cfg.cs.color[WIN_COLOR].bg); assert_int_equal(0, cfg.cs.color[WIN_COLOR].attr); } TEST(unknown_colorscheme_is_not_associated) { assert_failure(cmds_dispatch("colorscheme bad-name /", &lwin, CIT_COMMAND)); } TEST(colorscheme_is_not_associated_to_a_file) { char path[PATH_MAX + 1]; make_abs_path(path, sizeof(path), TEST_DATA_PATH, "read/very-long-line", saved_cwd); char cmd[PATH_MAX + 1]; snprintf(cmd, sizeof(cmd), "colorscheme good %s", path); assert_failure(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); } TEST(colorscheme_is_not_associated_to_relpath_on_startup) { strcpy(lwin.curr_dir, saved_cwd); assert_success(cmds_dispatch("colorscheme good .", &lwin, CIT_COMMAND)); assert_false(cs_load_local(1, ".")); assert_success(cmds_dispatch("colorscheme name1 name2", &lwin, CIT_COMMAND)); assert_false(cs_load_local(1, "name2")); } TEST(colorscheme_is_associated_to_tildepath_on_startup) { make_abs_path(cfg.home_dir, sizeof(cfg.home_dir), SANDBOX_PATH, "/", saved_cwd); make_abs_path(cfg.colors_dir, sizeof(cfg.colors_dir), SANDBOX_PATH, "colors", saved_cwd); create_dir(SANDBOX_PATH "/colors"); create_file(SANDBOX_PATH "/colors/cs.vifm"); assert_success(cmds_dispatch("colorscheme cs ~/colors", &lwin, CIT_COMMAND)); char *path = expand_tilde("~/colors"); assert_true(cs_load_local(1, path)); free(path); remove_file(SANDBOX_PATH "/colors/cs.vifm"); remove_dir(SANDBOX_PATH "/colors"); } TEST(colorscheme_is_restored_on_bad_name) { strcpy(cfg.cs.name, "test-scheme"); cfg.cs.color[WIN_COLOR].fg = 1; cfg.cs.color[WIN_COLOR].bg = 2; cfg.cs.color[WIN_COLOR].attr = 3; assert_success(cmds_dispatch("colorscheme bad-color", &lwin, CIT_COMMAND)); assert_string_equal("test-scheme", cfg.cs.name); assert_int_equal(1, cfg.cs.color[WIN_COLOR].fg); assert_int_equal(2, cfg.cs.color[WIN_COLOR].bg); assert_int_equal(3, cfg.cs.color[WIN_COLOR].attr); } TEST(colorscheme_is_restored_on_sourcing_error) { strcpy(cfg.cs.name, "test-scheme"); cfg.cs.color[WIN_COLOR].fg = 1; cfg.cs.color[WIN_COLOR].bg = 2; cfg.cs.color[WIN_COLOR].attr = 3; make_abs_path(cfg.colors_dir, sizeof(cfg.colors_dir), TEST_DATA_PATH, "scripts/", saved_cwd); assert_success(cmds_dispatch("colorscheme wrong-cmd-name", &lwin, CIT_COMMAND)); assert_string_equal("test-scheme", cfg.cs.name); assert_int_equal(1, cfg.cs.color[WIN_COLOR].fg); assert_int_equal(2, cfg.cs.color[WIN_COLOR].bg); assert_int_equal(3, cfg.cs.color[WIN_COLOR].attr); } TEST(colorscheme_is_restored_on_multiple_loading_failures) { strcpy(cfg.cs.name, "test-scheme"); cfg.cs.color[WIN_COLOR].fg = 1; cfg.cs.color[WIN_COLOR].bg = 2; cfg.cs.color[WIN_COLOR].attr = 3; assert_success(cmds_dispatch("colorscheme bad-cs-name bad-cmd bad-color", &lwin, CIT_COMMAND)); assert_string_equal("test-scheme", cfg.cs.name); assert_int_equal(1, cfg.cs.color[WIN_COLOR].fg); assert_int_equal(2, cfg.cs.color[WIN_COLOR].bg); assert_int_equal(3, cfg.cs.color[WIN_COLOR].attr); } TEST(first_usable_colorscheme_is_loaded) { strcpy(cfg.cs.name, "test-scheme"); cfg.cs.color[WIN_COLOR].fg = 1; cfg.cs.color[WIN_COLOR].bg = 2; cfg.cs.color[WIN_COLOR].attr = 3; assert_success(cmds_dispatch("colorscheme bad-color good", &lwin, CIT_COMMAND)); assert_string_equal("good", cfg.cs.name); assert_int_equal(-1, cfg.cs.color[WIN_COLOR].fg); assert_int_equal(-1, cfg.cs.color[WIN_COLOR].bg); assert_int_equal(0, cfg.cs.color[WIN_COLOR].attr); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/commands/autocmds.c0000600000175000017500000003045215051153245014670 0ustar korykory#include #include /* NULL */ #include /* snprintf() */ #include #include "../../src/cfg/config.h" #include "../../src/compat/os.h" #include "../../src/compat/fs_limits.h" #include "../../src/engine/autocmds.h" #include "../../src/ui/statusbar.h" #include "../../src/utils/env.h" #include "../../src/utils/fs.h" #include "../../src/utils/path.h" #include "../../src/utils/str.h" #include "../../src/cmd_core.h" #include "../../src/filelist.h" #include "../../src/status.h" static int change_view_directory(view_t *view, const char path[]); static void check_autocmd_print(const char cmd[], const char output[]); static char sandbox[PATH_MAX + 1]; static char test_data[PATH_MAX + 1]; static char cmd[PATH_MAX + 1]; SETUP_ONCE() { char cwd[PATH_MAX + 1]; assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(sandbox, sizeof(sandbox), SANDBOX_PATH, "", cwd); make_abs_path(test_data, sizeof(test_data), TEST_DATA_PATH, "", cwd); } SETUP() { curr_view = &lwin; other_view = &rwin; update_string(&cfg.slow_fs_list, ""); cmds_init(); opt_handlers_setup(); view_setup(&lwin); view_setup(&rwin); } TEARDOWN() { view_teardown(&lwin); view_teardown(&rwin); opt_handlers_teardown(); update_string(&cfg.slow_fs_list, NULL); vle_aucmd_remove(NULL, NULL); } TEST(no_args_lists_elements) { assert_failure(cmds_dispatch("autocmd", &lwin, CIT_COMMAND)); } TEST(addition_start) { snprintf(cmd, sizeof(cmd), "autocmd * '%s' let $a = 1", sandbox); assert_failure(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); } TEST(addition_match) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "autocmd DirEnter '%s' let $a = 1", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("1", env_get("a")); } TEST(autocmd_is_whole_line_command) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "autocmd DirEnter '%s' let $a = 1 | let $a = 2", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("2", env_get("a")); } TEST(addition_no_match) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "autocmd DirEnter '%s' let $a = 1", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, test_data) >= 0); assert_string_equal("x", env_get("a")); } TEST(remove_exact_match) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "autocmd DirEnter '%s' let $a = 1", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "autocmd! DirEnter '%s'", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("x", env_get("a")); } TEST(remove_event_match) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "autocmd DirEnter '%s' let $a = 1", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("autocmd! DirEnter", &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("x", env_get("a")); } TEST(remove_path_match) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "autocmd DirEnter '%s' let $a = 1", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "autocmd! * '%s'", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("x", env_get("a")); } TEST(remove_all) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "autocmd DirEnter '%s' let $a = 1", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("autocmd!", &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("x", env_get("a")); } TEST(remove_too_many_args) { assert_failure(cmds_dispatch("autocmd! a b c", &lwin, CIT_COMMAND)); } TEST(extra_slash_is_fine) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "auto DirEnter '%s/' let $a = 1", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("1", env_get("a")); } TEST(error_on_wrong_event_name) { assert_failure(cmds_dispatch("autocmd some /path let $a = 1", &lwin, CIT_COMMAND)); } TEST(envvars_are_expanded) { char cmd[PATH_MAX + 1]; assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "let $dir = '%s'", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("autocmd DirEnter $dir let $a = 1", &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("1", env_get("a")); } TEST(pattern_negation) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "auto DirEnter '!%s' let $a = 1", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, test_data) >= 0); assert_string_equal("1", env_get("a")); } TEST(tail_pattern) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("auto DirEnter existing-files let $a = 1", &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, test_data) >= 0); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, "existing-files") >= 0); assert_string_equal("1", env_get("a")); } TEST(multiple_patterns_addition) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "auto DirEnter '%s,ab' let $a = 1", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("1", env_get("a")); } TEST(multiple_patterns_removal) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "auto DirEnter '%s,%s' let $a = 1", sandbox, test_data); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "auto! DirEnter '%s,%s'", sandbox, test_data); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_true(change_view_directory(curr_view, test_data) >= 0); assert_string_equal("x", env_get("a")); } TEST(multiple_patterns_correct_expansion) { /* Each pattern should be expanded on its own, not all pattern string should * be expanded and then broken into patterns. */ assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("let $c = ','", &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "auto DirEnter '%s$c%s' let $a = 1", sandbox, test_data); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("x", env_get("a")); } TEST(direnter_is_not_triggered_on_leaving_custom_view_to_original_path) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); assert_true(change_view_directory(curr_view, sandbox) >= 0); replace_string(&curr_view->custom.orig_dir, curr_view->curr_dir); curr_view->curr_dir[0] = '\0'; snprintf(cmd, sizeof(cmd), "auto DirEnter '%s' let $a = 1", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_string_equal("x", env_get("a")); } TEST(direnter_can_be_triggered_on_entering_custom_view_to_different_path) { cfg.cvoptions = CVO_AUTOCMDS; snprintf(cmd, sizeof(cmd), "auto DirEnter '%s' let $a = 1", sandbox); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_true(change_view_directory(curr_view, sandbox) >= 0); assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); char path[PATH_MAX + 1]; flist_custom_start(&lwin, "test"); snprintf(path, sizeof(path), "%s/existing-files/a", test_data); flist_custom_add(&lwin, path); snprintf(path, sizeof(path), "%s/existing-files/b", test_data); flist_custom_add(&lwin, path); assert_true(flist_custom_finish(&lwin, CV_REGULAR, 0) == 0); assert_string_equal("1", env_get("a")); cfg.cvoptions = 0; } TEST(direnter_is_triggered_on_leaving_custom_view_to_different_path) { assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); assert_true(change_view_directory(curr_view, sandbox) >= 0); replace_string(&curr_view->custom.orig_dir, curr_view->curr_dir); curr_view->curr_dir[0] = '\0'; snprintf(cmd, sizeof(cmd), "auto DirEnter '%s' let $a = 1", test_data); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, test_data) >= 0); assert_string_equal("1", env_get("a")); } TEST(autocmd_in_vifmrc_affects_only_current_view) { snprintf(cmd, sizeof(cmd), "auto DirEnter '%s' setlocal nodotfiles", test_data); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); lwin.hide_dot = 0; rwin.hide_dot = 0; curr_stats.global_local_settings = 1; assert_true(change_view_directory(curr_view, test_data) >= 0); curr_stats.global_local_settings = 0; assert_true(lwin.hide_dot); assert_false(rwin.hide_dot); } TEST(list_autocmds) { check_autocmd_print("auto DirEnter pat p", "DirEnter pat p"); check_autocmd_print("auto DirEnter !pat n", "DirEnter !pat n"); check_autocmd_print("auto DirEnter 0123456789 0", "DirEnter 0123456789 0"); check_autocmd_print("auto DirEnter 01234567890 1", "DirEnter 01234567890\n" " 1"); check_autocmd_print("auto DirEnter !012345678 2", "DirEnter !012345678 2"); check_autocmd_print("auto DirEnter !0123456789 3", "DirEnter !0123456789\n" " 3"); check_autocmd_print("auto DirEnter looongpattern x", "DirEnter looongpattern\n" " x"); check_autocmd_print("auto DirEnter !looongpattern y", "DirEnter !looongpattern\n" " y"); } /* Windows has various limitations on characters used in file names. */ TEST(tilde_is_expanded_after_negation, IF(not_windows)) { char path[PATH_MAX + 1]; snprintf(path, sizeof(path), "%s/~", sandbox); assert_success(cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND)); assert_success(os_mkdir(path, 0700)); assert_success(cmds_dispatch("auto DirEnter !~ let $a = 1", &lwin, CIT_COMMAND)); assert_string_equal("x", env_get("a")); assert_true(change_view_directory(curr_view, path) >= 0); assert_string_equal("1", env_get("a")); assert_success(rmdir(path)); } static int change_view_directory(view_t *view, const char path[]) { const int ret = change_directory(view, path); if(ret >= 0) { assert_success(populate_dir_list(view, 0)); } return ret; } static void check_autocmd_print(const char cmd[], const char output[]) { assert_success(cmds_dispatch("auto!", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch1(cmd, &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("auto", &lwin, CIT_COMMAND)); assert_string_equal(output, ui_sb_last()); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/sync.c0000600000175000017500000002431515051153245014026 0ustar korykory#include #include /* chdir() rmdir() */ #include /* INT_MAX */ #include /* remove() */ #include /* free() */ #include /* strdup() */ #include #include "../../src/compat/fs_limits.h" #include "../../src/compat/os.h" #include "../../src/cfg/config.h" #include "../../src/ui/column_view.h" #include "../../src/utils/dynarray.h" #include "../../src/utils/fs.h" #include "../../src/utils/path.h" #include "../../src/cmd_core.h" #include "../../src/filelist.h" #include "../../src/filtering.h" static void column_line_print(const char buf[], int offset, AlignType align, const char full_column[], const format_info_t *info); static char *saved_cwd; SETUP() { curr_view = &lwin; other_view = &rwin; cmds_init(); cfg.slow_fs_list = strdup(""); view_setup(&lwin); view_setup(&rwin); lwin.window_rows = 1; rwin.window_rows = 1; saved_cwd = save_cwd(); } TEARDOWN() { restore_cwd(saved_cwd); vle_cmds_reset(); free(cfg.slow_fs_list); cfg.slow_fs_list = NULL; view_teardown(&lwin); view_teardown(&rwin); } TEST(sync_syncs_local_filter) { other_view->curr_dir[0] = '\0'; assert_true(change_directory(curr_view, ".") >= 0); populate_dir_list(curr_view, 0); local_filter_apply(curr_view, "a"); assert_success(cmds_dispatch("sync! location filters", curr_view, CIT_COMMAND)); assert_string_equal("a", other_view->local_filter.filter.raw); } TEST(sync_syncs_filelist) { char cwd[PATH_MAX + 1]; lwin.window_rows = 1; rwin.window_rows = 1; opt_handlers_setup(); assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "..", cwd); flist_custom_start(curr_view, "test"); flist_custom_add(curr_view, TEST_DATA_PATH "/existing-files/a"); flist_custom_add(curr_view, TEST_DATA_PATH "/existing-files/b"); flist_custom_add(curr_view, TEST_DATA_PATH "/existing-files/c"); flist_custom_add(curr_view, TEST_DATA_PATH "/rename/a"); make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "existing-files", cwd); assert_true(flist_custom_finish(curr_view, CV_VERY, 0) == 0); curr_view->list_pos = 3; assert_success(cmds_dispatch("sync! filelist cursorpos", curr_view, CIT_COMMAND)); assert_true(flist_custom_active(other_view)); assert_int_equal(curr_view->list_rows, other_view->list_rows); assert_int_equal(curr_view->list_pos, other_view->list_pos); opt_handlers_teardown(); } TEST(sync_removes_leafs_and_tree_data_on_converting_tree_to_cv) { lwin.window_rows = 2; rwin.window_rows = 2; opt_handlers_setup(); assert_success(os_mkdir(SANDBOX_PATH "/dir", 0700)); assert_non_null(get_cwd(curr_view->curr_dir, sizeof(curr_view->curr_dir))); assert_success(flist_load_tree(curr_view, SANDBOX_PATH, INT_MAX)); assert_int_equal(2, curr_view->list_rows); assert_success(cmds_dispatch("sync! filelist", curr_view, CIT_COMMAND)); restore_cwd(saved_cwd); saved_cwd = save_cwd(); assert_true(flist_custom_active(other_view)); assert_int_equal(1, other_view->list_rows); assert_int_equal(0, other_view->dir_entry[0].child_count); assert_int_equal(0, other_view->dir_entry[0].child_pos); assert_int_equal(CV_VERY, other_view->custom.type); assert_success(rmdir(SANDBOX_PATH "/dir")); opt_handlers_teardown(); } TEST(sync_syncs_trees) { char cwd[PATH_MAX + 1]; columns_set_line_print_func(&column_line_print); other_view->columns = columns_create(); assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "..", cwd); assert_success(flist_load_tree(curr_view, TEST_DATA_PATH "/tree", INT_MAX)); curr_view->dir_entry[0].selected = 1; curr_view->selected_files = 1; flist_custom_exclude(curr_view, 1); assert_int_equal(0, curr_view->selected_files); assert_success(cmds_dispatch("sync! tree", curr_view, CIT_COMMAND)); assert_true(flist_custom_active(other_view)); curr_stats.load_stage = 2; load_saving_pos(other_view); curr_stats.load_stage = 0; assert_int_equal(curr_view->list_rows, other_view->list_rows); columns_teardown(); } TEST(sync_all_does_not_turn_destination_into_tree) { columns_setup_column(SK_BY_NAME); columns_setup_column(SK_BY_SIZE); columns_set_line_print_func(&column_line_print); opt_handlers_setup(); other_view->curr_dir[0] = '\0'; other_view->custom.type = CV_REGULAR; other_view->columns = columns_create(); assert_true(change_directory(curr_view, SANDBOX_PATH) >= 0); populate_dir_list(curr_view, 0); local_filter_apply(curr_view, "a"); assert_success(cmds_dispatch("sync! all", curr_view, CIT_COMMAND)); assert_false(other_view->custom.type == CV_TREE); opt_handlers_teardown(); columns_teardown(); } TEST(sync_localopts_clones_local_options) { columns_setup_column(SK_BY_NAME); columns_setup_column(SK_BY_SIZE); columns_set_line_print_func(&column_line_print); lwin.hide_dot = 1; lwin.hide_dot_g = 1; rwin.hide_dot = 0; rwin.hide_dot_g = 0; opt_handlers_setup(); other_view->curr_dir[0] = '\0'; other_view->custom.type = CV_REGULAR; other_view->columns = columns_create(); assert_true(change_directory(curr_view, SANDBOX_PATH) >= 0); populate_dir_list(curr_view, 0); local_filter_apply(curr_view, "a"); assert_success(cmds_dispatch("sync! localopts", curr_view, CIT_COMMAND)); assert_true(rwin.hide_dot_g); assert_true(rwin.hide_dot); opt_handlers_teardown(); columns_teardown(); } TEST(tree_syncing_applies_properties_of_destination_view) { char cwd[PATH_MAX + 1]; columns_set_line_print_func(&column_line_print); other_view->columns = columns_create(); assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "..", cwd); assert_success(flist_load_tree(curr_view, TEST_DATA_PATH "/tree", INT_MAX)); /* Exclusion. */ curr_view->dir_entry[0].selected = 1; curr_view->selected_files = 1; flist_custom_exclude(curr_view, 1); assert_int_equal(0, curr_view->selected_files); /* Folding. */ curr_view->list_pos = 0; flist_toggle_fold(curr_view); /* Local filter (ignored here because we change directory of the other view, * is this a bug?). */ local_filter_apply(other_view, "d"); assert_success(cmds_dispatch("sync! tree", curr_view, CIT_COMMAND)); assert_int_equal(2, other_view->list_rows); assert_string_equal("", other_view->local_filter.filter.raw); assert_true(flist_custom_active(other_view)); curr_stats.load_stage = 2; load_saving_pos(other_view); curr_stats.load_stage = 0; assert_int_equal(2, other_view->list_rows); assert_string_equal("", other_view->local_filter.filter.raw); columns_teardown(); } static void column_line_print(const char buf[], int offset, AlignType align, const char full_column[], const format_info_t *info) { /* Do nothing. */ } TEST(symlinks_in_paths_are_not_resolved, IF(not_windows)) { char buf[PATH_MAX + 1]; char canonic_path[PATH_MAX + 1]; char src[PATH_MAX + 1], dst[PATH_MAX + 1]; make_abs_path(src, sizeof(src), TEST_DATA_PATH, "existing-files", saved_cwd); make_abs_path(dst, sizeof(dst), SANDBOX_PATH, "dir-link", saved_cwd); assert_success(make_symlink(src, dst)); assert_success(chdir(SANDBOX_PATH "/dir-link")); make_abs_path(buf, sizeof(buf), SANDBOX_PATH, "dir-link", saved_cwd); to_canonic_path(buf, "/fake-root", curr_view->curr_dir, sizeof(curr_view->curr_dir)); assert_success(cmds_dispatch("sync ../dir-link/..", curr_view, CIT_COMMAND)); restore_cwd(saved_cwd); saved_cwd = save_cwd(); make_abs_path(buf, sizeof(buf), SANDBOX_PATH, "", saved_cwd); to_canonic_path(buf, "/fake-root", canonic_path, sizeof(canonic_path)); assert_string_equal(canonic_path, other_view->curr_dir); assert_success(remove(SANDBOX_PATH "/dir-link")); } TEST(incorrect_parameter_causes_error) { assert_failure(cmds_dispatch("sync! nosuchthing", curr_view, CIT_COMMAND)); } TEST(sync_syncs_custom_trees) { char test_data[PATH_MAX + 1]; char path[PATH_MAX + 1]; opt_handlers_setup(); columns_setup_column(SK_BY_NAME); columns_setup_column(SK_BY_SIZE); columns_set_line_print_func(&column_line_print); other_view->columns = columns_create(); make_abs_path(test_data, sizeof(test_data), TEST_DATA_PATH, "", saved_cwd); flist_custom_start(curr_view, "test"); snprintf(path, sizeof(path), "%s/%s", test_data, "compare"); flist_custom_add(curr_view, path); snprintf(path, sizeof(path), "%s/%s", test_data, "read"); flist_custom_add(curr_view, path); snprintf(path, sizeof(path), "%s/%s", test_data, "rename"); flist_custom_add(curr_view, path); snprintf(path, sizeof(path), "%s/%s", test_data, "tree"); flist_custom_add(curr_view, path); assert_true(flist_custom_finish(curr_view, CV_REGULAR, 0) == 0); assert_success(flist_load_tree(curr_view, test_data, INT_MAX)); curr_view->dir_entry[0].selected = 1; curr_view->selected_files = 1; flist_custom_exclude(curr_view, 1); assert_int_equal(0, curr_view->selected_files); /* As custom trees. */ assert_success(cmds_dispatch("sync! tree", curr_view, CIT_COMMAND)); assert_true(flist_custom_active(other_view)); curr_stats.load_stage = 2; load_saving_pos(other_view); curr_stats.load_stage = 0; assert_int_equal(CV_CUSTOM_TREE, other_view->custom.type); assert_int_equal(curr_view->list_rows, other_view->list_rows); /* As custom views. */ assert_success(cmds_dispatch("sync! filelist", curr_view, CIT_COMMAND)); assert_true(flist_custom_active(other_view)); assert_int_equal(CV_VERY, other_view->custom.type); opt_handlers_teardown(); columns_teardown(); } TEST(sync_all_applies_filters_in_trees) { opt_handlers_setup(); columns_setup_column(SK_BY_NAME); columns_setup_column(SK_BY_SIZE); columns_set_line_print_func(&column_line_print); other_view->columns = columns_create(); make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "", NULL); assert_success(cmds_dispatch("set cvoptions=localfilter", curr_view, CIT_COMMAND)); assert_success(cmds_dispatch("tree", curr_view, CIT_COMMAND)); local_filter_apply(curr_view, "a"); assert_success(cmds_dispatch("sync! all", curr_view, CIT_COMMAND)); assert_string_equal("a", other_view->local_filter.filter.raw); columns_teardown(); opt_handlers_teardown(); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/regedit.c0000600000175000017500000000610515051153245014472 0ustar korykory#include #include #include "../../src/cfg/config.h" #include "../../src/compat/fs_limits.h" #include "../../src/engine/cmds.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/ui.h" #include "../../src/utils/path.h" #include "../../src/utils/str.h" #include "../../src/cmd_core.h" #include "../../src/registers.h" SETUP() { view_setup(&lwin); curr_view = &lwin; conf_setup(); cmds_init(); regs_init(); } TEARDOWN() { view_teardown(&lwin); curr_view = NULL; conf_teardown(); vle_cmds_reset(); regs_reset(); } TEST(regedit, IF(not_windows)) { create_executable(SANDBOX_PATH "/script"); make_file(SANDBOX_PATH "/script", "#!/bin/sh\n" "sed 's/from/to/' < \"$3\" > \"$3_out\"\n" "mv \"$3_out\" \"$3\"\n"); char vi_cmd[PATH_MAX + 1]; make_abs_path(vi_cmd, sizeof(vi_cmd), SANDBOX_PATH, "script", NULL); update_string(&cfg.vi_command, vi_cmd); ui_sb_msg(""); assert_failure(cmds_dispatch("regedit abc", &lwin, CIT_COMMAND)); assert_string_equal("Invalid argument: abc", ui_sb_last()); assert_failure(cmds_dispatch("regedit _", &lwin, CIT_COMMAND)); assert_string_equal("Cannot modify blackhole register.", ui_sb_last()); assert_failure(cmds_dispatch("regedit %", &lwin, CIT_COMMAND)); assert_string_equal("Register with given name does not exist.", ui_sb_last()); regs_append('a', "/path/before"); regs_append('a', "/path/from-1"); regs_append('a', "/path/from-2"); regs_append('a', "/path/to-2"); regs_append('a', "/path/this-was-after"); assert_success(cmds_dispatch("regedit a", &lwin, CIT_COMMAND)); /* Result should be sorted and without duplicates. */ const reg_t *reg = regs_find('a'); assert_int_equal(4, reg->nfiles); assert_string_equal("/path/before", reg->files[0]); assert_string_equal("/path/this-was-after", reg->files[1]); assert_string_equal("/path/to-1", reg->files[2]); assert_string_equal("/path/to-2", reg->files[3]); remove_file(SANDBOX_PATH "/script"); } TEST(regedit_normalizes_paths, IF(not_windows)) { create_executable(SANDBOX_PATH "/script"); make_file(SANDBOX_PATH "/script", "#!/bin/sh\n" "sed 's/from/to/' < \"$3\" > \"$3_out\"\n" "mv \"$3_out\" \"$3\"\n"); char vi_cmd[PATH_MAX + 1]; make_abs_path(vi_cmd, sizeof(vi_cmd), SANDBOX_PATH, "script", NULL); update_string(&cfg.vi_command, vi_cmd); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), SANDBOX_PATH, "", NULL); regs_append(DEFAULT_REG_NAME, "/abs/path/from-1"); regs_append(DEFAULT_REG_NAME, "from-2"); assert_success(cmds_dispatch("regedit", &lwin, CIT_COMMAND)); /* Result should contain only absolute paths. */ const reg_t *reg = regs_find(DEFAULT_REG_NAME); assert_int_equal(2, reg->nfiles); int rel_idx = (ends_with(reg->files[0], "/to-2") ? 0 : 1); assert_string_equal("/abs/path/to-1", reg->files[1 - rel_idx]); assert_string_ends_with("/to-2", reg->files[rel_idx]); assert_true(is_path_absolute(reg->files[0])); assert_true(is_path_absolute(reg->files[1])); remove_file(SANDBOX_PATH "/script"); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/completion.c0000600000175000017500000004416015051153245015223 0ustar korykory#include #include /* chdir() rmdir() */ #include /* NULL */ #include /* fclose() fopen() free() */ #include /* strdup() strstr() */ #include /* wcsdup() wcslen() */ #include #include "../../src/compat/fs_limits.h" #include "../../src/cfg/config.h" #include "../../src/engine/abbrevs.h" #include "../../src/engine/cmds.h" #include "../../src/engine/completion.h" #include "../../src/engine/functions.h" #include "../../src/engine/options.h" #include "../../src/engine/variables.h" #include "../../src/int/path_env.h" #include "../../src/lua/vlua.h" #include "../../src/modes/cmdline.h" #include "../../src/ui/ui.h" #include "../../src/utils/env.h" #include "../../src/utils/fs.h" #include "../../src/utils/path.h" #include "../../src/utils/str.h" #include "../../src/bmarks.h" #include "../../src/builtin_functions.h" #include "../../src/cmd_core.h" #include "../../src/plugins.h" #include "../lua/asserts.h" #define ASSERT_COMPLETION(initial, expected) \ do \ { \ prepare_for_line_completion(initial); \ assert_success(line_completion(&stats)); \ assert_wstring_equal(expected, stats.line); \ } \ while (0) #define ASSERT_COMPLETION_ENDS_WITH(initial, expected) \ do \ { \ prepare_for_line_completion(initial); \ assert_success(line_completion(&stats)); \ assert_wstring_ends_with(expected, stats.line); \ } \ while (0) #define ASSERT_NO_COMPLETION(initial) ASSERT_COMPLETION((initial), (initial)) #define ASSERT_NEXT_MATCH(str) \ do \ { \ char *const buf = vle_compl_next(); \ assert_string_equal((str), buf); \ free(buf); \ } \ while (0) #define ASSERT_NEXT_MATCH_ENDS_WITH(str) \ do \ { \ char *const buf = vle_compl_next(); \ assert_string_ends_with((str), buf); \ free(buf); \ } \ while (0) static void dummy_handler(OPT_OP op, optval_t val); static void prepare_for_line_completion(const wchar_t str[]); static line_stats_t stats; static char *saved_cwd; SETUP() { static int option_changed; optval_t def = { .str_val = "/tmp" }; cfg.slow_fs_list = strdup(""); init_builtin_functions(); stats.line = wcsdup(L"set "); stats.index = wcslen(stats.line); stats.curs_pos = 0; stats.len = stats.index; stats.cmd_pos = -1; stats.complete_continue = 0; stats.hist_search = 0; stats.hist_search_stash = NULL; stats.complete = &vle_cmds_complete; curr_view = &lwin; cmds_init(); vle_opts_init(&option_changed, NULL); vle_opts_add("fusehome", "fh", "descr", OPT_STR, OPT_GLOBAL, 0, NULL, &dummy_handler, def); vle_opts_add("path", "pt", "descr", OPT_STR, OPT_GLOBAL, 0, NULL, &dummy_handler, def); vle_opts_add("path", "pt", "descr", OPT_STR, OPT_LOCAL, 0, NULL, &dummy_handler, def); saved_cwd = save_cwd(); assert_success(chdir(TEST_DATA_PATH "/compare")); make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "compare", saved_cwd); curr_stats.cs = &cfg.cs; } TEARDOWN() { cs_reset(&cfg.cs); curr_stats.cs = NULL; restore_cwd(saved_cwd); update_string(&cfg.slow_fs_list, NULL); free(stats.line); vle_opts_reset(); function_reset_all(); } TEST(test_set_completion) { ASSERT_COMPLETION(L"set ", L"set all"); } TEST(root_entries_are_completed) { make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "", saved_cwd); assert_success(chdir(curr_view->curr_dir)); prepare_for_line_completion(L"cd /"); assert_success(line_completion(&stats)); assert_true(wcscmp(L"cd /", stats.line) != 0); } TEST(dirs_are_completed_with_trailing_slash) { make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "", saved_cwd); assert_success(chdir(curr_view->curr_dir)); ASSERT_COMPLETION(L"cd r", L"cd read/"); ASSERT_NEXT_MATCH("rename/"); ASSERT_NEXT_MATCH("r"); ASSERT_NEXT_MATCH("read/"); } TEST(tabnew_has_directory_only_completion) { make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "tree/dir1", saved_cwd); assert_success(chdir(curr_view->curr_dir)); ASSERT_COMPLETION(L"tabnew ", L"tabnew dir2/"); ASSERT_NEXT_MATCH("dir2/"); ASSERT_NEXT_MATCH("dir2/"); } TEST(function_name_completion) { ASSERT_COMPLETION(L"echo e", L"echo escape("); ASSERT_NEXT_MATCH("executable("); ASSERT_NEXT_MATCH("expand("); ASSERT_NEXT_MATCH("extcached("); ASSERT_NEXT_MATCH("e"); } TEST(abbreviations) { vle_abbr_reset(); assert_success(vle_abbr_add(L"lhs", L"rhs")); ASSERT_COMPLETION(L"cabbrev l", L"cabbrev lhs"); ASSERT_COMPLETION(L"cnoreabbrev l", L"cnoreabbrev lhs"); ASSERT_COMPLETION(L"cunabbrev l", L"cunabbrev lhs"); ASSERT_NO_COMPLETION(L"cabbrev l l"); vle_abbr_reset(); } TEST(bang_exec_completion) { char *const original_path_env = strdup(env_get("PATH")); restore_cwd(saved_cwd); assert_success(chdir(SANDBOX_PATH)); saved_cwd = save_cwd(); env_set("PATH", saved_cwd); update_path_env(1); create_executable("exec-for-completion" EXE_SUFFIX); ASSERT_COMPLETION(L"!exec-for-com", L"!exec-for-completion" EXE_SUFFIXW); assert_success(unlink("exec-for-completion" EXE_SUFFIX)); env_set("PATH", original_path_env); update_path_env(1); free(original_path_env); } TEST(bang_abs_path_completion) { wchar_t input[PATH_MAX + 1]; wchar_t cmd[PATH_MAX + 1]; char cwd[PATH_MAX + 1]; wchar_t *wcwd; restore_cwd(saved_cwd); saved_cwd = save_cwd(); assert_success(chdir(SANDBOX_PATH)); assert_true(get_cwd(cwd, sizeof(cwd)) == cwd); wcwd = to_wide(cwd); create_executable("exec-for-completion" EXE_SUFFIX); vifm_swprintf(input, ARRAY_LEN(input), L"!%" WPRINTF_WSTR L"/exec-for-compl", wcwd); vifm_swprintf(cmd, ARRAY_LEN(cmd), L"!%" WPRINTF_WSTR L"/exec-for-completion" EXE_SUFFIXW, wcwd); ASSERT_COMPLETION(input, cmd); assert_int_equal(2, vle_compl_get_count()); assert_success(unlink("exec-for-completion" EXE_SUFFIX)); free(wcwd); } TEST(standalone_tilde_is_expanded) { make_abs_path(cfg.home_dir, sizeof(cfg.home_dir), TEST_DATA_PATH, "/", saved_cwd); char *expected = format_str("cd %s", cfg.home_dir); wchar_t *wexpected = to_wide(expected); ASSERT_COMPLETION(L"cd ~", wexpected); free(wexpected); free(expected); } TEST(tilde_is_completed_after_emark) { make_abs_path(cfg.home_dir, sizeof(cfg.home_dir), TEST_DATA_PATH, "/", saved_cwd); ASSERT_COMPLETION(L"!~/", L"!~/color-schemes/"); } TEST(user_name_is_completed_after_tilde, IF(not_windows)) { prepare_for_line_completion(L"cd ~roo"); assert_success(line_completion(&stats)); char *narrow = to_multibyte(stats.line); assert_string_equal(NULL, strstr(narrow, "\\~")); free(narrow); } TEST(bmark_tags_are_completed) { bmarks_clear(); assert_success(cmds_dispatch("bmark! fake/path1 tag1", &lwin, CIT_COMMAND)); ASSERT_COMPLETION(L"bmark tag", L"bmark tag1"); ASSERT_COMPLETION(L"bmark! fake/path2 tag", L"bmark! fake/path2 tag1"); ASSERT_NO_COMPLETION(L"bmark! fake/path2 ../"); ASSERT_COMPLETION(L"bmark! fake/path2 ", L"bmark! fake/path2 tag1"); /* Current tag is added to the list of completions unless it's a duplicate. */ ASSERT_COMPLETION(L"bmark tag1", L"bmark tag1"); assert_int_equal(2, vle_compl_get_count()); ASSERT_COMPLETION(L"bmark tag1 tag1", L"bmark tag1 tag1"); assert_int_equal(1, vle_compl_get_count()); } TEST(bmark_path_is_completed) { bmarks_clear(); make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), SANDBOX_PATH, "", saved_cwd); assert_success(chdir(curr_view->curr_dir)); create_executable("exec-for-completion" EXE_SUFFIX); ASSERT_COMPLETION(L"bmark! exec", L"bmark! exec-for-completion" EXE_SUFFIX); assert_success(unlink("exec-for-completion" EXE_SUFFIX)); } TEST(delbmark_tags_are_completed) { bmarks_clear(); assert_success(cmds_dispatch("bmark! fake/path1 tag1", &lwin, CIT_COMMAND)); ASSERT_COMPLETION(L"delbmark ta", L"delbmark tag1"); } TEST(selective_sync_completion) { ASSERT_COMPLETION(L"sync! a", L"sync! all"); ASSERT_NO_COMPLETION(L"sync! ../"); } TEST(colorscheme_completion) { make_abs_path(cfg.colors_dir, sizeof(cfg.colors_dir), TEST_DATA_PATH, "scripts", saved_cwd); ASSERT_COMPLETION(L"colorscheme set-", L"colorscheme set-env"); ASSERT_COMPLETION(L"colorscheme set-env ../", L"colorscheme set-env ../color-schemes/"); ASSERT_NO_COMPLETION(L"colorscheme ../"); make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "", saved_cwd); ASSERT_COMPLETION(L"colorscheme set-env ", L"colorscheme set-env color-schemes/"); } TEST(wincmd_completion) { ASSERT_COMPLETION(L"wincmd ", L"wincmd +"); ASSERT_NO_COMPLETION(L"wincmd + "); } TEST(grep_completion) { ASSERT_NO_COMPLETION(L"grep -"); ASSERT_NO_COMPLETION(L"grep ."); ASSERT_COMPLETION(L"grep -o ..", L"grep -o ../"); make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "", saved_cwd); assert_success(chdir(curr_view->curr_dir)); ASSERT_COMPLETION(L"grep -o ", L"grep -o color-schemes/"); } TEST(find_completion) { #ifdef _WIN32 /* Windows escaping code doesn't prepend "./". */ ASSERT_NO_COMPLETION(L"find -"); #else ASSERT_COMPLETION(L"find -", L"find ./-"); #endif ASSERT_COMPLETION(L"find ..", L"find ../"); ASSERT_NO_COMPLETION(L"find . ."); make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "", saved_cwd); assert_success(chdir(curr_view->curr_dir)); ASSERT_COMPLETION(L"find ", L"find color-schemes/"); } TEST(aucmd_events_are_completed) { ASSERT_COMPLETION(L"autocmd ", L"autocmd DirEnter"); ASSERT_COMPLETION(L"autocmd Dir", L"autocmd DirEnter"); ASSERT_COMPLETION(L"autocmd! Dir", L"autocmd! DirEnter"); ASSERT_NO_COMPLETION(L"autocmd DirEnter "); } TEST(prefixless_option_name_is_completed) { ASSERT_COMPLETION(L"echo &", L"echo &fusehome"); assert_success(line_completion(&stats)); assert_wstring_equal(L"echo &path", stats.line); } TEST(prefixed_global_option_name_is_completed) { ASSERT_COMPLETION(L"echo &g:f", L"echo &g:fusehome"); } TEST(prefixed_local_option_name_is_completed) { ASSERT_COMPLETION(L"echo &l:p", L"echo &l:path"); } TEST(autocmd_name_completion_is_case_insensitive) { ASSERT_COMPLETION(L"autocmd dir", L"autocmd DirEnter"); } TEST(case_override_of_paths) { make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "existing-files", saved_cwd); assert_success(chdir(curr_view->curr_dir)); cfg.ignore_case = 0; cfg.case_override = CO_PATH_COMPL; cfg.case_ignore = CO_PATH_COMPL; ASSERT_COMPLETION(L"edit A", L"edit a"); cfg.case_override = 0; cfg.case_ignore = 0; } TEST(envvars_are_completed_for_edit) { env_set("RRRRRARE_VARIABLE1", "1"); env_set("RRRRRARE_VARIABLE2", "2"); ASSERT_COMPLETION(L"edit $RRRRRARE_VARIA", L"edit $RRRRRARE_VARIABLE1"); } TEST(builtinvars_are_completed_for_echo) { init_variables(); assert_success(setvar("v:test", var_from_bool(1))); ASSERT_COMPLETION(L"echo v:t", L"echo v:test"); clear_variables(); } TEST(select_is_completed) { env_set("RRRRRARE_VARIABLE1", "1"); env_set("RRRRRARE_VARIABLE2", "2"); ASSERT_NO_COMPLETION(L"select $RRRRRARE_VARIA"); ASSERT_NO_COMPLETION(L"select !/$RRRRRARE_VARIA"); ASSERT_NO_COMPLETION(L"select !cmd some-arg"); /* Check that not memory violations occur here. */ prepare_for_line_completion(L"select !cmd "); assert_success(line_completion(&stats)); ASSERT_COMPLETION(L"select!!$RRRRRARE_VARIA", L"select!!$RRRRRARE_VARIABLE1"); ASSERT_COMPLETION(L"unselect !cat $RRRRRARE_VARIA", L"unselect !cat $RRRRRARE_VARIABLE1"); } TEST(compare_is_completed) { ASSERT_COMPLETION(L"compare by", L"compare bycontents"); ASSERT_COMPLETION(L"compare bysize list", L"compare bysize listall"); } TEST(symlinks_in_paths_are_not_resolved, IF(not_windows)) { restore_cwd(saved_cwd); saved_cwd = save_cwd(); char src[PATH_MAX + 1], dst[PATH_MAX + 1]; make_abs_path(src, sizeof(src), TEST_DATA_PATH, "compare", saved_cwd); make_abs_path(dst, sizeof(dst), SANDBOX_PATH, "dir-link", saved_cwd); assert_success(make_symlink(src, dst)); assert_success(chdir(SANDBOX_PATH "/dir-link")); make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), SANDBOX_PATH, "dir-link", saved_cwd); ASSERT_COMPLETION(L"cd ../d", L"cd ../dir-link/"); restore_cwd(saved_cwd); saved_cwd = save_cwd(); assert_success(remove(SANDBOX_PATH "/dir-link")); } TEST(session_is_completed) { restore_cwd(saved_cwd); saved_cwd = save_cwd(); make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", saved_cwd); create_dir(SANDBOX_PATH "/sessions"); create_dir(SANDBOX_PATH "/sessions/subdir.json"); create_file(SANDBOX_PATH "/sessions/subdir.json/file.json"); create_file(SANDBOX_PATH "/sessions/session-a.json"); create_file(SANDBOX_PATH "/sessions/session-b.json"); ASSERT_COMPLETION(L"session ", L"session session-a"); ASSERT_NEXT_MATCH("session-b"); ASSERT_NEXT_MATCH(""); ASSERT_NO_COMPLETION(L"session session-a .."); ASSERT_NO_COMPLETION(L"session! ses"); ASSERT_NO_COMPLETION(L"session? ses"); remove_file(SANDBOX_PATH "/sessions/session-b.json"); remove_file(SANDBOX_PATH "/sessions/session-a.json"); remove_file(SANDBOX_PATH "/sessions/subdir.json/file.json"); remove_dir(SANDBOX_PATH "/sessions/subdir.json"); remove_dir(SANDBOX_PATH "/sessions"); cfg.config_dir[0] = '\0'; } TEST(delsession_is_completed) { restore_cwd(saved_cwd); saved_cwd = save_cwd(); make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", saved_cwd); create_dir(SANDBOX_PATH "/sessions"); create_dir(SANDBOX_PATH "/sessions/subdir.json"); create_file(SANDBOX_PATH "/sessions/subdir.json/file.json"); create_file(SANDBOX_PATH "/sessions/session-a.json"); create_file(SANDBOX_PATH "/sessions/session-b.json"); ASSERT_COMPLETION(L"delsession ", L"delsession session-a"); ASSERT_NEXT_MATCH("session-b"); ASSERT_NEXT_MATCH(""); ASSERT_NO_COMPLETION(L"delsession session-a .."); ASSERT_NO_COMPLETION(L"delsession! ses"); ASSERT_NO_COMPLETION(L"delsession? ses"); remove_file(SANDBOX_PATH "/sessions/session-b.json"); remove_file(SANDBOX_PATH "/sessions/session-a.json"); remove_file(SANDBOX_PATH "/sessions/subdir.json/file.json"); remove_dir(SANDBOX_PATH "/sessions/subdir.json"); remove_dir(SANDBOX_PATH "/sessions"); cfg.config_dir[0] = '\0'; } TEST(plugin_is_completed) { ASSERT_COMPLETION(L"plugin ", L"plugin blacklist"); ASSERT_NEXT_MATCH("load"); ASSERT_NEXT_MATCH("whitelist"); ASSERT_NEXT_MATCH(""); ASSERT_COMPLETION(L"plugin w", L"plugin whitelist"); ASSERT_NEXT_MATCH("whitelist"); restore_cwd(saved_cwd); saved_cwd = save_cwd(); make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); create_dir(SANDBOX_PATH "/plugins"); create_dir(SANDBOX_PATH "/plugins/plug1"); create_dir(SANDBOX_PATH "/plugins/plug2"); make_file(SANDBOX_PATH "/plugins/plug1/init.lua", "return {}"); make_file(SANDBOX_PATH "/plugins/plug2/init.lua", "return"); curr_stats.vlua = vlua_init(); curr_stats.plugs = plugs_create(curr_stats.vlua); load_plugins(curr_stats.plugs, cfg.config_dir); ASSERT_COMPLETION(L"plugin whitelist ", L"plugin whitelist plug1"); ASSERT_NEXT_MATCH("plug2"); ASSERT_NEXT_MATCH(""); plugs_free(curr_stats.plugs); vlua_finish(curr_stats.vlua); curr_stats.plugs = NULL; curr_stats.vlua = NULL; remove_file(SANDBOX_PATH "/plugins/plug1/init.lua"); remove_file(SANDBOX_PATH "/plugins/plug2/init.lua"); remove_dir(SANDBOX_PATH "/plugins/plug1"); remove_dir(SANDBOX_PATH "/plugins/plug2"); remove_dir(SANDBOX_PATH "/plugins"); } TEST(tree_is_completed) { prepare_for_line_completion(L"tree "); assert_success(line_completion(&stats)); assert_wstring_equal(L"tree depth=", stats.line); } TEST(highlight_is_completed) { ASSERT_COMPLETION(L"hi ", L"hi AuxWin"); ASSERT_COMPLETION(L"hi wi", L"hi WildBox"); ASSERT_COMPLETION(L"hi WildMenu cter", L"hi WildMenu cterm"); ASSERT_COMPLETION(L"hi WildMenu ctermfg=def", L"hi WildMenu ctermfg=default"); ASSERT_COMPLETION(L"hi WildMenu ctermfg=no", L"hi WildMenu ctermfg=none"); ASSERT_COMPLETION(L"hi WildMenu ctermfg=r", L"hi WildMenu ctermfg=Red1"); ASSERT_COMPLETION(L"hi WildMenu ctermfg=lightb", L"hi WildMenu ctermfg=lightblack"); ASSERT_COMPLETION(L"hi WildMenu cterm=re", L"hi WildMenu cterm=reverse"); ASSERT_COMPLETION(L"hi WildMenu cterm=bold,re", L"hi WildMenu cterm=bold,reverse"); ASSERT_COMPLETION(L"hi WildMenu guibg=r", L"hi WildMenu guibg=red"); ASSERT_COMPLETION(L"hi WildMenu guibg=l", L"hi WildMenu guibg=l"); assert_success(cmds_dispatch("hi {*.jpg} cterm=none", &lwin, CIT_COMMAND)); ASSERT_COMPLETION(L"hi clear ", L"hi clear {*.jpg}"); } TEST(highlight_columns_are_completed) { curr_stats.vlua = vlua_init(); GLUA_EQ(curr_stats.vlua, "", "function handler() end"); GLUA_EQ(curr_stats.vlua, "", "vifm.addcolumntype{ name = 'Test', handler = handler }"); /* Completion doesn't require columns to be colored. */ ASSERT_COMPLETION(L"hi column:s", L"hi column:size"); ASSERT_COMPLETION(L"hi column:T", L"hi column:Test"); assert_success(cmds_dispatch("hi column:size cterm=bold", &lwin, CIT_COMMAND)); ASSERT_COMPLETION(L"hi clear column:si", L"hi clear column:size"); vlua_finish(curr_stats.vlua); curr_stats.vlua = NULL; } TEST(command_options_are_completed) { ASSERT_COMPLETION(L"copy -", L"copy -skip"); other_view = &rwin; #ifndef _WIN32 ASSERT_COMPLETION(L"copy -- -", L"copy -- ./-"); #else ASSERT_COMPLETION(L"copy -- -", L"copy -- -"); #endif other_view = NULL; } TEST(wingo_is_completed) { make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "compare/a", saved_cwd); make_abs_path(rwin.curr_dir, sizeof(rwin.curr_dir), TEST_DATA_PATH, "compare/b", saved_cwd); ASSERT_COMPLETION_ENDS_WITH(L"wingo ", L"/compare/a"); ASSERT_NEXT_MATCH_ENDS_WITH("/compare/b"); /* Check that path part designed by ~ is being matched against. */ cfg.shorten_title_paths = 1; make_abs_path(cfg.home_dir, sizeof(cfg.home_dir), TEST_DATA_PATH, "/compare/b/", saved_cwd); ASSERT_COMPLETION_ENDS_WITH(L"wingo compare/b", L" ~"); cfg.shorten_title_paths = 0; } static void dummy_handler(OPT_OP op, optval_t val) { ASSERT_NO_COMPLETION(L"nosuchcommand a"); } static void prepare_for_line_completion(const wchar_t str[]) { free(stats.line); stats.line = wcsdup(str); stats.len = wcslen(stats.line); stats.index = stats.len; stats.complete_continue = 0; vle_compl_reset(); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/edit.c0000600000175000017500000000724615051153245014003 0ustar korykory#include #include /* FILE fclose() fopen() fprintf() remove() */ #include /* strcpy() strdup() */ #include #include "../../src/cfg/config.h" #include "../../src/compat/fs_limits.h" #include "../../src/compat/os.h" #include "../../src/lua/vlua.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/ui.h" #include "../../src/utils/dynarray.h" #include "../../src/utils/fs.h" #include "../../src/utils/str.h" #include "../../src/cmd_core.h" #include "../../src/status.h" #include "../lua/asserts.h" static char sandbox[PATH_MAX + 1]; SETUP_ONCE() { char cwd[PATH_MAX + 1]; assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(sandbox, sizeof(sandbox), SANDBOX_PATH, "", cwd); } SETUP() { conf_setup(); view_setup(&lwin); cmds_init(); curr_view = &lwin; } TEARDOWN() { conf_teardown(); view_teardown(&lwin); vle_cmds_reset(); curr_view = NULL; } TEST(edit_handles_ranges, IF(not_windows)) { create_file(SANDBOX_PATH "/file1"); create_file(SANDBOX_PATH "/file2"); char script_path[PATH_MAX + 1]; make_abs_path(script_path, sizeof(script_path), sandbox, "script", NULL); update_string(&cfg.vi_command, script_path); update_string(&cfg.vi_x_command, ""); FILE *fp = fopen(SANDBOX_PATH "/script", "w"); fprintf(fp, "#!/bin/sh\n"); fprintf(fp, "for arg; do echo \"$arg\" >> %s/vi-list; done\n", SANDBOX_PATH); fclose(fp); assert_success(os_chmod(SANDBOX_PATH "/script", 0777)); strcpy(lwin.curr_dir, sandbox); lwin.list_rows = 2; lwin.list_pos = 0; lwin.dir_entry = dynarray_cextend(NULL, lwin.list_rows*sizeof(*lwin.dir_entry)); lwin.dir_entry[0].name = strdup("file1"); lwin.dir_entry[0].origin = &lwin.curr_dir[0]; lwin.dir_entry[1].name = strdup("file2"); lwin.dir_entry[1].origin = &lwin.curr_dir[0]; (void)cmds_dispatch("%edit", &lwin, CIT_COMMAND); const char *lines[] = { "file1", "file2" }; file_is(SANDBOX_PATH "/vi-list", lines, ARRAY_LEN(lines)); assert_success(remove(SANDBOX_PATH "/script")); assert_success(remove(SANDBOX_PATH "/file1")); assert_success(remove(SANDBOX_PATH "/file2")); assert_success(remove(SANDBOX_PATH "/vi-list")); } TEST(edit_command) { curr_stats.exec_env_type = EET_EMULATOR; update_string(&cfg.vi_command, "#vifmtest#editor"); cfg.config_dir[0] = '\0'; curr_stats.vlua = vlua_init(); GLUA_EQ(curr_stats.vlua, "", "function handler(info)" " local s = ginfo ~= nil" " ginfo = info" " return { success = s }" "end"); GLUA_EQ(curr_stats.vlua, "", "vifm.addhandler{ name = 'editor', handler = handler }"); int i; for(i = 0; i < 2; ++i) { assert_success(cmds_dispatch("edit a b", &lwin, CIT_COMMAND)); GLUA_EQ(curr_stats.vlua, "edit-many", "print(ginfo.action)"); GLUA_EQ(curr_stats.vlua, "2", "print(#ginfo.paths)"); GLUA_EQ(curr_stats.vlua, "a", "print(ginfo.paths[1])"); GLUA_EQ(curr_stats.vlua, "b", "print(ginfo.paths[2])"); GLUA_EQ(curr_stats.vlua, "", "ginfo = {}"); } vlua_finish(curr_stats.vlua); curr_stats.vlua = NULL; } TEST(edit_broken_symlink, IF(not_windows)) { make_symlink("no-such-file", SANDBOX_PATH "/broken"); update_string(&cfg.vi_command, "rm"); update_string(&cfg.vi_x_command, ""); char *saved_cwd = save_cwd(); assert_success(chdir(sandbox)); strcpy(lwin.curr_dir, sandbox); lwin.list_rows = 1; lwin.list_pos = 0; lwin.dir_entry = dynarray_cextend(NULL, lwin.list_rows*sizeof(*lwin.dir_entry)); lwin.dir_entry[0].name = strdup("broken"); lwin.dir_entry[0].origin = &lwin.curr_dir[0]; (void)cmds_dispatch("edit", &lwin, CIT_COMMAND); restore_cwd(saved_cwd); remove_file(SANDBOX_PATH "/broken"); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/commands/cabbrev.c0000600000175000017500000001041415051153245014451 0ustar korykory#include #include /* iswspace() */ #include "../../src/cfg/config.h" #include "../../src/engine/abbrevs.h" #include "../../src/engine/cmds.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/ui.h" #include "../../src/cmd_core.h" SETUP() { int i; for(i = 0; i < 255; ++i) { cfg.word_chars[i] = !iswspace(i); } lwin.selected_files = 0; lwin.list_rows = 0; curr_view = &lwin; cmds_init(); } TEARDOWN() { vle_cmds_reset(); vle_abbr_reset(); } TEST(addition) { int no_remap; assert_success(cmds_dispatch("cabbrev lhs1 rhs1", &lwin, CIT_COMMAND)); assert_wstring_equal(L"rhs1", vle_abbr_expand(L"lhs1", &no_remap)); assert_success(cmds_dispatch("cnoreabbrev lhs2 rhs2", &lwin, CIT_COMMAND)); assert_wstring_equal(L"rhs2", vle_abbr_expand(L"lhs2", &no_remap)); } TEST(single_character_abbrev) { int no_remap; assert_success(cmds_dispatch("cabbrev x y", &lwin, CIT_COMMAND)); assert_wstring_equal(L"y", vle_abbr_expand(L"x", &no_remap)); assert_success(cmds_dispatch("cnoreabbrev a b", &lwin, CIT_COMMAND)); assert_wstring_equal(L"b", vle_abbr_expand(L"a", &no_remap)); } TEST(add_with_remap) { int no_remap = -1; assert_success(cmds_dispatch("cabbrev lhs rhs", &lwin, CIT_COMMAND)); assert_non_null(vle_abbr_expand(L"lhs", &no_remap)); assert_false(no_remap); } TEST(add_with_no_remap) { int no_remap = -1; assert_success(cmds_dispatch("cnoreabbrev lhs rhs", &lwin, CIT_COMMAND)); assert_non_null(vle_abbr_expand(L"lhs", &no_remap)); assert_true(no_remap); } TEST(double_cabbrev_same_lhs) { int no_remap = -1; assert_success(cmds_dispatch("cabbrev lhs rhs1", &lwin, CIT_COMMAND)); assert_wstring_equal(L"rhs1", vle_abbr_expand(L"lhs", &no_remap)); assert_false(no_remap); assert_success(cmds_dispatch("cabbrev lhs rhs2", &lwin, CIT_COMMAND)); assert_wstring_equal(L"rhs2", vle_abbr_expand(L"lhs", &no_remap)); assert_false(no_remap); assert_success(cmds_dispatch("cnoreabbrev lhs rhs1", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("cnoreabbrev lhs rhs2", &lwin, CIT_COMMAND)); } TEST(unabbrev_by_lhs) { int no_remap; assert_success(cmds_dispatch("cabbrev lhs rhs", &lwin, CIT_COMMAND)); assert_non_null(vle_abbr_expand(L"lhs", &no_remap)); assert_success(cmds_dispatch("cunabbrev lhs", &lwin, CIT_COMMAND)); assert_null(vle_abbr_expand(L"lhs", &no_remap)); assert_success(cmds_dispatch("cnoreabbrev lhs rhs", &lwin, CIT_COMMAND)); assert_non_null(vle_abbr_expand(L"lhs", &no_remap)); assert_success(cmds_dispatch("cunabbrev lhs", &lwin, CIT_COMMAND)); assert_null(vle_abbr_expand(L"lhs", &no_remap)); } TEST(unabbrev_by_rhs) { int no_remap; assert_success(cmds_dispatch("cabbrev lhs rhs", &lwin, CIT_COMMAND)); assert_non_null(vle_abbr_expand(L"lhs", &no_remap)); assert_success(cmds_dispatch("cunabbrev rhs", &lwin, CIT_COMMAND)); assert_null(vle_abbr_expand(L"lhs", &no_remap)); assert_success(cmds_dispatch("cnoreabbrev lhs rhs", &lwin, CIT_COMMAND)); assert_non_null(vle_abbr_expand(L"lhs", &no_remap)); assert_success(cmds_dispatch("cunabbrev rhs", &lwin, CIT_COMMAND)); assert_null(vle_abbr_expand(L"lhs", &no_remap)); } TEST(unabbrev_error) { int no_remap; ui_sb_msg(""); assert_failure(cmds_dispatch("cunabbrev rhs", &lwin, CIT_COMMAND)); assert_null(vle_abbr_expand(L"lhs", &no_remap)); assert_string_equal("No such abbreviation: rhs", ui_sb_last()); } TEST(cant_list_no_abbrevs) { ui_sb_msg(""); assert_failure(cmds_dispatch("cabbrev l", &lwin, CIT_COMMAND)); assert_string_equal("No abbreviations found", ui_sb_last()); } TEST(list_abbrevs_matches) { const char *expected = "Abbreviation -- N -- Expansion/Description\n" "lhs1 1\n" "lhs2 2"; assert_success(cmds_dispatch("cabbrev lhs1 1", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("cabbrev lhs2 2", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("cabbrev lh", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); } TEST(list_abbrevs_no_matches) { assert_success(cmds_dispatch("cabbrev lhs1 1", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("cabbrev r", &lwin, CIT_COMMAND)); assert_string_equal("No abbreviations found", ui_sb_last()); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/sessions.c0000600000175000017500000002612115051153266014720 0ustar korykory#include #include /* chmod() */ #include /* free() */ #include #include "../../src/cfg/config.h" #include "../../src/engine/autocmds.h" #include "../../src/engine/keys.h" #include "../../src/engine/variables.h" #include "../../src/ui/column_view.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/tabs.h" #include "../../src/ui/ui.h" #include "../../src/utils/env.h" #include "../../src/utils/str.h" #include "../../src/cmd_core.h" #include "../../src/status.h" SETUP_ONCE() { curr_view = &lwin; other_view = &rwin; } TEARDOWN_ONCE() { curr_view = NULL; other_view = NULL; } SETUP() { view_setup(&lwin); view_setup(&rwin); lwin.columns = columns_create(); rwin.columns = columns_create(); columns_setup_column(SK_BY_NAME); columns_setup_column(SK_BY_SIZE); /* Test a realistic configuration. */ cfg_init(); histories_init(cfg.history_len); cmds_init(); opt_handlers_setup(); } TEARDOWN() { (void)cmds_dispatch("session", &lwin, CIT_COMMAND); cfg.config_dir[0] = '\0'; cfg.session_options = 0; opt_handlers_teardown(); conf_teardown(); vle_keys_reset(); histories_init(0); view_teardown(&lwin); view_teardown(&rwin); columns_teardown(); } TEST(can_create_a_session) { ui_sb_msg(""); assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); assert_string_equal("Switched to a new session: sess", ui_sb_last()); } TEST(query_no_session) { ui_sb_msg(""); assert_failure(cmds_dispatch("session?", &lwin, CIT_COMMAND)); assert_string_equal("No active session", ui_sb_last()); } TEST(query_current_session) { assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("session?", &lwin, CIT_COMMAND)); assert_string_equal("Active session: sess", ui_sb_last()); } TEST(detach_no_session) { ui_sb_msg(""); assert_failure(cmds_dispatch("session", &lwin, CIT_COMMAND)); assert_string_equal("No active session", ui_sb_last()); } TEST(detach_current_session) { assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("session", &lwin, CIT_COMMAND)); assert_string_equal("Detached from session without saving: sess", ui_sb_last()); } TEST(reject_name_with_slash) { ui_sb_msg(""); assert_failure(cmds_dispatch("session a/b", &lwin, CIT_COMMAND)); assert_string_equal("Session name can't include path separators", ui_sb_last()); } TEST(reject_to_restart_current_session) { assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); assert_string_equal("Already active session: sess", ui_sb_last()); } TEST(store_previous_session_before_switching) { make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); cfg.session_options = VINFO_CHISTORY; assert_failure(cmds_dispatch("session first", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("session second", &lwin, CIT_COMMAND)); remove_file(SANDBOX_PATH "/sessions/first.json"); remove_dir(SANDBOX_PATH "/sessions"); remove_file(SANDBOX_PATH "/vifminfo.json"); } TEST(session_is_stored_with_general_state) { make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); cfg.session_options = VINFO_CHISTORY; assert_failure(cmds_dispatch("session session", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("write", &lwin, CIT_COMMAND)); remove_file(SANDBOX_PATH "/sessions/session.json"); remove_dir(SANDBOX_PATH "/sessions"); remove_file(SANDBOX_PATH "/vifminfo.json"); } TEST(can_load_a_session) { make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); cfg.session_options = VINFO_CHISTORY; histories_init(10); hist_add(&curr_stats.cmd_hist, "command1", 1); assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("session other", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("session", &lwin, CIT_COMMAND)); histories_init(10); ui_sb_msg(""); assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); assert_string_equal("Loaded session: sess", ui_sb_last()); assert_int_equal(1, curr_stats.cmd_hist.size); remove_file(SANDBOX_PATH "/sessions/sess.json"); remove_dir(SANDBOX_PATH "/sessions"); remove_file(SANDBOX_PATH "/vifminfo.json"); } TEST(can_delete_a_session) { make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); ui_sb_msg(""); assert_failure(cmds_dispatch("delsession sess", &lwin, CIT_COMMAND)); assert_string_equal("No stored sessions with such name: sess", ui_sb_last()); create_dir(SANDBOX_PATH "/sessions"); create_dir(SANDBOX_PATH "/sessions/not-a-session.json"); create_file(SANDBOX_PATH "/sessions/session.json"); if(regular_unix_user()) { assert_success(chmod(SANDBOX_PATH "/sessions", 0555)); ui_sb_msg(""); assert_failure(cmds_dispatch("delsession session", &lwin, CIT_COMMAND)); assert_string_equal("Failed to delete a session: session", ui_sb_last()); assert_success(chmod(SANDBOX_PATH "/sessions", 0777)); } assert_success(cmds_dispatch("delsession session", &lwin, CIT_COMMAND)); no_remove_file(SANDBOX_PATH "/sessions/session.json"); remove_dir(SANDBOX_PATH "/sessions/not-a-session.json"); remove_dir(SANDBOX_PATH "/sessions"); } TEST(can_fail_to_switch_and_still_be_in_a_session) { make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); curr_stats.load_stage = -1; env_set("MYVIFMRC", SANDBOX_PATH "/vifmrc"); create_dir(SANDBOX_PATH "/sessions"); create_file(SANDBOX_PATH "/sessions/empty.json"); make_file(SANDBOX_PATH "/vifmrc", "session bla"); ui_sb_msg(""); assert_failure(cmds_dispatch("session empty", &lwin, CIT_COMMAND)); assert_string_equal("Session switching has failed, active session: bla", ui_sb_last()); char *value = var_to_str(getvar("v:session")); assert_string_equal("bla", value); free(value); remove_file(SANDBOX_PATH "/vifmrc"); remove_file(SANDBOX_PATH "/sessions/empty.json"); remove_dir(SANDBOX_PATH "/sessions"); curr_stats.load_stage = 0; env_remove("MYVIFMRC"); } TEST(load_previous_session) { make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); curr_stats.load_stage = -1; env_set("MYVIFMRC", SANDBOX_PATH "/vifmrc"); cfg.session_options = VINFO_CHISTORY; /* No previous session. */ update_string(&curr_stats.last_session, NULL); ui_sb_msg(""); assert_failure(cmds_dispatch("session -", &lwin, CIT_COMMAND)); assert_string_equal("No previous session", ui_sb_last()); /* Detached session. */ assert_failure(cmds_dispatch("session tmp", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("session", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("session -", &lwin, CIT_COMMAND)); assert_string_equal("Previous session doesn't exist", ui_sb_last()); /* Previous session. */ assert_failure(cmds_dispatch("session first", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("session second", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("session -", &lwin, CIT_COMMAND)); assert_string_equal("Loaded session: first", ui_sb_last()); remove_file(SANDBOX_PATH "/sessions/first.json"); remove_file(SANDBOX_PATH "/sessions/second.json"); remove_dir(SANDBOX_PATH "/sessions"); curr_stats.load_stage = 0; env_remove("MYVIFMRC"); } TEST(vsession_is_empty_initially) { char *value = var_to_str(getvar("v:session")); assert_string_equal("", value); free(value); } TEST(vsession_is_set) { assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); char *value = var_to_str(getvar("v:session")); assert_string_equal("sess", value); free(value); } TEST(vsession_is_empty_after_detaching) { assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("session", &lwin, CIT_COMMAND)); char *value = var_to_str(getvar("v:session")); assert_string_equal("", value); free(value); } TEST(vsession_is_emptied_on_failure_to_load_a_session) { make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); cfg.session_options = VINFO_CHISTORY; create_dir(SANDBOX_PATH "/sessions"); create_file(SANDBOX_PATH "/sessions/empty.json"); assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("session empty", &lwin, CIT_COMMAND)); assert_string_equal("Session switching has failed, no active session", ui_sb_last()); char *value = var_to_str(getvar("v:session")); assert_string_equal("", value); free(value); remove_file(SANDBOX_PATH "/sessions/empty.json"); remove_file(SANDBOX_PATH "/sessions/sess.json"); remove_dir(SANDBOX_PATH "/sessions"); remove_file(SANDBOX_PATH "/vifminfo.json"); } TEST(autocmd_is_called_for_all_global_tabs) { make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); make_file(SANDBOX_PATH "/vifmrc", "autocmd DirEnter * setl dotfiles"); cfg.session_options = VINFO_TABS | VINFO_DHISTORY | VINFO_SAVEDIRS; curr_stats.load_stage = -1; setup_grid(&lwin, 1, 1, 1); setup_grid(&rwin, 1, 1, 1); create_dir(SANDBOX_PATH "/sessions"); assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("write", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("session", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("tabnext", &lwin, CIT_COMMAND)); int i; tab_info_t tab_info; for(i = 0; tabs_enum_all(i, &tab_info); ++i) { assert_false(tab_info.view->hide_dot); } remove_file(SANDBOX_PATH "/sessions/sess.json"); remove_dir(SANDBOX_PATH "/sessions"); remove_file(SANDBOX_PATH "/vifminfo.json"); remove_file(SANDBOX_PATH "/vifmrc"); tabs_only(&lwin); tabs_only(&rwin); vle_aucmd_remove(NULL, NULL); curr_stats.load_stage = 0; } TEST(autocmd_is_called_for_all_pane_tabs) { make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); make_file(SANDBOX_PATH "/vifmrc", "autocmd DirEnter * setl dotfiles"); cfg.session_options = VINFO_TABS | VINFO_DHISTORY | VINFO_SAVEDIRS; cfg.pane_tabs = 1; curr_stats.load_stage = -1; setup_grid(&lwin, 1, 1, 1); setup_grid(&rwin, 1, 1, 1); create_dir(SANDBOX_PATH "/sessions"); assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("write", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("session", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("session sess", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("tabnext", &lwin, CIT_COMMAND)); int i; tab_info_t tab_info; for(i = 0; tabs_enum_all(i, &tab_info); ++i) { assert_false(tab_info.view->hide_dot); } remove_file(SANDBOX_PATH "/sessions/sess.json"); remove_dir(SANDBOX_PATH "/sessions"); remove_file(SANDBOX_PATH "/vifminfo.json"); remove_file(SANDBOX_PATH "/vifmrc"); tabs_only(&lwin); tabs_only(&rwin); vle_aucmd_remove(NULL, NULL); curr_stats.load_stage = 0; cfg.pane_tabs = 0; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/cpmv.c0000600000175000017500000001010415051153245014006 0ustar korykory#include #include /* chdir() */ #include /* strcpy() strdup() */ #include #include "../../src/cfg/config.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/ui.h" #include "../../src/utils/dynarray.h" #include "../../src/utils/fs.h" #include "../../src/cmd_core.h" #include "../../src/filelist.h" static char cwd[PATH_MAX + 1]; SETUP_ONCE() { curr_view = &lwin; other_view = &rwin; assert_non_null(get_cwd(cwd, sizeof(cwd))); undo_setup(); conf_setup(); cfg.use_system_calls = 1; } TEARDOWN_ONCE() { undo_teardown(); conf_teardown(); cfg.use_system_calls = 0; } SETUP() { view_setup(&lwin); view_setup(&rwin); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), SANDBOX_PATH, "left", cwd); make_abs_path(rwin.curr_dir, sizeof(rwin.curr_dir), SANDBOX_PATH, "right", cwd); cmds_init(); create_dir(SANDBOX_PATH "/left"); make_file(SANDBOX_PATH "/left/a", "1"); make_file(SANDBOX_PATH "/left/b", "1"); create_dir(SANDBOX_PATH "/right"); make_file(SANDBOX_PATH "/right/a", "12"); assert_success(populate_dir_list(&lwin, /*reload=*/0)); } TEARDOWN() { view_teardown(&lwin); view_teardown(&rwin); vle_cmds_reset(); remove_file(SANDBOX_PATH "/left/a"); remove_file(SANDBOX_PATH "/left/b"); remove_dir(SANDBOX_PATH "/left"); remove_file(SANDBOX_PATH "/right/a"); remove_dir(SANDBOX_PATH "/right"); } TEST(wrong_cpmv_flag) { ui_sb_msg(""); assert_failure(cmds_dispatch("copy -wrong", &lwin, CIT_COMMAND)); assert_string_equal("Unrecognized :command option: -wrong", ui_sb_last()); ui_sb_msg(""); assert_failure(cmds_dispatch("alink -wrong", &lwin, CIT_COMMAND)); assert_string_equal("Unrecognized :command option: -wrong", ui_sb_last()); } TEST(copy_can_skip_existing_files) { ui_sb_msg(""); assert_failure(cmds_dispatch("%copy -skip", &lwin, CIT_COMMAND)); assert_string_equal("2 files successfully processed", ui_sb_last()); assert_int_equal(2, get_file_size(SANDBOX_PATH "/right/a")); remove_file(SANDBOX_PATH "/right/b"); } TEST(link_can_skip_existing_files, IF(not_windows)) { ui_sb_msg(""); assert_failure(cmds_dispatch("%alink -skip", &lwin, CIT_COMMAND)); assert_string_equal("2 files successfully processed", ui_sb_last()); assert_int_equal(2, get_file_size(SANDBOX_PATH "/right/a")); remove_file(SANDBOX_PATH "/right/b"); } TEST(file_name_can_start_with_a_dash) { ui_sb_msg(""); assert_failure(cmds_dispatch("%copy -- -test -skip", &lwin, CIT_COMMAND)); assert_string_equal("2 files successfully processed", ui_sb_last()); remove_file(SANDBOX_PATH "/right/-test"); remove_file(SANDBOX_PATH "/right/-skip"); } TEST(cpmv_does_not_crash_on_wrong_list_access) { char path[PATH_MAX + 1]; make_abs_path(path, sizeof(path), TEST_DATA_PATH, "existing-files", cwd); char sandbox[PATH_MAX + 1]; make_abs_path(sandbox, sizeof(sandbox), SANDBOX_PATH, "", cwd); char *saved_cwd = save_cwd(); assert_success(chdir(path)); strcpy(lwin.curr_dir, path); strcpy(rwin.curr_dir, sandbox); free_dir_entries(&lwin.dir_entry, &lwin.list_rows); lwin.list_rows = 3; lwin.list_pos = 0; lwin.dir_entry = dynarray_cextend(NULL, lwin.list_rows*sizeof(*lwin.dir_entry)); lwin.dir_entry[0].name = strdup("a"); lwin.dir_entry[0].origin = &lwin.curr_dir[0]; lwin.dir_entry[0].selected = 1; lwin.dir_entry[1].name = strdup("b"); lwin.dir_entry[1].origin = &lwin.curr_dir[0]; lwin.dir_entry[1].selected = 1; lwin.dir_entry[2].name = strdup("c"); lwin.dir_entry[2].origin = &lwin.curr_dir[0]; lwin.dir_entry[2].selected = 1; lwin.selected_files = 3; /* cpmv used to use presence of the argument as indication of availability of * file list and access memory beyond array boundaries. */ (void)cmds_dispatch("co .", &lwin, CIT_COMMAND); snprintf(path, sizeof(path), "%s/a", sandbox); assert_success(remove(path)); snprintf(path, sizeof(path), "%s/b", sandbox); assert_success(remove(path)); snprintf(path, sizeof(path), "%s/c", sandbox); assert_success(remove(path)); restore_cwd(saved_cwd); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/highlight.c0000600000175000017500000004401315051153245015016 0ustar korykory#include #include /* INT_MAX */ #include /* snprintf() */ #include /* strcpy() */ #include #include "../../src/cfg/config.h" #include "../../src/lua/vlua.h" #include "../../src/ui/color_scheme.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/ui.h" #include "../../src/utils/matchers.h" #include "../../src/cmd_core.h" #include "../../src/filelist.h" #include "../../src/status.h" SETUP_ONCE() { cmds_init(); cs_reset(&cfg.cs); lwin.list_rows = 0; rwin.list_rows = 0; curr_view = &lwin; } SETUP() { cs_reset(&cfg.cs); curr_stats.cs = &cfg.cs; } TEARDOWN() { cs_reset(&cfg.cs); curr_stats.cs = NULL; } /* General behaviour. */ TEST(all_groups_are_printed) { /* On PDCurses A_STANDOUT == (A_REVERSE | A_BOLD). */ #if __PDCURSES__ # define ATTR ",standout" #else # define ATTR "" #endif const char *expected = "Win cterm=none ctermfg=white ctermbg=black\n" "Directory cterm=bold ctermfg=cyan ctermbg=default\n" "Link cterm=bold ctermfg=yellow ctermbg=default\n" "BrokenLink cterm=bold ctermfg=red ctermbg=default\n" "HardLink cterm=none ctermfg=yellow ctermbg=default\n" "Socket cterm=bold ctermfg=magenta ctermbg=default\n" "Device cterm=bold ctermfg=red ctermbg=default\n" "Fifo cterm=bold ctermfg=cyan ctermbg=default\n" "Executable cterm=bold ctermfg=green ctermbg=default\n" "Selected cterm=bold ctermfg=magenta ctermbg=default\n" "CurrLine cterm=bold,reverse" ATTR " ctermfg=default ctermbg=default\n" "TopLine cterm=none ctermfg=black ctermbg=white\n" "TopLineSel cterm=bold ctermfg=black ctermbg=default\n" "StatusLine cterm=bold ctermfg=black ctermbg=white\n" "WildBox cterm=none ctermfg=default ctermbg=default\n" "WildMenu cterm=underline,reverse ctermfg=white ctermbg=black\n" "CmdLine cterm=none ctermfg=white ctermbg=black\n" "ErrorMsg cterm=none ctermfg=red ctermbg=black\n" "Border cterm=none ctermfg=black ctermbg=white\n" "OtherLine cterm=none ctermfg=default ctermbg=default\n" "JobLine cterm=bold,reverse" ATTR " ctermfg=black ctermbg=white\n" "SuggestBox cterm=bold ctermfg=default ctermbg=default\n" "CmpMismatch cterm=bold ctermfg=white ctermbg=red\n" "CmpUnmatched cterm=bold ctermfg=white ctermbg=green\n" "CmpBlank cterm=none ctermfg=default ctermbg=default\n" "AuxWin cterm=none ctermfg=default ctermbg=default\n" "TabLine cterm=none ctermfg=white ctermbg=black\n" "TabLineSel cterm=bold,reverse" ATTR " ctermfg=default ctermbg=default\n" "User1 cterm=none ctermfg=default ctermbg=default\n" "User2 cterm=none ctermfg=default ctermbg=default\n" "User3 cterm=none ctermfg=default ctermbg=default\n" "User4 cterm=none ctermfg=default ctermbg=default\n" "User5 cterm=none ctermfg=default ctermbg=default\n" "User6 cterm=none ctermfg=default ctermbg=default\n" "User7 cterm=none ctermfg=default ctermbg=default\n" "User8 cterm=none ctermfg=default ctermbg=default\n" "User9 cterm=none ctermfg=default ctermbg=default\n" "User10 cterm=none ctermfg=default ctermbg=default\n" "User11 cterm=none ctermfg=default ctermbg=default\n" "User12 cterm=none ctermfg=default ctermbg=default\n" "User13 cterm=none ctermfg=default ctermbg=default\n" "User14 cterm=none ctermfg=default ctermbg=default\n" "User15 cterm=none ctermfg=default ctermbg=default\n" "User16 cterm=none ctermfg=default ctermbg=default\n" "User17 cterm=none ctermfg=default ctermbg=default\n" "User18 cterm=none ctermfg=default ctermbg=default\n" "User19 cterm=none ctermfg=default ctermbg=default\n" "User20 cterm=none ctermfg=default ctermbg=default\n" "OtherWin cterm=none ctermfg=default ctermbg=default\n" "LineNr cterm=none ctermfg=default ctermbg=default\n" "OddLine cterm=none ctermfg=default ctermbg=default\n" "\n" "column:size cterm=bold ctermfg=red ctermbg=red\n" "\n" "{*.jpg} cterm=none ctermfg=red ctermbg=blue"; assert_success(cmds_dispatch("highlight {*.jpg} ctermfg=red\tctermbg=blue", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch( "highlight column:size ctermfg=red ctermbg=red cterm=bold", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("hi", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); } /* Colors. */ TEST(all_xterm_colors_are_printed) { size_t i; for(i = 0U; i < ARRAY_LEN(XTERM256_COLOR_NAMES); ++i) { cfg.cs.color[WIN_COLOR].bg = i; cfg.cs.color[WIN_COLOR].fg = i; char expected[128]; snprintf(expected, sizeof(expected), "Win cterm=none ctermfg=%-7s ctermbg=%s", XTERM256_COLOR_NAMES[i], XTERM256_COLOR_NAMES[i]); ui_sb_msg(""); assert_failure(cmds_dispatch("hi Win", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); } } TEST(wrong_gui_color_causes_error) { ui_sb_msg(""); assert_failure(cmds_dispatch("hi Win guifg=#1234", &lwin, CIT_COMMAND)); assert_string_equal("Unrecognized color value format: #1234", ui_sb_last()); ui_sb_msg(""); assert_failure(cmds_dispatch("hi Win guibg=#1234", &lwin, CIT_COMMAND)); assert_string_equal("Unrecognized color value format: #1234", ui_sb_last()); } TEST(gui_colors_are_parsed) { assert_success(cmds_dispatch("hi Win guifg=#1234fe guibg=red gui=reverse", &lwin, CIT_COMMAND)); assert_true(curr_stats.cs->color[WIN_COLOR].gui_set); assert_int_equal(0x1234fe, curr_stats.cs->color[WIN_COLOR].gui_fg); assert_int_equal(COLOR_RED, curr_stats.cs->color[WIN_COLOR].gui_bg); assert_int_equal(A_REVERSE, curr_stats.cs->color[WIN_COLOR].gui_attr); assert_success(cmds_dispatch("hi Win guifg=default", &lwin, CIT_COMMAND)); assert_true(curr_stats.cs->color[WIN_COLOR].gui_set); assert_int_equal(-1, curr_stats.cs->color[WIN_COLOR].gui_fg); assert_int_equal(COLOR_RED, curr_stats.cs->color[WIN_COLOR].gui_bg); assert_int_equal(A_REVERSE, curr_stats.cs->color[WIN_COLOR].gui_attr); } TEST(gui_colors_are_printed) { ui_sb_msg(""); assert_success(cmds_dispatch("hi Win guifg=#1234fe guibg=red", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("hi Win", &lwin, CIT_COMMAND)); assert_string_equal( "Win cterm=none ctermfg=white ctermbg=black\n" " gui=none guifg=#1234fe guibg=red", ui_sb_last()); } /* Attributes. */ TEST(wrong_attribute_causes_error) { assert_failure(cmds_dispatch("hi Win cterm=bad", &lwin, CIT_COMMAND)); } TEST(various_attributes_are_parsed) { #ifdef HAVE_A_ITALIC_DECL const unsigned int italic_attr = A_ITALIC; #else /* If A_ITALIC is missing (it's an extension), use A_REVERSE instead. */ const unsigned int italic_attr = A_REVERSE; #endif curr_stats.cs->color[WIN_COLOR].attr = 0; assert_success(cmds_dispatch("hi Win cterm=bold,italic", &lwin, CIT_COMMAND)); assert_int_equal(A_BOLD | italic_attr, curr_stats.cs->color[WIN_COLOR].attr); assert_success(cmds_dispatch("hi Win cterm=underline,reverse", &lwin, CIT_COMMAND)); assert_int_equal(A_UNDERLINE | A_REVERSE, curr_stats.cs->color[WIN_COLOR].attr); assert_success(cmds_dispatch("hi Win cterm=standout,combine", &lwin, CIT_COMMAND)); assert_int_equal(A_STANDOUT, curr_stats.cs->color[WIN_COLOR].attr); assert_true(curr_stats.cs->color[WIN_COLOR].combine_attrs); } TEST(attributes_are_printed_back_correctly) { ui_sb_msg(""); assert_failure(cmds_dispatch("highlight AuxWin", &lwin, CIT_COMMAND)); assert_string_equal("AuxWin cterm=none ctermfg=default ctermbg=default", ui_sb_last()); assert_success(cmds_dispatch("highlight Win cterm=underline,inverse", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_success(cmds_dispatch("highlight AuxWin cterm=combine", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("highlight AuxWin", &lwin, CIT_COMMAND)); assert_string_equal( "AuxWin cterm=combine ctermfg=default ctermbg=default", ui_sb_last()); assert_success(cmds_dispatch("highlight Win cterm=underline,inverse", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("highlight Win", &lwin, CIT_COMMAND)); assert_string_equal( "Win cterm=underline,reverse ctermfg=white ctermbg=black", ui_sb_last()); assert_success(cmds_dispatch("highlight Win cterm=italic,standout,bold", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("highlight Win", &lwin, CIT_COMMAND)); #ifdef HAVE_A_ITALIC_DECL assert_string_equal( "Win cterm=bold,standout,italic ctermfg=white ctermbg=black", ui_sb_last()); #else assert_string_equal( "Win cterm=bold,reverse,standout ctermfg=white ctermbg=black", ui_sb_last()); #endif } /* Generic groups. */ TEST(color_is_set) { const char *const COMMANDS = "hi Win ctermfg=red ctermbg=red cterm=bold"; curr_stats.cs->color[WIN_COLOR].fg = COLOR_BLUE; curr_stats.cs->color[WIN_COLOR].bg = COLOR_BLUE; curr_stats.cs->color[WIN_COLOR].attr = 0; assert_success(cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_int_equal(COLOR_RED, curr_stats.cs->color[WIN_COLOR].fg); assert_int_equal(COLOR_RED, curr_stats.cs->color[WIN_COLOR].bg); assert_int_equal(A_BOLD, curr_stats.cs->color[WIN_COLOR].attr); } TEST(original_color_is_unchanged_on_parsing_error) { const char *const COMMANDS = "highlight Win ctermfg=red ctersmbg=red"; curr_stats.cs->color[WIN_COLOR].fg = COLOR_BLUE; assert_failure(cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_int_equal(COLOR_BLUE, curr_stats.cs->color[WIN_COLOR].fg); } /* Column highlighting. */ TEST(column_name_is_wrong) { curr_stats.vlua = vlua_init(); ui_sb_msg(""); assert_failure(cmds_dispatch("hi column:badone ctermfg=red", &lwin, CIT_COMMAND)); assert_string_equal("No such column: badone", ui_sb_last()); vlua_finish(curr_stats.vlua); curr_stats.vlua = NULL; } TEST(column_color_is_not_set) { assert_null(cs_get_column_hi(curr_stats.cs, SK_BY_SIZE)); assert_failure(cmds_dispatch("hi column:size ctermfg=bad", &lwin, CIT_COMMAND)); assert_null(cs_get_column_hi(curr_stats.cs, SK_BY_SIZE)); } TEST(column_color_is_set) { assert_null(cs_get_column_hi(curr_stats.cs, SK_BY_SIZE)); assert_success(cmds_dispatch( "hi column:size ctermfg=red ctermbg=red cterm=bold", &lwin, CIT_COMMAND)); const col_attr_t *hi = cs_get_column_hi(curr_stats.cs, SK_BY_SIZE); assert_int_equal(COLOR_RED, hi->fg); assert_int_equal(COLOR_RED, hi->bg); assert_int_equal(A_BOLD, hi->attr); } TEST(skipped_column_color_is_not_set) { assert_null(cs_get_column_hi(curr_stats.cs, SK_BY_NAME)); assert_success(cmds_dispatch( "hi column:size ctermfg=red ctermbg=red cterm=bold", &lwin, CIT_COMMAND)); assert_null(cs_get_column_hi(curr_stats.cs, SK_BY_NAME)); } TEST(column_color_not_removed) { curr_stats.vlua = vlua_init(); ui_sb_msg(""); assert_failure(cmds_dispatch("hi clear column:bad", &lwin, CIT_COMMAND)); assert_string_equal("No such column: bad", ui_sb_last()); vlua_finish(curr_stats.vlua); curr_stats.vlua = NULL; } TEST(column_color_is_removed) { /* Nothing to remove yet. */ ui_sb_msg(""); assert_failure(cmds_dispatch("hi clear column:size", &lwin, CIT_COMMAND)); assert_string_equal("No such group: column:size", ui_sb_last()); assert_success(cmds_dispatch("hi column:size ctermfg=red cterm=bold", &lwin, CIT_COMMAND)); assert_non_null(cs_get_column_hi(curr_stats.cs, SK_BY_SIZE)); assert_success(cmds_dispatch("hi clear column:size", &lwin, CIT_COMMAND)); assert_null(cs_get_column_hi(curr_stats.cs, SK_BY_SIZE)); } TEST(column_color_is_printed) { ui_sb_msg(""); assert_success(cmds_dispatch("hi column:size", &lwin, CIT_COMMAND)); assert_string_equal("", ui_sb_last()); assert_success(cmds_dispatch("hi column:size ctermfg=red cterm=bold", &lwin, CIT_COMMAND)); assert_non_null(cs_get_column_hi(curr_stats.cs, SK_BY_SIZE)); ui_sb_msg(""); assert_failure(cmds_dispatch("hi column:size", &lwin, CIT_COMMAND)); assert_string_equal("column:size cterm=bold ctermfg=red ctermbg=default", ui_sb_last()); } /* File-specific highlight. */ TEST(empty_curly_braces) { const char *const COMMANDS = "highlight {} ctermfg=red"; assert_false(cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND) == 0); } TEST(curly_braces_pattern_transform) { const char *const COMMANDS = "highlight {*.sh} ctermfg=red"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal("{*.sh}", matchers_get_expr(cfg.cs.file_hi[0].matchers)); } TEST(curly_braces_no_flags_allowed) { const char *const COMMANDS = "highlight {*.sh}i ctermfg=red"; assert_false(cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND) == 0); } TEST(empty_re_without_flags) { const char *const COMMANDS = "highlight // ctermfg=red"; assert_false(cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND) == 0); } TEST(empty_re_with_flags) { const char *const COMMANDS = "highlight //i ctermfg=red"; assert_false(cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND) == 0); } TEST(pattern_is_not_unescaped) { const char *const COMMANDS = "highlight /^\\./ ctermfg=red"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal("/^\\./", matchers_get_expr(cfg.cs.file_hi[0].matchers)); } TEST(pattern_length_is_not_limited) { const char *const COMMANDS = "highlight /\\.(7z|Z|a|ace|alz|apkg|arc|arj|bz" "|bz2|cab|cpio|deb|gz|jar|lha|lrz|lz|lzma|lzo|rar|rpm|rz|t7z|tZ|tar|tbz" "|tbz2|tgz|tlz|txz|tzo|war|xz|zip)$/ ctermfg=red"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal("/\\.(7z|Z|a|ace|alz|apkg|arc|arj|bz" "|bz2|cab|cpio|deb|gz|jar|lha|lrz|lz|lzma|lzo|rar|rpm|rz|t7z|tZ|tar|tbz" "|tbz2|tgz|tlz|txz|tzo|war|xz|zip)$/", matchers_get_expr(cfg.cs.file_hi[0].matchers)); } TEST(i_flag) { const char *const COMMANDS = "highlight /^\\./i ctermfg=red"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal("/^\\./i", matchers_get_expr(cfg.cs.file_hi[0].matchers)); } TEST(I_flag) { const char *const COMMANDS = "highlight /^\\./I ctermfg=red"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal("/^\\./I", matchers_get_expr(cfg.cs.file_hi[0].matchers)); } TEST(wrong_flag) { const char *const COMMANDS = "highlight /^\\./x ctermfg=red"; assert_int_equal(-1, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); } TEST(negation) { const char *const COMMANDS = "highlight !/^\\./i ctermfg=red"; assert_success(cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal("!/^\\./i", matchers_get_expr(cfg.cs.file_hi[0].matchers)); } TEST(highlighting_is_printed_back_correctly) { const char *const COMMANDS = "highlight {*.jpg} ctermfg=red"; assert_success(cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("highlight {*.jpg}", &lwin, CIT_COMMAND)); assert_string_equal("{*.jpg} cterm=none ctermfg=red ctermbg=default", ui_sb_last()); } TEST(existing_records_are_updated) { const char *const COMMANDS1 = "highlight {*.jpg} ctermfg=red"; const char *const COMMANDS2 = "highlight {*.jpg} ctermfg=blue"; assert_success(cmds_dispatch(COMMANDS1, &lwin, CIT_COMMAND)); assert_success(cmds_dispatch(COMMANDS2, &lwin, CIT_COMMAND)); assert_int_equal(1, cfg.cs.file_hi_count); assert_int_equal(COLOR_BLUE, cfg.cs.file_hi[0].hi.fg); } TEST(all_records_can_be_removed) { const char *const COMMANDS1 = "highlight {*.jpg} ctermfg=red"; const char *const COMMANDS2 = "highlight {*.avi} cterm=bold"; const char *const COMMANDS3 = "highlight clear"; assert_success(cmds_dispatch(COMMANDS1, &lwin, CIT_COMMAND)); assert_success(cmds_dispatch(COMMANDS2, &lwin, CIT_COMMAND)); assert_int_equal(2, cfg.cs.file_hi_count); assert_success(cmds_dispatch(COMMANDS3, &lwin, CIT_COMMAND)); assert_int_equal(0, cfg.cs.file_hi_count); } TEST(records_can_be_removed) { const char *const COMMANDS1 = "highlight {*.jpg} ctermfg=red"; const char *const COMMANDS2 = "highlight clear {*.avi}"; const char *const COMMANDS3 = "highlight clear {*.jpg}"; assert_success(cmds_dispatch(COMMANDS1, &lwin, CIT_COMMAND)); assert_int_equal(1, cfg.cs.file_hi_count); assert_failure(cmds_dispatch(COMMANDS2, &lwin, CIT_COMMAND)); assert_int_equal(1, cfg.cs.file_hi_count); assert_success(cmds_dispatch(COMMANDS3, &lwin, CIT_COMMAND)); assert_int_equal(0, cfg.cs.file_hi_count); } TEST(incorrect_highlight_groups_are_not_added) { const char *const COMMANDS = "highlight {*.jpg} ctersmfg=red"; assert_failure(cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_int_equal(0, cfg.cs.file_hi_count); } TEST(can_color_uncolored_file) { view_setup(&lwin); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "color-schemes", NULL); assert_success(populate_dir_list(&lwin, 0)); curr_stats.cs = &cfg.cs; curr_stats.load_stage = 2; assert_null(cs_get_file_hi(curr_stats.cs, "some.vifm", &lwin.dir_entry[0].hi_num)); assert_int_equal(INT_MAX, lwin.dir_entry[0].hi_num); assert_success(cmds_dispatch("highlight {*.vifm} cterm=bold", &lwin, CIT_COMMAND)); assert_non_null(cs_get_file_hi(curr_stats.cs, "some.vifm", &lwin.dir_entry[0].hi_num)); assert_int_equal(0, lwin.dir_entry[0].hi_num); view_teardown(&lwin); curr_stats.load_stage = 0; } TEST(tabs_are_allowed) { const char *const COMMANDS1 = "highlight\t{*.jpg} ctermfg=red\tctermbg=blue"; const char *const COMMANDS2 = "highlight {*.avi}\tctermfg=red"; const char *const COMMANDS3 = "highlight\t{*.mp3}\tctermfg=red"; assert_success(cmds_dispatch(COMMANDS1, &lwin, CIT_COMMAND)); assert_int_equal(1, cfg.cs.file_hi_count); assert_success(cmds_dispatch(COMMANDS2, &lwin, CIT_COMMAND)); assert_int_equal(2, cfg.cs.file_hi_count); assert_success(cmds_dispatch(COMMANDS3, &lwin, CIT_COMMAND)); assert_int_equal(3, cfg.cs.file_hi_count); if(cfg.cs.file_hi_count > 0) { assert_string_equal("{*.jpg}", matchers_get_expr(cfg.cs.file_hi[0].matchers)); } if(cfg.cs.file_hi_count > 1) { assert_string_equal("{*.avi}", matchers_get_expr(cfg.cs.file_hi[1].matchers)); } if(cfg.cs.file_hi_count > 2) { assert_string_equal("{*.mp3}", matchers_get_expr(cfg.cs.file_hi[2].matchers)); } } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/generic.c0000600000175000017500000003777015051153245014477 0ustar korykory#include #include /* chmod() */ #include /* F_OK access() chdir() rmdir() unlink() */ #include /* LC_ALL setlocale() */ #include /* FILE fclose() fopen() fprintf() remove() */ #include /* strcpy() */ #include #include "../../src/compat/fs_limits.h" #include "../../src/cfg/config.h" #include "../../src/engine/cmds.h" #include "../../src/engine/keys.h" #include "../../src/engine/mode.h" #include "../../src/modes/modes.h" #include "../../src/ui/ui.h" #include "../../src/utils/dynarray.h" #include "../../src/utils/env.h" #include "../../src/utils/fs.h" #include "../../src/utils/path.h" #include "../../src/utils/str.h" #include "../../src/cmd_core.h" #include "../../src/filelist.h" #include "../../src/ops.h" #include "../../src/registers.h" #include "../../src/status.h" #include "../../src/undo.h" static int builtin_cmd(const cmd_info_t* cmd_info); static const cmd_add_t commands[] = { { .name = "builtin", .abbr = NULL, .id = -1, .descr = "descr", .flags = HAS_EMARK | HAS_BG_FLAG, .handler = &builtin_cmd, .min_args = 0, .max_args = 0, }, { .name = "onearg", .abbr = NULL, .id = -1, .descr = "descr", .flags = 0, .handler = &builtin_cmd, .min_args = 1, .max_args = 1, }, }; static int called; static int bg; static char *arg; static char cwd[PATH_MAX + 1]; static char sandbox[PATH_MAX + 1]; static char test_data[PATH_MAX + 1]; SETUP_ONCE() { assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(sandbox, sizeof(sandbox), SANDBOX_PATH, "", cwd); make_abs_path(test_data, sizeof(test_data), TEST_DATA_PATH, "", cwd); } SETUP() { view_setup(&lwin); view_setup(&rwin); curr_view = &lwin; other_view = &rwin; conf_setup(); cfg.use_system_calls = 1; cmds_init(); vle_cmds_add(commands, ARRAY_LEN(commands)); called = 0; undo_setup(); } TEARDOWN() { conf_teardown(); view_teardown(&lwin); view_teardown(&rwin); vle_cmds_reset(); undo_teardown(); } static int builtin_cmd(const cmd_info_t* cmd_info) { called = 1; bg = cmd_info->bg; if(cmd_info->argc != 0) { replace_string(&arg, cmd_info->argv[0]); } return 0; } TEST(space_amp) { assert_success(cmds_dispatch("builtin &", &lwin, CIT_COMMAND)); assert_true(called); assert_true(bg); } TEST(space_amp_spaces) { assert_success(cmds_dispatch("builtin & ", &lwin, CIT_COMMAND)); assert_true(called); assert_true(bg); } TEST(space_bg_bar) { assert_success(cmds_dispatch("builtin &|", &lwin, CIT_COMMAND)); assert_true(called); assert_true(bg); } TEST(bg_space_bar) { assert_success(cmds_dispatch("builtin& |", &lwin, CIT_COMMAND)); assert_true(called); assert_true(bg); } TEST(space_bg_space_bar) { assert_success(cmds_dispatch("builtin & |", &lwin, CIT_COMMAND)); assert_true(called); assert_true(bg); } TEST(non_printable_arg) { /* \x0C is Ctrl-L. */ assert_success(cmds_dispatch("onearg \x0C", &lwin, CIT_COMMAND)); assert_true(called); assert_string_equal("\x0C", arg); } TEST(non_printable_arg_in_udf) { /* \x0C is Ctrl-L. */ assert_success(cmds_dispatch("command udf :onearg \x0C", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("udf", &lwin, CIT_COMMAND)); assert_true(called); assert_string_equal("\x0C", arg); } TEST(space_last_arg_in_udf) { assert_success(cmds_dispatch("command udf :onearg \\ ", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("udf", &lwin, CIT_COMMAND)); assert_true(called); assert_string_equal(" ", arg); } TEST(bg_mark_with_space_in_udf) { assert_success(cmds_dispatch("command udf :builtin &", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("udf", &lwin, CIT_COMMAND)); assert_true(called); assert_true(bg); } TEST(bg_mark_without_space_in_udf) { assert_success(cmds_dispatch("command udf :builtin&", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("udf", &lwin, CIT_COMMAND)); assert_true(called); assert_true(bg); } TEST(shell_invocation_works_in_udf) { const char *const cmd = "command! udf echo a > out"; #ifndef _WIN32 replace_string(&cfg.shell, "/bin/sh"); replace_string(&cfg.shell_cmd_flag, "-c"); #else replace_string(&cfg.shell, "cmd"); replace_string(&cfg.shell_cmd_flag, "/C"); #endif assert_success(chdir(SANDBOX_PATH)); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); curr_view = &lwin; assert_failure(access("out", F_OK)); assert_success(cmds_dispatch("udf", &lwin, CIT_COMMAND)); assert_success(access("out", F_OK)); assert_success(unlink("out")); } TEST(envvars_of_commands_come_from_variables_unit) { assert_success(chdir(test_data)); strcpy(lwin.curr_dir, test_data); assert_false(is_root_dir(lwin.curr_dir)); assert_success(cmds_dispatch("let $ABCDE = '/'", &lwin, CIT_COMMAND)); env_set("ABCDE", SANDBOX_PATH); assert_success(cmds_dispatch("cd $ABCDE", &lwin, CIT_COMMAND)); assert_true(is_root_dir(lwin.curr_dir)); } TEST(or_operator_is_attributed_to_echo) { (void)cmds_dispatch("echo 1 || builtin", &lwin, CIT_COMMAND); assert_false(called); } TEST(bar_is_not_attributed_to_echo) { (void)cmds_dispatch("echo 1 | builtin", &lwin, CIT_COMMAND); assert_true(called); } TEST(mixed_or_operator_and_bar) { (void)cmds_dispatch("echo 1 || 0 | builtin", &lwin, CIT_COMMAND); assert_true(called); } TEST(or_operator_is_attributed_to_if) { (void)cmds_dispatch("if 0 || 0 | builtin | endif", &lwin, CIT_COMMAND); assert_false(called); } TEST(or_operator_is_attributed_to_let) { (void)cmds_dispatch("let $a = 'x'", &lwin, CIT_COMMAND); assert_string_equal("x", env_get("a")); (void)cmds_dispatch("let $a = 0 || 1", &lwin, CIT_COMMAND); assert_string_equal("1", env_get("a")); } TEST(user_command_is_executed_in_separated_scope) { assert_success(cmds_dispatch("command cmd :if 1 > 2", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("cmd", &lwin, CIT_COMMAND)); } TEST(usercmd_can_provide_input_to_fg_process, IF(have_cat)) { assert_success(chdir(SANDBOX_PATH)); setup_grid(&lwin, 20, 2, /*init=*/1); replace_string(&lwin.dir_entry[0].name, "a"); replace_string(&lwin.dir_entry[1].name, "b"); assert_int_equal(0, cmds_dispatch("command list cat > file %Pl", &lwin, CIT_COMMAND)); lwin.dir_entry[0].marked = 1; lwin.dir_entry[1].marked = 1; lwin.pending_marking = 1; assert_int_equal(0, cmds_dispatch("list", &lwin, CIT_COMMAND)); const char *lines[] = { "/path/a", "/path/b" }; file_is("file", lines, ARRAY_LEN(lines)); remove_file("file"); } TEST(usercmd_can_provide_input_to_bg_process, IF(have_cat)) { assert_success(chdir(SANDBOX_PATH)); setup_grid(&lwin, 20, 2, /*init=*/1); replace_string(&lwin.dir_entry[0].name, "a"); replace_string(&lwin.dir_entry[1].name, "b"); assert_int_equal(0, cmds_dispatch("command list cat > file %Pl &", &lwin, CIT_COMMAND)); lwin.dir_entry[0].marked = 1; lwin.dir_entry[1].marked = 1; lwin.pending_marking = 1; assert_int_equal(0, cmds_dispatch("list", &lwin, CIT_COMMAND)); wait_for_all_bg(); const char *lines[] = { "/path/a", "/path/b" }; file_is("file", lines, ARRAY_LEN(lines)); remove_file("file"); } TEST(cv_is_built_by_emark) { make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), test_data, "", cwd); flist_custom_start(&lwin, "test"); assert_non_null(flist_custom_add(&lwin, "existing-files/a")); assert_success(flist_custom_finish(&lwin, CV_REGULAR, 0)); assert_success(cmds_dispatch("!echo %c %u", &lwin, CIT_COMMAND)); assert_true(flist_custom_active(&lwin)); assert_string_equal("!echo %c %u", lwin.custom.title); } TEST(title_of_cv_is_limited, IF(not_windows)) { const char *long_cmd = "!echo " " " " %c%u"; const char *title = "!echo " " ..."; assert_success(stats_init(&cfg)); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), test_data, "", cwd); flist_custom_start(&lwin, "test"); assert_non_null(flist_custom_add(&lwin, "existing-files/a")); assert_success(flist_custom_finish(&lwin, CV_REGULAR, 0)); assert_success(cmds_dispatch(long_cmd, &lwin, CIT_COMMAND)); assert_true(flist_custom_active(&lwin)); assert_string_equal(title, lwin.custom.title); } TEST(cv_is_built_by_usercmd) { make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), test_data, "", cwd); flist_custom_start(&lwin, "test"); assert_non_null(flist_custom_add(&lwin, "existing-files/a")); assert_success(flist_custom_finish(&lwin, CV_REGULAR, 0)); assert_success(cmds_dispatch("command cmd echo %c %u", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("cmd", &lwin, CIT_COMMAND)); assert_true(flist_custom_active(&lwin)); assert_string_equal(":cmd", lwin.custom.title); } TEST(tree_cv_keeps_title) { make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), test_data, "", cwd); flist_custom_start(&lwin, "test"); assert_non_null(flist_custom_add(&lwin, "existing-files/a")); assert_success(flist_custom_finish(&lwin, CV_REGULAR, 0)); assert_success(cmds_dispatch("!echo %c %u", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("tree", &lwin, CIT_COMMAND)); assert_true(flist_custom_active(&lwin)); assert_string_equal("!echo %c %u", lwin.custom.title); } TEST(put_bg_cmd_is_parsed_correctly) { /* Simulate custom view to force failure of the command. */ lwin.curr_dir[0] = '\0'; assert_success(cmds_dispatch("put \" &", &lwin, CIT_COMMAND)); } TEST(conversion_failure_is_handled) { assert_non_null(setlocale(LC_ALL, "C")); modes_init(); /* Execution of the following commands just shouldn't crash. */ (void)cmds_dispatch("nnoremap \xee\x85\x8b", &lwin, CIT_COMMAND); (void)cmds_dispatch("nnoremap \xee\x85\x8b tj", &lwin, CIT_COMMAND); (void)cmds_dispatch("nnoremap tj \xee\x85\x8b", &lwin, CIT_COMMAND); (void)cmds_dispatch("nunmap \xee\x85\x8b", &lwin, CIT_COMMAND); (void)cmds_dispatch("unmap \xee\x85\x8b", &lwin, CIT_COMMAND); (void)cmds_dispatch("cabbrev \xee\x85\x8b tj", &lwin, CIT_COMMAND); /* The next command is needed so that there will be something to list. */ (void)cmds_dispatch("cabbrev a b", &lwin, CIT_COMMAND); (void)cmds_dispatch("cabbrev \xee\x85\x8b", &lwin, CIT_COMMAND); (void)cmds_dispatch("cunabbrev \xee\x85\x8b", &lwin, CIT_COMMAND); (void)cmds_dispatch("normal \xee\x85\x8b", &lwin, CIT_COMMAND); (void)cmds_dispatch("wincmd \xee", &lwin, CIT_COMMAND); vle_keys_reset(); } TEST(selection_is_not_reset_in_visual_mode) { modes_init(); init_view_list(&lwin); update_string(&lwin.dir_entry[0].name, "name"); (void)cmds_dispatch("if 1 == 1 | execute 'norm! ggvG' | endif", &lwin, CIT_COMMAND); assert_true(lwin.dir_entry[0].selected); assert_int_equal(1, lwin.selected_files); assert_true(vle_mode_is(VISUAL_MODE)); vle_keys_reset(); } TEST(usercmd_range_is_as_good_as_selection) { stats_init(&cfg); modes_init(); regs_init(); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), test_data, "", cwd); populate_dir_list(&lwin, 0); /* For gA. */ assert_success(cmds_dispatch("command! size :normal gA", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("%size", &lwin, CIT_COMMAND)); wait_for_bg(); assert_string_equal("color-schemes", lwin.dir_entry[0].name); assert_ulong_equal(107, fentry_get_size(&lwin, &lwin.dir_entry[0])); assert_string_equal("various-sizes", lwin.dir_entry[lwin.list_rows - 1].name); assert_ulong_equal(73728, fentry_get_size(&lwin, &lwin.dir_entry[lwin.list_rows - 1])); /* For zf. */ assert_success(cmds_dispatch("command! afilter :normal zf", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("%afilter", &lwin, CIT_COMMAND)); populate_dir_list(&lwin, 1); assert_int_equal(1, lwin.list_rows); assert_string_equal("..", lwin.dir_entry[0].name); /* For zd. */ flist_custom_start(&lwin, "test"); assert_non_null(flist_custom_add(&lwin, "existing-files/a")); assert_non_null(flist_custom_add(&lwin, "existing-files/b")); assert_success(flist_custom_finish(&lwin, CV_REGULAR, 0)); assert_success(cmds_dispatch("command! exclude :normal zd", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("%exclude", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.list_rows); assert_string_equal("..", lwin.dir_entry[0].name); /* For :command in :usercmd. */ flist_custom_start(&lwin, "test"); assert_non_null(flist_custom_add(&lwin, "existing-files/a")); assert_non_null(flist_custom_add(&lwin, "existing-files/b")); assert_success(flist_custom_finish(&lwin, CV_REGULAR, 0)); const reg_t *reg = regs_find('"'); assert_success(cmds_dispatch("command! myyank :yank", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("%myyank", &lwin, CIT_COMMAND)); assert_int_equal(2, reg->nfiles); assert_success(cmds_dispatch("command! myyank :yank %a", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("%myyank", &lwin, CIT_COMMAND)); assert_int_equal(2, reg->nfiles); #ifndef _WIN32 update_string(&cfg.shell, "/bin/sh"); char script_path[PATH_MAX + 1]; make_abs_path(script_path, sizeof(script_path), SANDBOX_PATH, "script", cwd); FILE *fp = fopen(SANDBOX_PATH "/script", "w"); fprintf(fp, "#!/bin/sh\n"); fprintf(fp, "for arg; do echo \"$arg\" >> %s/vi-list; done\n", SANDBOX_PATH); fclose(fp); assert_success(chmod(SANDBOX_PATH "/script", 0777)); /* For l. */ update_string(&cfg.vi_command, script_path); flist_custom_start(&lwin, "test"); assert_non_null(flist_custom_add(&lwin, "existing-files/a")); assert_non_null(flist_custom_add(&lwin, "existing-files/b")); assert_success(flist_custom_finish(&lwin, CV_REGULAR, 0)); assert_success(cmds_dispatch("command! run :normal l", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("%run", &lwin, CIT_COMMAND)); const char *lines[] = { "existing-files/a", "existing-files/b" }; file_is(SANDBOX_PATH "/vi-list", lines, ARRAY_LEN(lines)); assert_success(remove(SANDBOX_PATH "/vi-list")); /* For cp. */ update_string(&cfg.shell, "/bin/sh"); assert_success(chdir(sandbox)); create_file("file1"); create_file("file2"); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), sandbox, "", cwd); populate_dir_list(&lwin, 0); assert_success(cmds_dispatch("command! ex :normal 777cp", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("%ex", &lwin, CIT_COMMAND)); populate_dir_list(&lwin, 1); assert_int_equal(FT_EXEC, lwin.dir_entry[0].type); assert_int_equal(FT_EXEC, lwin.dir_entry[1].type); assert_success(remove("file1")); assert_success(remove("file2")); /* For some :menus. */ put_string(&cfg.find_prg, format_str("%s %%s %%A", script_path)); assert_success(chdir(cwd)); strcpy(lwin.curr_dir, test_data); flist_custom_start(&lwin, "test"); assert_non_null(flist_custom_add(&lwin, "existing-files/a")); assert_non_null(flist_custom_add(&lwin, "existing-files/b")); assert_success(flist_custom_finish(&lwin, CV_REGULAR, 0)); assert_failure(cmds_dispatch(".find a", &lwin, CIT_COMMAND)); const char *find_lines[] = { "existing-files/a", "a" }; file_is(SANDBOX_PATH "/vi-list", find_lines, ARRAY_LEN(find_lines)); assert_success(remove(SANDBOX_PATH "/vi-list")); assert_success(remove(script_path)); #endif regs_reset(); vle_keys_reset(); stats_reset(&cfg); } TEST(search_usercmd_perform_search) { make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), test_data, "", cwd); populate_dir_list(&lwin, /*reload=*/0); assert_int_equal(0, lwin.list_pos); assert_string_equal("", lwin.last_search); assert_success(cmds_dispatch("command cmd /var", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("cmd", &lwin, CIT_COMMAND)); assert_int_equal(9, lwin.list_pos); assert_string_equal("var", lwin.last_search); } TEST(search_usercmd_sets_search_direction_on_editing) { make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), test_data, "", cwd); populate_dir_list(&lwin, /*reload=*/0); assert_int_equal(0, lwin.list_pos); assert_string_equal("", lwin.last_search); curr_stats.last_search_backward = 1; assert_success(cmds_dispatch("command cmd /var", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("cmd", &lwin, CIT_COMMAND)); assert_int_equal(9, lwin.list_pos); assert_string_equal("var", lwin.last_search); assert_false(curr_stats.last_search_backward); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/call.c0000600000175000017500000000411415051153245013760 0ustar korykory#include #include "../../src/cmd_core.h" #include "../../src/engine/cmds.h" #include "../../src/engine/functions.h" #include "../../src/engine/parsing.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/ui.h" #include "../../src/builtin_functions.h" #include static void check_and_remove_file(void); SETUP_ONCE() { vle_parser_init(NULL); init_builtin_functions(); cmds_init(); conf_setup(); } TEARDOWN_ONCE() { function_reset_all(); vle_cmds_reset(); conf_teardown(); } SETUP() { curr_view = &lwin; other_view = &rwin; } TEARDOWN() { curr_view = NULL; other_view = NULL; } TEST(good_call) { assert_success(cmds_dispatch1("call system('echo call> file')", &lwin, CIT_COMMAND)); check_and_remove_file(); } TEST(good_call_with_comment) { assert_success(cmds_dispatch1("call system('echo call> file') \" comment", &lwin, CIT_COMMAND)); check_and_remove_file(); } TEST(unknown_function) { ui_sb_msg(""); assert_failure(cmds_dispatch1("call nosuchfunc()", &lwin, CIT_COMMAND)); assert_string_equal("Invalid expression: nosuchfunc()", ui_sb_last()); } TEST(bad_expression) { ui_sb_msg(""); assert_failure(cmds_dispatch1("call 1 + 2", &lwin, CIT_COMMAND)); assert_string_equal("Invalid expression: 1 + 2", ui_sb_last()); } TEST(side_effects_on_error) { ui_sb_msg(""); assert_failure(cmds_dispatch1("call 2 + system('echo call> file')", &lwin, CIT_COMMAND)); assert_string_equal("Invalid expression: 2 + system('echo call> file')", ui_sb_last()); no_remove_file("file"); /* Unlike in Vim, don't execute call expression followed by trailing * characters. */ ui_sb_msg(""); assert_failure(cmds_dispatch1("call system('echo call> file') + 2", &lwin, CIT_COMMAND)); assert_string_equal("Invalid expression: system('echo call> file') + 2", ui_sb_last()); no_remove_file("file"); } static void check_and_remove_file(void) { const char *lines[] = { "call" }; file_is("file", lines, 1); remove_file("file"); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/wincmd.c0000600000175000017500000000370015051153245014326 0ustar korykory#include #include #include "../../src/cfg/config.h" #include "../../src/engine/functions.h" #include "../../src/engine/keys.h" #include "../../src/modes/modes.h" #include "../../src/ui/ui.h" #include "../../src/utils/env.h" #include "../../src/builtin_functions.h" #include "../../src/cmd_core.h" #include "../../src/status.h" SETUP() { modes_init(); view_setup(&lwin); view_setup(&rwin); curr_view = &lwin; other_view = &rwin; opt_handlers_setup(); cmds_init(); } TEARDOWN() { opt_handlers_teardown(); vle_keys_reset(); vle_cmds_reset(); view_teardown(&lwin); view_teardown(&rwin); } TEST(wincmd_can_switch_views) { assert_success(stats_init(&cfg)); curr_view = &rwin; other_view = &lwin; assert_success(cmds_dispatch("wincmd h", curr_view, CIT_COMMAND)); assert_true(curr_view == &lwin); curr_view = &rwin; other_view = &lwin; assert_success(cmds_dispatch("execute 'wincmd h'", curr_view, CIT_COMMAND)); assert_true(curr_view == &lwin); init_builtin_functions(); curr_view = &rwin; other_view = &lwin; assert_success( cmds_dispatch("if paneisat('left') == 0 | execute 'wincmd h' | endif", curr_view, CIT_COMMAND)); assert_true(curr_view == &lwin); curr_view = &rwin; other_view = &lwin; assert_success( cmds_dispatch("if paneisat('left') == 0 " "| execute 'wincmd h' " "| let $a = paneisat('left') " "|endif", curr_view, CIT_COMMAND)); assert_true(curr_view == &lwin); assert_string_equal("1", env_get("a")); function_reset_all(); assert_success(stats_reset(&cfg)); } TEST(wincmd_ignores_mappings) { curr_view = &rwin; other_view = &lwin; assert_success(cmds_dispatch("nnoremap ", curr_view, CIT_COMMAND)); assert_success(cmds_dispatch("wincmd H", curr_view, CIT_COMMAND)); assert_true(curr_view == &lwin); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/commands/bmarks.c0000600000175000017500000001051015051153245014321 0ustar korykory#include #include /* NULL */ #include /* strcmp() strcpy() strlen() */ #include "../../src/ui/ui.h" #include "../../src/utils/str.h" #include "../../src/bmarks.h" #include "../../src/cmd_core.h" static int count_bmarks(void); static void bmarks_cb(const char p[], const char t[], time_t timestamp, void *arg); static char *path; static char *tags; static int cb_called; SETUP() { cmds_init(); lwin.selected_files = 0; strcpy(lwin.curr_dir, "/a/path"); path = NULL; tags = NULL; curr_view = &lwin; other_view = &rwin; } TEARDOWN() { assert_success(cmds_dispatch("delbmarks!", &lwin, CIT_COMMAND)); free(path); free(tags); } TEST(tag_with_comma_is_rejected) { assert_failure(cmds_dispatch("bmark a,b", &lwin, CIT_COMMAND)); } TEST(tag_with_space_is_rejected) { assert_failure(cmds_dispatch("bmark a\\ b", &lwin, CIT_COMMAND)); } TEST(emark_with_bookmark_path_only) { assert_failure(cmds_dispatch("bmark! /fake/path", &lwin, CIT_COMMAND)); } TEST(emark_allows_specifying_bookmark_path) { assert_success(cmds_dispatch("bmark! /fake/path tag", &lwin, CIT_COMMAND)); assert_int_equal(1, count_bmarks()); } TEST(delbmarks_with_emark_removes_all_tags) { assert_success(cmds_dispatch("bmark! /path1 tag1", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("bmark! /path2 tag2", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("bmark! /path3 tag3", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("delbmarks!", &lwin, CIT_COMMAND)); assert_int_equal(0, count_bmarks()); } TEST(delbmarks_with_emark_removes_selected_bookmarks) { assert_success(cmds_dispatch("bmark! /path1 tag1", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("bmark! /path2 tag2", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("bmark! /path3 tag3", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("delbmarks! /path1 /path3", &lwin, CIT_COMMAND)); assert_int_equal(1, count_bmarks()); } TEST(delbmarks_without_args_removes_current_mark) { assert_success(cmds_dispatch("bmark tag1", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("delbmarks", &lwin, CIT_COMMAND)); assert_int_equal(0, count_bmarks()); } TEST(delbmarks_with_args_removes_matching_bookmarks) { assert_success(cmds_dispatch("bmark! /path1 t1 t2", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("bmark! /path2 t2 t3", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("bmark! /path3 t1 t3", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("delbmarks t3", &lwin, CIT_COMMAND)); assert_int_equal(1, count_bmarks()); } TEST(delbmarks_tag_with_comma_is_rejected) { assert_failure(cmds_dispatch("delbmarks a,b", &lwin, CIT_COMMAND)); } TEST(arguments_are_unescaped) { assert_success(cmds_dispatch("bmark! /\\*stars\\* tag", &lwin, CIT_COMMAND)); assert_int_equal(1, count_bmarks()); assert_string_equal("/*stars*", path); } TEST(arguments_are_unquoted_single) { assert_success(cmds_dispatch("bmark! '/squotes' tag", &lwin, CIT_COMMAND)); assert_int_equal(1, count_bmarks()); assert_string_equal("/squotes", path); } TEST(arguments_are_unquoted_double) { assert_success(cmds_dispatch("bmark! \"/dquotes\" tag", &lwin, CIT_COMMAND)); assert_int_equal(1, count_bmarks()); assert_string_equal("/dquotes", path); } TEST(first_argument_is_expanded) { assert_success(cmds_dispatch("bmark! %d tag", &lwin, CIT_COMMAND)); assert_int_equal(1, count_bmarks()); assert_string_equal("/a/path", path); } TEST(not_first_argument_is_not_expanded) { assert_success(cmds_dispatch("bmark! /dir %d", &lwin, CIT_COMMAND)); assert_int_equal(1, count_bmarks()); assert_string_equal("%d", tags); } TEST(not_all_macros_are_expanded) { assert_success(cmds_dispatch("bmark! /%b%n%i%a%m%M%s%S%u%U%px tag", &lwin, CIT_COMMAND)); assert_int_equal(1, count_bmarks()); assert_string_equal("/", path); } TEST(tilde_is_expanded) { assert_success(cmds_dispatch("bmark! ~ tag", &lwin, CIT_COMMAND)); assert_int_equal(1, count_bmarks()); assert_false(path[0] == '~'); assert_false(path[strlen(path) - 1] == '~'); } static int count_bmarks(void) { cb_called = 0; bmarks_list(&bmarks_cb, NULL); return cb_called; } static void bmarks_cb(const char p[], const char t[], time_t timestamp, void *arg) { replace_string(&path, p); replace_string(&tags, t); ++cb_called; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/comments.c0000600000175000017500000000263015051153245014673 0ustar korykory#include #include #include "../../src/cfg/config.h" #include "../../src/engine/cmds.h" #include "../../src/ui/ui.h" #include "../../src/utils/env.h" #include "../../src/cmd_core.h" TEST(whole_line_comments) { assert_success(cmds_dispatch1("\"", NULL, CIT_COMMAND)); assert_success(cmds_dispatch1(" \"", NULL, CIT_COMMAND)); assert_success(cmds_dispatch1(" \"", NULL, CIT_COMMAND)); } TEST(trailing_comments) { view_setup(&lwin); view_setup(&rwin); curr_view = &lwin; other_view = &rwin; cmds_init(); opt_handlers_setup(); assert_success(cmds_dispatch1("let $a = 4 \"", &lwin, CIT_COMMAND)); assert_string_equal("4", env_get("a")); assert_success(cmds_dispatch1("let $a = \" 4 \"", &lwin, CIT_COMMAND)); assert_string_equal(" 4 ", env_get("a")); assert_failure(cmds_dispatch1("echo \" 4 \"", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch1("exe \" 4 \"", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch1("unlet $a \"comment", &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get("a")); assert_success(cmds_dispatch1("set statusline=\" %t%= %A %15E %20d \"", &lwin, CIT_COMMAND)); assert_string_equal(" %t%= %A %15E %20d ", cfg.status_line); opt_handlers_teardown(); vle_cmds_reset(); view_teardown(&lwin); view_teardown(&rwin); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/selection.c0000600000175000017500000003546715051153245015051 0ustar korykory#include #include /* chdir() */ #include /* remove() */ #include /* strcpy() strdup() */ #include #include "../../src/cfg/config.h" #include "../../src/ui/ui.h" #include "../../src/utils/dynarray.h" #include "../../src/utils/fs.h" #include "../../src/utils/str.h" #include "../../src/cmd_core.h" #include "../../src/status.h" static void add_some_files_to_view(view_t *view); SETUP() { view_setup(&lwin); view_setup(&rwin); curr_view = &lwin; other_view = &rwin; #ifndef _WIN32 replace_string(&cfg.shell, "/bin/sh"); replace_string(&cfg.shell_cmd_flag, "-c"); #else replace_string(&cfg.shell, "cmd"); replace_string(&cfg.shell_cmd_flag, "/C"); #endif stats_update_shell_type(cfg.shell); cmds_init(); cfg_resize_histories(10); char cwd[PATH_MAX + 1]; assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), SANDBOX_PATH, "", cwd); create_file(SANDBOX_PATH "/a.c"); create_file(SANDBOX_PATH "/b.cc"); create_file(SANDBOX_PATH "/c.c"); } TEARDOWN() { cfg_resize_histories(0); stats_update_shell_type("/bin/sh"); update_string(&cfg.shell, NULL); update_string(&cfg.shell_cmd_flag, NULL); view_teardown(&lwin); view_teardown(&rwin); assert_success(unlink(SANDBOX_PATH "/a.c")); assert_success(unlink(SANDBOX_PATH "/b.cc")); assert_success(unlink(SANDBOX_PATH "/c.c")); } TEST(select_fails_for_wrong_pattern) { assert_failure(cmds_dispatch("select /**/", &lwin, CIT_COMMAND)); } TEST(select_fails_for_pattern_and_range) { assert_failure(cmds_dispatch("1,$select *.c", &lwin, CIT_COMMAND)); } TEST(select_selects_matching_files) { add_some_files_to_view(&lwin); assert_success(cmds_dispatch("select *.c", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[2].selected); } TEST(select_appends_matching_files_to_selection) { add_some_files_to_view(&lwin); lwin.dir_entry[0].selected = 1; lwin.dir_entry[1].selected = 1; lwin.selected_files = 2; assert_success(cmds_dispatch("select *.c", &lwin, CIT_COMMAND)); assert_int_equal(3, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_true(lwin.dir_entry[2].selected); } TEST(select_bang_unselects_nonmatching_files) { add_some_files_to_view(&lwin); lwin.dir_entry[0].selected = 1; lwin.dir_entry[1].selected = 1; lwin.selected_files = 2; assert_success(cmds_dispatch("select! *.c", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_true(lwin.dir_entry[2].selected); } TEST(select_noargs_selects_current_file) { add_some_files_to_view(&lwin); lwin.dir_entry[0].selected = 1; lwin.dir_entry[1].selected = 1; lwin.selected_files = 2; lwin.list_pos = 2; assert_success(cmds_dispatch("select", &lwin, CIT_COMMAND)); assert_int_equal(3, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_true(lwin.dir_entry[2].selected); assert_success(cmds_dispatch("select", &lwin, CIT_COMMAND)); assert_int_equal(3, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_true(lwin.dir_entry[2].selected); assert_success(cmds_dispatch("select!", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_true(lwin.dir_entry[2].selected); } TEST(select_can_select_range) { add_some_files_to_view(&lwin); lwin.dir_entry[0].selected = 1; lwin.selected_files = 1; assert_success(cmds_dispatch("2,$select", &lwin, CIT_COMMAND)); assert_int_equal(3, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_true(lwin.dir_entry[2].selected); assert_success(cmds_dispatch("2,$select!", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_true(lwin.dir_entry[2].selected); } TEST(unselect_fails_for_wrong_pattern) { assert_failure(cmds_dispatch("unselect /**/", &lwin, CIT_COMMAND)); } TEST(unselect_fails_for_pattern_and_range) { assert_failure(cmds_dispatch("1,$unselect *.c", &lwin, CIT_COMMAND)); } TEST(unselect_unselects_matching_files) { add_some_files_to_view(&lwin); lwin.dir_entry[0].selected = 1; lwin.dir_entry[1].selected = 1; lwin.selected_files = 2; assert_success(cmds_dispatch("unselect *.c", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); } TEST(unselect_noargs_unselects_current_file) { add_some_files_to_view(&lwin); lwin.dir_entry[0].selected = 1; lwin.dir_entry[1].selected = 1; lwin.selected_files = 2; lwin.list_pos = 2; assert_success(cmds_dispatch("unselect", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); lwin.list_pos = 1; assert_success(cmds_dispatch("unselect", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); } TEST(unselect_can_unselect_range) { add_some_files_to_view(&lwin); lwin.dir_entry[0].selected = 1; lwin.dir_entry[1].selected = 1; lwin.dir_entry[2].selected = 1; lwin.selected_files = 3; assert_success(cmds_dispatch("2,$unselect", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); } TEST(select_and_unselect_and_pattern_ambiguity) { add_some_files_to_view(&lwin); assert_success(cmds_dispatch("select !{*.c}", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("unselect !/\\.c/", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); } TEST(select_and_unselect_use_last_pattern) { add_some_files_to_view(&lwin); cfg_resize_histories(5); hists_search_save(".*\\.C"); assert_success(cmds_dispatch("select! //I", &lwin, CIT_COMMAND)); assert_int_equal(0, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); hists_search_save(".*\\.c$"); assert_success(cmds_dispatch("select //", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_true(lwin.dir_entry[2].selected); hists_search_save("a.c"); assert_success(cmds_dispatch("unselect ////", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_true(lwin.dir_entry[2].selected); cfg_resize_histories(0); } TEST(select_and_unselect_accept_external_command) { add_some_files_to_view(&lwin); assert_success(cmds_dispatch("select !echo a.c", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); assert_success(cmds_dispatch("select!!echo c.c", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_true(lwin.dir_entry[2].selected); assert_success(cmds_dispatch("unselect !echo c.c", &lwin, CIT_COMMAND)); assert_int_equal(0, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); } TEST(select_expands_macros_in_external_command) { add_some_files_to_view(&lwin); assert_success(cmds_dispatch("select !echo %c", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); } TEST(select_directory_supplied_by_external_command) { create_dir(SANDBOX_PATH "/selection"); lwin.list_rows = 2; lwin.list_pos = 0; lwin.dir_entry = dynarray_cextend(NULL, lwin.list_rows*sizeof(*lwin.dir_entry)); lwin.dir_entry[0].name = strdup("selection"); lwin.dir_entry[0].origin = &lwin.curr_dir[0]; lwin.dir_entry[0].type = FT_DIR; lwin.dir_entry[1].name = strdup("a.c"); lwin.dir_entry[1].origin = &lwin.curr_dir[1]; lwin.dir_entry[1].type = FT_REG; lwin.selected_files = 0; assert_success(cmds_dispatch("select! !echo selection", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_success(cmds_dispatch("select! !echo selection/", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_success(cmds_dispatch("select! !echo selection//////", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_success(cmds_dispatch("select! !echo a.c/", &lwin, CIT_COMMAND)); assert_int_equal(0, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); remove_dir(SANDBOX_PATH "/selection"); } TEST(select_and_unselect_consider_trailing_slash) { lwin.list_rows = 4; lwin.list_pos = 0; lwin.dir_entry = dynarray_cextend(NULL, lwin.list_rows*sizeof(*lwin.dir_entry)); lwin.dir_entry[0].name = strdup("a"); lwin.dir_entry[0].origin = &lwin.curr_dir[0]; lwin.dir_entry[0].type = FT_REG; lwin.dir_entry[1].name = strdup("a"); lwin.dir_entry[1].origin = &lwin.curr_dir[0]; lwin.dir_entry[1].type = FT_DIR; lwin.dir_entry[2].name = strdup("b"); lwin.dir_entry[2].origin = &lwin.curr_dir[0]; lwin.dir_entry[2].type = FT_REG; lwin.dir_entry[3].name = strdup("b"); lwin.dir_entry[3].origin = &lwin.curr_dir[0]; lwin.dir_entry[3].type = FT_DIR; lwin.selected_files = 0; /* Select only directories. */ assert_success(cmds_dispatch("select */", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); assert_true(lwin.dir_entry[3].selected); /* Select both file and directory. */ assert_success(cmds_dispatch("select! a", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); assert_false(lwin.dir_entry[3].selected); /* Select only files inside given directory. */ assert_success(cmds_dispatch("select! {{*/a/**}}", &lwin, CIT_COMMAND)); assert_int_equal(0, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); assert_false(lwin.dir_entry[3].selected); /* Select directories and files. */ assert_success(cmds_dispatch("select! {{*/a}}", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); assert_false(lwin.dir_entry[3].selected); /* Select only directories. */ assert_success(cmds_dispatch("select! {{*/a/}}", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); assert_false(lwin.dir_entry[3].selected); } TEST(symlinks_are_not_resolved_in_cwd, IF(not_windows)) { assert_success(make_symlink(TEST_DATA_PATH "/existing-files", SANDBOX_PATH "/link")); lwin.list_rows = 1; lwin.list_pos = 0; lwin.dir_entry = dynarray_cextend(NULL, lwin.list_rows*sizeof(*lwin.dir_entry)); lwin.dir_entry[0].name = strdup("a"); lwin.dir_entry[0].origin = &lwin.curr_dir[0]; lwin.dir_entry[0].type = FT_REG; lwin.selected_files = 0; /* Select only directories. */ assert_success(cmds_dispatch("select !echo a", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_success(remove(SANDBOX_PATH "/link")); } TEST(select_and_unselect_can_take_location_list_as_input) { add_some_files_to_view(&lwin); assert_success(cmds_dispatch("select !echo a.c:here", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); assert_success(cmds_dispatch("unselect !echo a.c:here", &lwin, CIT_COMMAND)); assert_int_equal(0, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); } TEST(input_redirection, IF(have_cat)) { add_some_files_to_view(&lwin); assert_success(cmds_dispatch("select *", &lwin, CIT_COMMAND)); assert_int_equal(3, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_true(lwin.dir_entry[2].selected); assert_success(cmds_dispatch("unselect !cat %Pl", &lwin, CIT_COMMAND)); assert_int_equal(0, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_false(lwin.dir_entry[2].selected); } TEST(pipe_in_pattern_does_not_separate_commands) { assert_success(cmds_dispatch("select /first|second/", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("unselect /first|second/", &lwin, CIT_COMMAND)); } TEST(negated_mimetype_matcher_is_handled) { /* ! must not be taken for a request to run an external command. */ add_some_files_to_view(&lwin); assert_success(cmds_dispatch("select !{*.c}", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.selected_files); assert_success(cmds_dispatch("unselect !{*.c}", &lwin, CIT_COMMAND)); assert_int_equal(0, lwin.selected_files); } static void add_some_files_to_view(view_t *view) { view->list_rows = 3; view->list_pos = 0; view->dir_entry = dynarray_cextend(NULL, view->list_rows*sizeof(*view->dir_entry)); view->dir_entry[0].name = strdup("a.c"); view->dir_entry[0].origin = &view->curr_dir[0]; view->dir_entry[1].name = strdup("b.cc"); view->dir_entry[1].origin = &view->curr_dir[0]; view->dir_entry[2].name = strdup("c.c"); view->dir_entry[2].origin = &view->curr_dir[0]; view->selected_files = 0; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/commands/filetype.c0000600000175000017500000001024215051153245014665 0ustar korykory#include #include #include "../../src/engine/keys.h" #include "../../src/int/file_magic.h" #include "../../src/modes/modes.h" #include "../../src/ui/ui.h" #include "../../src/cmd_core.h" #include "../../src/filelist.h" #include "../../src/filetype.h" #include "../../src/status.h" static void check_filetype(void); static int prog_exists(const char name[]); static int has_mime_type_detection(void); SETUP() { cmds_init(); conf_setup(); view_setup(&lwin); view_setup(&rwin); curr_view = &lwin; other_view = &rwin; } TEARDOWN() { view_teardown(&lwin); view_teardown(&rwin); conf_teardown(); vle_cmds_reset(); } TEST(filetype_accepts_negated_patterns) { ft_init(&prog_exists); assert_success(cmds_dispatch("filetype !{*.tar} prog", &lwin, CIT_COMMAND)); check_filetype(); ft_reset(0); } TEST(filextype_accepts_negated_patterns) { ft_init(&prog_exists); curr_stats.exec_env_type = EET_EMULATOR_WITH_X; assert_success(cmds_dispatch("filextype !{*.tar} prog", &lwin, CIT_COMMAND)); check_filetype(); curr_stats.exec_env_type = EET_LINUX_NATIVE; ft_reset(1); curr_stats.exec_env_type = EET_EMULATOR_WITH_X; } TEST(fileviewer_accepts_negated_patterns) { ft_init(&prog_exists); assert_success(cmds_dispatch("fileviewer !{*.tar} view", &lwin, CIT_COMMAND)); assert_string_equal("view", ft_get_viewer("file.version.tar.bz2")); ft_reset(0); } TEST(pattern_anding_and_orring_failures) { /* No matching is performed, so we can use application/octet-stream. */ assert_failure(cmds_dispatch("filetype /*/," "{binary-data} app", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("fileviewer /*/," "{binary-data} viewer", &lwin, CIT_COMMAND)); } TEST(pattern_anding_and_orring, IF(has_mime_type_detection)) { char cmd[1024]; assoc_records_t ft; ft_init(&prog_exists); snprintf(cmd, sizeof(cmd), "filetype {two-lines},<%s>{binary-data} app", get_mimetype(TEST_DATA_PATH "/read/binary-data", 0)); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); snprintf(cmd, sizeof(cmd), "fileviewer {two-lines},<%s>{binary-data} viewer", get_mimetype(TEST_DATA_PATH "/read/binary-data", 0)); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); ft = ft_get_all_programs(TEST_DATA_PATH "/read/two-lines"); assert_int_equal(1, ft.count); if(ft.count == 1) { assert_string_equal("app", ft.list[0].command); } ft_assoc_records_free(&ft); ft = ft_get_all_programs(TEST_DATA_PATH "/read/binary-data"); assert_int_equal(1, ft.count); if(ft.count == 1) { assert_string_equal("app", ft.list[0].command); } ft_assoc_records_free(&ft); ft = ft_get_all_programs(TEST_DATA_PATH "/read/utf8-bom"); assert_int_equal(0, ft.count); ft_assoc_records_free(&ft); assert_string_equal("viewer", ft_get_viewer(TEST_DATA_PATH "/read/two-lines")); assert_string_equal("viewer", ft_get_viewer(TEST_DATA_PATH "/read/binary-data")); assert_string_equal(NULL, ft_get_viewer(TEST_DATA_PATH "/read/utf8-bom")); ft_reset(0); } TEST(cv_is_built_by_handler) { modes_init(); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "", NULL); flist_custom_start(&lwin, "test"); assert_non_null(flist_custom_add(&lwin, "existing-files/a")); assert_success(flist_custom_finish(&lwin, CV_REGULAR, 0)); assert_success(cmds_dispatch("filetype a echo %c %u", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("normal l", &lwin, CIT_COMMAND)); assert_true(flist_custom_active(&lwin)); assert_string_equal("echo %c %u", lwin.custom.title); vle_keys_reset(); } static void check_filetype(void) { assoc_records_t ft; ft = ft_get_all_programs("file.version.tar"); assert_int_equal(0, ft.count); ft_assoc_records_free(&ft); ft = ft_get_all_programs("file.version.tar.bz"); assert_int_equal(1, ft.count); assert_string_equal("prog", ft.list[0].command); ft_assoc_records_free(&ft); } static int prog_exists(const char name[]) { return 1; } static int has_mime_type_detection(void) { return get_mimetype(TEST_DATA_PATH "/read/dos-line-endings", 0) != NULL; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/commands/sibl.c0000600000175000017500000001441215051153245014000 0ustar korykory#include #include /* chdir() rmdir() unlink() */ #include /* strcpy() */ #include #include "../../src/compat/fs_limits.h" #include "../../src/compat/os.h" #include "../../src/ui/ui.h" #include "../../src/utils/fs.h" #include "../../src/cmd_core.h" #include "../../src/filelist.h" static char cwd[PATH_MAX + 1]; SETUP_ONCE() { assert_non_null(get_cwd(cwd, sizeof(cwd))); curr_view = &lwin; other_view = &rwin; } SETUP() { view_setup(&lwin); cmds_init(); opt_handlers_setup(); } TEARDOWN() { view_teardown(&lwin); vle_cmds_reset(); opt_handlers_teardown(); } TEST(sibl_do_nothing_in_cv) { char path[PATH_MAX + 1]; make_abs_path(path, sizeof(path), TEST_DATA_PATH, "existing-files/a", cwd); flist_custom_start(&lwin, "test"); flist_custom_add(&lwin, path); assert_true(flist_custom_finish(&lwin, CV_REGULAR, 0) == 0); assert_success(cmds_dispatch("siblnext", &lwin, CIT_COMMAND)); assert_true(flist_custom_active(&lwin)); } TEST(sibl_navigate_correctly) { char path[PATH_MAX + 1]; make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "read", cwd); assert_success(cmds_dispatch("siblnext", &lwin, CIT_COMMAND)); make_abs_path(path, sizeof(path), TEST_DATA_PATH, "rename", cwd); assert_true(paths_are_same(lwin.curr_dir, path)); assert_success(cmds_dispatch("siblprev", &lwin, CIT_COMMAND)); make_abs_path(path, sizeof(path), TEST_DATA_PATH, "read", cwd); assert_true(paths_are_same(lwin.curr_dir, path)); assert_success(cmds_dispatch("2siblnext", &lwin, CIT_COMMAND)); make_abs_path(path, sizeof(path), TEST_DATA_PATH, "scripts", cwd); assert_true(paths_are_same(lwin.curr_dir, path)); assert_success(cmds_dispatch("3siblprev", &lwin, CIT_COMMAND)); make_abs_path(path, sizeof(path), TEST_DATA_PATH, "quotes-in-names", cwd); assert_true(paths_are_same(lwin.curr_dir, path)); } TEST(sibl_does_not_wrap_by_default) { make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "various-sizes", cwd); assert_success(cmds_dispatch("siblnext", &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, TEST_DATA_PATH "/various-sizes")); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "color-schemes", cwd); assert_success(cmds_dispatch("siblprev", &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, TEST_DATA_PATH "/color-schemes")); } TEST(sibl_wrap) { char path[PATH_MAX + 1]; make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "various-sizes", cwd); cmds_dispatch("siblnext!", &lwin, CIT_COMMAND); make_abs_path(path, sizeof(path), TEST_DATA_PATH, "color-schemes", cwd); assert_true(paths_are_same(lwin.curr_dir, path)); cmds_dispatch("siblprev!", &lwin, CIT_COMMAND); make_abs_path(path, sizeof(path), TEST_DATA_PATH, "various-sizes", cwd); assert_true(paths_are_same(lwin.curr_dir, path)); } TEST(sibl_handles_errors_without_failures) { char path[PATH_MAX + 1]; make_abs_path(path, sizeof(path), TEST_DATA_PATH, "not_a_valid_last_entry", cwd); strcpy(lwin.curr_dir, "not/a/valid/path"); cmds_dispatch("siblnext!", &lwin, CIT_COMMAND); assert_string_equal(lwin.curr_dir, "not/a/valid/path"); strcpy(lwin.curr_dir, path); cmds_dispatch("siblprev", &lwin, CIT_COMMAND); assert_true(paths_are_same(lwin.curr_dir, path)); } TEST(sibl_skips_files_and_can_work_without_sorting) { char path[PATH_MAX + 1]; char *const saved_cwd = save_cwd(); make_abs_path(path, sizeof(path), TEST_DATA_PATH, "a", cwd); assert_success(os_mkdir(SANDBOX_PATH "/a", 0700)); create_file(SANDBOX_PATH "/b"); lwin.sort_g[0] = SK_NONE; strcpy(lwin.curr_dir, path); cmds_dispatch("siblnext!", &lwin, CIT_COMMAND); assert_true(paths_are_same(lwin.curr_dir, path)); restore_cwd(saved_cwd); assert_success(rmdir(SANDBOX_PATH "/a")); assert_success(unlink(SANDBOX_PATH "/b")); } TEST(sibl_uses_global_sort_option) { char path[PATH_MAX + 1]; make_abs_path(path, sizeof(path), TEST_DATA_PATH, "rename", cwd); lwin.sort[0] = -SK_BY_NAME; make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "read", cwd); assert_success(cmds_dispatch("siblnext", &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, path)); } TEST(sibl_respects_dot_filter) { char path[PATH_MAX + 1]; lwin.hide_dot = 1; assert_success(os_mkdir(SANDBOX_PATH "/.a", 0700)); assert_success(os_mkdir(SANDBOX_PATH "/b", 0700)); make_abs_path(path, sizeof(path), SANDBOX_PATH, "b", cwd); strcpy(lwin.curr_dir, path); assert_success(cmds_dispatch("siblnext", &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, path)); strcpy(lwin.curr_dir, path); assert_success(cmds_dispatch("siblprev", &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, path)); assert_success(rmdir(SANDBOX_PATH "/.a")); assert_success(rmdir(SANDBOX_PATH "/b")); lwin.hide_dot = 0; } TEST(sibl_respects_name_filters) { char path[PATH_MAX + 1]; (void)replace_matcher(&lwin.manual_filter, "a"); (void)filter_set(&lwin.auto_filter, "c"); assert_success(os_mkdir(SANDBOX_PATH "/a", 0700)); assert_success(os_mkdir(SANDBOX_PATH "/b", 0700)); assert_success(os_mkdir(SANDBOX_PATH "/c", 0700)); make_abs_path(path, sizeof(path), SANDBOX_PATH, "b", cwd); strcpy(lwin.curr_dir, path); assert_success(cmds_dispatch("siblnext", &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, path)); strcpy(lwin.curr_dir, path); assert_success(cmds_dispatch("siblprev", &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, path)); assert_success(rmdir(SANDBOX_PATH "/a")); assert_success(rmdir(SANDBOX_PATH "/b")); assert_success(rmdir(SANDBOX_PATH "/c")); } TEST(sibl_works_inside_filtered_out_directory) { char path[PATH_MAX + 1]; lwin.hide_dot = 1; assert_success(os_mkdir(SANDBOX_PATH "/a", 0700)); assert_success(os_mkdir(SANDBOX_PATH "/.b", 0700)); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), SANDBOX_PATH, ".b", cwd); assert_success(cmds_dispatch("siblnext", &lwin, CIT_COMMAND)); make_abs_path(path, sizeof(path), SANDBOX_PATH, "a", cwd); assert_true(paths_are_same(lwin.curr_dir, path)); assert_success(chdir(cwd)); assert_success(rmdir(SANDBOX_PATH "/a")); assert_success(rmdir(SANDBOX_PATH "/.b")); lwin.hide_dot = 0; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/commands/misc.c0000600000175000017500000006036615051153245014013 0ustar korykory#include #include /* chdir() rmdir() unlink() */ #include /* INT_MAX */ #include /* remove() snprintf() */ #include /* strcpy() strdup() */ #include #include "../../src/cfg/config.h" #include "../../src/compat/fs_limits.h" #include "../../src/compat/os.h" #include "../../src/engine/keys.h" #include "../../src/lua/vlua.h" #include "../../src/modes/menu.h" #include "../../src/modes/modes.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/ui.h" #include "../../src/utils/dynarray.h" #include "../../src/utils/fs.h" #include "../../src/utils/macros.h" #include "../../src/utils/path.h" #include "../../src/utils/str.h" #include "../../src/utils/string_array.h" #include "../../src/cmd_core.h" #include "../../src/compare.h" #include "../../src/filelist.h" #include "../../src/flist_hist.h" #include "../../src/plugins.h" #include "../../src/registers.h" #include "../../src/running.h" #include "../../src/status.h" #include "../lua/asserts.h" static char *saved_cwd; static char cwd[PATH_MAX + 1]; static char sandbox[PATH_MAX + 1]; static char test_data[PATH_MAX + 1]; static void strings_list_is(const strlist_t expected, const strlist_t actual); SETUP_ONCE() { cfg.sizefmt.base = 1; assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(sandbox, sizeof(sandbox), SANDBOX_PATH, "", cwd); make_abs_path(test_data, sizeof(test_data), TEST_DATA_PATH, "", cwd); } SETUP() { view_setup(&lwin); view_setup(&rwin); curr_view = &lwin; other_view = &rwin; conf_setup(); undo_setup(); cmds_init(); saved_cwd = save_cwd(); } TEARDOWN() { restore_cwd(saved_cwd); view_teardown(&lwin); view_teardown(&rwin); conf_teardown(); vle_cmds_reset(); undo_teardown(); } TEST(cd_in_root_works) { assert_success(chdir(test_data)); strcpy(lwin.curr_dir, test_data); assert_false(is_root_dir(lwin.curr_dir)); assert_success(cmds_dispatch("cd /", &lwin, CIT_COMMAND)); assert_true(is_root_dir(lwin.curr_dir)); } TEST(double_cd_uses_same_base_for_rel_paths) { char path[PATH_MAX + 1]; assert_success(chdir(test_data)); strcpy(lwin.curr_dir, test_data); strcpy(rwin.curr_dir, ".."); assert_success(cmds_dispatch("cd read rename", &lwin, CIT_COMMAND)); snprintf(path, sizeof(path), "%s/read", test_data); assert_true(paths_are_equal(lwin.curr_dir, path)); snprintf(path, sizeof(path), "%s/rename", test_data); assert_true(paths_are_equal(rwin.curr_dir, path)); } TEST(tr_extends_second_field) { char path[PATH_MAX + 1]; assert_success(chdir(sandbox)); strcpy(lwin.curr_dir, sandbox); snprintf(path, sizeof(path), "%s/a b", sandbox); create_file(path); lwin.list_rows = 1; lwin.list_pos = 0; lwin.dir_entry = dynarray_cextend(NULL, lwin.list_rows*sizeof(*lwin.dir_entry)); lwin.dir_entry[0].name = strdup("a b"); lwin.dir_entry[0].origin = &lwin.curr_dir[0]; (void)cmds_dispatch("tr/ ?<>\\\\:*|\"/_", &lwin, CIT_COMMAND); snprintf(path, sizeof(path), "%s/a_b", sandbox); assert_success(remove(path)); } TEST(substitute_works) { char path[PATH_MAX + 1]; assert_success(chdir(sandbox)); strcpy(lwin.curr_dir, sandbox); snprintf(path, sizeof(path), "%s/a b b", sandbox); create_file(path); snprintf(path, sizeof(path), "%s/B c", sandbox); create_file(path); lwin.list_rows = 2; lwin.list_pos = 0; lwin.dir_entry = dynarray_cextend(NULL, lwin.list_rows*sizeof(*lwin.dir_entry)); lwin.dir_entry[0].name = strdup("a b b"); lwin.dir_entry[0].origin = &lwin.curr_dir[0]; lwin.dir_entry[1].name = strdup("B c"); lwin.dir_entry[1].origin = &lwin.curr_dir[0]; (void)cmds_dispatch("%substitute/b/c/Iig", &lwin, CIT_COMMAND); snprintf(path, sizeof(path), "%s/a c c", sandbox); assert_success(remove(path)); snprintf(path, sizeof(path), "%s/c c", sandbox); assert_success(remove(path)); } TEST(chmod_works, IF(not_windows)) { char path[PATH_MAX + 1]; assert_success(chdir(sandbox)); strcpy(lwin.curr_dir, sandbox); snprintf(path, sizeof(path), "%s/file1", sandbox); create_file(path); snprintf(path, sizeof(path), "%s/file2", sandbox); create_file(path); lwin.list_rows = 2; lwin.list_pos = 0; lwin.dir_entry = dynarray_cextend(NULL, lwin.list_rows*sizeof(*lwin.dir_entry)); lwin.dir_entry[0].name = strdup("file1"); lwin.dir_entry[0].origin = &lwin.curr_dir[0]; lwin.dir_entry[1].name = strdup("file2"); lwin.dir_entry[1].origin = &lwin.curr_dir[0]; (void)cmds_dispatch("1,2chmod +x", &lwin, CIT_COMMAND); populate_dir_list(&lwin, 1); assert_int_equal(FT_EXEC, lwin.dir_entry[0].type); assert_int_equal(FT_EXEC, lwin.dir_entry[1].type); snprintf(path, sizeof(path), "%s/file1", sandbox); assert_success(remove(path)); snprintf(path, sizeof(path), "%s/file2", sandbox); assert_success(remove(path)); } TEST(putting_files_works) { char path[PATH_MAX + 1]; regs_init(); assert_success(os_mkdir(SANDBOX_PATH "/empty-dir", 0700)); assert_success(flist_load_tree(&lwin, sandbox, INT_MAX)); make_abs_path(path, sizeof(path), TEST_DATA_PATH, "read/binary-data", cwd); assert_success(regs_append(DEFAULT_REG_NAME, path)); lwin.list_pos = 1; assert_true(cmds_dispatch("put", &lwin, CIT_COMMAND) != 0); restore_cwd(saved_cwd); saved_cwd = save_cwd(); assert_success(unlink(SANDBOX_PATH "/empty-dir/binary-data")); assert_success(rmdir(SANDBOX_PATH "/empty-dir")); regs_reset(); } TEST(yank_works_with_ranges) { char path[PATH_MAX + 1]; const reg_t *reg; regs_init(); flist_custom_start(&lwin, "test"); snprintf(path, sizeof(path), "%s/%s", test_data, "existing-files/a"); flist_custom_add(&lwin, path); assert_true(flist_custom_finish(&lwin, CV_REGULAR, 0) == 0); reg = regs_find(DEFAULT_REG_NAME); assert_non_null(reg); assert_int_equal(0, reg->nfiles); (void)cmds_dispatch("%yank", &lwin, CIT_COMMAND); assert_int_equal(1, reg->nfiles); regs_reset(); } TEST(symlinks_in_paths_are_not_resolved, IF(not_windows)) { char canonic_path[PATH_MAX + 1]; char buf[PATH_MAX + 1]; assert_success(os_mkdir(SANDBOX_PATH "/dir1", 0700)); assert_success(os_mkdir(SANDBOX_PATH "/dir1/dir2", 0700)); char src[PATH_MAX + 1], dst[PATH_MAX + 1]; make_abs_path(src, sizeof(src), SANDBOX_PATH, "dir1/dir2", saved_cwd); make_abs_path(dst, sizeof(dst), SANDBOX_PATH, "dir-link", saved_cwd); assert_success(make_symlink(src, dst)); assert_success(chdir(SANDBOX_PATH "/dir-link")); make_abs_path(buf, sizeof(buf), SANDBOX_PATH, "dir-link", saved_cwd); to_canonic_path(buf, "/fake-root", lwin.curr_dir, sizeof(lwin.curr_dir)); to_canonic_path(sandbox, "/fake-root", canonic_path, sizeof(canonic_path)); /* :mkdir */ (void)cmds_dispatch("mkdir ../dir", &lwin, CIT_COMMAND); restore_cwd(saved_cwd); saved_cwd = save_cwd(); assert_success(rmdir(SANDBOX_PATH "/dir")); /* :clone file name. */ create_file(SANDBOX_PATH "/dir-link/file"); populate_dir_list(&lwin, 1); (void)cmds_dispatch("clone ../file-clone", &lwin, CIT_COMMAND); restore_cwd(saved_cwd); saved_cwd = save_cwd(); assert_success(remove(SANDBOX_PATH "/file-clone")); assert_success(remove(SANDBOX_PATH "/dir-link/file")); /* :colorscheme */ make_abs_path(cfg.colors_dir, sizeof(cfg.colors_dir), TEST_DATA_PATH, "scripts/", saved_cwd); snprintf(buf, sizeof(buf), "colorscheme set-env %s/../dir-link/..", sandbox); assert_success(cmds_dispatch(buf, &lwin, CIT_COMMAND)); cs_load_defaults(); /* :cd */ assert_success(cmds_dispatch("cd ../dir-link/..", &lwin, CIT_COMMAND)); assert_string_equal(canonic_path, lwin.curr_dir); restore_cwd(saved_cwd); saved_cwd = save_cwd(); assert_success(remove(SANDBOX_PATH "/dir-link")); assert_success(rmdir(SANDBOX_PATH "/dir1/dir2")); assert_success(rmdir(SANDBOX_PATH "/dir1")); } TEST(grep_command, IF(not_windows)) { opt_handlers_setup(); replace_string(&cfg.shell, "/bin/sh"); update_string(&cfg.shell_cmd_flag, "-c"); assert_success(chdir(TEST_DATA_PATH "/scripts")); assert_non_null(get_cwd(lwin.curr_dir, sizeof(lwin.curr_dir))); assert_success(cmds_dispatch("set grepprg='grep -n -H -r %i %a %s %u'", &lwin, CIT_COMMAND)); /* Nothing to repeat. */ assert_failure(cmds_dispatch("grep", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("grep command", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.list_rows); assert_string_equal("Grep command", lwin.custom.title); /* Repeat last grep, but add inversion. */ assert_success(cmds_dispatch("grep!", &lwin, CIT_COMMAND)); assert_int_equal(5, lwin.list_rows); assert_string_equal("Grep command", lwin.custom.title); opt_handlers_teardown(); } TEST(touch) { to_canonic_path(SANDBOX_PATH, cwd, lwin.curr_dir, sizeof(lwin.curr_dir)); (void)cmds_dispatch("touch file", &lwin, CIT_COMMAND); assert_success(remove(SANDBOX_PATH "/file")); } TEST(compare) { opt_handlers_setup(); create_file(SANDBOX_PATH "/file"); to_canonic_path(SANDBOX_PATH, cwd, lwin.curr_dir, sizeof(lwin.curr_dir)); /* The file is empty so nothing to do when "skipempty" is specified. */ assert_success(cmds_dispatch("compare ofone skipempty", &lwin, CIT_COMMAND)); assert_false(flist_custom_active(&lwin)); /* Verify that later arguments override the former ones. */ (void)cmds_dispatch("compare byname bysize bycontents listall listdups " "listunique ofboth ofone groupids grouppaths", &lwin, CIT_COMMAND); assert_true(flist_custom_active(&lwin)); assert_int_equal(CV_REGULAR, lwin.custom.type); rn_leave(&lwin, /*levels=*/1); /* Can't toggle without !. */ (void)cmds_dispatch("compare byname", &lwin, CIT_COMMAND); assert_int_equal(CF_GROUP_PATHS | CF_SHOW, lwin.custom.diff_cmp_flags); (void)cmds_dispatch("compare showdifferent", &lwin, CIT_COMMAND); assert_int_equal(CF_GROUP_PATHS | CF_SHOW, lwin.custom.diff_cmp_flags); rn_leave(&lwin, /*levels=*/1); /* No toggling. */ (void)cmds_dispatch("compare! showdifferent", &lwin, CIT_COMMAND); assert_string_equal("Toggling requires active compare view", ui_sb_last()); /* Verify that two-pane compare gets correct arguments. */ make_abs_path(rwin.curr_dir, sizeof(rwin.curr_dir), TEST_DATA_PATH, "rename", cwd); (void)cmds_dispatch("compare byname withrcase withicase", &lwin, CIT_COMMAND); assert_true(flist_custom_active(&lwin)); assert_true(flist_custom_active(&rwin)); assert_int_equal(CT_NAME, lwin.custom.diff_cmp_type); assert_int_equal(LT_ALL, lwin.custom.diff_list_type); assert_int_equal(CF_GROUP_PATHS | CF_IGNORE_CASE | CF_SHOW, lwin.custom.diff_cmp_flags); /* Toggling. */ (void)cmds_dispatch("compare! showidentical showdifferent", &lwin, CIT_COMMAND); assert_true(flist_custom_active(&lwin)); assert_true(flist_custom_active(&rwin)); assert_int_equal(CT_NAME, lwin.custom.diff_cmp_type); assert_int_equal(LT_ALL, lwin.custom.diff_list_type); assert_int_equal(CF_GROUP_PATHS | CF_IGNORE_CASE | CF_SHOW_UNIQUE_LEFT | CF_SHOW_UNIQUE_RIGHT, lwin.custom.diff_cmp_flags); /* Bad toggling. */ (void)cmds_dispatch("compare! byname", &lwin, CIT_COMMAND); assert_int_equal(CF_GROUP_PATHS | CF_IGNORE_CASE | CF_SHOW_UNIQUE_LEFT | CF_SHOW_UNIQUE_RIGHT, lwin.custom.diff_cmp_flags); assert_string_equal("Unexpected property for toggling: byname", ui_sb_last()); assert_success(chdir(cwd)); assert_success(remove(SANDBOX_PATH "/file")); opt_handlers_teardown(); } TEST(screen) { assert_false(cfg.use_term_multiplexer); /* :screen toggles the option. */ assert_success(cmds_dispatch("screen", &lwin, CIT_COMMAND)); assert_true(cfg.use_term_multiplexer); assert_success(cmds_dispatch("screen", &lwin, CIT_COMMAND)); assert_false(cfg.use_term_multiplexer); /* :screen! sets it to on. */ assert_success(cmds_dispatch("screen!", &lwin, CIT_COMMAND)); assert_true(cfg.use_term_multiplexer); assert_success(cmds_dispatch("screen!", &lwin, CIT_COMMAND)); assert_true(cfg.use_term_multiplexer); cfg.use_term_multiplexer = 0; } TEST(hist_next_and_prev) { /* Emulate proper history initialization (must happen after view * initialization). */ cfg_resize_histories(10); cfg_resize_histories(0); cfg_resize_histories(10); flist_hist_setup(&lwin, sandbox, ".", 0, 1); flist_hist_setup(&lwin, test_data, ".", 0, 1); assert_success(cmds_dispatch("histprev", &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, sandbox)); assert_success(cmds_dispatch("histnext", &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, test_data)); cfg_resize_histories(0); } TEST(normal_command_does_not_reset_selection) { modes_init(); opt_handlers_setup(); lwin.list_rows = 2; lwin.list_pos = 0; lwin.dir_entry = dynarray_cextend(NULL, lwin.list_rows*sizeof(*lwin.dir_entry)); lwin.dir_entry[0].name = strdup("a"); lwin.dir_entry[0].origin = &lwin.curr_dir[0]; lwin.dir_entry[0].selected = 1; lwin.dir_entry[1].name = strdup("b"); lwin.dir_entry[1].origin = &lwin.curr_dir[0]; lwin.dir_entry[1].selected = 0; lwin.selected_files = 1; assert_success(cmds_dispatch(":normal! t", &lwin, CIT_COMMAND)); assert_int_equal(0, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); assert_success(cmds_dispatch(":normal! vG\r", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_true(lwin.dir_entry[1].selected); assert_success(cmds_dispatch(":normal! t", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); assert_false(lwin.dir_entry[1].selected); opt_handlers_teardown(); vle_keys_reset(); } TEST(keepsel_preserves_selection) { init_view_list(&lwin); lwin.dir_entry[0].selected = 1; lwin.selected_files = 1; assert_failure(cmds_dispatch("echo 'hi'", &lwin, CIT_COMMAND)); assert_int_equal(0, lwin.selected_files); assert_false(lwin.dir_entry[0].selected); lwin.dir_entry[0].selected = 1; lwin.selected_files = 1; assert_failure(cmds_dispatch("keepsel echo 'hi'", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.selected_files); assert_true(lwin.dir_entry[0].selected); } TEST(echo_reports_all_errors) { const char *expected; expected = "Expression is missing closing quote: \"hi\n" "Invalid expression: \"hi"; ui_sb_msg(""); assert_failure(cmds_dispatch("echo \"hi", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); expected = "Expression is missing closing parenthesis: (1\n" "Invalid expression: (1"; ui_sb_msg(""); assert_failure(cmds_dispatch("echo (1", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); char zeroes[8192] = "echo "; memset(zeroes + strlen(zeroes), '0', sizeof(zeroes) - (strlen(zeroes) + 1U)); zeroes[sizeof(zeroes) - 1U] = '\0'; ui_sb_msg(""); assert_failure(cmds_dispatch(zeroes, &lwin, CIT_COMMAND)); assert_true(strchr(ui_sb_last(), '\n') != NULL); } TEST(echo_without_arguments_prints_nothing) { ui_sb_msg(""); /* First, print some message to record it as the last one. */ assert_failure(cmds_dispatch("echo 'previous'", &lwin, CIT_COMMAND)); assert_string_equal("previous", ui_sb_last()); /* Now, no message. The last one could popup here. */ assert_failure(cmds_dispatch("echo", &lwin, CIT_COMMAND)); assert_string_equal("", ui_sb_last()); } TEST(zero_count_is_rejected) { const char *expected = "Count argument can't be zero"; ui_sb_msg(""); assert_failure(cmds_dispatch("delete a 0", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); ui_sb_msg(""); assert_failure(cmds_dispatch("yank a 0", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); } TEST(tree_command) { strcpy(lwin.curr_dir, sandbox); /* Invalid input. */ assert_failure(cmds_dispatch("tree nesting=0", &lwin, CIT_COMMAND)); assert_false(flist_custom_active(&lwin)); assert_string_equal("Invalid argument: nesting=0", ui_sb_last()); assert_failure(cmds_dispatch("tree depth=0", &lwin, CIT_COMMAND)); assert_false(flist_custom_active(&lwin)); assert_string_equal("Invalid depth: 0", ui_sb_last()); /* :tree enters tree mode. */ assert_success(cmds_dispatch("tree", &lwin, CIT_COMMAND)); assert_true(flist_custom_active(&lwin)); assert_true(cv_tree(lwin.custom.type)); /* Repeating :tree leaves view in tree mode. */ assert_success(cmds_dispatch("tree", &lwin, CIT_COMMAND)); assert_true(flist_custom_active(&lwin)); assert_true(cv_tree(lwin.custom.type)); /* :tree! can leave tree mode. */ assert_success(cmds_dispatch("tree!", &lwin, CIT_COMMAND)); assert_false(flist_custom_active(&lwin)); /* :tree! can enter tree mode. */ assert_success(cmds_dispatch("tree!", &lwin, CIT_COMMAND)); assert_true(flist_custom_active(&lwin)); assert_true(cv_tree(lwin.custom.type)); /* Limited nesting. */ char sub_path[PATH_MAX + 1]; snprintf(sub_path, sizeof(sub_path), "%s/sub", sandbox); create_dir(sub_path); char sub_sub_path[PATH_MAX + 1]; snprintf(sub_sub_path, sizeof(sub_sub_path), "%s/sub/sub", sandbox); create_dir(sub_sub_path); assert_success(cmds_dispatch("tree depth=1", &lwin, CIT_COMMAND)); assert_true(flist_custom_active(&lwin)); assert_true(cv_tree(lwin.custom.type)); assert_int_equal(1, lwin.list_rows); remove_dir(sub_sub_path); remove_dir(sub_path); } TEST(regular_command) { strcpy(lwin.curr_dir, sandbox); /* :tree enters tree mode. */ assert_success(cmds_dispatch("tree", &lwin, CIT_COMMAND)); assert_true(flist_custom_active(&lwin)); assert_true(cv_tree(lwin.custom.type)); /* :regular leaves tree mode. */ assert_success(cmds_dispatch("regular", &lwin, CIT_COMMAND)); assert_false(flist_custom_active(&lwin)); /* Repeated :regular does nothing. */ assert_success(cmds_dispatch("regular", &lwin, CIT_COMMAND)); assert_false(flist_custom_active(&lwin)); } TEST(plugin_command) { curr_stats.vlua = vlua_init(); curr_stats.plugs = plugs_create(curr_stats.vlua); ui_sb_msg(""); assert_failure(cmds_dispatch("plugin load all", &lwin, CIT_COMMAND)); assert_string_equal("Trailing characters", ui_sb_last()); assert_failure(cmds_dispatch("plugin wrong arg", &lwin, CIT_COMMAND)); assert_string_equal("Unknown subcommand: wrong", ui_sb_last()); assert_failure(cmds_dispatch("plugin args-count", &lwin, CIT_COMMAND)); assert_string_equal("Too few arguments", ui_sb_last()); assert_success(cmds_dispatch("plugin load", &lwin, CIT_COMMAND)); strlist_t empty_list = {}; char *plug_items[] = { "plug" }; strlist_t plug_list = { .items = plug_items, .nitems = 1 }; ui_sb_msg(""); assert_success(cmds_dispatch("plugin blacklist plug", &lwin, CIT_COMMAND)); assert_string_equal("", ui_sb_last()); strings_list_is(plug_list, plugs_get_blacklist(curr_stats.plugs)); strings_list_is(empty_list, plugs_get_whitelist(curr_stats.plugs)); ui_sb_msg(""); assert_success(cmds_dispatch("plugin whitelist plug", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("plugin whitelist plug", &lwin, CIT_COMMAND)); assert_string_equal("", ui_sb_last()); strings_list_is(plug_list, plugs_get_blacklist(curr_stats.plugs)); strings_list_is(plug_list, plugs_get_whitelist(curr_stats.plugs)); plugs_free(curr_stats.plugs); curr_stats.plugs = NULL; vlua_finish(curr_stats.vlua); curr_stats.vlua = NULL; } TEST(help_command) { curr_stats.exec_env_type = EET_EMULATOR; update_string(&cfg.vi_command, "#vifmtest#editor"); curr_stats.vlua = vlua_init(); GLUA_EQ(curr_stats.vlua, "", "function handler(info) ginfo = info; return { success = false } end"); GLUA_EQ(curr_stats.vlua, "", "vifm.addhandler{ name = 'editor', handler = handler }"); cfg.use_vim_help = 0; assert_success(cmds_dispatch("help", &lwin, CIT_COMMAND)); char help_file[PATH_MAX + 1]; build_path(help_file, sizeof(help_file), get_installed_data_dir(), VIFM_HELP); GLUA_EQ(curr_stats.vlua, "edit-one", "print(ginfo.action)"); GLUA_EQ(curr_stats.vlua, help_file, "print(ginfo.path)"); GLUA_EQ(curr_stats.vlua, "false", "print(ginfo.mustwait)"); GLUA_EQ(curr_stats.vlua, "nil", "print(ginfo.line)"); GLUA_EQ(curr_stats.vlua, "nil", "print(ginfo.column)"); cfg.use_vim_help = 1; assert_success(cmds_dispatch("help", &lwin, CIT_COMMAND)); GLUA_EQ(curr_stats.vlua, "open-help", "print(ginfo.action)"); GLUA_EQ(curr_stats.vlua, "vifm-app.txt", "print(ginfo.topic)"); GLUA_ENDS(curr_stats.vlua, "/vim-doc", "print(ginfo.vimdocdir)"); cfg.use_vim_help = 0; vlua_finish(curr_stats.vlua); curr_stats.vlua = NULL; } TEST(view_command) { opt_handlers_setup(); curr_stats.preview.on = 0; assert_success(cmds_dispatch("view", &lwin, CIT_COMMAND)); assert_true(curr_stats.preview.on); assert_success(cmds_dispatch("view", &lwin, CIT_COMMAND)); assert_false(curr_stats.preview.on); assert_success(cmds_dispatch("view!", &lwin, CIT_COMMAND)); assert_true(curr_stats.preview.on); assert_success(cmds_dispatch("view!", &lwin, CIT_COMMAND)); assert_true(curr_stats.preview.on); assert_success(cmds_dispatch("view", &lwin, CIT_COMMAND)); assert_false(curr_stats.preview.on); opt_handlers_teardown(); } TEST(invert_command) { opt_handlers_setup(); ui_sb_msg(""); assert_failure(cmds_dispatch("set sort? sortorder?", &lwin, CIT_COMMAND)); assert_string_equal(" sort=+name\n sortorder=ascending", ui_sb_last()); assert_success(cmds_dispatch("invert o", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("set sort? sortorder?", &lwin, CIT_COMMAND)); assert_string_equal(" sort=-name\n sortorder=descending", ui_sb_last()); opt_handlers_teardown(); } TEST(locate_command) { ui_sb_msg(""); /* Nothing to repeat. */ assert_failure(cmds_dispatch("locate", &lwin, CIT_COMMAND)); assert_string_equal("Nothing to repeat", ui_sb_last()); } TEST(registers_command) { regs_init(); curr_stats.load_stage = -1; regs_append(DEFAULT_REG_NAME, "def"); assert_success(cmds_dispatch1("registers", &lwin, CIT_COMMAND)); assert_int_equal(2, menu_get_current()->len); regs_append('a', "a"); regs_append('b', "b1"); regs_append('b', "b2"); assert_success(cmds_dispatch1("registers aababaa", &lwin, CIT_COMMAND)); assert_int_equal(5, menu_get_current()->len); curr_stats.load_stage = 0; regs_reset(); } TEST(open_command) { curr_stats.vlua = vlua_init(); GLUA_EQ(curr_stats.vlua, "", "function editor(i) info = i end"); GLUA_EQ(curr_stats.vlua, "", "vifm.addhandler{ name = 'editor', handler = editor }"); update_string(&cfg.vi_command, "#vifmtest#editor"); create_file(SANDBOX_PATH "/to-open"); create_file(SANDBOX_PATH "/to-open-2"); lwin.list_rows = 2; lwin.list_pos = 0; lwin.dir_entry = dynarray_cextend(NULL, lwin.list_rows*sizeof(*lwin.dir_entry)); lwin.dir_entry[0].name = strdup("to-open"); lwin.dir_entry[0].origin = &lwin.curr_dir[0]; lwin.dir_entry[1].name = strdup("to-open-2"); lwin.dir_entry[1].origin = &lwin.curr_dir[0]; strcpy(lwin.curr_dir, sandbox); assert_success(cmds_dispatch1("open \"comment", &lwin, CIT_COMMAND)); GLUA_EQ(curr_stats.vlua, "1", "print(#info.paths)"); GLUA_EQ(curr_stats.vlua, "to-open", "print(info.paths[1])"); assert_success(cmds_dispatch1("%open", &lwin, CIT_COMMAND)); GLUA_EQ(curr_stats.vlua, "2", "print(#info.paths)"); GLUA_EQ(curr_stats.vlua, "to-open", "print(info.paths[1])"); GLUA_EQ(curr_stats.vlua, "to-open-2", "print(info.paths[2])"); remove_file(SANDBOX_PATH "/to-open"); remove_file(SANDBOX_PATH "/to-open-2"); vlua_finish(curr_stats.vlua); curr_stats.vlua = NULL; } TEST(mark_command) { /* Bad mark name. */ ui_sb_msg(""); assert_failure(cmds_dispatch1("mark ab", &lwin, CIT_COMMAND)); assert_string_equal("Invalid mark name: ab", ui_sb_last()); assert_failure(cmds_dispatch1("mark &", &lwin, CIT_COMMAND)); assert_string_equal("Invalid mark name: &", ui_sb_last()); /* Relative paths are rejected. */ ui_sb_msg(""); assert_failure(cmds_dispatch1("mark x aaaaa", &lwin, CIT_COMMAND)); assert_string_equal("Expected full path to a directory", ui_sb_last()); /* Environment variables are expanded. */ assert_success(cmds_dispatch1("let $TEST = '/'", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch1("mark x $TEST", &lwin, CIT_COMMAND)); const mark_t *mark = get_mark_by_name(&lwin, 'x'); assert_non_null(mark); assert_string_equal("/", mark->directory); /* Question mark prevents mark overwrite. */ ui_sb_msg(""); assert_failure(cmds_dispatch1("mark? x /tmp", &lwin, CIT_COMMAND)); assert_string_equal("Mark isn't empty: x", ui_sb_last()); /* Not an overwrite. */ assert_success(cmds_dispatch1("mark? y /tmp", &lwin, CIT_COMMAND)); } static void strings_list_is(const strlist_t expected, const strlist_t actual) { assert_int_equal(expected.nitems, actual.nitems); int i; for(i = 0; i < MIN(expected.nitems, actual.nitems); ++i) { assert_string_equal(expected.items[i], actual.items[i]); } } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/commands/scope.c0000600000175000017500000000431115051153245014155 0ustar korykory#include #include /* chmod() */ #include /* chdir() */ #include #include "../../src/cfg/config.h" #include "../../src/engine/keys.h" #include "../../src/modes/cmdline.h" #include "../../src/modes/modes.h" #include "../../src/modes/wk.h" #include "../../src/ui/ui.h" #include "../../src/utils/fs.h" #include "../../src/utils/str.h" #include "../../src/cmd_core.h" #include "../../src/filelist.h" #include "../../src/status.h" static line_stats_t *stats; SETUP_ONCE() { stats = get_line_stats(); curr_view = &lwin; other_view = &rwin; } SETUP() { modes_init(); modcline_enter(CLS_COMMAND, ""); } TEARDOWN() { (void)vle_keys_exec_timed_out(WK_C_c); vle_keys_reset(); } TEST(unfinished_scope_is_terminated_at_the_end) { (void)vle_keys_exec_timed_out(L":if 'a' == 'b'" WK_C_m); assert_true(cmds_scoped_empty()); (void)vle_keys_exec_timed_out(L":if 'a' == 'a' | | else" WK_C_m); assert_true(cmds_scoped_empty()); } TEST(finished_scope_is_terminated_at_the_end) { (void)vle_keys_exec_timed_out(L":if 'a' == 'a' | else | endif" WK_C_m); assert_true(cmds_scoped_empty()); } TEST(unfinished_scope_is_terminated_after_external_editing, IF(not_windows)) { FILE *fp; char path[PATH_MAX + 1]; char *const saved_cwd = save_cwd(); assert_success(chdir(SANDBOX_PATH)); /* Emulate proper history initialization (must happen after view * initialization). */ cfg_resize_histories(10); cfg_resize_histories(0); cfg_resize_histories(10); update_string(&cfg.shell, "/bin/sh"); stats_update_shell_type(cfg.shell); fp = fopen("./script", "w"); fputs("#!/bin/sh\n", fp); fputs("echo \"if 'a' == 'b'\" > $3\n", fp); fclose(fp); assert_success(chmod("script", 0777)); curr_stats.exec_env_type = EET_EMULATOR; make_abs_path(path, sizeof(path), SANDBOX_PATH, "script", saved_cwd); update_string(&cfg.vi_command, path); (void)vle_keys_exec_timed_out(WK_C_g); update_string(&cfg.vi_command, NULL); update_string(&cfg.shell, NULL); assert_success(unlink(path)); restore_cwd(saved_cwd); cfg_resize_histories(0); assert_true(cmds_scoped_empty()); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/set.c0000600000175000017500000000566615051153245013655 0ustar korykory#include #include #include "../../src/cfg/config.h" #include "../../src/ui/column_view.h" #include "../../src/ui/ui.h" #include "../../src/cmd_core.h" #include "../../src/opt_handlers.h" static void print_func(const char buf[], int offset, AlignType align, const char full_column[], const format_info_t *info); SETUP() { curr_view = &lwin; other_view = &rwin; conf_setup(); view_setup(&lwin); view_setup(&rwin); lwin.num_width_g = lwin.num_width = 4; lwin.columns = columns_create(); rwin.num_width_g = rwin.num_width = 4; rwin.columns = columns_create(); cmds_init(); opt_handlers_setup(); /* Name+size matches default column view setting ("-{name},{}"). */ columns_setup_column(SK_BY_NAME); columns_setup_column(SK_BY_SIZE); columns_set_line_print_func(&print_func); } TEARDOWN() { curr_view = NULL; other_view = NULL; conf_teardown(); view_teardown(&lwin); view_teardown(&rwin); vle_cmds_reset(); opt_handlers_teardown(); } TEST(set_local_sets_local_value) { assert_success(cmds_dispatch("setlocal numberwidth=2", &lwin, CIT_COMMAND)); assert_int_equal(4, lwin.num_width_g); assert_int_equal(2, lwin.num_width); } TEST(set_global_sets_global_value) { assert_success(cmds_dispatch("setglobal numberwidth=2", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.num_width_g); assert_int_equal(4, lwin.num_width); } TEST(set_sets_local_and_global_values) { assert_success(cmds_dispatch("set numberwidth=2", &lwin, CIT_COMMAND)); assert_int_equal(2, lwin.num_width_g); assert_int_equal(2, lwin.num_width); } TEST(fails_to_set_sort_group_with_wrong_regexp) { assert_failure(cmds_dispatch("set sortgroups=*", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("set sortgroups=.*,*", &lwin, CIT_COMMAND)); } TEST(global_local_always_updates_two_views) { lwin.ls_view_g = lwin.ls_view = 1; rwin.ls_view_g = rwin.ls_view = 0; lwin.hide_dot_g = lwin.hide_dot = 0; rwin.hide_dot_g = rwin.hide_dot = 1; load_view_options(curr_view); curr_stats.global_local_settings = 1; assert_success(cmds_dispatch("set nodotfiles lsview", &lwin, CIT_COMMAND)); assert_true(lwin.ls_view_g); assert_true(lwin.ls_view); assert_true(rwin.ls_view_g); assert_true(rwin.ls_view); assert_true(lwin.hide_dot_g); assert_true(lwin.hide_dot); assert_true(rwin.hide_dot_g); assert_true(rwin.hide_dot); curr_stats.global_local_settings = 0; } TEST(global_local_updates_regular_options_only_once) { assert_success(cmds_dispatch("set tabstop=1", &lwin, CIT_COMMAND)); assert_int_equal(1, cfg.tab_stop); curr_stats.global_local_settings = 1; assert_success(cmds_dispatch("set tabstop+=10", &lwin, CIT_COMMAND)); assert_int_equal(11, cfg.tab_stop); curr_stats.global_local_settings = 0; } static void print_func(const char buf[], int offset, AlignType align, const char full_column[], const format_info_t *info) { } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/restart.c0000600000175000017500000001716615051153266014547 0ustar korykory#include #include #include "../../src/cfg/config.h" #include "../../src/engine/abbrevs.h" #include "../../src/engine/keys.h" #include "../../src/ui/fileview.h" #include "../../src/ui/column_view.h" #include "../../src/ui/tabs.h" #include "../../src/ui/ui.h" #include "../../src/utils/env.h" #include "../../src/cmd_core.h" #include "../../src/flist_hist.h" #include "../../src/status.h" static void setup_tabs(void); static void check_first_tab(void); static void check_second_tab(void); SETUP() { curr_view = &lwin; other_view = &rwin; view_setup(&lwin); setup_grid(&lwin, 1, 1, 1); view_setup(&rwin); setup_grid(&rwin, 1, 1, 1); lwin.columns = columns_create(); rwin.columns = columns_create(); columns_setup_column(SK_BY_NAME); columns_setup_column(SK_BY_SIZE); cmds_init(); cfg.history_len = 10; opt_handlers_setup(); } TEARDOWN() { tabs_only(&lwin); tabs_only(&rwin); columns_teardown(); opt_handlers_teardown(); cfg.history_len = 0; vle_keys_reset(); view_teardown(&lwin); view_teardown(&rwin); curr_view = NULL; other_view = NULL; } TEST(history_survives_in_tabs_on_restart_without_persistance) { histories_init(10); setup_tabs(); assert_success(cmds_dispatch("restart", &lwin, CIT_COMMAND)); check_second_tab(); assert_success(cmds_dispatch("tabprev", &lwin, CIT_COMMAND)); check_first_tab(); } TEST(history_works_after_restart) { histories_init(10); hists_commands_save("cmd-1"); hists_commands_save("cmd-2"); assert_int_equal(10, curr_stats.cmd_hist.capacity); assert_int_equal(2, curr_stats.cmd_hist.size); assert_string_equal("cmd-2", curr_stats.cmd_hist.items[0].text); assert_string_equal("cmd-1", curr_stats.cmd_hist.items[1].text); assert_success(cmds_dispatch("restart", &lwin, CIT_COMMAND)); assert_int_equal(10, cfg.history_len); hists_commands_save("cmd-3"); assert_int_equal(10, curr_stats.cmd_hist.capacity); assert_int_equal(1, curr_stats.cmd_hist.size); assert_string_equal("cmd-3", curr_stats.cmd_hist.items[0].text); } TEST(restart_checks_its_parameter) { assert_failure(cmds_dispatch("restart wrong", &lwin, CIT_COMMAND)); } TEST(history_survives_in_tabs_on_restart_with_persistance) { histories_init(10); make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); cfg.vifm_info = VINFO_DHISTORY | VINFO_TABS; setup_tabs(); assert_success(cmds_dispatch("write | restart", &lwin, CIT_COMMAND)); check_second_tab(); assert_success(cmds_dispatch("tabprev", &lwin, CIT_COMMAND)); check_first_tab(); remove_file(SANDBOX_PATH "/vifminfo.json"); } TEST(partial_restart_preserves_tabs) { histories_init(10); make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); cfg.vifm_info = VINFO_DHISTORY | VINFO_TABS; setup_tabs(); assert_success(cmds_dispatch("restart", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_count(&lwin)); } TEST(full_restart_drops_tabs) { histories_init(10); make_abs_path(cfg.config_dir, sizeof(cfg.config_dir), SANDBOX_PATH, "", NULL); cfg.vifm_info = VINFO_DHISTORY | VINFO_TABS; setup_tabs(); assert_success(cmds_dispatch("restart full", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); } TEST(full_restart_can_change_tab_scope) { env_set("MYVIFMRC", SANDBOX_PATH "/vifmrc"); assert_success(cmds_dispatch1("set tabscope=global", &lwin, CIT_COMMAND)); assert_false(cfg.pane_tabs); make_file(SANDBOX_PATH "/vifmrc", "set tabscope=pane"); assert_success(cmds_dispatch1("restart full", &lwin, CIT_COMMAND)); assert_true(cfg.pane_tabs); /* The scope is set to global by default, but let's check for completeness. */ make_file(SANDBOX_PATH "/vifmrc", "set tabscope=global"); assert_success(cmds_dispatch1("restart full", &lwin, CIT_COMMAND)); assert_false(cfg.pane_tabs); remove_file(SANDBOX_PATH "/vifmrc"); env_remove("MYVIFMRC"); } TEST(restart_resets_abbreviations) { assert_success(cmds_dispatch("cabbrev lhs rhs", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("restart", &lwin, CIT_COMMAND)); void *state = NULL; const wchar_t *lhs, *rhs; const char *descr; int no_remap = -1; assert_false(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); } static void setup_tabs(void) { flist_hist_setup(&lwin, "/t1ldir1", "t1lfile1", 1, 1); flist_hist_setup(&lwin, "/t1ldir2", "t1lfile2", 2, 1); flist_hist_setup(&lwin, "/path", "", 3, 1); flist_hist_setup(&rwin, "/t1rdir1", "t1rfile1", 1, 1); flist_hist_setup(&rwin, "/t1rdir2", "t1rfile2", 2, 1); flist_hist_setup(&rwin, "/path", "", 3, 1); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); flist_hist_setup(&lwin, "/t2ldir1", "t2lfile1", 1, 1); flist_hist_setup(&lwin, "/t2ldir2", "t2lfile2", 2, 1); flist_hist_setup(&lwin, "/path", "", 3, 1); flist_hist_setup(&rwin, "/t2rdir1", "t2rfile1", 1, 1); flist_hist_setup(&rwin, "/t2rdir2", "t2rfile2", 2, 1); flist_hist_setup(&rwin, "/path", "", 3, 1); } static void check_first_tab(void) { assert_int_equal(4, lwin.history_num); if(lwin.history_num >= 4) { assert_string_equal("/path", lwin.history[0].dir); assert_string_equal("", lwin.history[0].file); assert_string_equal("/t1ldir1", lwin.history[1].dir); assert_string_equal("t1lfile1", lwin.history[1].file); assert_string_equal("/t1ldir2", lwin.history[2].dir); assert_string_equal("t1lfile2", lwin.history[2].file); assert_string_equal("/path", lwin.history[3].dir); assert_string_equal("", lwin.history[3].file); } assert_int_equal(4, rwin.history_num); if(rwin.history_num >= 4) { assert_string_equal("/path", rwin.history[0].dir); assert_string_equal("", rwin.history[0].file); assert_string_equal("/t1rdir1", rwin.history[1].dir); assert_string_equal("t1rfile1", rwin.history[1].file); assert_string_equal("/t1rdir2", rwin.history[2].dir); assert_string_equal("t1rfile2", rwin.history[2].file); assert_string_equal("/path", rwin.history[3].dir); assert_string_equal("", rwin.history[3].file); } } static void check_second_tab(void) { assert_int_equal(7, lwin.history_num); if(lwin.history_num >= 7) { assert_string_equal("/path", lwin.history[0].dir); assert_string_equal("", lwin.history[0].file); assert_string_equal("/t1ldir1", lwin.history[1].dir); assert_string_equal("t1lfile1", lwin.history[1].file); assert_string_equal("/t1ldir2", lwin.history[2].dir); assert_string_equal("t1lfile2", lwin.history[2].file); assert_string_equal("/path", lwin.history[3].dir); assert_string_equal("", lwin.history[3].file); assert_string_equal("/t2ldir1", lwin.history[4].dir); assert_string_equal("t2lfile1", lwin.history[4].file); assert_string_equal("/t2ldir2", lwin.history[5].dir); assert_string_equal("t2lfile2", lwin.history[5].file); assert_string_equal("/path", lwin.history[6].dir); assert_string_equal("", lwin.history[6].file); } assert_int_equal(7, rwin.history_num); if(rwin.history_num >= 7) { assert_string_equal("/path", rwin.history[0].dir); assert_string_equal("", rwin.history[0].file); assert_string_equal("/t1rdir1", rwin.history[1].dir); assert_string_equal("t1rfile1", rwin.history[1].file); assert_string_equal("/t1rdir2", rwin.history[2].dir); assert_string_equal("t1rfile2", rwin.history[2].file); assert_string_equal("/path", rwin.history[3].dir); assert_string_equal("", rwin.history[3].file); assert_string_equal("/t2rdir1", rwin.history[4].dir); assert_string_equal("t2rfile1", rwin.history[4].file); assert_string_equal("/t2rdir2", rwin.history[5].dir); assert_string_equal("t2rfile2", rwin.history[5].file); assert_string_equal("/path", rwin.history[6].dir); assert_string_equal("", rwin.history[6].file); } } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/filter.c0000600000175000017500000001220715051153245014334 0ustar korykory#include #include #include "../../src/cfg/config.h" #include "../../src/engine/cmds.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/ui.h" #include "../../src/utils/matcher.h" #include "../../src/cmd_core.h" #include "../../src/filtering.h" SETUP() { view_setup(&lwin); view_setup(&rwin); /* Emulate proper history initialization (must happen after view * initialization). */ cfg_resize_histories(5); cfg_resize_histories(0); curr_view = &lwin; other_view = &rwin; cmds_init(); } TEARDOWN() { view_teardown(&lwin); view_teardown(&rwin); vle_cmds_reset(); } TEST(filter_prints_empty_filters_correctly) { const char *expected = " Filter -- Flags -- Value\n" "Local \n" "Explicit \n" "Implicit "; ui_sb_msg(""); assert_failure(cmds_dispatch("filter?", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); } TEST(filter_prints_non_empty_filters) { const char *expected = " Filter -- Flags -- Value\n" "Local I local\n" "Explicit ----> abc\n" "Implicit "; assert_success(cmds_dispatch("filter abc", &lwin, CIT_COMMAND)); local_filter_apply(&lwin, "local"); ui_sb_msg(""); assert_failure(cmds_dispatch("filter?", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); } TEST(filter_with_empty_value_reuses_last_search) { const char *expected = " Filter -- Flags -- Value\n" "Local \n" "Explicit ----> /pattern/I\n" "Implicit "; cfg_resize_histories(5); hists_search_save("pattern"); assert_success(cmds_dispatch("filter //I", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("filter?", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); } TEST(filter_accepts_pipe_without_escaping) { assert_success(cmds_dispatch("filter /a|b/", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("filter a|b", &lwin, CIT_COMMAND)); } TEST(filter_prints_whole_manual_filter_expression) { const char *expected = " Filter -- Flags -- Value\n" "Local \n" "Explicit ----> /abc/i\n" "Implicit "; assert_success(cmds_dispatch("filter /abc/i", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("filter?", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); } TEST(filter_without_args_resets_manual_filter) { const char *expected = " Filter -- Flags -- Value\n" "Local \n" "Explicit \n" "Implicit "; assert_success(cmds_dispatch("filter this", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("filter", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("filter?", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); } TEST(filter_reset_is_not_affected_by_search_history) { const char *expected = " Filter -- Flags -- Value\n" "Local \n" "Explicit \n" "Implicit "; cfg_resize_histories(5); hists_search_save("pattern"); assert_success(cmds_dispatch("filter this", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("filter", &lwin, CIT_COMMAND)); ui_sb_msg(""); assert_failure(cmds_dispatch("filter?", &lwin, CIT_COMMAND)); assert_string_equal(expected, ui_sb_last()); } TEST(filter_can_affect_both_views) { assert_string_equal("", matcher_get_expr(curr_view->manual_filter)); assert_string_equal("", matcher_get_expr(other_view->manual_filter)); curr_view->invert = 1; other_view->invert = 1; curr_stats.global_local_settings = 1; assert_success(cmds_dispatch("filter /x/", &lwin, CIT_COMMAND)); curr_stats.global_local_settings = 0; assert_string_equal("/x/", matcher_get_expr(curr_view->manual_filter)); assert_string_equal("/x/", matcher_get_expr(other_view->manual_filter)); assert_false(curr_view->invert); assert_false(other_view->invert); } TEST(filter_can_setup_inverted_filter) { assert_string_equal("", matcher_get_expr(curr_view->manual_filter)); curr_view->invert = 0; assert_success(cmds_dispatch("filter! /x/", &lwin, CIT_COMMAND)); assert_string_equal("/x/", matcher_get_expr(curr_view->manual_filter)); assert_true(curr_view->invert); } TEST(filter_can_invert_manual_filter) { curr_view->invert = 0; assert_success(cmds_dispatch("filter!", &lwin, CIT_COMMAND)); assert_true(curr_view->invert); assert_success(cmds_dispatch("filter!", &lwin, CIT_COMMAND)); assert_false(curr_view->invert); } TEST(filter_accepts_full_path_patterns) { assert_success(cmds_dispatch("filter ///some/path//", &lwin, CIT_COMMAND)); } TEST(filter_accepts_paths_with_many_spaces) { assert_success(cmds_dispatch("filter { a b c d e }", &lwin, CIT_COMMAND)); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/commands/autocd.c0000600000175000017500000000312415051153245014324 0ustar korykory#include #include #include "../../src/cfg/config.h" #include "../../src/compat/os.h" #include "../../src/engine/cmds.h" #include "../../src/ui/ui.h" #include "../../src/utils/path.h" #include "../../src/cmd_core.h" static char test_data[PATH_MAX + 1]; static char read_path[PATH_MAX + 1]; SETUP_ONCE() { make_abs_path(test_data, sizeof(test_data), TEST_DATA_PATH, "", NULL); make_abs_path(read_path, sizeof(read_path), TEST_DATA_PATH, "read", NULL); } SETUP() { curr_view = &lwin; other_view = &rwin; conf_setup(); view_setup(&lwin); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "", NULL); cmds_init(); cfg.auto_cd = 1; } TEARDOWN() { curr_view = NULL; other_view = NULL; conf_teardown(); view_teardown(&lwin); vle_cmds_reset(); cfg.auto_cd = 0; } TEST(existing_dir) { assert_success(cmds_dispatch1("read", &lwin, CIT_COMMAND)); assert_true(paths_are_equal(lwin.curr_dir, read_path)); } TEST(parent_dir) { assert_success(cmds_dispatch1("read", &lwin, CIT_COMMAND)); assert_true(paths_are_equal(lwin.curr_dir, read_path)); assert_success(cmds_dispatch1("..", &lwin, CIT_COMMAND)); assert_true(paths_are_equal(lwin.curr_dir, test_data)); assert_success(cmds_dispatch1("read", &lwin, CIT_COMMAND)); assert_true(paths_are_equal(lwin.curr_dir, read_path)); } TEST(ambiguity_and_error) { assert_failure(cmds_dispatch1("compare/a", &lwin, CIT_COMMAND)); assert_true(paths_are_equal(lwin.curr_dir, test_data)); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/else.c0000600000175000017500000004021215051153245013774 0ustar korykory#include #include /* chdir() */ #include /* NULL */ #include /* strcmp() */ #include "../../src/engine/functions.h" #include "../../src/engine/variables.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/ui.h" #include "../../src/utils/env.h" #include "../../src/builtin_functions.h" #include "../../src/cmd_core.h" #include #define VAR_A "VAR_A" #define VAR_B "VAR_B" #define VAR_C "VAR_C" #define VAR_D "VAR_D" static int run_cmds(const char cmds[], int scoped); static void remove_tmp_vars(void) { env_remove(VAR_A); env_remove(VAR_B); env_remove(VAR_C); env_remove(VAR_D); } SETUP() { cmds_init(); lwin.selected_files = 0; remove_tmp_vars(); curr_view = &lwin; } TEARDOWN() { curr_view = NULL; } TEST(if_without_else_true_condition) { const char *const COMMANDS = " | if 1 == 1" " | let $"VAR_A" = '"VAR_A"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(VAR_A, env_get(VAR_A)); } TEST(if_without_else_false_condition) { const char *const COMMANDS = " | if 1 == 0" " | let $"VAR_A" = '"VAR_A"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get(VAR_A)); } TEST(if_with_else_true_condition) { const char *const COMMANDS = " | if 1 == 1" " | else" " | let $"VAR_A" = '"VAR_A"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get(VAR_A)); } TEST(if_with_else_false_condition) { const char *const COMMANDS = " | if 1 == 0" " | else" " | let $"VAR_A" = '"VAR_A"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(VAR_A, env_get(VAR_A)); } TEST(if_true_if_true_condition) { const char *const COMMANDS = " | if 1 == 1" " | let $"VAR_A" = '"VAR_A"'" " | if 2 == 2" " | let $"VAR_B" = '"VAR_B"'" " | endif" " | let $"VAR_C" = '"VAR_C"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(VAR_A, env_get(VAR_A)); assert_string_equal(VAR_B, env_get(VAR_B)); assert_string_equal(VAR_C, env_get(VAR_C)); } TEST(if_true_if_false_condition) { const char *const COMMANDS = " | if 1 == 1" " | let $"VAR_A" = '"VAR_A"'" " | if 2 == 0" " | let $"VAR_B" = '"VAR_B"'" " | endif" " | let $"VAR_C" = '"VAR_C"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(VAR_A, env_get(VAR_A)); assert_string_equal(NULL, env_get(VAR_B)); assert_string_equal(VAR_C, env_get(VAR_C)); } TEST(if_false_if_true_condition) { const char *const COMMANDS = " | if 1 == 0" " | let $"VAR_A" = '"VAR_A"'" " | if 2 == 2" " | let $"VAR_B" = '"VAR_B"'" " | endif" " | let $"VAR_C" = '"VAR_C"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get(VAR_A)); assert_string_equal(NULL, env_get(VAR_B)); assert_string_equal(NULL, env_get(VAR_C)); } TEST(if_false_else_if_true_condition) { const char *const COMMANDS = " | if 1 == 0" " | let $"VAR_A" = '"VAR_A"'" " | else" " | let $"VAR_B" = '"VAR_B"'" " | if 2 == 2" " | let $"VAR_C" = '"VAR_C"'" " | endif" " | let $"VAR_D" = '"VAR_D"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get(VAR_A)); assert_string_equal(VAR_B, env_get(VAR_B)); assert_string_equal(VAR_C, env_get(VAR_C)); assert_string_equal(VAR_D, env_get(VAR_D)); } TEST(if_false_if_else_condition) { const char *const COMMANDS = " | if 1 == 0" " | let $"VAR_A" = '"VAR_A"'" " | if 2 == 2" " | let $"VAR_B" = '"VAR_B"'" " | else" " | let $"VAR_C" = '"VAR_C"'" " | endif" " | let $"VAR_D" = '"VAR_D"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get(VAR_A)); assert_string_equal(NULL, env_get(VAR_B)); assert_string_equal(NULL, env_get(VAR_C)); assert_string_equal(NULL, env_get(VAR_D)); } TEST(if_true_else_if_else_condition) { const char *const COMMANDS = " | if 1 == 1" " | else" " | let $"VAR_A" = '"VAR_A"'" " | if 2 == 2" " | let $"VAR_B" = '"VAR_B"'" " | else" " | let $"VAR_C" = '"VAR_C"'" " | endif" " | let $"VAR_D" = '"VAR_D"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get(VAR_A)); assert_string_equal(NULL, env_get(VAR_B)); assert_string_equal(NULL, env_get(VAR_C)); assert_string_equal(NULL, env_get(VAR_D)); } TEST(if_true_elseif_else_condition) { const char *const COMMANDS = " | if 1 == 1" " | elseif 2 == \" \"" " | let $"VAR_B" = '"VAR_B"'" " | else" " | let $"VAR_C" = '"VAR_C"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get(VAR_A)); assert_string_equal(NULL, env_get(VAR_B)); assert_string_equal(NULL, env_get(VAR_C)); assert_string_equal(NULL, env_get(VAR_D)); } TEST(if_false_elseif_true_else_condition) { const char *const COMMANDS = " | if 1 == \"87 \"" " | elseif 2 == 2" " | let $"VAR_B" = '"VAR_B"'" " | else" " | let $"VAR_C" = '"VAR_C"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get(VAR_A)); assert_string_equal(VAR_B, env_get(VAR_B)); assert_string_equal(NULL, env_get(VAR_C)); assert_string_equal(NULL, env_get(VAR_D)); } TEST(if_false_elseif_false_else_condition) { const char *const COMMANDS = " | if 1 == 0" " | elseif 2 == 1" " | let $"VAR_B" = '"VAR_B"'" " | else" " | let $"VAR_C" = '"VAR_C"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get(VAR_A)); assert_string_equal(NULL, env_get(VAR_B)); assert_string_equal(VAR_C, env_get(VAR_C)); assert_string_equal(NULL, env_get(VAR_D)); } TEST(nested_passive_elseif) { const char *const COMMANDS = " | if 1 == 0" " | if 2 == 1" " | elseif 2 == 2" " | let $"VAR_B" = '"VAR_B"'" " | endif" " | else" " | let $"VAR_C" = '"VAR_C"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get(VAR_A)); assert_string_equal(NULL, env_get(VAR_B)); assert_string_equal(VAR_C, env_get(VAR_C)); assert_string_equal(NULL, env_get(VAR_D)); } TEST(nested_active_elseif) { const char *const COMMANDS = " | if 1 == 1" " | if 2 == 1" " | elseif 2 == 2" " | let $"VAR_B" = '"VAR_B"'" " | endif" " | else" " | let $"VAR_C" = '"VAR_C"'" " | endif"; assert_int_equal(0, cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); assert_string_equal(NULL, env_get(VAR_A)); assert_string_equal(VAR_B, env_get(VAR_B)); assert_string_equal(NULL, env_get(VAR_C)); assert_string_equal(NULL, env_get(VAR_D)); } TEST(else_before_elseif) { const char *const COMMANDS = " | if 1 == 1" " | else" " | let $"VAR_C" = '"VAR_C"'" " | elseif 2 == 2" " | endif"; assert_failure(cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); } TEST(multiple_else_branches) { const char *const COMMANDS = " | if 1 == 1" " | else" " | else" " | endif"; assert_failure(cmds_dispatch(COMMANDS, &lwin, CIT_COMMAND)); } TEST(sourcing_in_body) { const char *const CMDS = " | if 1 == 1" " | source "TEST_DATA_PATH"/scripts/set-env.vifm" " | endif"; assert_int_equal(0, cmds_dispatch(CMDS, &lwin, CIT_COMMAND)); } TEST(wrong_expr_causes_hard_error) { assert_true(cmds_dispatch("if $USER == root", &lwin, CIT_COMMAND) < 0); } TEST(misplaced_else_causes_hard_error) { assert_true(cmds_dispatch("else", &lwin, CIT_COMMAND) < 0); } TEST(misplaced_endif_causes_hard_error) { assert_true(cmds_dispatch("endif", &lwin, CIT_COMMAND) < 0); } TEST(finish_inside_if_statement_causes_no_missing_endif_error) { const char *const CMDS = " | if 1 == 1" " | source "TEST_DATA_PATH"/scripts/finish-inside-if.vifm" " | source "TEST_DATA_PATH"/scripts/finish-inside-ifs.vifm" " | endif"; assert_int_equal(0, cmds_dispatch(CMDS, &lwin, CIT_COMMAND)); } TEST(condition_of_inactive_elseif_is_not_evaluated, REPEAT(2)) { const int scoped = STIC_TEST_PARAM; const char *const CMDS = " | let $REACHED = 0" "" " | if 1" " | let $REACHED .= 1" " | elseif system('echo > temp-file') == ''" " | let $REACHED .= 2" " | endif" " | let $REACHED .= 3" "" " | if 0" " | let $REACHED .= 4" " | elseif 1" " | let $REACHED .= 5" " | elseif system('echo > temp-file') == ''" " | let $REACHED .= 6" " | endif" " | let $REACHED .= 7" "" " | if 1" " | let $REACHED .= 8" " | else" " | if system('echo > temp-file') == ''" " | let $REACHED .= 9" " | endif" " | endif" " | let $REACHED .= 'A'"; assert_success(chdir(SANDBOX_PATH)); conf_setup(); init_builtin_functions(); ui_sb_msg(""); assert_success(run_cmds(CMDS, scoped)); assert_string_equal("", ui_sb_last()); assert_string_equal("013578A", local_getenv_null("REACHED")); no_remove_file("temp-file"); conf_teardown(); function_reset_all(); } TEST(stray_elseif, REPEAT(2)) { const int scoped = STIC_TEST_PARAM; ui_sb_msg(""); assert_failure(run_cmds("elseif 1 == 1", scoped)); assert_string_equal("Misplaced :elseif", ui_sb_last()); } TEST(error_in_if_condition) { const char *const CMDS = " | let $REACHED = 0" " | if level1" " | let $REACHED .= 1" " | endif" " | let $REACHED .= 2"; ui_sb_msg(""); /* Unscoped use can't handle top-level errors gracefully because there is no * code that handles end of scope. This isn't a big deal because user * shouldn't be able to run commands out of scope anyway. */ assert_failure(run_cmds(CMDS, /*scoped=*/1)); assert_string_equal("Invalid expression: level1", ui_sb_last()); assert_string_equal("02", local_getenv_null("REACHED")); } TEST(error_in_inactive_elseif_condition_is_ignored, REPEAT(2)) { const int scoped = STIC_TEST_PARAM; const char *const CMDS = " | let $REACHED = 0" " | if 1" " | let $REACHED .= 1" " | elseif bad_elseif" " | let $REACHED .= 2" " | endif" " | let $REACHED .= 3"; ui_sb_msg(""); assert_success(run_cmds(CMDS, scoped)); assert_string_equal("", ui_sb_last()); assert_string_equal("013", local_getenv_null("REACHED")); } TEST(error_in_active_elseif_condition, REPEAT(2)) { const int scoped = STIC_TEST_PARAM; const char *const CMDS = " | let $REACHED = 0" " | if 0" " | let $REACHED .= 1" " | elseif bad_elseif" " | let $REACHED .= 2" " | endif" " | let $REACHED .= 3"; ui_sb_msg(""); assert_failure(run_cmds(CMDS, scoped)); assert_string_equal("Invalid expression: bad_elseif", ui_sb_last()); assert_string_equal("03", local_getenv_null("REACHED")); } TEST(error_in_a_nested_condition, REPEAT(2)) { const int scoped = STIC_TEST_PARAM; const char *const CMDS = " | let $REACHED = 0" " | if 1" " | let $REACHED .= 1" " | if level2" " | let $REACHED .= 2" " | endif" " | let $REACHED .= 3" " | endif" " | let $REACHED .= 4"; ui_sb_msg(""); assert_failure(run_cmds(CMDS, scoped)); assert_string_equal("Invalid expression: level2", ui_sb_last()); assert_string_equal("0134", local_getenv_null("REACHED")); } TEST(error_in_doubly_nested_condition, REPEAT(2)) { const int scoped = STIC_TEST_PARAM; const char *const CMDS = " | let $REACHED = 0" " | if 1" " | let $REACHED .= 1" " | if 2" " | let $REACHED .= 2" " | if level3" " | let $REACHED .= 3" " | endif" " | let $REACHED .= 4" " | endif" " | let $REACHED .= 5" " | endif" " | let $REACHED .= 6"; ui_sb_msg(""); assert_failure(run_cmds(CMDS, scoped)); assert_string_equal("Invalid expression: level3", ui_sb_last()); assert_string_equal("012456", local_getenv_null("REACHED")); } static int run_cmds(const char cmds[], int scoped) { if(scoped) { cmds_scope_start(); } int result = cmds_dispatch(cmds, &lwin, CIT_COMMAND); if(scoped && cmds_scope_finish() != 0 && result == 0) { result = -1; } return result; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/emark.c0000600000175000017500000000620515051153245014147 0ustar korykory#include #include /* chdir() */ #include /* free() */ #include /* strdup() */ #include /* wcsdup() wcslen() */ #include #include "../../src/cfg/config.h" #include "../../src/engine/cmds.h" #include "../../src/ui/ui.h" #include "../../src/utils/macros.h" #include "../../src/utils/str.h" #include "../../src/cmd_core.h" #include "../../src/status.h" static int builtin_cmd(const cmd_info_t *cmd_info); static const cmd_add_t commands[] = { { .name = "builtin", .abbr = NULL, .id = -1, .descr = "descr", .flags = HAS_EMARK, .handler = &builtin_cmd, .min_args = 0, .max_args = 0, }, }; static int called; SETUP_ONCE() { undo_setup(); conf_setup(); } TEARDOWN_ONCE() { undo_teardown(); conf_teardown(); } SETUP() { lwin.list_rows = 0; curr_view = &lwin; other_view = &rwin; cmds_init(); vle_cmds_add(commands, ARRAY_LEN(commands)); assert_success(stats_init(&cfg)); } TEARDOWN() { assert_success(stats_reset(&cfg)); vle_cmds_reset(); } static int builtin_cmd(const cmd_info_t* cmd_info) { called = 1; return 0; } TEST(repeat_of_no_command_prints_a_message) { called = 0; (void)cmds_dispatch("builtin", &lwin, CIT_COMMAND); assert_int_equal(1, called); update_string(&curr_stats.last_cmdline_command, NULL); called = 0; assert_int_equal(1, cmds_dispatch("!!", &lwin, CIT_COMMAND)); assert_int_equal(0, called); } TEST(double_emark_repeats_last_command) { called = 0; (void)cmds_dispatch("builtin", &lwin, CIT_COMMAND); assert_int_equal(1, called); update_string(&curr_stats.last_cmdline_command, "builtin"); called = 0; assert_int_equal(0, cmds_dispatch("!!", &lwin, CIT_COMMAND)); assert_int_equal(1, called); } TEST(single_emark_without_args_fails) { update_string(&curr_stats.last_cmdline_command, "builtin"); called = 0; assert_false(cmds_dispatch("!", &lwin, CIT_COMMAND) == 0); assert_int_equal(0, called); } TEST(provide_input_to_fg_process, IF(have_cat)) { assert_success(chdir(SANDBOX_PATH)); view_setup(&lwin); setup_grid(&lwin, 20, 2, /*init=*/1); replace_string(&lwin.dir_entry[0].name, "a"); replace_string(&lwin.dir_entry[1].name, "b"); lwin.dir_entry[0].marked = 1; lwin.dir_entry[1].marked = 1; lwin.pending_marking = 1; assert_int_equal(0, cmds_dispatch("!cat > file %Pl", &lwin, CIT_COMMAND)); const char *lines[] = { "/path/a", "/path/b" }; file_is("file", lines, ARRAY_LEN(lines)); remove_file("file"); view_teardown(&lwin); } TEST(provide_input_to_bg_process, IF(have_cat)) { assert_success(chdir(SANDBOX_PATH)); view_setup(&lwin); setup_grid(&lwin, 20, 2, /*init=*/1); replace_string(&lwin.dir_entry[0].name, "a"); replace_string(&lwin.dir_entry[1].name, "b"); lwin.dir_entry[0].marked = 1; lwin.dir_entry[1].marked = 1; lwin.pending_marking = 1; assert_int_equal(0, cmds_dispatch("!cat > file %Pl &", &lwin, CIT_COMMAND)); wait_for_all_bg(); const char *lines[] = { "/path/a", "/path/b" }; file_is("file", lines, ARRAY_LEN(lines)); remove_file("file"); view_teardown(&lwin); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/goto.c0000600000175000017500000000556415051153245014027 0ustar korykory#include #include /* snprintf() */ #include #include "../../src/compat/fs_limits.h" #include "../../src/ui/ui.h" #include "../../src/utils/fs.h" #include "../../src/cmd_core.h" #include "../../src/filelist.h" static char test_data[PATH_MAX + 1]; SETUP_ONCE() { make_abs_path(test_data, sizeof(test_data), TEST_DATA_PATH, "", NULL); } SETUP() { view_setup(&lwin); view_setup(&rwin); curr_view = &lwin; other_view = &rwin; conf_setup(); undo_setup(); cmds_init(); } TEARDOWN() { view_teardown(&lwin); view_teardown(&rwin); conf_teardown(); vle_cmds_reset(); undo_teardown(); } TEST(goto_navigates) { assert_failure(cmds_dispatch("goto /", &lwin, CIT_COMMAND)); assert_failure(cmds_dispatch("goto /no-such-path", &lwin, CIT_COMMAND)); char cmd[PATH_MAX*2]; snprintf(cmd, sizeof(cmd), "goto %s/compare", test_data); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, test_data)); assert_string_equal("compare", get_current_file_name(&lwin)); assert_success(cmds_dispatch("goto tree", &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, test_data)); assert_string_equal("tree", get_current_file_name(&lwin)); } TEST(goto_preserves_cv) { char path[PATH_MAX + 1]; make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "existing-files", NULL); flist_custom_start(&lwin, "test"); snprintf(path, sizeof(path), "%s/%s", test_data, "existing-files/a"); flist_custom_add(&lwin, path); snprintf(path, sizeof(path), "%s/%s", test_data, "existing-files/b"); flist_custom_add(&lwin, path); assert_true(flist_custom_finish(&lwin, CV_REGULAR, 0) == 0); assert_success(cmds_dispatch("goto b", &lwin, CIT_COMMAND)); assert_int_equal(1, lwin.list_pos); assert_true(flist_custom_active(&lwin)); assert_success(cmds_dispatch("goto a", &lwin, CIT_COMMAND)); assert_int_equal(0, lwin.list_pos); assert_true(flist_custom_active(&lwin)); } TEST(goto_preserves_tree) { make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "tree", NULL); assert_success(cmds_dispatch1("tree", &lwin, CIT_COMMAND)); assert_true(cv_tree(lwin.custom.type)); assert_success(cmds_dispatch("goto dir1/file4", &lwin, CIT_COMMAND)); assert_int_equal(7, lwin.list_pos); assert_true(cv_tree(lwin.custom.type)); assert_success(cmds_dispatch("goto dir5/file5", &lwin, CIT_COMMAND)); assert_int_equal(10, lwin.list_pos); assert_true(cv_tree(lwin.custom.type)); } TEST(goto_normalizes_slashes, IF(windows)) { char cmd[PATH_MAX*2]; snprintf(cmd, sizeof(cmd), "goto %s\\\\compare", test_data); assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); assert_true(paths_are_same(lwin.curr_dir, test_data)); assert_string_equal("compare", get_current_file_name(&lwin)); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/map.c0000600000175000017500000000756615051153245013640 0ustar korykory#include #include "../../src/engine/keys.h" #include "../../src/modes/modes.h" #include "../../src/modes/wk.h" #include "../../src/ui/ui.h" #include "../../src/cmd_core.h" #include "../../src/status.h" static void silent_key(key_info_t key_info, keys_info_t *keys_info); static void silence_ui(int more); static int silence; SETUP() { modes_init(); cmds_init(); curr_view = &lwin; other_view = &rwin; } TEARDOWN() { vle_cmds_reset(); vle_keys_reset(); } TEST(map_commands_count_arguments_correctly) { /* Each map command below should receive two arguments: "\\" and "j". */ /* Each unmap command below should receive single argument: "\\". */ assert_success(cmds_dispatch("cmap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("cnoremap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("cunmap \\", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("dmap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("dnoremap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("dunmap \\", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("mmap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("mnoremap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("munmap \\", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("nmap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("nnoremap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("nunmap \\", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("map \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("noremap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("unmap \\", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("map! \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("noremap! \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("unmap! \\", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("qmap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("qnoremap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("qunmap \\", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("vmap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("vnoremap \\ j", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("vunmap \\", &lwin, CIT_COMMAND)); } TEST(map_parses_args) { static int mode_flags[] = { MF_USES_REGS | MF_USES_COUNT, MF_USES_INPUT, MF_USES_COUNT }; vle_keys_reset(); vle_keys_init(MODES_COUNT, mode_flags, &silence_ui); keys_add_info_t keys = { WK_x, { {&silent_key} } }; vle_keys_add(&keys, 1U, NORMAL_MODE); /* */ assert_int_equal(0, silence); assert_success(cmds_dispatch("map a x", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("map b x", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("map c x", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("map d x", &lwin, CIT_COMMAND)); assert_false(IS_KEYS_RET_CODE(vle_keys_exec(L"a"))); assert_false(IS_KEYS_RET_CODE(vle_keys_exec(L"1b"))); assert_false(IS_KEYS_RET_CODE(vle_keys_exec(L"1c"))); assert_false(IS_KEYS_RET_CODE(vle_keys_exec(L"1d"))); assert_int_equal(0, silence); /* */ assert_success(cmds_dispatch("map xj j", &lwin, CIT_COMMAND)); assert_int_equal(KEYS_WAIT, vle_keys_exec(L"x")); } TEST(dialogs_exit_silent_mode) { const char *cmd = "map b :cd /no-such-dir"; assert_success(cmds_dispatch(cmd, &lwin, CIT_COMMAND)); curr_stats.load_stage = -1; stats_silence_ui(1); assert_false(IS_KEYS_RET_CODE(vle_keys_exec(L"b"))); assert_false(stats_silenced_ui()); curr_stats.load_stage = 0; } static void silent_key(key_info_t key_info, keys_info_t *keys_info) { assert_int_equal(key_info.count == NO_COUNT_GIVEN ? 0 : 1, silence); } static void silence_ui(int more) { silence += (more != 0 ? 1 : -1); assert_true(silence >= 0); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/tabs.c0000600000175000017500000004316715051153245014011 0ustar korykory#include #include /* NULL */ #include /* snprintf() */ #include /* strcpy() */ #include #include #include "../../src/cfg/config.h" #include "../../src/engine/keys.h" #include "../../src/modes/modes.h" #include "../../src/modes/view.h" #include "../../src/modes/wk.h" #include "../../src/ui/color_scheme.h" #include "../../src/ui/statusbar.h" #include "../../src/ui/tabs.h" #include "../../src/ui/ui.h" #include "../../src/utils/fs.h" #include "../../src/cmd_core.h" #include "../../src/compare.h" #include "../../src/filelist.h" #include "../../src/status.h" SETUP() { view_setup(&lwin); setup_grid(&lwin, /*column_count=*/1, /*list_rows=*/1, /*init=*/1); curr_view = &lwin; view_setup(&rwin); setup_grid(&rwin, /*column_count=*/1, /*list_rows=*/1, /*init=*/1); other_view = &rwin; modes_init(); opt_handlers_setup(); columns_setup_column(SK_BY_NAME); columns_setup_column(SK_BY_SIZE); cmds_init(); } TEARDOWN() { vle_cmds_reset(); tabs_only(&lwin); tabs_only(&rwin); cfg.pane_tabs = 0; tabs_only(&lwin); vle_keys_reset(); opt_handlers_teardown(); view_teardown(&lwin); view_teardown(&rwin); columns_teardown(); } TEST(tab_is_created_without_name) { tab_info_t tab_info; assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_count(&lwin)); assert_true(tabs_get(&lwin, 1, &tab_info)); assert_string_equal(NULL, tab_info.name); } TEST(tab_is_not_created_on_wrong_path) { char cwd[PATH_MAX + 1]; assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "", cwd); (void)cmds_dispatch("tabnew no-such-subdir", &lwin, CIT_COMMAND); assert_int_equal(1, tabs_count(&lwin)); tab_info_t tab_info; assert_true(tabs_get(&lwin, 0, &tab_info)); assert_true(paths_are_same(lwin.curr_dir, TEST_DATA_PATH)); } TEST(tab_in_path_is_created) { char cwd[PATH_MAX + 1]; assert_non_null(get_cwd(cwd, sizeof(cwd))); char test_data[PATH_MAX + 1]; make_abs_path(test_data, sizeof(test_data), TEST_DATA_PATH, "", cwd); strcpy(lwin.curr_dir, test_data); assert_success(cmds_dispatch("tabnew read", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_count(&lwin)); tab_info_t tab_info; assert_true(tabs_get(&lwin, 1, &tab_info)); char read_data[PATH_MAX + 1]; snprintf(read_data, sizeof(read_data), "%s/read", test_data); assert_true(paths_are_same(lwin.curr_dir, read_data)); } TEST(tab_in_parent_is_created) { char cwd[PATH_MAX + 1]; assert_non_null(get_cwd(cwd, sizeof(cwd))); char test_data[PATH_MAX + 1]; make_abs_path(test_data, sizeof(test_data), TEST_DATA_PATH, "", cwd); snprintf(lwin.curr_dir, sizeof(lwin.curr_dir), "%s/read", test_data); assert_success(cmds_dispatch("tabnew ..", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_count(&lwin)); tab_info_t tab_info; assert_true(tabs_get(&lwin, 1, &tab_info)); assert_true(paths_are_same(lwin.curr_dir, test_data)); } TEST(newtab_fails_in_diff_mode_for_tab_panes) { strcpy(lwin.curr_dir, TEST_DATA_PATH "/compare/a"); strcpy(rwin.curr_dir, TEST_DATA_PATH "/compare/b"); cfg.pane_tabs = 1; (void)compare_two_panes(CT_CONTENTS, LT_ALL, CF_GROUP_PATHS | CF_SHOW); assert_failure(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); } TEST(tab_name_is_set) { tab_info_t tab_info; assert_success(cmds_dispatch("tabname new-name", &lwin, CIT_COMMAND)); assert_true(tabs_get(&lwin, 0, &tab_info)); assert_string_equal("new-name", tab_info.name); } TEST(tab_name_is_reset) { tab_info_t tab_info; assert_success(cmds_dispatch("tabname new-name", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("tabname", &lwin, CIT_COMMAND)); assert_true(tabs_get(&lwin, 0, &tab_info)); assert_string_equal(NULL, tab_info.name); } TEST(tab_is_closed) { assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("tabclose", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); } TEST(last_tab_is_not_closed) { assert_success(cmds_dispatch("tabclose", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); } TEST(quit_commands_close_tabs) { assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("quit", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("wq", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); (void)vle_keys_exec_timed_out(WK_Z WK_Z); assert_int_equal(1, tabs_count(&lwin)); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); (void)vle_keys_exec_timed_out(WK_Z WK_Q); assert_int_equal(1, tabs_count(&lwin)); } TEST(quit_all_commands_ignore_tabs) { assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); vifm_tests_exited = 0; assert_success(cmds_dispatch("qall", &lwin, CIT_COMMAND)); assert_true(vifm_tests_exited); vifm_tests_exited = 0; assert_success(cmds_dispatch("wqall", &lwin, CIT_COMMAND)); assert_true(vifm_tests_exited); vifm_tests_exited = 0; assert_success(cmds_dispatch("xall", &lwin, CIT_COMMAND)); assert_true(vifm_tests_exited); assert_int_equal(2, tabs_count(&lwin)); } TEST(tabs_are_switched_with_shortcuts) { assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); (void)vle_keys_exec_timed_out(WK_g WK_t); assert_int_equal(0, tabs_current(&lwin)); (void)vle_keys_exec_timed_out(WK_g WK_T); assert_int_equal(1, tabs_current(&lwin)); (void)vle_keys_exec_timed_out(L"1" WK_g WK_t); assert_int_equal(0, tabs_current(&lwin)); } TEST(tabs_are_switched_with_commands) { assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); /* Valid arguments. */ assert_success(cmds_dispatch("tabnext", &lwin, CIT_COMMAND)); assert_int_equal(0, tabs_current(&lwin)); assert_success(cmds_dispatch("tabnext", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_success(cmds_dispatch("tabnext 1", &lwin, CIT_COMMAND)); assert_int_equal(0, tabs_current(&lwin)); assert_success(cmds_dispatch("tabnext 1", &lwin, CIT_COMMAND)); assert_int_equal(0, tabs_current(&lwin)); assert_success(cmds_dispatch("tabnext 2", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_current(&lwin)); assert_success(cmds_dispatch("tabprevious", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_success(cmds_dispatch("tabprevious 2", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_current(&lwin)); assert_success(cmds_dispatch("tabprevious 3", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_current(&lwin)); assert_success(cmds_dispatch("tabprevious 4", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); /* Invalid arguments. */ assert_failure(cmds_dispatch("tabnext 1z", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_failure(cmds_dispatch("tabnext -1", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_failure(cmds_dispatch("tabnext 4", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_failure(cmds_dispatch("tabnext 10", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_failure(cmds_dispatch("tabprevious 0", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_failure(cmds_dispatch("tabprevious -1", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_failure(cmds_dispatch("tabprevious -1", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); } TEST(tabs_are_moved) { for (cfg.pane_tabs = 0; cfg.pane_tabs < 2; ++cfg.pane_tabs) { assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_current(&lwin)); assert_success(cmds_dispatch("tabmove 0", &lwin, CIT_COMMAND)); assert_int_equal(0, tabs_current(&lwin)); assert_success(cmds_dispatch("tabmove 1", &lwin, CIT_COMMAND)); assert_int_equal(0, tabs_current(&lwin)); assert_success(cmds_dispatch("tabmove 2", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_success(cmds_dispatch("tabmove 2", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_success(cmds_dispatch("tabmove 3", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_current(&lwin)); assert_success(cmds_dispatch("tabmove 3", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_current(&lwin)); assert_success(cmds_dispatch("tabmove 1", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(&lwin)); assert_success(cmds_dispatch("tabmove", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_current(&lwin)); assert_success(cmds_dispatch("tabmove 0", &lwin, CIT_COMMAND)); assert_int_equal(0, tabs_current(&lwin)); assert_success(cmds_dispatch("tabmove $", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_current(&lwin)); assert_success(cmds_dispatch("tabmove 0", &lwin, CIT_COMMAND)); assert_int_equal(0, tabs_current(&lwin)); assert_failure(cmds_dispatch("tabmove wrong", &lwin, CIT_COMMAND)); assert_int_equal(0, tabs_current(&lwin)); tabs_only(&lwin); } } TEST(view_mode_is_fine_with_tabs) { char cwd[PATH_MAX + 1]; assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "read", cwd); populate_dir_list(&lwin, 0); (void)vle_keys_exec_timed_out(WK_e); (void)vle_keys_exec_timed_out(WK_q); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_count(&lwin)); (void)vle_keys_exec_timed_out(WK_e); (void)vle_keys_exec_timed_out(WK_q); assert_success(cmds_dispatch("tabclose", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); (void)vle_keys_exec_timed_out(WK_e); (void)vle_keys_exec_timed_out(WK_q); } TEST(left_view_mode_is_fine_with_tabs) { char cwd[PATH_MAX + 1]; assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "read", cwd); populate_dir_list(&lwin, 0); (void)vle_keys_exec_timed_out(WK_e); (void)vle_keys_exec_timed_out(WK_C_i); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_count(&lwin)); (void)vle_keys_exec_timed_out(WK_SPACE); (void)vle_keys_exec_timed_out(WK_e); (void)vle_keys_exec_timed_out(WK_C_i); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_int_equal(3, tabs_count(&lwin)); assert_success(cmds_dispatch("q", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_count(&lwin)); assert_success(cmds_dispatch("q", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); (void)vle_keys_exec_timed_out(WK_SPACE); (void)vle_keys_exec_timed_out(WK_q); } TEST(hidden_tabs_are_updated_on_cs_invalidation) { char cs[PATH_MAX + 1]; make_abs_path(cs, sizeof(cs), TEST_DATA_PATH, "color-schemes", NULL); strcpy(lwin.curr_dir, cs); assert_success(populate_dir_list(&lwin, 0)); strcpy(rwin.curr_dir, cs); assert_success(populate_dir_list(&rwin, 0)); curr_stats.cs = &cfg.cs; assert_success(cmds_dispatch("highlight {*.vifm} cterm=bold", &lwin, CIT_COMMAND)); assert_non_null(cs_get_file_hi(curr_stats.cs, "some.vifm", &lwin.dir_entry[0].hi_num)); assert_non_null(cs_get_file_hi(curr_stats.cs, "some.vifm", &rwin.dir_entry[0].hi_num)); assert_int_equal(0, lwin.dir_entry[0].hi_num); assert_int_equal(0, rwin.dir_entry[0].hi_num); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); tab_info_t tab_info; assert_true(tabs_get(&lwin, 0, &tab_info)); assert_int_equal(0, tab_info.view->dir_entry[0].hi_num); assert_int_equal(0, lwin.dir_entry[0].hi_num); assert_true(tabs_get(&rwin, 0, &tab_info)); assert_int_equal(0, tab_info.view->dir_entry[0].hi_num); assert_int_equal(0, rwin.dir_entry[0].hi_num); assert_success(cmds_dispatch("highlight clear", &lwin, CIT_COMMAND)); assert_true(tabs_enum(&lwin, 0, &tab_info)); assert_int_equal(-1, tab_info.view->dir_entry[0].hi_num); assert_int_equal(-1, lwin.dir_entry[0].hi_num); assert_true(tabs_enum(&rwin, 0, &tab_info)); assert_int_equal(-1, tab_info.view->dir_entry[0].hi_num); assert_int_equal(-1, rwin.dir_entry[0].hi_num); } TEST(setting_tabscope_drops_previous_tabs) { assert_false(cfg.pane_tabs); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("set tabscope=pane", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); assert_int_equal(1, tabs_count(&rwin)); assert_true(cfg.pane_tabs); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); swap_view_roles(); assert_success(cmds_dispatch("tabnew", &rwin, CIT_COMMAND)); assert_success(cmds_dispatch("set tabscope=global", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); assert_false(cfg.pane_tabs); assert_success(cmds_dispatch("set tabscope=pane", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); assert_int_equal(1, tabs_count(&rwin)); assert_true(cfg.pane_tabs); } TEST(tabonly_leave_only_one_global_tab) { assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("tabnew", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch("tabonly", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(&lwin)); } TEST(tabonly_leaves_only_one_pane_tab) { cfg.pane_tabs = 1; assert_success(cmds_dispatch("tabnew", curr_view, CIT_COMMAND)); assert_success(cmds_dispatch("tabnew", curr_view, CIT_COMMAND)); assert_success(cmds_dispatch("tabonly", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(curr_view)); } TEST(tabonly_keeps_inactive_side_intact) { cfg.pane_tabs = 1; assert_success(cmds_dispatch("tabnew", curr_view, CIT_COMMAND)); assert_success(cmds_dispatch("tabnew", curr_view, CIT_COMMAND)); swap_view_roles(); assert_success(cmds_dispatch("tabnew", curr_view, CIT_COMMAND)); swap_view_roles(); assert_success(cmds_dispatch("tabonly", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_count(curr_view)); assert_int_equal(2, tabs_count(other_view)); } TEST(wingo_global_tabs) { make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "", NULL); make_abs_path(rwin.curr_dir, sizeof(rwin.curr_dir), TEST_DATA_PATH, "", NULL); cfg.pane_tabs = 0; /* * Tab0: * - test-data * - test-data * Tab1: * - test-data/tree * - test-data * Tab2: * - test-data/scripts * - test-data * Tab3: * - test-data/scripts * - test-data/read * Tab4: * - test-data/scripts * - test-data/rename */ assert_success(cmds_dispatch1("tabnew tree", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch1("tabnew ../scripts", &lwin, CIT_COMMAND)); swap_view_roles(); assert_success(cmds_dispatch1("tabnew read", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch1("tabnew ../rename", &lwin, CIT_COMMAND)); /* Hits. */ assert_success(cmds_dispatch1("wingo tree", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(curr_view)); assert_true(curr_view == &lwin); assert_success(cmds_dispatch1("wingo read", &lwin, CIT_COMMAND)); assert_int_equal(3, tabs_current(curr_view)); assert_true(curr_view == &rwin); char cmd[32]; snprintf(cmd, sizeof(cmd), "wingo %u", other_view->id); assert_success(cmds_dispatch1(cmd, &lwin, CIT_COMMAND)); assert_int_equal(3, tabs_current(curr_view)); assert_true(curr_view == &lwin); /* Misses. */ ui_sb_msg(""); assert_failure(cmds_dispatch1("wingo test-data", &lwin, CIT_COMMAND)); assert_string_equal("10 views match 'test-data'", ui_sb_last()); assert_int_equal(3, tabs_current(curr_view)); assert_true(curr_view == &lwin); ui_sb_msg(""); assert_failure(cmds_dispatch1("wingo no such match", &lwin, CIT_COMMAND)); assert_string_equal("No view matches 'no such match'", ui_sb_last()); assert_int_equal(3, tabs_current(curr_view)); assert_true(curr_view == &lwin); ui_sb_msg(""); assert_failure(cmds_dispatch1("wingo 59999", &lwin, CIT_COMMAND)); assert_string_equal("Couldn't find view #59999", ui_sb_last()); assert_int_equal(3, tabs_current(curr_view)); assert_true(curr_view == &lwin); } TEST(wingo_pane_tabs) { make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "", NULL); make_abs_path(rwin.curr_dir, sizeof(rwin.curr_dir), TEST_DATA_PATH, "", NULL); cfg.pane_tabs = 1; /* * Left: * - tab0: test-data * - tab1: test-data/tree * - tab2: test-data/scripts * Right: * - tab0: test-data * - tab1: test-data/read * - tab2: test-data/rename */ assert_success(cmds_dispatch1("tabnew tree", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch1("tabnew ../scripts", &lwin, CIT_COMMAND)); swap_view_roles(); assert_success(cmds_dispatch1("tabnew read", &lwin, CIT_COMMAND)); assert_success(cmds_dispatch1("tabnew ../rename", &lwin, CIT_COMMAND)); /* Hits. */ assert_success(cmds_dispatch1("wingo tree", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(curr_view)); assert_true(curr_view == &lwin); assert_success(cmds_dispatch1("wingo rename", &lwin, CIT_COMMAND)); assert_int_equal(2, tabs_current(curr_view)); assert_true(curr_view == &rwin); assert_success(cmds_dispatch1("wingo read", &lwin, CIT_COMMAND)); assert_int_equal(1, tabs_current(curr_view)); assert_true(curr_view == &rwin); /* Misses. */ ui_sb_msg(""); assert_failure(cmds_dispatch1("wingo test-data", &lwin, CIT_COMMAND)); assert_string_equal("6 views match 'test-data'", ui_sb_last()); assert_int_equal(1, tabs_current(curr_view)); assert_true(curr_view == &rwin); ui_sb_msg(""); assert_failure(cmds_dispatch1("wingo no such match", &lwin, CIT_COMMAND)); assert_string_equal("No view matches 'no such match'", ui_sb_last()); assert_int_equal(1, tabs_current(curr_view)); assert_true(curr_view == &rwin); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/commands/suite.c0000600000175000017500000000162515051153245014202 0ustar korykory#include #include /* strcpy() */ #include #include "../../src/ui/tabs.h" #include "../../src/ui/ui.h" #include "../../src/utils/env.h" #include "../../src/utils/fs.h" #include "../../src/background.h" #include "../../src/status.h" static char *saved_cwd; DEFINE_SUITE(); SETUP_ONCE() { fix_environ(); stub_colmgr(); /* Remember original path in global SETUP_ONCE instead of SETUP to make sure * nothing will change the path before we try to save it. */ saved_cwd = save_cwd(); assert_success(bg_init()); tabs_init(); } SETUP() { strcpy(lwin.curr_dir, "/non-existing-dir"); strcpy(rwin.curr_dir, "/non-existing-dir"); curr_stats.save_msg = 0; env_remove("MYVIFMRC"); } TEARDOWN() { restore_cwd(saved_cwd); saved_cwd = save_cwd(); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/commands/cds.c0000600000175000017500000000517415051153245013625 0ustar korykory#include #include /* chdir() */ #include /* strcpy() */ #include #include "../../src/compat/fs_limits.h" #include "../../src/ui/ui.h" #include "../../src/utils/fs.h" #include "../../src/cmd_core.h" static char sandbox[PATH_MAX + 1]; static char test_data[PATH_MAX + 1]; SETUP() { view_setup(&lwin); view_setup(&rwin); curr_view = &lwin; other_view = &rwin; cmds_init(); conf_setup(); } TEARDOWN() { view_teardown(&lwin); view_teardown(&rwin); vle_cmds_reset(); conf_teardown(); } SETUP_ONCE() { char cwd[PATH_MAX + 1]; assert_non_null(get_cwd(cwd, sizeof(cwd))); make_abs_path(sandbox, sizeof(sandbox), SANDBOX_PATH, "", cwd); make_abs_path(test_data, sizeof(test_data), TEST_DATA_PATH, "", cwd); } TEST(cds_does_the_replacement) { char path[PATH_MAX + 1]; snprintf(path, sizeof(path), "%s/syntax-highlight", test_data); assert_success(chdir(path)); strcpy(lwin.curr_dir, path); assert_success(cmds_dispatch("cds syntax-highlight rename", &lwin, CIT_COMMAND)); snprintf(path, sizeof(path), "%s/rename", test_data); assert_string_equal(path, lwin.curr_dir); } TEST(cds_aborts_on_broken_) { char dst[PATH_MAX + 1]; snprintf(dst, sizeof(dst), "%s/rename", test_data); assert_success(chdir(dst)); strcpy(lwin.curr_dir, dst); assert_failure(cmds_dispatch("cds/rename/read/t", &lwin, CIT_COMMAND)); assert_string_equal(dst, lwin.curr_dir); } TEST(cds_acts_like_substitute) { char path[PATH_MAX + 1]; snprintf(path, sizeof(path), "%s/syntax-highlight", test_data); assert_success(chdir(path)); strcpy(lwin.curr_dir, path); assert_success(cmds_dispatch("cds/SYNtax-?hi[a-z]*/rename/i", &lwin, CIT_COMMAND)); snprintf(path, sizeof(path), "%s/rename", test_data); assert_string_equal(path, lwin.curr_dir); } TEST(cds_can_change_path_of_both_panes) { char path[PATH_MAX + 1]; snprintf(path, sizeof(path), "%s/syntax-highlight", test_data); assert_success(chdir(path)); strcpy(lwin.curr_dir, path); assert_success(cmds_dispatch("cds! syntax-highlight rename", &lwin, CIT_COMMAND)); snprintf(path, sizeof(path), "%s/rename", test_data); assert_string_equal(path, lwin.curr_dir); assert_string_equal(path, rwin.curr_dir); } TEST(cds_is_noop_when_pattern_not_found) { assert_success(chdir(test_data)); strcpy(lwin.curr_dir, test_data); strcpy(rwin.curr_dir, sandbox); assert_failure(cmds_dispatch("cds asdlfkjasdlkfj rename", &lwin, CIT_COMMAND)); assert_string_equal(test_data, lwin.curr_dir); assert_string_equal(sandbox, rwin.curr_dir); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/commands/history.c0000600000175000017500000001357515051153245014561 0ustar korykory#include #include #include "../../src/cfg/config.h" #include "../../src/engine/keys.h" #include "../../src/ui/ui.h" #include "../../src/modes/modes.h" #include "../../src/modes/menu.h" #include "../../src/cmd_core.h" #include "../../src/flist_hist.h" #include "../../src/status.h" SETUP() { modes_init(); cmds_init(); curr_view = &lwin; view_setup(&lwin); init_view_list(&lwin); histories_init(/*size=*/5); hists_commands_save("cmd"); hists_menucmd_save("mcmd"); hists_exprreg_save("ereg"); hists_search_save("search"); hists_prompt_save("prompt"); hists_filter_save("filter"); flist_hist_setup(&lwin, "/", NULL, /*rel_pos=*/0, /*timestamp=*/1); curr_stats.load_stage = -1; } TEARDOWN() { curr_stats.load_stage = 0; view_teardown(&lwin); curr_view = NULL; vle_cmds_reset(); vle_keys_reset(); cfg_resize_histories(0); } TEST(history_symbols) { assert_success(cmds_dispatch1("history :", &lwin, CIT_COMMAND)); assert_string_equal("Command Line History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history /", &lwin, CIT_COMMAND)); assert_string_equal("Search History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history @", &lwin, CIT_COMMAND)); assert_string_equal("Prompt History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history ?", &lwin, CIT_COMMAND)); assert_string_equal("Search History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history =", &lwin, CIT_COMMAND)); assert_string_equal("Filter History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history .", &lwin, CIT_COMMAND)); assert_string_equal("Directory History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); } TEST(history_keywords) { assert_success(cmds_dispatch1("history cmd", &lwin, CIT_COMMAND)); assert_string_equal("Command Line History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history search", &lwin, CIT_COMMAND)); assert_string_equal("Search History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history fsearch", &lwin, CIT_COMMAND)); assert_string_equal("Search History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history input", &lwin, CIT_COMMAND)); assert_string_equal("Prompt History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history bsearch", &lwin, CIT_COMMAND)); assert_string_equal("Search History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history filter", &lwin, CIT_COMMAND)); assert_string_equal("Filter History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history dir", &lwin, CIT_COMMAND)); assert_string_equal("Directory History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history exprreg", &lwin, CIT_COMMAND)); assert_string_equal("Expression Register History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history mcmd", &lwin, CIT_COMMAND)); assert_string_equal("Menu Command History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); } TEST(history_shortcuts) { assert_success(cmds_dispatch1("history c", &lwin, CIT_COMMAND)); assert_string_equal("Command Line History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history s", &lwin, CIT_COMMAND)); assert_string_equal("Search History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history f", &lwin, CIT_COMMAND)); assert_string_equal("Search History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history i", &lwin, CIT_COMMAND)); assert_string_equal("Prompt History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history b", &lwin, CIT_COMMAND)); assert_string_equal("Search History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history fi", &lwin, CIT_COMMAND)); assert_string_equal("Filter History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history d", &lwin, CIT_COMMAND)); assert_string_equal("Directory History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history e", &lwin, CIT_COMMAND)); assert_string_equal("Expression Register History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); assert_success(cmds_dispatch1("history mc", &lwin, CIT_COMMAND)); assert_string_equal("Menu Command History", menu_get_current()->title); assert_success(cmds_dispatch1("q", &lwin, CIT_MENU_COMMAND)); } TEST(history_bad_param) { assert_failure(cmds_dispatch1("history x", &lwin, CIT_COMMAND)); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/test-support/0000700000175000017500000000000015051153266013572 5ustar korykory./tests/test-support/test-utils.c0000600000175000017500000004304515051153266016063 0ustar korykory#include "test-utils.h" #include #include /* chmod() */ #include /* timeval utimes() */ #include /* access() geteuid() rmdir() symlink() usleep() */ #ifdef _WIN32 #include #endif #include /* LC_ALL setlocale() */ #include /* NULL */ #include /* FILE fclose() fopen() fread() remove() */ #include /* free() malloc() */ #include /* memset() strcpy() strdup() */ #include "../../src/cfg/config.h" #include "../../src/compat/os.h" #include "../../src/compat/pthread.h" #include "../../src/engine/cmds.h" #include "../../src/engine/options.h" #include "../../src/engine/var.h" #include "../../src/engine/variables.h" #include "../../src/ui/color_manager.h" #include "../../src/ui/column_view.h" #include "../../src/ui/ui.h" #include "../../src/utils/dynarray.h" #include "../../src/utils/env.h" #include "../../src/utils/fs.h" #include "../../src/utils/macros.h" #include "../../src/utils/matcher.h" #include "../../src/utils/path.h" #include "../../src/utils/regexp.h" #include "../../src/utils/str.h" #include "../../src/utils/string_array.h" #include "../../src/utils/utils.h" #include "../../src/background.h" #include "../../src/cmd_completion.h" #include "../../src/filelist.h" #include "../../src/filtering.h" #include "../../src/opt_handlers.h" #include "../../src/plugins.h" #include "../../src/status.h" #include "../../src/undo.h" static OpsResult exec_func(OPS op, void *data, const char src[], const char dst[]); static int op_avail(OPS op); static void format_none(void *data, size_t buf_len, char buf[], const format_info_t *info); static int complete_line_stub(const char cmd_line[], void *extra_arg); static int complete_args_stub(int id, const cmd_info_t *cmd_info, int arg_pos, void *extra_arg); static int swap_range(void); static int resolve_mark(char mark); static char * expand_macros(const char str[], int for_shell, int *usr1, int *usr2); static char * cmds_expand_envvars(const char *str); static void post(int id); static void select_range(int id, const cmd_info_t *cmd_info); static int skip_at_beginning(int id, const char *args); static void init_list(view_t *view); static int init_pair_stub(int pair, int f, int b); static int pair_content_stub(int pair, int *f, int *b); static int pair_in_use_stub(int pair); static void pair_moved_stub(int from, int to); void fix_environ(void) { #ifdef _WIN32 extern int _CRT_glob; extern void __wgetmainargs(int *, wchar_t ***, wchar_t ***, int, int *); wchar_t **envp, **argv; int argc, si = 0; __wgetmainargs(&argc, &argv, &envp, _CRT_glob, &si); #endif } void conf_setup(void) { update_string(&cfg.slow_fs_list, ""); update_string(&cfg.apropos_prg, ""); update_string(&cfg.cd_path, ""); update_string(&cfg.find_prg, ""); update_string(&cfg.fuse_home, ""); update_string(&cfg.time_format, "+"); update_string(&cfg.vi_command, ""); update_string(&cfg.vi_x_command, ""); update_string(&cfg.ruler_format, ""); update_string(&cfg.status_line, ""); update_string(&cfg.tab_line, ""); update_string(&cfg.grep_prg, ""); update_string(&cfg.locate_prg, ""); update_string(&cfg.media_prg, ""); update_string(&cfg.vborder_filler, ""); update_string(&cfg.hborder_filler, ""); update_string(&cfg.millersep_filler, ""); update_string(&cfg.tab_prefix, ""); update_string(&cfg.tab_label, ""); update_string(&cfg.tab_suffix, ""); update_string(&cfg.delete_prg, ""); cfg.sizefmt.base = 1; cfg.sizefmt.precision = 0; cfg.sizefmt.ieci_prefixes = 0; cfg.sizefmt.space = 0; cfg.tab_stop = 4; #ifndef _WIN32 replace_string(&cfg.shell, "/bin/sh"); update_string(&cfg.shell_cmd_flag, "-c"); #else replace_string(&cfg.shell, "cmd"); update_string(&cfg.shell_cmd_flag, "/C"); #endif stats_update_shell_type(cfg.shell); cfg.dot_dirs = DD_TREE_LEAFS_PARENT; if(cfg.wild_inc != NULL) { matcher_free(cfg.wild_inc); } char *error; cfg.wild_inc = matcher_alloc_glob("", &error); free(error); } void conf_teardown(void) { update_string(&cfg.slow_fs_list, NULL); update_string(&cfg.apropos_prg, NULL); update_string(&cfg.cd_path, NULL); update_string(&cfg.find_prg, NULL); update_string(&cfg.fuse_home, NULL); update_string(&cfg.time_format, NULL); update_string(&cfg.vi_command, NULL); update_string(&cfg.vi_x_command, NULL); update_string(&cfg.ruler_format, NULL); update_string(&cfg.status_line, NULL); update_string(&cfg.tab_line, NULL); update_string(&cfg.grep_prg, NULL); update_string(&cfg.locate_prg, NULL); update_string(&cfg.media_prg, NULL); update_string(&cfg.vborder_filler, NULL); update_string(&cfg.hborder_filler, NULL); update_string(&cfg.millersep_filler, NULL); update_string(&cfg.tab_prefix, NULL); update_string(&cfg.tab_label, NULL); update_string(&cfg.tab_suffix, NULL); update_string(&cfg.delete_prg, NULL); update_string(&cfg.shell, NULL); update_string(&cfg.shell_cmd_flag, NULL); /* Non-zero history size has implications for views and status, so reset * it. */ cfg.history_len = 0; cfg.dot_dirs = 0; cfg.sizefmt.base = 0; cfg.sizefmt.precision = 0; cfg.sizefmt.ieci_prefixes = 0; cfg.sizefmt.space = 0; matcher_free(cfg.wild_inc); cfg.wild_inc = NULL; } void opt_handlers_setup(void) { update_string(&lwin.view_columns, ""); update_string(&lwin.view_columns_g, ""); update_string(&lwin.sort_groups, ""); update_string(&lwin.sort_groups_g, ""); update_string(&lwin.preview_prg, ""); update_string(&lwin.preview_prg_g, ""); update_string(&rwin.view_columns, ""); update_string(&rwin.view_columns_g, ""); update_string(&rwin.sort_groups, ""); update_string(&rwin.sort_groups_g, ""); update_string(&rwin.preview_prg, ""); update_string(&rwin.preview_prg_g, ""); conf_setup(); init_option_handlers(); } void opt_handlers_teardown(void) { vle_opts_reset(); conf_teardown(); update_string(&lwin.view_columns, NULL); update_string(&lwin.view_columns_g, NULL); update_string(&lwin.sort_groups, NULL); update_string(&lwin.sort_groups_g, NULL); update_string(&lwin.preview_prg, NULL); update_string(&lwin.preview_prg_g, NULL); update_string(&rwin.view_columns, NULL); update_string(&rwin.view_columns_g, NULL); update_string(&rwin.sort_groups, NULL); update_string(&rwin.sort_groups_g, NULL); update_string(&rwin.preview_prg, NULL); update_string(&rwin.preview_prg_g, NULL); } void undo_setup(void) { static int max_undo_levels = 0; un_init(&exec_func, &op_avail, NULL, &max_undo_levels); } static OpsResult exec_func(OPS op, void *data, const char *src, const char *dst) { return OPS_SUCCEEDED; } static int op_avail(OPS op) { return 0; } void undo_teardown(void) { un_reset(); } void view_setup(view_t *view) { char *error; view->list_rows = 0; view->filtered = 0; view->list_pos = 0; view->dir_entry = NULL; view->hide_dot = 0; view->hide_dot_g = 0; view->invert = 1; view->selected_files = 0; view->ls_view = 0; view->ls_view_g = 0; view->miller_view = 0; view->miller_view_g = 0; view->window_rows = 0; view->run_size = 1; view->pending_marking = 0; assert_success(filter_init(&view->local_filter.filter, 1)); assert_non_null(view->manual_filter = matcher_alloc("", 0, 0, "", &error)); assert_success(filter_init(&view->auto_filter, 1)); strcpy(view->curr_dir, "/path"); update_string(&view->custom.orig_dir, NULL); view_set_sort(view->sort, SK_BY_NAME, SK_NONE); view_set_sort(view->sort_g, SK_BY_NAME, SK_NONE); /* The code assumes that this field is initialized. At OS X and other * BSD-like refuse to compile empty regular expression. */ assert_success(regexp_compile(&view->primary_group, ".*", REG_ICASE)); view->primary_group_set = 1; view->custom.entry_count = 0; view->custom.entries = NULL; view->custom.full.nentries = 0; view->custom.full.entries = NULL; view->timestamps_mutex = malloc(sizeof(*view->timestamps_mutex)); pthread_mutex_init(view->timestamps_mutex, NULL); } void view_teardown(view_t *view) { flist_free_view(view); view->last_search[0] = '\0'; } void view_set_sort(signed char sort_keys[], signed char primary_key, signed char secondary_key) { memset(sort_keys, SK_NONE, SK_COUNT); sort_keys[0] = primary_key; sort_keys[1] = secondary_key; } void columns_setup_column(int id) { columns_add_column_desc(id, &format_none, NULL); } static void format_none(void *data, size_t buf_len, char buf[], const format_info_t *info) { buf[0] = '\0'; } void columns_teardown(void) { columns_clear_column_descs(); columns_set_line_print_func(NULL); columns_set_line_match_func(NULL); } void engine_cmds_setup(int real_completion) { static cmds_conf_t cmds_conf = { .complete_line = &complete_line_stub, .swap_range = &swap_range, .resolve_mark = &resolve_mark, .expand_macros = &expand_macros, .expand_envvars = &cmds_expand_envvars, .post = &post, .select_range = &select_range, .skip_at_beginning = &skip_at_beginning, }; cmds_conf.complete_args = real_completion ? &complete_args : &complete_args_stub; vle_cmds_init(1, &cmds_conf); } static int complete_line_stub(const char cmd_line[], void *extra_arg) { return 0; } static int complete_args_stub(int id, const cmd_info_t *cmd_info, int arg_pos, void *extra_arg) { return 0; } static int swap_range(void) { return 1; } static int resolve_mark(char mark) { return -1; } static char * expand_macros(const char str[], int for_shell, int *usr1, int *usr2) { return strdup(str); } static char * cmds_expand_envvars(const char *str) { return strdup(str); } static void post(int id) { } static void select_range(int id, const cmd_info_t *cmd_info) { } static int skip_at_beginning(int id, const char *args) { return -1; } void engine_cmds_teardown(void) { vle_cmds_reset(); } void histories_init(int size) { cfg_resize_histories(0); cfg_resize_histories(size); } void create_dir(const char path[]) { assert_success(os_mkdir(path, 0700)); assert_true(is_dir(path)); } void create_file(const char path[]) { FILE *const f = fopen(path, "w"); assert_non_null(f); if(f != NULL) { fclose(f); } } void create_executable(const char path[]) { create_file(path); assert_success(access(path, F_OK)); chmod(path, 0755); assert_success(access(path, X_OK)); } void make_file(const char path[], const char contents[]) { FILE *fp = fopen(path, "wb"); assert_non_null(fp); if(fp != NULL) { fputs(contents, fp); fclose(fp); } } int make_symlink(const char target[], const char linkpath[]) { #ifndef _WIN32 return symlink(target, linkpath); #else assert_fail("No creation of symbolic links on Windows."); return 1; #endif } void remove_dir(const char path[]) { assert_success(rmdir(path)); } void no_remove_dir(const char path[]) { assert_failure(rmdir(path)); } void remove_file(const char path[]) { assert_success(remove(path)); } void no_remove_file(const char path[]) { assert_failure(remove(path)); } void make_abs_path(char buf[], size_t buf_len, const char base[], const char sub[], const char cwd[]) { char local_buf[buf_len]; if(is_path_absolute(base)) { snprintf(local_buf, buf_len, "%s%s%s", base, (sub[0] == '\0' ? "" : "/"), sub); } else { char cwd_buf[PATH_MAX + 1]; if(cwd == NULL) { assert_non_null(get_cwd(cwd_buf, sizeof(cwd_buf))); cwd = cwd_buf; } snprintf(local_buf, buf_len, "%s/%s%s%s", cwd, base, (sub[0] == '\0' ? "" : "/"), sub); } canonicalize_path(local_buf, buf, buf_len); if(!ends_with_slash(sub) && !is_root_dir(buf)) { chosp(buf); } } void copy_file(const char src[], const char dst[]) { char buf[4*1024]; size_t nread; FILE *const in = os_fopen(src, "rb"); FILE *const out = os_fopen(dst, "wb"); assert_non_null(in); assert_non_null(out); while((nread = fread(&buf, 1, sizeof(buf), in)) != 0U) { assert_int_equal(nread, fwrite(&buf, 1, nread, out)); } fclose(out); fclose(in); } int windows(void) { #ifdef _WIN32 return 1; #else return 0; #endif } int not_windows(void) { #ifdef _WIN32 return 0; #else return 1; #endif } int not_wine(void) { #ifndef _WIN32 return 1; #else const HMODULE dll = GetModuleHandle("ntdll.dll"); if(dll == INVALID_HANDLE_VALUE) { return 0; } /* Newer WINE has some issues with spawning second instance. */ return (GetProcAddress(dll, "wine_get_version") == NULL); #endif } int regular_unix_user(void) { #ifdef _WIN32 return 0; #else return (geteuid() != 0); #endif } int have_cat(void) { return (find_cmd_in_path("cat", 0, NULL) == 0); } void try_enable_utf8_locale(void) { (void)setlocale(LC_ALL, ""); if(!utf8_locale()) { (void)setlocale(LC_ALL, "en_US.utf8"); } } int utf8_locale(void) { return (vifm_wcwidth(L'ä¸') == 2); } int replace_matcher(matcher_t **matcher, const char expr[]) { char *error; matcher_free(*matcher); *matcher = matcher_alloc(expr, FILTER_DEF_CASE_SENSITIVITY, 0, "", &error); free(error); return (*matcher == NULL); } void setup_grid(view_t *view, int column_count, int list_rows, int init) { view->window_cols = column_count; view->ls_view = 1; view->miller_view = 0; view->ls_transposed = 0; view->list_rows = list_rows; view->column_count = column_count; view->run_size = column_count; view->window_cells = column_count*view->window_rows; if(init) { init_list(view); } } void setup_transposed_grid(view_t *view, int column_count, int list_rows, int init) { view->window_cols = column_count; view->ls_view = 1; view->miller_view = 0; view->ls_transposed = 1; view->list_rows = list_rows; view->column_count = column_count; view->run_size = view->window_rows; view->window_cells = column_count*view->window_rows; if(init) { init_list(view); } } void init_view_list(view_t *view) { view->list_rows = 1; init_list(view); } static void init_list(view_t *view) { int i; view->dir_entry = dynarray_cextend(NULL, view->list_rows*sizeof(*view->dir_entry)); for(i = 0; i < view->list_rows; ++i) { view->dir_entry[i].name = strdup(""); view->dir_entry[i].type = FT_REG; view->dir_entry[i].origin = view->curr_dir; } } void check_compare_invariants(int expected_len) { assert_true(flist_custom_active(&lwin)); assert_true(flist_custom_active(&rwin)); assert_true(cv_compare(lwin.custom.type)); assert_true(cv_compare(rwin.custom.type)); assert_int_equal(expected_len, lwin.list_rows); assert_int_equal(expected_len, rwin.list_rows); int i; for(i = 0; i < expected_len; ++i) { assert_int_equal(lwin.dir_entry[i].id, rwin.dir_entry[i].id); } } void check_bg_jobs(void) { /* Won't hurt to exercise code for displaying errors which depends on thread * synchronization. */ bg_check(/*show_errors=*/1); } void wait_for_bg(void) { int counter = 0; while(bg_has_active_jobs(0)) { usleep(5000); if(++counter > 100) { assert_fail("Waiting for too long."); break; } } } void wait_for_all_bg(void) { int counter = 0; var_t var = var_from_int(-1); setvar("v:jobcount", var); var_free(var); check_bg_jobs(); while(bg_jobs != NULL) { if(++counter > 100) { assert_fail("Waiting for too long."); break; } usleep(5000); check_bg_jobs(); } } int wait_for_job(struct bg_job_t *job) { assert_non_null(job); bg_job_incref(job); int counter = 0; while(bg_job_is_running(job)) { usleep(5000); check_bg_jobs(); if(++counter > 100) { assert_fail("Waiting for too long."); return -1; } } /* When the job is marked as not running, the callback might not yet been * dispatched, so call check_bg_jobs() once again to be sure. */ check_bg_jobs(); int exit_code = job->exit_code; bg_job_decref(job); return exit_code; } void file_is(const char path[], const char *lines[], int nlines) { FILE *fp = fopen(path, "r"); if(fp == NULL) { assert_non_null(fp); return; } int actual_nlines; char **actual_lines = read_stream_lines(fp, &actual_nlines, /*null_sep_heuristic=*/0, NULL, NULL); fclose(fp); assert_int_equal(nlines, actual_nlines); int i; for(i = 0; i < MIN(nlines, actual_nlines); ++i) { assert_string_equal(lines[i], actual_lines[i]); } free_string_array(actual_lines, actual_nlines); } char * mock_env(const char env[], const char with[]) { char *value = NULL; update_string(&value, env_get("TMPDIR")); env_set("TMPDIR", with); return value; } void unmock_env(const char env[], char old_value[]) { if(old_value != NULL) { env_set("TMPDIR", old_value); } else { env_remove("TMPDIR"); } free(old_value); } void stub_colmgr(void) { const colmgr_conf_t colmgr_conf = { .max_color_pairs = 256, .max_colors = 16, .init_pair = &init_pair_stub, .pair_content = &pair_content_stub, .pair_in_use = &pair_in_use_stub, .pair_moved = &pair_moved_stub, }; colmgr_init(&colmgr_conf); } static int init_pair_stub(int pair, int f, int b) { return 0; } static int pair_content_stub(int pair, int *f, int *b) { *f = 0; *b = 0; return 0; } static int pair_in_use_stub(int pair) { return 0; } static void pair_moved_stub(int from, int to) { } void reset_timestamp(const char path[]) { #ifndef _WIN32 struct timeval tvs[2] = {}; assert_success(utimes(path, tvs)); #else HANDLE file = CreateFileA(path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); assert_true(file != INVALID_HANDLE_VALUE); if(file != INVALID_HANDLE_VALUE) { FILETIME time = { 1, 0 }; assert_true(SetFileTime(file, &time, &time, &time)); CloseHandle(file); } #endif } void load_plugins(struct plugs_t *plugs, const char cfg_dir[]) { strlist_t plugins_dirs = { }; plugins_dirs.nitems = put_into_string_array(&plugins_dirs.items, plugins_dirs.nitems, format_str("%s/plugins", cfg_dir)); plugs_load(plugs, plugins_dirs); free_string_array(plugins_dirs.items, plugins_dirs.nitems); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/test-support/test-utils.h0000600000175000017500000001352315051153245016063 0ustar korykory#ifndef VIFM_TESTS__TEST_SUPPORT__TEST_UTILS_H__ #define VIFM_TESTS__TEST_SUPPORT__TEST_UTILS_H__ #include /* size_t */ /* Executable suffixes. */ #if defined(__CYGWIN__) || defined(_WIN32) #define EXE_SUFFIX ".exe" #define EXE_SUFFIXW L".exe" #else #define EXE_SUFFIX "" #define EXE_SUFFIXW L"" #endif #ifdef _WIN32 #define SL "\\\\" #else #define SL "/" #endif struct bg_job_t; struct view_t; /* _wenviron used on Windows gets created only if we invoke __wgetmainargs(), so * do it here. */ void fix_environ(void); /* Prepares configuration for use in tests. */ void conf_setup(void); /* Cleans up configuration. */ void conf_teardown(void); /* Prepares option handler for use in tests. */ void opt_handlers_setup(void); /* Cleans up option handlers. */ void opt_handlers_teardown(void); /* Prepares undo unit for file operations. */ void undo_setup(void); /* Cleans up undo unit. */ void undo_teardown(void); /* Initializes view with safe defaults. */ void view_setup(struct view_t *view); /* Frees resources of the view. */ void view_teardown(struct view_t *view); /* Sets up sorting with up to 2 sorting keys (use SK_NONE for unused ones). */ void view_set_sort(signed char sort_keys[], signed char primary_key, signed char secondary_key); /* Registers a column with specified id that prints empty string. */ void columns_setup_column(int id); /* Unregisters all columns and resets print function. */ void columns_teardown(void); /* Initializes engine/cmds unit. */ void engine_cmds_setup(int real_completion); /* Uninitializes engine/cmds unit. */ void engine_cmds_teardown(void); /* Initializes empty histories of specified size. */ void histories_init(int size); /* Creates empty directory at specified path. */ void create_dir(const char path[]); /* Creates file at the path. */ void create_file(const char path[]); /* Creates executable file at the path. */ void create_executable(const char path[]); /* Makes a file with specified contents. */ void make_file(const char path[], const char contents[]); /* Makes a symbolic link. Returns zero on success, otherwise non-zero is * returned. */ int make_symlink(const char target[], const char linkpath[]); /* Removes empty directory at specified path. */ void remove_dir(const char path[]); /* Removes empty directory at specified path checking that the removal fails. */ void no_remove_dir(const char path[]); /* Removes file at specified path. */ void remove_file(const char path[]); /* Removes empty file at specified path checking that the removal fails. */ void no_remove_file(const char path[]); /* Either puts base/sub or cwd/base/sub into the buf. If cwd is NULL, current * working directory is used. */ void make_abs_path(char buf[], size_t buf_len, const char base[], const char sub[], const char cwd[]); /* Copies file at src to dst. */ void copy_file(const char src[], const char dst[]); /* Whether running on Windows. Returns non-zero if so, otherwise zero is * returned. */ int windows(void); /* Whether running on non-Windows. Returns non-zero if so, otherwise zero is * returned. */ int not_windows(void); /* Whether running outside of WINE. Returns non-zero if so, otherwise zero is * returned. */ int not_wine(void); /* Attempts to switch to UTF-8 capable locale. Use utf8_locale() to check if * successful. */ void try_enable_utf8_locale(void); /* Whether locale is UTF-8. Returns non-zero if so, otherwise zero is * returned. */ int utf8_locale(void); /* Whether running as a regular user under Unix and can therefore force * errors via chmod(). Returns non-zero if so, otherwise zero is returned. */ int regular_unix_user(void); /* Whether cat program is available somewhere in the $PATH. Returns non-zero if * so, otherwise zero is returned. */ int have_cat(void); struct matcher_t; /* Changes *matcher to have the value of the expr. The operation is assumed to * succeed, but it's not guaranteed. */ int replace_matcher(struct matcher_t **matcher, const char expr[]); struct view_t; /* Setups a grid of specified dimensions for the view. */ void setup_grid(struct view_t *view, int column_count, int list_rows, int init); /* Setups transposed grid of specified dimensions for the view. */ void setup_transposed_grid(struct view_t *view, int column_count, int list_rows, int init); /* Loads dummy list of files into a view. It consists of a single fake * entry. */ void init_view_list(struct view_t *view); /* Checks state of two-pane compare for sanity. */ void check_compare_invariants(int expected_len); /* Checks currently running background tasks. */ void check_bg_jobs(void); /* Waits termination of all background tasks. */ void wait_for_bg(void); /* Waits termination of all background jobs including external applications. */ void wait_for_all_bg(void); /* Waits termination of a particular task. Returns job's exit code or -1 on * error. */ int wait_for_job(struct bg_job_t *job); /* Verifies that file at specified path consists of specified list of lines. */ void file_is(const char path[], const char *lines[], int nlines); /* Replaces value of an environment variable. Pass returned value to * unmock_env() to restore its state. Returns its old value. */ char * mock_env(const char env[], const char with[]); /* Restores value of an environment variable changed by mock_env(). */ void unmock_env(const char env[], char old_value[]); /* Initializes color manager with functions that do nothing. */ void stub_colmgr(void); /* Changes time attributes of a file to something "long time ago". */ void reset_timestamp(const char path[]); struct plugs_t; /* Appends "/plugins" to the passed in directory and loads plugins from * there. */ void load_plugins(struct plugs_t *plugs, const char cfg_dir[]); #endif /* VIFM_TESTS__TEST_SUPPORT__TEST_UTILS_H__ */ /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/test-support/stubs.h0000600000175000017500000000043315051153245015102 0ustar korykory#ifndef VIFM_TESTS__TEST_SUPPORT__STUBS_H__ #define VIFM_TESTS__TEST_SUPPORT__STUBS_H__ extern int vifm_tests_exited; #endif /* VIFM_TESTS__TEST_SUPPORT__STUBS_H__ */ /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/test-support/stic/0000700000175000017500000000000015051153245014531 5ustar korykory./tests/test-support/stic/stic.c0000600000175000017500000004625515051153245015655 0ustar korykory/* stic * Copyright (C) 2010 Keith Nicholas (as seatest project). * Copyright (C) 2015 xaizek. * * See LICENSE.txt for license text. */ #include "stic.h" #include #include #include #include #include #ifdef WIN32 #include int stic_is_string_equal_i(const char* s1, const char* s2) { #ifdef _MSC_VER #pragma warning(disable: 4996) #endif return stricmp(s1, s2) == 0; } #else #include #include static unsigned int GetTickCount() { enum { MS_PER_SEC = 1000, NS_PER_MS = 1000, }; struct timeval t; gettimeofday(&t, 0); return t.tv_sec*MS_PER_SEC + t.tv_usec/NS_PER_MS; } int stic_is_string_equal_i(const char* s1, const char* s2) { return strcasecmp(s1, s2) == 0; } #endif #ifdef STIC_INTERNAL_TESTS static int stic_test_last_passed = 0; #endif typedef enum { STIC_DISPLAY_TESTS, STIC_RUN_TESTS, STIC_DO_NOTHING, STIC_DO_ABORT } stic_action_t; typedef struct { int argc; char** argv; stic_action_t action; } stic_testrunner_t; static int stic_screen_width = 70; static int stic_tests_run = 0; static int stic_tests_skipped = 0; static int stic_tests_failed = 0; static int stic_checks_passed = 0; static int stic_checks_failed = 0; static int stic_display_only = 0; static int stic_verbose = 0; static int stic_random_failures = 0; static int stic_silent = 0; static int stic_machine_readable = 0; static const char *stic_current_fixture; static const char *stic_current_fixture_path; static char stic_magic_marker[20] = ""; static stic_void_void stic_suite_setup_func = 0; static stic_void_void stic_suite_teardown_func = 0; static stic_void_void stic_fixture_setup = 0; static stic_void_void stic_fixture_teardown = 0; const char *stic_current_test_name; stic_test stic_current_test; const char *stic_suite_name; int stic_current_count; int stic_max_count; void (*stic_simple_test_result)(int passed, char* reason, const char* function, const char file[], unsigned int line) = stic_simple_test_result_log; void suite_setup(stic_void_void setup) { stic_suite_setup_func = setup; } void suite_teardown(stic_void_void teardown) { stic_suite_teardown_func = teardown; } int stic_is_display_only() { return stic_display_only; } static void stic_header_printer(const char s[], int length, char f) { int l = strlen(s); int d = (length- (l + 2)) / 2; int i; if(stic_is_display_only() || stic_machine_readable) return; for(i = 0; i 1) { printf("\n%s(%d):\n", test_name, stic_current_count); } else { printf("\n%s:\n", test_name); } } printf(" (-) FAILED\n" " %s:%u: error: check failed\n" " in %s\n" " %s\n", file, line, function, reason ); } stic_checks_failed++; if (last_failed_test != stic_current_test) { ++stic_tests_failed; } last_failed_test = stic_current_test; last_test = stic_current_test; last_count = stic_current_count; } else { if(stic_verbose) { if(stic_machine_readable) { printf("%s%s,%s,%u,Passed\n", stic_magic_marker, stic_current_fixture_path, stic_current_test_name, line); } else { if(!same_test) { printf("\n%s\n", test_name); } printf(" (+) passed\n" " %s:%u\n" " in %s\n", file, line, function); } last_test = stic_current_test; last_count = stic_current_count; } stic_checks_passed++; } } void stic_assert_true(int test, const char* function, const char file[], unsigned int line) { stic_simple_test_result(test, "Should have been true", function, file, line); } void stic_assert_false(int test, const char* function, const char file[], unsigned int line) { stic_simple_test_result(!test, "Should have been false", function, file, line); } void stic_assert_success(int test, const char function[], const char file[], unsigned int line) { stic_simple_test_result(test == 0, "Should have been success (zero)", function, file, line); } void stic_assert_failure(int test, const char function[], const char file[], unsigned int line) { stic_simple_test_result(test != 0, "Should have been failure (non-zero)", function, file, line); } void stic_assert_null(const void *value, const char function[], const char file[], unsigned int line) { stic_simple_test_result(value == NULL, "Should have been NULL", function, file, line); } void stic_assert_non_null(const void *value, const char function[], const char file[], unsigned int line) { stic_simple_test_result(value != NULL, "Should have been non-NULL", function, file, line); } void stic_assert_int_equal(int expected, int actual, const char* function, const char file[], unsigned int line) { char s[STIC_PRINT_BUFFER_SIZE]; snprintf(s, sizeof(s), "Expected %d but was %d", expected, actual); stic_simple_test_result(expected==actual, s, function, file, line); } void stic_assert_ulong_equal(unsigned long expected, unsigned long actual, const char* function, const char file[], unsigned int line) { char s[STIC_PRINT_BUFFER_SIZE]; snprintf(s, sizeof(s), "Expected %lu but was %lu", expected, actual); stic_simple_test_result(expected==actual, s, function, file, line); } void stic_assert_float_equal( float expected, float actual, float delta, const char* function, const char file[], unsigned int line ) { char s[STIC_PRINT_BUFFER_SIZE]; float result = expected-actual; snprintf(s, sizeof(s), "Expected %f but was %f", expected, actual); if(result < 0.0) result = 0.0f - result; stic_simple_test_result( result <= delta, s, function, file, line); } void stic_assert_double_equal( double expected, double actual, double delta, const char* function, const char file[], unsigned int line ) { char s[STIC_PRINT_BUFFER_SIZE]; double result = expected-actual; snprintf(s, sizeof(s), "Expected %f but was %f", expected, actual); if(result < 0.0) result = 0.0 - result; stic_simple_test_result( result <= delta, s, function, file, line); } void stic_assert_string_equal(const char* expected, const char* actual, const char* function, const char file[], unsigned int line) { int comparison; char s[STIC_PRINT_BUFFER_SIZE]; if ((expected == (char *)0) && (actual == (char *)0)) { snprintf(s, sizeof(s), "Expected but was "); comparison = 1; } else if (expected == (char *)0) { snprintf(s, sizeof(s), "Expected but was \"%s\"", actual); comparison = 0; } else if (actual == (char *)0) { snprintf(s, sizeof(s), "Expected \"%s\" but was ", expected); comparison = 0; } else { comparison = strcmp(expected, actual) == 0; snprintf(s, sizeof(s), "Expected \"%s\" but was \"%s\"", expected, actual); } stic_simple_test_result(comparison, s, function, file, line); } void stic_assert_wstring_equal(const wchar_t expected[], const wchar_t actual[], const char function[], const char file[], unsigned int line) { int comparison; char s[STIC_PRINT_BUFFER_SIZE]; if ((expected == NULL) && (actual == NULL)) { snprintf(s, sizeof(s), "Expected but was "); comparison = 1; } else if (expected == NULL) { #ifdef STIC_C99 snprintf(s, sizeof(s), "Expected but was \"%ls\"", actual); #else snprintf(s, sizeof(s), "Expected but was wide string"); #endif comparison = 0; } else if (actual == NULL) { #ifdef STIC_C99 snprintf(s, sizeof(s), "Expected \"%ls\" but was ", expected); #else snprintf(s, sizeof(s), "Expected wide string but was "); #endif comparison = 0; } else { comparison = wcscmp(expected, actual) == 0; #ifdef STIC_C99 snprintf(s, sizeof(s), "Expected \"%ls\" but was \"%ls\"", expected, actual); #else snprintf(s, sizeof(s), "Expected wide string doesn't match"); #endif } stic_simple_test_result(comparison, s, function, file, line); } void stic_assert_string_ends_with(const char* expected, const char* actual, const char* function, const char file[], unsigned int line) { char s[STIC_PRINT_BUFFER_SIZE]; snprintf(s, sizeof(s), "Expected \"%s\" to end with \"%s\"", actual, expected); stic_simple_test_result(strcmp(expected, actual+(strlen(actual)-strlen(expected)))==0, s, function, file, line); } void stic_assert_wstring_ends_with(const wchar_t expected[], const wchar_t actual[], const char function[], const char file[], unsigned int line) { char s[STIC_PRINT_BUFFER_SIZE]; #ifdef STIC_C99 snprintf(s, sizeof(s), "Expected \"%ls\" to end with \"%ls\"", actual, expected); #else snprintf(s, sizeof(s), "Wide string doesn't end with the expected suffix"); #endif stic_simple_test_result(wcscmp(expected, actual+(wcslen(actual)-wcslen(expected)))==0, s, function, file, line); } void stic_assert_string_starts_with(const char* expected, const char* actual, const char* function, const char file[], unsigned int line) { char s[STIC_PRINT_BUFFER_SIZE]; snprintf(s, sizeof(s), "Expected \"%s\" to start with \"%s\"", actual, expected); stic_simple_test_result(strncmp(expected, actual, strlen(expected))==0, s, function, file, line); } void stic_assert_string_contains(const char* expected, const char* actual, const char* function, const char file[], unsigned int line) { char s[STIC_PRINT_BUFFER_SIZE]; snprintf(s, sizeof(s), "Expected \"%s\" to be in \"%s\"", expected, actual); stic_simple_test_result(strstr(actual, expected)!=0, s, function, file, line); } void stic_assert_string_doesnt_contain(const char* expected, const char* actual, const char* function, const char file[], unsigned int line) { char s[STIC_PRINT_BUFFER_SIZE]; snprintf(s, sizeof(s), "Expected \"%s\" not to have \"%s\" in it", actual, expected); stic_simple_test_result(strstr(actual, expected)==0, s, function, file, line); } void stic_run_test(const char fixture[], const char test[]) { stic_tests_run++; } void stic_test_fixture_start(const char filepath[]) { stic_current_fixture_path = filepath; stic_current_fixture = test_file_name(filepath); stic_fixture_checks_failed = stic_checks_failed; stic_fixture_checks_passed = stic_checks_passed; stic_fixture_tests_run = stic_tests_run; stic_fixture_teardown = 0; stic_fixture_setup = 0; if (!stic_silent) { stic_header_printer(stic_current_fixture, stic_screen_width, '-'); } } void stic_test_fixture_end() { char s[STIC_PRINT_BUFFER_SIZE]; const int nrun = stic_tests_run - stic_fixture_tests_run; const int nfailed = stic_checks_failed - stic_fixture_checks_failed; if (stic_silent) { if (stic_verbose) { if(!test_had_output()) { stic_header_printer(stic_current_fixture, stic_screen_width, '-'); } } else if(!test_had_output()) { return; } printf("\n"); } else if(test_had_output()) { printf("\n"); } snprintf(s, sizeof(s), "%d test%s run %d check%s failed", nrun, nrun == 1 ? "" : "s", nfailed, nfailed == 1 ? "" : "s"); stic_header_printer(s, stic_screen_width, ' '); printf("\n"); } static char* stic_fixture_filter = 0; static char* stic_test_filter = 0; void fixture_filter(char* filter) { stic_fixture_filter = filter; } void test_filter(char* filter) { stic_test_filter = filter; } void set_magic_marker(char* marker) { if(marker == NULL) return; strcpy(stic_magic_marker, marker); } static void stic_display_test(const char fixture_name[], const char test_name[]) { if(test_name == NULL) return; printf("%s,%s\n", fixture_name, test_name); } int stic_should_run(const char fixture[], const char test[]) { int run = 1; if(stic_fixture_filter) { if(strncmp(stic_fixture_filter, fixture, strlen(stic_fixture_filter)) != 0) run = 0; } if(stic_test_filter && test != NULL) { if(strncmp(stic_test_filter, test, strlen(stic_test_filter)) != 0) run = 0; } if(run && stic_display_only) { stic_display_test(fixture, test); run = 0; } return run; } int run_tests(stic_void_void tests) { unsigned long end; unsigned long start = GetTickCount(); char version[40]; char s[100]; char time[40]; tests(); end = GetTickCount(); if(stic_suite_name == NULL) { stic_suite_name = ""; } if(stic_is_display_only() || stic_machine_readable) return 1; snprintf(version, sizeof(version), "stic v%s%s%s", STIC_VERSION, (stic_suite_name[0] == '\0' ? "" : " :: "), stic_suite_name); printf("\n"); stic_header_printer(version, stic_screen_width, '='); printf("\n"); if (stic_checks_failed > 0) { snprintf(s, sizeof(s), "%d CHECK%s IN %d TEST%s FAILED", stic_checks_failed, stic_checks_failed == 1 ? "" : "S", stic_tests_failed, stic_tests_failed == 1 ? "" : "S"); stic_header_printer(s, stic_screen_width, ' '); } else { snprintf(s, sizeof(s), "ALL TESTS PASSED"); stic_header_printer(s, stic_screen_width, ' '); } memset(s, '-', strlen(s)); stic_header_printer(s, stic_screen_width, ' '); if (end - start == 0) { snprintf(time, sizeof(time), "< 1 ms"); } else { snprintf(time, sizeof(time), "%lu ms",end - start); } snprintf(s, sizeof(s), "%d check%s :: %d run test%s :: %d skipped test%s :: %s", stic_checks_passed + stic_checks_failed, stic_checks_passed + stic_checks_failed == 1 ? "" : "s", stic_tests_run, stic_tests_run == 1 ? "" : "s", stic_tests_skipped, stic_tests_skipped == 1 ? "" : "s", time); stic_header_printer(s, stic_screen_width, ' '); printf("\n"); stic_header_printer("", stic_screen_width, '='); return stic_checks_failed == 0; } void stic_show_help( void ) { printf("Usage: [-t ] [-f ] [-d] [help] [-v] [-m] [-k \n"); printf("Flags:\n"); printf("\thelp:\twill display this help\n"); printf("\t-t:\twill only run tests that match \n"); printf("\t-f:\twill only run fixtures that match \n"); printf("\t-d:\twill just display test names and fixtures without\n"); printf("\t-d:\trunning the test\n"); printf("\t-r:\tproduce random failures\n"); printf("\t-s:\tdo not display fixtures unless they contain failures\n"); printf("\t-v:\twill print a more verbose version of the test run\n"); printf("\t-m:\twill print a machine readable format of the test run, ie :- \n"); printf("\t \t,,,\n"); printf("\t-k:\twill prepend before machine readable output \n"); printf("\t \t cannot start with a '-'\n"); } int stic_commandline_has_value_after(stic_testrunner_t* runner, int arg) { if(!((arg+1) < runner->argc)) return 0; if(runner->argv[arg+1][0]=='-') return 0; return 1; } int stic_parse_commandline_option_with_value(stic_testrunner_t* runner, int arg, char* option, stic_void_string setter) { if(stic_is_string_equal_i(runner->argv[arg], option)) { if(!stic_commandline_has_value_after(runner, arg)) { printf("Error: The %s option expects to be followed by a value\n", option); runner->action = STIC_DO_ABORT; return 0; } setter(runner->argv[arg+1]); return 1; } return 0; } void stic_interpret_commandline(stic_testrunner_t* runner) { int arg; for(arg=0; (arg < runner->argc) && (runner->action != STIC_DO_ABORT); arg++) { if(stic_is_string_equal_i(runner->argv[arg], "help")) { stic_show_help(); runner->action = STIC_DO_NOTHING; return; } if(stic_is_string_equal_i(runner->argv[arg], "-d")) runner->action = STIC_DISPLAY_TESTS; if(stic_is_string_equal_i(runner->argv[arg], "-r")) stic_random_failures = 1; if(stic_is_string_equal_i(runner->argv[arg], "-s")) stic_silent = 1; if(stic_is_string_equal_i(runner->argv[arg], "-v")) stic_verbose = 1; if(stic_is_string_equal_i(runner->argv[arg], "-m")) stic_machine_readable = 1; if(stic_parse_commandline_option_with_value(runner,arg,"-t", test_filter)) arg++; if(stic_parse_commandline_option_with_value(runner,arg,"-f", fixture_filter)) arg++; if(stic_parse_commandline_option_with_value(runner,arg,"-k", set_magic_marker)) arg++; } } void stic_testrunner_create(stic_testrunner_t* runner, int argc, char** argv ) { runner->action = STIC_RUN_TESTS; runner->argc = argc; runner->argv = argv; stic_interpret_commandline(runner); } int stic_testrunner(int argc, char** argv, stic_void_void tests, stic_void_void setup, stic_void_void teardown) { stic_testrunner_t runner; stic_testrunner_create(&runner, argc, argv); switch(runner.action) { case STIC_DISPLAY_TESTS: { stic_display_only = 1; run_tests(tests); break; } case STIC_RUN_TESTS: { suite_setup(setup); suite_teardown(teardown); return run_tests(tests); } case STIC_DO_NOTHING: case STIC_DO_ABORT: default: { /* nothing to do, probably because there was an error which should of been already printed out. */ } } return 1; } #ifdef STIC_INTERNAL_TESTS void stic_simple_test_result_nolog(int passed, char* reason, const char* function, const char file[], unsigned int line) { stic_test_last_passed = passed; } void stic_assert_last_passed() { assert_int_equal(1, stic_test_last_passed); } void stic_assert_last_failed() { assert_int_equal(0, stic_test_last_passed); } void stic_disable_logging() { stic_simple_test_result = stic_simple_test_result_nolog; } void stic_enable_logging() { stic_simple_test_result = stic_simple_test_result_log; } #endif ./tests/test-support/stic/LICENSE.txt0000600000175000017500000000214215051153245016355 0ustar korykory Copyright (c) 2010 Keith Nicholas (as seatest project) Copyright (c) 2015 xaizek 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ./tests/test-support/stic/stic.h0000600000175000017500000005740715051153245015663 0ustar korykory/* stic * Copyright (C) 2010 Keith Nicholas (as seatest project). * Copyright (C) 2015 xaizek. * * See LICENSE.txt for license text. */ #ifndef STIC__STIC_H__ #define STIC__STIC_H__ #include /* Global data. */ #define STIC_VERSION "0.6" #define STIC_PROJECT_HOME "https://github.com/xaizek/stic" #define STIC_PRINT_BUFFER_SIZE 100000 /* Widely used function types. */ typedef void (*stic_test)(int test_param); typedef void (*stic_void_void)(void); typedef void (*stic_void_string)(char[]); /* Declarations. */ extern void (*stic_simple_test_result)(int passed, char* reason, const char* function, const char file[], unsigned int line); void stic_test_fixture_start(const char filepath[]); void stic_test_fixture_end( void ); void stic_simple_test_result_log(int passed, char* reason, const char* function, const char file[], unsigned int line); void stic_assert_true(int test, const char* function, const char file[], unsigned int line); void stic_assert_false(int test, const char* function, const char file[], unsigned int line); void stic_assert_success(int test, const char function[], const char file[], unsigned int line); void stic_assert_failure(int test, const char function[], const char file[], unsigned int line); void stic_assert_null(const void *value, const char function[], const char file[], unsigned int line); void stic_assert_non_null(const void *value, const char function[], const char file[], unsigned int line); void stic_assert_int_equal(int expected, int actual, const char* function, const char file[], unsigned int line); void stic_assert_ulong_equal(unsigned long expected, unsigned long actual, const char* function, const char file[], unsigned int line); void stic_assert_float_equal(float expected, float actual, float delta, const char* function, const char file[], unsigned int line); void stic_assert_double_equal(double expected, double actual, double delta, const char* function, const char file[], unsigned int line); void stic_assert_string_equal(const char* expected, const char* actual, const char* function, const char file[], unsigned int line); void stic_assert_wstring_equal(const wchar_t expected[], const wchar_t actual[], const char function[], const char file[], unsigned int line); void stic_assert_string_ends_with(const char* expected, const char* actual, const char* function, const char file[], unsigned int line); void stic_assert_wstring_ends_with(const wchar_t expected[], const wchar_t actual[], const char function[], const char file[], unsigned int line); void stic_assert_string_starts_with(const char* expected, const char* actual, const char* function, const char file[], unsigned int line); void stic_assert_string_contains(const char* expected, const char* actual, const char* function, const char file[], unsigned int line); void stic_assert_string_doesnt_contain(const char* expected, const char* actual, const char* function, const char file[], unsigned int line); int stic_should_run(const char fixture[], const char test[]); void stic_before_run( char* fixture, char* test); void stic_run_test(const char fixture[], const char test[]); void stic_skip_test(const char fixture[], const char test[]); void stic_setup( void ); void stic_teardown( void ); void stic_suite_teardown( void ); void stic_suite_setup( void ); int stic_positive_predicate( void ); void stic_printf(char buf[], const char format[], ...); /* Assert macros. */ #define assert_true(test) do { stic_assert_true(test, __FUNCTION__, __FILE__, __LINE__); } while (0) #define assert_false(test) do { stic_assert_false(test, __FUNCTION__, __FILE__, __LINE__); } while (0) #define assert_success(test) do { stic_assert_success(test, __FUNCTION__, __FILE__, __LINE__); } while (0) #define assert_failure(test) do { stic_assert_failure(test, __FUNCTION__, __FILE__, __LINE__); } while (0) #define assert_null(value) do { stic_assert_null(value, __FUNCTION__, __FILE__, __LINE__); } while (0) #define assert_non_null(value) do { stic_assert_non_null(value, __FUNCTION__, __FILE__, __LINE__); } while (0) #define assert_int_equal(expected, actual) do { stic_assert_int_equal(expected, actual, __FUNCTION__, __FILE__, __LINE__); } while (0) #define assert_ulong_equal(expected, actual) do { stic_assert_ulong_equal(expected, actual, __FUNCTION__, __FILE__, __LINE__); } while (0) #define assert_string_equal(expected, actual) do { stic_assert_string_equal(expected, actual, __FUNCTION__, __FILE__, __LINE__); } while (0) #define assert_wstring_equal(expected, actual) do { stic_assert_wstring_equal(expected, actual, __FUNCTION__, __FILE__, __LINE__); } while (0) #define assert_wstring_ends_with(expected, actual) do { stic_assert_wstring_ends_with(expected, actual, __FUNCTION__, __FILE__, __LINE__); } while (0) #define assert_n_array_equal(expected, actual, n) do { int stic_count; for(stic_count=0; stic_count= 199901L || (__GNUC__ >= 4 && !defined(__STRICT_ANSI__)) #define STIC_C99 #endif #ifdef STIC_C99 # define IF(...) .p = __VA_ARGS__, /* Specifies number of times to repeat the test as an integer (1 by default). */ # define REPEAT(...) .C = 1, .c = (__VA_ARGS__), /* Iteration number of the test (0..) or 0. To be used only * in test body. */ # define STIC_TEST_PARAM test_param # define TEST(name, ...) \ STIC_STATIC_ASSERT(STIC_CAT(too_many_lines_in_file_, __LINE__), \ __LINE__ < STIC_MAX_LINES); \ static void name(int test_param); \ static struct stic_test_data STIC_CAT(stic_test_data_, name) = { \ .n = #name, \ .t = &name, \ .f = __FILE__, \ __VA_ARGS__ \ }; \ static struct stic_test_data *STIC_CAT(l, __LINE__) = &STIC_CAT(stic_test_data_, name); \ static void name(int test_param) #else # define TEST(name) \ STIC_STATIC_ASSERT(STIC_CAT(too_many_lines_in_file_, __LINE__), \ __LINE__ < STIC_MAX_LINES); \ static void name(void); \ static struct stic_test_data STIC_CAT(stic_test_data_, name) = { \ /* .n = */ #name, \ /* .t = */ &name, \ /* .f = */ __FILE__, \ }; \ static struct stic_test_data *STIC_CAT(l, __LINE__) = &STIC_CAT(stic_test_data_, name); \ static void name(int test_param) #endif /* Setup/teardown declaration macros. */ #define SETUP_ONCE() \ static void stic_setup_once_func_impl(int no_test_param); \ static void (*stic_setup_once_func)(int no_test_param) = &stic_setup_once_func_impl; \ static void stic_setup_once_func_impl(int no_test_param) #define SETUP() \ static void stic_setup_func_impl(void); \ static void (*stic_setup_func)(void) = &stic_setup_func_impl; \ static void stic_setup_func_impl(void) #define TEARDOWN_ONCE() \ static void stic_teardown_once_func_impl(int no_test_param); \ static void (*stic_teardown_once_func)(int no_test_param) = &stic_teardown_once_func_impl; \ static void stic_teardown_once_func_impl(int no_test_param) #define TEARDOWN() \ static void stic_teardown_func_impl(void); \ static void (*stic_teardown_func)(void) = &stic_teardown_func_impl; \ static void stic_teardown_func_impl(void) /* Test suite entry point macro. */ #ifndef SUITE_NAME #define SUITE_NAME #endif #define DEFINE_SUITE() \ typedef void (*stic_ft)(void); \ stic_ft FIXTURES_VARIABLES; \ \ const char *stic_suite_name = STIC_STR(SUITE_NAME); \ \ void stic_suite(void) \ { \ stic_ft fixtures[] = { FIXTURES_VARIABLES }; \ STIC_STATIC_ASSERT(too_many_fixtures, \ STIC_ARRAY_LEN(fixtures) >= MAXTESTID); \ size_t i; \ for(i = 0; i < STIC_ARRAY_LEN(fixtures); ++i) \ { \ if(fixtures[i] != NULL) (*fixtures[i])(); \ } \ } \ \ int main(int argc, char *argv[]) \ { \ int r; \ const int file_has_tests = (stic_get_fixture_name() != NULL); \ if(!file_has_tests && stic_setup_once_func != NULL) \ { \ stic_setup_once_func(/*no_test_param=*/0); \ } \ r = stic_testrunner(argc, argv, stic_suite, stic_setup_func, stic_teardown_func) == 0; \ if(!file_has_tests && stic_teardown_once_func != NULL) \ { \ stic_teardown_once_func(/*no_test_param=*/0); \ } \ return r; \ } #ifdef TESTID /* Test fixture body. */ typedef struct stic_test_data *stic_test_data_p; static stic_test_data_p TEST_DATA_STRUCTS; static void (*stic_setup_func)(void); static void (*stic_setup_once_func)(int no_test_param); static void (*stic_teardown_func)(void); static void (*stic_teardown_once_func)(int no_test_param); static struct stic_test_data *const *const stic_test_data[] = { TEST_DATA_STRUCTS_REF }; static const char * stic_get_fixture_name(void) { size_t i; for(i = 0U; i < STIC_ARRAY_LEN(stic_test_data); ++i) { if(*stic_test_data[i]) { return (*stic_test_data[i])->f; } } return NULL; } static void stic_fixture(void) { extern const char *stic_current_test_name; extern stic_test stic_current_test; extern int stic_current_count; extern int stic_max_count; size_t i; int c; int has_any_tests = 0; const char *fixture_name = stic_get_fixture_name(); if(fixture_name == NULL || !stic_should_run(fixture_name, NULL)) { return; } stic_test_fixture_start(fixture_name); fixture_setup(stic_setup_func); fixture_teardown(stic_teardown_func); for(i = 0; i < STIC_ARRAY_LEN(stic_test_data); ++i) { struct stic_test_data *td = *stic_test_data[i]; if(td == NULL) continue; if(!stic_should_run(fixture_name, td->n)) continue; /* Since predicates can rely on setup once, check predicates after * invoking setup once. */ if(!has_any_tests) { has_any_tests = 1; if(stic_setup_once_func != NULL) { stic_current_test_name = ""; stic_current_test = stic_setup_once_func; stic_setup_once_func(/*no_test_param=*/0); } } if((td->p != NULL && !td->p()) || (td->C && td->c < 1)) { stic_skip_test(fixture_name, td->n); continue; } stic_current_test_name = td->n; stic_current_test = td->t; stic_max_count = (td->C ? td->c : 1); for(c = 0; c < stic_max_count; ++c) { stic_current_count = c; stic_suite_setup(); stic_setup(); td->t(c); stic_teardown(); stic_suite_teardown(); } stic_run_test(fixture_name, td->n); } if(has_any_tests && stic_teardown_once_func != NULL) { stic_current_test_name = ""; stic_current_test = stic_teardown_once_func; stic_teardown_once_func(/*no_test_param=*/0); } test_fixture_end(); } void (*STIC_CAT(t, TESTID))(void) = &stic_fixture; #endif /* TESTID */ #endif /* STIC__STIC_H__ */ #ifdef STIC_INTERNAL_TESTS void stic_simple_test_result_nolog(int passed, char* reason, const char* function, const char file[], unsigned int line); void stic_assert_last_passed(); void stic_assert_last_failed(); void stic_enable_logging(); void stic_disable_logging(); #endif /* STIC_INTERNAL_TESTS */ ./tests/test-support/stubs.c0000600000175000017500000000115715051153245015101 0ustar korykory#include "stubs.h" #include /* abort() */ #include "../../src/vifm.h" struct view_t; int vifm_tests_exited; void vifm_reexec_startup_commands(void) { /* Do nothing. */ } void vifm_try_leave(int write_info, int cquit, int force) { vifm_tests_exited = 1; } void vifm_choose_files(struct view_t *view, int nfiles, char *files[]) { abort(); } void vifm_finish(const char message[]) { abort(); } void vifm_exit(int exit_code) { abort(); } int vifm_testing(void) { return 1; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/viewcolumns_parser/0000700000175000017500000000000015051153245015025 5ustar korykory./tests/viewcolumns_parser/test.h0000600000175000017500000000056215051153245016162 0ustar korykory#ifndef VIFM_TESTS__VIEWCOLUMNS_PARSER__TEST_H__ #define VIFM_TESTS__VIEWCOLUMNS_PARSER__TEST_H__ #include "../../src/ui/column_view.h" column_info_t info; int do_parse(const char *str); #endif /* VIFM_TESTS__VIEWCOLUMNS_PARSER__TEST_H__ */ /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/viewcolumns_parser/alignment.c0000600000175000017500000000127315051153245017154 0ustar korykory#include #include #include "../../src/ui/column_view.h" #include "../../src/viewcolumns_parser.h" #include "test.h" TEST(left_alignment_ok) { assert_success(do_parse("-{name}")); assert_int_equal(AT_LEFT, info.align); } TEST(right_alignment_ok) { assert_success(do_parse("{name}")); assert_int_equal(AT_RIGHT, info.align); } TEST(middle_alignment_ok) { assert_success(do_parse("^{name}")); assert_int_equal(AT_MIDDLE, info.align); } TEST(dynamic_alignment_ok) { assert_success(do_parse("*{name}")); assert_int_equal(AT_DYN, info.align); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/viewcolumns_parser/cropping.c0000600000175000017500000000143715051153245017021 0ustar korykory#include #include #include "../../src/ui/column_view.h" #include "../../src/viewcolumns_parser.h" #include "test.h" TEST(cropping_no_ok) { int result = do_parse("{name}"); assert_true(result == 0); assert_true(info.cropping == CT_NONE); } TEST(cropping_none_ok) { int result = do_parse("{name}..."); assert_true(result == 0); assert_true(info.cropping == CT_NONE); } TEST(cropping_truncate_ok) { int result = do_parse("{name}."); assert_true(result == 0); assert_true(info.cropping == CT_TRUNCATE); } TEST(cropping_ellipsis_ok) { int result = do_parse("{name}.."); assert_true(result == 0); assert_true(info.cropping == CT_ELLIPSIS); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/viewcolumns_parser/sizes.c0000600000175000017500000000273115051153245016333 0ustar korykory#include #include #include "../../src/ui/column_view.h" #include "../../src/viewcolumns_parser.h" #include "test.h" TEST(auto_ok) { int result = do_parse("{name}"); assert_true(result == 0); assert_true(info.sizing == ST_AUTO); } TEST(absolute_without_limitation_ok) { int result = do_parse("10{name}"); assert_true(result == 0); assert_int_equal(10, info.full_width); assert_int_equal(10, info.text_width); assert_true(info.sizing == ST_ABSOLUTE); } TEST(absolute_with_limitation_ok) { int result = do_parse("10.8{name}"); assert_true(result == 0); assert_int_equal(10, info.full_width); assert_int_equal(8, info.text_width); assert_true(info.sizing == ST_ABSOLUTE); } TEST(absolute_with_limitation_overflow_fail) { int result = do_parse("10.11{name}"); assert_false(result == 0); } TEST(percent_ok) { int result = do_parse("50%{name}"); assert_true(result == 0); assert_int_equal(50, info.full_width); assert_int_equal(50, info.text_width); assert_true(info.sizing == ST_PERCENT); } TEST(percent_zero_fail) { int result = do_parse("0%{name}"); assert_false(result == 0); } TEST(percent_greater_than_hundred_fail) { int result = do_parse("110%{name}"); assert_false(result == 0); } TEST(percent_summ_greater_than_hundred_fail) { int result = do_parse("50%{name},50%{name},50%{name}"); assert_false(result == 0); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/viewcolumns_parser/literals.c0000600000175000017500000000334615051153245017020 0ustar korykory#include #include #include #include "../../src/ui/column_view.h" #include "../../src/viewcolumns_parser.h" #include "test.h" SETUP_ONCE() { try_enable_utf8_locale(); } TEST(defaults_are_ok) { assert_success(do_parse("{#literal}")); assert_int_equal(FILL_COLUMN_ID, info.column_id); assert_int_equal(AT_RIGHT, info.align); assert_int_equal(ST_ABSOLUTE, info.sizing); assert_int_equal(CT_TRUNCATE, info.cropping); } TEST(value_and_widths_are_ok) { assert_success(do_parse("{#}")); assert_string_equal("", info.literal); assert_int_equal(0, info.full_width); assert_int_equal(0, info.text_width); assert_success(do_parse("{#val}")); assert_string_equal("val", info.literal); assert_int_equal(3, info.full_width); assert_int_equal(3, info.text_width); } TEST(fields_are_applied) { assert_success(do_parse("-3.2{#}...")); assert_int_equal(FILL_COLUMN_ID, info.column_id); assert_int_equal(AT_LEFT, info.align); assert_int_equal(ST_ABSOLUTE, info.sizing); assert_int_equal(3, info.full_width); assert_int_equal(2, info.text_width); assert_int_equal(CT_NONE, info.cropping); assert_success(do_parse("*10%{#}...")); assert_int_equal(FILL_COLUMN_ID, info.column_id); assert_int_equal(AT_DYN, info.align); assert_int_equal(ST_PERCENT, info.sizing); assert_int_equal(10, info.full_width); assert_int_equal(10, info.text_width); assert_int_equal(CT_NONE, info.cropping); } TEST(unicode, IF(utf8_locale)) { assert_success(do_parse("{#абвгд}")); assert_string_equal("абвгд", info.literal); assert_int_equal(5, info.full_width); assert_int_equal(5, info.text_width); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/viewcolumns_parser/syntax.c0000600000175000017500000000334215051153245016523 0ustar korykory#include #include #include "../../src/ui/column_view.h" #include "../../src/viewcolumns_parser.h" #include "test.h" TEST(simple_ok) { int result = do_parse("{name}"); assert_true(result == 0); } TEST(simple_no_braces_fails) { int result = do_parse("name"); assert_false(result == 0); } TEST(simple_wrong_name_fails) { int result = do_parse("{notname}"); assert_false(result == 0); } TEST(alignment_ok) { int result = do_parse("-{name}"); assert_true(result == 0); } TEST(alignment_fails) { int result = do_parse("+{name}"); assert_false(result == 0); } TEST(sizes_ok) { int result = do_parse("20{name}."); assert_true(result == 0); result = do_parse("-10{name}"); assert_true(result == 0); result = do_parse("10.2{name}"); assert_true(result == 0); result = do_parse("10%{name}"); assert_true(result == 0); } TEST(sizes_fails) { int result = do_parse("+20{name}."); assert_false(result == 0); result = do_parse("0{name}."); assert_false(result == 0); result = do_parse("10.{name}."); assert_false(result == 0); result = do_parse(".1{name}."); assert_false(result == 0); result = do_parse("%{name}."); assert_false(result == 0); } TEST(cropping_ok) { int result = do_parse("{name}."); assert_true(result == 0); result = do_parse("{name}.."); assert_true(result == 0); result = do_parse("{name}..."); assert_true(result == 0); } TEST(cropping_fails) { int result = do_parse("{name}...."); assert_false(result == 0); result = do_parse("{name}:"); assert_false(result == 0); } TEST(literals_ok) { assert_success(do_parse("{#}")); assert_success(do_parse("{#bla}")); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/viewcolumns_parser/suite.c0000600000175000017500000000132215051153245016322 0ustar korykory#include #include #include #include "../../src/ui/column_view.h" #include "../../src/viewcolumns_parser.h" #include "test.h" column_info_t info; DEFINE_SUITE(); static void add_column(columns_t *columns, column_info_t column_info) { free(info.literal); info = column_info; if(info.literal != NULL) { info.literal = strdup(info.literal); } } static int map_name(const char name[], void *arg) { (void)arg; return (strcmp(name, "name") == 0) ? 0 : -1; } int do_parse(const char *str) { return parse_columns(NULL, add_column, map_name, str, NULL); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/column_view/0000700000175000017500000000000015051153266013430 5ustar korykory./tests/column_view/align.c0000600000175000017500000001706115051153245014672 0ustar korykory#include #include /* NULL size_t */ #include /* snprintf() */ #include /* memcpy() */ #include "../../src/ui/column_view.h" #include "test.h" static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info); static void column1_func(void *data, size_t buf_len, char buf[], const format_info_t *info); static void column2_func(void *data, size_t buf_len, char buf[], const format_info_t *info); static const size_t MAX_WIDTH = 80; static size_t print_offset; static char print_buffer[800 + 1]; static AlignType last_align; SETUP() { print_next = &column_line_print; col1_next = &column1_func; } TEARDOWN() { print_next = NULL; col1_next = NULL; } static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info) { if(info->real_id == COL1_ID) { last_align = align; } print_offset = offset; memcpy(print_buffer + offset, buf, strlen(buf)); } static void column1_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } static void column2_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", "bxx"); } static void column1_func2(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", "abcdefg"); } static void perform_test(column_info_t column_info) { columns_t *const cols = columns_create(); columns_add_column(cols, column_info); columns_format_line(cols, NULL, MAX_WIDTH); columns_free(cols); } TEST(right_align) { static column_info_t column_info = { .column_id = COL1_ID, .full_width = 30UL, .text_width = 30UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }; perform_test(column_info); assert_int_equal(0, print_offset); } TEST(left_align) { static column_info_t column_info = { .column_id = COL1_ID, .full_width = 80UL, .text_width = 80UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }; perform_test(column_info); assert_int_equal(0, print_offset); } TEST(very_long_line_right_align) { static column_info_t column_info = { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_RIGHT, .sizing = ST_AUTO, .cropping = CT_NONE, }; static const char expected[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaa"; perform_test(column_info); assert_string_equal(expected, print_buffer); } TEST(truncation_on_right_align) { static column_info_t column_info = { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_RIGHT, .sizing = ST_AUTO, .cropping = CT_TRUNCATE, }; static const char expected[] = "g"; columns_t *const cols = columns_create(); col1_next = column1_func2; columns_add_column(cols, column_info); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 1); columns_free(cols); assert_string_equal(expected, print_buffer); } TEST(dyn_align) { static column_info_t column_info = { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_DYN, .sizing = ST_AUTO, .cropping = CT_TRUNCATE, }; columns_t *const cols = columns_create(); col1_next = column1_func2; columns_add_column(cols, column_info); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 8); assert_string_equal("abcdefg ", print_buffer); assert_int_equal(AT_LEFT, last_align); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 7); assert_string_equal("abcdefg", print_buffer); assert_int_equal(AT_LEFT, last_align); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 6); assert_string_equal("bcdefg", print_buffer); assert_int_equal(AT_RIGHT, last_align); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 4); assert_string_equal("defg", print_buffer); assert_int_equal(AT_RIGHT, last_align); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 2); assert_string_equal("fg", print_buffer); assert_int_equal(AT_RIGHT, last_align); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 1); assert_string_equal("g", print_buffer); assert_int_equal(AT_RIGHT, last_align); columns_free(cols); } TEST(dyn_align_on_the_right) { static column_info_t column_info1 = { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_RIGHT, .sizing = ST_AUTO, .cropping = CT_TRUNCATE, }; static column_info_t column_info2 = { .column_id = COL2_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_DYN, .sizing = ST_AUTO, .cropping = CT_TRUNCATE, }; columns_t *const cols = columns_create(); columns_add_column(cols, column_info1); columns_add_column(cols, column_info2); col2_next = &column1_func2; memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 8); assert_string_equal("aaaadefg", print_buffer); col1_next = &column1_func2; col2_next = &column2_func; memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 16); assert_string_equal(" abcdefgbxx ", print_buffer); col2_next = NULL; columns_free(cols); } TEST(middle_align) { static column_info_t column_info = { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_MIDDLE, .sizing = ST_AUTO, .cropping = CT_ELLIPSIS, }; columns_t *const cols = columns_create(); col1_next = column1_func2; columns_add_column(cols, column_info); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 8); assert_string_equal("abcdefg ", print_buffer); assert_int_equal(AT_LEFT, last_align); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 7); assert_string_equal("abcdefg", print_buffer); assert_int_equal(AT_LEFT, last_align); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 6); assert_string_equal("ab...g", print_buffer); assert_int_equal(AT_LEFT, last_align); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 5); assert_string_equal("a...g", print_buffer); assert_int_equal(AT_LEFT, last_align); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 4); assert_string_equal("a...", print_buffer); assert_int_equal(AT_LEFT, last_align); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 2); assert_string_equal("..", print_buffer); assert_int_equal(AT_LEFT, last_align); columns_free(cols); } TEST(middle_align_on_the_right) { static column_info_t column_info1 = { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_RIGHT, .sizing = ST_AUTO, .cropping = CT_TRUNCATE, }; static column_info_t column_info2 = { .column_id = COL2_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_MIDDLE, .sizing = ST_AUTO, .cropping = CT_TRUNCATE, }; columns_t *const cols = columns_create(); columns_add_column(cols, column_info1); columns_add_column(cols, column_info2); col2_next = &column1_func2; memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 10); assert_string_equal("aaaaaabcfg", print_buffer); col1_next = &column1_func2; col2_next = &column2_func; memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 16); assert_string_equal(" abcdefgbxx ", print_buffer); col2_next = NULL; columns_free(cols); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/column_view/general.c0000600000175000017500000000367015051153245015216 0ustar korykory#include #include /* NULL size_t */ #include "../../src/ui/column_view.h" #include "test.h" static void print_not_less_than_zero(const char buf[], int offset, AlignType align, const format_info_t *info); static void column12_func(void *data, size_t buf_len, char buf[], const format_info_t *info); static const int MAX_WIDTH = 80; static columns_t *columns; SETUP() { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 0, .text_width = 0, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 0, .text_width = 0, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, }; col1_next = &column12_func; col2_next = &column12_func; print_next = &print_not_less_than_zero; columns = columns_create(); columns_add_column(columns, column_infos[0]); columns_add_column(columns, column_infos[1]); } TEARDOWN() { print_next = NULL; col1_next = NULL; col2_next = NULL; columns_free(columns); } static void print_not_less_than_zero(const char buf[], int offset, AlignType align, const format_info_t *info) { assert_true(offset <= MAX_WIDTH); } static void column12_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { buf[0] = '\0'; } TEST(cant_add_columns_with_same_id) { assert_false(columns_add_column_desc(COL1_ID, NULL, NULL) == 0); assert_false(columns_add_column_desc(COL2_ID, NULL, NULL) == 0); } TEST(not_out_of_max_width) { columns_format_line(columns, NULL, MAX_WIDTH); } TEST(free_null_columns_ok) { columns_free(NULL); } TEST(add_duplicate_columns_ok) { static column_info_t column_info = { .column_id = COL1_ID, .full_width = 0, .text_width = 0, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }; columns_add_column(columns, column_info); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/column_view/test.h0000600000175000017500000000132315051153245014556 0ustar korykory#ifndef VIFM_TESTS__COLUMN_VIEW__TEST_H__ #define VIFM_TESTS__COLUMN_VIEW__TEST_H__ #include "../../src/ui/column_view.h" #define COL1_ID 1 #define COL2_ID 2 /* This is version of column_line_print_func with fewer number of parameters. * Omitted those which are provide additional information and are not very * valuable for tests. */ typedef void (*print_func)(const char buf[], int offset, AlignType align, const format_info_t *info); print_func print_next; column_line_match_func match_next; column_func col1_next; column_func col2_next; #endif /* VIFM_TESTS__COLUMN_VIEW__TEST_H__ */ /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/column_view/width.c0000600000175000017500000001225215051153245014714 0ustar korykory#include #include /* NULL size_t */ #include /* snprintf() */ #include /* memcpy() */ #include "../../src/ui/column_view.h" #include "test.h" static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info); static void column1_func(void *data, size_t buf_len, char buf[], const format_info_t *info); static void column2_func(void *data, size_t buf_len, char buf[], const format_info_t *info); static const size_t MAX_WIDTH = 20; static char print_buffer[20 + 1]; SETUP() { print_next = &column_line_print; col1_next = &column1_func; col2_next = &column2_func; } TEARDOWN() { print_next = NULL; col1_next = NULL; col2_next = NULL; } static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info) { memcpy(print_buffer + offset, buf, strlen(buf)); } static void column1_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", "aaaaayyyyyzzzzz"); } static void column2_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", "bbbbbcccccdddddeeeee"); } static void perform_test(column_info_t column_infos[2]) { columns_t *const cols = columns_create(); columns_add_column(cols, column_infos[0]); columns_add_column(cols, column_infos[1]); memset(print_buffer, ' ', MAX_WIDTH); columns_format_line(cols, NULL, MAX_WIDTH); columns_free(cols); } TEST(absolute_same_width) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 10UL, .text_width = 10UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, { .column_id = COL2_ID, .full_width = 10UL, .text_width = 10UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "aaaaayyyyydddddeeeee"; perform_test(column_infos); assert_string_equal(expected, print_buffer); } TEST(absolute_smaller_width) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 10UL, .text_width = 8UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, { .column_id = COL2_ID, .full_width = 10UL, .text_width = 5UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "aaaaayyy eeeee"; perform_test(column_infos); assert_string_equal(expected, print_buffer); } TEST(last_percent_column_gets_unused_space) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 25UL, .text_width = 0UL, .align = AT_LEFT, .sizing = ST_PERCENT, .cropping = CT_TRUNCATE, }, { .column_id = COL2_ID, .full_width = 50UL, .text_width = 0UL, .align = AT_LEFT, .sizing = ST_PERCENT, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "aaaaabbbbbcccccddddd"; perform_test(column_infos); assert_string_equal(expected, print_buffer); } TEST(auto_sizing) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, }; static const char expected[] = "aaaaayyyyybbbbbccccc"; perform_test(column_infos); assert_string_equal(expected, print_buffer); } TEST(no_space_for_auto_left_ok) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 20UL, .text_width = 20UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, }; static const char expected[] = "aaaaayyyyyzzzzz "; perform_test(column_infos); assert_string_equal(expected, print_buffer); } TEST(even_width) { static column_info_t column_infos[2] = { { .column_id = COL2_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_RIGHT, .sizing = ST_AUTO, .cropping = CT_NONE, }, }; static const char expected[] = "bbbbaaaaayyyyyzzzzz "; columns_t *const cols = columns_create(); columns_add_column(cols, column_infos[0]); columns_add_column(cols, column_infos[1]); memset(print_buffer, ' ', MAX_WIDTH - 1); columns_format_line(cols, NULL, MAX_WIDTH - 1); columns_free(cols); assert_string_equal(expected, print_buffer); } TEST(filling) { static column_info_t column_infos[1] = { { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, }; static const char expected[] = "aaaaayyyyyzzzzz "; columns_t *const cols = columns_create(); columns_add_column(cols, column_infos[0]); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, MAX_WIDTH); columns_free(cols); assert_string_equal(expected, print_buffer); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/column_view/cropping.c0000600000175000017500000002255415051153245015424 0ustar korykory#include #include /* NULL size_t */ #include /* snprintf() */ #include /* memcpy() */ #include "../../src/ui/column_view.h" #include "../../src/utils/macros.h" #include "test.h" static const size_t MAX_WIDTH = 40; static char print_buffer[40 + 1]; static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info); static void filler_print(const char buf[], int offset, AlignType align, const format_info_t *info); static void column1_func(void *data, size_t buf_len, char buf[], const format_info_t *info); static void column2_func(void *data, size_t buf_len, char buf[], const format_info_t *info); static void column_short_func(void *data, size_t buf_len, char buf[], const format_info_t *info); SETUP() { print_next = &column_line_print; col1_next = &column1_func; col2_next = &column2_func; } TEARDOWN() { print_next = NULL; col1_next = NULL; col2_next = NULL; } static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info) { memcpy(print_buffer + offset, buf, strlen(buf)); } static void filler_print(const char buf[], int offset, AlignType align, const format_info_t *info) { int buf_len = strlen(buf); memset(print_buffer + offset, '0' + info->real_id, buf_len); print_buffer[offset + buf_len] = '\0'; } static void column1_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", "aaaaaaaaaaaaaaazzzzzzzzzzzzzzz"); } static void column2_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); } static void column_short_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", "xxxxx"); } static void perform_test(column_info_t column_infos[], int n) { int i; columns_t *const cols = columns_create(); for(i = 0; i < n; ++i) { columns_add_column(cols, column_infos[i]); } memset(print_buffer, ' ', MAX_WIDTH); columns_format_line(cols, NULL, MAX_WIDTH); columns_free(cols); } TEST(none_align_left) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 15UL, .text_width = 15UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 35UL, .text_width = 35UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, }; static const char expected[] = "aaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbb"; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } TEST(ellipsis_align_left) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 15UL, .text_width = 15UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_ELLIPSIS, }, { .column_id = COL2_ID, .full_width = 35UL, .text_width = 35UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "aaaaaaaaaaaa...bbbbbbbbbbbbbbbbbbbbbbbbb"; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } TEST(truncating_align_left) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 15UL, .text_width = 15UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 35UL, .text_width = 35UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "aaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbb"; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } TEST(none_align_right) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 15UL, .text_width = 15UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 35UL, .text_width = 35UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, }; static const char expected[] = "aaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } TEST(none_align_right_overlapping) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_RIGHT, .sizing = ST_AUTO, .cropping = CT_NONE, }, }; static const char expected[] = "aaaaaaaaaaaaaaazzzzzzzzzzzzzzz xxxxx"; col2_next = column_short_func; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } TEST(no_overlapping) { static column_info_t column_infos[3] = { { .column_id = COL2_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_ELLIPSIS, }, { .column_id = COL2_ID, .full_width = 8UL, .text_width = 8UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 4UL, .text_width = 4UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, }; static const char expected[] = "xxxxx xxxxxxxxx"; col2_next = column_short_func; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } TEST(ellipsis_align_right) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 15UL, .text_width = 15UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_ELLIPSIS, }, { .column_id = COL2_ID, .full_width = 35UL, .text_width = 35UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "...zzzzzzzzzzzzbbbbbbbbbbbbbbbbbbbbbbbbb"; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } TEST(truncating_align_right) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 15UL, .text_width = 15UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 35UL, .text_width = 35UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "aaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbb"; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } TEST(ellipsis_less_space) { static column_info_t column_info = { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_ELLIPSIS, }; static const char expected[] = ".."; columns_t *const cols = columns_create(); columns_add_column(cols, column_info); memset(print_buffer, '\0', MAX_WIDTH); print_buffer[2] = '\0'; columns_format_line(cols, NULL, 2); columns_free(cols); assert_string_equal(expected, print_buffer); } TEST(filling_is_done_per_column) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 15UL, .text_width = 15UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 35UL, .text_width = 35UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "1111111111111112222222222222222222222222"; print_next = &filler_print; col1_next = column_short_func; col2_next = column_short_func; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } TEST(ellipsis_align_middle) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 15UL, .text_width = 15UL, .align = AT_MIDDLE, .sizing = ST_ABSOLUTE, .cropping = CT_ELLIPSIS, }, { .column_id = COL2_ID, .full_width = 35UL, .text_width = 35UL, .align = AT_MIDDLE, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "aaaaaa...zzzzzzbbbbbbbbbbbbbbbbbbbbbbbbb"; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } TEST(truncating_align_middle) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 15UL, .text_width = 15UL, .align = AT_MIDDLE, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 35UL, .text_width = 35UL, .align = AT_MIDDLE, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "aaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbb"; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } TEST(none_align_middle) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 15UL, .text_width = 15UL, .align = AT_MIDDLE, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 35UL, .text_width = 35UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_NONE, }, }; static const char expected[] = "aaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; perform_test(column_infos, ARRAY_LEN(column_infos)); assert_string_equal(expected, print_buffer); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/column_view/callbacks.c0000600000175000017500000000530115051153245015511 0ustar korykory#include #include /* NULL size_t */ #include "../../src/ui/column_view.h" #include "test.h" static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info); static void columns_func(void *data, size_t buf_len, char buf[], const format_info_t *info); static const size_t MAX_WIDTH = 80; static columns_t *columns; static int print_counter; static int column1_counter; static int column2_counter; static int column_width; SETUP() { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 100, .text_width = 100, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 100, .text_width = 100, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, }; print_next = &column_line_print; col1_next = &columns_func; col2_next = &columns_func; print_counter = 0; column1_counter = 0; column2_counter = 0; column_width = 0; columns = columns_create(); columns_add_column(columns, column_infos[0]); columns_add_column(columns, column_infos[1]); } TEARDOWN() { print_next = NULL; col1_next = NULL; col2_next = NULL; columns_free(columns); } static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info) { ++print_counter; } static void columns_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { if(info->id == COL1_ID) { ++column1_counter; } else { ++column2_counter; } column_width = info->width; buf[0] = '\0'; } TEST(no_columns_one_print_callback_after_creation) { columns_t *const cols = columns_create(); columns_format_line(cols, NULL, MAX_WIDTH); assert_int_equal(0, column1_counter); assert_int_equal(0, column2_counter); /* Gap filling callback. */ assert_int_equal(1, print_counter); columns_free(cols); } TEST(no_columns_one_print_callback_after_clearing) { columns_clear(columns); columns_format_line(columns, NULL, MAX_WIDTH); assert_int_equal(0, column1_counter); assert_int_equal(0, column2_counter); /* Gap filling callback. */ assert_int_equal(1, print_counter); } TEST(number_of_calls_to_format_functions) { columns_format_line(columns, NULL, MAX_WIDTH); assert_int_equal(1, column1_counter); assert_int_equal(1, column2_counter); } TEST(passed_in_width) { columns_format_line(columns, NULL, MAX_WIDTH); assert_int_equal(MAX_WIDTH/2, column_width); } TEST(number_of_calls_to_print_function) { columns_format_line(columns, NULL, MAX_WIDTH); /* Two more calls are for filling gaps. */ assert_int_equal(4, print_counter); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/column_view/literals.c0000600000175000017500000000240115051153245015407 0ustar korykory#include #include /* NULL size_t */ #include /* snprintf() */ #include /* memcpy() */ #include "../../src/ui/column_view.h" #include "test.h" static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info); static const size_t MAX_WIDTH = 80; static size_t print_offset; static char print_buffer[800 + 1]; SETUP() { print_next = &column_line_print; } TEARDOWN() { print_next = NULL; col1_next = NULL; } static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info) { print_offset = offset; memcpy(print_buffer + offset, buf, strlen(buf)); } TEST(literal_is_used) { static column_info_t column_info = { .column_id = FILL_COLUMN_ID, .full_width = 2UL, .text_width = 2UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, .literal = "abc" }; columns_t *const cols = columns_create(); columns_add_column(cols, column_info); memset(print_buffer, '\0', MAX_WIDTH); columns_format_line(cols, NULL, 10); assert_string_equal("bc ", print_buffer); columns_free(cols); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/column_view/utf8.c0000600000175000017500000002035015051153266014464 0ustar korykory#include #include /* setlocale() */ #include /* NULL size_t */ #include /* memcpy() */ #include "../../src/utils/utf8.h" #include "../../src/utils/utils.h" #include "../../src/ui/column_view.h" #include "test.h" static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info); static void column1_func(void *data, size_t buf_len, char buf[], const format_info_t *info); static void column2_func(void *data, size_t buf_len, char buf[], const format_info_t *info); static int locale_works(void); static const size_t MAX_WIDTH = 20; static char print_buffer[80 + 1]; static const char *col1_str; static const char *col2_str; SETUP_ONCE() { (void)setlocale(LC_ALL, ""); if(!locale_works()) { (void)setlocale(LC_ALL, "en_US.utf8"); } } SETUP() { print_next = &column_line_print; col1_next = &column1_func; col2_next = &column2_func; col1_str = "师从螺ä¸åˆ€Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑтуфхцчшщьыъÑÑŽÑ"; col2_str = "ÑÑŽÑъыьщшчцхфутÑрпонмлкйизжёедгв推"; } TEARDOWN() { print_next = NULL; col1_next = NULL; col2_next = NULL; } static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info) { memcpy(print_buffer + utf8_nstrsnlen(print_buffer, offset), buf, strlen(buf)); } static void column1_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", col1_str); } static void column2_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", col2_str); } static void perform_test(column_info_t column_infos[], size_t count, size_t max_width) { size_t i; columns_t *const cols = columns_create(); for(i = 0U; i < count; ++i) { columns_add_column(cols, column_infos[i]); } memset(print_buffer, '\0', sizeof(print_buffer)); columns_format_line(cols, NULL, max_width); columns_free(cols); } TEST(not_truncating_short_utf8_ok, IF(locale_works)) { static column_info_t column_infos[1] = { { .column_id = COL1_ID, .full_width = 33UL, .text_width = 33UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "师从螺ä¸åˆ€Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑтуфхцчшщьыъÑÑŽÑ "; perform_test(column_infos, 1, 40); assert_string_equal(expected, print_buffer); } TEST(donot_add_ellipsis_short_utf8_ok, IF(locale_works)) { static column_info_t column_infos[1] = { { .column_id = COL1_ID, .full_width = 33UL, .text_width = 33UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_ELLIPSIS, }, }; static const char expected[] = "师从螺ä¸åˆ€Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑтуфхцчшщьыъÑÑŽÑ "; perform_test(column_infos, 1, 40); assert_string_equal(expected, print_buffer); } TEST(truncating_ok, IF(locale_works)) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 10UL, .text_width = 10UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, { .column_id = COL2_ID, .full_width = 10UL, .text_width = 10UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }, }; static const char expected[] = "师从螺ä¸åˆ€Ð¸Ð·Ð¶Ñ‘едгв推"; perform_test(column_infos, 2, MAX_WIDTH); assert_string_equal(expected, print_buffer); } TEST(none_cropping_allows_for_correct_gaps, IF(locale_works)) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 10UL, .text_width = 10UL, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 4UL, .text_width = 4UL, .align = AT_RIGHT, .sizing = ST_AUTO, .cropping = CT_NONE, }, }; static const char expected[] = "师从 ÑÑŽÑъыьщшчцхфутÑрпонмлкйизжёедгв推"; perform_test(column_infos, 2, 38); assert_string_equal(expected, print_buffer); } TEST(none_cropping_cuts_wide_strings_correctly, IF(locale_works)) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 10UL, .text_width = 10UL, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, { .column_id = COL2_ID, .full_width = 4UL, .text_width = 4UL, .align = AT_RIGHT, .sizing = ST_AUTO, .cropping = CT_NONE, }, }; col1_str = "师从螺ä¸"; col2_str = "xyz"; perform_test(column_infos, 2, 9); assert_string_equal("师从螺xyz", print_buffer); perform_test(column_infos, 2, 10); assert_string_equal("师从螺 xyz", print_buffer); perform_test(column_infos, 2, 11); assert_string_equal("师从螺ä¸xyz", print_buffer); perform_test(column_infos, 2, 12); assert_string_equal("å¸ˆä»Žèžºä¸ xyz", print_buffer); } TEST(add_ellipsis_ok, IF(locale_works)) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 10UL, .text_width = 10UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_ELLIPSIS, }, { .column_id = COL2_ID, .full_width = 10UL, .text_width = 10UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_ELLIPSIS, }, }; static const char expected[] = "师从螺... ...ёедгв推"; perform_test(column_infos, 2, MAX_WIDTH); assert_string_equal(expected, print_buffer); } TEST(wide_ellipsis_work, IF(locale_works)) { static column_info_t column_infos[2] = { { .column_id = COL1_ID, .full_width = 10UL, .text_width = 10UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_ELLIPSIS, }, { .column_id = COL2_ID, .full_width = 10UL, .text_width = 10UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_ELLIPSIS, }, }; static const char expected[] = "师从螺ä¸â€¦ …зжёедгв推"; columns_set_ellipsis("…"); perform_test(column_infos, 2, MAX_WIDTH); assert_string_equal(expected, print_buffer); } TEST(filling, IF(locale_works)) { static column_info_t column_infos[1] = { { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_LEFT, .sizing = ST_AUTO, .cropping = CT_NONE, }, }; static const char expected[] = "师从螺ä¸åˆ€Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑтуфхцчшщьыъÑÑŽÑ "; columns_t *const cols = columns_create(); columns_add_column(cols, column_infos[0]); memset(print_buffer, '\0', 80); columns_format_line(cols, NULL, 40); columns_free(cols); assert_string_equal(expected, print_buffer); } TEST(right_filling, IF(locale_works)) { static column_info_t column_infos[1] = { { .column_id = COL2_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_RIGHT, .sizing = ST_AUTO, .cropping = CT_ELLIPSIS, }, }; static const char expected[] = "."; columns_t *const cols = columns_create(); columns_add_column(cols, column_infos[0]); memset(print_buffer, '\0', 80); columns_format_line(cols, NULL, 1); columns_free(cols); assert_string_equal(expected, print_buffer); } TEST(wide_right_ellipsis_ok, IF(locale_works)) { /* A gap might appear after removing several characters to insert ellipsis in * their place, make sure that it's filled with spaces to obtain requested * width. */ static column_info_t column_infos[1] = { { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_RIGHT, .sizing = ST_AUTO, .cropping = CT_ELLIPSIS, }, }; static const char expected[] = " ...螺ä¸åˆ€å¸ˆä»Žèžºä¸åˆ€"; col1_str = ",师从螺ä¸åˆ€å¸ˆä»Žèžºä¸åˆ€"; perform_test(column_infos, ARRAY_LEN(column_infos), MAX_WIDTH); assert_string_equal(expected, print_buffer); } TEST(wide_middle_ellipsis_ok, IF(locale_works)) { /* A gap might appear after removing several characters to insert ellipsis in * their place, make sure that it's filled with spaces to obtain requested * width. */ static column_info_t column_infos[1] = { { .column_id = COL1_ID, .full_width = 0UL, .text_width = 0UL, .align = AT_MIDDLE, .sizing = ST_AUTO, .cropping = CT_ELLIPSIS, }, }; static const char expected[] = ",,师从螺...从螺ä¸åˆ€ "; col1_str = ",,师从螺ä¸åˆ€å¸ˆä»Žèžºä¸åˆ€"; perform_test(column_infos, ARRAY_LEN(column_infos), MAX_WIDTH); assert_string_equal(expected, print_buffer); } static int locale_works(void) { return (vifm_wcwidth(L'ä¸') == 2); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/column_view/highlighting.c0000600000175000017500000001121315051153245016236 0ustar korykory#include #include /* NULL size_t */ #include /* snprintf() */ #include /* memcpy() memset() */ #include "../../src/ui/column_view.h" #include "../../src/utils/macros.h" #include "test.h" enum { MAX_WIDTH = 10 }; static void column_line_print(const char buf[], int offset, AlignType align, const format_info_t *info); static void column_line_match(const char full_column[], const format_info_t *info, int *match_from, int *match_to); static void column_five_as_zs(void *data, size_t buf_len, char buf[], const format_info_t *info); static void column_many_bs(void *data, size_t buf_len, char buf[], const format_info_t *info); static void perform_test(const column_info_t *column_info, const char printed[], const char highlighted[]); static char print_buffer[MAX_WIDTH + 1]; static char match_buffer[MAX_WIDTH + 1]; static int match_start, match_end; SETUP() { print_next = &column_line_print; match_next = &column_line_match; col1_next = &column_five_as_zs; col2_next = &column_many_bs; } TEARDOWN() { print_next = NULL; match_next = NULL; col1_next = NULL; col2_next = NULL; } TEST(match_fits) { static column_info_t column_info = { .column_id = COL1_ID, .full_width = 10UL, .text_width = 10UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }; match_start = 0, match_end = 5; perform_test(&column_info, "aaaaazzzzz", "***** "); match_start = 5, match_end = 10; perform_test(&column_info, "aaaaazzzzz", " *****"); match_start = 3, match_end = 8; perform_test(&column_info, "aaaaazzzzz", " ***** "); } TEST(match_on_the_right_cut_out) { static column_info_t column_info = { .column_id = COL1_ID, .full_width = 8UL, .text_width = 8UL, .align = AT_LEFT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }; match_start = 0, match_end = 5; perform_test(&column_info, "aaaaazzz ", "***** "); match_start = 5, match_end = 10; perform_test(&column_info, "aaaaa>>> ", " *** "); match_start = 3, match_end = 8; perform_test(&column_info, "aaaaazzz ", " ***** "); } TEST(match_on_the_left_cut_out) { static column_info_t column_info = { .column_id = COL1_ID, .full_width = 8UL, .text_width = 8UL, .align = AT_RIGHT, .sizing = ST_ABSOLUTE, .cropping = CT_TRUNCATE, }; match_start = 0, match_end = 5; perform_test(&column_info, "<<......match_from, '*', info->match_to - info->match_from); } static void column_line_match(const char full_column[], const format_info_t *info, int *match_from, int *match_to) { *match_from = match_start; *match_to = match_end; } static void column_five_as_zs(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", "aaaaazzzzz"); } static void column_many_bs(void *data, size_t buf_len, char buf[], const format_info_t *info) { snprintf(buf, buf_len + 1, "%s", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); } static void perform_test(const column_info_t *column_info, const char printed[], const char highlighted[]) { columns_t *const cols = columns_create(); columns_add_column(cols, *column_info); memset(print_buffer, ' ', MAX_WIDTH); memset(match_buffer, ' ', MAX_WIDTH); columns_format_line(cols, NULL, MAX_WIDTH); columns_free(cols); assert_string_equal(printed, print_buffer); assert_string_equal(highlighted, match_buffer); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/column_view/suite.c0000600000175000017500000000340015051153245014721 0ustar korykory#include #include /* NULL size_t */ #include "../../src/ui/column_view.h" #include "test.h" static void column_line_print(const char buf[], int offset, AlignType align, const char full_column[], const format_info_t *info); static void column_line_match(const char full_column[], const format_info_t *info, int *match_from, int *match_to); static void column1_func(void *data, size_t buf_len, char buf[], const format_info_t *info); static void column2_func(void *data, size_t buf_len, char buf[], const format_info_t *info); DEFINE_SUITE(); SETUP() { columns_set_ellipsis("..."); columns_set_line_print_func(&column_line_print); columns_set_line_match_func(&column_line_match); assert_int_equal(0, columns_add_column_desc(COL1_ID, &column1_func, NULL)); assert_int_equal(0, columns_add_column_desc(COL2_ID, &column2_func, NULL)); } TEARDOWN() { columns_clear_column_descs(); } static void column_line_print(const char buf[], int offset, AlignType align, const char full_column[], const format_info_t *info) { assert_non_null(print_next); print_next(buf, offset, align, info); } static void column_line_match(const char full_column[], const format_info_t *info, int *match_from, int *match_to) { if(match_next != NULL) { match_next(full_column, info, match_from, match_to); } } static void column1_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { assert_true(col1_next != NULL); col1_next(data, buf_len, buf, info); } static void column2_func(void *data, size_t buf_len, char buf[], const format_info_t *info) { assert_true(col2_next != NULL); col2_next(data, buf_len, buf, info); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/fuzz/0000700000175000017500000000000015051153245012074 5ustar korykory./tests/fuzz/in/0000700000175000017500000000000015051153245012502 5ustar korykory./tests/fuzz/in/vars/0000700000175000017500000000000015051153245013455 5ustar korykory./tests/fuzz/in/vars/let20000600000175000017500000000004315051153245014245 0ustar korykory$b = "this" ./tests/fuzz/in/vars/let10000600000175000017500000000000615051153245014243 0ustar korykory$a=10 ./tests/fuzz/in/vars/unlet10000600000175000017500000000000715051153245014607 0ustar korykory$qoqiq ./tests/fuzz/in/cmds/0000700000175000017500000000000015051153245013430 5ustar korykory./tests/fuzz/in/cmds/cmd10000600000175000017500000000011315051153245014174 0ustar korykoryautocmd DirEnter ~/downloads,~/downloads/torrents setlocal sort=-mtime,dir ./tests/fuzz/in/cmds/cmd20000600000175000017500000000053615051153245014206 0ustar korykorycommand! togglesort \ :if &sort == '-size,+name' \ | set sort=+mtime \ | echo 'Sorted by modification date' \ |elseif &sort == '+name' \ | set sort=-size \ | echo 'Sorted by size' \ |else \ | set sort=+name \ | echo 'Sorted by name' \ |endif ./tests/fuzz/in/keys/0000700000175000017500000000000015051153245013455 5ustar korykory./tests/fuzz/in/keys/keys10000600000175000017500000000001315051153245014430 0ustar korykory33jj2kj44G ./tests/fuzz/in/keys/keys20000600000175000017500000000002015051153245014427 0ustar korykory2994j:stuff ./tests/fuzz/in/matchers/0000700000175000017500000000000015051153245014310 5ustar korykory./tests/fuzz/in/matchers/regex0000600000175000017500000000021415051153245015344 0ustar korykory/\.(7z|Z|a|ace|alz|apkg|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lrz|lz|lzma|lzo|rar|rpm|rz|t7z|tZ|tar|tbz|tbz2|tgz|tlz|txz|tzo|war|xz|zip)$/ ./tests/fuzz/in/matchers/list-of-globs0000600000175000017500000000004515051153245016715 0ustar korykory*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm ./tests/fuzz/in/matchers/path-regex0000600000175000017500000000005215051153245016276 0ustar korykory///home/xaizek/archive/articles/.*\.pdf// ./tests/fuzz/in/opts/0000700000175000017500000000000015051153245013467 5ustar korykory./tests/fuzz/in/opts/opt0000600000175000017500000000004615051153245014216 0ustar korykoryinvopt opt! opt=val opt=11 opt? noopt ./tests/fuzz/suite.c0000600000175000017500000002067215051153245013402 0ustar korykory#include #include #include #include #include "../../src/engine/cmds.h" #include "../../src/engine/keys.h" #include "../../src/engine/mode.h" #include "../../src/engine/options.h" #include "../../src/engine/variables.h" #include "../../src/modes/wk.h" #include "../../src/utils/macros.h" #include "../../src/utils/matchers.h" #include "../../src/utils/str.h" #include "../../src/utils/string_array.h" static int fuzz_options(const char input[]); static int fuzz_variables(const char input[]); static int fuzz_keys(const char input[]); static int fuzz_commands(const char input[]); static int fuzz_matchers(const char input[]); static void load_options(void); static void dummy_handler(OPT_OP op, optval_t val); static int complete_args(int id, const cmd_info_t *cmd_info, int arg_pos, void *extra_arg); static int swap_range(void); static int resolve_mark(char mark); static char * expand_macros(const char str[], int for_shell, int *usr1, int *usr2); static char * expand_envvars(const char *str); static int dummy_cmd(const cmd_info_t *cmd_info); static void post(int id); static void select_range(int id, const cmd_info_t *cmd_info); static int skip_at_beginning(int id, const char *args); static char * input(void) { size_t input_len; return read_nonseekable_stream(stdin, &input_len, NULL, NULL); } int main(int argc, char *argv[]) { if(argc != 2) { puts("Usage: test-kind-name"); return EXIT_FAILURE; } if(strcmp(argv[1], "options") == 0) { return fuzz_options(input()); } if(strcmp(argv[1], "variables") == 0) { return fuzz_variables(input()); } if(strcmp(argv[1], "keys") == 0) { return fuzz_keys(input()); } if(strcmp(argv[1], "commands") == 0) { return fuzz_commands(input()); } if(strcmp(argv[1], "matchers") == 0) { return fuzz_matchers(input()); } puts("Unknown test-kind-name"); return EXIT_FAILURE; } static int fuzz_options(const char input[]) { static int option_changed; const char *start; vle_opts_init(&option_changed, NULL); vle_opts_set(input, OPT_ANY); vle_opts_complete(input, &start, OPT_GLOBAL); load_options(); vle_opts_set(input, OPT_ANY); vle_opts_complete(input, &start, OPT_GLOBAL); return EXIT_SUCCESS; } static int fuzz_variables(const char input[]) { const char *start; init_variables(); let_variables(input); unlet_variables(input); complete_variables(input, &start); clear_variables(); clear_envvars(); return EXIT_SUCCESS; } static void keys_dummy(key_info_t key_info, keys_info_t *keys_info) { /* Do nothing. */ } static void silence(int more) { /* Do nothing. */ } static int fuzz_keys(const char input[]) { static int mode_flags[] = { MF_USES_REGS | MF_USES_COUNT, MF_USES_INPUT, MF_USES_COUNT }; static keys_add_info_t normal_cmds[] = { {WK_COLON, {{&keys_dummy}}}, {WK_m, {{&keys_dummy}, FOLLOWED_BY_MULTIKEY}}, {WK_QUOTE, {{&keys_dummy}, FOLLOWED_BY_MULTIKEY}}, {WK_H, {{&keys_dummy}}}, {WK_g WK_u, {{&keys_dummy}, FOLLOWED_BY_SELECTOR}}, {WK_g WK_u WK_u, {{&keys_dummy}}}, {WK_g WK_u WK_g WK_u, {{&keys_dummy}}}, {WK_g WK_u WK_g WK_g, {{&keys_dummy}, .skip_suggestion = 1}}, {WK_j, {{&keys_dummy}}}, {WK_k, {{&keys_dummy}}}, {WK_i, {{&keys_dummy}}}, {WK_C_w WK_LT, {{&keys_dummy}, .nim = 1}}, {WK_d, {{&keys_dummy}, FOLLOWED_BY_SELECTOR}}, {WK_d WK_d, {{&keys_dummy}, .nim = 1}}, {WK_v, {{&keys_dummy}}}, {WK_y, {{&keys_dummy}, FOLLOWED_BY_SELECTOR}}, {WK_Z WK_Q, {{&keys_dummy}}}, {WK_Z WK_Z, {{&keys_dummy}}}, {WK_n WK_o WK_r WK_m, {{&keys_dummy}}}, }; static keys_add_info_t normal_selectors[] = { {WK_g WK_g, {{&keys_dummy}}}, {WK_QUOTE, {{&keys_dummy}, FOLLOWED_BY_MULTIKEY}}, }; static keys_add_info_t visual_cmds[] = { {WK_j, {{&keys_dummy}}}, {WK_k, {{&keys_dummy}}}, {WK_v, {{&keys_dummy}}}, {WK_Z WK_Z, {{&keys_dummy}}}, }; static keys_add_info_t common_selectors[] = { {WK_j, {{&keys_dummy}}}, {WK_k, {{&keys_dummy}}}, {WK_s, {{&keys_dummy}}}, {WK_i WK_f, {{&keys_dummy}}}, }; wchar_t *winput = to_wide_force(input); vle_keys_init(3, mode_flags, &silence); vle_mode_set(0, VMT_PRIMARY); vle_keys_add(normal_cmds, ARRAY_LEN(normal_cmds), 0); vle_keys_add(visual_cmds, ARRAY_LEN(visual_cmds), 1); vle_keys_add_selectors(common_selectors, ARRAY_LEN(common_selectors), 0); vle_keys_add_selectors(normal_selectors, ARRAY_LEN(normal_selectors), 0); vle_keys_add_selectors(common_selectors, ARRAY_LEN(common_selectors), 1); vle_mode_set(0, VMT_PRIMARY); vle_keys_exec(winput); vle_keys_exec_no_remap(winput); vle_keys_exec_timed_out(winput); vle_keys_exec_timed_out_no_remap(winput); vle_keys_user_exists(winput, 0); vle_keys_user_add(winput, winput, 0, KEYS_FLAG_NOREMAP); vle_keys_user_exists(winput, 0); vle_keys_user_remove(winput, 0); vle_mode_set(1, VMT_PRIMARY); vle_keys_exec(winput); vle_keys_exec_no_remap(winput); vle_keys_exec_timed_out(winput); vle_keys_exec_timed_out_no_remap(winput); vle_keys_user_exists(winput, 1); vle_keys_user_add(winput, winput, 1, KEYS_FLAG_NOREMAP); vle_keys_user_exists(winput, 1); vle_keys_user_remove(winput, 1); return EXIT_SUCCESS; } static int fuzz_commands(const char input[]) { static cmds_conf_t cmds_conf = { .complete_args = &complete_args, .swap_range = &swap_range, .resolve_mark = &resolve_mark, .expand_macros = &expand_macros, .expand_envvars = &expand_envvars, .post = &post, .select_range = &select_range, .skip_at_beginning = &skip_at_beginning, }; cmd_add_t commands[] = { { .name = "", .abbr = NULL, .id = -1, .descr = "descr", .flags = HAS_RANGE, .handler = &dummy_cmd, .min_args = 0, .max_args = 0, }, { .name = "", .abbr = NULL, .id = -1, .descr = "descr", .flags = HAS_RANGE, .handler = &dummy_cmd, .min_args = 0, .max_args = 0, }, { .name = "delete", .abbr = "d", .id = -1, .descr = "descr", .flags = HAS_EMARK | HAS_RANGE, .handler = &dummy_cmd, .min_args = 0, .max_args = 1, }, }; cmds_conf.begin = 10; cmds_conf.current = 50; cmds_conf.end = 100; vle_cmds_init(1, &cmds_conf); vle_cmds_add(commands, 3); vle_cmds_run(input); vle_cmds_reset(); return EXIT_SUCCESS; } static int fuzz_matchers(const char input[]) { char *error = NULL; matchers_t *ms; ms = matchers_alloc(input, 0, 0, "", &error); free(error); matchers_free(ms); ms = matchers_alloc(input, 0, 1, "", &error); free(error); matchers_free(ms); ms = matchers_alloc(input, 1, 0, "", &error); free(error); matchers_free(ms); ms = matchers_alloc(input, 1, 1, "", &error); free(error); matchers_free(ms); return EXIT_SUCCESS; } static void load_options(void) { optval_t val; static const char *sort_enum[][2] = { { "ext", "descr" }, { "name", "descr" }, { "gid", "descr" }, { "gname", "descr" }, }; val.str_val = ""; vle_opts_add("cdpath", "cd", "descr", OPT_STRLIST, OPT_GLOBAL, 0, NULL, dummy_handler, val); val.bool_val = 0; vle_opts_add("fastrun", "fr", "descr", OPT_BOOL, OPT_GLOBAL, 0, NULL, dummy_handler, val); val.str_val = "fusehome-default"; vle_opts_add("fusehome", "fh", "descr", OPT_STR, OPT_GLOBAL, 0, NULL, dummy_handler, val); val.enum_item = 1; vle_opts_add("sort", "so", "descr", OPT_ENUM, OPT_GLOBAL, ARRAY_LEN(sort_enum), sort_enum, &dummy_handler, val); val.bool_val = 1; vle_opts_add("sortorder", "", "descr", OPT_BOOL, OPT_GLOBAL, 0, NULL, &dummy_handler, val); } static void dummy_handler(OPT_OP op, optval_t val) { } static int complete_args(int id, const cmd_info_t *cmd_info, int arg_pos, void *extra_arg) { return 0; } static int swap_range(void) { return 1; } static int resolve_mark(char mark) { if(isdigit(mark)) return -1; return 75; } static char * expand_macros(const char str[], int for_shell, int *usr1, int *usr2) { return strdup(str); } static char * expand_envvars(const char *str) { return strdup(str); } static int dummy_cmd(const cmd_info_t *cmd_info) { return 0; } static void post(int id) { } static void select_range(int id, const cmd_info_t *cmd_info) { } static int skip_at_beginning(int id, const char *args) { return -1; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/filetype/0000700000175000017500000000000015051153245012717 5ustar korykory./tests/filetype/regexps.c0000600000175000017500000000114715051153245014545 0ustar korykory#include #include #include "../../src/filetype.h" #include "../../src/status.h" #include "test.h" TEST(regexp) { const char *prog_cmd; set_programs("/.*\\.[ch]$/", "c file", 0, 0); assert_null(ft_get_program("main.cpp")); assert_null(ft_get_program("main.hpp")); assert_non_null(prog_cmd = ft_get_program("main.c")); assert_string_equal("c file", prog_cmd); assert_non_null(prog_cmd = ft_get_program("main.h")); assert_string_equal("c file", prog_cmd); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/filetype/classes.c0000600000175000017500000000324215051153245014523 0ustar korykory#include #include #include "../../src/filetype.h" #include "../../src/status.h" #include "test.h" TEST(enumeration) { const char *prog_cmd; set_programs("*.[ch]", "c file", 0, 0); assert_true((prog_cmd = ft_get_program("main.cpp")) == NULL); assert_true((prog_cmd = ft_get_program("main.hpp")) == NULL); assert_true((prog_cmd = ft_get_program("main.c")) != NULL); assert_string_equal("c file", prog_cmd); assert_true((prog_cmd = ft_get_program("main.h")) != NULL); assert_string_equal("c file", prog_cmd); } TEST(negation_with_emark) { const char *prog_cmd; set_programs("*.[!ch]", "not c file", 0, 0); assert_false((prog_cmd = ft_get_program("main.c")) != NULL); assert_false((prog_cmd = ft_get_program("main.h")) != NULL); assert_true((prog_cmd = ft_get_program("main.o")) != NULL); assert_string_equal("not c file", prog_cmd); } TEST(negation_with_hat) { const char *prog_cmd; set_programs("*.[^ch]", "not c file", 0, 0); assert_false((prog_cmd = ft_get_program("main.c")) != NULL); assert_false((prog_cmd = ft_get_program("main.h")) != NULL); assert_true((prog_cmd = ft_get_program("main.o")) != NULL); assert_string_equal("not c file", prog_cmd); } TEST(ranges) { const char *prog_cmd; set_programs("*.[0-9]", "part file", 0, 0); assert_false((prog_cmd = ft_get_program("main.A")) != NULL); assert_true((prog_cmd = ft_get_program("main.0")) != NULL); assert_string_equal("part file", prog_cmd); assert_true((prog_cmd = ft_get_program("main.8")) != NULL); assert_string_equal("part file", prog_cmd); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/filetype/description.c0000600000175000017500000000345115051153245015413 0ustar korykory#include #include #include "../../src/filetype.h" #include "../../src/status.h" #include "test.h" TEST(one_pattern) { assoc_records_t ft; set_programs("*.tar", "{description} tar prog", 0, 0); ft = ft_get_all_programs("file.version.tar"); assert_int_equal(1, ft.count); assert_true(ft.list[0].command != NULL); assert_string_equal("description", ft.list[0].description); ft_assoc_records_free(&ft); } TEST(double_comma_in_description) { assoc_records_t ft; set_programs("*.tar", "{description,,is,,here} tar prog", 0, 0); ft = ft_get_all_programs("file.version.tar"); assert_int_equal(1, ft.count); assert_string_equal("description,is,here", ft.list[0].description); ft_assoc_records_free(&ft); } TEST(two_patterns) { assoc_records_t ft; set_programs("*.tar,*.zip", "{archives} prog", 0, 0); { ft = ft_get_all_programs("file.version.tar"); assert_int_equal(1, ft.count); assert_true(ft.list[0].command != NULL); assert_string_equal("archives", ft.list[0].description); ft_assoc_records_free(&ft); } { ft = ft_get_all_programs("file.version.zip"); assert_int_equal(1, ft.count); assert_true(ft.list[0].command != NULL); assert_string_equal("archives", ft.list[0].description); ft_assoc_records_free(&ft); } } TEST(two_programs) { assoc_records_t ft; set_programs("*.tar", "{rar} rarprog, {zip} zipprog", 0, 0); ft = ft_get_all_programs("a.tar"); assert_int_equal(2, ft.count); assert_string_equal(ft.list[0].command, "rarprog"); assert_string_equal(ft.list[0].description, "rar"); assert_string_equal(ft.list[1].command, "zipprog"); assert_string_equal(ft.list[1].description, "zip"); ft_assoc_records_free(&ft); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/filetype/viewers.c0000600000175000017500000000732615051153245014561 0ustar korykory#include #include #include #include "../../src/int/file_magic.h" #include "../../src/filetype.h" #include "../../src/status.h" #include "../../src/utils/str.h" #include "../../src/utils/string_array.h" #include "test.h" static int prog1_available(const char name[]) { return stroscmp(name, "prog1") == 0; } static int prog2_available(const char name[]) { return stroscmp(name, "prog2") == 0; } static int nothing_available(const char name[]) { return 0; } TEST(null_if_nothing_set) { assert_true(ft_get_viewer("file.version.tar.bz2") == NULL); } TEST(multiple_choice_separated) { const char *viewer; set_viewers("*.tar.bz2", "prog1"); set_viewers("*.tar.bz2", "prog2"); ft_init(&prog1_available); viewer = ft_get_viewer("file.version.tar.bz2"); assert_string_equal("prog1", viewer); ft_init(&prog2_available); viewer = ft_get_viewer("file.version.tar.bz2"); assert_string_equal("prog2", viewer); ft_init(¬hing_available); viewer = ft_get_viewer("file.version.tar.bz2"); assert_true(viewer == NULL); } TEST(multiple_choice_joined) { const char *viewer; set_viewers("*.tar.bz2", "prog1,prog2"); ft_init(&prog1_available); viewer = ft_get_viewer("file.version.tar.bz2"); assert_string_equal("prog1", viewer); ft_init(&prog2_available); viewer = ft_get_viewer("file.version.tar.bz2"); assert_string_equal("prog2", viewer); ft_init(¬hing_available); viewer = ft_get_viewer("file.version.tar.bz2"); assert_true(viewer == NULL); } TEST(description_is_not_allowed) { const char *viewer; set_viewers("*.tar.bz2", "{archives} prog1"); ft_init(&prog1_available); viewer = ft_get_viewer("file.version.tar.bz2"); assert_true(viewer == NULL); } TEST(several_patterns) { set_viewers("*.tbz,*.tbz2,*.tar.bz2", "prog1"); ft_init(&prog1_available); assert_true(ft_get_viewer("file.version.tbz") != NULL); assert_true(ft_get_viewer("file.version.tbz2") != NULL); assert_true(ft_get_viewer("file.version.tar.bz2") != NULL); } TEST(multiple_viewers) { set_viewers("*.tbz", "prog1 a"); set_viewers("*.tba", "prog2 a"); set_viewers("*.tbz", "prog2 b"); set_viewers("*.tbz", "prog1 b"); ft_init(&prog1_available); strlist_t viewers = ft_get_viewers("a.tbz"); assert_int_equal(2, viewers.nitems); assert_string_equal("prog1 a", viewers.items[0]); assert_string_equal("prog1 b", viewers.items[1]); free_string_array(viewers.items, viewers.nitems); } TEST(pattern_list, IF(has_mime_type_detection)) { char cmd[1024]; snprintf(cmd, sizeof(cmd), "<%s>{binary-data}", get_mimetype(TEST_DATA_PATH "/read/binary-data", 0)); set_viewers(cmd, "prog1"); ft_init(&prog1_available); assert_string_equal("prog1", ft_get_viewer(TEST_DATA_PATH "/read/binary-data")); } TEST(viewer_kind) { assert_int_equal(VK_TEXTUAL, ft_viewer_kind(NULL)); assert_int_equal(VK_TEXTUAL, ft_viewer_kind("")); assert_int_equal(VK_TEXTUAL, ft_viewer_kind("cat")); assert_int_equal(VK_TEXTUAL, ft_viewer_kind("cat %c")); assert_int_equal(VK_TEXTUAL, ft_viewer_kind("echo %px")); assert_int_equal(VK_TEXTUAL, ft_viewer_kind("echo %py")); assert_int_equal(VK_GRAPHICAL, ft_viewer_kind("echo %px %py")); assert_int_equal(VK_GRAPHICAL, ft_viewer_kind("echo %px %py %ph %pw")); assert_int_equal(VK_TEXTUAL, ft_viewer_kind("echo %%px %%py")); assert_int_equal(VK_TEXTUAL, ft_viewer_kind("echo %%px %%py %%ph %%pw")); assert_int_equal(VK_PASS_THROUGH, ft_viewer_kind("echo %pd")); assert_int_equal(VK_PASS_THROUGH, ft_viewer_kind("echo %px %py %pw %ph %pd")); assert_int_equal(VK_TEXTUAL, ft_viewer_kind("echo %%pd")); assert_int_equal(VK_GRAPHICAL, ft_viewer_kind("echo %px %py %pw %ph %%pd")); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/filetype/find_program.c0000600000175000017500000000127315051153245015537 0ustar korykory#include #include #include #include "../../src/filetype.h" #include "../../src/utils/str.h" #include "test.h" static int prog_exists(const char name[]); TEST(find_program) { const char *prog_cmd; ft_init(&prog_exists); set_programs("*.tar.bz2", "no console prog", 0, 0); set_programs("*.tar.bz2", "console prog", 0, 0); assert_true((prog_cmd = ft_get_program("file.version.tar.bz2")) != NULL); assert_string_equal("console prog", prog_cmd); } static int prog_exists(const char name[]) { return stroscmp(name, "console") == 0; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/filetype/test.h0000600000175000017500000000073215051153245014053 0ustar korykory#ifndef VIFM_TESTS__FILETYPE__TEST_H__ #define VIFM_TESTS__FILETYPE__TEST_H__ #include "../../src/ui/column_view.h" void set_programs(const char pattern[], const char programs[], int for_x, int in_x); void set_viewers(const char pattern[], const char viewers[]); int has_mime_type_detection(void); #endif /* VIFM_TESTS__FILETYPE__TEST_H__ */ /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/filetype/filetype.c0000600000175000017500000001022615051153245014707 0ustar korykory#include #include #include "../../src/int/file_magic.h" #include "../../src/filetype.h" #include "../../src/status.h" #include "test.h" TEST(one_pattern) { const char *prog_cmd; set_programs("*.tar", "tar prog", 0, 0); assert_true((prog_cmd = ft_get_program("file.version.tar")) != NULL); assert_string_equal("tar prog", prog_cmd); } TEST(many_pattern) { const char *prog_cmd; set_programs("*.tar", "tar prog", 0, 0); set_programs("*.tar.gz", "tar.gz prog", 0, 0); assert_true((prog_cmd = ft_get_program("file.version.tar.gz")) != NULL); assert_string_equal("tar.gz prog", prog_cmd); } TEST(many_filepattern) { const char *prog_cmd; set_programs("*.tgz,*.tar.gz", "tar.gz prog", 0, 0); assert_true((prog_cmd = ft_get_program("file.version.tar.gz")) != NULL); assert_string_equal("tar.gz prog", prog_cmd); } TEST(dont_match_hidden) { set_programs("*.tgz,*.tar.gz", "tar.gz prog", 0, 0); assert_null(ft_get_program(".file.version.tar.gz")); } TEST(match_empty) { const char *prog_cmd; set_programs("a*bc", "empty prog", 0, 0); assert_true((prog_cmd = ft_get_program("abc")) != NULL); assert_string_equal("empty prog", prog_cmd); } TEST(match_full_line) { const char *prog_cmd; set_programs("abc", "full prog", 0, 0); assert_true((prog_cmd = ft_get_program("abcd")) == NULL); assert_true((prog_cmd = ft_get_program("0abc")) == NULL); assert_true((prog_cmd = ft_get_program("0abcd")) == NULL); assert_true((prog_cmd = ft_get_program("abc")) != NULL); assert_string_equal("full prog", prog_cmd); } TEST(match_qmark) { const char *prog_cmd; set_programs("a?c", "full prog", 0, 0); assert_true((prog_cmd = ft_get_program("ac")) == NULL); assert_true((prog_cmd = ft_get_program("abc")) != NULL); assert_string_equal("full prog", prog_cmd); } TEST(qmark_escaping) { const char *prog_cmd; set_programs("a\\?c", "qmark prog", 0, 0); assert_true((prog_cmd = ft_get_program("abc")) == NULL); assert_true((prog_cmd = ft_get_program("a?c")) != NULL); assert_string_equal("qmark prog", prog_cmd); } TEST(star_escaping) { const char *prog_cmd; set_programs("a\\*c", "star prog", 0, 0); assert_true((prog_cmd = ft_get_program("abc")) == NULL); assert_true((prog_cmd = ft_get_program("a*c")) != NULL); assert_string_equal("star prog", prog_cmd); } TEST(star_and_dot) { const char *prog_cmd; set_programs(".xls,*.doc", "libreoffice", 0, 0); assert_true((prog_cmd = ft_get_program("a.doc")) != NULL); assert_string_equal("libreoffice", prog_cmd); assert_true((prog_cmd = ft_get_program(".a.doc")) == NULL); assert_true((prog_cmd = ft_get_program(".doc")) == NULL); set_programs(".*.doc", "hlibreoffice", 0, 0); assert_true((prog_cmd = ft_get_program(".a.doc")) != NULL); assert_string_equal("hlibreoffice", prog_cmd); } TEST(double_comma_in_command) { const char *prog_cmd; set_programs("*.tar", "prog -o opt1,,opt2", 0, 0); assert_true((prog_cmd = ft_get_program("file.version.tar")) != NULL); assert_string_equal("prog -o opt1,opt2", prog_cmd); set_programs("*.zip", "prog1 -o opt1, prog2", 0, 0); assert_true((prog_cmd = ft_get_program("file.version.zip")) != NULL); assert_string_equal("prog1 -o opt1", prog_cmd); } TEST(double_comma_in_pattern) { set_programs("a,,b,*.tar", "prog1", 0, 0); assert_string_equal("prog1", ft_get_program("a,b")); assert_string_equal("prog1", ft_get_program("file.version.tar")); set_programs("{c,,d}", "prog2", 0, 0); assert_string_equal("prog2", ft_get_program("c,d")); } TEST(zero_length_match) { /* This is confirmation of limitation of globs->regex transition. There is a * complication for list of globs, so it's left with somewhat incorrect * behaviour. */ const char *prog_cmd; set_programs("*git", "tig", 0, 0); assert_null(prog_cmd = ft_get_program("git")); } TEST(pattern_list, IF(has_mime_type_detection)) { char cmd[1024]; snprintf(cmd, sizeof(cmd), "<%s>{binary-data}", get_mimetype(TEST_DATA_PATH "/read/binary-data", 0)); set_programs(cmd, "prog", 0, 0); assert_string_equal("prog", ft_get_program(TEST_DATA_PATH "/read/binary-data")); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/filetype/filextype.c0000600000175000017500000000301615051153245015076 0ustar korykory#include #include #include "../../src/filetype.h" #include "../../src/status.h" #include "test.h" TEST(one_console_prog) { const char *prog_cmd; set_programs("*.tar", "x prog", 1, 0); set_programs("*.tar", "console prog", 0, 0); assert_true((prog_cmd = ft_get_program("file.version.tar")) != NULL); assert_string_equal("console prog", prog_cmd); } TEST(one_graphic_prog) { const char *prog_cmd; set_programs("*.tar", "x prog", 1, 1); set_programs("*.tar", "console prog", 0, 1); assert_true((prog_cmd = ft_get_program("file.version.tar")) != NULL); assert_string_equal("x prog", prog_cmd); } TEST(two_console_prog) { set_programs("*.tgz", "2 x prog", 1, 0); assert_null(ft_get_program("file.version.tgz")); } TEST(two_graphic_prog) { const char *prog_cmd; set_programs("*.tgz", "2 x prog", 1, 1); assert_true((prog_cmd = ft_get_program("file.version.tgz")) != NULL); assert_string_equal("2 x prog", prog_cmd); } TEST(three_console_prog) { const char *prog_cmd; set_programs("*.tar.bz2", "3 console prog", 0, 1); assert_true((prog_cmd = ft_get_program("file.version.tar.bz2")) != NULL); assert_string_equal("3 console prog", prog_cmd); } TEST(three_graphic_prog) { const char *prog_cmd; set_programs("*.tar.bz2", "3 console prog", 0, 0); assert_true((prog_cmd = ft_get_program("file.version.tar.bz2")) != NULL); assert_string_equal("3 console prog", prog_cmd); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/filetype/test.c0000600000175000017500000000150315051153245014043 0ustar korykory#include "test.h" #include "../../src/int/file_magic.h" #include "../../src/utils/matchers.h" #include "../../src/filetype.h" void set_programs(const char pattern[], const char programs[], int for_x, int in_x) { char *error; matchers_t *ms; assert_non_null(ms = matchers_alloc(pattern, 0, 1, "", &error)); assert_null(error); ft_set_programs(ms, programs, for_x, in_x); } void set_viewers(const char pattern[], const char viewers[]) { char *error; matchers_t *ms; assert_non_null(ms = matchers_alloc(pattern, 0, 1, "", &error)); assert_null(error); ft_set_viewers(ms, viewers); } int has_mime_type_detection(void) { return get_mimetype(TEST_DATA_PATH "/read/dos-line-endings", 0) != NULL; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/filetype/assocs.c0000600000175000017500000000141015051153245014354 0ustar korykory#include #include "../../src/filetype.h" TEST(cannot_add_single_duplicate) { assoc_records_t assocs = {}; ft_assoc_record_add(&assocs, "cmd", "descr"); ft_assoc_record_add(&assocs, "cmd", "descr"); assert_int_equal(1, assocs.count); ft_assoc_records_free(&assocs); } TEST(cannot_add_multiple_duplicates) { assoc_records_t assocs = {}; ft_assoc_record_add(&assocs, "cmd1", "descr"); ft_assoc_record_add(&assocs, "cmd2", "descr"); ft_assoc_record_add(&assocs, "cmd3", "descr1"); ft_assoc_record_add(&assocs, "cmd3", "descr2"); ft_assoc_record_add_all(&assocs, &assocs); assert_int_equal(4, assocs.count); ft_assoc_records_free(&assocs); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */ ./tests/filetype/suite.c0000600000175000017500000000037415051153245014222 0ustar korykory#include #include "../../src/filetype.h" DEFINE_SUITE(); SETUP() { ft_init(NULL); } TEARDOWN() { ft_reset(0); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/autocmds/0000700000175000017500000000000015051153245012715 5ustar korykory./tests/autocmds/list.c0000600000175000017500000000432515051153245014042 0ustar korykory#include #include /* NULL */ #include "../../src/engine/autocmds.h" static void dummy_handler(const char action[], void *arg); static void list_handler(const char event[], const char pattern[], int negated, const char action[], void *arg); static int count; TEARDOWN() { count = 0; } TEST(callback_not_invoked_for_no_entries) { vle_aucmd_list(NULL, NULL, &list_handler, NULL); assert_int_equal(0, count); } TEST(particular_event_is_listed) { assert_success(vle_aucmd_on_execute("cd", "/path", "action", &dummy_handler)); assert_success(vle_aucmd_on_execute("cd", "/pat", "action", &dummy_handler)); assert_success(vle_aucmd_on_execute("go", "/pat", "action", &dummy_handler)); vle_aucmd_list("cd", NULL, &list_handler, NULL); assert_int_equal(2, count); } TEST(particular_pattern_is_listed) { assert_success(vle_aucmd_on_execute("cd", "/path", "action", &dummy_handler)); assert_success(vle_aucmd_on_execute("cd", "/path", "action", &dummy_handler)); assert_success(vle_aucmd_on_execute("cd", "/pat", "action", &dummy_handler)); assert_success(vle_aucmd_on_execute("go", "/pat", "action", &dummy_handler)); vle_aucmd_list("cd", "/path", &list_handler, NULL); assert_int_equal(2, count); } TEST(multiple_patterns_are_listed) { assert_success(vle_aucmd_on_execute("cd", "/path", "action", &dummy_handler)); assert_success(vle_aucmd_on_execute("cd", "/path", "action", &dummy_handler)); assert_success(vle_aucmd_on_execute("cd", "/pat", "action", &dummy_handler)); assert_success(vle_aucmd_on_execute("go", "/pat", "action", &dummy_handler)); vle_aucmd_list(NULL, "/path,/pat", &list_handler, NULL); assert_int_equal(4, count); } TEST(negation_is_considered_on_listing) { assert_success(vle_aucmd_on_execute("cd", "~", "~", &dummy_handler)); assert_success(vle_aucmd_on_execute("cd", "!~", "!~", &dummy_handler)); vle_aucmd_list(NULL, "~", &list_handler, NULL); assert_int_equal(1, count); } static void dummy_handler(const char a[], void *arg) { } static void list_handler(const char event[], const char pattern[], int negated, const char action[], void *arg) { ++count; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/autocmds/remove.c0000600000175000017500000000140115051153245014354 0ustar korykory#include #include /* NULL */ #include "../../src/engine/autocmds.h" static void handler(const char action[], void *arg); static const char *action; TEARDOWN() { action = NULL; } TEST(negation_is_considered_on_removal) { assert_success(vle_aucmd_on_execute("cd", "~", "~", &handler)); assert_success(vle_aucmd_on_execute("cd", "!~", "!~", &handler)); vle_aucmd_remove("cd", "!~"); vle_aucmd_execute("cd", "~", NULL); assert_string_equal("~", action); action = NULL; vle_aucmd_execute("cd", "~/tmp", NULL); assert_string_equal(NULL, action); } static void handler(const char a[], void *arg) { action = a; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/autocmds/basic.c0000600000175000017500000001006015051153245014141 0ustar korykory#include #include /* NULL */ #include "../../src/engine/autocmds.h" static void handler(const char action[], void *arg); static const char *action; TEARDOWN() { action = NULL; } TEST(different_path_does_not_match) { assert_success(vle_aucmd_on_execute("cd", "/path", "action", &handler)); vle_aucmd_execute("cd", "/other", NULL); assert_string_equal(NULL, action); } TEST(same_path_matches) { assert_success(vle_aucmd_on_execute("cd", "/path", "action", &handler)); vle_aucmd_execute("cd", "/path", NULL); assert_string_equal("action", action); } TEST(extra_shashes_match) { assert_success(vle_aucmd_on_execute("cd", "/path/", "action", &handler)); vle_aucmd_execute("cd", "/path//", NULL); assert_string_equal("action", action); } TEST(one_level_match) { assert_success(vle_aucmd_on_execute("cd", "/parent/*", "action", &handler)); vle_aucmd_execute("cd", "/parent/child/grand-child", NULL); assert_string_equal(NULL, action); vle_aucmd_execute("cd", "/parent/child", NULL); assert_string_equal("action", action); } TEST(leading_match) { assert_success(vle_aucmd_on_execute("cd", "**/.git", "action", &handler)); vle_aucmd_execute("cd", "/path/to/repo/.git", NULL); assert_string_equal("action", action); } TEST(trailing_match) { assert_success(vle_aucmd_on_execute("cd", "**/.git/**", "action", &handler)); vle_aucmd_execute("cd", "/path/to/repo/.git", NULL); assert_string_equal(NULL, action); vle_aucmd_execute("cd", "/path/to/repo/.git/objects", NULL); assert_string_equal("action", action); } TEST(trail_glob_match) { assert_success(vle_aucmd_on_execute("cd", "*.d", "action", &handler)); vle_aucmd_execute("cd", "/etc/conf.d", NULL); assert_string_equal("action", action); } TEST(zero_length_start_match_single_asterisk) { assert_success(vle_aucmd_on_execute("cd", "*.git", "action", &handler)); vle_aucmd_execute("cd", "/home/user/repo/.git", NULL); assert_string_equal(NULL, action); assert_success(vle_aucmd_on_execute("cd", "*git", "action", &handler)); vle_aucmd_execute("cd", "/home/user/repo/git", NULL); assert_string_equal("action", action); } TEST(zero_length_start_match_double_asterisk) { assert_success(vle_aucmd_on_execute("cd", "**.git", "action", &handler)); vle_aucmd_execute("cd", "/home/user/repo/.git", NULL); assert_string_equal(NULL, action); vle_aucmd_execute("cd", "repo.git", NULL); assert_string_equal("action", action); action = NULL; assert_success(vle_aucmd_on_execute("cd", "**git", "action", &handler)); vle_aucmd_execute("cd", "/home/user/repo/git", NULL); assert_string_equal("action", action); } TEST(zero_length_path_prefix) { assert_success(vle_aucmd_on_execute("cd", "/etc/**/*.d", "action", &handler)); vle_aucmd_execute("cd", "/etc/conf.d", NULL); assert_string_equal("action", action); action = NULL; vle_aucmd_execute("cd", "/etc/X11/conf.d", NULL); assert_string_equal("action", action); } TEST(sub_tree_doublestar) { assert_success(vle_aucmd_on_execute("cd", "/etc/**/**", "action", &handler)); vle_aucmd_execute("cd", "/etc/", NULL); assert_string_equal("action", action); action = NULL; vle_aucmd_execute("cd", "/etc", NULL); assert_string_equal("action", action); action = NULL; vle_aucmd_execute("cd", "/etc/something", NULL); assert_string_equal("action", action); action = NULL; vle_aucmd_execute("cd", "/etc/something/else", NULL); assert_string_equal("action", action); } TEST(sub_tree_star) { assert_success(vle_aucmd_on_execute("cd", "/etc/**/*", "action", &handler)); vle_aucmd_execute("cd", "/etc/", NULL); assert_string_equal("action", action); action = NULL; vle_aucmd_execute("cd", "/etc", NULL); assert_string_equal("action", action); action = NULL; vle_aucmd_execute("cd", "/etc/something", NULL); assert_string_equal("action", action); action = NULL; vle_aucmd_execute("cd", "/etc/something/else", NULL); assert_string_equal("action", action); } static void handler(const char a[], void *arg) { action = a; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/autocmds/suite.c0000600000175000017500000000042715051153245014217 0ustar korykory#include #include /* NULL */ #include "../../src/engine/autocmds.h" DEFINE_SUITE(); TEARDOWN() { vle_aucmd_remove(NULL, NULL); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/io_tester_app/0000700000175000017500000000000015051153245013733 5ustar korykory./tests/io_tester_app/io_tester.c0000600000175000017500000000274015051153245016101 0ustar korykory#include /* EOF FILE fclose() fflush() fgets() */ #include /* strcmp() strlen() strspn() */ /* * Usage: io_tester modes * * `modes` must be a three-letter sequence of: * * c -- close * * k -- keep * * u -- use * * A letter corresponds to stdin, stdout and stderr in this order. * * Example modes: kcc, cuc, ccu * * When a file descriptor is being used, stdin expects "stdin" string and * stdout and stderr print "stdout" and "stderr" respectively. */ int main(int argc, char *argv[]) { if(argc != 2) { return 10; } const char *modes = argv[1]; if(strlen(modes) != 3) { return 11; } if(strspn(modes, "cku") != 3) { return 12; } FILE *fps[3] = { stdin, stdout, stderr }; const char *data[3] = { "stdin", "stdout", "stderr" }; int i; /* Start by closing descriptors to make sure others can still be used. */ for(i = 0; i < 3; ++i) { if(modes[i] == 'c') { if(fclose(fps[i]) != 0) { return 20 + i; } } } for(i = 0; i < 3; ++i) { if(modes[i] != 'u') { continue; } if(i == 0) { char buf[16]; if(fgets(buf, sizeof(buf), fps[i]) != buf) { return 30; } if(strcmp(buf, data[i]) != 0) { return 31; } } else { if(fputs(data[i], fps[i]) == EOF) { return 40 + i; } if(fflush(fps[i]) == EOF) { return 50 + i; } } } return 0; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/abbrevs/0000700000175000017500000000000015051153245012522 5ustar korykory./tests/abbrevs/deletion.c0000600000175000017500000000306315051153245014475 0ustar korykory#include #include /* NULL wchar_t */ #include "../../src/engine/abbrevs.h" #include "../../src/utils/str.h" static wchar_t * handler(void *user_data); TEST(delete_inexistent) { assert_false(vle_abbr_remove(L"lhs") == 0); } TEST(delete_existent_by_lhs) { assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_success(vle_abbr_remove(L"lhs")); assert_success(vle_abbr_add_no_remap(L"lhs", L"rhs")); assert_success(vle_abbr_remove(L"lhs")); } TEST(delete_existent_by_rhs) { assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_success(vle_abbr_remove(L"rhs")); assert_success(vle_abbr_add_no_remap(L"lhs", L"rhs")); assert_success(vle_abbr_remove(L"rhs")); } TEST(delete_existent_by_rhs_check_all_lhs_first) { assert_success(vle_abbr_add(L"a", L"b")); assert_success(vle_abbr_add_no_remap(L"b", L"c")); assert_success(vle_abbr_remove(L"b")); assert_success(vle_abbr_remove(L"a")); } TEST(delete_foreign_by_lhs) { assert_success(vle_abbr_add_foreign(L"lhs", "descr", /*no_remap=*/1, handler, /*user_data=*/NULL)); assert_success(vle_abbr_remove(L"lhs")); } TEST(delete_foreign_by_rhs) { int no_remap; assert_success(vle_abbr_add_foreign(L"lhs", "descr", /*no_remap=*/1, handler, /*user_data=*/NULL)); assert_failure(vle_abbr_remove(L"hrhs")); (void)vle_abbr_expand(L"lhs", &no_remap); assert_success(vle_abbr_remove(L"hrhs")); } static wchar_t * handler(void *user_data) { return vifm_wcsdup(L"hrhs"); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/abbrevs/completion.c0000600000175000017500000000247115051153245015045 0ustar korykory#include #include /* NULL */ #include /* free() */ #include "../../src/engine/abbrevs.h" #include "../../src/engine/completion.h" SETUP() { assert_success(vle_abbr_add(L"lhs1", L"rhs1")); assert_success(vle_abbr_add_foreign(L"lhs2", "descr", /*no_remap=*/1, /*handler=*/NULL, /*user_data=*/NULL)); assert_success(vle_abbr_add(L"seq", L"rhs3")); } TEST(nothing_to_complete) { char *completed; vle_abbr_reset(); vle_compl_reset(); vle_abbr_complete(""); completed = vle_compl_next(); assert_string_equal("", completed); free(completed); } TEST(ambiguous) { char *completed; vle_compl_reset(); vle_abbr_complete("l"); completed = vle_compl_next(); assert_string_equal("lhs1", completed); free(completed); completed = vle_compl_next(); assert_string_equal("lhs2", completed); free(completed); completed = vle_compl_next(); assert_string_equal("l", completed); free(completed); } TEST(non_ambiguous) { char *completed; vle_compl_reset(); vle_abbr_complete("s"); completed = vle_compl_next(); assert_string_equal("seq", completed); free(completed); completed = vle_compl_next(); assert_string_equal("seq", completed); free(completed); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/abbrevs/addition.c0000600000175000017500000000440215051153245014463 0ustar korykory#include #include /* NULL wchar_t */ #include "../../src/engine/abbrevs.h" #include "../../src/utils/str.h" static wchar_t * handler(void *user_data); TEST(adds_fine_first_time) { int no_remap; assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_wstring_equal(L"rhs", vle_abbr_expand(L"lhs", &no_remap)); assert_success(vle_abbr_add_no_remap(L"lhs", L"rhs")); assert_wstring_equal(L"rhs", vle_abbr_expand(L"lhs", &no_remap)); } TEST(overwriten_on_second_addition) { int no_remap; assert_success(vle_abbr_add(L"lhs1", L"rhs1_1")); assert_wstring_equal(L"rhs1_1", vle_abbr_expand(L"lhs1", &no_remap)); assert_success(vle_abbr_add(L"lhs1", L"rhs1_2")); assert_wstring_equal(L"rhs1_2", vle_abbr_expand(L"lhs1", &no_remap)); assert_success(vle_abbr_add_no_remap(L"lhs1", L"rhs1_3")); assert_wstring_equal(L"rhs1_3", vle_abbr_expand(L"lhs1", &no_remap)); assert_success(vle_abbr_add_no_remap(L"lhs2", L"rhs2_1")); assert_wstring_equal(L"rhs2_1", vle_abbr_expand(L"lhs2", &no_remap)); assert_success(vle_abbr_add(L"lhs2", L"rhs2_2")); assert_wstring_equal(L"rhs2_2", vle_abbr_expand(L"lhs2", &no_remap)); assert_success(vle_abbr_add_no_remap(L"lhs2", L"rhs2_3")); assert_wstring_equal(L"rhs2_3", vle_abbr_expand(L"lhs2", &no_remap)); } TEST(overwrite_changes_mapping_type) { int no_remap; assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_non_null(vle_abbr_expand(L"lhs", &no_remap)); assert_false(no_remap); assert_success(vle_abbr_add_no_remap(L"lhs", L"rhs")); assert_non_null(vle_abbr_expand(L"lhs", &no_remap)); assert_true(no_remap); assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_non_null(vle_abbr_expand(L"lhs", &no_remap)); assert_false(no_remap); } TEST(overwrite_foreign) { int no_remap; assert_success(vle_abbr_add_foreign(L"lhs", "descr", /*no_remap=*/1, handler, /*user_data=*/NULL)); assert_wstring_equal(L"hrhs", vle_abbr_expand(L"lhs", &no_remap)); assert_true(no_remap); assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_wstring_equal(L"rhs", vle_abbr_expand(L"lhs", &no_remap)); assert_false(no_remap); } static wchar_t * handler(void *user_data) { return vifm_wcsdup(L"hrhs"); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/abbrevs/iter.c0000600000175000017500000000665415051153245013646 0ustar korykory#include #include /* NULL */ #include "../../src/engine/abbrevs.h" TEST(nothing_to_iterate) { void *state = NULL; const wchar_t *lhs, *rhs; const char *descr; int no_remap = -1; assert_false(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); } TEST(nulls_are_restored) { void *state = NULL; const wchar_t *lhs, *rhs; const char *descr; int no_remap; assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_true(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); assert_non_null(lhs); assert_non_null(rhs); assert_null(descr); assert_non_null(state); assert_false(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); assert_null(lhs); assert_null(rhs); assert_null(descr); assert_null(state); } TEST(repeated_iteration) { void *state = NULL; const wchar_t *lhs, *rhs; const char *descr; int no_remap; assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_true(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); assert_false(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); assert_true(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); assert_false(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); } TEST(single_element) { void *state = NULL; const wchar_t *lhs, *rhs; const char *descr; int no_remap = -1; assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_true(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); assert_wstring_equal(L"lhs", lhs); assert_wstring_equal(L"rhs", rhs); assert_null(descr); assert_false(no_remap); assert_false(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); } TEST(single_foreign_element) { void *state = NULL; const wchar_t *lhs, *rhs; const char *descr; int no_remap = -1; assert_success(vle_abbr_add_foreign(L"lhs", "descr", /*no_remap=*/1, /*handler=*/NULL, /*user_data=*/NULL)); assert_true(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); assert_wstring_equal(L"lhs", lhs); assert_null(rhs); assert_string_equal("descr", descr); assert_true(no_remap); assert_false(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); } TEST(several_elements) { void *state = NULL; const wchar_t *lhs, *rhs; const char *descr; int no_remap = -1; assert_success(vle_abbr_add(L"lhs1", L"rhs1")); assert_success(vle_abbr_add_no_remap(L"lhs2", L"rhs2")); assert_success(vle_abbr_add_foreign(L"lhs3", "descr3", /*no_remap=*/0, /*handler=*/NULL, /*user_data=*/NULL)); assert_success(vle_abbr_add_foreign(L"lhs4", "descr4", /*no_remap=*/1, /*handler=*/NULL, /*user_data=*/NULL)); assert_true(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); assert_wstring_equal(L"lhs1", lhs); assert_wstring_equal(L"rhs1", rhs); assert_null(descr); assert_false(no_remap); assert_true(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); assert_wstring_equal(L"lhs2", lhs); assert_wstring_equal(L"rhs2", rhs); assert_null(descr); assert_true(no_remap); assert_true(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); assert_wstring_equal(L"lhs3", lhs); assert_null(rhs); assert_string_equal("descr3", descr); assert_false(no_remap); assert_true(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); assert_wstring_equal(L"lhs4", lhs); assert_null(rhs); assert_string_equal("descr4", descr); assert_true(no_remap); assert_false(vle_abbr_iter(&lhs, &rhs, &descr, &no_remap, &state)); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/abbrevs/expansion.c0000600000175000017500000000164315051153245014700 0ustar korykory#include #include "../../src/engine/abbrevs.h" TEST(correct_expansion) { int no_remap; assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_wstring_equal(L"rhs", vle_abbr_expand(L"lhs", &no_remap)); } TEST(correct_expansion_pick) { int no_remap; assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_success(vle_abbr_add(L"prefixlhs", L"prefixrhs")); assert_wstring_equal(L"rhs", vle_abbr_expand(L"lhs", &no_remap)); } TEST(no_remap_flag_false) { int no_remap = -1; assert_success(vle_abbr_add(L"lhs", L"rhs")); assert_true(vle_abbr_expand(L"lhs", &no_remap) != NULL); assert_false(no_remap); } TEST(no_remap_flag_true) { int no_remap = -1; assert_success(vle_abbr_add_no_remap(L"lhs", L"rhs")); assert_true(vle_abbr_expand(L"lhs", &no_remap) != NULL); assert_true(no_remap); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/abbrevs/suite.c0000600000175000017500000000034715051153245014025 0ustar korykory#include #include "../../src/engine/abbrevs.h" DEFINE_SUITE(); SETUP() { vle_abbr_reset(); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/0000700000175000017500000000000015051153245012541 5ustar korykory./tests/parsing/functions.c0000600000175000017500000000514015051153245014717 0ustar korykory#include #include /* free() */ #include "../../src/engine/functions.h" #include "../../src/engine/parsing.h" #include "../../src/engine/var.h" #include "asserts.h" static var_t dummy(const call_info_t *call_info); SETUP_ONCE() { static const function_t function_a = { "a", "adescr", {1,1}, &dummy }; static const function_t function_b = { "b", "bdescr", {2,2}, &dummy }; static const function_t function_c = { "c", "cdescr", {0,0}, &dummy }; static const function_t function_d = { "d", "ddescr", {1,3}, &dummy }; assert_success(function_register(&function_a)); assert_success(function_register(&function_b)); assert_success(function_register(&function_c)); assert_success(function_register(&function_d)); } TEARDOWN_ONCE() { function_reset_all(); } static var_t dummy(const call_info_t *call_info) { return var_from_str(""); } TEST(function_with_wrong_signature_is_not_added) { static const function_t function = { "d", "ddescr", {3,2}, &dummy }; assert_failure(function_register(&function)); } TEST(wrong_number_of_arguments_fail) { ASSERT_FAIL_AT("a()", "a()", PE_INVALID_EXPRESSION); } TEST(wrong_arg_fail) { ASSERT_FAIL_AT("a(a)", "a)", PE_INVALID_SUBEXPRESSION); } TEST(two_args_ok) { ASSERT_OK("b('a','b')", ""); } TEST(space_before_first_arg_ok) { ASSERT_OK("b( 'a','b')", ""); } TEST(space_after_last_arg_ok) { ASSERT_OK("b('a','b' )", ""); } TEST(space_before_comma_ok) { ASSERT_OK("b('a' ,'b')", ""); } TEST(space_after_comma_ok) { ASSERT_OK("b('a', 'b')", ""); } TEST(concatenation_as_arg_ok) { ASSERT_OK("a('a'.'b')", ""); } TEST(or_as_arg_ok) { ASSERT_OK("a('a'||'b')", ""); } TEST(and_as_arg_ok) { ASSERT_OK("a('a'&&'b')", ""); } TEST(no_args_ok) { ASSERT_OK("c()", ""); } TEST(range_of_args) { ASSERT_FAIL("d()", PE_INVALID_EXPRESSION); ASSERT_OK("d(1)", ""); ASSERT_OK("d(1, 2)", ""); ASSERT_OK("d(1, 2, 3)", ""); ASSERT_FAIL("d(1, 2, 3, 4)", PE_INVALID_EXPRESSION); } TEST(no_function_name_fail) { ASSERT_FAIL("()", PE_INVALID_EXPRESSION); } TEST(chars_after_function_call_fail) { ASSERT_FAIL("a()a", PE_INVALID_EXPRESSION); } TEST(very_long_function_name) { const char *const input = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafffffffffffffffffffffffff" "fffffffff"; ASSERT_FAIL(input, PE_INVALID_EXPRESSION); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/laziness.c0000600000175000017500000000202515051153245014536 0ustar korykory#include #include "../../src/engine/functions.h" #include "../../src/engine/parsing.h" #include "../../src/engine/var.h" #include "asserts.h" static var_t dummy(const call_info_t *call_info); static int called; SETUP_ONCE() { static const function_t function_a = { "a", "descr", {0,0}, &dummy }; assert_success(function_register(&function_a)); } TEARDOWN_ONCE() { function_reset_all(); } TEARDOWN() { called = 0; } static var_t dummy(const call_info_t *call_info) { called = 1; return var_from_str(""); } TEST(or_is_lazy) { ASSERT_OK("1 || a()", "1"); assert_false(called); } TEST(and_is_lazy) { ASSERT_OK("0 && a()", "0"); assert_false(called); } TEST(compares_are_lazy) { ASSERT_OK("0 && 1 < a()", "0"); assert_false(called); } TEST(negation_is_lazy) { ASSERT_OK("0 && -a()", "0"); assert_false(called); } TEST(not_is_lazy) { ASSERT_OK("0 && !a()", "0"); assert_false(called); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/and_or.c0000600000175000017500000000546415051153245014162 0ustar korykory#include #include /* free() */ #include /* memset() strcpy() */ #include "../../src/engine/parsing.h" #include "../../src/engine/var.h" #include "asserts.h" TEST(front_back_op_fail) { ASSERT_FAIL("&& 'a' == 'b'", PE_INVALID_EXPRESSION); ASSERT_FAIL("|| 'a' == 'b'", PE_INVALID_EXPRESSION); ASSERT_FAIL("'a' == 'a' &&", PE_INVALID_EXPRESSION); ASSERT_FAIL("'a' == 'a' ||", PE_INVALID_EXPRESSION); } TEST(spaces_before_after_op_ok) { ASSERT_OK("'a' == 'a'&& 'a' == 'b'", "0"); ASSERT_OK("'a' == 'a'|| 'a' == 'b'", "1"); ASSERT_OK("'a' == 'a' &&'a' == 'b'", "0"); ASSERT_OK("'a' == 'a' ||'a' == 'b'", "1"); ASSERT_OK("'a' == 'a'&&'a' == 'b'", "0"); ASSERT_OK("'a' == 'a'||'a' == 'b'", "1"); } TEST(spaces_in_op_fail) { ASSERT_FAIL("'a' == 'a' & & 'a' == 'b'", PE_INVALID_EXPRESSION); ASSERT_FAIL("'a' == 'a' | | 'a' == 'b'", PE_INVALID_EXPRESSION); } TEST(wrong_op_fail) { ASSERT_FAIL("'a' == 'a' &| 'a' == 'b'", PE_INVALID_EXPRESSION); ASSERT_FAIL("'a' == 'a' |& 'a' == 'b'", PE_INVALID_EXPRESSION); } TEST(constant_operands_ok) { ASSERT_OK("'a' == 'a'&& 1", "1"); ASSERT_OK("0000000000|| 'a' == 'b'", "0"); ASSERT_OK("0||0||0", "0"); ASSERT_OK("1&&0&&1", "0"); } TEST(and_operates_ok) { ASSERT_OK("0 && 0", "0"); ASSERT_OK("0 && 1", "0"); ASSERT_OK("1 && 0", "0"); ASSERT_OK("1 && 1", "1"); ASSERT_OK("1 && 1", "1"); ASSERT_OK("1 && 2", "1"); ASSERT_OK("2 && 1", "1"); ASSERT_OK("2 && 2", "1"); } TEST(or_operates_ok) { ASSERT_OK("0 || 0", "0"); ASSERT_OK("0 || 1", "1"); ASSERT_OK("1 || 0", "1"); ASSERT_OK("1 || 1", "1"); ASSERT_OK("1 || 1", "1"); ASSERT_OK("1 || 2", "1"); ASSERT_OK("2 || 1", "1"); ASSERT_OK("2 || 2", "1"); } TEST(priority_of_and_is_higher) { ASSERT_OK("1 || 1 && 0", "1"); } TEST(and_or_ignored_inside_strings) { ASSERT_OK("'||&&'", "||&&"); ASSERT_OK("\"||&&\"", "||&&"); } TEST(strings_are_converted_to_integers) { ASSERT_BOOL_OK("''", 0); /* The following checks must be inverted when the bug is fixed (breaks * compatibility). */ ASSERT_BOOL_OK("'a'", 1); ASSERT_BOOL_OK("'0'", 1); ASSERT_BOOL_OK("'0'", 1); ASSERT_OK("'a' && 'b' && 'c'", "0"); ASSERT_OK("'0' && '0' && '0'", "0"); ASSERT_OK("'1' && '2' && '4'", "1"); ASSERT_OK("'0' || '0' || '0'", "0"); ASSERT_OK("'1' || '2' || '4'", "1"); } TEST(and_handles_errors_correctly) { char expr[8192]; strcpy(expr, "1&&1=="); memset(expr + strlen(expr), '3', sizeof(expr) - strlen(expr)); expr[sizeof(expr) - 1U] = '\0'; ASSERT_FAIL(expr, PE_INTERNAL); } TEST(or_handles_errors_correctly) { char expr[8192]; strcpy(expr, "1||1=="); memset(expr + strlen(expr), '3', sizeof(expr) - strlen(expr)); expr[sizeof(expr) - 1U] = '\0'; ASSERT_FAIL(expr, PE_INTERNAL); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/unary.c0000600000175000017500000000147715051153245014056 0ustar korykory#include #include /* free() */ #include "../../src/engine/parsing.h" #include "../../src/engine/var.h" #include "asserts.h" TEST(logical_not_of_integers) { ASSERT_INT_OK("!1", 0); ASSERT_INT_OK("!0", 1); ASSERT_INT_OK("!-10", 0); } TEST(logical_not_of_strings) { ASSERT_INT_OK("!'abc'", 1); ASSERT_INT_OK("!''", 1); ASSERT_INT_OK("!'0'", 1); ASSERT_INT_OK("!'1'", 0); } TEST(multiple_logical_not) { ASSERT_INT_OK("!!10", 1); ASSERT_INT_OK("!!!10", 0); } TEST(extra_spaces_in_logical_not) { ASSERT_INT_OK("! 18", 0); ASSERT_INT_OK("! \"\"", 1); ASSERT_INT_OK("! !! \"\"", 1); } TEST(invalid_logical_not_without_argument) { ASSERT_FAIL("!", PE_INVALID_EXPRESSION); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/general.c0000600000175000017500000000423415051153245014327 0ustar korykory#include #include /* free() */ #include "../../src/engine/functions.h" #include "../../src/engine/parsing.h" #include "../../src/engine/var.h" #include "asserts.h" static var_t dummy(const call_info_t *call_info); TEST(empty_fail) { ASSERT_FAIL("", PE_INVALID_EXPRESSION); } TEST(non_quoted_fail) { ASSERT_FAIL("b", PE_INVALID_EXPRESSION); } TEST(double_dot_fail) { ASSERT_FAIL("'a'..'b'", PE_INVALID_EXPRESSION); } TEST(starts_with_dot_fail) { ASSERT_FAIL(".'b'", PE_INVALID_EXPRESSION); } TEST(ends_with_dot_fail) { ASSERT_FAIL("'a'.", PE_INVALID_EXPRESSION); } TEST(fail_position_correct) { ASSERT_FAIL_AT("'b' c", "'b' c", PE_INVALID_EXPRESSION); ASSERT_FAIL_AT("a b", "a b", PE_INVALID_EXPRESSION); } TEST(spaces_and_fail_position_correct) { ASSERT_FAIL_AT(" 'b' c", "'b' c", PE_INVALID_EXPRESSION); ASSERT_FAIL_AT(" a b", "a b", PE_INVALID_EXPRESSION); } TEST(nothing_but_comment) { ASSERT_FAIL("\"", PE_MISSING_QUOTE); ASSERT_FAIL("\" this is a comment", PE_MISSING_QUOTE); ASSERT_FAIL(" \"this is a comment", PE_MISSING_QUOTE); ASSERT_FAIL(" \"", PE_MISSING_QUOTE); } TEST(expression_and_comment) { ASSERT_OK("1\"", "1"); ASSERT_OK("'str'\" this is a comment", "str"); ASSERT_OK(" 1 && 0 \"this is a comment", "0"); ASSERT_FAIL(" + \"", PE_MISSING_QUOTE); ASSERT_FAIL(" 4 || \"", PE_MISSING_QUOTE); } TEST(priority_of_operators) { ASSERT_OK("1.'0' + 1 > 10 && 1 + 2 != 0 || +0 == -3 + 2 && 0", "1"); } TEST(state_is_reset_on_each_parsing) { parsing_result_t result; result = ASSERT_FAIL_GET("1 1", PE_INVALID_EXPRESSION); assert_true(result.ends_with_whitespace); result = ASSERT_FAIL_GET("", PE_INVALID_EXPRESSION); assert_false(result.ends_with_whitespace); static const function_t function_a = { "a", "adescr", {1,1}, &dummy }; assert_success(function_register(&function_a)); result = ASSERT_FAIL_GET("a('a'", PE_INVALID_EXPRESSION); assert_int_equal(VTYPE_ERROR, result.value.type); function_reset_all(); } static var_t dummy(const call_info_t *call_info) { return var_from_str(""); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/envvar.c0000600000175000017500000000205615051153245014213 0ustar korykory#include #include /* free() */ #include "../../src/engine/parsing.h" #include "asserts.h" static const char * getenv_value(const char name[]); SETUP() { vle_parser_init(&getenv_value); } static const char * getenv_value(const char *name) { return name + 1; } TEST(simple_ok) { ASSERT_OK("$ENV", "NV"); } TEST(leading_spaces_ok) { ASSERT_OK(" $ENV", "NV"); } TEST(trailing_spaces_ok) { ASSERT_OK("$ENV ", "NV"); } TEST(space_in_the_middle_fail) { ASSERT_FAIL("$ENV $VAR", PE_INVALID_EXPRESSION); } TEST(concatenation) { ASSERT_OK("$ENV.$VAR", "NVAR"); ASSERT_OK("$ENV .$VAR", "NVAR"); ASSERT_OK("$ENV. $VAR", "NVAR"); ASSERT_OK("$ENV . $VAR", "NVAR"); } TEST(non_first_digit_in_name_ok) { ASSERT_OK("$VAR_NUMBER_1", "AR_NUMBER_1"); } TEST(first_digit_in_name_fail) { ASSERT_FAIL("$1_VAR", PE_INVALID_EXPRESSION); } TEST(invalid_first_char_in_name_fail) { ASSERT_FAIL("$#", PE_INVALID_EXPRESSION); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/variables.c0000600000175000017500000000136115051153245014660 0ustar korykory#include #include "../../src/engine/parsing.h" #include "../../src/engine/variables.h" #include "../../src/engine/var.h" #include "asserts.h" SETUP() { init_variables(); } TEARDOWN() { clear_variables(); } TEST(nonexistent_variable_errors) { ASSERT_FAIL("g:test", PE_INVALID_EXPRESSION); ASSERT_FAIL("v:test", PE_INVALID_EXPRESSION); } TEST(existent_variable_is_expanded) { assert_success(let_variables("g:test = 1")); ASSERT_OK("g:test", "1"); assert_success(let_variables("g:test = 'abc'")); ASSERT_OK("g:test", "abc"); assert_success(setvar("v:test", var_from_bool(1))); ASSERT_OK("v:test", "1"); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/plus_minus.c0000600000175000017500000000207215051153245015106 0ustar korykory#include #include /* free() */ #include "../../src/engine/parsing.h" #include "../../src/engine/var.h" #include "asserts.h" TEST(sum_of_two_elements) { ASSERT_INT_OK("1 + 1", 2); ASSERT_INT_OK("-1 + 4", 3); ASSERT_INT_OK("- 1 + 4", 3); ASSERT_INT_OK("1 + -2", -1); ASSERT_INT_OK("1 +- 2", -1); ASSERT_INT_OK("1 + - 2", -1); } TEST(difference_of_two_elements) { ASSERT_INT_OK("1 - 1", 0); ASSERT_INT_OK("-1 - 4", -5); ASSERT_INT_OK("- 1 - 4", -5); ASSERT_INT_OK("1 - -2", 3); ASSERT_INT_OK("1 -- 2", 3); ASSERT_INT_OK("1 - - 2", 3); } TEST(more_than_two_elements) { ASSERT_INT_OK("1 + 1 + 1", 3); ASSERT_INT_OK("1 + 2 + 3 + 4", 10); ASSERT_INT_OK("1 - 1 - 1", -1); ASSERT_INT_OK("1 - 2 - 3 - 4", -8); } TEST(incomplete_expressions) { ASSERT_FAIL("1 +", PE_INVALID_EXPRESSION); ASSERT_FAIL("1+", PE_INVALID_EXPRESSION); ASSERT_FAIL("0 -", PE_INVALID_EXPRESSION); ASSERT_FAIL("0-", PE_INVALID_EXPRESSION); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/numbers.c0000600000175000017500000000332115051153245014361 0ustar korykory#include #include /* free() */ #include /* memset() */ #include "../../src/engine/parsing.h" #include "../../src/engine/var.h" #include "asserts.h" TEST(negative_number_ok) { ASSERT_OK("-1", "-1"); } TEST(multiple_negations_ok) { ASSERT_OK("--1", "1"); ASSERT_OK("---1", "-1"); ASSERT_OK("----1", "1"); ASSERT_OK("-----1", "-1"); } TEST(spaces_betwen_signs_ok) { ASSERT_OK("--- 1", "-1"); ASSERT_OK("- - + 1", "1"); ASSERT_OK(" ++ + 1", "1"); } TEST(zero_ok) { ASSERT_OK("0", "0"); ASSERT_OK("-0", "0"); ASSERT_OK("+0", "0"); } TEST(multiple_zeroes_ok) { ASSERT_OK("00000", "0"); ASSERT_OK("-00000", "0"); ASSERT_OK("+00000", "0"); } TEST(positive_number_ok) { ASSERT_OK("12345", "12345"); ASSERT_OK("+12", "12"); ASSERT_OK("++12", "12"); ASSERT_OK("+++12", "12"); } TEST(leading_zeroes_ok) { ASSERT_OK("0123456", "123456"); } TEST(single_signs_fail) { ASSERT_FAIL("-", PE_INVALID_EXPRESSION); ASSERT_FAIL("--", PE_INVALID_EXPRESSION); ASSERT_FAIL("+", PE_INVALID_EXPRESSION); ASSERT_FAIL("++", PE_INVALID_EXPRESSION); ASSERT_FAIL("- +", PE_INVALID_EXPRESSION); ASSERT_FAIL("+ -", PE_INVALID_EXPRESSION); } TEST(string_is_converted_for_signs) { ASSERT_OK("-'a'", "0"); ASSERT_OK("+'a'", "0"); ASSERT_OK("-'1'", "-1"); ASSERT_OK("-'0'", "0"); ASSERT_OK("-''", "0"); ASSERT_OK("-'-1'", "1"); ASSERT_OK("-'--1'", "0"); ASSERT_OK("+'10'", "10"); ASSERT_OK("+'-100'", "-100"); } TEST(extremely_long_number) { char zeroes[8192]; memset(zeroes, '0', sizeof(zeroes) - 1U); zeroes[sizeof(zeroes) - 1U] = '\0'; ASSERT_FAIL(zeroes, PE_INTERNAL); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/grouping.c0000600000175000017500000000225315051153245014543 0ustar korykory#include #include "../../src/engine/parsing.h" #include "../../src/engine/variables.h" #include "../../src/engine/var.h" #include "asserts.h" TEST(wrong_paren_syntax) { ASSERT_FAIL("(", PE_MISSING_PAREN); ASSERT_FAIL(")", PE_INVALID_EXPRESSION); ASSERT_FAIL("(0", PE_MISSING_PAREN); ASSERT_FAIL("0)", PE_INVALID_EXPRESSION); ASSERT_FAIL("()", PE_INVALID_EXPRESSION); } TEST(whitespace_in_parens) { ASSERT_OK("(1)", "1"); ASSERT_OK("( 1)", "1"); ASSERT_OK("(1 )", "1"); ASSERT_OK("( 1 )", "1"); ASSERT_OK(" (1)", "1"); ASSERT_OK("(1) ", "1"); ASSERT_OK(" (1) ", "1"); } TEST(nesting) { ASSERT_OK("('a')", "a"); ASSERT_OK("(('a'))", "a"); ASSERT_OK("((('a')))", "a"); } TEST(grouping_works) { ASSERT_OK("(1 + 2 + 3)", "6"); ASSERT_OK("(1 + 2) + 3", "6"); ASSERT_OK("1 + (2 + 3)", "6"); ASSERT_OK("1 + (2) + 3", "6"); ASSERT_OK("(1 - 2 - 3)", "-4"); ASSERT_OK("(1 - 2) - 3", "-4"); ASSERT_OK("1 - (2 - 3)", "2"); ASSERT_OK("1 - (2) - 3", "-4"); ASSERT_OK("-(2)", "-2"); ASSERT_OK("-(-2)", "2"); ASSERT_OK("(1 + 2).'2'", "32"); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/compares.c0000600000175000017500000000446415051153245014530 0ustar korykory#include #include /* free() */ #include "../../src/engine/parsing.h" #include "../../src/engine/var.h" #include "asserts.h" TEST(eq_compare_true) { ASSERT_OK("'a'=='a'", "1"); ASSERT_OK("1==1", "1"); } TEST(eq_compare_false) { ASSERT_OK("'a'=='b'", "0"); ASSERT_OK("1==-1", "0"); } TEST(ne_compare_true) { ASSERT_OK("'a'!='b'", "1"); ASSERT_OK("-1!=1", "1"); } TEST(ne_compare_false) { ASSERT_OK("'a'!='a'", "0"); ASSERT_OK("0!=0", "0"); } TEST(lt_compare_true) { ASSERT_OK("1<2", "1"); ASSERT_OK("'a'<'b'", "1"); } TEST(lt_compare_false) { ASSERT_OK("2<1", "0"); ASSERT_OK("' '<'a'", "1"); } TEST(le_compare_true) { ASSERT_OK("1<=1", "1"); ASSERT_OK("-1<=1", "1"); ASSERT_OK("'a'<='b'", "1"); ASSERT_OK("'b'<='b'", "1"); } TEST(le_compare_false) { ASSERT_OK("3<=2", "0"); ASSERT_OK("'c'<='b'", "0"); } TEST(ge_compare_true) { ASSERT_OK("1>=1", "1"); ASSERT_OK("2>=1", "1"); ASSERT_OK("'b'>='a'", "1"); ASSERT_OK("'b'>='b'", "1"); } TEST(ge_compare_false) { ASSERT_OK("0>=1", "0"); ASSERT_OK("'b'>='c'", "0"); } TEST(gt_compare_true) { ASSERT_OK("2>-1", "1"); ASSERT_OK("'b'>'a'", "1"); } TEST(gt_compare_false) { ASSERT_OK("1>1", "0"); ASSERT_OK("'b'>'b'", "0"); } TEST(compares_prefer_numbers) { ASSERT_OK("'2'>'b'", "0"); ASSERT_OK("2>'b'", "1"); } TEST(compares_convert_string_to_numbers) { ASSERT_OK("2>'b'", "1"); ASSERT_OK("2>'9b'", "0"); } TEST(leading_spaces_ok) { ASSERT_OK(" 'a'!='a'", "0"); } TEST(trailing_spaces_ok) { ASSERT_OK("'a'!='a' ", "0"); } TEST(spaces_before_op_ok) { ASSERT_OK("'a' !='a'", "0"); } TEST(spaces_after_op_ok) { ASSERT_OK("'a'!= 'a'", "0"); } TEST(spaces_in_op_fail) { ASSERT_FAIL("'a' ! = 'a'", PE_INVALID_EXPRESSION); ASSERT_FAIL("'a' = = 'a'", PE_INVALID_EXPRESSION); ASSERT_FAIL("'a' > = 'a'", PE_INVALID_EXPRESSION); ASSERT_FAIL("'a' < = 'a'", PE_INVALID_EXPRESSION); } TEST(wrong_op_fail) { ASSERT_FAIL("'a' =! 'a'", PE_INVALID_EXPRESSION); ASSERT_FAIL("'a' => 'a'", PE_INVALID_EXPRESSION); ASSERT_FAIL("'a' =< 'a'", PE_INVALID_EXPRESSION); } TEST(ops_ignored_inside_strings) { ASSERT_OK("'!= == <= >= !'", "!= == <= >= !"); ASSERT_OK("\"!= == <= >= !\"", "!= == <= >= !"); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/ampersand.c0000600000175000017500000000773315051153245014673 0ustar korykory#include #include "../../src/engine/options.h" #include "../../src/engine/parsing.h" #include "../../src/utils/macros.h" #include "asserts.h" static void dummy_handler(OPT_OP op, optval_t val); static const char *cpoptions_vals[][2] = { { "abc", "descr" }, { "a", "descr" }, { "b", "descr" }, { "c", "descr" }, }; static const char *sort_enum[][2] = { { "ext", "descr" }, { "name", "descr" }, { "gid", "descr" }, { "gname", "descr" }, { "mode", "descr" }, { "uid", "descr" }, { "uname", "descr" }, { "size", "descr" }, { "atime", "descr" }, { "ctime", "descr" }, { "mtime", "descr" }, }; static const char *vifminfo_set[][2] = { { "options", "descr" }, { "filetypes", "descr" }, { "commands", "descr" }, { "bookmarks", "descr" }, { "tui", "descr" }, { "dhistory", "descr" }, { "state", "descr" }, { "cs", "descr" }, }; SETUP() { static int option_changed; optval_t val; vle_opts_init(&option_changed, NULL); val.str_val = "bc"; vle_opts_add("cpoptions", "cpo", "descr", OPT_CHARSET, OPT_GLOBAL, ARRAY_LEN(cpoptions_vals), cpoptions_vals, dummy_handler, val); val.bool_val = 0; vle_opts_add("fastrun", "fr", "descr", OPT_BOOL, OPT_GLOBAL, 0, NULL, dummy_handler, val); val.str_val = "fusehome-default"; vle_opts_add("fusehome", "fh", "descr", OPT_STR, OPT_GLOBAL, 0, NULL, dummy_handler, val); val.str_val = "%r/.vifm-Trash,$HOME/.vifm/Trash"; vle_opts_add("trashdir", "td", "descr", OPT_STRLIST, OPT_GLOBAL, 0, NULL, dummy_handler, val); val.enum_item = 1; vle_opts_add("sort", "so", "descr", OPT_ENUM, OPT_GLOBAL, ARRAY_LEN(sort_enum), sort_enum, &dummy_handler, val); /* Parsing unit doesn't accept options with underscores, although options unit * doesn't reject them. Should it? */ val.enum_item = 1; vle_opts_add("so_rt", "", "descr", OPT_ENUM, OPT_GLOBAL, ARRAY_LEN(sort_enum), sort_enum, &dummy_handler, val); val.int_val = 2; vle_opts_add("tabstop", "ts", "descr", OPT_INT, OPT_GLOBAL, 0, NULL, &dummy_handler, val); val.int_val = 8; vle_opts_add("tabstop", "ts", "descr", OPT_INT, OPT_LOCAL, 0, NULL, &dummy_handler, val); val.set_items = 0x81; vle_opts_add("vifminfo", "", "descr", OPT_SET, OPT_GLOBAL, ARRAY_LEN(vifminfo_set), vifminfo_set, &dummy_handler, val); } TEARDOWN() { vle_opts_reset(); } static void dummy_handler(OPT_OP op, optval_t val) { } TEST(nothing_follows_fail) { ASSERT_FAIL("&", PE_INVALID_EXPRESSION); } TEST(space_follows_fail) { ASSERT_FAIL("& ", PE_INVALID_EXPRESSION); } TEST(number_follows_fail) { ASSERT_FAIL("&1", PE_INVALID_EXPRESSION); } TEST(wrong_option_name_fail) { ASSERT_FAIL("&nosuchoption", PE_INVALID_EXPRESSION); } TEST(correct_full_option_name_ok) { ASSERT_INT_OK("&tabstop", 8); } TEST(correct_local_option_name_ok) { ASSERT_INT_OK("&l:tabstop", 8); } TEST(correct_global_option_name_ok) { ASSERT_INT_OK("&g:tabstop", 2); } TEST(wrong_option_syntax_fail) { ASSERT_FAIL("&x:tabstop", PE_INVALID_EXPRESSION); } TEST(correct_short_option_name_ok) { ASSERT_INT_OK("&ts", 8); } TEST(concatenation_ok) { ASSERT_OK("&ts.&ts", "88"); } TEST(all_fail) { ASSERT_FAIL("&all", PE_INVALID_EXPRESSION); } TEST(bool_option_ok) { ASSERT_INT_OK("&fastrun", 0); } TEST(int_option_ok) { ASSERT_INT_OK("&tabstop", 8); } TEST(str_option_ok) { ASSERT_OK("&fusehome", "fusehome-default"); } TEST(strlist_option_ok) { ASSERT_OK("&trashdir", "%r/.vifm-Trash,$HOME/.vifm/Trash"); } TEST(enum_option_ok) { ASSERT_OK("&sort", "name"); } TEST(set_option_ok) { ASSERT_OK("&vifminfo", "options,cs"); } TEST(charset_option_ok) { ASSERT_OK("&cpoptions", "bc"); } TEST(wrong_char_is_option_name_fail) { ASSERT_FAIL("&so_rt", PE_INVALID_EXPRESSION); } TEST(very_long_option_name_fail) { ASSERT_FAIL("&ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", PE_INVALID_EXPRESSION); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/double_quotes.c0000600000175000017500000000205415051153245015562 0ustar korykory#include #include /* free() */ #include /* memset() */ #include "../../src/engine/parsing.h" #include "../../src/engine/var.h" #include "asserts.h" TEST(empty_ok) { ASSERT_OK("\"\"", ""); } TEST(simple_ok) { ASSERT_OK("\"test\"", "test"); } TEST(not_closed_error) { ASSERT_FAIL("\"test", PE_MISSING_QUOTE); } TEST(concatenation) { ASSERT_OK("\"NV\".\"AR\"", "NVAR"); ASSERT_OK("\"NV\" .\"AR\"", "NVAR"); ASSERT_OK("\"NV\". \"AR\"", "NVAR"); ASSERT_OK("\"NV\" . \"AR\"", "NVAR"); } TEST(double_quote_escaping_ok) { ASSERT_OK("\"\\\"\"", "\""); } TEST(special_chars_ok) { ASSERT_OK("\"\\t\"", "\t"); } TEST(spaces_ok) { ASSERT_OK("\" s y \"", " s y "); } TEST(dot_ok) { ASSERT_OK("\"a . c\"", "a . c"); } TEST(very_long_string) { char string[8192]; string[0] = '\"'; memset(string + 1, '0', sizeof(string) - 2U); string[sizeof(string) - 1U] = '\0'; ASSERT_FAIL(string, PE_INTERNAL); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/asserts.h0000600000175000017500000000477415051153245014414 0ustar korykory#ifndef VIFM_TESTS__PARSING__ASSERTS_H__ #define VIFM_TESTS__PARSING__ASSERTS_H__ #include /* free() */ /* This should be a macro to see what test has failed. */ #define ASSERT_OK(str, expected) \ do \ { \ parsing_result_t result = vle_parser_eval((str), /*interactive=*/0); \ assert_int_equal(PE_NO_ERROR, result.error); \ \ if(result.value.type != VTYPE_ERROR) \ { \ char *str_res = var_to_str(result.value); \ assert_string_equal((expected), str_res); \ free(str_res); \ } \ \ var_free(result.value); \ } \ while(0) /* This should be a macro to see what test has failed. */ #define ASSERT_INT_OK(str, expected) \ do \ { \ parsing_result_t result = vle_parser_eval((str), /*interactive=*/0); \ assert_int_equal(PE_NO_ERROR, result.error); \ \ if(result.value.type != VTYPE_ERROR) \ { \ int int_res = var_to_int(result.value); \ assert_int_equal((expected), int_res); \ } \ \ var_free(result.value); \ } \ while(0) /* This should be a macro to see what test has failed. */ #define ASSERT_BOOL_OK(str, expected) \ do \ { \ parsing_result_t result = vle_parser_eval((str), /*interactive=*/0); \ assert_int_equal(PE_NO_ERROR, result.error); \ \ if(result.value.type != VTYPE_ERROR) \ { \ int bool_res = var_to_bool(result.value); \ if(expected) \ { \ assert_true(bool_res); \ } \ else \ { \ assert_false(bool_res); \ } \ } \ \ var_free(result.value); \ } \ while(0) /* This should be a macro to see what test has failed. */ #define ASSERT_FAIL(str, error_code) \ do \ { \ parsing_result_t result = vle_parser_eval((str), /*interactive=*/0); \ assert_int_equal((error_code), result.error); \ var_free(result.value); \ } \ while(0) /* This should be a macro to see what test has failed. */ #define ASSERT_FAIL_AT(str, suffix, error_code) \ do \ { \ parsing_result_t result = vle_parser_eval((str), /*interactive=*/0); \ assert_int_equal((error_code), result.error); \ var_free(result.value); \ \ assert_string_equal((suffix), result.last_position); \ } \ while(0) /* This should be a macro to see what test has failed. */ #define ASSERT_FAIL_GET(str, error_code) \ ({ \ parsing_result_t result = vle_parser_eval((str), /*interactive=*/0); \ assert_int_equal((error_code), result.error); \ var_free(result.value); \ \ result; \ }) #endif /* VIFM_TESTS__PARSING__ASSERTS_H__ */ /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/single_quoted.c0000600000175000017500000000225515051153245015555 0ustar korykory#include #include /* free() */ #include /* memset() */ #include "../../src/engine/parsing.h" #include "../../src/engine/var.h" #include "asserts.h" TEST(empty_ok) { ASSERT_OK("''", ""); } TEST(simple_ok) { ASSERT_OK("'test'", "test"); } TEST(not_closed_error) { ASSERT_FAIL("'test", PE_MISSING_QUOTE); } TEST(concatenation) { ASSERT_OK("'NV'.'AR'", "NVAR"); ASSERT_OK("'NV' .'AR'", "NVAR"); ASSERT_OK("'NV'. 'AR'", "NVAR"); ASSERT_OK("'NV' . 'AR'", "NVAR"); } TEST(double_single_quote_ok) { ASSERT_OK("''''", "'"); ASSERT_OK("'foo''bar'", "foo'bar"); } TEST(triple_single_quote_error) { ASSERT_FAIL("'''''", PE_MISSING_QUOTE); } TEST(single_slash_ok) { ASSERT_OK("'\\'", "\\"); } TEST(slash_t_ok) { ASSERT_OK("'\\t'", "\\t"); } TEST(spaces_ok) { ASSERT_OK("' s y '", " s y "); } TEST(dot_ok) { ASSERT_OK("'a . c'", "a . c"); } TEST(very_long_string) { char string[8192]; string[0] = '\''; memset(string + 1, '0', sizeof(string) - 2U); string[sizeof(string) - 1U] = '\0'; ASSERT_FAIL(string, PE_INTERNAL); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/parsing/suite.c0000600000175000017500000000050715051153245014042 0ustar korykory#include #include /* NULL */ #include "../../src/engine/parsing.h" #include DEFINE_SUITE(); SETUP_ONCE() { fix_environ(); } SETUP() { vle_parser_init(NULL); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/bmarks/0000700000175000017500000000000015051153245012355 5ustar korykory./tests/bmarks/list.c0000600000175000017500000000226215051153245013500 0ustar korykory#include "utils.h" #include /* NULL */ #include /* strcmp() */ #include "../../src/bmarks.h" static void bmarks_cb(const char path[], const char tags[], time_t timestamp, void *arg); static int cb_called; TEST(no_call_for_empty_list) { cb_called = 0; bmarks_list(&bmarks_cb, NULL); assert_int_equal(0, cb_called); } TEST(one_call_for_one_item) { assert_success(bmarks_set("fake/path", "tag")); cb_called = 0; bmarks_list(&bmarks_cb, NULL); assert_int_equal(1, cb_called); } TEST(two_calls_for_two_items) { assert_success(bmarks_set("fake/path1", "tag1")); assert_success(bmarks_set("fake/path2", "tag2")); cb_called = 0; bmarks_list(&bmarks_cb, NULL); assert_int_equal(2, cb_called); } TEST(path_is_canonicalized) { assert_success(bmarks_set("parent/../dir//another-dir", "tag1")); assert_success(bmarks_set("dir/another-dir", "tag2")); cb_called = 0; bmarks_list(&bmarks_cb, NULL); assert_int_equal(1, cb_called); } static void bmarks_cb(const char path[], const char tags[], time_t timestamp, void *arg) { ++cb_called; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/bmarks/complete.c0000600000175000017500000000267015051153245014340 0ustar korykory#include #include /* NULL */ #include /* free() */ #include "../../src/engine/completion.h" #include "../../src/bmarks.h" TEST(completes_single_match) { char *completed; assert_success(bmarks_set("fake/dir", "atag,btag,ctag")); vle_compl_reset(); bmarks_complete(0, NULL, "a"); completed = vle_compl_next(); assert_string_equal("atag", completed); free(completed); completed = vle_compl_next(); assert_string_equal("atag", completed); free(completed); } TEST(completes_multiple_matches) { char *completed; assert_success(bmarks_set("fake/dir", "atag,aatag,ctag")); vle_compl_reset(); bmarks_complete(0, NULL, "a"); completed = vle_compl_next(); assert_string_equal("aatag", completed); free(completed); completed = vle_compl_next(); assert_string_equal("atag", completed); free(completed); completed = vle_compl_next(); assert_string_equal("a", completed); free(completed); } TEST(skips_already_typed_tags) { char *completed; const char *used[] = {"atag"}; assert_success(bmarks_set("fake/dir", "atag,aatag,ctag")); vle_compl_reset(); bmarks_complete(1, (char **)used, "a"); completed = vle_compl_next(); assert_string_equal("aatag", completed); free(completed); completed = vle_compl_next(); assert_string_equal("aatag", completed); free(completed); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/bmarks/remove.c0000600000175000017500000000206315051153245014021 0ustar korykory#include #include "../../src/bmarks.h" #include "utils.h" TEST(inexistent_bookmark_is_removed) { bmarks_remove("no/bookmark"); assert_string_equal(NULL, get_tags("no/bookmark")); } TEST(existent_bookmark_is_removed) { assert_success(bmarks_set("bookmark", "tag")); bmarks_remove("bookmark"); assert_string_equal(NULL, get_tags("bookmark")); } TEST(other_bookmark_is_not_touched) { assert_success(bmarks_set("bookmark1", "tag1")); assert_success(bmarks_set("bookmark2", "tag2")); bmarks_remove("bookmark1"); assert_string_equal("tag2", get_tags("bookmark2")); } TEST(bookmark_can_be_recreated) { assert_success(bmarks_set("bookmark", "tag")); bmarks_remove("bookmark"); assert_success(bmarks_set("bookmark", "tag")); assert_string_equal("tag", get_tags("bookmark")); } TEST(path_is_canonicalized) { assert_success(bmarks_set("parent/../dir", "tag")); bmarks_remove("dir"); assert_string_equal(NULL, get_tags("dir")); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/bmarks/is_older.c0000600000175000017500000000113415051153245014322 0ustar korykory#include #include /* NULL */ #include /* time() */ #include "../../src/bmarks.h" TEST(check_for_newer) { assert_success(bmarks_setup("newer", "tag", 0U)); assert_true(bmark_is_older("newer", time(NULL))); } TEST(check_for_older) { assert_success(bmarks_set("newer", "tag")); assert_false(bmark_is_older("newer", 0)); } TEST(path_is_canonicalized) { assert_success(bmarks_set("newer/.", "tag")); assert_false(bmark_is_older("newer", 0)); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/bmarks/utils.c0000600000175000017500000000120615051153245013662 0ustar korykory#include "utils.h" #include /* NULL */ #include /* strcmp() */ #include "../../src/bmarks.h" static void bmarks_cb(const char path[], const char tags[], time_t timestamp, void *arg); static const char *result_tags; const char * get_tags(const char path[]) { result_tags = NULL; bmarks_list(&bmarks_cb, (void *)path); return result_tags; } static void bmarks_cb(const char path[], const char tags[], time_t timestamp, void *arg) { if(strcmp(path, arg) == 0) { result_tags = tags; } } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/bmarks/utils.h0000600000175000017500000000044015051153245013666 0ustar korykory#ifndef VIFM_TESTS__BMARKS__UTILS_H__ #define VIFM_TESTS__BMARKS__UTILS_H__ const char * get_tags(const char path[]); #endif /* VIFM_TESTS__BMARKS__UTILS_H__ */ /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/bmarks/set.c0000600000175000017500000000323715051153245013323 0ustar korykory#include #include "../../src/bmarks.h" #include "utils.h" TEST(lonely_empty_tag_is_rejected) { assert_failure(bmarks_set("lonely/empty/tag/is/rejected", "")); assert_string_equal(NULL, get_tags("lonely/empty/tag/is/rejected")); } TEST(empty_tag_is_rejected_in_any_form) { assert_failure(bmarks_set("empty/tag/is/rejected", ",")); assert_string_equal(NULL, get_tags("empty/tag/is/rejected")); assert_failure(bmarks_set("empty/tag/is/rejected", ",,")); assert_string_equal(NULL, get_tags("empty/tag/is/rejected")); assert_failure(bmarks_set("empty/tag/is/rejected", "abc,,")); assert_string_equal(NULL, get_tags("empty/tag/is/rejected")); assert_failure(bmarks_set("empty/tag/is/rejected", ",xz,de")); assert_string_equal(NULL, get_tags("empty/tag/is/rejected")); assert_failure(bmarks_set("empty/tag/is/rejected", "abc,,de")); assert_string_equal(NULL, get_tags("empty/tag/is/rejected")); } TEST(single_tag_is_set) { assert_success(bmarks_set("single/tag/is/set", "tag")); assert_string_equal("tag", get_tags("single/tag/is/set")); } TEST(tag_is_overwritten) { assert_success(bmarks_set("tag/is/overwritten", "old-tag")); assert_success(bmarks_set("tag/is/overwritten", "new-tag")); assert_string_equal("new-tag", get_tags("tag/is/overwritten")); } TEST(path_is_canonicalized) { assert_success(bmarks_set("parent/../dir", "tag")); assert_string_equal("tag", get_tags("dir")); } TEST(canonicalization_preserves_trailing_slash) { assert_success(bmarks_set("parent/../dir/", "tag")); assert_string_equal("tag", get_tags("dir/")); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/bmarks/update.c0000600000175000017500000000120115051153245013777 0ustar korykory#include #include /* NULL */ #include "../../src/bmarks.h" #include "utils.h" TEST(bmark_is_renamed) { assert_success(bmarks_setup("old", "tag", 0U)); bmarks_file_moved("old", "new"); assert_string_equal("tag", get_tags("new")); assert_string_equal(NULL, get_tags("old")); } TEST(path_is_canonicalized) { assert_success(bmarks_setup("old", "tag", 0U)); bmarks_file_moved("old/.", "new"); assert_string_equal("tag", get_tags("new")); assert_string_equal(NULL, get_tags("old")); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/bmarks/find.c0000600000175000017500000000403215051153245013442 0ustar korykory#include #include /* NULL */ #include "../../src/bmarks.h" static void bmarks_cb(const char path[], const char tags[], time_t timestamp, void *arg); static int nmatches; TEST(finds_nothing_for_empty_tags) { assert_success(bmarks_set("finds/nothing/for/empty/tags", "a,b,c")); nmatches = 0; bmarks_find("", &bmarks_cb, NULL); assert_int_equal(0, nmatches); nmatches = 0; bmarks_find(",", &bmarks_cb, NULL); assert_int_equal(0, nmatches); nmatches = 0; bmarks_find(",,", &bmarks_cb, NULL); assert_int_equal(0, nmatches); } TEST(finds_nothing) { assert_success(bmarks_set("finds/nothing", "a,b,c")); nmatches = 0; bmarks_find("d", &bmarks_cb, NULL); assert_int_equal(0, nmatches); } TEST(finds_single_match) { assert_success(bmarks_set("finds/single/match1", "a,b,c")); assert_success(bmarks_set("finds/single/match2", "d,e,f")); nmatches = 0; bmarks_find("d", &bmarks_cb, NULL); assert_int_equal(1, nmatches); nmatches = 0; bmarks_find("d,e", &bmarks_cb, NULL); assert_int_equal(1, nmatches); nmatches = 0; bmarks_find("a,b", &bmarks_cb, NULL); assert_int_equal(1, nmatches); } TEST(finds_multiple_matches) { assert_success(bmarks_set("finds/multiple/matches1", "a,b,c,x")); assert_success(bmarks_set("finds/multiple/matches2", "d,e,f,x")); nmatches = 0; bmarks_find("x", &bmarks_cb, NULL); assert_int_equal(2, nmatches); nmatches = 0; bmarks_find("x,x", &bmarks_cb, NULL); assert_int_equal(2, nmatches); } TEST(finds_intersection_of_matches) { assert_success(bmarks_set("finds/intersection/of/matches1", "a,b,c,x")); assert_success(bmarks_set("finds/intersection/of/matches2", "d,e,f,x")); nmatches = 0; bmarks_find("a,e", &bmarks_cb, NULL); assert_int_equal(0, nmatches); nmatches = 0; bmarks_find("f,b,d", &bmarks_cb, NULL); assert_int_equal(0, nmatches); } static void bmarks_cb(const char path[], const char tags[], time_t timestamp, void *arg) { ++nmatches; } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/bmarks/suite.c0000600000175000017500000000033515051153245013655 0ustar korykory#include #include "../../src/bmarks.h" DEFINE_SUITE(); SETUP() { bmarks_clear(); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/bmarks/clear.c0000600000175000017500000000075015051153245013613 0ustar korykory#include #include /* NULL */ #include "../../src/bmarks.h" #include "utils.h" TEST(clear_removes_all_bookmarks) { assert_success(bmarks_set("clear/removes/all/bookmarks", "tag")); assert_string_equal("tag", get_tags("clear/removes/all/bookmarks")); bmarks_clear(); assert_string_equal(NULL, get_tags("clear/removes/all/bookmarks")); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ ./tests/test-data/0000700000175000017500000000000015051153245012764 5ustar korykory./tests/test-data/existing-files/0000700000175000017500000000000015051153245015716 5ustar korykory./tests/test-data/existing-files/a0000600000175000017500000000000015051153245016051 0ustar korykory./tests/test-data/existing-files/c0000600000175000017500000000000015051153245016053 0ustar korykory./tests/test-data/existing-files/b0000600000175000017500000000000015051153245016052 0ustar korykory./tests/test-data/compare/0000700000175000017500000000000015051153245014412 5ustar korykory./tests/test-data/compare/a/0000700000175000017500000000000015051153245014632 5ustar korykory./tests/test-data/compare/a/same-content-different-name-10000600000175000017500000000134015051153245022172 0ustar korykoryasfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df ./tests/test-data/compare/a/same-name-different-content0000600000175000017500000000000015051153245022024 0ustar korykory./tests/test-data/compare/a/same-name-same-content0000600000175000017500000000000515051153245021010 0ustar korykoryaaaa ./tests/test-data/compare/b/0000700000175000017500000000000015051153245014633 5ustar korykory./tests/test-data/compare/b/same-content-different-name-10000600000175000017500000000134015051153245022173 0ustar korykoryasfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df ./tests/test-data/compare/b/same-name-different-content0000600000175000017500000000001215051153245022030 0ustar korykorysomething ./tests/test-data/compare/b/same-content-different-name-20000600000175000017500000000134015051153245022174 0ustar korykoryasfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df asfasdfasdfasdf asdfas dfasdfdfa sdfasdfas df ./tests/test-data/compare/b/same-name-same-content0000600000175000017500000000000515051153245021011 0ustar korykoryaaaa ./tests/test-data/tree/0000700000175000017500000000000015051153245013723 5ustar korykory./tests/test-data/tree/.hidden0000600000175000017500000000000015051153245015147 0ustar korykory./tests/test-data/tree/dir1/0000700000175000017500000000000015051153245014562 5ustar korykory./tests/test-data/tree/dir1/dir2/0000700000175000017500000000000015051153245015422 5ustar korykory./tests/test-data/tree/dir1/dir2/dir3/0000700000175000017500000000000015051153245016263 5ustar korykory./tests/test-data/tree/dir1/dir2/dir3/file20000600000175000017500000000000015051153245017177 0ustar korykory./tests/test-data/tree/dir1/dir2/dir3/file10000600000175000017500000000000015051153245017176 0ustar korykory./tests/test-data/tree/dir1/dir2/dir4/0000700000175000017500000000000015051153245016264 5ustar korykory./tests/test-data/tree/dir1/dir2/dir4/file30000600000175000017500000000000015051153245017201 0ustar korykory./tests/test-data/tree/dir1/file40000600000175000017500000000000015051153245015500 0ustar korykory./tests/test-data/tree/dir5/0000700000175000017500000000000015051153245014566 5ustar korykory./tests/test-data/tree/dir5/.nested_hidden0000600000175000017500000000000015051153245017354 0ustar korykory./tests/test-data/tree/dir5/file50000600000175000017500000000000015051153245015505 0ustar korykory./tests/test-data/color-schemes/0000700000175000017500000000000015051153245015527 5ustar korykory./tests/test-data/color-schemes/good.vifm0000600000175000017500000000007115051153245017342 0ustar korykoryhighlight Win cterm=none ctermfg=default ctermbg=default ./tests/test-data/color-schemes/bad-color.vifm0000600000175000017500000000004315051153245020253 0ustar korykoryhighlight Win ctermfg=badcolorname ./tests/test-data/color-schemes/bad-cmd.vifm0000600000175000017500000000001715051153245017701 0ustar korykorynosuchacommand ./tests/test-data/scripts/0000700000175000017500000000000015051153245014453 5ustar korykory./tests/test-data/scripts/wrong-udcmd-name.vifm0000600000175000017500000000002615051153245020502 0ustar korykorycommand! 1digit do-it ./tests/test-data/scripts/append-env.vifm0000600000175000017500000000002415051153245017371 0ustar korykorylet $ENV .= 'value' ./tests/test-data/scripts/wrong-cmd-name.vifm0000600000175000017500000000003015051153245020144 0ustar korykorythiscommanddoesnotexist ./tests/test-data/scripts/finish-inside-if.vifm0000600000175000017500000000003315051153245020461 0ustar korykoryif 1 == 1 finish endif ./tests/test-data/scripts/trailing-line-continuation.vifm0000600000175000017500000000002215051153245022600 0ustar korykorylet $ENV = 'a \b' ./tests/test-data/scripts/set-env.vifm0000600000175000017500000000001515051153245016715 0ustar korykorylet $ENV = 1 ./tests/test-data/scripts/finish-inside-ifs.vifm0000600000175000017500000000013315051153245020645 0ustar korykoryif 0 == 0 if 1 == 1 if 2 == 2 finish endif endif endif ./tests/test-data/read/0000700000175000017500000000000015051153245013677 5ustar korykory./tests/test-data/read/very-long-line0000600000175000017500000001232015051153245016471 0ustar korykory# short line f^vc1gx_05\.jpg\.part$|^vb8he_11\.jpg\.part$|^vb5hg_05\.jpg\.part$|^va9ha_06\.jpg\.part$|^va7hc_08\.jpg\.part$|^va3hc_13\.jpg\.part$|^va3hc_01\.jpg\.part$|^va1gp_08\.jpg\.part$|^v9zgq_06\.jpg\.part$|^v9ygx_08\.jpg\.part$|^v9xgk_07\.jpg\.part$|^v9tgx_07\.jpg\.part$|^v9sgk_09\.jpg\.part$|^v9rge_06\.jpg\.part$|^v9nbo_02\.jpg\.part$|^v9kfu_12\.jpg\.part$|^v9igs_07\.jpg\.part$|^v9hgb_03\.jpg\.part$|^v9ego_06\.jpg\.part$|^v9bgm_14\.jpg\.part$|^v9bgm_05\.jpg\.part$|^v9agn_09\.jpg\.part$|^v8zfp_14\.jpg\.part$|^v8zfp_03\.jpg\.part$|^v8udk_11\.jpg\.part$|^v8udk_05\.jpg\.part$|^v8tgh_12\.jpg\.part$|^v8nbt_08\.jpg\.part$|^v8kfc_01\.jpg\.part$|^v8ifw_11\.jpg\.part$|^v8hfz_12\.jpg\.part$|^v8gfx_12\.jpg\.part$|^v8ebj_04\.jpg\.part$|^v8bpr_07\.jpg\.part$|^v7yfp_10\.jpg\.part$|^v7rfo_09\.jpg\.part$|^v7nfq_09\.jpg\.part$|^v7ifk_11\.jpg\.part$|^v7ifk_03\.jpg\.part$|^v7hfp_10\.jpg\.part$|^v7gfm_05\.jpg\.part$|^v7efn_04\.jpg\.part$|^v7bfm_04\.jpg\.part$|^v6zex_05\.jpg\.part$|^v6xfn_09\.jpg\.part$|^v6xfn_01\.jpg\.part$|^v6wfk_01\.jpg\.part$|^v6sej_03\.jpg\.part$|^v6oej_05\.jpg\.part$|^v6naa_05\.jpg\.part$|^v6jex_03\.jpg\.part$|^v6hek_06\.jpg\.part$|^v6faj_04\.jpg\.part$|^v6dfm_08\.jpg\.part$|^v6cem_06\.jpg\.part$|^v6cem_02\.jpg\.part$|^v6baz_08\.jpg\.part$|^v5pdg_01\.jpg\.part$|^v5mbk_04\.jpg\.part$|^v5lek_04\.jpg\.part$|^v5hem_02\.jpg\.part$|^v4wen_02\.jpg\.part$|^v4rbi_03\.jpg\.part$|^v4mbk_03\.jpg\.part$|^v4lam_01\.jpg\.part$|^v4jas_05\.jpg\.part$|^v4ibx_02\.jpg\.part$|^v4gbr_01\.jpg\.part$|^v4dbt_05\.jpg\.part$|^v4cbk_02\.jpg\.part$|^v4baq_04\.jpg\.part$|^v3yaa_04\.jpg\.part$|^v3xbu_01\.jpg\.part$|^v3sbq_02\.jpg\.part$|^v3abg_01\.jpg\.part$|^sb7ae_08\.jpg\.part$|^sb6hh_09\.jpg\.part$|^sb4ha_08\.jpg\.part$|^sb3hg_04\.jpg\.part$|^sb1gw_03\.jpg\.part$|^sa9fq_12\.jpg\.part$|^sa9fq_01\.jpg\.part$|^sa8hd_01\.jpg\.part$|^sa6hd_05\.jpg\.part$|^sa4hb_10\.jpg\.part$|^sa3gw_09\.jpg\.part$|^sa1ep_13\.jpg\.part$|^s9zep_12\.jpg\.part$|^s9yfp_02\.jpg\.part$|^s9ogt_05\.jpg\.part$|^s9nfe_15\.jpg\.part$|^s9nfe_02\.jpg\.part$|^s9mgs_02\.jpg\.part$|^s9hfp_04\.jpg\.part$|^s9gas_05\.jpg\.part$|^s9fbo_03\.jpg\.part$|^s9efw_09\.jpg\.part$|^s8xgl_14\.jpg\.part$|^s8wbg_04\.jpg\.part$|^s8tag_04\.jpg\.part$|^s8qgb_06\.jpg\.part$|^s8pgf_06\.jpg\.part$|^s8ngv_12\.jpg\.part$|^s8lgc_14\.jpg\.part$|^s8lgc_02\.jpg\.part$|^s8hfp_01\.jpg\.part$|^s8gga_03\.jpg\.part$|^s8efx_13\.jpg\.part$|^s8bfw_02\.jpg\.part$|^s7ybh_03\.jpg\.part$|^s7xfu_10\.jpg\.part$|^s7xfu_02\.jpg\.part$|^s7ubk_03\.jpg\.part$|^s7tfo_11\.jpg\.part$|^s7tfo_01\.jpg\.part$|^s7qpr_09\.jpg\.part$|^s7odf_02\.jpg\.part$|^s7lfr_08\.jpg\.part$|^s7kfr_06\.jpg\.part$|^s7eat_02\.jpg\.part$|^s7abh_06\.jpg\.part$|^s6ubk_01\.jpg\.part$|^s6raj_01\.jpg\.part$|^s6lbz_04\.jpg\.part$|^s6kwp_03\.jpg\.part$|^s6aej_02\.jpg\.part$|^s5yaj_02\.jpg\.part$|^s5weq_02\.jpg\.part$|^s5twp_03\.jpg\.part$|^s5caj_01\.jpg\.part$|^s4wej_02\.jpg\.part$|^s4pbo_01\.jpg\.part$|^s4ipc_01\.jpg\.part$|^s4esm_01\.jpg\.part$|^s3vbk_01\.jpg\.part$|^s3bbi_01\.jpg\.part$|^s2mas_01\.jpg\.jpg\.part$|^s1dsi_01\.jpg\.part$|^lb9aq_07\.jpg\.part$|^lb6gz_10\.jpg\.part$|^lb5ah_11\.jpg\.part$|^lb2gn_05\.jpg\.part$|^lb1go_11\.jpg\.part$|^la9hg_08\.jpg\.part$|^la5hc_08\.jpg\.part$|^la4gx_11\.jpg\.part$|^la3gs_03\.jpg\.part$|^l53as_04\.jpg\.part$|^l9wep_14\.jpg\.part$|^l9vgx_13\.jpg\.part$|^l9ugh_11\.jpg\.part$|^l9trn_12\.jpg\.part$|^l9pfq_08\.jpg\.part$|^l9ogp_12\.jpg\.part$|^l9lff_08\.jpg\.part$|^l9kgp_09\.jpg\.part$|^l9kgp_03\.jpg\.part$|^l9hgm_01\.jpg\.part$|^l9ggp_07\.jpg\.part$|^l9fgl_02\.jpg\.part$|^l9cdk_11\.jpg\.part$|^l9cdk_02\.jpg\.part$|^l8vfj_06\.jpg\.part$|^l8sfp_10\.jpg\.part$|^l8rgh_08\.jpg\.part$|^l8qam_04\.jpg\.part$|^l8oet_01\.jpg\.part$|^l8nek_09\.jpg\.part$|^l8lfk_03\.jpg\.part$|^l8jfu_10\.jpg\.part$|^l8ifk_13\.jpg\.part$|^l8hgb_12\.jpg\.part$|^l8dfw_13\.jpg\.part$|^l8cae_08\.jpg\.part$|^l8bel_05\.jpg\.part$|^l8afp_13\.jpg\.part$|^l8afp_03\.jpg\.part$|^l7yfm_13\.jpg\.part$|^l7yfm_01\.jpg\.part$|^l7wfo_11\.jpg\.part$|^l7tfl_01\.jpg\.part$|^l7qfo_11\.jpg\.part$|^l7pbj_06\.jpg\.part$|^l7ofn_09\.jpg\.part$|^l7jam_01\.jpg\.part$|^l7gat_10\.jpg\.part$|^l7fsq_13\.jpg\.part$|^l7eas_05\.jpg\.part$|^l7dak_04\.jpg\.part$|^l7cbi_01\.jpg\.part$|^l6yfj_01\.jpg\.part$|^l6wdb_03\.jpg\.part$|^l6leg_02\.jpg\.part$|^l6iel_05\.jpg\.part$|^l6has_06\.jpg\.part$|^l6gbv_01\.jpg\.part$|^l5yeq_03\.jpg\.part$|^l5weg_06\.jpg\.part$|^l5res_02\.jpg\.part$|^l5qbh_01\.jpg\.part$|^l5oeg_01\.jpg\.part$|^l5nbu_02\.jpg\.part$|^l5ldf_03\.jpg\.part$|^l5kbg_01\.jpg\.part$|^l5faz_03\.jpg\.part$|^l5cbh_02\.jpg\.part$|^l5bbu_02\.jpg\.part$|^l4xam_02\.jpg\.part$|^l4vbr_02\.jpg\.part$|^l4oag_01\.jpg\.part$|^l4jas_06\.jpg\.part$|^l4gaz_02\.jpg\.part$|^l4eag_08\.jpg\.part$|^l4dbt_02\.jpg\.part$|^l4baq_12\.jpg\.part$|^l3vbk_02\.jpg\.part$|^l3upc_03\.jpg\.part$|^l3rds_09\.jpg\.part$|^l3rds_04\.jpg\.part$|^l3qpc_10\.jpg\.part$|^l3qpc_01\.jpg\.part$|^l3obs_11\.jpg\.part$|^l3nat_10\.jpg\.part$|^l3mbh_08\.jpg\.part$|^l3kds_03\.jpg\.part$|^l3abg_04\.jpg\.part$|^l2yae_06\.jpg\.part$|^l2saq_08\.jpg\.part$|^l2qag_03\.jpg\.part$|^l2oac_05\.jpg\.part$|^l2iad_08\.jpg\.part$|^l1gsf_04\.jpg\.part$|^l1asl_04\.jpg\.part$|^jc1db_03\.jpg\.part$|^jb9gm_08\.jpg\.part$|^jb6hf_08\.jpg\.part$|^jb3fp_12\.jpg\.part$|^jb2hh_02\.jpg\.part$|^jb1gm_01\.jpg\.part$ # the line above is empty # this is the last file ./tests/test-data/read/binary-data0000600000175000017500000000200015051153245016007 0ustar korykory  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÿþýüûúùø÷öõôóòñðïîíìëêéèçæåäãâáàßÞÝÜÛÚÙØ×ÖÕÔÓÒÑÐÏÎÍÌËÊÉÈÇÆÅÄÃÂÁÀ¿¾½¼»º¹¸·¶µ´³²±°¯®­¬«ª©¨§¦¥¤£¢¡ Ÿžœ›š™˜—–•”“’‘ŽŒ‹Š‰ˆ‡†…„ƒ‚€~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!  ÿþýüûúùø÷öõôóòñðïîíìëêéèçæåäãâáàßÞÝÜÛÚÙØ×ÖÕÔÓÒÑÐÏÎÍÌËÊÉÈÇÆÅÄÃÂÁÀ¿¾½¼»º¹¸·¶µ´³²±°¯®­¬«ª©¨§¦¥¤£¢¡ Ÿžœ›š™˜—–•”“’‘ŽŒ‹Š‰ˆ‡†…„ƒ‚€~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!  ./tests/test-data/read/dos-line-endings0000600000175000017500000000004215051153245016757 0ustar korykoryfirst line second line third line ./tests/test-data/read/utf8-bom0000600000175000017500000000001115051153245015255 0ustar korykory1 2 ./tests/test-data/read/dos-eof0000600000175000017500000000006215051153245015156 0ustar korykorynext line contains EOF  this is "invisible" line ./tests/test-data/read/two-lines0000600000175000017500000000002215051153245015537 0ustar korykory1st line 2nd line ./tests/test-data/quotes-in-names/0000700000175000017500000000000015051153245016011 5ustar korykory./tests/test-data/quotes-in-names/s-quote-'-in-name0000600000175000017500000000000015051153245020767 0ustar korykory./tests/test-data/quotes-in-names/s-quote-'-in-name-20000600000175000017500000000000015051153245021126 0ustar korykory./tests/test-data/syntax-highlight/0000700000175000017500000000000015051153245016257 5ustar korykory./tests/test-data/syntax-highlight/syntax.vifm0000600000175000017500000005210015051153245020470 0ustar korykory" "s" should NOT be highlighted nnoremap ,E :%nextract . %c:cd %c:r:s/\.tar$// " "" in the last line should be highlighted as angle bracket notation nnoremap az : if expand('%c') == expand('%f') \ | execute '!pack %c.zip %c' \ | else \ | execute '!pack %d:t.zip %f' \ | endif \ | normal j " both occurrences of "" should be highlighted as angle bracket notation nnoremap bb :marks " non of arguments should be highlighted touch copy-init.cp m e20-en.avi co e20-en.avi mkdir mkdir " "" should be highlighted as angle bracket notation nnoremap o :! " this should be highlighted as a comment " "edit" should be highlighted as :commands edit file " this should be highlighted as a comment " "" should be highlighted as angle bracket notation nnoremap ,b :set viewcolumns=-{name}..,6{}. nnoremap ,b :set viewcolumns='-{name}..,6{}.' nnoremap ,b :set viewcolumns="-{name}..,6{}." " ":nnoremap" and ":let" should be highlighted as :commands " "$a" as environment variable " "'a'" as a string " "" and "" should be highlighted as angle bracket notation nnoremap s :let $a = 'a' " "" should be highlighted as angle bracket notation " "" should be highlighted as angle bracket notation map ,b :set viewcolumns="-{name}..,6{}." map ,b :set viewcolumns="-{name}..,6{}." map ,b :set viewcolumns="-{name}..,6{}." map ,b :set viewcolumns="-{name}..,6{}." map ,b :set viewcolumns="-{name}..,6{}." nnoremap a b nmap a b cnoremap a b cmap a b qnoremap a b qmap a b dnoremap a b dmap a b " "" shouldn't be highlighted " "" shouldn't be highlighted map ,b :set viewcolumns="-{name}..,6{}." map ,b :set viewcolumns="-{name}..,6{}." " "" should be highlighted as angle bracket notation nnoremap j " the second and third lines should be highlighted as comments " "trash" in the line after comments should NOT be highlighted set slowfs=fuse.sshfs "set slowfs=fuse.sshfs,curlftpfs "set slowfs=fuse.sshfs,curlftpfs \trash \ trash \ trash \ trash \ trash " "set" should NOT be highlighted as :command " "not comment should NOT be highlighted as a comment " "'vim -p'" should be highlighted as 'string' " ""vim -p"" should be highlighted as "string" " "vicmd" and "trashdir" should be highlighted as 'option' name " 1st, 2nd, last occurrences of "trash" should be highlighted as 'option' name " nothing else should be highlighted (watch "trash") set trashdir= trash \ trashdir= trash "not comment \ trashdir=\ trash \ vicmd='vim -p' vicmd="vim -p" trash " "set" should NOT be highlighted as :command " "trashdir" should be highlighted as 'option' name " "trash" on right-hand side should NOT be highlighted at all set trashdir=%r/.vifm-Trash,$HOME/.vifm/trash " highlight of "trash" and "trashdir" should be of 'option' name group on both " lines set trash trashdir=$HOME/.vifm/trash set trashdir=$HOME/.vifm/trash trash " "comment should be highlighted as comment set vifminfo=dhistory,save,dirstack,registers,bookmarks "comment " "$VIFM" should be highlighted as environment variable name " `" comment` should be highlighted as a comment source $VIFM/vifmrc_local " comment unlet $VIFM " не подÑвечены Ñтроки cd "Ñтрока не подÑвечена" nnoremap foo :cd "Ñтрока не подÑвечена" so "/tmp/%a.vifm" command! eso :exe ':!vim "/tmp/%a.vifm"' | so "/tmp/%a.vifm" let $FOO="foo" " комментарий подÑвечен как Ñтрока let $FOO="foo" " комментарий не подÑвечен invert f invert s invert o invert? f invert? s invert? o " "not comment should NOT be highlighted as comment nnoremap ga "not a comment \ : if filetype('.') == 'dir' \ | execute 'Ñтрока подÑвечиваетÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ до | а поÑле подÑвечиваетÑÑ Ð½Ðµ как Ñтрока' \ | endif " еще не подÑвечен endif и Ñтот комментарий " "not comment should NOT be highlighted as comment nnoremap ,sn \ "not a comment \L|2< \:fileviewer *,*/ seq 2 999 || echo "echo не подÑвечено как ключевое Ñлово и Ñта Ñтрока не подÑвечена как Ñтрока" \:view! \l " "ts" should be highlighted as 'option' name only in the first line :set ts :let ts :hi ts command foo \ bar "this should NOT be highlighted as comment " this should be highlighted as comment " this should be highlighted as comment too \ biz map foo bar " this should be highlighted as comment, "cd" below as a :command and " "" as angle bracket notation \ :cd " this should be highlighted as comment " this should be highlighted as comment too \ biz command foo bar " this should be highlighted as comment " this should be highlighted as comment too map foo \ bar " this should be highlighted as comment " this should be highlighted as comment too command foo :bar " this should be highlighted as comment, but "" above should NOT be " highlighted at all map foo :bar " this should be highlighted as comment " this should be highlighted as comment too " "$HOME" should be highlighted as environment variable " "" should be highlighted as bracket notation nnoremap gh :cd $HOME " "" as bracket notation cnoremap " left-hand side should be highlighted as bracket notation nnoremap rhs nnoremap rhs nnoremap rhs nnoremap rhs nnoremap rhs nnoremap rhs nnoremap rhs cnoremap sh cnoremap se cnoremap sl cnoremap sr cnoremap su cnoremap sd cnoremap sdel cnoremap sins cnoremap spu cnoremap spd " "windo" and "normal" should be highlighted as :command " "" should NOT be highlighted as bracket notation windo normal zo " "$HOME" should be highlighted as environment variable " "" should NOT be highlighted as bracket notation windo normal :cd $HOME windo normal :execute 'a' " fileviewer и view не подÑвечены как ключевые Ñлова, но Ñлучай вроде оÑобый nnoremap ,sn \ \L|2< \:fileviewer *,*/ seq 2 999 || echo "false" \:view! \l command! foo :echo 'не подÑвечено из-за !' " echo and string on the second line should NOT be highlighted, while " should nnoremap aw :!%S echo %c:p >> ~/.config/watch-queue \ && echo 'Stored to watch queue.' " "100" should be highlighted as a number if &columns < 100 only else vsplit endif " all single quoted strings should be highlighted command cx :cd ~/projects/experiments/ | mkdir '%a' | cd '%a' | touch '%%d:t.c' " highlight operators if &columns == != > >= < <= . - + 100 only else vsplit endif " both patterns should be highlighted " "d" between vertical bars should NOT be highlighted in any special way in " either of lines windo filter! /^.*\.(o|d|class|pyc)$|^\$RECYCLE\.BIN\/$/ windo filter /^.*\.(o|d|class|pyc)$|^\$RECYCLE\.BIN\/$/ " ":cd" should be highlighted as a :command in both lines below nnoremap ,e :!%nextract ~/tmp %c:cd ~/tmp/%C:t:r:s/\.tar$// nnoremap ,E :!%nextract . %c:cd %c:r:s/\.tar$// " "highlight" should be highlighted as a :command in both lines below " "clear" should be highlighted as a :command in both lines below " "clear2" should NOT be highlighted highlight clear highlight clear2 " "nnoremap" should be highlighted as a :command " "" should be highlighted as angle bracket notation " "mkdir" should be highlighted as a :command " "" and "" should be highlighted as angle bracket notation nnoremap :mkdir nnoremap ,s :restart " "{*.h,*.c}" and "!{*.h,*.c}" should be highlighted as a 'string' highlight {*.h,*.c} cterm=bold ctermfg=yellow highlight !{*.h,*.c} cterm=bold ctermfg=yellow " "{}" and "!{}" should NOT be highlighted highlight {} cterm=bold ctermfg=yellow highlight !{} cterm=bold ctermfg=yellow " "" and "!" should be highlighted as a 'string' highlight cterm=bold ctermfg=yellow highlight ! cterm=bold ctermfg=yellow " "<>" and "!<>" should NOT be highlighted highlight <> cterm=bold ctermfg=yellow highlight !<> cterm=bold ctermfg=yellow " "/\.(7z|Z|a|ace|alz|apkg)$/[iI]" and "!/\.(7z|Z|a|ace|alz|apkg)$/[iI]" should " be highlighted as a 'string' highlight /\.(7z|Z|a|ace|alz|apkg)$/ ctermfg=red highlight /\.(7z|Z|a|ace|alz|apkg)$/i ctermfg=red highlight /\.(7z|Z|a|ace|alz|apkg)$/I ctermfg=red highlight !/\.(7z|Z|a|ace|alz|apkg)$/iI ctermfg=red highlight /\.(7z|Z|a|ace|alz|apkg)$/Ii ctermfg=red highlight /\.(7z|Z|a|ace|alz|apkg)$/IiI ctermfg=red " leading "!" should NOT be highlighted as a 'string' highlight !!/\.(7z|Z|a|ace|alz|apkg)$/iI ctermfg=red " "/\.(7z|Z|a|ace|alz|apkg)$/" (but not "g") should be highlighted as a 'string' highlight /\.(7z|Z|a|ace|alz|apkg)$/g ctermfg=red " "//" should NOT be highlighted highlight // ctermfg=red " comments and patterns should be highlighted properly (as stated above) highlight /.*\.djvu$| \.*\.tex$| " \.*\.txt$| \.*\.xhtml$| \.*\.xml$/iI cterm=underline ctermfg=188 ctermbg=default highlight //.*\.djvu$| \.*\.tex$| " \.*\.txt$| \.*\.xhtml$| \.*\.xml$//iI cterm=underline ctermfg=188 ctermbg=default highlight {*.djvu, \*.tex, " *.txt, \*.xhtml, \*.xml} cterm=underline ctermfg=188 ctermbg=default highlight {{*.djvu, \*.tex, " *.txt, \*.xhtml, \*.xml}} cterm=underline ctermfg=188 ctermbg=default " "not comment should NOT be highlighted as comment " " \*.xhtml, should be highlighted as comment highlight {*.djvu, "not comment " \*.xhtml, \*.xml} cterm=underline ctermfg=188 ctermbg=default " "column:*" should be highlighted highlight column:ext cterm=bold highlight column:iname cterm=bold highlight column:Custom cterm=bold " "column:bad" shouldn't be highlighted highlight column:bad cterm=bold " "italic" should be highlighted " "combine" should be highlighted highlight Win cterm=italic highlight Win cterm=combine " "guifg", "guibg" and "gui" should be highlighted " "#14fd14" should be highlighted highlight Win guifg=yellow guibg=#14fd14 gui=combine " patterns here should NOT be highlighted highlight // cterm=bold ctermfg=yellow highlight //// cterm=bold ctermfg=yellow highlight {} cterm=bold ctermfg=yellow highlight {{}} cterm=bold ctermfg=yellow highlight <> cterm=bold ctermfg=yellow " patterns here should be highlighted (except for {{}} suffix) highlight /a/ cterm=bold ctermfg=yellow highlight /a\/b/ cterm=bold ctermfg=yellow highlight //full/path/to\/file// cterm=bold ctermfg=yellow highlight //fullpath// cterm=bold ctermfg=yellow highlight //a//{things}{{}} cterm=bold ctermfg=yellow highlight {{?}} cterm=bold ctermfg=yellow filetype *.vifm {Open in Vim} vim filextype {{*.vifm}} {Open in Vim} vim filextype {*.vifm},/regex/{*.pdf} \ {Open in Vim} vim filextype {*.vifm},/regex/,{*.pdf} \ {Open in Vim} vim filetype {*.vifm},{{*.pdf}} \ {Open in Vim} vim fileviewer {*.vifm},//some/regex\/here//,{*.pdf} \ cat " "cabbrev", "cnoreabbrev" and "cunabbrev" should be highlighted as :commands " "" and "" should be highlighted as angle bracket notation cabbrev utf2cp iconv-futf-8-tcp1251 cabbrev fi filter! cabbrev pathtosomething C:/path/to/something cnoreabbrev ddd e cunabbrev bbb c cabbrev pyp python-c'print' " "command" and ":normal" should be highlighted as :commands " "something should be highlighted as comment command! myredraw :normal! "something " "autocmd" and ":setlocal" should be highlighted as :commands " "DirEnter" should be highlighted as autocommand event name " 'sort' should be highlighted as option " "comment should be highlighted as comment autocmd DirEnter ~/downloads,~/downloads/torrents setlocal sort=-mtime,dir "comment " "fileviewer" should be highlighted as :commands " "not comment should NOT be highlighted fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm "not comment \ imgt %px %py %pw %ph %c "not comment " "fileviewer" should be highlighted as :command " `" \ comment1` should be highlighted as comment " `" \ comment2` should be highlighted as comment fileviewer *.ext " \ comment1 " \ comment2 \ cmd " "fileviewer" should be highlighted as :command " "/,*/" should not be highlighted as a pattern fileviewer .*/,*/ tree %f " "," must not be highlighted filextype /regex/,{*.pdf} filextype /reg\/ex/,{*.pdf} filetype {*.spx,*.opus}, \