4 * ajax-powered autocompletion...
6 * Copyright (c) 1996-2010 by the citadel.org team
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * Recipient autocompletion results
28 void recp_autocomplete(char *partial) {
32 output_headers(0, 0, 0, 0, 0, 0);
34 hprintf("Content-type: text/html\r\n"
36 "Connection: close\r\n"
37 "Pragma: no-cache\r\n"
38 "Cache-Control: no-store\r\n"
46 serv_printf("AUTO %s", partial);
47 serv_getln(buf, sizeof buf);
49 while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
50 extract_token(name, buf, 0, '|', sizeof name);
59 wc_printf("\r\n\r\n");
64 void _recp_autocomplete(void) {recp_autocomplete(bstr("recp"));}
65 void _cc_autocomplete(void) {recp_autocomplete(bstr("cc"));}
66 void _bcc_autocomplete(void) {recp_autocomplete(bstr("bcc"));}
70 InitModule_AUTO_COMPLETE
73 WebcitAddUrlHandler(HKEY("recp_autocomplete"), "", 0, _recp_autocomplete, 0);
74 WebcitAddUrlHandler(HKEY("cc_autocomplete"), "", 0, _cc_autocomplete, 0);
75 WebcitAddUrlHandler(HKEY("bcc_autocomplete"), "", 0, _bcc_autocomplete, 0);