Mon, 23 May 2016 12:12:53 +0200
added install target
1
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * |
185
cd42cccee550
updated copyright notice
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
181
diff
changeset
|
4 | * Copyright 2016 Olaf Wintermann. All rights reserved. |
1
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | * |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | * Redistribution and use in source and binary forms, with or without |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | * modification, are permitted provided that the following conditions are met: |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | * |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | * 1. Redistributions of source code must retain the above copyright |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer. |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | * |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | * 2. Redistributions in binary form must reproduce the above copyright |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | * notice, this list of conditions and the following disclaimer in the |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | * documentation and/or other materials provided with the distribution. |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | * |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | * POSSIBILITY OF SUCH DAMAGE. |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | */ |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | #ifndef MAIN_H |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | #define MAIN_H |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | #include <curl/curl.h> |
11 | 33 | #include "optparser.h" |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
34 | #include <libidav/webdav.h> |
1
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | |
190
a76e43d89f55
dav-sync can create and delete empty directories now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
188
diff
changeset
|
36 | #include "version.h" |
188
753c8fcde12f
added version info
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
185
diff
changeset
|
37 | |
1
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | #ifdef __cplusplus |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | extern "C" { |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | #endif |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | |
11 | 42 | void print_usage(char *cmd); |
147
458a8dc68048
added password based keys and fixed crash when keys are missing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
119
diff
changeset
|
43 | char* password_input(char *prompt); |
212
01e80c7cfe96
added noinput option to dav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
209
diff
changeset
|
44 | int request_auth(Repository *repo, DavSession *sn, CmdArgs *args); |
4 | 45 | |
11 | 46 | int cmd_list(CmdArgs *args); |
14
d1a43035d3a2
added some options to list command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
11
diff
changeset
|
47 | void ls_print_list_elm(DavResource *res, CmdArgs *args); |
d1a43035d3a2
added some options to list command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
11
diff
changeset
|
48 | void ls_print_elm(DavResource *res, CmdArgs *args); |
d1a43035d3a2
added some options to list command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
11
diff
changeset
|
49 | |
11 | 50 | int cmd_get(CmdArgs *args); |
18
651989681053
recursive list and get
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
16
diff
changeset
|
51 | int get_resource(Repository *repo, DavResource *res, CmdArgs *a, char *out); |
651989681053
recursive list and get
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
16
diff
changeset
|
52 | |
11 | 53 | int cmd_put(CmdArgs *args); |
28
4e46c65711ef
added recursive put
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
18
diff
changeset
|
54 | int put_entry(Repository *repo, CmdArgs *a, DavSession *sn, char *path, char *file); |
178
e137883e620f
using content-length header in dav put
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
147
diff
changeset
|
55 | int put_file(Repository *repo, CmdArgs *a, DavSession *sn, char *path, char *name, FILE *in, off_t len); |
28
4e46c65711ef
added recursive put
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
18
diff
changeset
|
56 | |
15
182af08b4813
added remove command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
14
diff
changeset
|
57 | int cmd_remove(CmdArgs *args); |
16
5dbef9e07376
added mkdir command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
15
diff
changeset
|
58 | int cmd_mkdir(CmdArgs *args); |
1
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
59 | |
181
a8f8cdbf85df
implemented webdav copy and move method
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
178
diff
changeset
|
60 | int cmd_move(CmdArgs *args, int cp); |
a8f8cdbf85df
implemented webdav copy and move method
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
178
diff
changeset
|
61 | |
29
938957a4eea7
added date command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
28
diff
changeset
|
62 | int cmd_date(CmdArgs *args); |
938957a4eea7
added date command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
28
diff
changeset
|
63 | |
62
3b813c57c106
added property-set and property-get command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
64 | int cmd_get_property(CmdArgs *args); |
84
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
65 | int cmd_set_property(CmdArgs *args); |
62
3b813c57c106
added property-set and property-get command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
66 | |
209
d24761f1e07c
added lock and unlock commands to dav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
195
diff
changeset
|
67 | int cmd_lock(CmdArgs *args); |
d24761f1e07c
added lock and unlock commands to dav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
195
diff
changeset
|
68 | int cmd_unlock(CmdArgs *args); |
d24761f1e07c
added lock and unlock commands to dav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
195
diff
changeset
|
69 | |
84
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
70 | int cmd_info(CmdArgs *args); |
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
71 | |
62
3b813c57c106
added property-set and property-get command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
72 | char* stdin2str(); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
73 | |
195
4b7823a58199
fixed add-repository function name
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
194
diff
changeset
|
74 | int cmd_add_repository(CmdArgs *args); |
119
451607eeff05
added initial code for config commands
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
75 | |
1
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
76 | #ifdef __cplusplus |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
77 | } |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
78 | #endif |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
79 | |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
80 | #endif /* MAIN_H */ |
1bcaac272cdf
added existing source code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
81 |