-static void _g_slist_free_g_object_unref (GSList* self);
-#define IDENTITIES_MANAGER_FILE_NAME "identities.txt"
-IdentitiesManager* identities_manager_new (void);
-IdentitiesManager* identities_manager_construct (GType object_type);
-static char* identities_manager_get_data_dir (IdentitiesManager* self);
-IdCard* id_card_new (void);
-IdCard* id_card_construct (GType object_type);
-void id_card_set_issuer (IdCard* self, const char* value);
-void id_card_set_username (IdCard* self, const char* value);
-void id_card_set_password (IdCard* self, const char* value);
-void id_card_set_services (IdCard* self, char** value, int value_length1);
-void id_card_set_display_name (IdCard* self, const char* value);
-GdkPixbuf* find_icon (const char* name, gint size);
-GType rule_get_type (void) G_GNUC_CONST;
-Rule* rule_dup (const Rule* self);
-void rule_free (Rule* self);
-void rule_copy (const Rule* self, Rule* dest);
-void rule_destroy (Rule* self);
-void id_card_set_rules (IdCard* self, Rule* value, int value_length1);
-static void _vala_Rule_array_free (Rule* array, gint array_length);
-GType trust_anchor_get_type (void) G_GNUC_CONST;
-TrustAnchor* id_card_get_trust_anchor (IdCard* self);
-void trust_anchor_set_ca_cert (TrustAnchor* self, const char* value);
-void trust_anchor_set_subject (TrustAnchor* self, const char* value);
-void trust_anchor_set_subject_alt (TrustAnchor* self, const char* value);
-void trust_anchor_set_server_cert (TrustAnchor* self, const char* value);
-void identities_manager_store_id_cards (IdentitiesManager* self);
-Rule* id_card_get_rules (IdCard* self, int* result_length1);
-const char* id_card_get_issuer (IdCard* self);
-const char* id_card_get_display_name (IdCard* self);
-const char* id_card_get_username (IdCard* self);
-const char* id_card_get_password (IdCard* self);
-char** id_card_get_services (IdCard* self, int* result_length1);
-static char** _vala_array_dup3 (char** self, int length);
-const char* trust_anchor_get_ca_cert (TrustAnchor* self);
-const char* trust_anchor_get_subject (TrustAnchor* self);
-const char* trust_anchor_get_subject_alt (TrustAnchor* self);
-const char* trust_anchor_get_server_cert (TrustAnchor* self);
-static void identities_manager_finalize (GObject* obj);
-static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
-static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
-
-
-
-static void _g_slist_free_g_object_unref (GSList* self) {
- g_slist_foreach (self, (GFunc) g_object_unref, NULL);
- g_slist_free (self);
-}
-
-
-static void _vala_Rule_array_free (Rule* array, gint array_length) {
- if (array != NULL) {
- int i;
- for (i = 0; i < array_length; i = i + 1) {
- rule_destroy (&array[i]);
- }
- }
- g_free (array);
-}
-
-
-static gpointer _g_object_ref0 (gpointer self) {
- return self ? g_object_ref (self) : NULL;
-}
-
-
-IdentitiesManager* identities_manager_construct (GType object_type) {
- IdentitiesManager * self = NULL;
- GSList* _tmp0_;
- GKeyFile* key_file;
- char* path;
- char* filename;
- gint identities_uris_length1;
- gint _identities_uris_size_;
- char** _tmp2_;
- gsize _tmp1_;
- char** identities_uris;
- GError * _inner_error_ = NULL;
- self = (IdentitiesManager*) g_object_new (object_type, NULL);
- self->id_card_list = (_tmp0_ = NULL, __g_slist_free_g_object_unref0 (self->id_card_list), _tmp0_);
- key_file = g_key_file_new ();
- path = identities_manager_get_data_dir (self);
- filename = g_build_filename (path, IDENTITIES_MANAGER_FILE_NAME, NULL);
- {
- g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, &_inner_error_);
- if (_inner_error_ != NULL) {
- goto __catch0_g_error;
- }
- }
- goto __finally0;
- __catch0_g_error:
- {
- GError * e;
- e = _inner_error_;
- _inner_error_ = NULL;
- {
- fprintf (stdout, "Error: %s\n", e->message);
- _g_error_free0 (e);
- _g_free0 (filename);
- _g_free0 (path);
- _g_key_file_free0 (key_file);
- return self;
- }
- }
- __finally0:
- if (_inner_error_ != NULL) {
- _g_free0 (filename);
- _g_free0 (path);
- _g_key_file_free0 (key_file);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return NULL;
- }
- identities_uris = (_tmp2_ = g_key_file_get_groups (key_file, &_tmp1_), identities_uris_length1 = _tmp1_, _identities_uris_size_ = identities_uris_length1, _tmp2_);
- {
- char** identity_collection;
- int identity_collection_length1;
- int identity_it;
- identity_collection = identities_uris;
- identity_collection_length1 = identities_uris_length1;
- for (identity_it = 0; identity_it < identities_uris_length1; identity_it = identity_it + 1) {
- char* identity;
- identity = g_strdup (identity_collection[identity_it]);
- {
- {
- IdCard* id_card;
- char* _tmp3_;
- char* _tmp4_;
- char* _tmp5_;
- char* _tmp6_;
- char* _tmp7_;
- char* _tmp8_;
- gint _tmp10__length1;
- gint __tmp10__size_;
- char** _tmp11_;
- gsize _tmp9_;
- char** _tmp10_;
- char** _tmp12_;
- gint _tmp12__length1;
- char** _tmp13_;
- char* _tmp14_;
- char* _tmp15_;
- gboolean _tmp16_ = FALSE;
- gboolean _tmp17_;
- char* _tmp28_;
- char* _tmp29_;
- char* _tmp30_;
- char* _tmp31_;
- char* _tmp32_;
- char* _tmp33_;
- char* _tmp34_;
- char* _tmp35_;
- id_card = id_card_new ();
- _tmp3_ = g_key_file_get_string (key_file, identity, "Issuer", &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- id_card_set_issuer (id_card, _tmp4_ = _tmp3_);
- _g_free0 (_tmp4_);
- _tmp5_ = g_key_file_get_string (key_file, identity, "Username", &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- id_card_set_username (id_card, _tmp6_ = _tmp5_);
- _g_free0 (_tmp6_);
- _tmp7_ = g_key_file_get_string (key_file, identity, "Password", &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- id_card_set_password (id_card, _tmp8_ = _tmp7_);
- _g_free0 (_tmp8_);
- _tmp10_ = (_tmp11_ = g_key_file_get_string_list (key_file, identity, "Services", &_tmp9_, &_inner_error_), _tmp10__length1 = _tmp9_, __tmp10__size_ = _tmp10__length1, _tmp11_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- _tmp13_ = (_tmp12_ = _tmp10_, _tmp12__length1 = _tmp10__length1, _tmp12_);
- id_card_set_services (id_card, _tmp13_, _tmp10__length1);
- _tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_free), NULL);
- _tmp14_ = g_key_file_get_string (key_file, identity, "DisplayName", &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- id_card_set_display_name (id_card, _tmp15_ = _tmp14_);
- _g_free0 (_tmp15_);
- g_object_set_data_full ((GObject*) id_card, "pixbuf", find_icon ("avatar-default", 48), g_object_unref);
- _tmp17_ = g_key_file_has_key (key_file, identity, "Rules-Patterns", &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- if (_tmp17_) {
- gboolean _tmp18_;
- _tmp18_ = g_key_file_has_key (key_file, identity, "Rules-AlwaysConfirm", &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- _tmp16_ = _tmp18_;
- } else {
- _tmp16_ = FALSE;
- }
- if (_tmp16_) {
- gint rules_patterns_length1;
- gint _rules_patterns_size_;
- char** _tmp20_;
- gsize _tmp19_;
- char** rules_patterns;
- gint rules_always_conf_length1;
- gint _rules_always_conf_size_;
- char** _tmp22_;
- gsize _tmp21_;
- char** rules_always_conf;
- rules_patterns = (_tmp20_ = g_key_file_get_string_list (key_file, identity, "Rules-Patterns", &_tmp19_, &_inner_error_), rules_patterns_length1 = _tmp19_, _rules_patterns_size_ = rules_patterns_length1, _tmp20_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- rules_always_conf = (_tmp22_ = g_key_file_get_string_list (key_file, identity, "Rules-AlwaysConfirm", &_tmp21_, &_inner_error_), rules_always_conf_length1 = _tmp21_, _rules_always_conf_size_ = rules_always_conf_length1, _tmp22_);
- if (_inner_error_ != NULL) {
- rules_patterns = (_vala_array_free (rules_patterns, rules_patterns_length1, (GDestroyNotify) g_free), NULL);
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- if (rules_patterns_length1 == rules_always_conf_length1) {
- gint rules_length1;
- gint _rules_size_;
- Rule* _tmp23_;
- Rule* rules;
- Rule* _tmp27_;
- rules = (_tmp23_ = g_new0 (Rule, rules_patterns_length1), rules_length1 = rules_patterns_length1, _rules_size_ = rules_length1, _tmp23_);
- {
- gint i;
- i = 0;
- {
- gboolean _tmp24_;
- _tmp24_ = TRUE;
- while (TRUE) {
- Rule _tmp25_ = {0};
- Rule _tmp26_;
- if (!_tmp24_) {
- i++;
- }
- _tmp24_ = FALSE;
- if (!(i < rules_patterns_length1)) {
- break;
- }
- rules[i] = (_tmp26_ = (_tmp25_.pattern = g_strdup (rules_patterns[i]), _tmp25_.always_confirm = g_strdup (rules_always_conf[i]), _tmp25_), rule_destroy (&rules[i]), _tmp26_);
- }
- }
- }
- _tmp27_ = rules;
- id_card_set_rules (id_card, _tmp27_, rules_length1);
- rules = (_vala_Rule_array_free (rules, rules_length1), NULL);
- }
- rules_always_conf = (_vala_array_free (rules_always_conf, rules_always_conf_length1, (GDestroyNotify) g_free), NULL);
- rules_patterns = (_vala_array_free (rules_patterns, rules_patterns_length1, (GDestroyNotify) g_free), NULL);
- }
- _tmp28_ = g_key_file_get_string (key_file, identity, "CA-Cert", &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- trust_anchor_set_ca_cert (id_card_get_trust_anchor (id_card), _tmp29_ = _tmp28_);
- _g_free0 (_tmp29_);
- _tmp30_ = g_key_file_get_string (key_file, identity, "Subject", &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- trust_anchor_set_subject (id_card_get_trust_anchor (id_card), _tmp31_ = _tmp30_);
- _g_free0 (_tmp31_);
- _tmp32_ = g_key_file_get_string (key_file, identity, "SubjectAlt", &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- trust_anchor_set_subject_alt (id_card_get_trust_anchor (id_card), _tmp33_ = _tmp32_);
- _g_free0 (_tmp33_);
- _tmp34_ = g_key_file_get_string (key_file, identity, "ServerCert", &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (id_card);
- goto __catch1_g_error;
- }
- trust_anchor_set_server_cert (id_card_get_trust_anchor (id_card), _tmp35_ = _tmp34_);
- _g_free0 (_tmp35_);
- self->id_card_list = g_slist_prepend (self->id_card_list, _g_object_ref0 (id_card));
- _g_object_unref0 (id_card);
- }
- goto __finally1;
- __catch1_g_error:
- {
- GError * e;
- e = _inner_error_;
- _inner_error_ = NULL;
- {
- fprintf (stdout, "Error: %s\n", e->message);
- _g_error_free0 (e);
- }
- }
- __finally1:
- if (_inner_error_ != NULL) {
- _g_free0 (identity);
- identities_uris = (_vala_array_free (identities_uris, identities_uris_length1, (GDestroyNotify) g_free), NULL);
- _g_free0 (filename);
- _g_free0 (path);
- _g_key_file_free0 (key_file);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return NULL;
- }
- _g_free0 (identity);
- }
- }
- }
- identities_uris = (_vala_array_free (identities_uris, identities_uris_length1, (GDestroyNotify) g_free), NULL);
- _g_free0 (filename);
- _g_free0 (path);
- _g_key_file_free0 (key_file);
- return self;