From 7afc43901d6af27cb421cc878e9bd38a35f3b97f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 23 Aug 2023 12:06:59 +0200 Subject: irc: move function irc_server_fingerprint_search_algo_with_size --- src/plugins/irc/irc-server.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/plugins/irc/irc-server.c') diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 5f468d0eb..1d0c50e90 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -403,6 +403,28 @@ irc_server_eval_expression (struct t_irc_server *server, const char *string) return value; } +/* + * Searches for a fingerprint digest algorithm with the size (in bits). + * + * Returns index of algo in enum t_irc_fingerprint_digest_algo, + * -1 if not found. + */ + +int +irc_server_fingerprint_search_algo_with_size (int size) +{ + int i; + + for (i = 0; i < IRC_FINGERPRINT_NUM_ALGOS; i++) + { + if (irc_fingerprint_digest_algos_size[i] == size) + return i; + } + + /* digest algorithm not found */ + return -1; +} + /* * Evaluates and returns the fingerprint. * @@ -4773,28 +4795,6 @@ irc_server_create_buffer (struct t_irc_server *server) return server->buffer; } -/* - * Searches for a fingerprint digest algorithm with the size (in bits). - * - * Returns index of algo in enum t_irc_fingerprint_digest_algo, - * -1 if not found. - */ - -int -irc_server_fingerprint_search_algo_with_size (int size) -{ - int i; - - for (i = 0; i < IRC_FINGERPRINT_NUM_ALGOS; i++) - { - if (irc_fingerprint_digest_algos_size[i] == size) - return i; - } - - /* digest algorithm not found */ - return -1; -} - /* * Returns a string with sizes of allowed fingerprint, * in number of hexadecimal digits (== bits / 4). -- cgit v1.2.3