]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_vandelay.c
mk_module_init.sh now tests to see if echo supports -e and -E
[citadel.git] / citadel / serv_vandelay.c
index b8ab892f06b533c98baf7d058915b3282542f2a6..b1c3630c0cdf9a3facc2a41d4c6db96e536e01ea 100644 (file)
 #include <limits.h>
 #include "citadel.h"
 #include "server.h"
-#include "sysdep_decls.h"
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "serv_extensions.h"
 #include "database.h"
 #include "msgbase.h"
 #include "tools.h"
 #include "control.h"
 #include "euidindex.h"
 
+
+#include "ctdl_module.h"
+
+
+
+
 #define END_OF_MESSAGE "---eom---dbd---"
 
 char artv_tempfilename1[PATH_MAX];
@@ -646,16 +650,32 @@ void artv_import_message(void) {
 
 void artv_do_import(void) {
        char buf[SIZ];
+       char abuf[SIZ];
        char s_version[SIZ];
        int version;
+       long iterations;
 
        unbuffer_output();
 
        cprintf("%d sock it to me\n", SEND_LISTING);
+       abuf[0] = '\0';
+       unbuffer_output();
+       iterations = 0;
        while (client_getln(buf, sizeof buf), strcmp(buf, "000")) {
 
                lprintf(CTDL_DEBUG, "import keyword: <%s>\n", buf);
-
+               if ((abuf[0] == '\0') || (strcasecmp(buf, abuf))) {
+                       cprintf ("\n\nImporting datatype %s\n", buf);
+                       strncpy (abuf, buf, SIZ);       
+                       iterations = 0;
+               }
+               else {
+                       cprintf(".");
+                       if (iterations % 64 == 0)
+                               cprintf("\n");
+                       
+               }
+               
                if (!strcasecmp(buf, "version")) {
                        client_getln(s_version, sizeof s_version);
                        version = atoi(s_version);
@@ -672,7 +692,7 @@ void artv_do_import(void) {
                else if (!strcasecmp(buf, "visit")) artv_import_visit();
                else if (!strcasecmp(buf, "message")) artv_import_message();
                else break;
-
+               iterations ++;
        }
        lprintf(CTDL_INFO, "Invalid keyword <%s>.  Flushing input.\n", buf);
        while (client_getln(buf, sizeof buf), strcmp(buf, "000"))  ;;
@@ -710,8 +730,10 @@ void cmd_artv(char *cmdbuf) {
 
 
 
-char *serv_vandelay_init(void)
+CTDL_MODULE_INIT(vandelay)
 {
        CtdlRegisterProtoHook(cmd_artv, "ARTV", "import/export data store");
+
+       /* return our Subversion id for the Log */
        return "$Id$";
 }