2 * dynamic html autocompletion
4 * Copyright (c) 1996-2012 by the citadel.org team
6 * This program is open source software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
18 * Recipient autocompletion results
20 void recp_autocomplete(char *partial) {
24 output_headers(0, 0, 0, 0, 0, 0);
26 hprintf("Content-type: text/html\r\n"
28 "Connection: close\r\n"
29 "Pragma: no-cache\r\n"
30 "Cache-Control: no-store\r\n"
38 serv_printf("AUTO %s", partial);
39 serv_getln(buf, sizeof buf);
41 while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
42 extract_token(name, buf, 0, '|', sizeof name);
51 wc_printf("\r\n\r\n");
56 void _recp_autocomplete(void) {recp_autocomplete(bstr("recp"));}
57 void _cc_autocomplete(void) {recp_autocomplete(bstr("cc"));}
58 void _bcc_autocomplete(void) {recp_autocomplete(bstr("bcc"));}
62 InitModule_AUTO_COMPLETE
65 WebcitAddUrlHandler(HKEY("recp_autocomplete"), "", 0, _recp_autocomplete, 0);
66 WebcitAddUrlHandler(HKEY("cc_autocomplete"), "", 0, _cc_autocomplete, 0);
67 WebcitAddUrlHandler(HKEY("bcc_autocomplete"), "", 0, _bcc_autocomplete, 0);