File: dconf-dump.c

package info (click to toggle)
d-conf 0.12.1-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,948 kB
  • sloc: ansic: 18,683; sh: 1,074; makefile: 201; xml: 44
file content (883 lines) | stat: -rw-r--r-- 26,663 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
/* dconf-dump.c generated by valac 0.16.0, the Vala compiler
 * generated from dconf-dump.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <dconf.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <gobject/gvaluecollector.h>

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_key_file_free0(var) ((var == NULL) ? NULL : (var = (g_key_file_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

#define TYPE_DCONF_LOAD_STATE (dconf_load_state_get_type ())
#define DCONF_LOAD_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DCONF_LOAD_STATE, DConfLoadState))
#define DCONF_LOAD_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DCONF_LOAD_STATE, DConfLoadStateClass))
#define IS_DCONF_LOAD_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DCONF_LOAD_STATE))
#define IS_DCONF_LOAD_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DCONF_LOAD_STATE))
#define DCONF_LOAD_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DCONF_LOAD_STATE, DConfLoadStateClass))

typedef struct _DConfLoadState DConfLoadState;
typedef struct _DConfLoadStateClass DConfLoadStateClass;
typedef struct _DConfLoadStatePrivate DConfLoadStatePrivate;
typedef struct _ParamSpecDConfLoadState ParamSpecDConfLoadState;
#define _g_tree_destroy0(var) ((var == NULL) ? NULL : (var = (g_tree_destroy (var), NULL)))
#define _dconf_load_state_unref0(var) ((var == NULL) ? NULL : (var = (dconf_load_state_unref (var), NULL)))

struct _DConfLoadState {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DConfLoadStatePrivate * priv;
	gchar** keys;
	gint keys_length1;
	gint _keys_size_;
	GVariant** vals;
	gint vals_length1;
	gint _vals_size_;
};

struct _DConfLoadStateClass {
	GTypeClass parent_class;
	void (*finalize) (DConfLoadState *self);
};

struct _DConfLoadStatePrivate {
	gint n_keys;
	gint i;
};

struct _ParamSpecDConfLoadState {
	GParamSpec parent_instance;
};


static gpointer dconf_load_state_parent_class = NULL;

void add_to_keyfile (GKeyFile* kf, DConfClient* client, const gchar* topdir, const gchar* rel);
void dconf_dump (gchar** args, int args_length1, GError** error);
GKeyFile* keyfile_from_stdin (GError** error);
gpointer dconf_load_state_ref (gpointer instance);
void dconf_load_state_unref (gpointer instance);
GParamSpec* param_spec_dconf_load_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_dconf_load_state (GValue* value, gpointer v_object);
void value_take_dconf_load_state (GValue* value, gpointer v_object);
gpointer value_get_dconf_load_state (const GValue* value);
GType dconf_load_state_get_type (void) G_GNUC_CONST;
#define DCONF_LOAD_STATE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DCONF_LOAD_STATE, DConfLoadStatePrivate))
enum  {
	DCONF_LOAD_STATE_DUMMY_PROPERTY
};
DConfLoadState* dconf_load_state_new (gint n);
DConfLoadState* dconf_load_state_construct (GType object_type, gint n);
gint dconf_load_state_add (DConfLoadState* self, void* key, void* value);
static void dconf_load_state_finalize (DConfLoadState* obj);
void dconf_load (gchar** args, int args_length1, GError** error);
static gint _dconf_load_state_add_gtraverse_func (void* key, void* value, gpointer self);
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 gchar* string_slice (const gchar* self, glong start, glong end) {
	gchar* result = NULL;
	gint _tmp0_;
	gint _tmp1_;
	glong string_length;
	glong _tmp2_;
	glong _tmp5_;
	gboolean _tmp8_ = FALSE;
	glong _tmp9_;
	gboolean _tmp12_;
	gboolean _tmp13_ = FALSE;
	glong _tmp14_;
	gboolean _tmp17_;
	glong _tmp18_;
	glong _tmp19_;
	glong _tmp20_;
	glong _tmp21_;
	glong _tmp22_;
	gchar* _tmp23_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	_tmp2_ = start;
	if (_tmp2_ < ((glong) 0)) {
		glong _tmp3_;
		glong _tmp4_;
		_tmp3_ = string_length;
		_tmp4_ = start;
		start = _tmp3_ + _tmp4_;
	}
	_tmp5_ = end;
	if (_tmp5_ < ((glong) 0)) {
		glong _tmp6_;
		glong _tmp7_;
		_tmp6_ = string_length;
		_tmp7_ = end;
		end = _tmp6_ + _tmp7_;
	}
	_tmp9_ = start;
	if (_tmp9_ >= ((glong) 0)) {
		glong _tmp10_;
		glong _tmp11_;
		_tmp10_ = start;
		_tmp11_ = string_length;
		_tmp8_ = _tmp10_ <= _tmp11_;
	} else {
		_tmp8_ = FALSE;
	}
	_tmp12_ = _tmp8_;
	g_return_val_if_fail (_tmp12_, NULL);
	_tmp14_ = end;
	if (_tmp14_ >= ((glong) 0)) {
		glong _tmp15_;
		glong _tmp16_;
		_tmp15_ = end;
		_tmp16_ = string_length;
		_tmp13_ = _tmp15_ <= _tmp16_;
	} else {
		_tmp13_ = FALSE;
	}
	_tmp17_ = _tmp13_;
	g_return_val_if_fail (_tmp17_, NULL);
	_tmp18_ = start;
	_tmp19_ = end;
	g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL);
	_tmp20_ = start;
	_tmp21_ = end;
	_tmp22_ = start;
	_tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_));
	result = _tmp23_;
	return result;
}


void add_to_keyfile (GKeyFile* kf, DConfClient* client, const gchar* topdir, const gchar* rel) {
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* this_dir;
	gchar* this_group = NULL;
	const gchar* _tmp3_;
	DConfClient* _tmp7_;
	const gchar* _tmp8_;
	gint _tmp9_ = 0;
	gchar** _tmp10_ = NULL;
	g_return_if_fail (kf != NULL);
	g_return_if_fail (client != NULL);
	g_return_if_fail (topdir != NULL);
	_tmp0_ = topdir;
	_tmp1_ = rel;
	_tmp2_ = g_strconcat (_tmp0_, _tmp1_, NULL);
	this_dir = _tmp2_;
	_tmp3_ = rel;
	if (g_strcmp0 (_tmp3_, "") != 0) {
		const gchar* _tmp4_;
		gchar* _tmp5_ = NULL;
		_tmp4_ = rel;
		_tmp5_ = string_slice (_tmp4_, (glong) 0, (glong) (-1));
		_g_free0 (this_group);
		this_group = _tmp5_;
	} else {
		gchar* _tmp6_;
		_tmp6_ = g_strdup ("/");
		_g_free0 (this_group);
		this_group = _tmp6_;
	}
	_tmp7_ = client;
	_tmp8_ = this_dir;
	_tmp10_ = dconf_client_list (_tmp7_, _tmp8_, &_tmp9_);
	{
		gchar** item_collection = NULL;
		gint item_collection_length1 = 0;
		gint _item_collection_size_ = 0;
		gint item_it = 0;
		item_collection = _tmp10_;
		item_collection_length1 = _tmp9_;
		for (item_it = 0; item_it < _tmp9_; item_it = item_it + 1) {
			gchar* _tmp11_;
			gchar* item = NULL;
			_tmp11_ = g_strdup (item_collection[item_it]);
			item = _tmp11_;
			{
				const gchar* _tmp12_;
				gboolean _tmp13_ = FALSE;
				_tmp12_ = item;
				_tmp13_ = g_str_has_suffix (_tmp12_, "/");
				if (_tmp13_) {
					GKeyFile* _tmp14_;
					DConfClient* _tmp15_;
					const gchar* _tmp16_;
					const gchar* _tmp17_;
					const gchar* _tmp18_;
					gchar* _tmp19_;
					gchar* _tmp20_;
					_tmp14_ = kf;
					_tmp15_ = client;
					_tmp16_ = topdir;
					_tmp17_ = rel;
					_tmp18_ = item;
					_tmp19_ = g_strconcat (_tmp17_, _tmp18_, NULL);
					_tmp20_ = _tmp19_;
					add_to_keyfile (_tmp14_, _tmp15_, _tmp16_, _tmp20_);
					_g_free0 (_tmp20_);
				} else {
					DConfClient* _tmp21_;
					const gchar* _tmp22_;
					const gchar* _tmp23_;
					gchar* _tmp24_;
					gchar* _tmp25_;
					GVariant* _tmp26_ = NULL;
					GVariant* _tmp27_;
					GVariant* val;
					GVariant* _tmp28_;
					_tmp21_ = client;
					_tmp22_ = this_dir;
					_tmp23_ = item;
					_tmp24_ = g_strconcat (_tmp22_, _tmp23_, NULL);
					_tmp25_ = _tmp24_;
					_tmp26_ = dconf_client_read (_tmp21_, _tmp25_);
					_tmp27_ = _tmp26_;
					_g_free0 (_tmp25_);
					val = _tmp27_;
					_tmp28_ = val;
					if (_tmp28_ != NULL) {
						GKeyFile* _tmp29_;
						const gchar* _tmp30_;
						const gchar* _tmp31_;
						GVariant* _tmp32_;
						gchar* _tmp33_ = NULL;
						gchar* _tmp34_;
						_tmp29_ = kf;
						_tmp30_ = this_group;
						_tmp31_ = item;
						_tmp32_ = val;
						_tmp33_ = g_variant_print (_tmp32_, TRUE);
						_tmp34_ = _tmp33_;
						g_key_file_set_value (_tmp29_, _tmp30_, _tmp31_, _tmp34_);
						_g_free0 (_tmp34_);
					}
					_g_variant_unref0 (val);
				}
				_g_free0 (item);
			}
		}
		item_collection = (_vala_array_free (item_collection, item_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_g_free0 (this_group);
	_g_free0 (this_dir);
}


void dconf_dump (gchar** args, int args_length1, GError** error) {
	DConfClient* _tmp0_;
	DConfClient* client;
	GKeyFile* _tmp1_;
	GKeyFile* kf;
	gchar** _tmp2_;
	gint _tmp2__length1;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* dir;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_;
	GError * _inner_error_ = NULL;
	_tmp0_ = dconf_client_new (NULL, NULL, NULL, NULL);
	client = _tmp0_;
	_tmp1_ = g_key_file_new ();
	kf = _tmp1_;
	_tmp2_ = args;
	_tmp2__length1 = args_length1;
	_tmp3_ = _tmp2_[2];
	_tmp4_ = g_strdup (_tmp3_);
	dir = _tmp4_;
	dconf_is_dir (dir, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_free0 (dir);
		_g_key_file_free0 (kf);
		_g_object_unref0 (client);
		return;
	}
	add_to_keyfile (kf, client, dir, "");
	_tmp5_ = g_key_file_to_data (kf, NULL, NULL);
	_tmp6_ = _tmp5_;
	g_print ("%s", _tmp6_);
	_g_free0 (_tmp6_);
	_g_free0 (dir);
	_g_key_file_free0 (kf);
	_g_object_unref0 (client);
}


GKeyFile* keyfile_from_stdin (GError** error) {
	GKeyFile* result = NULL;
	const gchar* tmp = NULL;
	gchar buffer[1024] = {0};
	GString* _tmp0_;
	GString* s;
	GKeyFile* _tmp6_;
	GKeyFile* kf;
	GString* _tmp7_;
	const gchar* _tmp8_;
	GString* _tmp9_;
	gssize _tmp10_;
	GError * _inner_error_ = NULL;
	_tmp0_ = g_string_new ("");
	s = _tmp0_;
	while (TRUE) {
		FILE* _tmp1_;
		const gchar* _tmp2_ = NULL;
		const gchar* _tmp3_;
		GString* _tmp4_;
		const gchar* _tmp5_;
		_tmp1_ = stdin;
		_tmp2_ = fgets (buffer, 1024, _tmp1_);
		tmp = _tmp2_;
		_tmp3_ = tmp;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = s;
		_tmp5_ = tmp;
		g_string_append (_tmp4_, _tmp5_);
	}
	_tmp6_ = g_key_file_new ();
	kf = _tmp6_;
	_tmp7_ = s;
	_tmp8_ = _tmp7_->str;
	_tmp9_ = s;
	_tmp10_ = _tmp9_->len;
	g_key_file_load_from_data (kf, _tmp8_, (gsize) _tmp10_, 0, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_key_file_free0 (kf);
		_g_string_free0 (s);
		return NULL;
	}
	result = kf;
	_g_string_free0 (s);
	return result;
}


DConfLoadState* dconf_load_state_construct (GType object_type, gint n) {
	DConfLoadState* self = NULL;
	gint _tmp0_;
	gchar** _tmp1_ = NULL;
	gint _tmp2_;
	GVariant** _tmp3_ = NULL;
	gint _tmp4_;
	self = (DConfLoadState*) g_type_create_instance (object_type);
	_tmp0_ = n;
	_tmp1_ = g_new0 (gchar*, (_tmp0_ + 1) + 1);
	self->keys = (_vala_array_free (self->keys, self->keys_length1, (GDestroyNotify) g_free), NULL);
	self->keys = _tmp1_;
	self->keys_length1 = _tmp0_ + 1;
	self->_keys_size_ = self->keys_length1;
	_tmp2_ = n;
	_tmp3_ = g_new0 (GVariant*, _tmp2_ + 1);
	self->vals = (_vala_array_free (self->vals, self->vals_length1, (GDestroyNotify) g_variant_unref), NULL);
	self->vals = _tmp3_;
	self->vals_length1 = _tmp2_;
	self->_vals_size_ = self->vals_length1;
	_tmp4_ = n;
	self->priv->n_keys = _tmp4_;
	self->priv->i = 0;
	return self;
}


DConfLoadState* dconf_load_state_new (gint n) {
	return dconf_load_state_construct (TYPE_DCONF_LOAD_STATE, n);
}


static gpointer _g_variant_ref0 (gpointer self) {
	return self ? g_variant_ref (self) : NULL;
}


gint dconf_load_state_add (DConfLoadState* self, void* key, void* value) {
	gint result = 0;
	gint _tmp0_;
	gint _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gint _tmp3_;
	void* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GVariant** _tmp7_;
	gint _tmp7__length1;
	gint _tmp8_;
	void* _tmp9_;
	GVariant* _tmp10_;
	GVariant* _tmp11_;
	gint _tmp12_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->i;
	_tmp1_ = self->priv->n_keys;
	g_assert (_tmp0_ < _tmp1_);
	_tmp2_ = self->keys;
	_tmp2__length1 = self->keys_length1;
	_tmp3_ = self->priv->i;
	_tmp4_ = key;
	_tmp5_ = g_strdup ((const gchar*) _tmp4_);
	_g_free0 (_tmp2_[_tmp3_]);
	_tmp2_[_tmp3_] = _tmp5_;
	_tmp6_ = _tmp2_[_tmp3_];
	_tmp7_ = self->vals;
	_tmp7__length1 = self->vals_length1;
	_tmp8_ = self->priv->i;
	_tmp9_ = value;
	_tmp10_ = _g_variant_ref0 ((GVariant*) _tmp9_);
	_g_variant_unref0 (_tmp7_[_tmp8_]);
	_tmp7_[_tmp8_] = _tmp10_;
	_tmp11_ = _tmp7_[_tmp8_];
	_tmp12_ = self->priv->i;
	self->priv->i = _tmp12_ + 1;
	result = (gint) FALSE;
	return result;
}


static void value_dconf_load_state_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void value_dconf_load_state_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		dconf_load_state_unref (value->data[0].v_pointer);
	}
}


static void value_dconf_load_state_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = dconf_load_state_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer value_dconf_load_state_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* value_dconf_load_state_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		DConfLoadState* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = dconf_load_state_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* value_dconf_load_state_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	DConfLoadState** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = dconf_load_state_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* param_spec_dconf_load_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecDConfLoadState* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_DCONF_LOAD_STATE), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer value_get_dconf_load_state (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DCONF_LOAD_STATE), NULL);
	return value->data[0].v_pointer;
}


void value_set_dconf_load_state (GValue* value, gpointer v_object) {
	DConfLoadState* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DCONF_LOAD_STATE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_DCONF_LOAD_STATE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		dconf_load_state_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dconf_load_state_unref (old);
	}
}


void value_take_dconf_load_state (GValue* value, gpointer v_object) {
	DConfLoadState* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DCONF_LOAD_STATE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_DCONF_LOAD_STATE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dconf_load_state_unref (old);
	}
}


static void dconf_load_state_class_init (DConfLoadStateClass * klass) {
	dconf_load_state_parent_class = g_type_class_peek_parent (klass);
	DCONF_LOAD_STATE_CLASS (klass)->finalize = dconf_load_state_finalize;
	g_type_class_add_private (klass, sizeof (DConfLoadStatePrivate));
}


static void dconf_load_state_instance_init (DConfLoadState * self) {
	self->priv = DCONF_LOAD_STATE_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void dconf_load_state_finalize (DConfLoadState* obj) {
	DConfLoadState * self;
	self = DCONF_LOAD_STATE (obj);
	self->keys = (_vala_array_free (self->keys, self->keys_length1, (GDestroyNotify) g_free), NULL);
	self->vals = (_vala_array_free (self->vals, self->vals_length1, (GDestroyNotify) g_variant_unref), NULL);
}


GType dconf_load_state_get_type (void) {
	static volatile gsize dconf_load_state_type_id__volatile = 0;
	if (g_once_init_enter (&dconf_load_state_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_dconf_load_state_init, value_dconf_load_state_free_value, value_dconf_load_state_copy_value, value_dconf_load_state_peek_pointer, "p", value_dconf_load_state_collect_value, "p", value_dconf_load_state_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (DConfLoadStateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dconf_load_state_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DConfLoadState), 0, (GInstanceInitFunc) dconf_load_state_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType dconf_load_state_type_id;
		dconf_load_state_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DConfLoadState", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&dconf_load_state_type_id__volatile, dconf_load_state_type_id);
	}
	return dconf_load_state_type_id__volatile;
}


gpointer dconf_load_state_ref (gpointer instance) {
	DConfLoadState* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void dconf_load_state_unref (gpointer instance) {
	DConfLoadState* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		DCONF_LOAD_STATE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static gint _dconf_load_state_add_gtraverse_func (void* key, void* value, gpointer self) {
	gint result;
	result = dconf_load_state_add (self, key, value);
	return result;
}


void dconf_load (gchar** args, int args_length1, GError** error) {
	gchar** _tmp0_;
	gint _tmp0__length1;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* dir;
	const gchar* _tmp3_;
	GCompareFunc _tmp4_;
	GTree* _tmp5_;
	GTree* tree;
	GKeyFile* _tmp6_ = NULL;
	GKeyFile* kf;
	GKeyFile* _tmp7_;
	gsize _tmp8_;
	gchar** _tmp9_ = NULL;
	GTree* _tmp38_;
	gint _tmp39_ = 0;
	DConfLoadState* _tmp40_;
	DConfLoadState* list;
	GTree* _tmp41_;
	DConfLoadState* _tmp42_;
	DConfClient* _tmp43_;
	DConfClient* client;
	DConfClient* _tmp44_;
	const gchar* _tmp45_;
	DConfLoadState* _tmp46_;
	gchar** _tmp47_;
	gint _tmp47__length1;
	DConfLoadState* _tmp48_;
	GVariant** _tmp49_;
	gint _tmp49__length1;
	GError * _inner_error_ = NULL;
	_tmp0_ = args;
	_tmp0__length1 = args_length1;
	_tmp1_ = _tmp0_[2];
	_tmp2_ = g_strdup (_tmp1_);
	dir = _tmp2_;
	_tmp3_ = dir;
	dconf_is_dir (_tmp3_, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_free0 (dir);
		return;
	}
	_tmp4_ = g_strcmp0;
	_tmp5_ = g_tree_new (_tmp4_);
	tree = _tmp5_;
	_tmp6_ = keyfile_from_stdin (&_inner_error_);
	kf = _tmp6_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_tree_destroy0 (tree);
		_g_free0 (dir);
		return;
	}
	_tmp7_ = kf;
	_tmp9_ = g_key_file_get_groups (_tmp7_, &_tmp8_);
	{
		gchar** group_collection = NULL;
		gint group_collection_length1 = 0;
		gint _group_collection_size_ = 0;
		gint group_it = 0;
		group_collection = _tmp9_;
		group_collection_length1 = _tmp8_;
		for (group_it = 0; group_it < _tmp8_; group_it = group_it + 1) {
			gchar* _tmp10_;
			gchar* group = NULL;
			_tmp10_ = g_strdup (group_collection[group_it]);
			group = _tmp10_;
			{
				GKeyFile* _tmp11_;
				const gchar* _tmp12_;
				gsize _tmp13_;
				gchar** _tmp14_ = NULL;
				gchar** _tmp15_;
				gint _tmp15__length1;
				gint __tmp15__size_;
				_tmp11_ = kf;
				_tmp12_ = group;
				_tmp14_ = g_key_file_get_keys (_tmp11_, _tmp12_, &_tmp13_, &_inner_error_);
				_tmp15_ = _tmp14_;
				_tmp15__length1 = _tmp13_;
				__tmp15__size_ = _tmp15__length1;
				if (_inner_error_ != NULL) {
					g_propagate_error (error, _inner_error_);
					_g_free0 (group);
					group_collection = (_vala_array_free (group_collection, group_collection_length1, (GDestroyNotify) g_free), NULL);
					_g_key_file_free0 (kf);
					_g_tree_destroy0 (tree);
					_g_free0 (dir);
					return;
				}
				{
					gchar** key_collection = NULL;
					gint key_collection_length1 = 0;
					gint _key_collection_size_ = 0;
					gint key_it = 0;
					key_collection = _tmp15_;
					key_collection_length1 = _tmp15__length1;
					for (key_it = 0; key_it < _tmp15__length1; key_it = key_it + 1) {
						gchar* _tmp16_;
						gchar* key = NULL;
						_tmp16_ = g_strdup (key_collection[key_it]);
						key = _tmp16_;
						{
							gchar* _tmp17_ = NULL;
							const gchar* _tmp18_;
							const gchar* _tmp22_;
							const gchar* _tmp23_;
							gchar* _tmp24_;
							gchar* rel;
							const gchar* _tmp25_;
							GKeyFile* _tmp26_;
							const gchar* _tmp27_;
							const gchar* _tmp28_;
							gchar* _tmp29_ = NULL;
							gchar* _tmp30_;
							gchar* _tmp31_;
							GVariant* _tmp32_ = NULL;
							GVariant* _tmp33_;
							GVariant* _tmp34_;
							GTree* _tmp35_;
							const gchar* _tmp36_;
							gchar* _tmp37_;
							_tmp18_ = group;
							if (g_strcmp0 (_tmp18_, "/") == 0) {
								gchar* _tmp19_;
								_tmp19_ = g_strdup ("");
								_g_free0 (_tmp17_);
								_tmp17_ = _tmp19_;
							} else {
								const gchar* _tmp20_;
								gchar* _tmp21_;
								_tmp20_ = group;
								_tmp21_ = g_strconcat (_tmp20_, "/", NULL);
								_g_free0 (_tmp17_);
								_tmp17_ = _tmp21_;
							}
							_tmp22_ = _tmp17_;
							_tmp23_ = key;
							_tmp24_ = g_strconcat (_tmp22_, _tmp23_, NULL);
							rel = _tmp24_;
							_tmp25_ = rel;
							dconf_is_rel_key (_tmp25_, &_inner_error_);
							if (_inner_error_ != NULL) {
								g_propagate_error (error, _inner_error_);
								_g_free0 (rel);
								_g_free0 (_tmp17_);
								_g_free0 (key);
								key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
								_g_free0 (group);
								group_collection = (_vala_array_free (group_collection, group_collection_length1, (GDestroyNotify) g_free), NULL);
								_g_key_file_free0 (kf);
								_g_tree_destroy0 (tree);
								_g_free0 (dir);
								return;
							}
							_tmp26_ = kf;
							_tmp27_ = group;
							_tmp28_ = key;
							_tmp29_ = g_key_file_get_value (_tmp26_, _tmp27_, _tmp28_, &_inner_error_);
							_tmp30_ = _tmp29_;
							if (_inner_error_ != NULL) {
								g_propagate_error (error, _inner_error_);
								_g_free0 (rel);
								_g_free0 (_tmp17_);
								_g_free0 (key);
								key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
								_g_free0 (group);
								group_collection = (_vala_array_free (group_collection, group_collection_length1, (GDestroyNotify) g_free), NULL);
								_g_key_file_free0 (kf);
								_g_tree_destroy0 (tree);
								_g_free0 (dir);
								return;
							}
							_tmp31_ = _tmp30_;
							_tmp32_ = g_variant_parse (NULL, _tmp31_, NULL, NULL, &_inner_error_);
							_tmp33_ = _tmp32_;
							_g_free0 (_tmp31_);
							_tmp34_ = _tmp33_;
							if (_inner_error_ != NULL) {
								g_propagate_error (error, _inner_error_);
								_g_free0 (rel);
								_g_free0 (_tmp17_);
								_g_free0 (key);
								key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
								_g_free0 (group);
								group_collection = (_vala_array_free (group_collection, group_collection_length1, (GDestroyNotify) g_free), NULL);
								_g_key_file_free0 (kf);
								_g_tree_destroy0 (tree);
								_g_free0 (dir);
								return;
							}
							_tmp35_ = tree;
							_tmp36_ = rel;
							_tmp37_ = g_strdup (_tmp36_);
							g_tree_insert (_tmp35_, _tmp37_, _tmp34_);
							_g_free0 (rel);
							_g_free0 (_tmp17_);
							_g_free0 (key);
						}
					}
					key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
				}
				_g_free0 (group);
			}
		}
		group_collection = (_vala_array_free (group_collection, group_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp38_ = tree;
	_tmp39_ = g_tree_nnodes (_tmp38_);
	_tmp40_ = dconf_load_state_new (_tmp39_);
	list = _tmp40_;
	_tmp41_ = tree;
	_tmp42_ = list;
	g_tree_foreach (_tmp41_, _dconf_load_state_add_gtraverse_func, _tmp42_);
	_tmp43_ = dconf_client_new (NULL, NULL, NULL, NULL);
	client = _tmp43_;
	_tmp44_ = client;
	_tmp45_ = dir;
	_tmp46_ = list;
	_tmp47_ = _tmp46_->keys;
	_tmp47__length1 = _tmp46_->keys_length1;
	_tmp48_ = list;
	_tmp49_ = _tmp48_->vals;
	_tmp49__length1 = _tmp48_->vals_length1;
	dconf_client_write_many (_tmp44_, _tmp45_, _tmp47_, _tmp49_, _tmp49__length1, NULL, NULL, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (client);
		_dconf_load_state_unref0 (list);
		_g_key_file_free0 (kf);
		_g_tree_destroy0 (tree);
		_g_free0 (dir);
		return;
	}
	_g_object_unref0 (client);
	_dconf_load_state_unref0 (list);
	_g_key_file_free0 (kf);
	_g_tree_destroy0 (tree);
	_g_free0 (dir);
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}