static bool backupscmd(UAContext *ua, const char *cmd);
static bool levelscmd(UAContext *ua, const char *cmd);
static bool getmsgscmd(UAContext *ua, const char *cmd);
+static bool volstatuscmd(UAContext *ua, const char *cmd);
+static bool mediatypescmd(UAContext *ua, const char *cmd);
+static bool locationscmd(UAContext *ua, const char *cmd);
static bool dot_bvfs_lsdirs(UAContext *ua, const char *cmd);
static bool dot_bvfs_lsfiles(UAContext *ua, const char *cmd);
{ NT_(".status"), dot_status_cmd, NULL, false},
{ NT_(".storage"), storagecmd, NULL, true},
{ NT_(".volstatus"), volstatuscmd, NULL, true},
+ { NT_(".mediatypes"), mediatypescmd, NULL, true},
+ { NT_(".locations"), locationscmd, NULL, true},
{ NT_(".bvfs_lsdirs"), dot_bvfs_lsdirs, NULL, true},
{ NT_(".bvfs_lsfiles"),dot_bvfs_lsfiles,NULL, true},
{ NT_(".bvfs_update"), dot_bvfs_update, NULL, true},
return true;
}
+static int one_handler(void *ctx, int num_field, char **row)
+{
+ UAContext *ua = (UAContext *)ctx;
+ ua->send_msg("%s\n", row[0]);
+ return 0;
+}
+static bool mediatypescmd(UAContext *ua, const char *cmd)
+{
+ if (!open_client_db(ua)) {
+ return true;
+ }
+ if (!db_sql_query(ua->db,
+ "SELECT DISTINCT MediaType FROM MediaType ORDER BY MediaType",
+ one_handler, (void *)ua))
+ {
+ ua->error_msg(_("List MediaType failed: ERR=%s\n"), db_strerror(ua->db));
+ }
+ return true;
+}
+
+static bool locationscmd(UAContext *ua, const char *cmd)
+{
+ if (!open_client_db(ua)) {
+ return true;
+ }
+ if (!db_sql_query(ua->db,
+ "SELECT DISTINCT Location FROM Location ORDER BY Location",
+ one_handler, (void *)ua))
+ {
+ ua->error_msg(_("List Location failed: ERR=%s\n"), db_strerror(ua->db));
+ }
+ return true;
+}
static bool levelscmd(UAContext *ua, const char *cmd)
{