From: Egor Date: Fri, 13 Jun 2025 06:11:44 +0000 (+0300) Subject: s/.h/.hpp/g X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=9861ac12efc4b3d950f293467f5a9328449d313e;p=patchyircd.git s/.h/.hpp/g --- diff --git a/Makefile.am b/Makefile.am index df0a2e1..647c157 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,21 +3,21 @@ 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) @@ -51,12 +51,12 @@ valgrind: ircd .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 diff --git a/src/admin.cpp b/src/admin.cpp index ac1409b..ff93fa0 100644 --- a/src/admin.cpp +++ b/src/admin.cpp @@ -1,11 +1,11 @@ // 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 static lua_State *GL = 0; diff --git a/src/admin.h b/src/admin.hpp similarity index 100% rename from src/admin.h rename to src/admin.hpp diff --git a/src/common.h b/src/common.hpp similarity index 99% rename from src/common.h rename to src/common.hpp index da14adc..7140936 100644 --- a/src/common.h +++ b/src/common.hpp @@ -40,7 +40,7 @@ struct tls; #endif #include -#include "map.h" +#include "map.hpp" #define MAX_NICKLEN 32 #define MAX_CHANLEN 33 diff --git a/src/crypt_blowfish.cpp b/src/crypt_blowfish.cpp index 7159654..5c07789 100644 --- a/src/crypt_blowfish.cpp +++ b/src/crypt_blowfish.cpp @@ -1,8 +1,8 @@ // 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. */ diff --git a/src/crypt_blowfish.h b/src/crypt_blowfish.hpp similarity index 100% rename from src/crypt_blowfish.h rename to src/crypt_blowfish.hpp diff --git a/src/irc.cpp b/src/irc.cpp index 685bd60..47a2bbd 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -1,12 +1,12 @@ // 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 databuf; clientmap client_map = {}; channelmap channel_map = {}; diff --git a/src/irc.h b/src/irc.hpp similarity index 97% rename from src/irc.h rename to src/irc.hpp index 5b1ed10..065ba0e 100644 --- a/src/irc.h +++ b/src/irc.hpp @@ -3,8 +3,8 @@ // 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); diff --git a/src/ircfmt.cpp b/src/ircfmt.cpp index 2744c09..98fc9b1 100644 --- a/src/ircfmt.cpp +++ b/src/ircfmt.cpp @@ -1,7 +1,7 @@ // 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); diff --git a/src/ircfmt.h b/src/ircfmt.hpp similarity index 99% rename from src/ircfmt.h rename to src/ircfmt.hpp index ac3deb0..7b9601d 100644 --- a/src/ircfmt.h +++ b/src/ircfmt.hpp @@ -2,7 +2,7 @@ // 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); diff --git a/src/job.cpp b/src/job.cpp index 45e252f..fb0cdc4 100644 --- a/src/job.cpp +++ b/src/job.cpp @@ -1,8 +1,8 @@ // 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; diff --git a/src/job.h b/src/job.hpp similarity index 100% rename from src/job.h rename to src/job.hpp diff --git a/src/main.cpp b/src/main.cpp index 0198938..6a7253f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,12 +1,12 @@ // 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; diff --git a/src/map.cpp b/src/map.cpp index 7ece2c3..0ed59c8 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1,7 +1,7 @@ // 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, diff --git a/src/map.h b/src/map.hpp similarity index 99% rename from src/map.h rename to src/map.hpp index 69e2fee..243e504 100644 --- a/src/map.h +++ b/src/map.hpp @@ -2,7 +2,7 @@ // 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 diff --git a/src/net.cpp b/src/net.cpp index 047a381..a8d3da7 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1,13 +1,13 @@ // 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) diff --git a/src/net.h b/src/net.hpp similarity index 100% rename from src/net.h rename to src/net.hpp diff --git a/src/netpoll.cpp b/src/netpoll.cpp index 3bfcb41..eea2810 100644 --- a/src/netpoll.cpp +++ b/src/netpoll.cpp @@ -1,8 +1,8 @@ // 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))) diff --git a/src/netpoll.h b/src/netpoll.hpp similarity index 100% rename from src/netpoll.h rename to src/netpoll.hpp diff --git a/src/passwd.cpp b/src/passwd.cpp index c45a896..65bdce0 100644 --- a/src/passwd.cpp +++ b/src/passwd.cpp @@ -1,8 +1,8 @@ // 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]; diff --git a/src/passwd.h b/src/passwd.hpp similarity index 100% rename from src/passwd.h rename to src/passwd.hpp diff --git a/src/setpass.cpp b/src/setpass.cpp index 6638184..4aa4b41 100644 --- a/src/setpass.cpp +++ b/src/setpass.cpp @@ -1,7 +1,7 @@ // 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) { diff --git a/src/util.cpp b/src/util.cpp index a732aed..011bafc 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,8 +1,8 @@ // 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 *v, const char *s, int len) { v->insert(v->end(), s, s+len); } diff --git a/src/util.h b/src/util.hpp similarity index 100% rename from src/util.h rename to src/util.hpp