libidav/utils.h

changeset 747
efbd59642577
parent 731
e0358fa1a3b1
child 775
e5909dff0dbf
equal deleted inserted replaced
746:a569148841ff 747:efbd59642577
34 #include <io.h> 34 #include <io.h>
35 #endif /* _WIN32 */ 35 #endif /* _WIN32 */
36 36
37 #include <sys/types.h> 37 #include <sys/types.h>
38 #include <libxml/tree.h> 38 #include <libxml/tree.h>
39 #include <ucx/string.h> 39 #include <cx/string.h>
40 #include <ucx/buffer.h> 40 #include <cx/buffer.h>
41 #include <sys/stat.h> 41 #include <sys/stat.h>
42 #include <inttypes.h> 42 #include <inttypes.h>
43 43
44 #include <curl/curl.h> 44 #include <curl/curl.h>
45 #include "webdav.h" 45 #include "webdav.h"
64 time_t util_parse_lastmodified(char *str); 64 time_t util_parse_lastmodified(char *str);
65 65
66 int util_mkdir(char *path, mode_t mode); 66 int util_mkdir(char *path, mode_t mode);
67 67
68 char* util_url_base(char *url); 68 char* util_url_base(char *url);
69 char* util_url_base_s(sstr_t url); 69 char* util_url_base_s(cxstring url);
70 char* util_url_path(char *url); 70 const char* util_url_path(const char *url);
71 char* util_url_decode(DavSession *sn, char *url); 71 char* util_url_decode(DavSession *sn, const char *url);
72 char* util_resource_name(char *url); 72 const char* util_resource_name(const char *url);
73 char* util_concat_path(const char *url_base, const char *path); 73 char* util_concat_path(const char *url_base, const char *path);
74 char* util_get_url(DavSession *sn, const char *href); 74 char* util_get_url(DavSession *sn, const char *href);
75 void util_set_url(DavSession *sn, const char *href); 75 void util_set_url(DavSession *sn, const char *href);
76 76
77 /* 77 /*
82 int util_path_isabsolut(const char *path); 82 int util_path_isabsolut(const char *path);
83 83
84 char* util_path_normalize(const char *path); 84 char* util_path_normalize(const char *path);
85 char* util_create_relative_path(const char *abspath, const char *base); 85 char* util_create_relative_path(const char *abspath, const char *base);
86 86
87 void util_capture_header(CURL *handle, UcxMap* map); 87 void util_capture_header(CURL *handle, CxMap* map);
88 88
89 char* util_path_to_url(DavSession *sn, char *path); 89 char* util_path_to_url(DavSession *sn, const char *path);
90 char* util_parent_path(const char *path); 90 char* util_parent_path(const char *path);
91 91
92 char* util_size_str(DavBool iscollection, uint64_t contentlength); 92 char* util_size_str(DavBool iscollection, uint64_t contentlength);
93 char* util_date_str(time_t tm); 93 char* util_date_str(time_t tm);
94 94
103 103
104 char* util_base64decode(const char *in); 104 char* util_base64decode(const char *in);
105 char* util_base64decode_len(const char *in, int *outlen); 105 char* util_base64decode_len(const char *in, int *outlen);
106 char* util_base64encode(const char *in, size_t len); 106 char* util_base64encode(const char *in, size_t len);
107 107
108 char* util_encrypt_str(DavSession *sn, char *str, char *key); 108 char* util_encrypt_str(DavSession *sn, const char *str, const char *key);
109 char* util_encrypt_str_k(DavSession *sn, char *str, DavKey *key); 109 char* util_encrypt_str_k(DavSession *sn, const char *str, DavKey *key);
110 char* util_decrypt_str(DavSession *sn, char *str, char *key); 110 char* util_decrypt_str(DavSession *sn, const char *str, const char *key);
111 char* util_decrypt_str_k(DavSession *sn, char *str, DavKey *key); 111 char* util_decrypt_str_k(DavSession *sn, const char *str, DavKey *key);
112 112
113 char* util_random_str(); 113 char* util_random_str();
114 114
115 sstr_t util_getsubstr_until_token(sstr_t str, sstr_t token, sstr_t *sub); 115 //sstr_t util_getsubstr_until_token(sstr_t str, sstr_t token, sstr_t *sub);
116 116
117 sstr_t util_readline(FILE *stream); 117 cxmutstr util_readline(FILE *stream);
118 char* util_password_input(char *prompt); 118 char* util_password_input(char *prompt);
119 119
120 int util_exec_command(char *command, UcxBuffer *outbuf); 120 int util_exec_command(char *command, CxBuffer *outbuf);
121 121
122 char* util_hexstr(const unsigned char *data, size_t len); 122 char* util_hexstr(const unsigned char *data, size_t len);
123 123
124 void util_remove_trailing_pathseparator(char *path); 124 void util_remove_trailing_pathseparator(char *path);
125 125
126 char* util_file_hash(const char *path); 126 char* util_file_hash(const char *path);
127 127
128 int util_regdestr(CxMempool *mp, void *data, cx_destructor_func destructor);
129
128 #ifdef __cplusplus 130 #ifdef __cplusplus
129 } 131 }
130 #endif 132 #endif
131 133
132 #endif /* UTILS_H */ 134 #endif /* UTILS_H */

mercurial