Jeff King | abca927 | 2011-12-10 05:31:11 -0500 | [diff] [blame] | 1 | #ifndef CREDENTIAL_H |
| 2 | #define CREDENTIAL_H |
| 3 | |
| 4 | #include "string-list.h" |
| 5 | |
| 6 | struct credential { |
| 7 | struct string_list helpers; |
Jeff King | 1182507 | 2011-12-10 05:31:24 -0500 | [diff] [blame] | 8 | unsigned approved:1, |
Jeff King | a78fbb4 | 2011-12-10 05:31:34 -0500 | [diff] [blame] | 9 | configured:1, |
| 10 | use_http_path:1; |
Jeff King | abca927 | 2011-12-10 05:31:11 -0500 | [diff] [blame] | 11 | |
| 12 | char *username; |
| 13 | char *password; |
| 14 | char *protocol; |
| 15 | char *host; |
| 16 | char *path; |
| 17 | }; |
| 18 | |
| 19 | #define CREDENTIAL_INIT { STRING_LIST_INIT_DUP } |
| 20 | |
| 21 | void credential_init(struct credential *); |
| 22 | void credential_clear(struct credential *); |
| 23 | |
| 24 | void credential_fill(struct credential *); |
| 25 | void credential_approve(struct credential *); |
| 26 | void credential_reject(struct credential *); |
| 27 | |
| 28 | int credential_read(struct credential *, FILE *); |
Matthieu Moy | 2d6dc18 | 2012-06-24 13:40:00 +0200 | [diff] [blame] | 29 | void credential_write(const struct credential *, FILE *); |
Jeff King | d3e847c | 2011-12-10 05:31:17 -0500 | [diff] [blame] | 30 | void credential_from_url(struct credential *, const char *url); |
Jeff King | 1182507 | 2011-12-10 05:31:24 -0500 | [diff] [blame] | 31 | int credential_match(const struct credential *have, |
| 32 | const struct credential *want); |
Jeff King | abca927 | 2011-12-10 05:31:11 -0500 | [diff] [blame] | 33 | |
| 34 | #endif /* CREDENTIAL_H */ |