summaryrefslogtreecommitdiff
path: root/src/NaturalCollate.c
blob: b5c4fdb373bf039e75b3e0691835156f27030fd4 (plain)
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
/* NaturalCollate.c generated by valac 0.40.4, the Vala compiler
 * generated from NaturalCollate.vala, do not modify */



#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>

#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);



#define NATURAL_COLLATE_SUPERDIGIT ((gunichar) ':')
#define NATURAL_COLLATE_NUM_SENTINEL ((gunichar) 0x2)
#define NATURAL_COLLATE_COLLATION_SENTINEL "\x01\x01\x01"
gint natural_collate_read_number (gchar* s,
                                  gint* byte_index);
gint natural_collate_compare (const gchar* str1,
                              const gchar* str2);
gchar* natural_collate_collate_key (gchar* str);


static gunichar
string_get_char (const gchar* self,
                 glong index)
{
	gunichar result = 0U;
#line 1154 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0U);
#line 1155 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	result = g_utf8_get_char (((gchar*) self) + index);
#line 1155 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	return result;
#line 41 "NaturalCollate.c"
}


static gint
string_index_of_nth_char (const gchar* self,
                          glong c)
{
	gint result = 0;
	gchar* _tmp0_;
#line 1174 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0);
#line 1175 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp0_ = g_utf8_offset_to_pointer (self, c);
#line 1175 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	result = (gint) (_tmp0_ - ((gchar*) self));
#line 1175 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	return result;
#line 59 "NaturalCollate.c"
}


static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	glong result = 0L;
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
#line 1336 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
#line 1336 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	end = _tmp0_;
#line 1337 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp1_ = end;
#line 1337 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	if (_tmp1_ == NULL) {
#line 1338 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		result = maxlen;
#line 1338 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		return result;
#line 83 "NaturalCollate.c"
	} else {
		gchar* _tmp2_;
#line 1340 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp2_ = end;
#line 1340 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		result = (glong) (_tmp2_ - str);
#line 1340 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		return result;
#line 92 "NaturalCollate.c"
	}
}


static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	gchar* result = NULL;
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	glong _tmp6_;
	gchar* _tmp7_;
#line 1347 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1349 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	if (offset >= ((glong) 0)) {
#line 1349 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp0_ = len >= ((glong) 0);
#line 113 "NaturalCollate.c"
	} else {
#line 1349 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp0_ = FALSE;
#line 117 "NaturalCollate.c"
	}
#line 1349 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	if (_tmp0_) {
#line 1351 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		string_length = string_strnlen ((gchar*) self, offset + len);
#line 123 "NaturalCollate.c"
	} else {
		gint _tmp1_;
		gint _tmp2_;
#line 1353 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp1_ = strlen (self);
#line 1353 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp2_ = _tmp1_;
#line 1353 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		string_length = (glong) _tmp2_;
#line 133 "NaturalCollate.c"
	}
#line 1356 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	if (offset < ((glong) 0)) {
#line 137 "NaturalCollate.c"
		glong _tmp3_;
#line 1357 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp3_ = string_length;
#line 1357 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		offset = _tmp3_ + offset;
#line 1358 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
#line 145 "NaturalCollate.c"
	} else {
		glong _tmp4_;
#line 1360 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp4_ = string_length;
#line 1360 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		g_return_val_if_fail (offset <= _tmp4_, NULL);
#line 152 "NaturalCollate.c"
	}
#line 1362 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	if (len < ((glong) 0)) {
#line 156 "NaturalCollate.c"
		glong _tmp5_;
#line 1363 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp5_ = string_length;
#line 1363 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
		len = _tmp5_ - offset;
#line 162 "NaturalCollate.c"
	}
#line 1365 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp6_ = string_length;
#line 1365 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail ((offset + len) <= _tmp6_, NULL);
#line 1366 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp7_ = g_strndup (((gchar*) self) + offset, (gsize) len);
#line 1366 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	result = _tmp7_;
#line 1366 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	return result;
#line 174 "NaturalCollate.c"
}


gint
natural_collate_read_number (gchar* s,
                             gint* byte_index)
{
	gint result = 0;
	gint number = 0;
#line 23 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	g_return_val_if_fail (s != NULL, 0);
#line 31 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	number = 0;
#line 33 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	while (TRUE) {
#line 190 "NaturalCollate.c"
		gboolean _tmp0_ = FALSE;
		gint _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint second_char = 0;
		gint _tmp5_;
		gchar* _tmp6_;
		gint _tmp7_;
#line 33 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp1_ = strlen (s);
#line 33 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp2_ = _tmp1_;
#line 33 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		if (_tmp2_ != 0) {
#line 33 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp0_ = g_unichar_isdigit (string_get_char (s, (glong) 0));
#line 208 "NaturalCollate.c"
		} else {
#line 33 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp0_ = FALSE;
#line 212 "NaturalCollate.c"
		}
#line 33 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		if (!_tmp0_) {
#line 33 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			break;
#line 218 "NaturalCollate.c"
		}
#line 34 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp3_ = number;
#line 34 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		number = _tmp3_ * 10;
#line 35 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp4_ = number;
#line 35 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		number = _tmp4_ + g_unichar_digit_value (string_get_char (s, (glong) 0));
#line 36 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		second_char = string_index_of_nth_char (s, (glong) 1);
#line 37 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp5_ = second_char;
#line 37 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp6_ = string_substring (s, (glong) _tmp5_, (glong) -1);
#line 37 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_g_free0 (s);
#line 37 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		s = _tmp6_;
#line 38 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp7_ = second_char;
#line 38 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		*byte_index = (*byte_index) + _tmp7_;
#line 242 "NaturalCollate.c"
	}
#line 40 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	result = number;
#line 40 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_g_free0 (s);
#line 40 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	return result;
#line 250 "NaturalCollate.c"
}


gint
natural_collate_compare (const gchar* str1,
                         const gchar* str2)
{
	gint result = 0;
	GCompareFunc _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gint _tmp7_;
#line 43 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	g_return_val_if_fail (str1 != NULL, 0);
#line 43 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	g_return_val_if_fail (str2 != NULL, 0);
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp0_ = g_strcmp0;
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp1_ = g_strdup (str1);
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp2_ = natural_collate_collate_key (_tmp1_);
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp3_ = _tmp2_;
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp4_ = g_strdup (str2);
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp5_ = natural_collate_collate_key (_tmp4_);
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp6_ = _tmp5_;
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp7_ = _tmp0_ (_tmp3_, _tmp6_);
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_g_free0 (_tmp6_);
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_g_free0 (_tmp3_);
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	result = _tmp7_;
#line 44 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	return result;
#line 295 "NaturalCollate.c"
}


static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gboolean result = FALSE;
	gchar* _tmp0_;
#line 1417 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1417 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, FALSE);
#line 1418 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
#line 1418 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	result = _tmp0_ != NULL;
#line 1418 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	return result;
#line 315 "NaturalCollate.c"
}


static gchar*
g_unichar_to_string (gunichar self)
{
	gchar* result = NULL;
	gchar* str = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
#line 963 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp0_ = g_new0 (gchar, 7);
#line 963 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	str = (gchar*) _tmp0_;
#line 964 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp1_ = str;
#line 964 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	g_unichar_to_utf8 (self, _tmp1_);
#line 965 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	result = str;
#line 965 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
	return result;
#line 338 "NaturalCollate.c"
}


gchar*
natural_collate_collate_key (gchar* str)
{
	gchar* result = NULL;
	gboolean _tmp0_;
	gchar* _result_ = NULL;
	gchar* _tmp1_;
	gboolean eos = FALSE;
	gint _tmp2_;
	gint _tmp3_;
	const gchar* _tmp58_;
	gchar* _tmp59_;
	gchar* _tmp60_;
	gchar* _tmp61_;
#line 47 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	g_return_val_if_fail (str != NULL, NULL);
#line 53 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp0_ = g_utf8_validate (str, (gssize) -1, NULL);
#line 53 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_vala_assert (_tmp0_, "str.validate()");
#line 54 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp1_ = g_strdup ("");
#line 54 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_result_ = _tmp1_;
#line 55 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp2_ = strlen (str);
#line 55 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp3_ = _tmp2_;
#line 55 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	eos = _tmp3_ == 0;
#line 57 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	while (TRUE) {
#line 374 "NaturalCollate.c"
		gboolean _tmp4_;
		gboolean _tmp5_;
		gint position = 0;
		const gchar* _tmp11_;
		gint _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		gint _tmp18_;
		gchar* _tmp19_;
		gint _tmp20_;
		gint _tmp21_;
		gboolean _tmp22_;
		gint _tmp56_;
		gint _tmp57_;
#line 57 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp4_ = eos;
#line 57 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		if (!(!_tmp4_)) {
#line 57 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			break;
#line 398 "NaturalCollate.c"
		}
#line 58 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp5_ = g_utf8_validate (str, (gssize) -1, NULL);
#line 58 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_vala_assert (_tmp5_, "str.validate()");
#line 59 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		position = 0;
#line 60 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		while (TRUE) {
#line 408 "NaturalCollate.c"
			gint _tmp6_;
			gchar* _tmp7_;
			gchar* _tmp8_;
			gboolean _tmp9_;
			gint _tmp10_;
#line 60 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp6_ = position;
#line 60 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp7_ = g_unichar_to_string (string_get_char (str, (glong) _tmp6_));
#line 60 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp8_ = _tmp7_;
#line 60 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp9_ = !(!string_contains ("0123456789", _tmp8_));
#line 60 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_g_free0 (_tmp8_);
#line 60 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			if (_tmp9_) {
#line 60 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
				break;
#line 428 "NaturalCollate.c"
			}
#line 62 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp10_ = position;
#line 62 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			position = _tmp10_ + 1;
#line 434 "NaturalCollate.c"
		}
#line 66 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp11_ = _result_;
#line 66 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp12_ = position;
#line 66 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp13_ = string_substring (str, (glong) 0, (glong) _tmp12_);
#line 66 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp14_ = _tmp13_;
#line 66 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp15_ = g_utf8_collate_key (_tmp14_, (gssize) -1);
#line 66 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp16_ = _tmp15_;
#line 66 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp17_ = g_strconcat (_tmp11_, _tmp16_, NULL);
#line 66 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_g_free0 (_result_);
#line 66 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_result_ = _tmp17_;
#line 66 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_g_free0 (_tmp16_);
#line 66 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_g_free0 (_tmp14_);
#line 69 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp18_ = position;
#line 69 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp19_ = string_substring (str, (glong) _tmp18_, (glong) -1);
#line 69 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_g_free0 (str);
#line 69 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		str = _tmp19_;
#line 71 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp20_ = strlen (str);
#line 71 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp21_ = _tmp20_;
#line 71 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		eos = _tmp21_ == 0;
#line 72 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		position = 0;
#line 74 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp22_ = eos;
#line 74 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		if (!_tmp22_) {
#line 478 "NaturalCollate.c"
			gint number = 0;
			gchar* _tmp23_;
			gint _tmp24_;
			gint _tmp25_;
			gchar* _tmp26_;
			gint number_of_superdigits = 0;
			gint _tmp27_;
			gchar* _tmp28_;
			gchar* _tmp29_;
			gint _tmp30_;
			gint _tmp31_;
			gint _tmp32_;
			gchar* to_append = NULL;
			gchar* _tmp33_;
			const gchar* _tmp42_;
			gint _tmp43_;
			gchar* _tmp44_;
			gchar* _tmp45_;
			gchar* _tmp46_;
			const gchar* _tmp47_;
			gchar* _tmp48_;
			gchar* _tmp49_;
			gchar* _tmp50_;
			gchar* _tmp51_;
			gchar* _tmp52_;
			gchar* _tmp53_;
			const gchar* _tmp54_;
			gchar* _tmp55_;
#line 76 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp23_ = g_strdup (str);
#line 76 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp24_ = natural_collate_read_number (_tmp23_, &position);
#line 76 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			number = _tmp24_;
#line 77 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp25_ = position;
#line 77 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp26_ = string_substring (str, (glong) _tmp25_, (glong) -1);
#line 77 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_g_free0 (str);
#line 77 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			str = _tmp26_;
#line 78 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp27_ = number;
#line 78 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp28_ = g_strdup_printf ("%i", _tmp27_);
#line 78 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp29_ = _tmp28_;
#line 78 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp30_ = strlen (_tmp29_);
#line 78 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp31_ = _tmp30_;
#line 78 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp32_ = _tmp31_;
#line 78 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_g_free0 (_tmp29_);
#line 78 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			number_of_superdigits = _tmp32_;
#line 79 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp33_ = g_strdup ("");
#line 79 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			to_append = _tmp33_;
#line 541 "NaturalCollate.c"
			{
				gint i = 0;
#line 80 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
				i = 1;
#line 546 "NaturalCollate.c"
				{
					gboolean _tmp34_ = FALSE;
#line 80 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
					_tmp34_ = TRUE;
#line 80 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
					while (TRUE) {
#line 553 "NaturalCollate.c"
						gint _tmp36_;
						gint _tmp37_;
						const gchar* _tmp38_;
						gchar* _tmp39_;
						gchar* _tmp40_;
						gchar* _tmp41_;
#line 80 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						if (!_tmp34_) {
#line 562 "NaturalCollate.c"
							gint _tmp35_;
#line 80 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
							_tmp35_ = i;
#line 80 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
							i = _tmp35_ + 1;
#line 568 "NaturalCollate.c"
						}
#line 80 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						_tmp34_ = FALSE;
#line 80 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						_tmp36_ = i;
#line 80 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						_tmp37_ = number_of_superdigits;
#line 80 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						if (!(_tmp36_ < _tmp37_)) {
#line 80 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
							break;
#line 580 "NaturalCollate.c"
						}
#line 82 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						_tmp38_ = to_append;
#line 82 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						_tmp39_ = g_unichar_to_string (NATURAL_COLLATE_SUPERDIGIT);
#line 82 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						_tmp40_ = _tmp39_;
#line 82 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						_tmp41_ = g_strconcat (_tmp38_, _tmp40_, NULL);
#line 82 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						_g_free0 (to_append);
#line 82 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						to_append = _tmp41_;
#line 82 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
						_g_free0 (_tmp40_);
#line 596 "NaturalCollate.c"
					}
				}
			}
#line 84 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp42_ = to_append;
#line 84 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp43_ = number;
#line 84 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp44_ = g_strdup_printf ("%i", _tmp43_);
#line 84 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp45_ = _tmp44_;
#line 84 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp46_ = g_strconcat (_tmp42_, _tmp45_, NULL);
#line 84 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_g_free0 (to_append);
#line 84 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			to_append = _tmp46_;
#line 84 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_g_free0 (_tmp45_);
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp47_ = _result_;
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp48_ = g_strconcat (_tmp47_, NATURAL_COLLATE_COLLATION_SENTINEL, NULL);
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp49_ = _tmp48_;
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp50_ = g_unichar_to_string (NATURAL_COLLATE_NUM_SENTINEL);
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp51_ = _tmp50_;
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp52_ = g_strconcat (_tmp49_, _tmp51_, NULL);
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp53_ = _tmp52_;
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp54_ = to_append;
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_tmp55_ = g_strconcat (_tmp53_, _tmp54_, NULL);
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_g_free0 (_result_);
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_result_ = _tmp55_;
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_g_free0 (_tmp53_);
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_g_free0 (_tmp51_);
#line 85 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_g_free0 (_tmp49_);
#line 74 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
			_g_free0 (to_append);
#line 646 "NaturalCollate.c"
		}
#line 90 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp56_ = strlen (str);
#line 90 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		_tmp57_ = _tmp56_;
#line 90 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
		eos = _tmp57_ == 0;
#line 654 "NaturalCollate.c"
	}
#line 93 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp58_ = _result_;
#line 93 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp59_ = g_unichar_to_string (NATURAL_COLLATE_NUM_SENTINEL);
#line 93 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp60_ = _tmp59_;
#line 93 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_tmp61_ = g_strconcat (_tmp58_, _tmp60_, NULL);
#line 93 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_g_free0 (_result_);
#line 93 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_result_ = _tmp61_;
#line 93 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_g_free0 (_tmp60_);
#line 96 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	result = _result_;
#line 96 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	_g_free0 (str);
#line 96 "/home/jens/Source/shotwell/src/NaturalCollate.vala"
	return result;
#line 676 "NaturalCollate.c"
}