mirror of
https://github.com/matrix-construct/construct
synced 2024-08-26 11:25:17 +02:00
ircd: Add select preliminary inlines for future client refactor.
This commit is contained in:
parent
125e3b21f2
commit
4f7eeaa60c
1 changed files with 20 additions and 1 deletions
|
@ -339,6 +339,13 @@ struct ListClient
|
||||||
#define IsMe(x) ((x)->status == STAT_ME)
|
#define IsMe(x) ((x)->status == STAT_ME)
|
||||||
#define IsUnknown(x) ((x)->status == STAT_UNKNOWN)
|
#define IsUnknown(x) ((x)->status == STAT_UNKNOWN)
|
||||||
#define IsServer(x) ((x)->status == STAT_SERVER)
|
#define IsServer(x) ((x)->status == STAT_SERVER)
|
||||||
|
|
||||||
|
inline bool
|
||||||
|
is_client(const Client &client)
|
||||||
|
{
|
||||||
|
return client.status == STAT_CLIENT;
|
||||||
|
}
|
||||||
|
|
||||||
#define IsClient(x) ((x)->status == STAT_CLIENT)
|
#define IsClient(x) ((x)->status == STAT_CLIENT)
|
||||||
#define IsReject(x) ((x)->status == STAT_REJECT)
|
#define IsReject(x) ((x)->status == STAT_REJECT)
|
||||||
|
|
||||||
|
@ -462,8 +469,20 @@ struct ListClient
|
||||||
#define MyConnect(x) ((x)->flags & FLAGS_MYCONNECT)
|
#define MyConnect(x) ((x)->flags & FLAGS_MYCONNECT)
|
||||||
#define SetMyConnect(x) ((x)->flags |= FLAGS_MYCONNECT)
|
#define SetMyConnect(x) ((x)->flags |= FLAGS_MYCONNECT)
|
||||||
#define ClearMyConnect(x) ((x)->flags &= ~FLAGS_MYCONNECT)
|
#define ClearMyConnect(x) ((x)->flags &= ~FLAGS_MYCONNECT)
|
||||||
|
|
||||||
#define MyClient(x) (MyConnect(x) && IsClient(x))
|
#define MyClient(x) (MyConnect(x) && IsClient(x))
|
||||||
|
|
||||||
|
inline bool
|
||||||
|
my(const Client &client)
|
||||||
|
{
|
||||||
|
return MyClient(&client);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool
|
||||||
|
is_person(const Client &client)
|
||||||
|
{
|
||||||
|
return IsPerson(&client);
|
||||||
|
}
|
||||||
|
|
||||||
#define SetMark(x) ((x)->flags |= FLAGS_MARK)
|
#define SetMark(x) ((x)->flags |= FLAGS_MARK)
|
||||||
#define ClearMark(x) ((x)->flags &= ~FLAGS_MARK)
|
#define ClearMark(x) ((x)->flags &= ~FLAGS_MARK)
|
||||||
#define IsMarked(x) ((x)->flags & FLAGS_MARK)
|
#define IsMarked(x) ((x)->flags & FLAGS_MARK)
|
||||||
|
|
Loading…
Reference in a new issue