Krolyxon
Commit f9662ef

Branches

Refs →

nsxivf9662ef

merge autoreload_{inotify,nop}.c into autoreload.c (#263)

Author
explosion-mental
Date
2022-04-26 20:43 -0500
Committer
GitHub · 2022-04-27 01:43 +0000
Parent
29c6b14
Commit
f9662efb1f522c1b554f789659d261a97a1918f5

+30 −45

3 files changed

  1. M Makefile +2 −4
  2. R autoreload_inotify.c → autoreload.c +28 −0
  3. D autoreload_nop.c +0 −41
M Makefile View
@@ -32,7 +32,7 @@ inc_fonts_1 = -I/usr/include/freetype2 -I$(PREFIX)/include/freetype2
3232 CPPFLAGS = -D_XOPEN_SOURCE=700 \
3333 -DHAVE_LIBGIF=$(HAVE_LIBGIF) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF) \
3434 -DHAVE_LIBWEBP=$(HAVE_LIBWEBP) -DHAVE_LIBFONTS=$(HAVE_LIBFONTS) \
35− $(inc_fonts_$(HAVE_LIBFONTS))
35+ -DHAVE_INOTIFY=$(HAVE_INOTIFY) $(inc_fonts_$(HAVE_LIBFONTS))
3636
3737 lib_fonts_0 =
3838 lib_fonts_1 = -lXft -lfontconfig
@@ -42,14 +42,12 @@ lib_gif_0 =
4242 lib_gif_1 = -lgif
4343 lib_webp_0 =
4444 lib_webp_1 = -lwebpdemux -lwebp
45−autoreload_0 = nop
46−autoreload_1 = inotify
4745
4846 NSXIV_LDLIBS = -lImlib2 -lX11 \
4947 $(lib_exif_$(HAVE_LIBEXIF)) $(lib_gif_$(HAVE_LIBGIF)) \
5048 $(lib_webp_$(HAVE_LIBWEBP)) $(lib_fonts_$(HAVE_LIBFONTS))
5149
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 \
5351 thumbs.o util.o window.o
5452
5553 .SUFFIXES:
R autoreload_inotify.c → autoreload.c View
@@ -18,6 +18,8 @@
1818
1919 #include "nsxiv.h"
2020
21+#if HAVE_INOTIFY
22+
2123 #include <errno.h>
2224 #include <stdlib.h>
2325 #include <string.h>
@@ -109,3 +111,29 @@ bool arl_handle(arl_t *arl)
109111 }
110112 return reload;
111113 }
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 */
D autoreload_nop.c View
@@ -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−}