dav/sync.c

changeset 779
a0e02b70dad1
parent 775
e5909dff0dbf
child 780
cd1c869720e0
equal deleted inserted replaced
778:bf53db813cc9 779:a0e02b70dad1
68 68
69 static DavContext *ctx; 69 static DavContext *ctx;
70 70
71 static int sync_shutdown = 0; 71 static int sync_shutdown = 0;
72 72
73 static FILE *synclog;
74
73 static void xmlerrorfnc(void * c, const char * msg, ... ) { 75 static void xmlerrorfnc(void * c, const char * msg, ... ) {
74 va_list ap; 76 va_list ap;
75 va_start(ap, msg); 77 va_start(ap, msg);
76 vfprintf(stderr, msg, ap); 78 vfprintf(stderr, msg, ap);
77 va_end(ap); 79 va_end(ap);
86 { DAV_PROPS_NS, "tags" }, 88 { DAV_PROPS_NS, "tags" },
87 { DAV_PROPS_NS, "xattributes" }, 89 { DAV_PROPS_NS, "xattributes" },
88 { DAV_PROPS_NS, "link" } 90 { DAV_PROPS_NS, "link" }
89 }; 91 };
90 static size_t numdefprops = 8 ; 92 static size_t numdefprops = 8 ;
93
94 void log_printf(const char *loglevel, const char *fmt, ...) {
95 const char *sp = " ";
96 if(!loglevel) {
97 loglevel = "";
98 sp = "";
99 }
100
101 va_list ap;
102 va_start(ap, fmt);
103 cxmutstr str = cx_vasprintf(fmt, ap);
104 va_end(ap);
105
106 printf("%s\n", str.ptr);
107 if(synclog) {
108 fprintf(synclog, "%s%s%s\n", loglevel, sp, str.ptr);
109 }
110 }
91 111
92 /* 112 /*
93 * strcmp version that works with NULL pointers 113 * strcmp version that works with NULL pointers
94 */ 114 */
95 static int nullstrcmp(const char *s1, const char *s2) { 115 static int nullstrcmp(const char *s1, const char *s2) {

mercurial