commit d5ecc41: [Minor] Remove unused legacy functions

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Oct 11 11:07:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-10-11 11:38:20 +0100
URL: https://github.com/rspamd/rspamd/commit/d5ecc4135fe8a7a8cc578740095ad6d94bbccf2b

[Minor] Remove unused legacy functions

---
 src/libserver/cfg_file.h  | 19 ----------
 src/libserver/cfg_utils.c | 92 -----------------------------------------------
 2 files changed, 111 deletions(-)

diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h
index 2aad328f7..e1bc9cfac 100644
--- a/src/libserver/cfg_file.h
+++ b/src/libserver/cfg_file.h
@@ -583,25 +583,6 @@ enum rspamd_post_load_options {
 gboolean rspamd_config_post_load (struct rspamd_config *cfg,
 								  enum rspamd_post_load_options opts);
 
-/**
- * Calculate checksum for config file
- * @param cfg config file
- */
-gboolean rspamd_config_calculate_checksum (struct rspamd_config *cfg);
-
-
-/**
- * Replace all \" with a single " in given string
- * @param line input string
- */
-void rspamd_config_unescape_quotes (gchar *line);
-
-/*
- * Convert comma separated string to a list of strings
- */
-GList *rspamd_config_parse_comma_list (rspamd_mempool_t *pool,
-									   const gchar *line);
-
 /*
  * Return a new classifier_config structure, setting default and non-conflicting attributes
  */
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 98b47efdc..7a9f9cd53 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -945,98 +945,6 @@ rspamd_config_post_load (struct rspamd_config *cfg,
 	return ret;
 }
 
-#if 0
-void
-parse_err (const gchar *fmt, ...)
-{
-	va_list aq;
-	gchar logbuf[BUFSIZ], readbuf[32];
-	gint r;
-
-	va_start (aq, fmt);
-	rspamd_strlcpy (readbuf, yytext, sizeof (readbuf));
-
-	r = snprintf (logbuf,
-			sizeof (logbuf),
-			"config file parse error! line: %d, text: %s, reason: ",
-			yylineno,
-			readbuf);
-	r += vsnprintf (logbuf + r, sizeof (logbuf) - r, fmt, aq);
-
-	va_end (aq);
-	g_critical ("%s", logbuf);
-}
-
-void
-parse_warn (const gchar *fmt, ...)
-{
-	va_list aq;
-	gchar logbuf[BUFSIZ], readbuf[32];
-	gint r;
-
-	va_start (aq, fmt);
-	rspamd_strlcpy (readbuf, yytext, sizeof (readbuf));
-
-	r = snprintf (logbuf,
-			sizeof (logbuf),
-			"config file parse warning! line: %d, text: %s, reason: ",
-			yylineno,
-			readbuf);
-	r += vsnprintf (logbuf + r, sizeof (logbuf) - r, fmt, aq);
-
-	va_end (aq);
-	g_warning ("%s", logbuf);
-}
-#endif
-
-void
-rspamd_config_unescape_quotes (gchar *line)
-{
-	gchar *c = line, *t;
-
-	while (*c) {
-		if (*c == '\\' && *(c + 1) == '"') {
-			t = c;
-			while (*t) {
-				*t = *(t + 1);
-				t++;
-			}
-		}
-		c++;
-	}
-}
-
-GList *
-rspamd_config_parse_comma_list (rspamd_mempool_t * pool, const gchar *line)
-{
-	GList *res = NULL;
-	const gchar *c, *p;
-	gchar *str;
-
-	c = line;
-	p = c;
-
-	while (*p) {
-		if (*p == ',' && *c != *p) {
-			str = rspamd_mempool_alloc (pool, p - c + 1);
-			rspamd_strlcpy (str, c, p - c + 1);
-			res = g_list_prepend (res, str);
-			/* Skip spaces */
-			while (g_ascii_isspace (*(++p))) ;
-			c = p;
-			continue;
-		}
-		p++;
-	}
-	if (res != NULL) {
-		rspamd_mempool_add_destructor (pool,
-			(rspamd_mempool_destruct_t) g_list_free,
-			res);
-	}
-
-	return res;
-}
-
 struct rspamd_classifier_config *
 rspamd_config_new_classifier (struct rspamd_config *cfg,
 	struct rspamd_classifier_config *c)


More information about the Commits mailing list