fix build

Wed, 23 Oct 2024 10:32:15 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 23 Oct 2024 10:32:15 +0200
changeset 833
8aa2dc02d9b7
parent 832
dff5f4c23aa7
child 834
6a466635eace

fix build

dav/config.c file | annotate | diff | comparison | revisions
dav/config.h file | annotate | diff | comparison | revisions
dav/connect.h file | annotate | diff | comparison | revisions
dav/main.c file | annotate | diff | comparison | revisions
dav/sync.c file | annotate | diff | comparison | revisions
libidav/pwdstore.c file | annotate | diff | comparison | revisions
--- a/dav/config.c	Wed Oct 23 09:46:33 2024 +0200
+++ b/dav/config.c	Wed Oct 23 10:32:15 2024 +0200
@@ -35,9 +35,7 @@
 #include <errno.h>
 #include <libxml/tree.h>
 
-#include "pwd.h"
 #include "config.h"
-#include "main.h"
 #include "pwd.h"
 #include "system.h"
 
--- a/dav/config.h	Wed Oct 23 09:46:33 2024 +0200
+++ b/dav/config.h	Wed Oct 23 10:32:15 2024 +0200
@@ -32,7 +32,6 @@
 #include <cx/string.h>
 #include <stdbool.h>
 #include <libidav/webdav.h>
-#include "opt.h"
 
 #include <libidav/config.h>
 #include <libidav/pwdstore.h>
@@ -65,12 +64,6 @@
 int get_stored_credentials(char *credid, char **user, char **password);
 int get_location_credentials(DavCfgRepository *repo, const char *path, char **user, char **password);
 
-//Repository* url2repo_s(cxstring url, char **path);
-//Repository* url2repo(const char *url, char **path);
-
-DavSession* connect_to_repo(DavContext *ctx, DavCfgRepository *repo, const char *path, dav_auth_func authfunc, CmdArgs *a);
-
-int request_auth(DavSession *sn, void *userdata);
 
 #ifdef	__cplusplus
 }
--- a/dav/connect.h	Wed Oct 23 09:46:33 2024 +0200
+++ b/dav/connect.h	Wed Oct 23 10:32:15 2024 +0200
@@ -30,6 +30,7 @@
 #define DAV_CONNECT_H
 
 #include "config.h"
+#include "opt.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -37,6 +38,7 @@
 
 DavSession* connect_to_repo(DavContext *ctx, DavCfgRepository *repo, const char *path, dav_auth_func authfunc, CmdArgs *a);
 
+int request_auth(DavSession *sn, void *userdata);
 
 #ifdef __cplusplus
 }
--- a/dav/main.c	Wed Oct 23 09:46:33 2024 +0200
+++ b/dav/main.c	Wed Oct 23 10:32:15 2024 +0200
@@ -53,9 +53,9 @@
 #include "error.h"
 #include "assistant.h"
 #include "system.h"
-#include "pwd.h"
 #include "finfo.h"
 #include "main.h"
+#include "connect.h"
 
 static DavContext *ctx;
 
@@ -139,6 +139,9 @@
         print_usage(argv[0]);
         return -1;
     }
+    if(cmd_getoption(args, "noinput")) {
+        pwdstore_set_pwinput_func(NULL, NULL);
+    }
     
     sys_init();
     xmlGenericErrorFunc fnc = xmlerrorfnc;
--- a/dav/sync.c	Wed Oct 23 09:46:33 2024 +0200
+++ b/dav/sync.c	Wed Oct 23 10:32:15 2024 +0200
@@ -68,6 +68,7 @@
 #include "assistant.h"
 #include "libxattr.h"
 #include "tags.h"
+#include "connect.h"
 
 #include "system.h"
 
--- a/libidav/pwdstore.c	Wed Oct 23 09:46:33 2024 +0200
+++ b/libidav/pwdstore.c	Wed Oct 23 10:32:15 2024 +0200
@@ -52,6 +52,11 @@
     return util_password_input(prompt);
 }
 
+void pwdstore_set_pwinput_func(pwdstore_pwinput_func func, void *userdata) {
+    pw_input = func;
+    pw_input_data = userdata;
+}
+
 PwdStore* pwdstore_open(const char *file) {
     FILE *in = fopen(file, "r");
     if(!in) {

mercurial