From 85dd88a180043e991c19a4c93a6ce5c7fe0a6e88 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sun, 22 Dec 2019 16:01:16 +0000 Subject: Make full debug output optional for extractnickfromprefix() and stripprefix() to avoid huge debug logs when using replaymode = "lastspoke" combined with DEBUG_FULL. --- functions.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'functions.h') diff --git a/functions.h b/functions.h index 420e03f..7a3e398 100644 --- a/functions.h +++ b/functions.h @@ -69,14 +69,22 @@ int getstdin(char *prompt, char *buff, size_t sz); void appendcrlf(char *string); // Remove leading colon ':' which is the starting character of a prefix in an IRC message -// If no leading colon present, string is left unchanged -void stripprefix(char *string); +// If no leading colon present, string is left unchanged. +// "debug" is used to determine whether stripprefix() should produce all debug output, +// used as debug output with stripprefix() can be particularly noisy. +void stripprefix(char *string, int debug); // Extract final parameter from IRC message, removing the leading colon ':' void extractfinalparameter(char *string); // Extract the IRC nick from a prefix -void extractnickfromprefix(char *string); +// e.g. given this string: +// ":foo!bar@baz" +// We want to end up with: +// "foo" +// "debug" is used to determine whether extractnickfromprefix() should produce all debug output, +// used as debug output with extractnickfromprefix() can be particularly noisy. +void extractnickfromprefix(char *string, int debug); // Update an existing nickuserhost string with a new nick void updatenickuserhost(char *nickuserhost, char *nick); -- cgit v1.2.3