projects
/
paraslash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f76e70d
)
mysql_selector.c: whitespace cleanup
author
Andre
<maan@p133.(none)>
Sat, 25 Mar 2006 21:07:22 +0000
(22:07 +0100)
committer
Andre
<maan@p133.(none)>
Sat, 25 Mar 2006 21:07:22 +0000
(22:07 +0100)
mysql_selector.c
patch
|
blob
|
history
diff --git
a/mysql_selector.c
b/mysql_selector.c
index
c5f71cd
..
cdb36dd
100644
(file)
--- a/
mysql_selector.c
+++ b/
mysql_selector.c
@@
-38,7
+38,6
@@
extern struct misc_meta_data *mmd;
static void *mysql_ptr = NULL;
static void *mysql_ptr = NULL;
-
static int com_cam(int, int, char **);
static int com_cdb(int, int, char **);
static int com_cs(int, int, char **);
static int com_cam(int, int, char **);
static int com_cdb(int, int, char **);
static int com_cs(int, int, char **);
@@
-810,7
+809,7
@@
static int com_verb(int fd, int argc, char *argv[])
if (argc < 1)
return -E_MYSQL_SYNTAX;
if (argc < 1)
return -E_MYSQL_SYNTAX;
-
result = get_result(argv[1]);
+ result = get_result(argv[1]);
if (!result)
/* return success, because it's ok to have no results */
return 1;
if (!result)
/* return success, because it's ok to have no results */
return 1;
@@
-837,7
+836,7
@@
static void *get_all_attributes(void)
mysql_free_result(result);
return NULL;
}
mysql_free_result(result);
return NULL;
}
-
mysql_data_seek(result, 4); /* skip Lastplayed, Numplayed... */
+ mysql_data_seek(result, 4); /* skip Lastplayed, Numplayed... */
return result;
}
return result;
}
@@
-871,9
+870,9
@@
static int com_hist(int fd, int argc, char *argv[]) {
q = make_message("select name, to_days(now()) - to_days(lastplayed) from "
"data%s%s%s order by lastplayed",
(argc < 1)? "" : " where ",
q = make_message("select name, to_days(now()) - to_days(lastplayed) from "
"data%s%s%s order by lastplayed",
(argc < 1)? "" : " where ",
- (argc < 1)? "" : argv[1],
+ (argc < 1)? "" : argv[1],
(argc < 1)? "" : " = '1'");
(argc < 1)? "" : " = '1'");
-
result = get_result(q);
+ result = get_result(q);
free(q);
if (!result)
return -E_NORESULT;
free(q);
if (!result)
return -E_NORESULT;
@@
-951,7
+950,7
@@
static int com_mbox(int fd, int argc, char *argv[])
}
mysql_free_result(result);
ret = -E_NORESULT;
}
mysql_free_result(result);
ret = -E_NORESULT;
-
result = get_result(query);
+ result = get_result(query);
if (!result)
goto out;
ret = -E_EMPTY_RESULT;
if (!result)
goto out;
ret = -E_EMPTY_RESULT;
@@
-998,7
+997,7
@@
static char *get_atts(char *name, int verbose)
num_fields = mysql_num_fields(result);
if (num_fields < 5)
goto out;
num_fields = mysql_num_fields(result);
if (num_fields < 5)
goto out;
-
mysql_data_seek(result2, 4); /* skip Lastplayed, Numplayed... */
+ mysql_data_seek(result2, 4); /* skip Lastplayed, Numplayed... */
row = mysql_fetch_row(result);
ret = -E_NOROW;
if (!row)
row = mysql_fetch_row(result);
ret = -E_NOROW;
if (!row)
@@
-1010,11
+1009,11
@@
static char *get_atts(char *name, int verbose)
goto out;
if (atts && (verbose || is_set))
atts = para_strcat(atts, verbose? "," : " ");
goto out;
if (atts && (verbose || is_set))
atts = para_strcat(atts, verbose? "," : " ");
-
if (is_set || verbose)
+ if (is_set || verbose)
atts = para_strcat(atts, row2[0]);
if (verbose)
atts = para_strcat(atts, is_set? "=\"1\"" : "=\"0\"");
atts = para_strcat(atts, row2[0]);
if (verbose)
atts = para_strcat(atts, is_set? "=\"1\"" : "=\"0\"");
-
}
+ }
ret = 1;
out:
if (result2)
ret = 1;
out:
if (result2)
@@
-1048,7
+1047,7
@@
static char *get_meta(char *name, int verbose)
goto out;
q = make_message(verbose? verbose_fmt : fmt, ebn);
free(ebn);
goto out;
q = make_message(verbose? verbose_fmt : fmt, ebn);
free(ebn);
-
result = get_result(q);
+ result = get_result(q);
free(q);
if (!result)
goto out;
free(q);
if (!result)
goto out;
@@
-1207,10
+1206,10
@@
static char *get_query(char *streamname, char *filename, int with_path)
goto write_query;
}
select_clause = para_strdup(with_path?
goto write_query;
}
select_clause = para_strdup(with_path?
-
"select concat(dir.dir, '/', dir.name) from data, dir "
-
"where dir.name = data.name "
-
:
-
"select name from data where name is not NULL");
+ "select concat(dir.dir, '/', dir.name) from data, dir "
+ "where dir.name = data.name "
+ :
+ "select name from data where name is not NULL");
order = make_message("order by -(%s)", score);
free(score);
if (accept_opts && deny_opts) {
order = make_message("order by -(%s)", score);
free(score);
if (accept_opts && deny_opts) {
@@
-1696,7
+1695,7
@@
static int com_ls(int fd, int argc, char *argv[])
argv[1]);
else
q = para_strdup("select name from data");
argv[1]);
else
q = para_strdup("select name from data");
-
result = get_result(q);
+ result = get_result(q);
free(q);
if (!result)
return -E_NORESULT;
free(q);
if (!result)
return -E_NORESULT;
@@
-1761,7
+1760,7
@@
static int get_numplayed(char *name)
char *buf = make_message(fmt, name);
int ret = -E_NORESULT;
char *buf = make_message(fmt, name);
int ret = -E_NORESULT;
-
result = get_result(buf);
+ result = get_result(buf);
free(buf);
if (!result)
goto out;
free(buf);
if (!result)
goto out;
@@
-1880,7
+1879,7
@@
static int com_ps(__unused int fd, int argc, char *argv[])
else
i = match < num_rows - 1? match + 1 : 0;
ret = -E_NOROW;
else
i = match < num_rows - 1? match + 1 : 0;
ret = -E_NOROW;
-
mysql_data_seek(result, i);
+ mysql_data_seek(result, i);
row = mysql_fetch_row(result);
if (!row || !row[0])
goto out;
row = mysql_fetch_row(result);
if (!row || !row[0])
goto out;