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
|
/* VersionTable.c generated by valac 0.32.1, the Vala compiler
* generated from VersionTable.vala, do not modify */
/* Copyright 2016 Software Freedom Conservancy Inc.
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <sqlite3.h>
#define TYPE_DATABASE_TABLE (database_table_get_type ())
#define DATABASE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE_TABLE, DatabaseTable))
#define DATABASE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE_TABLE, DatabaseTableClass))
#define IS_DATABASE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE_TABLE))
#define IS_DATABASE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE_TABLE))
#define DATABASE_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE_TABLE, DatabaseTableClass))
typedef struct _DatabaseTable DatabaseTable;
typedef struct _DatabaseTableClass DatabaseTableClass;
typedef struct _DatabaseTablePrivate DatabaseTablePrivate;
#define TYPE_VERSION_TABLE (version_table_get_type ())
#define VERSION_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VERSION_TABLE, VersionTable))
#define VERSION_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VERSION_TABLE, VersionTableClass))
#define IS_VERSION_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VERSION_TABLE))
#define IS_VERSION_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VERSION_TABLE))
#define VERSION_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VERSION_TABLE, VersionTableClass))
typedef struct _VersionTable VersionTable;
typedef struct _VersionTableClass VersionTableClass;
typedef struct _VersionTablePrivate VersionTablePrivate;
#define _sqlite3_finalize0(var) ((var == NULL) ? NULL : (var = (sqlite3_finalize (var), NULL)))
#define _database_table_unref0(var) ((var == NULL) ? NULL : (var = (database_table_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
struct _DatabaseTable {
GTypeInstance parent_instance;
volatile int ref_count;
DatabaseTablePrivate * priv;
gchar* table_name;
};
struct _DatabaseTableClass {
GTypeClass parent_class;
void (*finalize) (DatabaseTable *self);
};
struct _VersionTable {
DatabaseTable parent_instance;
VersionTablePrivate * priv;
};
struct _VersionTableClass {
DatabaseTableClass parent_class;
};
static gpointer version_table_parent_class = NULL;
static VersionTable* version_table_instance;
static VersionTable* version_table_instance = NULL;
extern sqlite3* database_table_db;
gpointer database_table_ref (gpointer instance);
void database_table_unref (gpointer instance);
GParamSpec* param_spec_database_table (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_database_table (GValue* value, gpointer v_object);
void value_take_database_table (GValue* value, gpointer v_object);
gpointer value_get_database_table (const GValue* value);
GType database_table_get_type (void) G_GNUC_CONST;
GType version_table_get_type (void) G_GNUC_CONST;
enum {
VERSION_TABLE_DUMMY_PROPERTY
};
static VersionTable* version_table_new (void);
static VersionTable* version_table_construct (GType object_type);
DatabaseTable* database_table_construct (GType object_type);
void database_table_fatal (const gchar* op, gint res);
void database_table_set_table_name (DatabaseTable* self, const gchar* table_name);
VersionTable* version_table_get_instance (void);
gint version_table_get_version (VersionTable* self, gchar** app_version);
void version_table_set_version (VersionTable* self, gint version, const gchar* app_version, const gchar* user_data);
void version_table_update_version (VersionTable* self, gint version, const gchar* app_version);
static void version_table_finalize (DatabaseTable* obj);
static VersionTable* version_table_construct (GType object_type) {
VersionTable* self = NULL;
sqlite3_stmt* stmt = NULL;
gint res = 0;
sqlite3* _tmp0_ = NULL;
sqlite3_stmt* _tmp1_ = NULL;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
sqlite3_stmt* _tmp4_ = NULL;
gint _tmp5_ = 0;
gint _tmp6_ = 0;
#line 10 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
self = (VersionTable*) database_table_construct (object_type);
#line 12 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp0_ = database_table_db;
#line 12 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp2_ = sqlite3_prepare_v2 (_tmp0_, "CREATE TABLE IF NOT EXISTS VersionTable (" "id INTEGER PRIMARY KEY, " "schema_version INTEGER, " "app_version TEXT, " "user_data TEXT NULL" ")", -1, &_tmp1_, NULL);
#line 12 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_sqlite3_finalize0 (stmt);
#line 12 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
stmt = _tmp1_;
#line 12 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp2_;
#line 18 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp3_ = res;
#line 18 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_assert (_tmp3_ == SQLITE_OK, "res == Sqlite.OK");
#line 20 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp4_ = stmt;
#line 20 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp5_ = sqlite3_step (_tmp4_);
#line 20 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp5_;
#line 21 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp6_ = res;
#line 21 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
if (_tmp6_ != SQLITE_DONE) {
#line 134 "VersionTable.c"
gint _tmp7_ = 0;
#line 22 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp7_ = res;
#line 22 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
database_table_fatal ("create version table", _tmp7_);
#line 140 "VersionTable.c"
}
#line 24 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
database_table_set_table_name (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATABASE_TABLE, DatabaseTable), "VersionTable");
#line 10 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_sqlite3_finalize0 (stmt);
#line 10 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
return self;
#line 148 "VersionTable.c"
}
static VersionTable* version_table_new (void) {
#line 10 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
return version_table_construct (TYPE_VERSION_TABLE);
#line 155 "VersionTable.c"
}
static gpointer _database_table_ref0 (gpointer self) {
#line 31 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
return self ? database_table_ref (self) : NULL;
#line 162 "VersionTable.c"
}
VersionTable* version_table_get_instance (void) {
VersionTable* result = NULL;
VersionTable* _tmp0_ = NULL;
VersionTable* _tmp2_ = NULL;
VersionTable* _tmp3_ = NULL;
#line 28 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp0_ = version_table_instance;
#line 28 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
if (_tmp0_ == NULL) {
#line 175 "VersionTable.c"
VersionTable* _tmp1_ = NULL;
#line 29 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp1_ = version_table_new ();
#line 29 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_database_table_unref0 (version_table_instance);
#line 29 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
version_table_instance = _tmp1_;
#line 183 "VersionTable.c"
}
#line 31 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp2_ = version_table_instance;
#line 31 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp3_ = _database_table_ref0 (_tmp2_);
#line 31 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
result = _tmp3_;
#line 31 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
return result;
#line 193 "VersionTable.c"
}
gint version_table_get_version (VersionTable* self, gchar** app_version) {
gchar* _vala_app_version = NULL;
gint result = 0;
sqlite3_stmt* stmt = NULL;
gint res = 0;
sqlite3* _tmp0_ = NULL;
sqlite3_stmt* _tmp1_ = NULL;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
sqlite3_stmt* _tmp4_ = NULL;
gint _tmp5_ = 0;
gint _tmp6_ = 0;
sqlite3_stmt* _tmp9_ = NULL;
const gchar* _tmp10_ = NULL;
gchar* _tmp11_ = NULL;
sqlite3_stmt* _tmp12_ = NULL;
gint _tmp13_ = 0;
#line 34 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
g_return_val_if_fail (IS_VERSION_TABLE (self), 0);
#line 36 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp0_ = database_table_db;
#line 36 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp2_ = sqlite3_prepare_v2 (_tmp0_, "SELECT schema_version, app_version FROM VersionTable ORDER BY schema_v" \
"ersion DESC LIMIT 1", -1, &_tmp1_, NULL);
#line 36 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_sqlite3_finalize0 (stmt);
#line 36 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
stmt = _tmp1_;
#line 36 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp2_;
#line 38 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp3_ = res;
#line 38 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_assert (_tmp3_ == SQLITE_OK, "res == Sqlite.OK");
#line 40 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp4_ = stmt;
#line 40 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp5_ = sqlite3_step (_tmp4_);
#line 40 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp5_;
#line 41 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp6_ = res;
#line 41 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
if (_tmp6_ != SQLITE_ROW) {
#line 240 "VersionTable.c"
gint _tmp7_ = 0;
#line 42 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp7_ = res;
#line 42 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
if (_tmp7_ != SQLITE_DONE) {
#line 246 "VersionTable.c"
gint _tmp8_ = 0;
#line 43 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp8_ = res;
#line 43 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
database_table_fatal ("get_version", _tmp8_);
#line 252 "VersionTable.c"
}
#line 45 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_g_free0 (_vala_app_version);
#line 45 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_app_version = NULL;
#line 47 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
result = -1;
#line 47 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_sqlite3_finalize0 (stmt);
#line 47 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
if (app_version) {
#line 47 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
*app_version = _vala_app_version;
#line 266 "VersionTable.c"
} else {
#line 47 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_g_free0 (_vala_app_version);
#line 270 "VersionTable.c"
}
#line 47 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
return result;
#line 274 "VersionTable.c"
}
#line 50 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp9_ = stmt;
#line 50 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp10_ = sqlite3_column_text (_tmp9_, 1);
#line 50 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp11_ = g_strdup (_tmp10_);
#line 50 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_g_free0 (_vala_app_version);
#line 50 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_app_version = _tmp11_;
#line 52 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp12_ = stmt;
#line 52 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp13_ = sqlite3_column_int (_tmp12_, 0);
#line 52 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
result = _tmp13_;
#line 52 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_sqlite3_finalize0 (stmt);
#line 52 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
if (app_version) {
#line 52 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
*app_version = _vala_app_version;
#line 298 "VersionTable.c"
} else {
#line 52 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_g_free0 (_vala_app_version);
#line 302 "VersionTable.c"
}
#line 52 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
return result;
#line 306 "VersionTable.c"
}
void version_table_set_version (VersionTable* self, gint version, const gchar* app_version, const gchar* user_data) {
sqlite3_stmt* stmt = NULL;
gchar* bitbucket = NULL;
gchar* _tmp0_ = NULL;
gint _tmp1_ = 0;
gint res = 0;
sqlite3_stmt* _tmp10_ = NULL;
gint _tmp11_ = 0;
gint _tmp12_ = 0;
gint _tmp13_ = 0;
sqlite3_stmt* _tmp14_ = NULL;
const gchar* _tmp15_ = NULL;
gchar* _tmp16_ = NULL;
GDestroyNotify _tmp17_ = NULL;
gint _tmp18_ = 0;
gint _tmp19_ = 0;
sqlite3_stmt* _tmp20_ = NULL;
const gchar* _tmp21_ = NULL;
gchar* _tmp22_ = NULL;
GDestroyNotify _tmp23_ = NULL;
gint _tmp24_ = 0;
gint _tmp25_ = 0;
sqlite3_stmt* _tmp26_ = NULL;
gint _tmp27_ = 0;
gint _tmp28_ = 0;
#line 55 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
g_return_if_fail (IS_VERSION_TABLE (self));
#line 55 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
g_return_if_fail (app_version != NULL);
#line 59 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp1_ = version_table_get_version (self, &_tmp0_);
#line 59 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_g_free0 (bitbucket);
#line 59 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
bitbucket = _tmp0_;
#line 59 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
if (_tmp1_ != -1) {
#line 347 "VersionTable.c"
gint res = 0;
sqlite3* _tmp2_ = NULL;
sqlite3_stmt* _tmp3_ = NULL;
gint _tmp4_ = 0;
gint _tmp5_ = 0;
#line 61 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp2_ = database_table_db;
#line 61 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp4_ = sqlite3_prepare_v2 (_tmp2_, "UPDATE VersionTable SET schema_version=?, app_version=?, user_data=?", -1, &_tmp3_, NULL);
#line 61 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_sqlite3_finalize0 (stmt);
#line 61 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
stmt = _tmp3_;
#line 61 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp4_;
#line 63 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp5_ = res;
#line 63 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_assert (_tmp5_ == SQLITE_OK, "res == Sqlite.OK");
#line 367 "VersionTable.c"
} else {
gint res = 0;
sqlite3* _tmp6_ = NULL;
sqlite3_stmt* _tmp7_ = NULL;
gint _tmp8_ = 0;
gint _tmp9_ = 0;
#line 66 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp6_ = database_table_db;
#line 66 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp8_ = sqlite3_prepare_v2 (_tmp6_, "INSERT INTO VersionTable (schema_version, app_version, user_data) VALU" \
"ES (?,?, ?)", -1, &_tmp7_, NULL);
#line 66 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_sqlite3_finalize0 (stmt);
#line 66 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
stmt = _tmp7_;
#line 66 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp8_;
#line 68 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp9_ = res;
#line 68 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_assert (_tmp9_ == SQLITE_OK, "res == Sqlite.OK");
#line 388 "VersionTable.c"
}
#line 71 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp10_ = stmt;
#line 71 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp11_ = version;
#line 71 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp12_ = sqlite3_bind_int (_tmp10_, 1, _tmp11_);
#line 71 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp12_;
#line 72 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp13_ = res;
#line 72 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_assert (_tmp13_ == SQLITE_OK, "res == Sqlite.OK");
#line 73 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp14_ = stmt;
#line 73 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp15_ = app_version;
#line 73 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp16_ = g_strdup (_tmp15_);
#line 73 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp17_ = g_free;
#line 73 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp18_ = sqlite3_bind_text (_tmp14_, 2, _tmp16_, -1, _tmp17_);
#line 73 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp18_;
#line 74 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp19_ = res;
#line 74 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_assert (_tmp19_ == SQLITE_OK, "res == Sqlite.OK");
#line 75 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp20_ = stmt;
#line 75 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp21_ = user_data;
#line 75 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp22_ = g_strdup (_tmp21_);
#line 75 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp23_ = g_free;
#line 75 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp24_ = sqlite3_bind_text (_tmp20_, 3, _tmp22_, -1, _tmp23_);
#line 75 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp24_;
#line 76 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp25_ = res;
#line 76 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_assert (_tmp25_ == SQLITE_OK, "res == Sqlite.OK");
#line 78 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp26_ = stmt;
#line 78 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp27_ = sqlite3_step (_tmp26_);
#line 78 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp27_;
#line 79 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp28_ = res;
#line 79 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
if (_tmp28_ != SQLITE_DONE) {
#line 444 "VersionTable.c"
gint _tmp29_ = 0;
const gchar* _tmp30_ = NULL;
const gchar* _tmp31_ = NULL;
gchar* _tmp32_ = NULL;
gchar* _tmp33_ = NULL;
gint _tmp34_ = 0;
#line 80 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp29_ = version;
#line 80 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp30_ = app_version;
#line 80 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp31_ = user_data;
#line 80 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp32_ = g_strdup_printf ("set_version %d %s %s", _tmp29_, _tmp30_, _tmp31_);
#line 80 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp33_ = _tmp32_;
#line 80 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp34_ = res;
#line 80 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
database_table_fatal (_tmp33_, _tmp34_);
#line 80 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_g_free0 (_tmp33_);
#line 467 "VersionTable.c"
}
#line 55 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_g_free0 (bitbucket);
#line 55 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_sqlite3_finalize0 (stmt);
#line 473 "VersionTable.c"
}
void version_table_update_version (VersionTable* self, gint version, const gchar* app_version) {
sqlite3_stmt* stmt = NULL;
gint res = 0;
sqlite3* _tmp0_ = NULL;
sqlite3_stmt* _tmp1_ = NULL;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
sqlite3_stmt* _tmp4_ = NULL;
gint _tmp5_ = 0;
gint _tmp6_ = 0;
gint _tmp7_ = 0;
sqlite3_stmt* _tmp8_ = NULL;
const gchar* _tmp9_ = NULL;
gchar* _tmp10_ = NULL;
GDestroyNotify _tmp11_ = NULL;
gint _tmp12_ = 0;
gint _tmp13_ = 0;
sqlite3_stmt* _tmp14_ = NULL;
gint _tmp15_ = 0;
gint _tmp16_ = 0;
#line 83 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
g_return_if_fail (IS_VERSION_TABLE (self));
#line 83 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
g_return_if_fail (app_version != NULL);
#line 85 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp0_ = database_table_db;
#line 85 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp2_ = sqlite3_prepare_v2 (_tmp0_, "UPDATE VersionTable SET schema_version=?, app_version=?", -1, &_tmp1_, NULL);
#line 85 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_sqlite3_finalize0 (stmt);
#line 85 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
stmt = _tmp1_;
#line 85 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp2_;
#line 86 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp3_ = res;
#line 86 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_assert (_tmp3_ == SQLITE_OK, "res == Sqlite.OK");
#line 88 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp4_ = stmt;
#line 88 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp5_ = version;
#line 88 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp6_ = sqlite3_bind_int (_tmp4_, 1, _tmp5_);
#line 88 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp6_;
#line 89 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp7_ = res;
#line 89 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_assert (_tmp7_ == SQLITE_OK, "res == Sqlite.OK");
#line 90 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp8_ = stmt;
#line 90 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp9_ = app_version;
#line 90 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp10_ = g_strdup (_tmp9_);
#line 90 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp11_ = g_free;
#line 90 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp12_ = sqlite3_bind_text (_tmp8_, 2, _tmp10_, -1, _tmp11_);
#line 90 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp12_;
#line 91 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp13_ = res;
#line 91 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_vala_assert (_tmp13_ == SQLITE_OK, "res == Sqlite.OK");
#line 93 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp14_ = stmt;
#line 93 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp15_ = sqlite3_step (_tmp14_);
#line 93 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
res = _tmp15_;
#line 94 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp16_ = res;
#line 94 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
if (_tmp16_ != SQLITE_DONE) {
#line 553 "VersionTable.c"
gint _tmp17_ = 0;
gchar* _tmp18_ = NULL;
gchar* _tmp19_ = NULL;
gint _tmp20_ = 0;
#line 95 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp17_ = version;
#line 95 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp18_ = g_strdup_printf ("update_version %d", _tmp17_);
#line 95 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp19_ = _tmp18_;
#line 95 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_tmp20_ = res;
#line 95 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
database_table_fatal (_tmp19_, _tmp20_);
#line 95 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_g_free0 (_tmp19_);
#line 570 "VersionTable.c"
}
#line 83 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
_sqlite3_finalize0 (stmt);
#line 574 "VersionTable.c"
}
static void version_table_class_init (VersionTableClass * klass) {
#line 7 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
version_table_parent_class = g_type_class_peek_parent (klass);
#line 7 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
((DatabaseTableClass *) klass)->finalize = version_table_finalize;
#line 583 "VersionTable.c"
}
static void version_table_instance_init (VersionTable * self) {
}
static void version_table_finalize (DatabaseTable* obj) {
VersionTable * self;
#line 7 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_VERSION_TABLE, VersionTable);
#line 7 "/home/jens/Source/shotwell/src/db/VersionTable.vala"
DATABASE_TABLE_CLASS (version_table_parent_class)->finalize (obj);
#line 597 "VersionTable.c"
}
GType version_table_get_type (void) {
static volatile gsize version_table_type_id__volatile = 0;
if (g_once_init_enter (&version_table_type_id__volatile)) {
static const GTypeInfo g_define_type_info = { sizeof (VersionTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) version_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (VersionTable), 0, (GInstanceInitFunc) version_table_instance_init, NULL };
GType version_table_type_id;
version_table_type_id = g_type_register_static (TYPE_DATABASE_TABLE, "VersionTable", &g_define_type_info, 0);
g_once_init_leave (&version_table_type_id__volatile, version_table_type_id);
}
return version_table_type_id__volatile;
}
|