4 #include "string-list.h"
7 struct string_list helpers;
20 #define CREDENTIAL_INIT { STRING_LIST_INIT_DUP }
22 void credential_init(struct credential *);
23 void credential_clear(struct credential *);
25 void credential_fill(struct credential *);
26 void credential_approve(struct credential *);
27 void credential_reject(struct credential *);
29 int credential_read(struct credential *, FILE *);
30 void credential_write(const struct credential *, FILE *);
33 * Parse a url into a credential struct, replacing any existing contents.
35 * Ifthe url can't be parsed (e.g., a missing "proto://" component), the
36 * resulting credential will be empty but we'll still return success from the
39 * If we encounter a component which cannot be represented as a credential
40 * value (e.g., because it contains a newline), the "gently" form will return
41 * an error but leave the broken state in the credential object for further
42 * examination. The non-gentle form will issue a warning to stderr and return
43 * an empty credential.
45 void credential_from_url(struct credential *, const char *url);
46 int credential_from_url_gently(struct credential *, const char *url, int quiet);
48 int credential_match(const struct credential *have,
49 const struct credential *want);
51 #endif /* CREDENTIAL_H */