credential.h 833 Bytes
Newer Older
Jeff King's avatar
Jeff King committed
1 2 3 4 5 6 7
#ifndef CREDENTIAL_H
#define CREDENTIAL_H

#include "string-list.h"

struct credential {
	struct string_list helpers;
8
	unsigned approved:1,
9
		 configured:1,
10
		 quit:1,
11
		 use_http_path:1;
Jeff King's avatar
Jeff King committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

	char *username;
	char *password;
	char *protocol;
	char *host;
	char *path;
};

#define CREDENTIAL_INIT { STRING_LIST_INIT_DUP }

void credential_init(struct credential *);
void credential_clear(struct credential *);

void credential_fill(struct credential *);
void credential_approve(struct credential *);
void credential_reject(struct credential *);

int credential_read(struct credential *, FILE *);
30
void credential_write(const struct credential *, FILE *);
31
void credential_from_url(struct credential *, const char *url);
32 33
int credential_match(const struct credential *have,
		     const struct credential *want);
Jeff King's avatar
Jeff King committed
34 35

#endif /* CREDENTIAL_H */