isl_rs/bindings/
space.rs

1// Automatically generated by isl_bindings_generator.
2// LICENSE: MIT
3
4use crate::bindings::{Context, DimType, Id};
5use libc::uintptr_t;
6use std::ffi::{CStr, CString};
7use std::os::raw::c_char;
8
9/// Wraps `isl_space`.
10pub struct Space {
11    pub ptr: uintptr_t,
12    pub should_free_on_drop: bool,
13}
14
15extern "C" {
16
17    fn isl_space_get_ctx(space: uintptr_t) -> uintptr_t;
18
19    fn isl_space_unit(ctx: uintptr_t) -> uintptr_t;
20
21    fn isl_space_alloc(ctx: uintptr_t, nparam: u32, n_in: u32, n_out: u32) -> uintptr_t;
22
23    fn isl_space_set_alloc(ctx: uintptr_t, nparam: u32, dim: u32) -> uintptr_t;
24
25    fn isl_space_params_alloc(ctx: uintptr_t, nparam: u32) -> uintptr_t;
26
27    fn isl_space_copy(space: uintptr_t) -> uintptr_t;
28
29    fn isl_space_free(space: uintptr_t) -> uintptr_t;
30
31    fn isl_space_is_params(space: uintptr_t) -> i32;
32
33    fn isl_space_is_set(space: uintptr_t) -> i32;
34
35    fn isl_space_is_map(space: uintptr_t) -> i32;
36
37    fn isl_space_add_param_id(space: uintptr_t, id: uintptr_t) -> uintptr_t;
38
39    fn isl_space_set_tuple_name(space: uintptr_t, type_: DimType, s: *const c_char) -> uintptr_t;
40
41    fn isl_space_has_tuple_name(space: uintptr_t, type_: DimType) -> i32;
42
43    fn isl_space_get_tuple_name(space: uintptr_t, type_: DimType) -> *const c_char;
44
45    fn isl_space_set_domain_tuple_id(space: uintptr_t, id: uintptr_t) -> uintptr_t;
46
47    fn isl_space_set_range_tuple_id(space: uintptr_t, id: uintptr_t) -> uintptr_t;
48
49    fn isl_space_set_tuple_id(space: uintptr_t, type_: DimType, id: uintptr_t) -> uintptr_t;
50
51    fn isl_space_reset_tuple_id(space: uintptr_t, type_: DimType) -> uintptr_t;
52
53    fn isl_space_has_domain_tuple_id(space: uintptr_t) -> i32;
54
55    fn isl_space_has_range_tuple_id(space: uintptr_t) -> i32;
56
57    fn isl_space_has_tuple_id(space: uintptr_t, type_: DimType) -> i32;
58
59    fn isl_space_get_domain_tuple_id(space: uintptr_t) -> uintptr_t;
60
61    fn isl_space_get_range_tuple_id(space: uintptr_t) -> uintptr_t;
62
63    fn isl_space_get_tuple_id(space: uintptr_t, type_: DimType) -> uintptr_t;
64
65    fn isl_space_reset_user(space: uintptr_t) -> uintptr_t;
66
67    fn isl_space_set_dim_id(space: uintptr_t, type_: DimType, pos: u32, id: uintptr_t)
68                            -> uintptr_t;
69
70    fn isl_space_has_dim_id(space: uintptr_t, type_: DimType, pos: u32) -> i32;
71
72    fn isl_space_get_dim_id(space: uintptr_t, type_: DimType, pos: u32) -> uintptr_t;
73
74    fn isl_space_find_dim_by_id(space: uintptr_t, type_: DimType, id: uintptr_t) -> i32;
75
76    fn isl_space_find_dim_by_name(space: uintptr_t, type_: DimType, name: *const c_char) -> i32;
77
78    fn isl_space_has_dim_name(space: uintptr_t, type_: DimType, pos: u32) -> i32;
79
80    fn isl_space_set_dim_name(space: uintptr_t, type_: DimType, pos: u32, name: *const c_char)
81                              -> uintptr_t;
82
83    fn isl_space_get_dim_name(space: uintptr_t, type_: DimType, pos: u32) -> *const c_char;
84
85    fn isl_space_extend(space: uintptr_t, nparam: u32, n_in: u32, n_out: u32) -> uintptr_t;
86
87    fn isl_space_add_dims(space: uintptr_t, type_: DimType, n: u32) -> uintptr_t;
88
89    fn isl_space_move_dims(space: uintptr_t, dst_type: DimType, dst_pos: u32, src_type: DimType,
90                           src_pos: u32, n: u32)
91                           -> uintptr_t;
92
93    fn isl_space_insert_dims(space: uintptr_t, type_: DimType, pos: u32, n: u32) -> uintptr_t;
94
95    fn isl_space_join(left: uintptr_t, right: uintptr_t) -> uintptr_t;
96
97    fn isl_space_product(left: uintptr_t, right: uintptr_t) -> uintptr_t;
98
99    fn isl_space_domain_product(left: uintptr_t, right: uintptr_t) -> uintptr_t;
100
101    fn isl_space_range_product(left: uintptr_t, right: uintptr_t) -> uintptr_t;
102
103    fn isl_space_factor_domain(space: uintptr_t) -> uintptr_t;
104
105    fn isl_space_factor_range(space: uintptr_t) -> uintptr_t;
106
107    fn isl_space_domain_factor_domain(space: uintptr_t) -> uintptr_t;
108
109    fn isl_space_domain_factor_range(space: uintptr_t) -> uintptr_t;
110
111    fn isl_space_range_factor_domain(space: uintptr_t) -> uintptr_t;
112
113    fn isl_space_range_factor_range(space: uintptr_t) -> uintptr_t;
114
115    fn isl_space_domain_wrapped_domain(space: uintptr_t) -> uintptr_t;
116
117    fn isl_space_domain_wrapped_range(space: uintptr_t) -> uintptr_t;
118
119    fn isl_space_range_wrapped_domain(space: uintptr_t) -> uintptr_t;
120
121    fn isl_space_range_wrapped_range(space: uintptr_t) -> uintptr_t;
122
123    fn isl_space_map_from_set(space: uintptr_t) -> uintptr_t;
124
125    fn isl_space_map_from_domain_and_range(domain: uintptr_t, range: uintptr_t) -> uintptr_t;
126
127    fn isl_space_reverse(space: uintptr_t) -> uintptr_t;
128
129    fn isl_space_wrapped_reverse(space: uintptr_t) -> uintptr_t;
130
131    fn isl_space_domain_reverse(space: uintptr_t) -> uintptr_t;
132
133    fn isl_space_range_reverse(space: uintptr_t) -> uintptr_t;
134
135    fn isl_space_drop_dims(space: uintptr_t, type_: DimType, first: u32, num: u32) -> uintptr_t;
136
137    fn isl_space_drop_inputs(space: uintptr_t, first: u32, n: u32) -> uintptr_t;
138
139    fn isl_space_drop_outputs(space: uintptr_t, first: u32, n: u32) -> uintptr_t;
140
141    fn isl_space_drop_all_params(space: uintptr_t) -> uintptr_t;
142
143    fn isl_space_domain(space: uintptr_t) -> uintptr_t;
144
145    fn isl_space_from_domain(space: uintptr_t) -> uintptr_t;
146
147    fn isl_space_range(space: uintptr_t) -> uintptr_t;
148
149    fn isl_space_from_range(space: uintptr_t) -> uintptr_t;
150
151    fn isl_space_domain_map(space: uintptr_t) -> uintptr_t;
152
153    fn isl_space_range_map(space: uintptr_t) -> uintptr_t;
154
155    fn isl_space_params(space: uintptr_t) -> uintptr_t;
156
157    fn isl_space_add_unnamed_tuple_ui(space: uintptr_t, dim: u32) -> uintptr_t;
158
159    fn isl_space_add_named_tuple_id_ui(space: uintptr_t, tuple_id: uintptr_t, dim: u32)
160                                       -> uintptr_t;
161
162    fn isl_space_set_from_params(space: uintptr_t) -> uintptr_t;
163
164    fn isl_space_align_params(space1: uintptr_t, space2: uintptr_t) -> uintptr_t;
165
166    fn isl_space_is_wrapping(space: uintptr_t) -> i32;
167
168    fn isl_space_domain_is_wrapping(space: uintptr_t) -> i32;
169
170    fn isl_space_range_is_wrapping(space: uintptr_t) -> i32;
171
172    fn isl_space_is_product(space: uintptr_t) -> i32;
173
174    fn isl_space_wrap(space: uintptr_t) -> uintptr_t;
175
176    fn isl_space_unwrap(space: uintptr_t) -> uintptr_t;
177
178    fn isl_space_can_zip(space: uintptr_t) -> i32;
179
180    fn isl_space_zip(space: uintptr_t) -> uintptr_t;
181
182    fn isl_space_can_curry(space: uintptr_t) -> i32;
183
184    fn isl_space_curry(space: uintptr_t) -> uintptr_t;
185
186    fn isl_space_can_range_curry(space: uintptr_t) -> i32;
187
188    fn isl_space_range_curry(space: uintptr_t) -> uintptr_t;
189
190    fn isl_space_can_uncurry(space: uintptr_t) -> i32;
191
192    fn isl_space_uncurry(space: uintptr_t) -> uintptr_t;
193
194    fn isl_space_is_domain(space1: uintptr_t, space2: uintptr_t) -> i32;
195
196    fn isl_space_is_range(space1: uintptr_t, space2: uintptr_t) -> i32;
197
198    fn isl_space_is_equal(space1: uintptr_t, space2: uintptr_t) -> i32;
199
200    fn isl_space_has_equal_params(space1: uintptr_t, space2: uintptr_t) -> i32;
201
202    fn isl_space_has_equal_tuples(space1: uintptr_t, space2: uintptr_t) -> i32;
203
204    fn isl_space_tuple_is_equal(space1: uintptr_t, type1: DimType, space2: uintptr_t,
205                                type2: DimType)
206                                -> i32;
207
208    fn isl_space_match(space1: uintptr_t, type1: DimType, space2: uintptr_t, type2: DimType)
209                       -> i32;
210
211    fn isl_space_dim(space: uintptr_t, type_: DimType) -> i32;
212
213    fn isl_space_flatten_domain(space: uintptr_t) -> uintptr_t;
214
215    fn isl_space_flatten_range(space: uintptr_t) -> uintptr_t;
216
217    fn isl_space_read_from_str(ctx: uintptr_t, str_: *const c_char) -> uintptr_t;
218
219    fn isl_space_to_str(space: uintptr_t) -> *const c_char;
220
221    fn isl_space_dump(space: uintptr_t);
222
223}
224
225impl Space {
226    /// Wraps `isl_space_get_ctx`.
227    pub fn get_ctx(&self) -> Context {
228        let space = self;
229        let space = space.ptr;
230        let isl_rs_result = unsafe { isl_space_get_ctx(space) };
231        let isl_rs_result = Context { ptr: isl_rs_result,
232                                      should_free_on_drop: true };
233        let mut isl_rs_result = isl_rs_result;
234        isl_rs_result.do_not_free_on_drop();
235        isl_rs_result
236    }
237
238    /// Wraps `isl_space_unit`.
239    pub fn unit(ctx: &Context) -> Space {
240        let ctx = ctx.ptr;
241        let isl_rs_result = unsafe { isl_space_unit(ctx) };
242        let isl_rs_result = Space { ptr: isl_rs_result,
243                                    should_free_on_drop: true };
244        isl_rs_result
245    }
246
247    /// Wraps `isl_space_alloc`.
248    pub fn alloc(ctx: &Context, nparam: u32, n_in: u32, n_out: u32) -> Space {
249        let ctx = ctx.ptr;
250        let isl_rs_result = unsafe { isl_space_alloc(ctx, nparam, n_in, n_out) };
251        let isl_rs_result = Space { ptr: isl_rs_result,
252                                    should_free_on_drop: true };
253        isl_rs_result
254    }
255
256    /// Wraps `isl_space_set_alloc`.
257    pub fn set_alloc(ctx: &Context, nparam: u32, dim: u32) -> Space {
258        let ctx = ctx.ptr;
259        let isl_rs_result = unsafe { isl_space_set_alloc(ctx, nparam, dim) };
260        let isl_rs_result = Space { ptr: isl_rs_result,
261                                    should_free_on_drop: true };
262        isl_rs_result
263    }
264
265    /// Wraps `isl_space_params_alloc`.
266    pub fn params_alloc(ctx: &Context, nparam: u32) -> Space {
267        let ctx = ctx.ptr;
268        let isl_rs_result = unsafe { isl_space_params_alloc(ctx, nparam) };
269        let isl_rs_result = Space { ptr: isl_rs_result,
270                                    should_free_on_drop: true };
271        isl_rs_result
272    }
273
274    /// Wraps `isl_space_copy`.
275    pub fn copy(&self) -> Space {
276        let space = self;
277        let space = space.ptr;
278        let isl_rs_result = unsafe { isl_space_copy(space) };
279        let isl_rs_result = Space { ptr: isl_rs_result,
280                                    should_free_on_drop: true };
281        isl_rs_result
282    }
283
284    /// Wraps `isl_space_free`.
285    pub fn free(self) -> Space {
286        let space = self;
287        let mut space = space;
288        space.do_not_free_on_drop();
289        let space = space.ptr;
290        let isl_rs_result = unsafe { isl_space_free(space) };
291        let isl_rs_result = Space { ptr: isl_rs_result,
292                                    should_free_on_drop: true };
293        isl_rs_result
294    }
295
296    /// Wraps `isl_space_is_params`.
297    pub fn is_params(&self) -> bool {
298        let space = self;
299        let space = space.ptr;
300        let isl_rs_result = unsafe { isl_space_is_params(space) };
301        let isl_rs_result = match isl_rs_result {
302            0 => false,
303            1 => true,
304            _ => panic!("Got isl_bool = -1"),
305        };
306        isl_rs_result
307    }
308
309    /// Wraps `isl_space_is_set`.
310    pub fn is_set(&self) -> bool {
311        let space = self;
312        let space = space.ptr;
313        let isl_rs_result = unsafe { isl_space_is_set(space) };
314        let isl_rs_result = match isl_rs_result {
315            0 => false,
316            1 => true,
317            _ => panic!("Got isl_bool = -1"),
318        };
319        isl_rs_result
320    }
321
322    /// Wraps `isl_space_is_map`.
323    pub fn is_map(&self) -> bool {
324        let space = self;
325        let space = space.ptr;
326        let isl_rs_result = unsafe { isl_space_is_map(space) };
327        let isl_rs_result = match isl_rs_result {
328            0 => false,
329            1 => true,
330            _ => panic!("Got isl_bool = -1"),
331        };
332        isl_rs_result
333    }
334
335    /// Wraps `isl_space_add_param_id`.
336    pub fn add_param_id(self, id: Id) -> Space {
337        let space = self;
338        let mut space = space;
339        space.do_not_free_on_drop();
340        let space = space.ptr;
341        let mut id = id;
342        id.do_not_free_on_drop();
343        let id = id.ptr;
344        let isl_rs_result = unsafe { isl_space_add_param_id(space, id) };
345        let isl_rs_result = Space { ptr: isl_rs_result,
346                                    should_free_on_drop: true };
347        isl_rs_result
348    }
349
350    /// Wraps `isl_space_set_tuple_name`.
351    pub fn set_tuple_name(self, type_: DimType, s: &str) -> Space {
352        let space = self;
353        let mut space = space;
354        space.do_not_free_on_drop();
355        let space = space.ptr;
356        let s = CString::new(s).unwrap();
357        let s = s.as_ptr();
358        let isl_rs_result = unsafe { isl_space_set_tuple_name(space, type_, s) };
359        let isl_rs_result = Space { ptr: isl_rs_result,
360                                    should_free_on_drop: true };
361        isl_rs_result
362    }
363
364    /// Wraps `isl_space_has_tuple_name`.
365    pub fn has_tuple_name(&self, type_: DimType) -> bool {
366        let space = self;
367        let space = space.ptr;
368        let isl_rs_result = unsafe { isl_space_has_tuple_name(space, type_) };
369        let isl_rs_result = match isl_rs_result {
370            0 => false,
371            1 => true,
372            _ => panic!("Got isl_bool = -1"),
373        };
374        isl_rs_result
375    }
376
377    /// Wraps `isl_space_get_tuple_name`.
378    pub fn get_tuple_name(&self, type_: DimType) -> &str {
379        let space = self;
380        let space = space.ptr;
381        let isl_rs_result = unsafe { isl_space_get_tuple_name(space, type_) };
382        let isl_rs_result = unsafe { CStr::from_ptr(isl_rs_result) };
383        let isl_rs_result = isl_rs_result.to_str().unwrap();
384        isl_rs_result
385    }
386
387    /// Wraps `isl_space_set_domain_tuple_id`.
388    pub fn set_domain_tuple_id(self, id: Id) -> Space {
389        let space = self;
390        let mut space = space;
391        space.do_not_free_on_drop();
392        let space = space.ptr;
393        let mut id = id;
394        id.do_not_free_on_drop();
395        let id = id.ptr;
396        let isl_rs_result = unsafe { isl_space_set_domain_tuple_id(space, id) };
397        let isl_rs_result = Space { ptr: isl_rs_result,
398                                    should_free_on_drop: true };
399        isl_rs_result
400    }
401
402    /// Wraps `isl_space_set_range_tuple_id`.
403    pub fn set_range_tuple_id(self, id: Id) -> Space {
404        let space = self;
405        let mut space = space;
406        space.do_not_free_on_drop();
407        let space = space.ptr;
408        let mut id = id;
409        id.do_not_free_on_drop();
410        let id = id.ptr;
411        let isl_rs_result = unsafe { isl_space_set_range_tuple_id(space, id) };
412        let isl_rs_result = Space { ptr: isl_rs_result,
413                                    should_free_on_drop: true };
414        isl_rs_result
415    }
416
417    /// Wraps `isl_space_set_tuple_id`.
418    pub fn set_tuple_id(self, type_: DimType, id: Id) -> Space {
419        let space = self;
420        let mut space = space;
421        space.do_not_free_on_drop();
422        let space = space.ptr;
423        let mut id = id;
424        id.do_not_free_on_drop();
425        let id = id.ptr;
426        let isl_rs_result = unsafe { isl_space_set_tuple_id(space, type_, id) };
427        let isl_rs_result = Space { ptr: isl_rs_result,
428                                    should_free_on_drop: true };
429        isl_rs_result
430    }
431
432    /// Wraps `isl_space_reset_tuple_id`.
433    pub fn reset_tuple_id(self, type_: DimType) -> Space {
434        let space = self;
435        let mut space = space;
436        space.do_not_free_on_drop();
437        let space = space.ptr;
438        let isl_rs_result = unsafe { isl_space_reset_tuple_id(space, type_) };
439        let isl_rs_result = Space { ptr: isl_rs_result,
440                                    should_free_on_drop: true };
441        isl_rs_result
442    }
443
444    /// Wraps `isl_space_has_domain_tuple_id`.
445    pub fn has_domain_tuple_id(&self) -> bool {
446        let space = self;
447        let space = space.ptr;
448        let isl_rs_result = unsafe { isl_space_has_domain_tuple_id(space) };
449        let isl_rs_result = match isl_rs_result {
450            0 => false,
451            1 => true,
452            _ => panic!("Got isl_bool = -1"),
453        };
454        isl_rs_result
455    }
456
457    /// Wraps `isl_space_has_range_tuple_id`.
458    pub fn has_range_tuple_id(&self) -> bool {
459        let space = self;
460        let space = space.ptr;
461        let isl_rs_result = unsafe { isl_space_has_range_tuple_id(space) };
462        let isl_rs_result = match isl_rs_result {
463            0 => false,
464            1 => true,
465            _ => panic!("Got isl_bool = -1"),
466        };
467        isl_rs_result
468    }
469
470    /// Wraps `isl_space_has_tuple_id`.
471    pub fn has_tuple_id(&self, type_: DimType) -> bool {
472        let space = self;
473        let space = space.ptr;
474        let isl_rs_result = unsafe { isl_space_has_tuple_id(space, type_) };
475        let isl_rs_result = match isl_rs_result {
476            0 => false,
477            1 => true,
478            _ => panic!("Got isl_bool = -1"),
479        };
480        isl_rs_result
481    }
482
483    /// Wraps `isl_space_get_domain_tuple_id`.
484    pub fn get_domain_tuple_id(&self) -> Id {
485        let space = self;
486        let space = space.ptr;
487        let isl_rs_result = unsafe { isl_space_get_domain_tuple_id(space) };
488        let isl_rs_result = Id { ptr: isl_rs_result,
489                                 should_free_on_drop: true };
490        isl_rs_result
491    }
492
493    /// Wraps `isl_space_get_range_tuple_id`.
494    pub fn get_range_tuple_id(&self) -> Id {
495        let space = self;
496        let space = space.ptr;
497        let isl_rs_result = unsafe { isl_space_get_range_tuple_id(space) };
498        let isl_rs_result = Id { ptr: isl_rs_result,
499                                 should_free_on_drop: true };
500        isl_rs_result
501    }
502
503    /// Wraps `isl_space_get_tuple_id`.
504    pub fn get_tuple_id(&self, type_: DimType) -> Id {
505        let space = self;
506        let space = space.ptr;
507        let isl_rs_result = unsafe { isl_space_get_tuple_id(space, type_) };
508        let isl_rs_result = Id { ptr: isl_rs_result,
509                                 should_free_on_drop: true };
510        isl_rs_result
511    }
512
513    /// Wraps `isl_space_reset_user`.
514    pub fn reset_user(self) -> Space {
515        let space = self;
516        let mut space = space;
517        space.do_not_free_on_drop();
518        let space = space.ptr;
519        let isl_rs_result = unsafe { isl_space_reset_user(space) };
520        let isl_rs_result = Space { ptr: isl_rs_result,
521                                    should_free_on_drop: true };
522        isl_rs_result
523    }
524
525    /// Wraps `isl_space_set_dim_id`.
526    pub fn set_dim_id(self, type_: DimType, pos: u32, id: Id) -> Space {
527        let space = self;
528        let mut space = space;
529        space.do_not_free_on_drop();
530        let space = space.ptr;
531        let mut id = id;
532        id.do_not_free_on_drop();
533        let id = id.ptr;
534        let isl_rs_result = unsafe { isl_space_set_dim_id(space, type_, pos, id) };
535        let isl_rs_result = Space { ptr: isl_rs_result,
536                                    should_free_on_drop: true };
537        isl_rs_result
538    }
539
540    /// Wraps `isl_space_has_dim_id`.
541    pub fn has_dim_id(&self, type_: DimType, pos: u32) -> bool {
542        let space = self;
543        let space = space.ptr;
544        let isl_rs_result = unsafe { isl_space_has_dim_id(space, type_, pos) };
545        let isl_rs_result = match isl_rs_result {
546            0 => false,
547            1 => true,
548            _ => panic!("Got isl_bool = -1"),
549        };
550        isl_rs_result
551    }
552
553    /// Wraps `isl_space_get_dim_id`.
554    pub fn get_dim_id(&self, type_: DimType, pos: u32) -> Id {
555        let space = self;
556        let space = space.ptr;
557        let isl_rs_result = unsafe { isl_space_get_dim_id(space, type_, pos) };
558        let isl_rs_result = Id { ptr: isl_rs_result,
559                                 should_free_on_drop: true };
560        isl_rs_result
561    }
562
563    /// Wraps `isl_space_find_dim_by_id`.
564    pub fn find_dim_by_id(&self, type_: DimType, id: &Id) -> i32 {
565        let space = self;
566        let space = space.ptr;
567        let id = id.ptr;
568        let isl_rs_result = unsafe { isl_space_find_dim_by_id(space, type_, id) };
569        isl_rs_result
570    }
571
572    /// Wraps `isl_space_find_dim_by_name`.
573    pub fn find_dim_by_name(&self, type_: DimType, name: &str) -> i32 {
574        let space = self;
575        let space = space.ptr;
576        let name = CString::new(name).unwrap();
577        let name = name.as_ptr();
578        let isl_rs_result = unsafe { isl_space_find_dim_by_name(space, type_, name) };
579        isl_rs_result
580    }
581
582    /// Wraps `isl_space_has_dim_name`.
583    pub fn has_dim_name(&self, type_: DimType, pos: u32) -> bool {
584        let space = self;
585        let space = space.ptr;
586        let isl_rs_result = unsafe { isl_space_has_dim_name(space, type_, pos) };
587        let isl_rs_result = match isl_rs_result {
588            0 => false,
589            1 => true,
590            _ => panic!("Got isl_bool = -1"),
591        };
592        isl_rs_result
593    }
594
595    /// Wraps `isl_space_set_dim_name`.
596    pub fn set_dim_name(self, type_: DimType, pos: u32, name: &str) -> Space {
597        let space = self;
598        let mut space = space;
599        space.do_not_free_on_drop();
600        let space = space.ptr;
601        let name = CString::new(name).unwrap();
602        let name = name.as_ptr();
603        let isl_rs_result = unsafe { isl_space_set_dim_name(space, type_, pos, name) };
604        let isl_rs_result = Space { ptr: isl_rs_result,
605                                    should_free_on_drop: true };
606        isl_rs_result
607    }
608
609    /// Wraps `isl_space_get_dim_name`.
610    pub fn get_dim_name(&self, type_: DimType, pos: u32) -> &str {
611        let space = self;
612        let space = space.ptr;
613        let isl_rs_result = unsafe { isl_space_get_dim_name(space, type_, pos) };
614        let isl_rs_result = unsafe { CStr::from_ptr(isl_rs_result) };
615        let isl_rs_result = isl_rs_result.to_str().unwrap();
616        isl_rs_result
617    }
618
619    /// Wraps `isl_space_extend`.
620    pub fn extend(self, nparam: u32, n_in: u32, n_out: u32) -> Space {
621        let space = self;
622        let mut space = space;
623        space.do_not_free_on_drop();
624        let space = space.ptr;
625        let isl_rs_result = unsafe { isl_space_extend(space, nparam, n_in, n_out) };
626        let isl_rs_result = Space { ptr: isl_rs_result,
627                                    should_free_on_drop: true };
628        isl_rs_result
629    }
630
631    /// Wraps `isl_space_add_dims`.
632    pub fn add_dims(self, type_: DimType, n: u32) -> Space {
633        let space = self;
634        let mut space = space;
635        space.do_not_free_on_drop();
636        let space = space.ptr;
637        let isl_rs_result = unsafe { isl_space_add_dims(space, type_, n) };
638        let isl_rs_result = Space { ptr: isl_rs_result,
639                                    should_free_on_drop: true };
640        isl_rs_result
641    }
642
643    /// Wraps `isl_space_move_dims`.
644    pub fn move_dims(self, dst_type: DimType, dst_pos: u32, src_type: DimType, src_pos: u32,
645                     n: u32)
646                     -> Space {
647        let space = self;
648        let mut space = space;
649        space.do_not_free_on_drop();
650        let space = space.ptr;
651        let isl_rs_result =
652            unsafe { isl_space_move_dims(space, dst_type, dst_pos, src_type, src_pos, n) };
653        let isl_rs_result = Space { ptr: isl_rs_result,
654                                    should_free_on_drop: true };
655        isl_rs_result
656    }
657
658    /// Wraps `isl_space_insert_dims`.
659    pub fn insert_dims(self, type_: DimType, pos: u32, n: u32) -> Space {
660        let space = self;
661        let mut space = space;
662        space.do_not_free_on_drop();
663        let space = space.ptr;
664        let isl_rs_result = unsafe { isl_space_insert_dims(space, type_, pos, n) };
665        let isl_rs_result = Space { ptr: isl_rs_result,
666                                    should_free_on_drop: true };
667        isl_rs_result
668    }
669
670    /// Wraps `isl_space_join`.
671    pub fn join(self, right: Space) -> Space {
672        let left = self;
673        let mut left = left;
674        left.do_not_free_on_drop();
675        let left = left.ptr;
676        let mut right = right;
677        right.do_not_free_on_drop();
678        let right = right.ptr;
679        let isl_rs_result = unsafe { isl_space_join(left, right) };
680        let isl_rs_result = Space { ptr: isl_rs_result,
681                                    should_free_on_drop: true };
682        isl_rs_result
683    }
684
685    /// Wraps `isl_space_product`.
686    pub fn product(self, right: Space) -> Space {
687        let left = self;
688        let mut left = left;
689        left.do_not_free_on_drop();
690        let left = left.ptr;
691        let mut right = right;
692        right.do_not_free_on_drop();
693        let right = right.ptr;
694        let isl_rs_result = unsafe { isl_space_product(left, right) };
695        let isl_rs_result = Space { ptr: isl_rs_result,
696                                    should_free_on_drop: true };
697        isl_rs_result
698    }
699
700    /// Wraps `isl_space_domain_product`.
701    pub fn domain_product(self, right: Space) -> Space {
702        let left = self;
703        let mut left = left;
704        left.do_not_free_on_drop();
705        let left = left.ptr;
706        let mut right = right;
707        right.do_not_free_on_drop();
708        let right = right.ptr;
709        let isl_rs_result = unsafe { isl_space_domain_product(left, right) };
710        let isl_rs_result = Space { ptr: isl_rs_result,
711                                    should_free_on_drop: true };
712        isl_rs_result
713    }
714
715    /// Wraps `isl_space_range_product`.
716    pub fn range_product(self, right: Space) -> Space {
717        let left = self;
718        let mut left = left;
719        left.do_not_free_on_drop();
720        let left = left.ptr;
721        let mut right = right;
722        right.do_not_free_on_drop();
723        let right = right.ptr;
724        let isl_rs_result = unsafe { isl_space_range_product(left, right) };
725        let isl_rs_result = Space { ptr: isl_rs_result,
726                                    should_free_on_drop: true };
727        isl_rs_result
728    }
729
730    /// Wraps `isl_space_factor_domain`.
731    pub fn factor_domain(self) -> Space {
732        let space = self;
733        let mut space = space;
734        space.do_not_free_on_drop();
735        let space = space.ptr;
736        let isl_rs_result = unsafe { isl_space_factor_domain(space) };
737        let isl_rs_result = Space { ptr: isl_rs_result,
738                                    should_free_on_drop: true };
739        isl_rs_result
740    }
741
742    /// Wraps `isl_space_factor_range`.
743    pub fn factor_range(self) -> Space {
744        let space = self;
745        let mut space = space;
746        space.do_not_free_on_drop();
747        let space = space.ptr;
748        let isl_rs_result = unsafe { isl_space_factor_range(space) };
749        let isl_rs_result = Space { ptr: isl_rs_result,
750                                    should_free_on_drop: true };
751        isl_rs_result
752    }
753
754    /// Wraps `isl_space_domain_factor_domain`.
755    pub fn domain_factor_domain(self) -> Space {
756        let space = self;
757        let mut space = space;
758        space.do_not_free_on_drop();
759        let space = space.ptr;
760        let isl_rs_result = unsafe { isl_space_domain_factor_domain(space) };
761        let isl_rs_result = Space { ptr: isl_rs_result,
762                                    should_free_on_drop: true };
763        isl_rs_result
764    }
765
766    /// Wraps `isl_space_domain_factor_range`.
767    pub fn domain_factor_range(self) -> Space {
768        let space = self;
769        let mut space = space;
770        space.do_not_free_on_drop();
771        let space = space.ptr;
772        let isl_rs_result = unsafe { isl_space_domain_factor_range(space) };
773        let isl_rs_result = Space { ptr: isl_rs_result,
774                                    should_free_on_drop: true };
775        isl_rs_result
776    }
777
778    /// Wraps `isl_space_range_factor_domain`.
779    pub fn range_factor_domain(self) -> Space {
780        let space = self;
781        let mut space = space;
782        space.do_not_free_on_drop();
783        let space = space.ptr;
784        let isl_rs_result = unsafe { isl_space_range_factor_domain(space) };
785        let isl_rs_result = Space { ptr: isl_rs_result,
786                                    should_free_on_drop: true };
787        isl_rs_result
788    }
789
790    /// Wraps `isl_space_range_factor_range`.
791    pub fn range_factor_range(self) -> Space {
792        let space = self;
793        let mut space = space;
794        space.do_not_free_on_drop();
795        let space = space.ptr;
796        let isl_rs_result = unsafe { isl_space_range_factor_range(space) };
797        let isl_rs_result = Space { ptr: isl_rs_result,
798                                    should_free_on_drop: true };
799        isl_rs_result
800    }
801
802    /// Wraps `isl_space_domain_wrapped_domain`.
803    pub fn domain_wrapped_domain(self) -> Space {
804        let space = self;
805        let mut space = space;
806        space.do_not_free_on_drop();
807        let space = space.ptr;
808        let isl_rs_result = unsafe { isl_space_domain_wrapped_domain(space) };
809        let isl_rs_result = Space { ptr: isl_rs_result,
810                                    should_free_on_drop: true };
811        isl_rs_result
812    }
813
814    /// Wraps `isl_space_domain_wrapped_range`.
815    pub fn domain_wrapped_range(self) -> Space {
816        let space = self;
817        let mut space = space;
818        space.do_not_free_on_drop();
819        let space = space.ptr;
820        let isl_rs_result = unsafe { isl_space_domain_wrapped_range(space) };
821        let isl_rs_result = Space { ptr: isl_rs_result,
822                                    should_free_on_drop: true };
823        isl_rs_result
824    }
825
826    /// Wraps `isl_space_range_wrapped_domain`.
827    pub fn range_wrapped_domain(self) -> Space {
828        let space = self;
829        let mut space = space;
830        space.do_not_free_on_drop();
831        let space = space.ptr;
832        let isl_rs_result = unsafe { isl_space_range_wrapped_domain(space) };
833        let isl_rs_result = Space { ptr: isl_rs_result,
834                                    should_free_on_drop: true };
835        isl_rs_result
836    }
837
838    /// Wraps `isl_space_range_wrapped_range`.
839    pub fn range_wrapped_range(self) -> Space {
840        let space = self;
841        let mut space = space;
842        space.do_not_free_on_drop();
843        let space = space.ptr;
844        let isl_rs_result = unsafe { isl_space_range_wrapped_range(space) };
845        let isl_rs_result = Space { ptr: isl_rs_result,
846                                    should_free_on_drop: true };
847        isl_rs_result
848    }
849
850    /// Wraps `isl_space_map_from_set`.
851    pub fn map_from_set(self) -> Space {
852        let space = self;
853        let mut space = space;
854        space.do_not_free_on_drop();
855        let space = space.ptr;
856        let isl_rs_result = unsafe { isl_space_map_from_set(space) };
857        let isl_rs_result = Space { ptr: isl_rs_result,
858                                    should_free_on_drop: true };
859        isl_rs_result
860    }
861
862    /// Wraps `isl_space_map_from_domain_and_range`.
863    pub fn map_from_domain_and_range(self, range: Space) -> Space {
864        let domain = self;
865        let mut domain = domain;
866        domain.do_not_free_on_drop();
867        let domain = domain.ptr;
868        let mut range = range;
869        range.do_not_free_on_drop();
870        let range = range.ptr;
871        let isl_rs_result = unsafe { isl_space_map_from_domain_and_range(domain, range) };
872        let isl_rs_result = Space { ptr: isl_rs_result,
873                                    should_free_on_drop: true };
874        isl_rs_result
875    }
876
877    /// Wraps `isl_space_reverse`.
878    pub fn reverse(self) -> Space {
879        let space = self;
880        let mut space = space;
881        space.do_not_free_on_drop();
882        let space = space.ptr;
883        let isl_rs_result = unsafe { isl_space_reverse(space) };
884        let isl_rs_result = Space { ptr: isl_rs_result,
885                                    should_free_on_drop: true };
886        isl_rs_result
887    }
888
889    /// Wraps `isl_space_wrapped_reverse`.
890    pub fn wrapped_reverse(self) -> Space {
891        let space = self;
892        let mut space = space;
893        space.do_not_free_on_drop();
894        let space = space.ptr;
895        let isl_rs_result = unsafe { isl_space_wrapped_reverse(space) };
896        let isl_rs_result = Space { ptr: isl_rs_result,
897                                    should_free_on_drop: true };
898        isl_rs_result
899    }
900
901    /// Wraps `isl_space_domain_reverse`.
902    pub fn domain_reverse(self) -> Space {
903        let space = self;
904        let mut space = space;
905        space.do_not_free_on_drop();
906        let space = space.ptr;
907        let isl_rs_result = unsafe { isl_space_domain_reverse(space) };
908        let isl_rs_result = Space { ptr: isl_rs_result,
909                                    should_free_on_drop: true };
910        isl_rs_result
911    }
912
913    /// Wraps `isl_space_range_reverse`.
914    pub fn range_reverse(self) -> Space {
915        let space = self;
916        let mut space = space;
917        space.do_not_free_on_drop();
918        let space = space.ptr;
919        let isl_rs_result = unsafe { isl_space_range_reverse(space) };
920        let isl_rs_result = Space { ptr: isl_rs_result,
921                                    should_free_on_drop: true };
922        isl_rs_result
923    }
924
925    /// Wraps `isl_space_drop_dims`.
926    pub fn drop_dims(self, type_: DimType, first: u32, num: u32) -> Space {
927        let space = self;
928        let mut space = space;
929        space.do_not_free_on_drop();
930        let space = space.ptr;
931        let isl_rs_result = unsafe { isl_space_drop_dims(space, type_, first, num) };
932        let isl_rs_result = Space { ptr: isl_rs_result,
933                                    should_free_on_drop: true };
934        isl_rs_result
935    }
936
937    /// Wraps `isl_space_drop_inputs`.
938    pub fn drop_inputs(self, first: u32, n: u32) -> Space {
939        let space = self;
940        let mut space = space;
941        space.do_not_free_on_drop();
942        let space = space.ptr;
943        let isl_rs_result = unsafe { isl_space_drop_inputs(space, first, n) };
944        let isl_rs_result = Space { ptr: isl_rs_result,
945                                    should_free_on_drop: true };
946        isl_rs_result
947    }
948
949    /// Wraps `isl_space_drop_outputs`.
950    pub fn drop_outputs(self, first: u32, n: u32) -> Space {
951        let space = self;
952        let mut space = space;
953        space.do_not_free_on_drop();
954        let space = space.ptr;
955        let isl_rs_result = unsafe { isl_space_drop_outputs(space, first, n) };
956        let isl_rs_result = Space { ptr: isl_rs_result,
957                                    should_free_on_drop: true };
958        isl_rs_result
959    }
960
961    /// Wraps `isl_space_drop_all_params`.
962    pub fn drop_all_params(self) -> Space {
963        let space = self;
964        let mut space = space;
965        space.do_not_free_on_drop();
966        let space = space.ptr;
967        let isl_rs_result = unsafe { isl_space_drop_all_params(space) };
968        let isl_rs_result = Space { ptr: isl_rs_result,
969                                    should_free_on_drop: true };
970        isl_rs_result
971    }
972
973    /// Wraps `isl_space_domain`.
974    pub fn domain(self) -> Space {
975        let space = self;
976        let mut space = space;
977        space.do_not_free_on_drop();
978        let space = space.ptr;
979        let isl_rs_result = unsafe { isl_space_domain(space) };
980        let isl_rs_result = Space { ptr: isl_rs_result,
981                                    should_free_on_drop: true };
982        isl_rs_result
983    }
984
985    /// Wraps `isl_space_from_domain`.
986    pub fn from_domain(self) -> Space {
987        let space = self;
988        let mut space = space;
989        space.do_not_free_on_drop();
990        let space = space.ptr;
991        let isl_rs_result = unsafe { isl_space_from_domain(space) };
992        let isl_rs_result = Space { ptr: isl_rs_result,
993                                    should_free_on_drop: true };
994        isl_rs_result
995    }
996
997    /// Wraps `isl_space_range`.
998    pub fn range(self) -> Space {
999        let space = self;
1000        let mut space = space;
1001        space.do_not_free_on_drop();
1002        let space = space.ptr;
1003        let isl_rs_result = unsafe { isl_space_range(space) };
1004        let isl_rs_result = Space { ptr: isl_rs_result,
1005                                    should_free_on_drop: true };
1006        isl_rs_result
1007    }
1008
1009    /// Wraps `isl_space_from_range`.
1010    pub fn from_range(self) -> Space {
1011        let space = self;
1012        let mut space = space;
1013        space.do_not_free_on_drop();
1014        let space = space.ptr;
1015        let isl_rs_result = unsafe { isl_space_from_range(space) };
1016        let isl_rs_result = Space { ptr: isl_rs_result,
1017                                    should_free_on_drop: true };
1018        isl_rs_result
1019    }
1020
1021    /// Wraps `isl_space_domain_map`.
1022    pub fn domain_map(self) -> Space {
1023        let space = self;
1024        let mut space = space;
1025        space.do_not_free_on_drop();
1026        let space = space.ptr;
1027        let isl_rs_result = unsafe { isl_space_domain_map(space) };
1028        let isl_rs_result = Space { ptr: isl_rs_result,
1029                                    should_free_on_drop: true };
1030        isl_rs_result
1031    }
1032
1033    /// Wraps `isl_space_range_map`.
1034    pub fn range_map(self) -> Space {
1035        let space = self;
1036        let mut space = space;
1037        space.do_not_free_on_drop();
1038        let space = space.ptr;
1039        let isl_rs_result = unsafe { isl_space_range_map(space) };
1040        let isl_rs_result = Space { ptr: isl_rs_result,
1041                                    should_free_on_drop: true };
1042        isl_rs_result
1043    }
1044
1045    /// Wraps `isl_space_params`.
1046    pub fn params(self) -> Space {
1047        let space = self;
1048        let mut space = space;
1049        space.do_not_free_on_drop();
1050        let space = space.ptr;
1051        let isl_rs_result = unsafe { isl_space_params(space) };
1052        let isl_rs_result = Space { ptr: isl_rs_result,
1053                                    should_free_on_drop: true };
1054        isl_rs_result
1055    }
1056
1057    /// Wraps `isl_space_add_unnamed_tuple_ui`.
1058    pub fn add_unnamed_tuple_ui(self, dim: u32) -> Space {
1059        let space = self;
1060        let mut space = space;
1061        space.do_not_free_on_drop();
1062        let space = space.ptr;
1063        let isl_rs_result = unsafe { isl_space_add_unnamed_tuple_ui(space, dim) };
1064        let isl_rs_result = Space { ptr: isl_rs_result,
1065                                    should_free_on_drop: true };
1066        isl_rs_result
1067    }
1068
1069    /// Wraps `isl_space_add_named_tuple_id_ui`.
1070    pub fn add_named_tuple_id_ui(self, tuple_id: Id, dim: u32) -> Space {
1071        let space = self;
1072        let mut space = space;
1073        space.do_not_free_on_drop();
1074        let space = space.ptr;
1075        let mut tuple_id = tuple_id;
1076        tuple_id.do_not_free_on_drop();
1077        let tuple_id = tuple_id.ptr;
1078        let isl_rs_result = unsafe { isl_space_add_named_tuple_id_ui(space, tuple_id, dim) };
1079        let isl_rs_result = Space { ptr: isl_rs_result,
1080                                    should_free_on_drop: true };
1081        isl_rs_result
1082    }
1083
1084    /// Wraps `isl_space_set_from_params`.
1085    pub fn set_from_params(self) -> Space {
1086        let space = self;
1087        let mut space = space;
1088        space.do_not_free_on_drop();
1089        let space = space.ptr;
1090        let isl_rs_result = unsafe { isl_space_set_from_params(space) };
1091        let isl_rs_result = Space { ptr: isl_rs_result,
1092                                    should_free_on_drop: true };
1093        isl_rs_result
1094    }
1095
1096    /// Wraps `isl_space_align_params`.
1097    pub fn align_params(self, space2: Space) -> Space {
1098        let space1 = self;
1099        let mut space1 = space1;
1100        space1.do_not_free_on_drop();
1101        let space1 = space1.ptr;
1102        let mut space2 = space2;
1103        space2.do_not_free_on_drop();
1104        let space2 = space2.ptr;
1105        let isl_rs_result = unsafe { isl_space_align_params(space1, space2) };
1106        let isl_rs_result = Space { ptr: isl_rs_result,
1107                                    should_free_on_drop: true };
1108        isl_rs_result
1109    }
1110
1111    /// Wraps `isl_space_is_wrapping`.
1112    pub fn is_wrapping(&self) -> bool {
1113        let space = self;
1114        let space = space.ptr;
1115        let isl_rs_result = unsafe { isl_space_is_wrapping(space) };
1116        let isl_rs_result = match isl_rs_result {
1117            0 => false,
1118            1 => true,
1119            _ => panic!("Got isl_bool = -1"),
1120        };
1121        isl_rs_result
1122    }
1123
1124    /// Wraps `isl_space_domain_is_wrapping`.
1125    pub fn domain_is_wrapping(&self) -> bool {
1126        let space = self;
1127        let space = space.ptr;
1128        let isl_rs_result = unsafe { isl_space_domain_is_wrapping(space) };
1129        let isl_rs_result = match isl_rs_result {
1130            0 => false,
1131            1 => true,
1132            _ => panic!("Got isl_bool = -1"),
1133        };
1134        isl_rs_result
1135    }
1136
1137    /// Wraps `isl_space_range_is_wrapping`.
1138    pub fn range_is_wrapping(&self) -> bool {
1139        let space = self;
1140        let space = space.ptr;
1141        let isl_rs_result = unsafe { isl_space_range_is_wrapping(space) };
1142        let isl_rs_result = match isl_rs_result {
1143            0 => false,
1144            1 => true,
1145            _ => panic!("Got isl_bool = -1"),
1146        };
1147        isl_rs_result
1148    }
1149
1150    /// Wraps `isl_space_is_product`.
1151    pub fn is_product(&self) -> bool {
1152        let space = self;
1153        let space = space.ptr;
1154        let isl_rs_result = unsafe { isl_space_is_product(space) };
1155        let isl_rs_result = match isl_rs_result {
1156            0 => false,
1157            1 => true,
1158            _ => panic!("Got isl_bool = -1"),
1159        };
1160        isl_rs_result
1161    }
1162
1163    /// Wraps `isl_space_wrap`.
1164    pub fn wrap(self) -> Space {
1165        let space = self;
1166        let mut space = space;
1167        space.do_not_free_on_drop();
1168        let space = space.ptr;
1169        let isl_rs_result = unsafe { isl_space_wrap(space) };
1170        let isl_rs_result = Space { ptr: isl_rs_result,
1171                                    should_free_on_drop: true };
1172        isl_rs_result
1173    }
1174
1175    /// Wraps `isl_space_unwrap`.
1176    pub fn unwrap(self) -> Space {
1177        let space = self;
1178        let mut space = space;
1179        space.do_not_free_on_drop();
1180        let space = space.ptr;
1181        let isl_rs_result = unsafe { isl_space_unwrap(space) };
1182        let isl_rs_result = Space { ptr: isl_rs_result,
1183                                    should_free_on_drop: true };
1184        isl_rs_result
1185    }
1186
1187    /// Wraps `isl_space_can_zip`.
1188    pub fn can_zip(&self) -> bool {
1189        let space = self;
1190        let space = space.ptr;
1191        let isl_rs_result = unsafe { isl_space_can_zip(space) };
1192        let isl_rs_result = match isl_rs_result {
1193            0 => false,
1194            1 => true,
1195            _ => panic!("Got isl_bool = -1"),
1196        };
1197        isl_rs_result
1198    }
1199
1200    /// Wraps `isl_space_zip`.
1201    pub fn zip(self) -> Space {
1202        let space = self;
1203        let mut space = space;
1204        space.do_not_free_on_drop();
1205        let space = space.ptr;
1206        let isl_rs_result = unsafe { isl_space_zip(space) };
1207        let isl_rs_result = Space { ptr: isl_rs_result,
1208                                    should_free_on_drop: true };
1209        isl_rs_result
1210    }
1211
1212    /// Wraps `isl_space_can_curry`.
1213    pub fn can_curry(&self) -> bool {
1214        let space = self;
1215        let space = space.ptr;
1216        let isl_rs_result = unsafe { isl_space_can_curry(space) };
1217        let isl_rs_result = match isl_rs_result {
1218            0 => false,
1219            1 => true,
1220            _ => panic!("Got isl_bool = -1"),
1221        };
1222        isl_rs_result
1223    }
1224
1225    /// Wraps `isl_space_curry`.
1226    pub fn curry(self) -> Space {
1227        let space = self;
1228        let mut space = space;
1229        space.do_not_free_on_drop();
1230        let space = space.ptr;
1231        let isl_rs_result = unsafe { isl_space_curry(space) };
1232        let isl_rs_result = Space { ptr: isl_rs_result,
1233                                    should_free_on_drop: true };
1234        isl_rs_result
1235    }
1236
1237    /// Wraps `isl_space_can_range_curry`.
1238    pub fn can_range_curry(&self) -> bool {
1239        let space = self;
1240        let space = space.ptr;
1241        let isl_rs_result = unsafe { isl_space_can_range_curry(space) };
1242        let isl_rs_result = match isl_rs_result {
1243            0 => false,
1244            1 => true,
1245            _ => panic!("Got isl_bool = -1"),
1246        };
1247        isl_rs_result
1248    }
1249
1250    /// Wraps `isl_space_range_curry`.
1251    pub fn range_curry(self) -> Space {
1252        let space = self;
1253        let mut space = space;
1254        space.do_not_free_on_drop();
1255        let space = space.ptr;
1256        let isl_rs_result = unsafe { isl_space_range_curry(space) };
1257        let isl_rs_result = Space { ptr: isl_rs_result,
1258                                    should_free_on_drop: true };
1259        isl_rs_result
1260    }
1261
1262    /// Wraps `isl_space_can_uncurry`.
1263    pub fn can_uncurry(&self) -> bool {
1264        let space = self;
1265        let space = space.ptr;
1266        let isl_rs_result = unsafe { isl_space_can_uncurry(space) };
1267        let isl_rs_result = match isl_rs_result {
1268            0 => false,
1269            1 => true,
1270            _ => panic!("Got isl_bool = -1"),
1271        };
1272        isl_rs_result
1273    }
1274
1275    /// Wraps `isl_space_uncurry`.
1276    pub fn uncurry(self) -> Space {
1277        let space = self;
1278        let mut space = space;
1279        space.do_not_free_on_drop();
1280        let space = space.ptr;
1281        let isl_rs_result = unsafe { isl_space_uncurry(space) };
1282        let isl_rs_result = Space { ptr: isl_rs_result,
1283                                    should_free_on_drop: true };
1284        isl_rs_result
1285    }
1286
1287    /// Wraps `isl_space_is_domain`.
1288    pub fn is_domain(&self, space2: &Space) -> bool {
1289        let space1 = self;
1290        let space1 = space1.ptr;
1291        let space2 = space2.ptr;
1292        let isl_rs_result = unsafe { isl_space_is_domain(space1, space2) };
1293        let isl_rs_result = match isl_rs_result {
1294            0 => false,
1295            1 => true,
1296            _ => panic!("Got isl_bool = -1"),
1297        };
1298        isl_rs_result
1299    }
1300
1301    /// Wraps `isl_space_is_range`.
1302    pub fn is_range(&self, space2: &Space) -> bool {
1303        let space1 = self;
1304        let space1 = space1.ptr;
1305        let space2 = space2.ptr;
1306        let isl_rs_result = unsafe { isl_space_is_range(space1, space2) };
1307        let isl_rs_result = match isl_rs_result {
1308            0 => false,
1309            1 => true,
1310            _ => panic!("Got isl_bool = -1"),
1311        };
1312        isl_rs_result
1313    }
1314
1315    /// Wraps `isl_space_is_equal`.
1316    pub fn is_equal(&self, space2: &Space) -> bool {
1317        let space1 = self;
1318        let space1 = space1.ptr;
1319        let space2 = space2.ptr;
1320        let isl_rs_result = unsafe { isl_space_is_equal(space1, space2) };
1321        let isl_rs_result = match isl_rs_result {
1322            0 => false,
1323            1 => true,
1324            _ => panic!("Got isl_bool = -1"),
1325        };
1326        isl_rs_result
1327    }
1328
1329    /// Wraps `isl_space_has_equal_params`.
1330    pub fn has_equal_params(&self, space2: &Space) -> bool {
1331        let space1 = self;
1332        let space1 = space1.ptr;
1333        let space2 = space2.ptr;
1334        let isl_rs_result = unsafe { isl_space_has_equal_params(space1, space2) };
1335        let isl_rs_result = match isl_rs_result {
1336            0 => false,
1337            1 => true,
1338            _ => panic!("Got isl_bool = -1"),
1339        };
1340        isl_rs_result
1341    }
1342
1343    /// Wraps `isl_space_has_equal_tuples`.
1344    pub fn has_equal_tuples(&self, space2: &Space) -> bool {
1345        let space1 = self;
1346        let space1 = space1.ptr;
1347        let space2 = space2.ptr;
1348        let isl_rs_result = unsafe { isl_space_has_equal_tuples(space1, space2) };
1349        let isl_rs_result = match isl_rs_result {
1350            0 => false,
1351            1 => true,
1352            _ => panic!("Got isl_bool = -1"),
1353        };
1354        isl_rs_result
1355    }
1356
1357    /// Wraps `isl_space_tuple_is_equal`.
1358    pub fn tuple_is_equal(&self, type1: DimType, space2: &Space, type2: DimType) -> bool {
1359        let space1 = self;
1360        let space1 = space1.ptr;
1361        let space2 = space2.ptr;
1362        let isl_rs_result = unsafe { isl_space_tuple_is_equal(space1, type1, space2, type2) };
1363        let isl_rs_result = match isl_rs_result {
1364            0 => false,
1365            1 => true,
1366            _ => panic!("Got isl_bool = -1"),
1367        };
1368        isl_rs_result
1369    }
1370
1371    /// Wraps `isl_space_match`.
1372    pub fn match_(&self, type1: DimType, space2: &Space, type2: DimType) -> bool {
1373        let space1 = self;
1374        let space1 = space1.ptr;
1375        let space2 = space2.ptr;
1376        let isl_rs_result = unsafe { isl_space_match(space1, type1, space2, type2) };
1377        let isl_rs_result = match isl_rs_result {
1378            0 => false,
1379            1 => true,
1380            _ => panic!("Got isl_bool = -1"),
1381        };
1382        isl_rs_result
1383    }
1384
1385    /// Wraps `isl_space_dim`.
1386    pub fn dim(&self, type_: DimType) -> i32 {
1387        let space = self;
1388        let space = space.ptr;
1389        let isl_rs_result = unsafe { isl_space_dim(space, type_) };
1390        isl_rs_result
1391    }
1392
1393    /// Wraps `isl_space_flatten_domain`.
1394    pub fn flatten_domain(self) -> Space {
1395        let space = self;
1396        let mut space = space;
1397        space.do_not_free_on_drop();
1398        let space = space.ptr;
1399        let isl_rs_result = unsafe { isl_space_flatten_domain(space) };
1400        let isl_rs_result = Space { ptr: isl_rs_result,
1401                                    should_free_on_drop: true };
1402        isl_rs_result
1403    }
1404
1405    /// Wraps `isl_space_flatten_range`.
1406    pub fn flatten_range(self) -> Space {
1407        let space = self;
1408        let mut space = space;
1409        space.do_not_free_on_drop();
1410        let space = space.ptr;
1411        let isl_rs_result = unsafe { isl_space_flatten_range(space) };
1412        let isl_rs_result = Space { ptr: isl_rs_result,
1413                                    should_free_on_drop: true };
1414        isl_rs_result
1415    }
1416
1417    /// Wraps `isl_space_read_from_str`.
1418    pub fn read_from_str(ctx: &Context, str_: &str) -> Space {
1419        let ctx = ctx.ptr;
1420        let str_ = CString::new(str_).unwrap();
1421        let str_ = str_.as_ptr();
1422        let isl_rs_result = unsafe { isl_space_read_from_str(ctx, str_) };
1423        let isl_rs_result = Space { ptr: isl_rs_result,
1424                                    should_free_on_drop: true };
1425        isl_rs_result
1426    }
1427
1428    /// Wraps `isl_space_to_str`.
1429    pub fn to_str(&self) -> &str {
1430        let space = self;
1431        let space = space.ptr;
1432        let isl_rs_result = unsafe { isl_space_to_str(space) };
1433        let isl_rs_result = unsafe { CStr::from_ptr(isl_rs_result) };
1434        let isl_rs_result = isl_rs_result.to_str().unwrap();
1435        isl_rs_result
1436    }
1437
1438    /// Wraps `isl_space_dump`.
1439    pub fn dump(&self) {
1440        let space = self;
1441        let space = space.ptr;
1442        let isl_rs_result = unsafe { isl_space_dump(space) };
1443        isl_rs_result
1444    }
1445
1446    /// Does not call isl_xxx_free() on being dropped. (For internal use only.)
1447    pub fn do_not_free_on_drop(&mut self) {
1448        self.should_free_on_drop = false;
1449    }
1450}
1451
1452impl Drop for Space {
1453    fn drop(&mut self) {
1454        if self.should_free_on_drop {
1455            unsafe {
1456                isl_space_free(self.ptr);
1457            }
1458        }
1459    }
1460}