diff options
Diffstat (limited to 'lasso/id-ff')
| -rw-r--r-- | lasso/id-ff/profile.c | 26 | ||||
| -rw-r--r-- | lasso/id-ff/profile.h | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/lasso/id-ff/profile.c b/lasso/id-ff/profile.c index 650c29f7..b616228c 100644 --- a/lasso/id-ff/profile.c +++ b/lasso/id-ff/profile.c @@ -417,6 +417,32 @@ lasso_profile_set_artifact_message(LassoProfile *profile, char *message) profile->private_data->artifact_message = g_strdup(message); } +/** + * lasso_profile_get_server: + * @profile: a #LassoProfile object + * + * Return the #LassoServer linked to this profile object. A profile object should always contains + * one. It allows to find metadatas of other providers and to know our own metadatas. + * + * Return value: a #LassoServer or NULL if profile is not a #LassoProfile or no #LassoServer object + * was setup at the creation of this profile. + */ +LassoServer* +lasso_profile_get_server(LassoProfile *profile) +{ + g_return_val_if_fail(LASSO_IS_PROFILE(profile), NULL); + + if (profile->server) { + if (LASSO_IS_SERVER(profile->server)) { + return profile->server; + } else { + message(G_LOG_LEVEL_WARNING, "profile->server contains a non LassoServer object"); + } + } + + return NULL; +} + /*****************************************************************************/ /* private methods */ diff --git a/lasso/id-ff/profile.h b/lasso/id-ff/profile.h index 758af182..1a327cda 100644 --- a/lasso/id-ff/profile.h +++ b/lasso/id-ff/profile.h @@ -141,6 +141,7 @@ LASSO_EXPORT LassoNode* lasso_profile_get_nameIdentifier(LassoProfile *profile); LASSO_EXPORT char* lasso_profile_get_artifact(LassoProfile *profile); LASSO_EXPORT char* lasso_profile_get_artifact_message(LassoProfile *profile); LASSO_EXPORT void lasso_profile_set_artifact_message(LassoProfile *profile, char *message); +LASSO_EXPORT LassoServer* lasso_profile_get_server(LassoProfile *profile); #ifdef __cplusplus } |
