aboutsummaryrefslogtreecommitdiffstats
path: root/src/ClientMessage.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ClientMessage.cxx (renamed from src/db/simple_db_plugin.h)36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/db/simple_db_plugin.h b/src/ClientMessage.cxx
index 511505846..6fbcf3371 100644
--- a/src/db/simple_db_plugin.h
+++ b/src/ClientMessage.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,26 +17,26 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_SIMPLE_DB_PLUGIN_H
-#define MPD_SIMPLE_DB_PLUGIN_H
+#include "ClientMessage.hxx"
+#include <assert.h>
#include <glib.h>
-#include <stdbool.h>
-#include <time.h>
-
-extern const struct db_plugin simple_db_plugin;
-
-struct db;
G_GNUC_PURE
-struct directory *
-simple_db_get_root(struct db *db);
+static bool
+valid_channel_char(const char ch)
+{
+ return g_ascii_isalnum(ch) ||
+ ch == '_' || ch == '-' || ch == '.' || ch == ':';
+}
bool
-simple_db_save(struct db *db, GError **error_r);
-
-G_GNUC_PURE
-time_t
-simple_db_get_mtime(const struct db *db);
-
-#endif
+client_message_valid_channel_name(const char *name)
+{
+ do {
+ if (!valid_channel_char(*name))
+ return false;
+ } while (*++name != 0);
+
+ return true;
+}