From: Egor Date: Wed, 11 Jun 2025 09:59:42 +0000 (+0300) Subject: use PACKAGE_* defines X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=a23741cf744641aee79aecffc025e608e35072f2;p=patchyircd.git use PACKAGE_* defines --- diff --git a/src/irc.cpp b/src/irc.cpp index 2942c4e..f21809b 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -822,7 +822,7 @@ saslcleanup: return err_notregistered(client), sendbuf(client), 0; if (args[0] && strcmp(args[0], hostname) != 0) return err_nosuchserver(client, args[0]), sendbuf(client), 0; - rpl_version(client, "v0.0.1", "PatchyIRCD v0.0.1"), sendbuf(client); + rpl_version(client, PACKAGE_VERSION, PACKAGE_STRING), sendbuf(client); rpl_isupport(client), sendbuf(client); } else if(strcmp(command, "ADMIN") == 0) { if (!is_registered(client)) diff --git a/src/ircfmt.cpp b/src/ircfmt.cpp index b02dd08..08a0b0c 100644 --- a/src/ircfmt.cpp +++ b/src/ircfmt.cpp @@ -140,7 +140,7 @@ void rpl_welcome(struct client_data *client) // 001 } void rpl_yourhost(struct client_data *client) // 002 { - copy_strf(&databuf, ":%s 002 %s :Your host is PatchyIRCD, running version 0.0.1\r\n", hostname, client->nick); + copy_strf(&databuf, ":%s 002 %s :Your host is " PACKAGE_NAME ", running version " PACKAGE_VERSION "\r\n", hostname, client->nick); } void rpl_created(struct client_data *client) // 003 { @@ -148,7 +148,7 @@ void rpl_created(struct client_data *client) // 003 } void rpl_myinfo(struct client_data *client) // 004 { - copy_strf(&databuf, ":%s 004 %s PatchyIRCD 0.0.1 iworZ beIqwklPimnstov\r\n", hostname, client->nick); + copy_strf(&databuf, ":%s 004 %s " PACKAGE_STRING " iworZ beIqwklPimnstov\r\n", hostname, client->nick); } void rpl_isupport(struct client_data *client) // 005 { diff --git a/src/main.cpp b/src/main.cpp index 2a4c930..91a5e51 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -195,7 +195,7 @@ static void determine_hostname(void) static void show_license(void) { fprintf(stderr, -"PatchyIRCD 0.0.1\n" +PACKAGE_STRING "\n" "Copyright (c) 2022, 2024 Sam Smith\n" "Copyright (c) 2022-2025 Egor\n" "\n" @@ -222,7 +222,7 @@ int main(int argc, char *argv[]) show_license(); - fprintf(stderr, "[PatchyIRCD]: Starting up...\n"); + fprintf(stderr, "Starting up...\n"); net_init(); netpoll::init(); @@ -372,7 +372,7 @@ int main(int argc, char *argv[]) // Main loop while (is_running || dyingclients) { if (is_siginted) { - fprintf(stderr, "[PatchyIRCD]: Cleaning up...\n"); + fprintf(stderr, "Cleaning up...\n"); for (int i = 0; i < listener_count; i++) { netpoll::del_and_close(listeners[i].sock); }