freenectrs 0.1.0

A rust wrapper for libfreenect
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
// automatically generated by rust-bindgen

#![allow(dead_code,
         non_camel_case_types,
         non_upper_case_globals,
         non_snake_case)]
pub type int8_t = i8;
pub type int16_t = i16;
pub type int32_t = i32;
pub type int64_t = i64;
pub type uint8_t = u8;
pub type uint16_t = u16;
pub type uint32_t = u32;
pub type uint64_t = u64;
pub type int_least8_t = int8_t;
pub type int_least16_t = int16_t;
pub type int_least32_t = int32_t;
pub type int_least64_t = int64_t;
pub type uint_least8_t = uint8_t;
pub type uint_least16_t = uint16_t;
pub type uint_least32_t = uint32_t;
pub type uint_least64_t = uint64_t;
pub type int_fast8_t = int8_t;
pub type int_fast16_t = int16_t;
pub type int_fast32_t = int32_t;
pub type int_fast64_t = int64_t;
pub type uint_fast8_t = uint8_t;
pub type uint_fast16_t = uint16_t;
pub type uint_fast32_t = uint32_t;
pub type uint_fast64_t = uint64_t;
pub type __int8_t = ::std::os::raw::c_char;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_longlong;
pub type __uint64_t = ::std::os::raw::c_ulonglong;
pub type __darwin_intptr_t = ::std::os::raw::c_long;
pub type __darwin_natural_t = ::std::os::raw::c_uint;
pub type __darwin_ct_rune_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Copy)]
pub struct __mbstate_t {
    pub _bindgen_data_: [u64; 16usize],
}
impl __mbstate_t {
    pub unsafe fn __mbstate8(&mut self) -> *mut [::std::os::raw::c_char; 128usize] {
        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
        ::std::mem::transmute(raw.offset(0))
    }
    pub unsafe fn _mbstateL(&mut self) -> *mut ::std::os::raw::c_longlong {
        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
        ::std::mem::transmute(raw.offset(0))
    }
}
impl ::std::clone::Clone for __mbstate_t {
    fn clone(&self) -> Self {
        *self
    }
}
impl ::std::default::Default for __mbstate_t {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
pub type __darwin_mbstate_t = __mbstate_t;
pub type __darwin_ptrdiff_t = ::std::os::raw::c_long;
pub type __darwin_size_t = ::std::os::raw::c_ulong;
pub type __darwin_wchar_t = ::std::os::raw::c_int;
pub type __darwin_rune_t = __darwin_wchar_t;
pub type __darwin_wint_t = ::std::os::raw::c_int;
pub type __darwin_clock_t = ::std::os::raw::c_ulong;
pub type __darwin_socklen_t = __uint32_t;
pub type __darwin_ssize_t = ::std::os::raw::c_long;
pub type __darwin_time_t = ::std::os::raw::c_long;
pub type __darwin_blkcnt_t = __int64_t;
pub type __darwin_blksize_t = __int32_t;
pub type __darwin_dev_t = __int32_t;
pub type __darwin_fsblkcnt_t = ::std::os::raw::c_uint;
pub type __darwin_fsfilcnt_t = ::std::os::raw::c_uint;
pub type __darwin_gid_t = __uint32_t;
pub type __darwin_id_t = __uint32_t;
pub type __darwin_ino64_t = __uint64_t;
pub type __darwin_ino_t = __darwin_ino64_t;
pub type __darwin_mach_port_name_t = __darwin_natural_t;
pub type __darwin_mach_port_t = __darwin_mach_port_name_t;
pub type __darwin_mode_t = __uint16_t;
pub type __darwin_off_t = __int64_t;
pub type __darwin_pid_t = __int32_t;
pub type __darwin_sigset_t = __uint32_t;
pub type __darwin_suseconds_t = __int32_t;
pub type __darwin_uid_t = __uint32_t;
pub type __darwin_useconds_t = __uint32_t;
pub type __darwin_uuid_t = [::std::os::raw::c_uchar; 16usize];
pub type __darwin_uuid_string_t = [::std::os::raw::c_char; 37usize];
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct __darwin_pthread_handler_rec {
    pub __routine: ::std::option::Option<unsafe extern "C" fn(arg1:
                                                                  *mut ::std::os::raw::c_void)>,
    pub __arg: *mut ::std::os::raw::c_void,
    pub __next: *mut __darwin_pthread_handler_rec,
}
impl ::std::default::Default for __darwin_pthread_handler_rec {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy)]
pub struct _opaque_pthread_attr_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 56usize],
}
impl ::std::clone::Clone for _opaque_pthread_attr_t {
    fn clone(&self) -> Self {
        *self
    }
}
impl ::std::default::Default for _opaque_pthread_attr_t {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy)]
pub struct _opaque_pthread_cond_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 40usize],
}
impl ::std::clone::Clone for _opaque_pthread_cond_t {
    fn clone(&self) -> Self {
        *self
    }
}
impl ::std::default::Default for _opaque_pthread_cond_t {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct _opaque_pthread_condattr_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 8usize],
}
impl ::std::default::Default for _opaque_pthread_condattr_t {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy)]
pub struct _opaque_pthread_mutex_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 56usize],
}
impl ::std::clone::Clone for _opaque_pthread_mutex_t {
    fn clone(&self) -> Self {
        *self
    }
}
impl ::std::default::Default for _opaque_pthread_mutex_t {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct _opaque_pthread_mutexattr_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 8usize],
}
impl ::std::default::Default for _opaque_pthread_mutexattr_t {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct _opaque_pthread_once_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 8usize],
}
impl ::std::default::Default for _opaque_pthread_once_t {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy)]
pub struct _opaque_pthread_rwlock_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 192usize],
}
impl ::std::clone::Clone for _opaque_pthread_rwlock_t {
    fn clone(&self) -> Self {
        *self
    }
}
impl ::std::default::Default for _opaque_pthread_rwlock_t {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct _opaque_pthread_rwlockattr_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 16usize],
}
impl ::std::default::Default for _opaque_pthread_rwlockattr_t {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy)]
pub struct _opaque_pthread_t {
    pub __sig: ::std::os::raw::c_long,
    pub __cleanup_stack: *mut __darwin_pthread_handler_rec,
    pub __opaque: [::std::os::raw::c_char; 8176usize],
}
impl ::std::clone::Clone for _opaque_pthread_t {
    fn clone(&self) -> Self {
        *self
    }
}
impl ::std::default::Default for _opaque_pthread_t {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
pub type __darwin_pthread_attr_t = _opaque_pthread_attr_t;
pub type __darwin_pthread_cond_t = _opaque_pthread_cond_t;
pub type __darwin_pthread_condattr_t = _opaque_pthread_condattr_t;
pub type __darwin_pthread_key_t = ::std::os::raw::c_ulong;
pub type __darwin_pthread_mutex_t = _opaque_pthread_mutex_t;
pub type __darwin_pthread_mutexattr_t = _opaque_pthread_mutexattr_t;
pub type __darwin_pthread_once_t = _opaque_pthread_once_t;
pub type __darwin_pthread_rwlock_t = _opaque_pthread_rwlock_t;
pub type __darwin_pthread_rwlockattr_t = _opaque_pthread_rwlockattr_t;
pub type __darwin_pthread_t = *mut _opaque_pthread_t;
pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type intmax_t = ::std::os::raw::c_long;
pub type uintmax_t = ::std::os::raw::c_ulong;
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct fd_set {
    pub fds_bits: [__int32_t; 32usize],
}
impl ::std::default::Default for fd_set {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct timespec {
    pub tv_sec: __darwin_time_t,
    pub tv_nsec: ::std::os::raw::c_long,
}
impl ::std::default::Default for timespec {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct timeval {
    pub tv_sec: __darwin_time_t,
    pub tv_usec: __darwin_suseconds_t,
    _bindgen_padding_0_: [u8; 4usize],
}
impl ::std::default::Default for timeval {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct timeval64 {
    pub tv_sec: __int64_t,
    pub tv_usec: __int64_t,
}
impl ::std::default::Default for timeval64 {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
pub type time_t = __darwin_time_t;
pub type suseconds_t = __darwin_suseconds_t;
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct itimerval {
    pub it_interval: timeval,
    pub it_value: timeval,
}
impl ::std::default::Default for itimerval {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct timezone {
    pub tz_minuteswest: ::std::os::raw::c_int,
    pub tz_dsttime: ::std::os::raw::c_int,
}
impl ::std::default::Default for timezone {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct clockinfo {
    pub hz: ::std::os::raw::c_int,
    pub tick: ::std::os::raw::c_int,
    pub tickadj: ::std::os::raw::c_int,
    pub stathz: ::std::os::raw::c_int,
    pub profhz: ::std::os::raw::c_int,
}
impl ::std::default::Default for clockinfo {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
pub type __darwin_nl_item = ::std::os::raw::c_int;
pub type __darwin_wctrans_t = ::std::os::raw::c_int;
pub type __darwin_wctype_t = __uint32_t;
pub type clock_t = __darwin_clock_t;
pub type size_t = usize;
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct tm {
    pub tm_sec: ::std::os::raw::c_int,
    pub tm_min: ::std::os::raw::c_int,
    pub tm_hour: ::std::os::raw::c_int,
    pub tm_mday: ::std::os::raw::c_int,
    pub tm_mon: ::std::os::raw::c_int,
    pub tm_year: ::std::os::raw::c_int,
    pub tm_wday: ::std::os::raw::c_int,
    pub tm_yday: ::std::os::raw::c_int,
    pub tm_isdst: ::std::os::raw::c_int,
    pub tm_gmtoff: ::std::os::raw::c_long,
    pub tm_zone: *mut ::std::os::raw::c_char,
}
impl ::std::default::Default for tm {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[derive(Copy, Clone)]
#[repr(u32)]
#[derive(Debug)]
pub enum clockid_t {
    _CLOCK_REALTIME = 0,
    _CLOCK_MONOTONIC = 6,
    _CLOCK_MONOTONIC_RAW = 4,
    _CLOCK_MONOTONIC_RAW_APPROX = 5,
    _CLOCK_UPTIME_RAW = 8,
    _CLOCK_UPTIME_RAW_APPROX = 9,
    _CLOCK_PROCESS_CPUTIME_ID = 12,
    _CLOCK_THREAD_CPUTIME_ID = 16,
}
#[derive(Copy, Clone)]
#[repr(u32)]
#[derive(Debug)]
pub enum freenect_device_flags {
    FREENECT_DEVICE_MOTOR = 1,
    FREENECT_DEVICE_CAMERA = 2,
    FREENECT_DEVICE_AUDIO = 4,
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct freenect_device_attributes {
    pub next: *mut freenect_device_attributes,
    pub camera_serial: *const ::std::os::raw::c_char,
}
impl ::std::default::Default for freenect_device_attributes {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[derive(Copy, Clone)]
#[repr(u32)]
#[derive(Debug)]
pub enum freenect_resolution {
    FREENECT_RESOLUTION_LOW = 0,
    FREENECT_RESOLUTION_MEDIUM = 1,
    FREENECT_RESOLUTION_HIGH = 2,
    FREENECT_RESOLUTION_DUMMY = 2147483647,
}
#[derive(Copy, Clone)]
#[repr(u32)]
#[derive(Debug)]
pub enum freenect_video_format {
    FREENECT_VIDEO_RGB = 0,
    FREENECT_VIDEO_BAYER = 1,
    FREENECT_VIDEO_IR_8BIT = 2,
    FREENECT_VIDEO_IR_10BIT = 3,
    FREENECT_VIDEO_IR_10BIT_PACKED = 4,
    FREENECT_VIDEO_YUV_RGB = 5,
    FREENECT_VIDEO_YUV_RAW = 6,
    FREENECT_VIDEO_DUMMY = 2147483647,
}
#[derive(Copy, Clone)]
#[repr(u32)]
#[derive(Debug)]
pub enum freenect_depth_format {
    FREENECT_DEPTH_11BIT = 0,
    FREENECT_DEPTH_10BIT = 1,
    FREENECT_DEPTH_11BIT_PACKED = 2,
    FREENECT_DEPTH_10BIT_PACKED = 3,
    FREENECT_DEPTH_REGISTERED = 4,
    FREENECT_DEPTH_MM = 5,
    FREENECT_DEPTH_DUMMY = 2147483647,
}
#[derive(Copy, Clone)]
#[repr(u32)]
#[derive(Debug)]
pub enum freenect_flag {
    FREENECT_AUTO_EXPOSURE = 16384,
    FREENECT_AUTO_WHITE_BALANCE = 2,
    FREENECT_RAW_COLOR = 16,
    FREENECT_MIRROR_DEPTH = 65536,
    FREENECT_MIRROR_VIDEO = 131072,
    FREENECT_NEAR_MODE = 262144,
}
#[derive(Copy, Clone)]
#[repr(u32)]
#[derive(Debug)]
pub enum freenect_flag_value {
    FREENECT_OFF = 0,
    FREENECT_ON = 1,
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct freenect_frame_mode {
    pub reserved: uint32_t,
    pub resolution: freenect_resolution,
    pub _bindgen_data_1_: [u32; 1usize],
    pub bytes: int32_t,
    pub width: int16_t,
    pub height: int16_t,
    pub data_bits_per_pixel: int8_t,
    pub padding_bits_per_pixel: int8_t,
    pub framerate: int8_t,
    pub is_valid: int8_t,
}
impl freenect_frame_mode {
    pub unsafe fn dummy(&mut self) -> *mut int32_t {
        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
        ::std::mem::transmute(raw.offset(0))
    }
    pub unsafe fn video_format(&mut self) -> *mut freenect_video_format {
        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
        ::std::mem::transmute(raw.offset(0))
    }
    pub unsafe fn depth_format(&mut self) -> *mut freenect_depth_format {
        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
        ::std::mem::transmute(raw.offset(0))
    }
}
impl ::std::default::Default for freenect_frame_mode {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[derive(Copy, Clone)]
#[repr(u32)]
#[derive(Debug)]
pub enum freenect_led_options {
    LED_OFF = 0,
    LED_GREEN = 1,
    LED_RED = 2,
    LED_YELLOW = 3,
    LED_BLINK_GREEN = 4,
    LED_BLINK_RED_YELLOW = 6,
}
#[derive(Copy, Clone)]
#[repr(u32)]
#[derive(Debug)]
pub enum freenect_tilt_status_code {
    TILT_STATUS_STOPPED = 0,
    TILT_STATUS_LIMIT = 1,
    TILT_STATUS_MOVING = 4,
}
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct freenect_raw_tilt_state {
    pub accelerometer_x: int16_t,
    pub accelerometer_y: int16_t,
    pub accelerometer_z: int16_t,
    pub tilt_angle: int8_t,
    pub tilt_status: freenect_tilt_status_code,
}
impl ::std::default::Default for freenect_raw_tilt_state {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
pub enum _freenect_context { }
pub type freenect_context = _freenect_context;
pub enum _freenect_device { }
pub type freenect_device = _freenect_device;
pub type freenect_usb_context = ::std::os::raw::c_void;
#[derive(Copy, Clone)]
#[repr(u32)]
#[derive(Debug)]
pub enum freenect_loglevel {
    FREENECT_LOG_FATAL = 0,
    FREENECT_LOG_ERROR = 1,
    FREENECT_LOG_WARNING = 2,
    FREENECT_LOG_NOTICE = 3,
    FREENECT_LOG_INFO = 4,
    FREENECT_LOG_DEBUG = 5,
    FREENECT_LOG_SPEW = 6,
    FREENECT_LOG_FLOOD = 7,
}
pub type freenect_log_cb =
    ::std::option::Option<unsafe extern "C" fn(dev: *mut freenect_context,
                                                 level: freenect_loglevel,
                                                 msg: *const ::std::os::raw::c_char)>;
pub type freenect_depth_cb =
    ::std::option::Option<unsafe extern "C" fn(dev: *mut freenect_device,
                                                 depth: *mut ::std::os::raw::c_void,
                                                 timestamp: uint32_t)>;
pub type freenect_video_cb =
    ::std::option::Option<unsafe extern "C" fn(dev: *mut freenect_device,
                                                 video: *mut ::std::os::raw::c_void,
                                                 timestamp: uint32_t)>;
pub type freenect_chunk_cb =
    ::std::option::Option<unsafe extern "C" fn(buffer: *mut ::std::os::raw::c_void,
                                                 pkt_data: *mut ::std::os::raw::c_void,
                                                 pkt_num: ::std::os::raw::c_int,
                                                 datalen: ::std::os::raw::c_int,
                                                 user_data: *mut ::std::os::raw::c_void)>;
#[link(name = "freenect", kind = "dylib")]
extern "C" {
    pub static mut tzname: [*mut ::std::os::raw::c_char; 0usize];
    pub static mut getdate_err: ::std::os::raw::c_int;
    pub static mut timezone: ::std::os::raw::c_long;
    pub static mut daylight: ::std::os::raw::c_int;
}
#[link(name = "freenect", kind = "dylib")]
extern "C" {
    pub fn asctime(arg1: *const tm) -> *mut ::std::os::raw::c_char;
    pub fn clock() -> clock_t;
    pub fn ctime(arg1: *const time_t) -> *mut ::std::os::raw::c_char;
    pub fn difftime(arg1: time_t, arg2: time_t) -> f64;
    pub fn getdate(arg1: *const ::std::os::raw::c_char) -> *mut tm;
    pub fn gmtime(arg1: *const time_t) -> *mut tm;
    pub fn localtime(arg1: *const time_t) -> *mut tm;
    pub fn mktime(arg1: *mut tm) -> time_t;
    pub fn strftime(arg1: *mut ::std::os::raw::c_char,
                    arg2: size_t,
                    arg3: *const ::std::os::raw::c_char,
                    arg4: *const tm)
                    -> size_t;
    pub fn strptime(arg1: *const ::std::os::raw::c_char,
                    arg2: *const ::std::os::raw::c_char,
                    arg3: *mut tm)
                    -> *mut ::std::os::raw::c_char;
    pub fn time(arg1: *mut time_t) -> time_t;
    pub fn tzset();
    pub fn asctime_r(arg1: *const tm,
                     arg2: *mut ::std::os::raw::c_char)
                     -> *mut ::std::os::raw::c_char;
    pub fn ctime_r(arg1: *const time_t,
                   arg2: *mut ::std::os::raw::c_char)
                   -> *mut ::std::os::raw::c_char;
    pub fn gmtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm;
    pub fn localtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm;
    pub fn posix2time(arg1: time_t) -> time_t;
    pub fn tzsetwall();
    pub fn time2posix(arg1: time_t) -> time_t;
    pub fn timelocal(arg1: *mut tm) -> time_t;
    pub fn timegm(arg1: *mut tm) -> time_t;
    pub fn nanosleep(__rqtp: *const timespec, __rmtp: *mut timespec) -> ::std::os::raw::c_int;
    pub fn clock_getres(__clock_id: clockid_t, __res: *mut timespec) -> ::std::os::raw::c_int;
    pub fn clock_gettime(__clock_id: clockid_t, __tp: *mut timespec) -> ::std::os::raw::c_int;
    pub fn clock_gettime_nsec_np(__clock_id: clockid_t) -> __uint64_t;
    pub fn clock_settime(__clock_id: clockid_t, __tp: *const timespec) -> ::std::os::raw::c_int;
    pub fn adjtime(arg1: *const timeval, arg2: *mut timeval) -> ::std::os::raw::c_int;
    pub fn futimes(arg1: ::std::os::raw::c_int, arg2: *const timeval) -> ::std::os::raw::c_int;
    pub fn lutimes(arg1: *const ::std::os::raw::c_char,
                   arg2: *const timeval)
                   -> ::std::os::raw::c_int;
    pub fn settimeofday(arg1: *const timeval, arg2: *const timezone) -> ::std::os::raw::c_int;
    pub fn getitimer(arg1: ::std::os::raw::c_int, arg2: *mut itimerval) -> ::std::os::raw::c_int;
    pub fn gettimeofday(arg1: *mut timeval,
                        arg2: *mut ::std::os::raw::c_void)
                        -> ::std::os::raw::c_int;
    pub fn select(arg1: ::std::os::raw::c_int,
                  arg2: *mut fd_set,
                  arg3: *mut fd_set,
                  arg4: *mut fd_set,
                  arg5: *mut timeval)
                  -> ::std::os::raw::c_int;
    pub fn setitimer(arg1: ::std::os::raw::c_int,
                     arg2: *const itimerval,
                     arg3: *mut itimerval)
                     -> ::std::os::raw::c_int;
    pub fn utimes(arg1: *const ::std::os::raw::c_char,
                  arg2: *const timeval)
                  -> ::std::os::raw::c_int;
    pub fn freenect_init(ctx: *mut *mut freenect_context,
                         usb_ctx: *mut freenect_usb_context)
                         -> ::std::os::raw::c_int;
    pub fn freenect_shutdown(ctx: *mut freenect_context) -> ::std::os::raw::c_int;
    pub fn freenect_set_log_level(ctx: *mut freenect_context, level: freenect_loglevel);
    pub fn freenect_set_log_callback(ctx: *mut freenect_context, cb: freenect_log_cb);
    pub fn freenect_process_events(ctx: *mut freenect_context) -> ::std::os::raw::c_int;
    pub fn freenect_process_events_timeout(ctx: *mut freenect_context,
                                           timeout: *mut timeval)
                                           -> ::std::os::raw::c_int;
    pub fn freenect_num_devices(ctx: *mut freenect_context) -> ::std::os::raw::c_int;
    pub fn freenect_list_device_attributes(ctx: *mut freenect_context,
                                           attribute_list: *mut *mut freenect_device_attributes)
                                           -> ::std::os::raw::c_int;
    pub fn freenect_free_device_attributes(attribute_list: *mut freenect_device_attributes);
    pub fn freenect_supported_subdevices() -> ::std::os::raw::c_int;
    pub fn freenect_select_subdevices(ctx: *mut freenect_context, subdevs: freenect_device_flags);
    pub fn freenect_enabled_subdevices(ctx: *mut freenect_context) -> freenect_device_flags;
    pub fn freenect_open_device(ctx: *mut freenect_context,
                                dev: *mut *mut freenect_device,
                                index: ::std::os::raw::c_int)
                                -> ::std::os::raw::c_int;
    pub fn freenect_open_device_by_camera_serial(ctx: *mut freenect_context,
                                                 dev: *mut *mut freenect_device,
                                                 camera_serial: *const ::std::os::raw::c_char)
                                                 -> ::std::os::raw::c_int;
    pub fn freenect_close_device(dev: *mut freenect_device) -> ::std::os::raw::c_int;
    pub fn freenect_set_user(dev: *mut freenect_device, user: *mut ::std::os::raw::c_void);
    pub fn freenect_get_user(dev: *mut freenect_device) -> *mut ::std::os::raw::c_void;
    pub fn freenect_set_depth_callback(dev: *mut freenect_device, cb: freenect_depth_cb);
    pub fn freenect_set_video_callback(dev: *mut freenect_device, cb: freenect_video_cb);
    pub fn freenect_set_depth_chunk_callback(dev: *mut freenect_device, cb: freenect_chunk_cb);
    pub fn freenect_set_video_chunk_callback(dev: *mut freenect_device, cb: freenect_chunk_cb);
    pub fn freenect_set_depth_buffer(dev: *mut freenect_device,
                                     buf: *mut ::std::os::raw::c_void)
                                     -> ::std::os::raw::c_int;
    pub fn freenect_set_video_buffer(dev: *mut freenect_device,
                                     buf: *mut ::std::os::raw::c_void)
                                     -> ::std::os::raw::c_int;
    pub fn freenect_start_depth(dev: *mut freenect_device) -> ::std::os::raw::c_int;
    pub fn freenect_start_video(dev: *mut freenect_device) -> ::std::os::raw::c_int;
    pub fn freenect_stop_depth(dev: *mut freenect_device) -> ::std::os::raw::c_int;
    pub fn freenect_stop_video(dev: *mut freenect_device) -> ::std::os::raw::c_int;
    pub fn freenect_update_tilt_state(dev: *mut freenect_device) -> ::std::os::raw::c_int;
    pub fn freenect_get_tilt_state(dev: *mut freenect_device) -> *mut freenect_raw_tilt_state;
    pub fn freenect_get_tilt_degs(state: *mut freenect_raw_tilt_state) -> f64;
    pub fn freenect_set_tilt_degs(dev: *mut freenect_device, angle: f64) -> ::std::os::raw::c_int;
    pub fn freenect_get_tilt_status(state: *mut freenect_raw_tilt_state)
                                    -> freenect_tilt_status_code;
    pub fn freenect_set_led(dev: *mut freenect_device,
                            option: freenect_led_options)
                            -> ::std::os::raw::c_int;
    pub fn freenect_get_mks_accel(state: *mut freenect_raw_tilt_state,
                                  x: *mut f64,
                                  y: *mut f64,
                                  z: *mut f64);
    pub fn freenect_get_video_mode_count() -> ::std::os::raw::c_int;
    pub fn freenect_get_video_mode(mode_num: ::std::os::raw::c_int) -> freenect_frame_mode;
    pub fn freenect_get_current_video_mode(dev: *mut freenect_device) -> freenect_frame_mode;
    pub fn freenect_find_video_mode(res: freenect_resolution,
                                    fmt: freenect_video_format)
                                    -> freenect_frame_mode;
    pub fn freenect_set_video_mode(dev: *mut freenect_device,
                                   mode: freenect_frame_mode)
                                   -> ::std::os::raw::c_int;
    pub fn freenect_get_depth_mode_count() -> ::std::os::raw::c_int;
    pub fn freenect_get_depth_mode(mode_num: ::std::os::raw::c_int) -> freenect_frame_mode;
    pub fn freenect_get_current_depth_mode(dev: *mut freenect_device) -> freenect_frame_mode;
    pub fn freenect_find_depth_mode(res: freenect_resolution,
                                    fmt: freenect_depth_format)
                                    -> freenect_frame_mode;
    pub fn freenect_set_depth_mode(dev: *mut freenect_device,
                                   mode: freenect_frame_mode)
                                   -> ::std::os::raw::c_int;
    pub fn freenect_set_flag(dev: *mut freenect_device,
                             flag: freenect_flag,
                             value: freenect_flag_value)
                             -> ::std::os::raw::c_int;
    pub fn freenect_get_ir_brightness(dev: *mut freenect_device) -> ::std::os::raw::c_int;
    pub fn freenect_set_ir_brightness(dev: *mut freenect_device,
                                      brightness: uint16_t)
                                      -> ::std::os::raw::c_int;
    pub fn freenect_set_fw_address_nui(ctx: *mut freenect_context,
                                       fw_ptr: *mut ::std::os::raw::c_uchar,
                                       num_bytes: ::std::os::raw::c_uint);
    pub fn freenect_set_fw_address_k4w(ctx: *mut freenect_context,
                                       fw_ptr: *mut ::std::os::raw::c_uchar,
                                       num_bytes: ::std::os::raw::c_uint);
}