summaryrefslogtreecommitdiff
path: root/src/core/nickmatch-cache.h
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-01-21 04:09:48 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-01-21 04:09:48 +0000
commit1bfa0e1ee33abab707762a7c6cc896f355a25074 (patch)
tree1c932d9eb6ba8ba6ce85b1edc15a0b9e5d33409d /src/core/nickmatch-cache.h
parent443ba1a97da454bbc4fb0439573e00b0225728a7 (diff)
downloadirssi-1bfa0e1ee33abab707762a7c6cc896f355a25074.zip
Nickmatch cache. A couple of helper functions to check if channel nicks
belong to something. Used for checking nickmasks in highlighting and ignores (well, ignore isn't done yet). git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1138 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/nickmatch-cache.h')
-rw-r--r--src/core/nickmatch-cache.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/nickmatch-cache.h b/src/core/nickmatch-cache.h
new file mode 100644
index 00000000..c4140a49
--- /dev/null
+++ b/src/core/nickmatch-cache.h
@@ -0,0 +1,26 @@
+#ifndef __NICKMATCH_CACHE_H
+#define __NICKMATCH_CACHE_H
+
+typedef void (*NICKMATCH_REBUILD_FUNC) (GHashTable *list,
+ CHANNEL_REC *channel, NICK_REC *nick);
+
+typedef struct {
+ GHashTable *nicks;
+ NICKMATCH_REBUILD_FUNC func;
+} NICKMATCH_REC;
+
+NICKMATCH_REC *nickmatch_init(NICKMATCH_REBUILD_FUNC func);
+void nickmatch_deinit(NICKMATCH_REC *rec);
+
+/* Calls rebuild function for all nicks in all channels.
+ This must be called soon after nickmatch_init(), before any nicklist
+ signals get sent. */
+void nickmatch_rebuild(NICKMATCH_REC *rec);
+
+#define nickmatch_find(rec, nick) \
+ g_hash_table_lookup((rec)->nicks, nick)
+
+void nickmatch_cache_init(void);
+void nickmatch_cache_deinit(void);
+
+#endif