+/* Checks whether the UTF-8 encoded NAME is a valid name for a multiple
+ response set in a dictionary encoded in DICT_ENCODING. Return NULL if it
+ is, otherwise an error message that the caller must free(). */
+char * WARN_UNUSED_RESULT
+mrset_is_valid_name__ (const char *name, const char *dict_encoding)
+{
+ char *error = id_is_valid__ (name, dict_encoding);
+ if (error)
+ return error;
+
+ if (name[0] != '$')
+ return xasprintf (_("%s is not a valid name for a multiple response "
+ "set. Multiple response set names must begin with "
+ "`$'."), name);
+
+ return NULL;
+}
+
+static bool
+error_to_bool (char *error)
+{
+ if (error)
+ {
+ free (error);
+ return false;
+ }
+ else
+ return true;
+}
+
+/* Returns true if the UTF-8 encoded NAME is a valid name for a multiple
+ response set in a dictionary encoded in DICT_ENCODING, false otherwise. */
+bool
+mrset_is_valid_name (const char *name, const char *dict_encoding)
+{
+ return error_to_bool (mrset_is_valid_name__ (name, dict_encoding));
+}
+