xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 841e4a49d10b4bdca13cfa507d66c7a322ddc630

Make int/term_title.c:get_title_kind() testable
Author: xaizek
Author date (UTC): 2019-07-25 16:48
Committer name: xaizek
Committer date (UTC): 2019-07-25 16:48
Parent(s): 0227a3ca1c3ec08b3546c8c52a7f579b9919a766
Signing key: 99DC5E4DB05F6BE2
Tree: 88844674e6fb6ee4cfb2b9d660be467ad3f9b40c
File Lines added Lines deleted
src/int/term_title.c 3 2
src/int/term_title.h 16 0
File src/int/term_title.c changed (mode: 100644) (index bf0850926..a33f5342a)
40 40 #include "../utils/macros.h" #include "../utils/macros.h"
41 41 #include "../utils/str.h" #include "../utils/str.h"
42 42 #include "../utils/string_array.h" #include "../utils/string_array.h"
43 #include "../utils/test_helpers.h"
43 44 #include "../utils/utf8.h" #include "../utils/utf8.h"
44 45
45 46 /* Kind of title we're working with. */ /* Kind of title we're working with. */
 
... ... typedef enum
52 53 TitleKind; TitleKind;
53 54
54 55 static void ensure_initialized(void); static void ensure_initialized(void);
55 static TitleKind get_title_kind(const char term[]);
56 TSTATIC TitleKind get_title_kind(const char term[]);
56 57 static void save_term_title(void); static void save_term_title(void);
57 58 static void restore_term_title(void); static void restore_term_title(void);
58 59 #if !defined(_WIN32) && defined(HAVE_X11) #if !defined(_WIN32) && defined(HAVE_X11)
 
... ... ensure_initialized(void)
160 161
161 162 /* Checks if we can alter terminal emulator title. Returns kind of writes we /* Checks if we can alter terminal emulator title. Returns kind of writes we
162 163 * should do. */ * should do. */
163 static TitleKind
164 TSTATIC TitleKind
164 165 get_title_kind(const char term[]) get_title_kind(const char term[])
165 166 { {
166 167 #ifdef _WIN32 #ifdef _WIN32
File src/int/term_title.h changed (mode: 100644) (index 62169b219..2c9873284)
19 19 #ifndef VIFM__INT__TERM_TITLE_H__ #ifndef VIFM__INT__TERM_TITLE_H__
20 20 #define VIFM__INT__TERM_TITLE_H__ #define VIFM__INT__TERM_TITLE_H__
21 21
22 #include "../utils/test_helpers.h"
23
22 24 /* Determines whether terminal title can be restored. Returns non-zero if so, /* Determines whether terminal title can be restored. Returns non-zero if so,
23 25 * otherwise zero is returned. */ * otherwise zero is returned. */
24 26 int term_title_restorable(void); int term_title_restorable(void);
 
... ... int term_title_restorable(void);
26 28 /* Updates terminal title. If title_part is NULL, resets terminal title. */ /* Updates terminal title. If title_part is NULL, resets terminal title. */
27 29 void term_title_update(const char title_part[]); void term_title_update(const char title_part[]);
28 30
31 #ifdef TEST
32 /* Kind of title we're working with. */
33 typedef enum
34 {
35 TK_ABSENT, /* No title support. */
36 TK_REGULAR, /* Normal for the platform (xterm for *nix). */
37 TK_SCREEN, /* GNU screen compatible. */
38 }
39 TitleKind;
40 #endif
41 TSTATIC_DEFS(
42 TitleKind get_title_kind(const char term[]);
43 )
44
29 45 #endif /* VIFM__INT__TERM_TITLE_H__ */ #endif /* VIFM__INT__TERM_TITLE_H__ */
30 46
31 47 /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
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/vifm

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

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