VLC 4.0.0-dev
|
Data Structures | |
struct | vlc_credential |
Macros | |
#define | vlc_credential_get(a, b, c, d, e, f, ...) vlc_credential_get(a, VLC_OBJECT(b), c, d, e, f, ##__VA_ARGS__) |
#define | vlc_credential_store(a, b) vlc_credential_store(a, VLC_OBJECT(b)) |
Functions | |
void | vlc_credential_init (vlc_credential *p_credential, const vlc_url_t *p_url) |
Init a credential struct. More... | |
void | vlc_credential_clean (vlc_credential *p_credential) |
Clean a credential struct. More... | |
int | vlc_credential_get (vlc_credential *p_credential, vlc_object_t *p_parent, const char *psz_option_username, const char *psz_option_password, const char *psz_dialog_title, const char *psz_dialog_fmt,...) |
Get a username/password couple. More... | |
bool | vlc_credential_store (vlc_credential *p_credential, vlc_object_t *p_parent) |
Store the last dialog credential returned by vlc_credential_get() More... | |
#define vlc_credential_get | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
... | |||
) | vlc_credential_get(a, VLC_OBJECT(b), c, d, e, f, ##__VA_ARGS__) |
#define vlc_credential_store | ( | a, | |
b | |||
) | vlc_credential_store(a, VLC_OBJECT(b)) |
void vlc_credential_clean | ( | vlc_credential * | p_credential | ) |
Clean a credential struct.
References vlc_credential::i_entries_count, vlc_credential::p_entries, vlc_credential::p_keystore, vlc_credential::psz_dialog_password, vlc_credential::psz_dialog_username, vlc_credential::psz_split_domain, vlc_credential::psz_var_password, vlc_credential::psz_var_username, vlc_keystore_release(), and vlc_keystore_release_entries().
Referenced by Open().
int vlc_credential_get | ( | vlc_credential * | p_credential, |
vlc_object_t * | p_parent, | ||
const char * | psz_option_username, | ||
const char * | psz_option_password, | ||
const char * | psz_dialog_title, | ||
const char * | psz_dialog_fmt, | ||
... | |||
) |
Get a username/password couple.
This will search for a credential using url, VLC options, the vlc_keystore or by asking the user via dialog_Login(). This function can be called indefinitely, it will first return the user/password from the url (if any), then from VLC options (if any), then from the keystore (if any), and finally from the dialog (if any). This function will return true as long as the user fill the dialog texts and will return false when the user cancel it.
p_parent | the parent object (for var, keystore and dialog) |
psz_option_username | VLC option name for the username |
psz_option_password | VLC option name for the password |
psz_dialog_title | dialog title, if NULL, this function won't use the keystore or the dialog |
psz_dialog_fmt | dialog text using format |
References vlc_credential::b_from_keystore, vlc_credential::b_store, credential_find_keystore(), get_memory_keystore(), vlc_credential::i_get_order, is_credential_valid(), is_url_valid(), msg_Err, msg_Warn, vlc_credential::p_keystore, vlc_credential::p_url, protocol_is_smb(), vlc_credential::psz_dialog_password, vlc_credential::psz_dialog_username, vlc_credential::psz_password, vlc_url_t::psz_password, vlc_credential::psz_username, vlc_url_t::psz_username, vlc_credential::psz_var_password, vlc_credential::psz_var_username, smb_split_domain(), var_InheritString(), vlc_dialog_wait_login_va(), vlc_keystore_create(), and vlc_killed().
void vlc_credential_init | ( | vlc_credential * | p_credential, |
const vlc_url_t * | p_url | ||
) |
Init a credential struct.
psz_url | url to store or to search |
References vlc_credential::i_get_order, and vlc_credential::p_url.
Referenced by Open().
bool vlc_credential_store | ( | vlc_credential * | p_credential, |
vlc_object_t * | p_parent | ||
) |
Store the last dialog credential returned by vlc_credential_get()
This function will store the credential in the memory keystore if it's valid, or will store in the permanent one if it comes from the dialog and if the user asked for it.
References asprintf(), vlc_credential::b_from_keystore, vlc_credential::b_store, get_memory_keystore(), is_credential_valid(), KEY_AUTHTYPE, KEY_MAX, KEY_PATH, KEY_PORT, KEY_PROTOCOL, KEY_REALM, KEY_SERVER, KEY_USER, vlc_credential::p_keystore, vlc_credential::p_url, protocol_is_smb(), protocol_set_port(), protocol_store_path(), vlc_credential::psz_authtype, vlc_url_t::psz_host, psz_label, vlc_credential::psz_password, vlc_url_t::psz_path, vlc_url_t::psz_protocol, vlc_credential::psz_realm, vlc_credential::psz_username, vlc_keystore_store(), VLC_SUCCESS, and vlc_uri_decode_duplicate().