| File: | midgard_key_config_file_context.c |
| Location: | line 236, column 5 |
| Description: | Value stored to 'child_collection_length1' is never read |
| 1 | /* midgard_key_config_file_context.c generated by valac, the Vala compiler |
| 2 | * generated from midgard_key_config_file_context.vala, do not modify */ |
| 3 | |
| 4 | /* |
| 5 | * Copyright (C) 2009 Piotr Pokora <piotrek.pokora@gmail.com> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify it |
| 8 | * under the terms of the GNU Lesser General Public License as published |
| 9 | * by the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | */ |
| 21 | |
| 22 | #include <glib.h> |
| 23 | #include <glib-object.h> |
| 24 | #include <stdlib.h> |
| 25 | #include <string.h> |
| 26 | #include <glib/gstdio.h> |
| 27 | |
| 28 | |
| 29 | #define MIDGARD_TYPE_KEY_CONFIG_CONTEXT(midgard_key_config_context_get_type ()) (midgard_key_config_context_get_type ()) |
| 30 | #define MIDGARD_KEY_CONFIG_CONTEXT(obj)((((MidgardKeyConfigContext*) g_type_check_instance_cast ((GTypeInstance *) ((obj)), ((midgard_key_config_context_get_type ())))))) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDGARD_TYPE_KEY_CONFIG_CONTEXT, MidgardKeyConfigContext)(((MidgardKeyConfigContext*) g_type_check_instance_cast ((GTypeInstance *) ((obj)), ((midgard_key_config_context_get_type ())))))) |
| 31 | #define MIDGARD_KEY_CONFIG_CONTEXT_CLASS(klass)((((MidgardKeyConfigContextClass*) g_type_check_class_cast (( GTypeClass*) ((klass)), ((midgard_key_config_context_get_type ())))))) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDGARD_TYPE_KEY_CONFIG_CONTEXT, MidgardKeyConfigContextClass)(((MidgardKeyConfigContextClass*) g_type_check_class_cast ((GTypeClass *) ((klass)), ((midgard_key_config_context_get_type ())))))) |
| 32 | #define MIDGARD_IS_KEY_CONFIG_CONTEXT(obj)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( (obj)); GType __t = ((midgard_key_config_context_get_type ()) ); gboolean __r; if (__inst && __inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDGARD_TYPE_KEY_CONFIG_CONTEXT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( (obj)); GType __t = ((midgard_key_config_context_get_type ()) ); gboolean __r; if (__inst && __inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) |
| 33 | #define MIDGARD_IS_KEY_CONFIG_CONTEXT_CLASS(klass)(((__extension__ ({ GTypeClass *__class = (GTypeClass*) ((klass )); GType __t = ((midgard_key_config_context_get_type ())); gboolean __r; if (__class && __class->g_type == __t) __r = (!(0)); else __r = g_type_check_class_is_a (__class, __t); __r ; })))) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDGARD_TYPE_KEY_CONFIG_CONTEXT)((__extension__ ({ GTypeClass *__class = (GTypeClass*) ((klass )); GType __t = ((midgard_key_config_context_get_type ())); gboolean __r; if (__class && __class->g_type == __t) __r = (!(0)); else __r = g_type_check_class_is_a (__class, __t); __r ; })))) |
| 34 | #define MIDGARD_KEY_CONFIG_CONTEXT_GET_CLASS(obj)((((MidgardKeyConfigContextClass*) (((GTypeInstance*) ((obj)) )->g_class)))) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDGARD_TYPE_KEY_CONFIG_CONTEXT, MidgardKeyConfigContextClass)(((MidgardKeyConfigContextClass*) (((GTypeInstance*) ((obj))) ->g_class)))) |
| 35 | |
| 36 | typedef struct _MidgardKeyConfigContext MidgardKeyConfigContext; |
| 37 | typedef struct _MidgardKeyConfigContextClass MidgardKeyConfigContextClass; |
| 38 | typedef struct _MidgardKeyConfigContextPrivate MidgardKeyConfigContextPrivate; |
| 39 | |
| 40 | #define MIDGARD_TYPE_KEY_CONFIG_FILE_CONTEXT(midgard_key_config_file_context_get_type ()) (midgard_key_config_file_context_get_type ()) |
| 41 | #define MIDGARD_KEY_CONFIG_FILE_CONTEXT(obj)((((MidgardKeyConfigFileContext*) g_type_check_instance_cast ( (GTypeInstance*) ((obj)), ((midgard_key_config_file_context_get_type ())))))) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDGARD_TYPE_KEY_CONFIG_FILE_CONTEXT, MidgardKeyConfigFileContext)(((MidgardKeyConfigFileContext*) g_type_check_instance_cast ( (GTypeInstance*) ((obj)), ((midgard_key_config_file_context_get_type ())))))) |
| 42 | #define MIDGARD_KEY_CONFIG_FILE_CONTEXT_CLASS(klass)((((MidgardKeyConfigFileContextClass*) g_type_check_class_cast ((GTypeClass*) ((klass)), ((midgard_key_config_file_context_get_type ())))))) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDGARD_TYPE_KEY_CONFIG_FILE_CONTEXT, MidgardKeyConfigFileContextClass)(((MidgardKeyConfigFileContextClass*) g_type_check_class_cast ((GTypeClass*) ((klass)), ((midgard_key_config_file_context_get_type ())))))) |
| 43 | #define MIDGARD_IS_KEY_CONFIG_FILE_CONTEXT(obj)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( (obj)); GType __t = ((midgard_key_config_file_context_get_type ())); gboolean __r; if (__inst && __inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDGARD_TYPE_KEY_CONFIG_FILE_CONTEXT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( (obj)); GType __t = ((midgard_key_config_file_context_get_type ())); gboolean __r; if (__inst && __inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) |
| 44 | #define MIDGARD_IS_KEY_CONFIG_FILE_CONTEXT_CLASS(klass)(((__extension__ ({ GTypeClass *__class = (GTypeClass*) ((klass )); GType __t = ((midgard_key_config_file_context_get_type () )); gboolean __r; if (__class && __class->g_type == __t) __r = (!(0)); else __r = g_type_check_class_is_a (__class , __t); __r; })))) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDGARD_TYPE_KEY_CONFIG_FILE_CONTEXT)((__extension__ ({ GTypeClass *__class = (GTypeClass*) ((klass )); GType __t = ((midgard_key_config_file_context_get_type () )); gboolean __r; if (__class && __class->g_type == __t) __r = (!(0)); else __r = g_type_check_class_is_a (__class , __t); __r; })))) |
| 45 | #define MIDGARD_KEY_CONFIG_FILE_CONTEXT_GET_CLASS(obj)((((MidgardKeyConfigFileContextClass*) (((GTypeInstance*) ((obj )))->g_class)))) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDGARD_TYPE_KEY_CONFIG_FILE_CONTEXT, MidgardKeyConfigFileContextClass)(((MidgardKeyConfigFileContextClass*) (((GTypeInstance*) ((obj )))->g_class)))) |
| 46 | |
| 47 | typedef struct _MidgardKeyConfigFileContext MidgardKeyConfigFileContext; |
| 48 | typedef struct _MidgardKeyConfigFileContextClass MidgardKeyConfigFileContextClass; |
| 49 | typedef struct _MidgardKeyConfigFileContextPrivate MidgardKeyConfigFileContextPrivate; |
| 50 | #define _g_dir_close0(var)((var == ((void*)0)) ? ((void*)0) : (var = (g_dir_close (var) , ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (g_dir_close (var), NULL((void*)0)))) |
| 51 | #define _g_error_free0(var)((var == ((void*)0)) ? ((void*)0) : (var = (g_error_free (var ), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (g_error_free (var), NULL((void*)0)))) |
| 52 | #define _g_free0(var)(var = (g_free (var), ((void*)0))) (var = (g_free (var), NULL((void*)0))) |
| 53 | #define _g_regex_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (g_regex_unref (var ), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (g_regex_unref (var), NULL((void*)0)))) |
| 54 | |
| 55 | struct _MidgardKeyConfigContext { |
| 56 | GObject parent_instance; |
| 57 | MidgardKeyConfigContextPrivate * priv; |
| 58 | }; |
| 59 | |
| 60 | struct _MidgardKeyConfigContextClass { |
| 61 | GObjectClass parent_class; |
| 62 | char** (*list_key_config) (MidgardKeyConfigContext* self, int* result_length1); |
| 63 | }; |
| 64 | |
| 65 | struct _MidgardKeyConfigFileContext { |
| 66 | MidgardKeyConfigContext parent_instance; |
| 67 | MidgardKeyConfigFileContextPrivate * priv; |
| 68 | }; |
| 69 | |
| 70 | struct _MidgardKeyConfigFileContextClass { |
| 71 | MidgardKeyConfigContextClass parent_class; |
| 72 | }; |
| 73 | |
| 74 | typedef enum { |
| 75 | KEY_CONFIG_CONTEXT_ERROR_PATH_IS_NOT_ABSOLUTE |
| 76 | } KeyConfigContextError; |
| 77 | #define KEY_CONFIG_CONTEXT_ERRORkey_config_context_error_quark () key_config_context_error_quark () |
| 78 | |
| 79 | static gpointer midgard_key_config_file_context_parent_class = NULL((void*)0); |
| 80 | |
| 81 | GType midgard_key_config_context_get_type (void); |
| 82 | GType midgard_key_config_file_context_get_type (void); |
| 83 | enum { |
| 84 | MIDGARD_KEY_CONFIG_FILE_CONTEXT_DUMMY_PROPERTY |
| 85 | }; |
| 86 | GQuark key_config_context_error_quark (void); |
| 87 | MidgardKeyConfigContext* midgard_key_config_context_construct (GType object_type, const char* context_path); |
| 88 | MidgardKeyConfigFileContext* midgard_key_config_file_context_new (const char* context_path, GError** error); |
| 89 | MidgardKeyConfigFileContext* midgard_key_config_file_context_construct (GType object_type, const char* context_path, GError** error); |
| 90 | static char** midgard_key_config_file_context_set_cfgs (MidgardKeyConfigFileContext* self, const char* path, gint i, int* result_length1); |
| 91 | static void _vala_array_add1 (char*** array, int* length, int* size, char* value); |
| 92 | #define MIDGARD_CONFIG_EXTENSION".mcfg" ".mcfg" |
| 93 | const char* midgard_key_config_context_get_context_path (MidgardKeyConfigContext* self); |
| 94 | static void _vala_array_add2 (char*** array, int* length, int* size, char* value); |
| 95 | static char** midgard_key_config_file_context_real_list_key_config (MidgardKeyConfigContext* base, int* result_length1); |
| 96 | static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); |
| 97 | static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); |
| 98 | |
| 99 | |
| 100 | |
| 101 | MidgardKeyConfigFileContext* midgard_key_config_file_context_construct (GType object_type, const char* context_path, GError** error) { |
| 102 | GError * _inner_error_; |
| 103 | MidgardKeyConfigFileContext * self; |
| 104 | g_return_val_if_fail (context_path != NULL, NULL)do{ if (context_path != ((void*)0)) { } else { g_return_if_fail_warning ("midgard-core", __PRETTY_FUNCTION__, "context_path != NULL" ); return (((void*)0)); }; }while (0); |
| 105 | _inner_error_ = NULL((void*)0); |
| 106 | if (!g_path_is_absolute (context_path)) { |
| 107 | _inner_error_ = g_error_new (KEY_CONFIG_CONTEXT_ERRORkey_config_context_error_quark (), KEY_CONFIG_CONTEXT_ERROR_PATH_IS_NOT_ABSOLUTE, "Expected absolute path. %s given", context_path); |
| 108 | if (_inner_error_ != NULL((void*)0)) { |
| 109 | if (_inner_error_->domain == KEY_CONFIG_CONTEXT_ERRORkey_config_context_error_quark ()) { |
| 110 | g_propagate_error (error, _inner_error_); |
| 111 | return NULL((void*)0); |
| 112 | } else { |
| 113 | g_critical ("file %s: line %d: uncaught error: %s", __FILE__, __LINE__, _inner_error_->message)g_log ("midgard-core", G_LOG_LEVEL_CRITICAL, "file %s: line %d: uncaught error: %s" , "src/midgard_key_config_file_context.c", 113, _inner_error_ ->message); |
| 114 | g_clear_error (&_inner_error_); |
| 115 | return NULL((void*)0); |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | self = (MidgardKeyConfigFileContext*) midgard_key_config_context_construct (object_type, context_path); |
| 120 | return self; |
| 121 | } |
| 122 | |
| 123 | |
| 124 | MidgardKeyConfigFileContext* midgard_key_config_file_context_new (const char* context_path, GError** error) { |
| 125 | return midgard_key_config_file_context_construct (MIDGARD_TYPE_KEY_CONFIG_FILE_CONTEXT(midgard_key_config_file_context_get_type ()), context_path, error); |
| 126 | } |
| 127 | |
| 128 | |
| 129 | static void _vala_array_add1 (char*** array, int* length, int* size, char* value) { |
| 130 | if ((*length) == (*size)) { |
| 131 | *size = (*size) ? (2 * (*size)) : 4; |
| 132 | *array = g_renew (char*, *array, (*size) + 1)((char* *) g_realloc ((*array), ((gsize) sizeof (char*)) * (( gsize) ((*size) + 1)))); |
| 133 | } |
| 134 | (*array)[(*length)++] = value; |
| 135 | (*array)[*length] = NULL((void*)0); |
| 136 | } |
| 137 | |
| 138 | |
| 139 | static char* string_substring (const char* self, glong offset, glong len) { |
| 140 | char* result; |
| 141 | glong string_length; |
| 142 | const char* start; |
| 143 | g_return_val_if_fail (self != NULL, NULL)do{ if (self != ((void*)0)) { } else { g_return_if_fail_warning ("midgard-core", __PRETTY_FUNCTION__, "self != NULL"); return (((void*)0)); }; }while (0); |
| 144 | string_length = g_utf8_strlen (self, -1); |
| 145 | if (offset < 0) { |
| 146 | offset = string_length + offset; |
| 147 | g_return_val_if_fail (offset >= 0, NULL)do{ if (offset >= 0) { } else { g_return_if_fail_warning ( "midgard-core", __PRETTY_FUNCTION__, "offset >= 0"); return (((void*)0)); }; }while (0); |
| 148 | } else { |
| 149 | g_return_val_if_fail (offset <= string_length, NULL)do{ if (offset <= string_length) { } else { g_return_if_fail_warning ("midgard-core", __PRETTY_FUNCTION__, "offset <= string_length" ); return (((void*)0)); }; }while (0); |
| 150 | } |
| 151 | if (len < 0) { |
| 152 | len = string_length - offset; |
| 153 | } |
| 154 | g_return_val_if_fail ((offset + len) <= string_length, NULL)do{ if ((offset + len) <= string_length) { } else { g_return_if_fail_warning ("midgard-core", __PRETTY_FUNCTION__, "(offset + len) <= string_length" ); return (((void*)0)); }; }while (0); |
| 155 | start = g_utf8_offset_to_pointer (self, offset); |
| 156 | result = g_strndup (start, ((gchar*) g_utf8_offset_to_pointer (start, len)) - ((gchar*) start)); |
| 157 | return result; |
| 158 | } |
| 159 | |
| 160 | |
| 161 | static void _vala_array_add2 (char*** array, int* length, int* size, char* value) { |
| 162 | if ((*length) == (*size)) { |
| 163 | *size = (*size) ? (2 * (*size)) : 4; |
| 164 | *array = g_renew (char*, *array, (*size) + 1)((char* *) g_realloc ((*array), ((gsize) sizeof (char*)) * (( gsize) ((*size) + 1)))); |
| 165 | } |
| 166 | (*array)[(*length)++] = value; |
| 167 | (*array)[*length] = NULL((void*)0); |
| 168 | } |
| 169 | |
| 170 | |
| 171 | static char** midgard_key_config_file_context_set_cfgs (MidgardKeyConfigFileContext* self, const char* path, gint i, int* result_length1) { |
| 172 | char** result; |
| 173 | GError * _inner_error_; |
| 174 | GDir* dir; |
| 175 | char* name; |
| 176 | char** _tmp2_; |
| 177 | gint cfgs_size; |
| 178 | gint cfgs_length1; |
| 179 | char** cfgs; |
| 180 | char** _tmp9_; |
| 181 | g_return_val_if_fail (self != NULL, NULL)do{ if (self != ((void*)0)) { } else { g_return_if_fail_warning ("midgard-core", __PRETTY_FUNCTION__, "self != NULL"); return (((void*)0)); }; }while (0); |
| 182 | g_return_val_if_fail (path != NULL, NULL)do{ if (path != ((void*)0)) { } else { g_return_if_fail_warning ("midgard-core", __PRETTY_FUNCTION__, "path != NULL"); return (((void*)0)); }; }while (0); |
| 183 | _inner_error_ = NULL((void*)0); |
| 184 | dir = NULL((void*)0); |
| 185 | { |
| 186 | GDir* _tmp0_; |
| 187 | GDir* _tmp1_; |
| 188 | _tmp0_ = g_dir_open (path, 0, &_inner_error_); |
| 189 | if (_inner_error_ != NULL((void*)0)) { |
| 190 | if (_inner_error_->domain == G_FILE_ERRORg_file_error_quark ()) { |
| 191 | goto __catch0_g_file_error; |
| 192 | } |
| 193 | goto __finally0; |
| 194 | } |
| 195 | dir = (_tmp1_ = _tmp0_, _g_dir_close0 (dir)((dir == ((void*)0)) ? ((void*)0) : (dir = (g_dir_close (dir) , ((void*)0)))), _tmp1_); |
| 196 | } |
| 197 | goto __finally0; |
| 198 | __catch0_g_file_error: |
| 199 | { |
| 200 | GError * e; |
| 201 | e = _inner_error_; |
| 202 | _inner_error_ = NULL((void*)0); |
| 203 | { |
| 204 | g_warning ("midgard_key_config_file_context.vala:45: Can not open context path %s. %s", path, e->message)g_log ("midgard-core", G_LOG_LEVEL_WARNING, "midgard_key_config_file_context.vala:45: Can not open context path %s. %s" , path, e->message); |
| 205 | _g_error_free0 (e)((e == ((void*)0)) ? ((void*)0) : (e = (g_error_free (e), ((void *)0)))); |
| 206 | } |
| 207 | } |
| 208 | __finally0: |
| 209 | if (_inner_error_ != NULL((void*)0)) { |
| 210 | _g_dir_close0 (dir)((dir == ((void*)0)) ? ((void*)0) : (dir = (g_dir_close (dir) , ((void*)0)))); |
| 211 | g_critical ("file %s: line %d: uncaught error: %s", __FILE__, __LINE__, _inner_error_->message)g_log ("midgard-core", G_LOG_LEVEL_CRITICAL, "file %s: line %d: uncaught error: %s" , "src/midgard_key_config_file_context.c", 211, _inner_error_ ->message); |
| 212 | g_clear_error (&_inner_error_); |
| 213 | return NULL((void*)0); |
| 214 | } |
| 215 | name = NULL((void*)0); |
| 216 | cfgs = (_tmp2_ = g_new0 (char*, 0 + 1)((char* *) g_malloc0 (((gsize) sizeof (char*)) * ((gsize) (0 + 1)))), cfgs_length1 = 0, cfgs_size = cfgs_length1, _tmp2_); |
| 217 | while (TRUE(!(0))) { |
| 218 | char* _tmp3_; |
| 219 | char* abspath; |
| 220 | if (!((name = (_tmp3_ = g_strdup (g_dir_read_name (dir)), _g_free0 (name)(name = (g_free (name), ((void*)0))), _tmp3_)) != NULL((void*)0))) { |
| 221 | break; |
| 222 | } |
| 223 | abspath = g_build_filename (path, name, NULL((void*)0)); |
| 224 | if (g_file_test (abspath, G_FILE_TEST_IS_DIR)) { |
| 225 | char** _tmp5_; |
| 226 | gint children_size; |
| 227 | gint children_length1; |
| 228 | gint _tmp4_; |
| 229 | char** children; |
| 230 | children = (_tmp5_ = midgard_key_config_file_context_set_cfgs (self, abspath, i, &_tmp4_), children_length1 = _tmp4_, children_size = children_length1, _tmp5_); |
| 231 | { |
| 232 | char** child_collection; |
| 233 | int child_collection_length1; |
| 234 | int child_it; |
| 235 | child_collection = children; |
| 236 | child_collection_length1 = children_length1; |
Value stored to 'child_collection_length1' is never read | |
| 237 | for (child_it = 0; child_it < children_length1; child_it = child_it + 1) { |
| 238 | const char* child; |
| 239 | child = child_collection[child_it]; |
| 240 | { |
| 241 | _vala_array_add1 (&cfgs, &cfgs_length1, &cfgs_size, g_strdup (child)); |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | children = (_vala_array_free (children, children_length1, (GDestroyNotify) g_free), NULL((void*)0)); |
| 246 | } else { |
| 247 | if (g_str_has_suffix (abspath, MIDGARD_CONFIG_EXTENSION".mcfg")) { |
| 248 | char* path_wo_suffix; |
| 249 | path_wo_suffix = string_substring (abspath, (glong) 0, g_utf8_strlen (abspath, -1) - g_utf8_strlen (MIDGARD_CONFIG_EXTENSION".mcfg", -1)); |
| 250 | { |
| 251 | char* _tmp6_; |
| 252 | GRegex* _tmp7_; |
| 253 | GRegex* regex; |
| 254 | char* _tmp8_; |
| 255 | regex = (_tmp7_ = g_regex_new (_tmp6_ = g_regex_escape_string (midgard_key_config_context_get_context_path ((MidgardKeyConfigContext*) self), -1), 0, 0, &_inner_error_), _g_free0 (_tmp6_)(_tmp6_ = (g_free (_tmp6_), ((void*)0))), _tmp7_); |
| 256 | if (_inner_error_ != NULL((void*)0)) { |
| 257 | goto __catch1_g_error; |
| 258 | goto __finally1; |
| 259 | } |
| 260 | _tmp8_ = g_regex_replace_literal (regex, path_wo_suffix, (glong) (-1), 0, "", 0, &_inner_error_); |
| 261 | if (_inner_error_ != NULL((void*)0)) { |
| 262 | _g_regex_unref0 (regex)((regex == ((void*)0)) ? ((void*)0) : (regex = (g_regex_unref (regex), ((void*)0)))); |
| 263 | goto __catch1_g_error; |
| 264 | goto __finally1; |
| 265 | } |
| 266 | _vala_array_add2 (&cfgs, &cfgs_length1, &cfgs_size, _tmp8_); |
| 267 | _g_regex_unref0 (regex)((regex == ((void*)0)) ? ((void*)0) : (regex = (g_regex_unref (regex), ((void*)0)))); |
| 268 | } |
| 269 | goto __finally1; |
| 270 | __catch1_g_error: |
| 271 | { |
| 272 | /*Error object is not used within catch statement, clear it*/ |
| 273 | g_clear_error (&_inner_error_); |
| 274 | _inner_error_ = NULL((void*)0); |
| 275 | { |
| 276 | g_warning ("midgard_key_config_file_context.vala:70: Weird path '%s', not added.", abspath)g_log ("midgard-core", G_LOG_LEVEL_WARNING, "midgard_key_config_file_context.vala:70: Weird path '%s', not added." , abspath); |
| 277 | } |
| 278 | } |
| 279 | __finally1: |
| 280 | if (_inner_error_ != NULL((void*)0)) { |
| 281 | _g_free0 (path_wo_suffix)(path_wo_suffix = (g_free (path_wo_suffix), ((void*)0))); |
| 282 | _g_free0 (abspath)(abspath = (g_free (abspath), ((void*)0))); |
| 283 | _g_dir_close0 (dir)((dir == ((void*)0)) ? ((void*)0) : (dir = (g_dir_close (dir) , ((void*)0)))); |
| 284 | _g_free0 (name)(name = (g_free (name), ((void*)0))); |
| 285 | cfgs = (_vala_array_free (cfgs, cfgs_length1, (GDestroyNotify) g_free), NULL((void*)0)); |
| 286 | g_critical ("file %s: line %d: uncaught error: %s", __FILE__, __LINE__, _inner_error_->message)g_log ("midgard-core", G_LOG_LEVEL_CRITICAL, "file %s: line %d: uncaught error: %s" , "src/midgard_key_config_file_context.c", 286, _inner_error_ ->message); |
| 287 | g_clear_error (&_inner_error_); |
| 288 | return NULL((void*)0); |
| 289 | } |
| 290 | i++; |
| 291 | _g_free0 (path_wo_suffix)(path_wo_suffix = (g_free (path_wo_suffix), ((void*)0))); |
| 292 | } |
| 293 | } |
| 294 | _g_free0 (abspath)(abspath = (g_free (abspath), ((void*)0))); |
| 295 | } |
| 296 | result = (_tmp9_ = cfgs, *result_length1 = cfgs_length1, _tmp9_); |
| 297 | _g_dir_close0 (dir)((dir == ((void*)0)) ? ((void*)0) : (dir = (g_dir_close (dir) , ((void*)0)))); |
| 298 | _g_free0 (name)(name = (g_free (name), ((void*)0))); |
| 299 | return result; |
| 300 | _g_dir_close0 (dir)((dir == ((void*)0)) ? ((void*)0) : (dir = (g_dir_close (dir) , ((void*)0)))); |
| 301 | _g_free0 (name)(name = (g_free (name), ((void*)0))); |
| 302 | cfgs = (_vala_array_free (cfgs, cfgs_length1, (GDestroyNotify) g_free), NULL((void*)0)); |
| 303 | } |
| 304 | |
| 305 | |
| 306 | static char** midgard_key_config_file_context_real_list_key_config (MidgardKeyConfigContext* base, int* result_length1) { |
| 307 | MidgardKeyConfigFileContext * self; |
| 308 | char** result; |
| 309 | gint _tmp0_; |
| 310 | char** _tmp1_; |
| 311 | self = (MidgardKeyConfigFileContext*) base; |
| 312 | result = (_tmp1_ = midgard_key_config_file_context_set_cfgs (self, midgard_key_config_context_get_context_path ((MidgardKeyConfigContext*) self), 0, &_tmp0_), *result_length1 = _tmp0_, _tmp1_); |
| 313 | return result; |
| 314 | } |
| 315 | |
| 316 | |
| 317 | static void midgard_key_config_file_context_class_init (MidgardKeyConfigFileContextClass * klass) { |
| 318 | midgard_key_config_file_context_parent_class = g_type_class_peek_parent (klass); |
| 319 | MIDGARD_KEY_CONFIG_CONTEXT_CLASS (klass)((((MidgardKeyConfigContextClass*) g_type_check_class_cast (( GTypeClass*) ((klass)), ((midgard_key_config_context_get_type ()))))))->list_key_config = midgard_key_config_file_context_real_list_key_config; |
| 320 | } |
| 321 | |
| 322 | |
| 323 | static void midgard_key_config_file_context_instance_init (MidgardKeyConfigFileContext * self) { |
| 324 | } |
| 325 | |
| 326 | |
| 327 | GType midgard_key_config_file_context_get_type (void) { |
| 328 | static volatile gsize midgard_key_config_file_context_type_id__volatile = 0; |
| 329 | if (g_once_init_enter (&midgard_key_config_file_context_type_id__volatile)) { |
| 330 | static const GTypeInfo g_define_type_info = { sizeof (MidgardKeyConfigFileContextClass), (GBaseInitFunc) NULL((void*)0), (GBaseFinalizeFunc) NULL((void*)0), (GClassInitFunc) midgard_key_config_file_context_class_init, (GClassFinalizeFunc) NULL((void*)0), NULL((void*)0), sizeof (MidgardKeyConfigFileContext), 0, (GInstanceInitFunc) midgard_key_config_file_context_instance_init, NULL((void*)0) }; |
| 331 | GType midgard_key_config_file_context_type_id; |
| 332 | midgard_key_config_file_context_type_id = g_type_register_static (MIDGARD_TYPE_KEY_CONFIG_CONTEXT(midgard_key_config_context_get_type ()), "MidgardKeyConfigFileContext", &g_define_type_info, 0); |
| 333 | g_once_init_leave (&midgard_key_config_file_context_type_id__volatile, midgard_key_config_file_context_type_id); |
| 334 | } |
| 335 | return midgard_key_config_file_context_type_id__volatile; |
| 336 | } |
| 337 | |
| 338 | |
| 339 | static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { |
| 340 | if ((array != NULL((void*)0)) && (destroy_func != NULL((void*)0))) { |
| 341 | int i; |
| 342 | for (i = 0; i < array_length; i = i + 1) { |
| 343 | if (((gpointer*) array)[i] != NULL((void*)0)) { |
| 344 | destroy_func (((gpointer*) array)[i]); |
| 345 | } |
| 346 | } |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | |
| 351 | static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { |
| 352 | _vala_array_destroy (array, array_length, destroy_func); |
| 353 | g_free (array); |
| 354 | } |
| 355 | |
| 356 | |
| 357 | |
| 358 |