nsxivf9662ef
merge autoreload_{inotify,nop}.c into autoreload.c (#263)
+30 −45
3 files changed
- M Makefile +2 −4
- R autoreload_inotify.c → autoreload.c +28 −0
- D autoreload_nop.c +0 −41
| @@ -32,7 +32,7 @@ inc_fonts_1 = -I/usr/include/freetype2 -I$(PREFIX)/include/freetype2 | |||
| 32 | 32 | CPPFLAGS = -D_XOPEN_SOURCE=700 \ | |
| 33 | 33 | -DHAVE_LIBGIF=$(HAVE_LIBGIF) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF) \ | |
| 34 | 34 | -DHAVE_LIBWEBP=$(HAVE_LIBWEBP) -DHAVE_LIBFONTS=$(HAVE_LIBFONTS) \ | |
| 35 | − | $(inc_fonts_$(HAVE_LIBFONTS)) | |
| 35 | + | -DHAVE_INOTIFY=$(HAVE_INOTIFY) $(inc_fonts_$(HAVE_LIBFONTS)) | |
| 36 | 36 | ||
| 37 | 37 | lib_fonts_0 = | |
| 38 | 38 | lib_fonts_1 = -lXft -lfontconfig | |
| @@ -42,14 +42,12 @@ lib_gif_0 = | |||
| 42 | 42 | lib_gif_1 = -lgif | |
| 43 | 43 | lib_webp_0 = | |
| 44 | 44 | lib_webp_1 = -lwebpdemux -lwebp | |
| 45 | − | autoreload_0 = nop | |
| 46 | − | autoreload_1 = inotify | |
| 47 | 45 | ||
| 48 | 46 | NSXIV_LDLIBS = -lImlib2 -lX11 \ | |
| 49 | 47 | $(lib_exif_$(HAVE_LIBEXIF)) $(lib_gif_$(HAVE_LIBGIF)) \ | |
| 50 | 48 | $(lib_webp_$(HAVE_LIBWEBP)) $(lib_fonts_$(HAVE_LIBFONTS)) | |
| 51 | 49 | ||
| 52 | − | OBJS = autoreload_$(autoreload_$(HAVE_INOTIFY)).o commands.o image.o main.o options.o \ | |
| 50 | + | OBJS = autoreload.o commands.o image.o main.o options.o \ | |
| 53 | 51 | thumbs.o util.o window.o | |
| 54 | 52 | ||
| 55 | 53 | .SUFFIXES: | |
| @@ -18,6 +18,8 @@ | |||
| 18 | 18 | ||
| 19 | 19 | #include "nsxiv.h" | |
| 20 | 20 | ||
| 21 | + | #if HAVE_INOTIFY | |
| 22 | + | ||
| 21 | 23 | #include <errno.h> | |
| 22 | 24 | #include <stdlib.h> | |
| 23 | 25 | #include <string.h> | |
| @@ -109,3 +111,29 @@ bool arl_handle(arl_t *arl) | |||
| 109 | 111 | } | |
| 110 | 112 | return reload; | |
| 111 | 113 | } | |
| 114 | + | ||
| 115 | + | #else | |
| 116 | + | ||
| 117 | + | void arl_init(arl_t *arl) | |
| 118 | + | { | |
| 119 | + | arl->fd = -1; | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | void arl_cleanup(arl_t *arl) | |
| 123 | + | { | |
| 124 | + | (void) arl; | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | void arl_setup(arl_t *arl, const char *filepath) | |
| 128 | + | { | |
| 129 | + | (void) arl; | |
| 130 | + | (void) filepath; | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | bool arl_handle(arl_t *arl) | |
| 134 | + | { | |
| 135 | + | (void) arl; | |
| 136 | + | return false; | |
| 137 | + | } | |
| 138 | + | ||
| 139 | + | #endif /* HAVE_INOTIFY */ | |
| @@ -1,41 +0,0 @@ | |||
| 1 | − | /* Copyright 2017 Max Voit | |
| 2 | − | * | |
| 3 | − | * This file is a part of nsxiv. | |
| 4 | − | * | |
| 5 | − | * nsxiv is free software; you can redistribute it and/or modify | |
| 6 | − | * it under the terms of the GNU General Public License as published | |
| 7 | − | * by the Free Software Foundation; either version 2 of the License, | |
| 8 | − | * or (at your option) any later version. | |
| 9 | − | * | |
| 10 | − | * nsxiv is distributed in the hope that it will be useful, | |
| 11 | − | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | − | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | − | * GNU General Public License for more details. | |
| 14 | − | * | |
| 15 | − | * You should have received a copy of the GNU General Public License | |
| 16 | − | * along with nsxiv. If not, see <http://www.gnu.org/licenses/>. | |
| 17 | − | */ | |
| 18 | − | ||
| 19 | − | #include "nsxiv.h" | |
| 20 | − | ||
| 21 | − | void arl_init(arl_t *arl) | |
| 22 | − | { | |
| 23 | − | arl->fd = -1; | |
| 24 | − | } | |
| 25 | − | ||
| 26 | − | void arl_cleanup(arl_t *arl) | |
| 27 | − | { | |
| 28 | − | (void) arl; | |
| 29 | − | } | |
| 30 | − | ||
| 31 | − | void arl_setup(arl_t *arl, const char *filepath) | |
| 32 | − | { | |
| 33 | − | (void) arl; | |
| 34 | − | (void) filepath; | |
| 35 | − | } | |
| 36 | − | ||
| 37 | − | bool arl_handle(arl_t *arl) | |
| 38 | − | { | |
| 39 | − | (void) arl; | |
| 40 | − | return false; | |
| 41 | − | } | |