xaizek / hstr (License: Apachev2) (since 2018-12-07)
Bash and Zsh shell history suggest box - easily view, navigate, search and manage your command history.
Commit 2571e993fc02771e269de19d5ea0b12bba9fdf34

Use Mac-specific checks for ncurses
Author: Ryan Baumann
Author date (UTC): 2015-02-24 15:02
Committer name: Ryan Baumann
Committer date (UTC): 2015-02-24 15:02
Parent(s): 44d63a8e80b53d2eaac22f02c63a7cdae1067055
Signing key:
Tree: 1c42fedb1cd1c723df4ae7db6e4e9bd4a68be499
File Lines added Lines deleted
configure.ac 13 2
src/hstr.c 4 0
src/include/hstr_curses.h 4 0
File configure.ac changed (mode: 100644) (index 28dab14..38eae09)
... ... AM_INIT_AUTOMAKE
16 16 # Checks for programs. # Checks for programs.
17 17 AC_PROG_CC AC_PROG_CC
18 18
19 # Mac-specific ncurses check
20 AC_CANONICAL_HOST
21 case $host_os in
22 darwin*)
23 AC_CHECK_LIB(ncurses, killwchar, [], [AC_MSG_ERROR([Could not find ncurses library])])
24 AC_CHECK_HEADER(curses.h)
25 ;;
26 *)
27 AC_CHECK_LIB(ncursesw, killwchar, [], [AC_MSG_ERROR([Could not find ncursesw library])])
28 AC_CHECK_HEADER(ncursesw/curses.h)
29 ;;
30 esac
31
19 32 # Checks for libraries. # Checks for libraries.
20 AC_CHECK_LIB(ncursesw, killwchar, [], [AC_MSG_ERROR([Could not find ncursesw library])])
21 33 AC_CHECK_LIB(m, cos, [], [AC_MSG_ERROR([Could not find m library])]) AC_CHECK_LIB(m, cos, [], [AC_MSG_ERROR([Could not find m library])])
22 34 AC_CHECK_LIB(readline, using_history, [], [AC_MSG_ERROR([Could not find readline library])]) AC_CHECK_LIB(readline, using_history, [], [AC_MSG_ERROR([Could not find readline library])])
23 35
 
... ... AC_CHECK_HEADER(fcntl.h)
28 40 AC_CHECK_HEADER(getopt.h) AC_CHECK_HEADER(getopt.h)
29 41 AC_CHECK_HEADER(locale.h) AC_CHECK_HEADER(locale.h)
30 42 AC_CHECK_HEADER(math.h) AC_CHECK_HEADER(math.h)
31 AC_CHECK_HEADER(ncursesw/curses.h)
32 43 AC_CHECK_HEADER(readline/history.h) AC_CHECK_HEADER(readline/history.h)
33 44 AC_CHECK_HEADER(regex.h) AC_CHECK_HEADER(regex.h)
34 45 AC_CHECK_HEADER(signal.h) AC_CHECK_HEADER(signal.h)
File src/hstr.c changed (mode: 100644) (index c2fa25c..5670d76)
11 11
12 12 #include <getopt.h> #include <getopt.h>
13 13 #include <locale.h> #include <locale.h>
14 #ifdef __APPLE__
15 #include <curses.h>
16 #else
14 17 #include <ncursesw/curses.h> #include <ncursesw/curses.h>
18 #endif
15 19 #include <readline/chardefs.h> #include <readline/chardefs.h>
16 20 #include <regex.h> #include <regex.h>
17 21 #include <signal.h> #include <signal.h>
File src/include/hstr_curses.h changed (mode: 100644) (index f90081a..5a32017)
10 10 #ifndef _HSTR_CURSES_H #ifndef _HSTR_CURSES_H
11 11 #define _HSTR_CURSES_H #define _HSTR_CURSES_H
12 12
13 #ifdef __APPLE__
14 #include <curses.h>
15 #else
13 16 #include <ncursesw/curses.h> #include <ncursesw/curses.h>
17 #endif
14 18
15 19 #define color_attr_on(C) if(terminal_has_colors()) { attron(C); } #define color_attr_on(C) if(terminal_has_colors()) { attron(C); }
16 20 #define color_attr_off(C) if(terminal_has_colors()) { attroff(C); } #define color_attr_off(C) if(terminal_has_colors()) { attroff(C); }
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/hstr

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/hstr

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master