mirror of
https://github.com/irssi/irssi.git
synced 2026-08-17 15:42:26 +02:00
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
This commit is contained in:
parent
443ba1a97d
commit
1bfa0e1ee3
4 changed files with 151 additions and 0 deletions
26
src/core/nickmatch-cache.h
Normal file
26
src/core/nickmatch-cache.h
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue