projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
22cc5cd
)
Move declarations in cmd_termlist
author
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 18 May 2011 07:50:56 +0000
(09:50 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 18 May 2011 07:50:56 +0000
(09:50 +0200)
src/http_command.c
patch
|
blob
|
history
diff --git
a/src/http_command.c
b/src/http_command.c
index
90b6cd6
..
bbd6b83
100644
(file)
--- a/
src/http_command.c
+++ b/
src/http_command.c
@@
-539,9
+539,6
@@
static void cmd_termlist(struct http_channel *c)
struct http_response *rs = c->response;
struct http_request *rq = c->request;
struct http_session *s = locate_session(c);
struct http_response *rs = c->response;
struct http_request *rq = c->request;
struct http_session *s = locate_session(c);
- struct termlist_score **p;
- int len;
- int i;
const char *name = http_argbyname(rq, "name");
const char *nums = http_argbyname(rq, "num");
int num = 15;
const char *name = http_argbyname(rq, "name");
const char *nums = http_argbyname(rq, "num");
int num = 15;
@@
-582,10
+579,13
@@
static void cmd_termlist(struct http_channel *c)
}
else
{
}
else
{
- p = get_termlist_score(s->psession, tname, &len);
+ int len;
+ struct termlist_score **p =
+ get_termlist_score(s->psession, tname, &len);
if (p && len)
wrbuf_printf(debug_log, " %s: %d", tname, len);
if (p) {
if (p && len)
wrbuf_printf(debug_log, " %s: %d", tname, len);
if (p) {
+ int i;
for (i = 0; i < len && i < num; i++){
// prevnt sending empty term elements
if (!p[i]->term || !p[i]->term[0])
for (i = 0; i < len && i < num; i++){
// prevnt sending empty term elements
if (!p[i]->term || !p[i]->term[0])
@@
-595,7
+595,7
@@
static void cmd_termlist(struct http_channel *c)
wrbuf_puts(c->wrbuf, "<name>");
wrbuf_xmlputs(c->wrbuf, p[i]->term);
wrbuf_puts(c->wrbuf, "</name>");
wrbuf_puts(c->wrbuf, "<name>");
wrbuf_xmlputs(c->wrbuf, p[i]->term);
wrbuf_puts(c->wrbuf, "</name>");
-
+
wrbuf_printf(c->wrbuf,
"<frequency>%d</frequency>",
p[i]->frequency);
wrbuf_printf(c->wrbuf,
"<frequency>%d</frequency>",
p[i]->frequency);