2 * ajax-powered autocompletion...
4 * Copyright (c) 1996-2010 by the citadel.org team
6 * This program is open source software. You can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 3 of the
9 * License, or (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, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * Recipient autocompletion results
26 void recp_autocomplete(char *partial) {
30 output_headers(0, 0, 0, 0, 0, 0);
32 hprintf("Content-type: text/html\r\n"
34 "Connection: close\r\n"
35 "Pragma: no-cache\r\n"
36 "Cache-Control: no-store\r\n"
44 serv_printf("AUTO %s", partial);
45 serv_getln(buf, sizeof buf);
47 while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
48 extract_token(name, buf, 0, '|', sizeof name);
57 wc_printf("\r\n\r\n");
62 void _recp_autocomplete(void) {recp_autocomplete(bstr("recp"));}
63 void _cc_autocomplete(void) {recp_autocomplete(bstr("cc"));}
64 void _bcc_autocomplete(void) {recp_autocomplete(bstr("bcc"));}
68 InitModule_AUTO_COMPLETE
71 WebcitAddUrlHandler(HKEY("recp_autocomplete"), "", 0, _recp_autocomplete, 0);
72 WebcitAddUrlHandler(HKEY("cc_autocomplete"), "", 0, _cc_autocomplete, 0);
73 WebcitAddUrlHandler(HKEY("bcc_autocomplete"), "", 0, _bcc_autocomplete, 0);