Version number to 7.35 in preparation for an upcoming release.
[citadel.git] / webcit / autocompletion.c
1 /*
2  * $Id$
3  *
4  * ajax-powered autocompletion...
5  */
6
7 #include "webcit.h"
8
9 /*
10  * Recipient autocompletion results
11  */
12 void recp_autocomplete(char *partial) {
13         char buf[1024];
14         char name[128];
15
16         output_headers(0, 0, 0, 0, 0, 0);
17
18         wprintf("Content-type: text/html\r\n"
19                 "Server: %s\r\n"
20                 "Connection: close\r\n"
21                 "Pragma: no-cache\r\n"
22                 "Cache-Control: no-store\r\n"
23                 "Expires: -1\r\n"
24                 ,
25                 PACKAGE_STRING);
26         begin_burst();
27
28         wprintf("<ul>");
29
30         serv_printf("AUTO %s", partial);
31         serv_getln(buf, sizeof buf);
32         if (buf[0] == '1') {
33                 while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
34                         extract_token(name, buf, 0, '|', sizeof name);
35                         wprintf("<li>");
36                         escputs(name);
37                         wprintf("</li>");
38                 }
39         }
40
41         wprintf("</ul>");
42
43         wprintf("\r\n\r\n");
44         wDumpContent(0);
45 }