summaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-07-15 00:39:48 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-07-15 00:39:48 +0000
commit79d1d7089a699cf8a09bd5227f9033282001b0b3 (patch)
tree11a2e10bce84587e2b5a13029c43354a185e846c /src/common.h
parentbcbb55dd1e0ecf828942dcc91d5661e9a44ab841 (diff)
downloadirssi-79d1d7089a699cf8a09bd5227f9033282001b0b3.zip
Added --home and --config command line parameters to irssi to specify
locations for ~/.irssi and ~/.irssi/config git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1626 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/common.h b/src/common.h
index c79c5d9b..89d4da94 100644
--- a/src/common.h
+++ b/src/common.h
@@ -4,6 +4,9 @@
#define IRSSI_AUTHOR "Timo Sirainen <tss@iki.fi>"
#define IRSSI_WEBSITE "http://irssi.org/"
+#define IRSSI_DIR_SHORT "~/.irssi"
+#define IRSSI_DIR_FULL "%s/.irssi" /* %s == g_get_home_dir() */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -45,16 +48,7 @@
#include "core/memdebug.h"
-#define g_free_not_null(a) \
- G_STMT_START { \
- if (a) g_free(a); \
- } G_STMT_END
-
-#define g_free_and_null(a) \
- G_STMT_START { \
- if (a) { g_free(a); (a) = NULL; } \
- } G_STMT_END
-
+/* input functions */
#define G_INPUT_READ (1 << 0)
#define G_INPUT_WRITE (1 << 1)
@@ -65,8 +59,24 @@ int g_input_add(GIOChannel *source, int condition,
int g_input_add_full(GIOChannel *source, int priority, int condition,
GInputFunction function, void *data);
+/* return full path for ~/.irssi */
+const char *get_irssi_dir(void);
+/* return full path for ~/.irssi/config */
+const char *get_irssi_config(void);
+
+/* max. size for %d */
#define MAX_INT_STRLEN ((sizeof(int) * CHAR_BIT + 2) / 3 + 1)
+#define g_free_not_null(a) \
+ G_STMT_START { \
+ if (a) g_free(a); \
+ } G_STMT_END
+
+#define g_free_and_null(a) \
+ G_STMT_START { \
+ if (a) { g_free(a); (a) = NULL; } \
+ } G_STMT_END
+
typedef struct _IPADDR IPADDR;
typedef struct _CONFIG_REC CONFIG_REC;
typedef struct _CONFIG_NODE CONFIG_NODE;