3 * dynamic html autocompletion
5 * Copyright (c) 1996-2012 by the citadel.org team
7 * This program is open source software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License, version 3.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
19 * Recipient autocompletion results
21 void recp_autocomplete(char *partial) {
25 output_headers(0, 0, 0, 0, 0, 0);
27 hprintf("Content-type: text/html\r\n"
29 "Connection: close\r\n" "Pragma: no-cache\r\n" "Cache-Control: no-store\r\n" "Expires: -1\r\n", PACKAGE_STRING);
34 serv_printf("AUTO %s", partial);
35 serv_getln(buf, sizeof buf);
37 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
38 extract_token(name, buf, 0, '|', sizeof name);
47 wc_printf("\r\n\r\n");
52 void _recp_autocomplete(void) {
53 recp_autocomplete(bstr("recp"));
55 void _cc_autocomplete(void) {
56 recp_autocomplete(bstr("cc"));
58 void _bcc_autocomplete(void) {
59 recp_autocomplete(bstr("bcc"));
63 void InitModule_AUTO_COMPLETE(void) {
64 WebcitAddUrlHandler(HKEY("recp_autocomplete"), "", 0, _recp_autocomplete, 0);
65 WebcitAddUrlHandler(HKEY("cc_autocomplete"), "", 0, _cc_autocomplete, 0);
66 WebcitAddUrlHandler(HKEY("bcc_autocomplete"), "", 0, _bcc_autocomplete, 0);