gboolean gdm_get_details_for_session (const char *id, char **name, char **comment) { GdmSessionFile *session; if (!gdm_sessions_map_is_initialized) { collect_sessions (); gdm_sessions_map_is_initialized = TRUE; } session = (GdmSessionFile *) g_hash_table_lookup (gdm_available_sessions_map, id); if (session == NULL) { return FALSE; } if (name != NULL) { *name = g_strdup (session->translated_name); } if (comment != NULL) { *comment = g_strdup (session->translated_comment); } return TRUE; }
/** * gdm_get_session_name_and_description: * @id: an id from gdm_get_session_ids() * @description: (out): optional returned session description * * Takes an xsession id and returns the name and comment about it. * * Returns: The session name if found, or %NULL otherwise */ char * gdm_get_session_name_and_description (const char *id, char **description) { GdmSessionFile *session; char *name; if (!gdm_sessions_map_is_initialized) { collect_sessions (); gdm_sessions_map_is_initialized = TRUE; } session = (GdmSessionFile *) g_hash_table_lookup (gdm_available_sessions_map, id); if (session == NULL) { return NULL; } name = g_strdup (session->translated_name); if (description != NULL) { *description = g_strdup (session->translated_comment); } return name; }