]> code.citadel.org Git - citadel.git/blobdiff - webcit/autocompletion.c
indent -kr -i8 -brf -bbb -fnc -l132 -nce on all of webcit-classic
[citadel.git] / webcit / autocompletion.c
index 20b6cd95a46af5f6c25352cbf433976f6fce1ab0..95948c60f5a97f1bed8235d4cc4dced7e0c47bbc 100644 (file)
@@ -1,23 +1,16 @@
+
 /*
- * $Id$
- *
- * ajax-powered autocompletion...
+ * dynamic html autocompletion
  *
- * Copyright (c) 1996-2010 by the citadel.org team
+ * Copyright (c) 1996-2012 by the citadel.org team
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * This program is open source software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 3.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #include "webcit.h"
@@ -33,12 +26,7 @@ void recp_autocomplete(char *partial) {
 
        hprintf("Content-type: text/html\r\n"
                "Server: %s\r\n"
-               "Connection: close\r\n"
-               "Pragma: no-cache\r\n"
-               "Cache-Control: no-store\r\n"
-               "Expires: -1\r\n"
-               ,
-               PACKAGE_STRING);
+               "Connection: close\r\n" "Pragma: no-cache\r\n" "Cache-Control: no-store\r\n" "Expires: -1\r\n", PACKAGE_STRING);
        begin_burst();
 
        wc_printf("<ul>");
@@ -46,7 +34,7 @@ void recp_autocomplete(char *partial) {
        serv_printf("AUTO %s", partial);
        serv_getln(buf, sizeof buf);
        if (buf[0] == '1') {
-               while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
+               while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
                        extract_token(name, buf, 0, '|', sizeof name);
                        wc_printf("<li>");
                        escputs(name);
@@ -61,16 +49,19 @@ void recp_autocomplete(char *partial) {
 }
 
 
-void _recp_autocomplete(void) {recp_autocomplete(bstr("recp"));}
-void _cc_autocomplete(void)   {recp_autocomplete(bstr("cc"));} 
-void _bcc_autocomplete(void)  {recp_autocomplete(bstr("bcc"));}
+void _recp_autocomplete(void) {
+       recp_autocomplete(bstr("recp"));
+}
+void _cc_autocomplete(void) {
+       recp_autocomplete(bstr("cc"));
+}
+void _bcc_autocomplete(void) {
+       recp_autocomplete(bstr("bcc"));
+}
 
 
-void 
-InitModule_AUTO_COMPLETE
-(void)
-{
+void InitModule_AUTO_COMPLETE(void) {
        WebcitAddUrlHandler(HKEY("recp_autocomplete"), "", 0, _recp_autocomplete, 0);
-       WebcitAddUrlHandler(HKEY("cc_autocomplete"),   "", 0, _cc_autocomplete, 0);
-       WebcitAddUrlHandler(HKEY("bcc_autocomplete"),  "", 0, _bcc_autocomplete, 0);
+       WebcitAddUrlHandler(HKEY("cc_autocomplete"), "", 0, _cc_autocomplete, 0);
+       WebcitAddUrlHandler(HKEY("bcc_autocomplete"), "", 0, _bcc_autocomplete, 0);
 }