]> code.citadel.org Git - citadel.git/blobdiff - ctdlsh/export.c
removed all of the gnu autofoo crap from ctdlsh
[citadel.git] / ctdlsh / export.c
diff --git a/ctdlsh/export.c b/ctdlsh/export.c
new file mode 100644 (file)
index 0000000..e368419
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * (c) 2009-2014 by Art Cancro and citadel.org
+ * This program is released under the terms of the GNU General Public License v3.
+ */
+
+#include "ctdlsh.h"
+
+int cmd_export(int server_socket, char *cmdbuf) {
+       char buf[1024];
+       char export_file_name[1024];
+
+       strcpy(export_file_name, &cmdbuf[7]);
+       if (strlen(export_file_name) == 0) {
+               strncpy(export_file_name, readline("Enter export file name: "), sizeof export_file_name);
+       }
+
+       sock_printf(server_socket, "MIGR export\n");
+       sock_getln(server_socket, buf, sizeof buf);
+
+       if (buf[0] != '1') {
+               fprintf(stderr, "%s\n", &buf[4]);
+               return(cmdret_error);
+       }
+
+       while (sock_getln(server_socket, buf, sizeof buf), strcmp(buf, "000")) {
+
+               if (!strncmp(buf, "<progress>", 10)) {
+                       fprintf(stderr, "%s\n", buf);
+               }
+       }
+
+
+
+       return(cmdret_ok);
+}
+
+
+
+