application/config.h

changeset 55
1ce14068ef31
parent 7
905ac52c910f
equal deleted inserted replaced
54:3ca3acefc66a 55:1ce14068ef31
1 /* 1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 * 3 *
4 * Copyright 2024 Olaf Wintermann. All rights reserved. 4 * Copyright 2018 Olaf Wintermann. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met: 7 * modification, are permitted provided that the following conditions are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
30 #define CONFIG_H 30 #define CONFIG_H
31 31
32 #include <cx/string.h> 32 #include <cx/string.h>
33 #include <stdbool.h> 33 #include <stdbool.h>
34 #include <libidav/webdav.h> 34 #include <libidav/webdav.h>
35 #include "pwd.h"
36 35
37 #include <libidav/config.h> 36 #include <libidav/config.h>
37 #include <libidav/pwdstore.h>
38 38
39 #ifdef __cplusplus 39 #ifdef __cplusplus
40 extern "C" { 40 extern "C" {
41 #endif 41 #endif
42 42
45 #define HTTPS_PROXY 2 45 #define HTTPS_PROXY 2
46 46
47 47
48 int check_config_dir(void); 48 int check_config_dir(void);
49 49
50 char* config_file_path(char* name); 50 char* config_file_path(char *name);
51 51
52 cxmutstr config_load_file(const char* path); 52 cxmutstr config_load_file(const char *path);
53 53
54 int load_config(DavContext* ctx); 54 int load_config(DavContext *ctx);
55 DavConfig* get_config(void); 55 DavConfig* get_config(void);
56 int store_config(void); 56 int store_config(void);
57 void free_config(void); 57 void free_config(void);
58 58
59 cxmutstr load_key_file(const char* filename); 59 cxmutstr load_key_file(const char *filename);
60 60
61 PwdStore* get_pwdstore(void); 61 PwdStore* get_pwdstore(void);
62 int pwdstore_save(PwdStore* pwdstore); 62 int pwdstore_save(PwdStore *pwdstore);
63 63
64 int get_stored_credentials(char *credid, char **user, char **password);
65 int get_location_credentials(DavCfgRepository *repo, const char *path, char **user, char **password);
64 66
65 int request_auth(DavSession* sn, void* userdata);
66
67 DavSession* connect_to_repo(DavContext *ctx, DavCfgRepository *repo, const char *path, dav_auth_func authfunc);
68 67
69 #ifdef __cplusplus 68 #ifdef __cplusplus
70 } 69 }
71 #endif 70 #endif
72 71

mercurial