ACLOCAL_AMFLAGS=--install
bin_PROGRAMS = ircd setpass
ircd_SOURCES = \
- src/admin.cpp src/admin.h \
- src/common.h \
- src/crypt_blowfish.cpp src/crypt_blowfish.h \
- src/irc.cpp src/irc.h \
- src/ircfmt.cpp src/ircfmt.h \
- src/job.cpp src/job.h \
- src/map.cpp src/map.h \
- src/net.cpp src/net.h \
- src/netpoll.cpp src/netpoll.h \
- src/passwd.cpp src/passwd.h \
- src/util.cpp src/util.h \
+ src/admin.cpp src/admin.hpp \
+ src/common.hpp \
+ src/crypt_blowfish.cpp src/crypt_blowfish.hpp \
+ src/irc.cpp src/irc.hpp \
+ src/ircfmt.cpp src/ircfmt.hpp \
+ src/job.cpp src/job.hpp \
+ src/map.cpp src/map.hpp \
+ src/net.cpp src/net.hpp \
+ src/netpoll.cpp src/netpoll.hpp \
+ src/passwd.cpp src/passwd.hpp \
+ src/util.cpp src/util.hpp \
src/main.cpp
setpass_SOURCES = \
- src/crypt_blowfish.cpp src/crypt_blowfish.h \
- src/passwd.cpp src/passwd.h \
+ src/crypt_blowfish.cpp src/crypt_blowfish.hpp \
+ src/passwd.cpp src/passwd.hpp \
src/setpass.cpp
AM_CXXFLAGS = $(LIBUV_CFLAGS) $(LIBTLS_CFLAGS) $(LUA_CFLAGS)
LDADD = $(LIBUV_LIBS) $(LIBTLS_LIBS) $(LUA_LIBS)
.PHONY: pch
if ENABLE_PCH
-MOSTLYCLEANFILES = common.h.@PCHEXT@
-AM_CPPFLAGS = -Winvalid-pch `test -f common.h.@PCHEXT@ && printf @PCHOPT@ "common.h"`
-common.h.@PCHEXT@: src/common.h
+MOSTLYCLEANFILES = common.hpp.@PCHEXT@
+AM_CPPFLAGS = -Winvalid-pch `test -f common.hpp.@PCHEXT@ && printf @PCHOPT@ "common.hpp"`
+common.hpp.@PCHEXT@: src/common.hpp
$(AM_V_GEN)$(RM) $@; $(CXXCOMPILE) -x c++-header -o $@ $<
-pch: common.h.@PCHEXT@
-pch.mk: common.h.@PCHEXT@
+pch: common.hpp.@PCHEXT@
+pch.mk: common.hpp.@PCHEXT@
@: >pch.mk
-include pch.mk
endif
// Copyright (c) 2023-2025 Egor
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "common.h"
+#include "common.hpp"
#ifdef HAVE_LUA
-#include "admin.h"
-#include "irc.h"
-#include "ircfmt.h"
-#include "passwd.h"
+#include "admin.hpp"
+#include "irc.hpp"
+#include "ircfmt.hpp"
+#include "passwd.hpp"
#include <lua.hpp>
static lua_State *GL = 0;
#endif
#include <uv.h>
-#include "map.h"
+#include "map.hpp"
#define MAX_NICKLEN 32
#define MAX_CHANLEN 33
// Copyright (c) 1998-2014 Solar Designer
// Copyright (c) 2005-2020 Rich Felker, et al.
// SPDX-License-Identifier: MIT
-#include "common.h"
-#include "crypt_blowfish.h"
+#include "common.hpp"
+#include "crypt_blowfish.hpp"
/* Modified by Rich Felker in for inclusion in musl libc, based on
* Solar Designer's second size-optimized version sent to the musl
* mailing list. */
// Copyright (c) 2022, 2024 Sam Smith
// Copyright (c) 2022-2025 Egor
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "common.h"
-#include "irc.h"
-#include "ircfmt.h"
-#include "passwd.h"
-#include "job.h"
-#include "admin.h"
+#include "common.hpp"
+#include "irc.hpp"
+#include "ircfmt.hpp"
+#include "passwd.hpp"
+#include "job.hpp"
+#include "admin.hpp"
std::vector<char> databuf;
clientmap client_map = {};
channelmap channel_map = {};
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef IRC_H_
#define IRC_H_
-#include "net.h"
-#include "util.h"
+#include "net.hpp"
+#include "util.hpp"
#define is_registered(cl) ((cl)->regstate == REG_REGISTERED)
void sendbuf_monitor(const char *nick, int cookie, int positive, int negative);
const char *format_umodes(struct client_data *cl);
// Copyright (c) 2022-2025 Egor
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "common.h"
-#include "ircfmt.h"
+#include "common.hpp"
+#include "ircfmt.hpp"
static const char *format_prefixes(struct client_data *client, struct client_data *cl, struct channel *chan) {
if (!chan) return "";
int o = is_chanop(chan, cl);
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef IRCFMT_H_
#define IRCFMT_H_
-#include "irc.h"
+#include "irc.hpp"
void msg_away(struct client_data *src);
void msg_nick(struct client_data *src, const char *newnick);
void msg_ping(const char *token);
// Copyright (c) 2024-2025 Egor
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "common.h"
-#include "job.h"
-#include "passwd.h"
+#include "common.hpp"
+#include "job.hpp"
+#include "passwd.hpp"
struct jobent {
struct client_data *client;
// Copyright (c) 2022 Sam Smith
// Copyright (c) 2022-2025 Egor
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "common.h"
-#include "net.h"
-#include "netpoll.h"
-#include "irc.h"
-#include "job.h"
-#include "admin.h"
+#include "common.hpp"
+#include "net.hpp"
+#include "netpoll.hpp"
+#include "irc.hpp"
+#include "job.hpp"
+#include "admin.hpp"
static int is_running = 1;
// Copyright (c) 2023, 2025 Egor
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "common.h"
-#include "map.h"
+#include "common.hpp"
+#include "map.hpp"
static int ent_find(map_base *root, const char *key, int *found)
{
auto it = std::partition_point(root->ptr, root->ptr + root->len,
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef MAP_H_
#define MAP_H_
-#include "util.h"
+#include "util.hpp"
/* A map abstract data type with following properties:
* - keys are lexicographically-sorted unique NUL-terminated strings
// Copyright (c) 2022 Sam Smith
// Copyright (c) 2022-2025 Egor
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "common.h"
-#include "net.h"
-#include "netpoll.h"
-#include "irc.h"
-#include "ircfmt.h"
-#include "job.h"
-#include "admin.h"
+#include "common.hpp"
+#include "net.hpp"
+#include "netpoll.hpp"
+#include "irc.hpp"
+#include "ircfmt.hpp"
+#include "job.hpp"
+#include "admin.hpp"
void update_poll_reg(struct client_data *cl)
{
if (cl->fd == -1)
// Copyright (c) 2023-2025 Egor
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "common.h"
-#include "netpoll.h"
-#include "util.h"
+#include "common.hpp"
+#include "netpoll.hpp"
+#include "util.hpp"
#define container_of(ptr, type, member) ((type *)((char *)(ptr) - offsetof(type, member)))
// Copyright (c) 2022-2025 Egor
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "common.h"
-#include "passwd.h"
-#include "crypt_blowfish.h"
+#include "common.hpp"
+#include "passwd.hpp"
+#include "crypt_blowfish.hpp"
char *password_crypt(const char *key, const char *setting)
{
static char output[128];
// Copyright (c) 2022-2023, 2025 Egor
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "common.h"
-#include "passwd.h"
+#include "common.hpp"
+#include "passwd.hpp"
char *read_password(const char *prompt)
{
// Copyright (c) 2022 Sam Smith
// Copyright (c) 2022-2025 Egor
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "common.h"
-#include "util.h"
+#include "common.hpp"
+#include "util.hpp"
static void append_strn(std::vector<char> *v, const char *s, int len) {
v->insert(v->end(), s, s+len);
}