[dev] [ii] introduction of a config.h

From: Marc Chantreux <eiro_AT_phear.org>
Date: Thu, 14 Nov 2019 21:38:59 +0100

i don't really know if it's a good idea. the idea is: i want ii to
behave the way i want by default. as dwm can be configured with
a config.h, i feel ii should get the same feature.

regards.
marc

* SET_PREFIX() macro
---
 config.h.sample | 1 +
 ii.c            | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 config.h.sample
diff --git a/config.h.sample b/config.h.sample
new file mode 100644
index 0000000..0eb6a47
--- /dev/null
+++ b/config.h.sample
_AT_@ -0,0 +1 @@
+#define SET_PREFIX() snprintf(prefix, sizeof(prefix), "%s/irc", spw->pw_dir);
diff --git a/ii.c b/ii.c
index 55d5f52..7f484c3 100644
--- a/ii.c
+++ b/ii.c
_AT_@ -1,4 +1,5 @@
 /* See LICENSE file for license details. */
+#include "config.h"
 #include <sys/select.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
_AT_@ -790,7 +791,7 @@ main(int argc, char *argv[])
 		exit(1);
 	}
 	strlcpy(nick, spw->pw_name, sizeof(nick));
-	snprintf(prefix, sizeof(prefix), "%s/irc", spw->pw_dir);
+    SET_PREFIX();
 
 	ARGBEGIN {
 	case 'f':
-- 
2.20.1
Received on Thu Nov 14 2019 - 21:38:59 CET

This archive was generated by hypermail 2.3.0 : Thu Nov 14 2019 - 21:48:09 CET