removed all of the gnu autofoo crap from ctdlsh
[citadel] / ctdlsh / export.c
1 /*
2  * (c) 2009-2014 by Art Cancro and citadel.org
3  * This program is released under the terms of the GNU General Public License v3.
4  */
5
6 #include "ctdlsh.h"
7
8 int cmd_export(int server_socket, char *cmdbuf) {
9         char buf[1024];
10         char export_file_name[1024];
11
12         strcpy(export_file_name, &cmdbuf[7]);
13         if (strlen(export_file_name) == 0) {
14                 strncpy(export_file_name, readline("Enter export file name: "), sizeof export_file_name);
15         }
16
17         sock_printf(server_socket, "MIGR export\n");
18         sock_getln(server_socket, buf, sizeof buf);
19
20         if (buf[0] != '1') {
21                 fprintf(stderr, "%s\n", &buf[4]);
22                 return(cmdret_error);
23         }
24
25         while (sock_getln(server_socket, buf, sizeof buf), strcmp(buf, "000")) {
26
27                 if (!strncmp(buf, "<progress>", 10)) {
28                         fprintf(stderr, "%s\n", buf);
29                 }
30         }
31
32
33
34         return(cmdret_ok);
35 }
36
37
38
39