dav/main.c

changeset 105
ee0de2b1872e
parent 100
f4127c4d1018
child 107
a0903d2d8e3e
equal deleted inserted replaced
104:6fb4d24d9df9 105:ee0de2b1872e
30 #include <stdlib.h> 30 #include <stdlib.h>
31 #include <string.h> 31 #include <string.h>
32 #include <errno.h> 32 #include <errno.h>
33 #include <unistd.h> 33 #include <unistd.h>
34 #include <time.h> 34 #include <time.h>
35 #include <libxml/xmlerror.h>
36 #include <sys/types.h> 35 #include <sys/types.h>
37 #include <ucx/string.h> 36 #include <ucx/string.h>
38 #include <ucx/utils.h> 37 #include <ucx/utils.h>
39 #include <dirent.h> 38 #include <dirent.h>
40 39
49 48
50 static void xmlerrorfnc(void * c, const char * msg, ... ) { 49 static void xmlerrorfnc(void * c, const char * msg, ... ) {
51 // nothing 50 // nothing
52 } 51 }
53 52
53 //#define DO_THE_TEST
54 #include <libidav/davqlparser.h>
54 void test() { 55 void test() {
55 56 DavQLStatement *stmt = dav_parse_statement(S(
57 "get *,count(*) as count from /uap/House of Cards with depth = infinity"));
58 dav_debug_statement(stmt);
59 dav_free_statement(stmt);
56 } 60 }
57 61
58 int main(int argc, char **argv) { 62 int main(int argc, char **argv) {
59 xmlGenericErrorFunc fnc = xmlerrorfnc; 63 xmlGenericErrorFunc fnc = xmlerrorfnc;
60 initGenericErrorDefaultFunc(&fnc); 64 initGenericErrorDefaultFunc(&fnc);
61 ctx = dav_context_new(); 65 ctx = dav_context_new();
62 load_config(ctx); 66 load_config(ctx);
63 //dav_add_namespace(ctx, "U", "http://www.uap-core.de/"); 67 #ifdef DO_THE_TEST
64 //test(); 68 test();
69 #endif
65 70
66 memcpy(ctx->http_proxy, get_http_proxy(), sizeof(Proxy)); 71 memcpy(ctx->http_proxy, get_http_proxy(), sizeof(Proxy));
67 memcpy(ctx->https_proxy, get_https_proxy(), sizeof(Proxy)); 72 memcpy(ctx->https_proxy, get_https_proxy(), sizeof(Proxy));
68 73
69 if(argc < 2) { 74 if(argc < 2) {
1088 value = sstrtrim(value); 1093 value = sstrtrim(value);
1089 printf(" %s: %.*s\n", p.name, (int)value.length, value.ptr); 1094 printf(" %s: %.*s\n", p.name, (int)value.length, value.ptr);
1090 } 1095 }
1091 1096
1092 dav_session_free(sn, properties); 1097 dav_session_free(sn, properties);
1098 return 0;
1093 } else { 1099 } else {
1094 print_resource_error(sn, res->path); 1100 print_resource_error(sn, res->path);
1095 return -1; 1101 return -1;
1096 } 1102 }
1097 } 1103 }

mercurial