From ce0f41da41a2d97d4a8e7159747464ecef72de4c Mon Sep 17 00:00:00 2001 From: Nakidai Date: Wed, 4 Feb 2026 12:21:47 +0300 Subject: Add WHOIS and config parsing Now users can query each other Plus, server info and creation date can be changed without recompiling using configuration file in IRC message format which is loaded on startup TODO: since readcfg uses IRC logic, handle() now should be able to deal with commands ending with simply \n --- ircd.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ircd.h') diff --git a/ircd.h b/ircd.h index 0cde9e0..1f5bba8 100644 --- a/ircd.h +++ b/ircd.h @@ -38,7 +38,7 @@ struct Message struct Peer { int fd; - enum ClientType { UNREGD, CLIENT, SERVER, SERVICE } type; + enum ClientType { UNREGD, CLIENT, CONFIG, SERVER, SERVICE } type; char nick[PEER_NICK_MAX], user[PEER_USER_MAX], real[PEER_REAL_MAX], host[PEER_HOST_MAX]; struct Channel *channels[PEER_CHANNELS_MAX]; enum PeerStatus { @@ -80,6 +80,10 @@ extern size_t channels_c, peers_c; extern const char *hostname; extern const char *host; extern unsigned long port; +extern char creation[CREATION_MAX]; +extern char info[INFO_MAX]; + +int readcfg(const char *path); const char *getnick(const struct Peer *peer); enum PeerMode user_mode(char m); -- cgit 1.4.1