1 // This file was generated by gir (https://github.com/gtk-rs/gir)
2 // from gir-files (https://github.com/gtk-rs/gir-files)
3 // DO NOT EDIT
4 
5 extern crate gobject_sys;
6 extern crate shell_words;
7 extern crate tempfile;
8 use gobject_sys::*;
9 use std::env;
10 use std::error::Error;
11 use std::mem::{align_of, size_of};
12 use std::path::Path;
13 use std::process::Command;
14 use std::str;
15 use tempfile::Builder;
16 
17 static PACKAGES: &[&str] = &["gobject-2.0"];
18 
19 #[derive(Clone, Debug)]
20 struct Compiler {
21     pub args: Vec<String>,
22 }
23 
24 impl Compiler {
new() -> Result<Compiler, Box<dyn Error>>25     pub fn new() -> Result<Compiler, Box<dyn Error>> {
26         let mut args = get_var("CC", "cc")?;
27         args.push("-Wno-deprecated-declarations".to_owned());
28         // For %z support in printf when using MinGW.
29         args.push("-D__USE_MINGW_ANSI_STDIO".to_owned());
30         args.extend(get_var("CFLAGS", "")?);
31         args.extend(get_var("CPPFLAGS", "")?);
32         args.extend(pkg_config_cflags(PACKAGES)?);
33         Ok(Compiler { args })
34     }
35 
define<'a, V: Into<Option<&'a str>>>(&mut self, var: &str, val: V)36     pub fn define<'a, V: Into<Option<&'a str>>>(&mut self, var: &str, val: V) {
37         let arg = match val.into() {
38             None => format!("-D{}", var),
39             Some(val) => format!("-D{}={}", var, val),
40         };
41         self.args.push(arg);
42     }
43 
compile(&self, src: &Path, out: &Path) -> Result<(), Box<dyn Error>>44     pub fn compile(&self, src: &Path, out: &Path) -> Result<(), Box<dyn Error>> {
45         let mut cmd = self.to_command();
46         cmd.arg(src);
47         cmd.arg("-o");
48         cmd.arg(out);
49         let status = cmd.spawn()?.wait()?;
50         if !status.success() {
51             return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
52         }
53         Ok(())
54     }
55 
to_command(&self) -> Command56     fn to_command(&self) -> Command {
57         let mut cmd = Command::new(&self.args[0]);
58         cmd.args(&self.args[1..]);
59         cmd
60     }
61 }
62 
get_var(name: &str, default: &str) -> Result<Vec<String>, Box<dyn Error>>63 fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<dyn Error>> {
64     match env::var(name) {
65         Ok(value) => Ok(shell_words::split(&value)?),
66         Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
67         Err(err) => Err(format!("{} {}", name, err).into()),
68     }
69 }
70 
pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>>71 fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
72     if packages.is_empty() {
73         return Ok(Vec::new());
74     }
75     let mut cmd = Command::new("pkg-config");
76     cmd.arg("--cflags");
77     cmd.args(packages);
78     let out = cmd.output()?;
79     if !out.status.success() {
80         return Err(format!("command {:?} returned {}", &cmd, out.status).into());
81     }
82     let stdout = str::from_utf8(&out.stdout)?;
83     Ok(shell_words::split(stdout.trim())?)
84 }
85 
86 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
87 struct Layout {
88     size: usize,
89     alignment: usize,
90 }
91 
92 #[derive(Copy, Clone, Debug, Default, Eq, PartialEq)]
93 struct Results {
94     /// Number of successfully completed tests.
95     passed: usize,
96     /// Total number of failed tests (including those that failed to compile).
97     failed: usize,
98     /// Number of tests that failed to compile.
99     failed_to_compile: usize,
100 }
101 
102 impl Results {
record_passed(&mut self)103     fn record_passed(&mut self) {
104         self.passed += 1;
105     }
record_failed(&mut self)106     fn record_failed(&mut self) {
107         self.failed += 1;
108     }
record_failed_to_compile(&mut self)109     fn record_failed_to_compile(&mut self) {
110         self.failed += 1;
111         self.failed_to_compile += 1;
112     }
summary(&self) -> String113     fn summary(&self) -> String {
114         format!(
115             "{} passed; {} failed (compilation errors: {})",
116             self.passed, self.failed, self.failed_to_compile
117         )
118     }
expect_total_success(&self)119     fn expect_total_success(&self) {
120         if self.failed == 0 {
121             println!("OK: {}", self.summary());
122         } else {
123             panic!("FAILED: {}", self.summary());
124         };
125     }
126 }
127 
128 #[test]
cross_validate_constants_with_c()129 fn cross_validate_constants_with_c() {
130     let tmpdir = Builder::new()
131         .prefix("abi")
132         .tempdir()
133         .expect("temporary directory");
134     let cc = Compiler::new().expect("configured compiler");
135 
136     assert_eq!(
137         "1",
138         get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
139         "failed to obtain correct constant value for 1"
140     );
141 
142     let mut results: Results = Default::default();
143     for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
144         match get_c_value(tmpdir.path(), &cc, name) {
145             Err(e) => {
146                 results.record_failed_to_compile();
147                 eprintln!("{}", e);
148             }
149             Ok(ref c_value) => {
150                 if rust_value == c_value {
151                     results.record_passed();
152                 } else {
153                     results.record_failed();
154                     eprintln!(
155                         "Constant value mismatch for {}\nRust: {:?}\nC:    {:?}",
156                         name, rust_value, c_value
157                     );
158                 }
159             }
160         };
161         if (i + 1) % 25 == 0 {
162             println!("constants ... {}", results.summary());
163         }
164     }
165     results.expect_total_success();
166 }
167 
168 #[test]
cross_validate_layout_with_c()169 fn cross_validate_layout_with_c() {
170     let tmpdir = Builder::new()
171         .prefix("abi")
172         .tempdir()
173         .expect("temporary directory");
174     let cc = Compiler::new().expect("configured compiler");
175 
176     assert_eq!(
177         Layout {
178             size: 1,
179             alignment: 1
180         },
181         get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
182         "failed to obtain correct layout for char type"
183     );
184 
185     let mut results: Results = Default::default();
186     for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
187         match get_c_layout(tmpdir.path(), &cc, name) {
188             Err(e) => {
189                 results.record_failed_to_compile();
190                 eprintln!("{}", e);
191             }
192             Ok(c_layout) => {
193                 if rust_layout == c_layout {
194                     results.record_passed();
195                 } else {
196                     results.record_failed();
197                     eprintln!(
198                         "Layout mismatch for {}\nRust: {:?}\nC:    {:?}",
199                         name, rust_layout, &c_layout
200                     );
201                 }
202             }
203         };
204         if (i + 1) % 25 == 0 {
205             println!("layout    ... {}", results.summary());
206         }
207     }
208     results.expect_total_success();
209 }
210 
get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<dyn Error>>211 fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<dyn Error>> {
212     let exe = dir.join("layout");
213     let mut cc = cc.clone();
214     cc.define("ABI_TYPE_NAME", name);
215     cc.compile(Path::new("tests/layout.c"), &exe)?;
216 
217     let mut abi_cmd = Command::new(exe);
218     let output = abi_cmd.output()?;
219     if !output.status.success() {
220         return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
221     }
222 
223     let stdout = str::from_utf8(&output.stdout)?;
224     let mut words = stdout.trim().split_whitespace();
225     let size = words.next().unwrap().parse().unwrap();
226     let alignment = words.next().unwrap().parse().unwrap();
227     Ok(Layout { size, alignment })
228 }
229 
get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<dyn Error>>230 fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<dyn Error>> {
231     let exe = dir.join("constant");
232     let mut cc = cc.clone();
233     cc.define("ABI_CONSTANT_NAME", name);
234     cc.compile(Path::new("tests/constant.c"), &exe)?;
235 
236     let mut abi_cmd = Command::new(exe);
237     let output = abi_cmd.output()?;
238     if !output.status.success() {
239         return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
240     }
241 
242     let output = str::from_utf8(&output.stdout)?.trim();
243     if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
244         return Err(format!(
245             "command {:?} return invalid output, {:?}",
246             &abi_cmd, &output
247         )
248         .into());
249     }
250 
251     Ok(String::from(&output[14..(output.len() - 14)]))
252 }
253 
254 const RUST_LAYOUTS: &[(&str, Layout)] = &[
255     (
256         "GBindingFlags",
257         Layout {
258             size: size_of::<GBindingFlags>(),
259             alignment: align_of::<GBindingFlags>(),
260         },
261     ),
262     (
263         "GClosureNotifyData",
264         Layout {
265             size: size_of::<GClosureNotifyData>(),
266             alignment: align_of::<GClosureNotifyData>(),
267         },
268     ),
269     (
270         "GConnectFlags",
271         Layout {
272             size: size_of::<GConnectFlags>(),
273             alignment: align_of::<GConnectFlags>(),
274         },
275     ),
276     (
277         "GEnumClass",
278         Layout {
279             size: size_of::<GEnumClass>(),
280             alignment: align_of::<GEnumClass>(),
281         },
282     ),
283     (
284         "GEnumValue",
285         Layout {
286             size: size_of::<GEnumValue>(),
287             alignment: align_of::<GEnumValue>(),
288         },
289     ),
290     (
291         "GFlagsClass",
292         Layout {
293             size: size_of::<GFlagsClass>(),
294             alignment: align_of::<GFlagsClass>(),
295         },
296     ),
297     (
298         "GFlagsValue",
299         Layout {
300             size: size_of::<GFlagsValue>(),
301             alignment: align_of::<GFlagsValue>(),
302         },
303     ),
304     (
305         "GInitiallyUnowned",
306         Layout {
307             size: size_of::<GInitiallyUnowned>(),
308             alignment: align_of::<GInitiallyUnowned>(),
309         },
310     ),
311     (
312         "GInitiallyUnownedClass",
313         Layout {
314             size: size_of::<GInitiallyUnownedClass>(),
315             alignment: align_of::<GInitiallyUnownedClass>(),
316         },
317     ),
318     (
319         "GInterfaceInfo",
320         Layout {
321             size: size_of::<GInterfaceInfo>(),
322             alignment: align_of::<GInterfaceInfo>(),
323         },
324     ),
325     (
326         "GObject",
327         Layout {
328             size: size_of::<GObject>(),
329             alignment: align_of::<GObject>(),
330         },
331     ),
332     (
333         "GObjectClass",
334         Layout {
335             size: size_of::<GObjectClass>(),
336             alignment: align_of::<GObjectClass>(),
337         },
338     ),
339     (
340         "GObjectConstructParam",
341         Layout {
342             size: size_of::<GObjectConstructParam>(),
343             alignment: align_of::<GObjectConstructParam>(),
344         },
345     ),
346     (
347         "GParamFlags",
348         Layout {
349             size: size_of::<GParamFlags>(),
350             alignment: align_of::<GParamFlags>(),
351         },
352     ),
353     (
354         "GParamSpec",
355         Layout {
356             size: size_of::<GParamSpec>(),
357             alignment: align_of::<GParamSpec>(),
358         },
359     ),
360     (
361         "GParamSpecBoolean",
362         Layout {
363             size: size_of::<GParamSpecBoolean>(),
364             alignment: align_of::<GParamSpecBoolean>(),
365         },
366     ),
367     (
368         "GParamSpecBoxed",
369         Layout {
370             size: size_of::<GParamSpecBoxed>(),
371             alignment: align_of::<GParamSpecBoxed>(),
372         },
373     ),
374     (
375         "GParamSpecChar",
376         Layout {
377             size: size_of::<GParamSpecChar>(),
378             alignment: align_of::<GParamSpecChar>(),
379         },
380     ),
381     (
382         "GParamSpecClass",
383         Layout {
384             size: size_of::<GParamSpecClass>(),
385             alignment: align_of::<GParamSpecClass>(),
386         },
387     ),
388     (
389         "GParamSpecDouble",
390         Layout {
391             size: size_of::<GParamSpecDouble>(),
392             alignment: align_of::<GParamSpecDouble>(),
393         },
394     ),
395     (
396         "GParamSpecEnum",
397         Layout {
398             size: size_of::<GParamSpecEnum>(),
399             alignment: align_of::<GParamSpecEnum>(),
400         },
401     ),
402     (
403         "GParamSpecFlags",
404         Layout {
405             size: size_of::<GParamSpecFlags>(),
406             alignment: align_of::<GParamSpecFlags>(),
407         },
408     ),
409     (
410         "GParamSpecFloat",
411         Layout {
412             size: size_of::<GParamSpecFloat>(),
413             alignment: align_of::<GParamSpecFloat>(),
414         },
415     ),
416     (
417         "GParamSpecGType",
418         Layout {
419             size: size_of::<GParamSpecGType>(),
420             alignment: align_of::<GParamSpecGType>(),
421         },
422     ),
423     (
424         "GParamSpecInt",
425         Layout {
426             size: size_of::<GParamSpecInt>(),
427             alignment: align_of::<GParamSpecInt>(),
428         },
429     ),
430     (
431         "GParamSpecInt64",
432         Layout {
433             size: size_of::<GParamSpecInt64>(),
434             alignment: align_of::<GParamSpecInt64>(),
435         },
436     ),
437     (
438         "GParamSpecLong",
439         Layout {
440             size: size_of::<GParamSpecLong>(),
441             alignment: align_of::<GParamSpecLong>(),
442         },
443     ),
444     (
445         "GParamSpecObject",
446         Layout {
447             size: size_of::<GParamSpecObject>(),
448             alignment: align_of::<GParamSpecObject>(),
449         },
450     ),
451     (
452         "GParamSpecOverride",
453         Layout {
454             size: size_of::<GParamSpecOverride>(),
455             alignment: align_of::<GParamSpecOverride>(),
456         },
457     ),
458     (
459         "GParamSpecParam",
460         Layout {
461             size: size_of::<GParamSpecParam>(),
462             alignment: align_of::<GParamSpecParam>(),
463         },
464     ),
465     (
466         "GParamSpecPointer",
467         Layout {
468             size: size_of::<GParamSpecPointer>(),
469             alignment: align_of::<GParamSpecPointer>(),
470         },
471     ),
472     (
473         "GParamSpecTypeInfo",
474         Layout {
475             size: size_of::<GParamSpecTypeInfo>(),
476             alignment: align_of::<GParamSpecTypeInfo>(),
477         },
478     ),
479     (
480         "GParamSpecUChar",
481         Layout {
482             size: size_of::<GParamSpecUChar>(),
483             alignment: align_of::<GParamSpecUChar>(),
484         },
485     ),
486     (
487         "GParamSpecUInt",
488         Layout {
489             size: size_of::<GParamSpecUInt>(),
490             alignment: align_of::<GParamSpecUInt>(),
491         },
492     ),
493     (
494         "GParamSpecUInt64",
495         Layout {
496             size: size_of::<GParamSpecUInt64>(),
497             alignment: align_of::<GParamSpecUInt64>(),
498         },
499     ),
500     (
501         "GParamSpecULong",
502         Layout {
503             size: size_of::<GParamSpecULong>(),
504             alignment: align_of::<GParamSpecULong>(),
505         },
506     ),
507     (
508         "GParamSpecUnichar",
509         Layout {
510             size: size_of::<GParamSpecUnichar>(),
511             alignment: align_of::<GParamSpecUnichar>(),
512         },
513     ),
514     (
515         "GParamSpecValueArray",
516         Layout {
517             size: size_of::<GParamSpecValueArray>(),
518             alignment: align_of::<GParamSpecValueArray>(),
519         },
520     ),
521     (
522         "GParamSpecVariant",
523         Layout {
524             size: size_of::<GParamSpecVariant>(),
525             alignment: align_of::<GParamSpecVariant>(),
526         },
527     ),
528     (
529         "GParameter",
530         Layout {
531             size: size_of::<GParameter>(),
532             alignment: align_of::<GParameter>(),
533         },
534     ),
535     (
536         "GSignalCMarshaller",
537         Layout {
538             size: size_of::<GSignalCMarshaller>(),
539             alignment: align_of::<GSignalCMarshaller>(),
540         },
541     ),
542     (
543         "GSignalFlags",
544         Layout {
545             size: size_of::<GSignalFlags>(),
546             alignment: align_of::<GSignalFlags>(),
547         },
548     ),
549     (
550         "GSignalInvocationHint",
551         Layout {
552             size: size_of::<GSignalInvocationHint>(),
553             alignment: align_of::<GSignalInvocationHint>(),
554         },
555     ),
556     (
557         "GSignalMatchType",
558         Layout {
559             size: size_of::<GSignalMatchType>(),
560             alignment: align_of::<GSignalMatchType>(),
561         },
562     ),
563     (
564         "GSignalQuery",
565         Layout {
566             size: size_of::<GSignalQuery>(),
567             alignment: align_of::<GSignalQuery>(),
568         },
569     ),
570     (
571         "GTypeClass",
572         Layout {
573             size: size_of::<GTypeClass>(),
574             alignment: align_of::<GTypeClass>(),
575         },
576     ),
577     (
578         "GTypeDebugFlags",
579         Layout {
580             size: size_of::<GTypeDebugFlags>(),
581             alignment: align_of::<GTypeDebugFlags>(),
582         },
583     ),
584     (
585         "GTypeFlags",
586         Layout {
587             size: size_of::<GTypeFlags>(),
588             alignment: align_of::<GTypeFlags>(),
589         },
590     ),
591     (
592         "GTypeFundamentalFlags",
593         Layout {
594             size: size_of::<GTypeFundamentalFlags>(),
595             alignment: align_of::<GTypeFundamentalFlags>(),
596         },
597     ),
598     (
599         "GTypeFundamentalInfo",
600         Layout {
601             size: size_of::<GTypeFundamentalInfo>(),
602             alignment: align_of::<GTypeFundamentalInfo>(),
603         },
604     ),
605     (
606         "GTypeInfo",
607         Layout {
608             size: size_of::<GTypeInfo>(),
609             alignment: align_of::<GTypeInfo>(),
610         },
611     ),
612     (
613         "GTypeInstance",
614         Layout {
615             size: size_of::<GTypeInstance>(),
616             alignment: align_of::<GTypeInstance>(),
617         },
618     ),
619     (
620         "GTypeInterface",
621         Layout {
622             size: size_of::<GTypeInterface>(),
623             alignment: align_of::<GTypeInterface>(),
624         },
625     ),
626     (
627         "GTypeModule",
628         Layout {
629             size: size_of::<GTypeModule>(),
630             alignment: align_of::<GTypeModule>(),
631         },
632     ),
633     (
634         "GTypeModuleClass",
635         Layout {
636             size: size_of::<GTypeModuleClass>(),
637             alignment: align_of::<GTypeModuleClass>(),
638         },
639     ),
640     (
641         "GTypePluginClass",
642         Layout {
643             size: size_of::<GTypePluginClass>(),
644             alignment: align_of::<GTypePluginClass>(),
645         },
646     ),
647     (
648         "GTypeQuery",
649         Layout {
650             size: size_of::<GTypeQuery>(),
651             alignment: align_of::<GTypeQuery>(),
652         },
653     ),
654     (
655         "GTypeValueTable",
656         Layout {
657             size: size_of::<GTypeValueTable>(),
658             alignment: align_of::<GTypeValueTable>(),
659         },
660     ),
661     (
662         "GValue",
663         Layout {
664             size: size_of::<GValue>(),
665             alignment: align_of::<GValue>(),
666         },
667     ),
668     (
669         "GValueArray",
670         Layout {
671             size: size_of::<GValueArray>(),
672             alignment: align_of::<GValueArray>(),
673         },
674     ),
675     (
676         "GWeakRef",
677         Layout {
678             size: size_of::<GWeakRef>(),
679             alignment: align_of::<GWeakRef>(),
680         },
681     ),
682 ];
683 
684 const RUST_CONSTANTS: &[(&str, &str)] = &[
685     ("(guint) G_BINDING_BIDIRECTIONAL", "1"),
686     ("(guint) G_BINDING_DEFAULT", "0"),
687     ("(guint) G_BINDING_INVERT_BOOLEAN", "4"),
688     ("(guint) G_BINDING_SYNC_CREATE", "2"),
689     ("(guint) G_CONNECT_AFTER", "1"),
690     ("(guint) G_CONNECT_SWAPPED", "2"),
691     ("(guint) G_PARAM_CONSTRUCT", "4"),
692     ("(guint) G_PARAM_CONSTRUCT_ONLY", "8"),
693     ("(guint) G_PARAM_DEPRECATED", "2147483648"),
694     ("(guint) G_PARAM_EXPLICIT_NOTIFY", "1073741824"),
695     ("(guint) G_PARAM_LAX_VALIDATION", "16"),
696     ("G_PARAM_MASK", "255"),
697     ("(guint) G_PARAM_PRIVATE", "32"),
698     ("(guint) G_PARAM_READABLE", "1"),
699     ("(guint) G_PARAM_READWRITE", "3"),
700     ("(guint) G_PARAM_STATIC_BLURB", "128"),
701     ("(guint) G_PARAM_STATIC_NAME", "32"),
702     ("(guint) G_PARAM_STATIC_NICK", "64"),
703     ("G_PARAM_STATIC_STRINGS", "224"),
704     ("G_PARAM_USER_SHIFT", "8"),
705     ("(guint) G_PARAM_WRITABLE", "2"),
706     ("(guint) G_SIGNAL_ACTION", "32"),
707     ("(guint) G_SIGNAL_DEPRECATED", "256"),
708     ("(guint) G_SIGNAL_DETAILED", "16"),
709     ("G_SIGNAL_FLAGS_MASK", "511"),
710     ("(guint) G_SIGNAL_MATCH_CLOSURE", "4"),
711     ("(guint) G_SIGNAL_MATCH_DATA", "16"),
712     ("(guint) G_SIGNAL_MATCH_DETAIL", "2"),
713     ("(guint) G_SIGNAL_MATCH_FUNC", "8"),
714     ("(guint) G_SIGNAL_MATCH_ID", "1"),
715     ("G_SIGNAL_MATCH_MASK", "63"),
716     ("(guint) G_SIGNAL_MATCH_UNBLOCKED", "32"),
717     ("(guint) G_SIGNAL_MUST_COLLECT", "128"),
718     ("(guint) G_SIGNAL_NO_HOOKS", "64"),
719     ("(guint) G_SIGNAL_NO_RECURSE", "8"),
720     ("(guint) G_SIGNAL_RUN_CLEANUP", "4"),
721     ("(guint) G_SIGNAL_RUN_FIRST", "1"),
722     ("(guint) G_SIGNAL_RUN_LAST", "2"),
723     ("(guint) G_TYPE_DEBUG_INSTANCE_COUNT", "4"),
724     ("(guint) G_TYPE_DEBUG_MASK", "7"),
725     ("(guint) G_TYPE_DEBUG_NONE", "0"),
726     ("(guint) G_TYPE_DEBUG_OBJECTS", "1"),
727     ("(guint) G_TYPE_DEBUG_SIGNALS", "2"),
728     ("(guint) G_TYPE_FLAG_ABSTRACT", "16"),
729     ("(guint) G_TYPE_FLAG_CLASSED", "1"),
730     ("(guint) G_TYPE_FLAG_DEEP_DERIVABLE", "8"),
731     ("(guint) G_TYPE_FLAG_DERIVABLE", "4"),
732     ("(guint) G_TYPE_FLAG_INSTANTIATABLE", "2"),
733     ("G_TYPE_FLAG_RESERVED_ID_BIT", "1"),
734     ("(guint) G_TYPE_FLAG_VALUE_ABSTRACT", "32"),
735     ("G_TYPE_FUNDAMENTAL_MAX", "255"),
736     ("G_TYPE_FUNDAMENTAL_SHIFT", "2"),
737     ("G_TYPE_RESERVED_BSE_FIRST", "32"),
738     ("G_TYPE_RESERVED_BSE_LAST", "48"),
739     ("G_TYPE_RESERVED_GLIB_FIRST", "22"),
740     ("G_TYPE_RESERVED_GLIB_LAST", "31"),
741     ("G_TYPE_RESERVED_USER_FIRST", "49"),
742     ("G_VALUE_NOCOPY_CONTENTS", "134217728"),
743 ];
744