2 * ajax-powered autocompletion...
4 * Copyright (c) 1996-2011 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 as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 * Recipient autocompletion results
25 void recp_autocomplete(char *partial) {
29 output_headers(0, 0, 0, 0, 0, 0);
31 hprintf("Content-type: text/html\r\n"
33 "Connection: close\r\n"
34 "Pragma: no-cache\r\n"
35 "Cache-Control: no-store\r\n"
43 serv_printf("AUTO %s", partial);
44 serv_getln(buf, sizeof buf);
46 while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
47 extract_token(name, buf, 0, '|', sizeof name);
56 wc_printf("\r\n\r\n");
61 void _recp_autocomplete(void) {recp_autocomplete(bstr("recp"));}
62 void _cc_autocomplete(void) {recp_autocomplete(bstr("cc"));}
63 void _bcc_autocomplete(void) {recp_autocomplete(bstr("bcc"));}
67 InitModule_AUTO_COMPLETE
70 WebcitAddUrlHandler(HKEY("recp_autocomplete"), "", 0, _recp_autocomplete, 0);
71 WebcitAddUrlHandler(HKEY("cc_autocomplete"), "", 0, _cc_autocomplete, 0);
72 WebcitAddUrlHandler(HKEY("bcc_autocomplete"), "", 0, _bcc_autocomplete, 0);