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
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
#![allow(non_camel_case_types, non_upper_case_globals)]

extern crate libc;
#[macro_use]
extern crate lazy_static;
extern crate libloading;

/// JACK port type for 8 bit raw midi
pub static RAW_MIDI_TYPE: &'static str = "8 bit raw midi";

/// JACK port type for 32 bit float mono audio
pub static FLOAT_MONO_AUDIO: &'static str = "32 bit float mono audio";

/* automatically generated by rust-bindgen */

pub type jack_native_thread_t = ::libc::pthread_t;
pub type jack_uuid_t = ::libc::uint64_t;
pub type jack_shmsize_t = ::libc::int32_t;
pub type jack_nframes_t = ::libc::uint32_t;
pub type jack_time_t = ::libc::uint64_t;
pub type jack_intclient_t = ::libc::uint64_t;
pub enum Struct__jack_port { }
pub type jack_port_t = Struct__jack_port;
pub enum Struct__jack_client { }
pub type jack_client_t = Struct__jack_client;
pub type jack_port_id_t = ::libc::uint32_t;
pub type jack_port_type_id_t = ::libc::uint32_t;
pub type Enum_JackOptions = ::libc::c_uint;
pub const JackNullOption: ::libc::c_uint = 0;
pub const JackNoStartServer: ::libc::c_uint = 1;
pub const JackUseExactName: ::libc::c_uint = 2;
pub const JackServerName: ::libc::c_uint = 4;
pub const JackLoadName: ::libc::c_uint = 8;
pub const JackLoadInit: ::libc::c_uint = 16;
pub const JackSessionID: ::libc::c_uint = 32;
pub type jack_options_t = Enum_JackOptions;
pub type Enum_JackStatus = ::libc::c_uint;
pub const JackFailure: ::libc::c_uint = 1;
pub const JackInvalidOption: ::libc::c_uint = 2;
pub const JackNameNotUnique: ::libc::c_uint = 4;
pub const JackServerStarted: ::libc::c_uint = 8;
pub const JackServerFailed: ::libc::c_uint = 16;
pub const JackServerError: ::libc::c_uint = 32;
pub const JackNoSuchClient: ::libc::c_uint = 64;
pub const JackLoadFailure: ::libc::c_uint = 128;
pub const JackInitFailure: ::libc::c_uint = 256;
pub const JackShmFailure: ::libc::c_uint = 512;
pub const JackVersionError: ::libc::c_uint = 1024;
pub const JackBackendError: ::libc::c_uint = 2048;
pub const JackClientZombie: ::libc::c_uint = 4096;
pub type jack_status_t = Enum_JackStatus;
pub type Enum_JackLatencyCallbackMode = ::libc::c_uint;
pub const JackCaptureLatency: ::libc::c_uint = 0;
pub const JackPlaybackLatency: ::libc::c_uint = 1;
pub type jack_latency_callback_mode_t = Enum_JackLatencyCallbackMode;
pub type JackLatencyCallback =
    ::std::option::Option<unsafe extern "C" fn(mode: jack_latency_callback_mode_t,
                                        arg: *mut ::libc::c_void) -> ()>;
#[repr(C, packed)]
#[derive(Copy)]
pub struct Struct__jack_latency_range {
    pub min: jack_nframes_t,
    pub max: jack_nframes_t,
}
impl ::std::clone::Clone for Struct__jack_latency_range {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct__jack_latency_range {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type jack_latency_range_t = Struct__jack_latency_range;
pub type JackProcessCallback =
    ::std::option::Option<unsafe extern "C" fn(nframes: jack_nframes_t,
                                        arg: *mut ::libc::c_void)
                              -> ::libc::c_int>;
pub type JackThreadCallback =
    ::std::option::Option<unsafe extern "C" fn(arg: *mut ::libc::c_void)
                              -> *mut ::libc::c_void>;
pub type JackThreadInitCallback =
    ::std::option::Option<unsafe extern "C" fn(arg: *mut ::libc::c_void) -> ()>;
pub type JackGraphOrderCallback =
    ::std::option::Option<unsafe extern "C" fn(arg: *mut ::libc::c_void)
                              -> ::libc::c_int>;
pub type JackXRunCallback =
    ::std::option::Option<unsafe extern "C" fn(arg: *mut ::libc::c_void)
                              -> ::libc::c_int>;
pub type JackBufferSizeCallback =
    ::std::option::Option<unsafe extern "C" fn(nframes: jack_nframes_t,
                                        arg: *mut ::libc::c_void)
                              -> ::libc::c_int>;
pub type JackSampleRateCallback =
    ::std::option::Option<unsafe extern "C" fn(nframes: jack_nframes_t,
                                        arg: *mut ::libc::c_void)
                              -> ::libc::c_int>;
pub type JackPortRegistrationCallback =
    ::std::option::Option<unsafe extern "C" fn(port: jack_port_id_t,
                                        arg1: ::libc::c_int,
                                        arg: *mut ::libc::c_void) -> ()>;
pub type JackClientRegistrationCallback =
    ::std::option::Option<unsafe extern "C" fn(name: *const ::libc::c_char,
                                        arg1: ::libc::c_int,
                                        arg: *mut ::libc::c_void) -> ()>;
pub type JackPortConnectCallback =
    ::std::option::Option<unsafe extern "C" fn(a: jack_port_id_t, b: jack_port_id_t,
                                        connect: ::libc::c_int,
                                        arg: *mut ::libc::c_void) -> ()>;
pub type JackPortRenameCallback =
    ::std::option::Option<unsafe extern "C" fn(port: jack_port_id_t,
                                        old_name: *const ::libc::c_char,
                                        new_name: *const ::libc::c_char,
                                        arg: *mut ::libc::c_void)
                              -> ::libc::c_int>;
pub type JackFreewheelCallback =
    ::std::option::Option<unsafe extern "C" fn(starting: ::libc::c_int,
                                        arg: *mut ::libc::c_void) -> ()>;
pub type JackShutdownCallback =
    ::std::option::Option<unsafe extern "C" fn(arg: *mut ::libc::c_void) -> ()>;
pub type JackInfoShutdownCallback =
    ::std::option::Option<unsafe extern "C" fn(code: jack_status_t,
                                        reason: *const ::libc::c_char,
                                        arg: *mut ::libc::c_void) -> ()>;
pub type jack_default_audio_sample_t = ::libc::c_float;
pub type Enum_JackPortFlags = ::libc::c_uint;
pub const JackPortIsInput: ::libc::c_uint = 1;
pub const JackPortIsOutput: ::libc::c_uint = 2;
pub const JackPortIsPhysical: ::libc::c_uint = 4;
pub const JackPortCanMonitor: ::libc::c_uint = 8;
pub const JackPortIsTerminal: ::libc::c_uint = 16;
pub type Enum_Unnamed1 = ::libc::c_uint;
pub const JackTransportStopped: ::libc::c_uint = 0;
pub const JackTransportRolling: ::libc::c_uint = 1;
pub const JackTransportLooping: ::libc::c_uint = 2;
pub const JackTransportStarting: ::libc::c_uint = 3;
pub const JackTransportNetStarting: ::libc::c_uint = 4;
pub type jack_transport_state_t = Enum_Unnamed1;
pub type jack_unique_t = ::libc::uint64_t;
pub type Enum_Unnamed2 = ::libc::c_uint;
pub const JackPositionBBT: ::libc::c_uint = 16;
pub const JackPositionTimecode: ::libc::c_uint = 32;
pub const JackBBTFrameOffset: ::libc::c_uint = 64;
pub const JackAudioVideoRatio: ::libc::c_uint = 128;
pub const JackVideoFrameOffset: ::libc::c_uint = 256;
pub type jack_position_bits_t = Enum_Unnamed2;
#[repr(C, packed)]
#[derive(Copy)]
pub struct Struct__jack_position {
    pub unique_1: jack_unique_t,
    pub usecs: jack_time_t,
    pub frame_rate: jack_nframes_t,
    pub frame: jack_nframes_t,
    pub valid: jack_position_bits_t,
    pub bar: ::libc::int32_t,
    pub beat: ::libc::int32_t,
    pub tick: ::libc::int32_t,
    pub bar_start_tick: ::libc::c_double,
    pub beats_per_bar: ::libc::c_float,
    pub beat_type: ::libc::c_float,
    pub ticks_per_beat: ::libc::c_double,
    pub beats_per_minute: ::libc::c_double,
    pub frame_time: ::libc::c_double,
    pub next_time: ::libc::c_double,
    pub bbt_offset: jack_nframes_t,
    pub audio_frames_per_video_frame: ::libc::c_float,
    pub video_offset: jack_nframes_t,
    pub padding: [::libc::int32_t; 7usize],
    pub unique_2: jack_unique_t,
}
impl ::std::clone::Clone for Struct__jack_position {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct__jack_position {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type jack_position_t = Struct__jack_position;
pub type JackSyncCallback =
    ::std::option::Option<unsafe extern "C" fn(state: jack_transport_state_t,
                                        pos: *mut jack_position_t,
                                        arg: *mut ::libc::c_void)
                              -> ::libc::c_int>;
pub type JackTimebaseCallback =
    ::std::option::Option<unsafe extern "C" fn(state: jack_transport_state_t,
                                        nframes: jack_nframes_t,
                                        pos: *mut jack_position_t,
                                        new_pos: ::libc::c_int,
                                        arg: *mut ::libc::c_void) -> ()>;
pub type Enum_Unnamed3 = ::libc::c_uint;
pub const JackTransportState: ::libc::c_uint = 1;
pub const JackTransportPosition: ::libc::c_uint = 2;
pub const JackTransportLoop: ::libc::c_uint = 4;
pub const JackTransportSMPTE: ::libc::c_uint = 8;
pub const JackTransportBBT: ::libc::c_uint = 16;
pub type jack_transport_bits_t = Enum_Unnamed3;
#[repr(C)]
#[derive(Copy)]
pub struct Struct_Unnamed4 {
    pub frame_rate: jack_nframes_t,
    pub usecs: jack_time_t,
    pub valid: jack_transport_bits_t,
    pub transport_state: jack_transport_state_t,
    pub frame: jack_nframes_t,
    pub loop_start: jack_nframes_t,
    pub loop_end: jack_nframes_t,
    pub smpte_offset: ::libc::c_long,
    pub smpte_frame_rate: ::libc::c_float,
    pub bar: ::libc::c_int,
    pub beat: ::libc::c_int,
    pub tick: ::libc::c_int,
    pub bar_start_tick: ::libc::c_double,
    pub beats_per_bar: ::libc::c_float,
    pub beat_type: ::libc::c_float,
    pub ticks_per_beat: ::libc::c_double,
    pub beats_per_minute: ::libc::c_double,
}
impl ::std::clone::Clone for Struct_Unnamed4 {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_Unnamed4 {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type jack_transport_info_t = Struct_Unnamed4;
pub type jack_thread_creator_t =
    ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::libc::pthread_t,
                                        arg2: *const ::libc::pthread_attr_t,
                                        function:
                                            ::std::option::Option<extern "C" fn(arg1:
                                                                                    *mut ::libc::c_void)
                                                                      ->
                                                                          *mut ::libc::c_void>,
                                        arg: *mut ::libc::c_void)
                              -> ::libc::c_int>;
pub type Enum_JackSessionEventType = ::libc::c_uint;
pub const JackSessionSave: ::libc::c_uint = 1;
pub const JackSessionSaveAndQuit: ::libc::c_uint = 2;
pub const JackSessionSaveTemplate: ::libc::c_uint = 3;
pub type jack_session_event_type_t = Enum_JackSessionEventType;
pub type Enum_JackSessionFlags = ::libc::c_uint;
pub const JackSessionSaveError: ::libc::c_uint = 1;
pub const JackSessionNeedTerminal: ::libc::c_uint = 2;
pub type jack_session_flags_t = Enum_JackSessionFlags;
#[repr(C)]
#[derive(Copy)]
pub struct Struct__jack_session_event {
    pub _type: jack_session_event_type_t,
    pub session_dir: *const ::libc::c_char,
    pub client_uuid: *const ::libc::c_char,
    pub command_line: *mut ::libc::c_char,
    pub flags: jack_session_flags_t,
    pub future: ::libc::uint32_t,
}
impl ::std::clone::Clone for Struct__jack_session_event {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct__jack_session_event {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type jack_session_event_t = Struct__jack_session_event;
pub type JackSessionCallback =
    ::std::option::Option<unsafe extern "C" fn(event: *mut jack_session_event_t,
                                        arg: *mut ::libc::c_void) -> ()>;
#[repr(C)]
#[derive(Copy)]
pub struct Struct_Unnamed5 {
    pub uuid: *const ::libc::c_char,
    pub client_name: *const ::libc::c_char,
    pub command: *const ::libc::c_char,
    pub flags: jack_session_flags_t,
}
impl ::std::clone::Clone for Struct_Unnamed5 {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_Unnamed5 {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type jack_session_command_t = Struct_Unnamed5;
pub type JSList = Struct__JSList;
pub type JCompareFunc =
    ::std::option::Option<unsafe extern "C" fn(a: *mut ::libc::c_void,
                                        b: *mut ::libc::c_void)
                              -> ::libc::c_int>;
#[repr(C)]
#[derive(Copy)]
pub struct Struct__JSList {
    pub data: *mut ::libc::c_void,
    pub next: *mut JSList,
}
impl ::std::clone::Clone for Struct__JSList {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct__JSList {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type Enum_Unnamed6 = ::libc::c_uint;
pub const JackParamInt: ::libc::c_uint = 1;
pub const JackParamUInt: ::libc::c_uint = 2;
pub const JackParamChar: ::libc::c_uint = 3;
pub const JackParamString: ::libc::c_uint = 4;
pub const JackParamBool: ::libc::c_uint = 5;
pub type jackctl_param_type_t = Enum_Unnamed6;
pub type Enum_Unnamed7 = ::libc::c_uint;
pub const JackMaster: ::libc::c_uint = 1;
pub const JackSlave: ::libc::c_uint = 2;
pub type jackctl_driver_type_t = Enum_Unnamed7;
#[repr(C)]
#[derive(Copy)]
pub struct Union_jackctl_parameter_value {
    pub _bindgen_data_: [u32; 32usize],
}
impl Union_jackctl_parameter_value {
    pub unsafe fn ui(&mut self) -> *mut ::libc::uint32_t {
        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
        ::std::mem::transmute(raw.offset(0))
    }
    pub unsafe fn i(&mut self) -> *mut ::libc::int32_t {
        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
        ::std::mem::transmute(raw.offset(0))
    }
    pub unsafe fn c(&mut self) -> *mut ::libc::c_char {
        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
        ::std::mem::transmute(raw.offset(0))
    }
    pub unsafe fn str(&mut self) -> *mut [::libc::c_char; 128usize] {
        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
        ::std::mem::transmute(raw.offset(0))
    }
    pub unsafe fn b(&mut self) -> *mut u8 {
        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
        ::std::mem::transmute(raw.offset(0))
    }
}
impl ::std::clone::Clone for Union_jackctl_parameter_value {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Union_jackctl_parameter_value {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub enum Struct_jackctl_server { }
pub type jackctl_server_t = Struct_jackctl_server;
pub enum Struct_jackctl_driver { }
pub type jackctl_driver_t = Struct_jackctl_driver;
pub enum Struct_jackctl_internal { }
pub type jackctl_internal_t = Struct_jackctl_internal;
pub enum Struct_jackctl_parameter { }
pub type jackctl_parameter_t = Struct_jackctl_parameter;
pub enum Struct_jackctl_sigmask { }
pub type jackctl_sigmask_t = Struct_jackctl_sigmask;
#[repr(C)]
#[derive(Copy)]
pub struct Struct_Unnamed8 {
    pub key: *const ::libc::c_char,
    pub data: *const ::libc::c_char,
    pub _type: *const ::libc::c_char,
}
impl ::std::clone::Clone for Struct_Unnamed8 {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_Unnamed8 {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type jack_property_t = Struct_Unnamed8;
#[repr(C)]
#[derive(Copy)]
pub struct Struct_Unnamed9 {
    pub subject: jack_uuid_t,
    pub property_cnt: ::libc::uint32_t,
    pub properties: *mut jack_property_t,
    pub property_size: ::libc::uint32_t,
}
impl ::std::clone::Clone for Struct_Unnamed9 {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_Unnamed9 {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type jack_description_t = Struct_Unnamed9;
pub type Enum_Unnamed10 = ::libc::c_uint;
pub const PropertyCreated: ::libc::c_uint = 0;
pub const PropertyChanged: ::libc::c_uint = 1;
pub const PropertyDeleted: ::libc::c_uint = 2;
pub type jack_property_change_t = Enum_Unnamed10;
pub type JackPropertyChangeCallback =
    ::std::option::Option<unsafe extern "C" fn(subject: jack_uuid_t,
                                        key: *const ::libc::c_char,
                                        change: jack_property_change_t,
                                        arg: *mut ::libc::c_void) -> ()>;
pub type jack_midi_data_t = ::libc::c_uchar;
#[repr(C)]
#[derive(Copy)]
pub struct Struct__jack_midi_event {
    pub time: jack_nframes_t,
    pub size: ::libc::size_t,
    pub buffer: *mut jack_midi_data_t,
}
impl ::std::clone::Clone for Struct__jack_midi_event {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct__jack_midi_event {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type jack_midi_event_t = Struct__jack_midi_event;
#[repr(C)]
#[derive(Copy)]
pub struct Struct_Unnamed11 {
    pub buf: *mut ::libc::c_char,
    pub len: ::libc::size_t,
}
impl ::std::clone::Clone for Struct_Unnamed11 {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_Unnamed11 {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type jack_ringbuffer_data_t = Struct_Unnamed11;
#[repr(C)]
#[derive(Copy)]
pub struct Struct_Unnamed12 {
    pub buf: *mut ::libc::c_char,
    pub write_ptr: ::libc::size_t,
    pub read_ptr: ::libc::size_t,
    pub size: ::libc::size_t,
    pub size_mask: ::libc::size_t,
    pub mlocked: ::libc::c_int,
}
impl ::std::clone::Clone for Struct_Unnamed12 {
    fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_Unnamed12 {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type jack_ringbuffer_t = Struct_Unnamed12;
extern "C" {
    pub static mut jack_error_callback:
               ::std::option::Option<unsafe extern "C" fn(msg: *const ::libc::c_char)
                                         -> ()>;
    pub static mut jack_info_callback:
               ::std::option::Option<unsafe extern "C" fn(msg: *const ::libc::c_char)
                                         -> ()>;
    pub static mut JACK_METADATA_PRETTY_NAME: *const ::libc::c_char;
    pub static mut JACK_METADATA_HARDWARE: *const ::libc::c_char;
    pub static mut JACK_METADATA_CONNECTED: *const ::libc::c_char;
    pub static mut JACK_METADATA_PORT_GROUP: *const ::libc::c_char;
    pub static mut JACK_METADATA_ICON_SMALL: *const ::libc::c_char;
    pub static mut JACK_METADATA_ICON_LARGE: *const ::libc::c_char;
}

#[link(name = "jack")]
extern "C" {
    pub fn jack_release_timebase(client: *mut jack_client_t) -> ::libc::c_int;
    pub fn jack_set_sync_callback(client: *mut jack_client_t,
                                  sync_callback: JackSyncCallback,
                                  arg: *mut ::libc::c_void) -> ::libc::c_int;
    pub fn jack_set_sync_timeout(client: *mut jack_client_t,
                                 timeout: jack_time_t) -> ::libc::c_int;
    pub fn jack_set_timebase_callback(client: *mut jack_client_t,
                                      conditional: ::libc::c_int,
                                      timebase_callback: JackTimebaseCallback,
                                      arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_transport_locate(client: *mut jack_client_t,
                                 frame: jack_nframes_t) -> ::libc::c_int;
    pub fn jack_transport_query(client: *const jack_client_t,
                                pos: *mut jack_position_t)
     -> jack_transport_state_t;
    pub fn jack_get_current_transport_frame(client: *const jack_client_t)
     -> jack_nframes_t;
    pub fn jack_transport_reposition(client: *mut jack_client_t,
                                     pos: *const jack_position_t)
     -> ::libc::c_int;
    pub fn jack_transport_start(client: *mut jack_client_t) -> ();
    pub fn jack_transport_stop(client: *mut jack_client_t) -> ();
    pub fn jack_get_transport_info(client: *mut jack_client_t,
                                   tinfo: *mut jack_transport_info_t) -> ();
    pub fn jack_set_transport_info(client: *mut jack_client_t,
                                   tinfo: *mut jack_transport_info_t) -> ();
    pub fn jack_get_version(major_ptr: *mut ::libc::c_int,
                            minor_ptr: *mut ::libc::c_int,
                            micro_ptr: *mut ::libc::c_int,
                            proto_ptr: *mut ::libc::c_int) -> ();
    pub fn jack_get_version_string() -> *const ::libc::c_char;
    pub fn jack_client_open(client_name: *const ::libc::c_char,
                            options: jack_options_t,
                            status: *mut jack_status_t, ...)
     -> *mut jack_client_t;
    pub fn jack_client_new(client_name: *const ::libc::c_char)
     -> *mut jack_client_t;
    pub fn jack_client_close(client: *mut jack_client_t) -> ::libc::c_int;
    pub fn jack_client_name_size() -> ::libc::c_int;
    pub fn jack_get_client_name(client: *mut jack_client_t)
     -> *mut ::libc::c_char;
    pub fn jack_get_uuid_for_client_name(client: *mut jack_client_t,
                                         client_name: *const ::libc::c_char)
     -> *mut ::libc::c_char;
    pub fn jack_get_client_name_by_uuid(client: *mut jack_client_t,
                                        client_uuid: *const ::libc::c_char)
     -> *mut ::libc::c_char;
    pub fn jack_internal_client_new(client_name: *const ::libc::c_char,
                                    load_name: *const ::libc::c_char,
                                    load_init: *const ::libc::c_char)
     -> ::libc::c_int;
    pub fn jack_internal_client_close(client_name: *const ::libc::c_char)
     -> ();
    pub fn jack_activate(client: *mut jack_client_t) -> ::libc::c_int;
    pub fn jack_deactivate(client: *mut jack_client_t) -> ::libc::c_int;
    pub fn jack_get_client_pid(name: *const ::libc::c_char) -> ::libc::c_int;
    pub fn jack_client_thread_id(client: *mut jack_client_t)
     -> jack_native_thread_t;
    pub fn jack_is_realtime(client: *mut jack_client_t) -> ::libc::c_int;
    pub fn jack_thread_wait(client: *mut jack_client_t, status: ::libc::c_int)
     -> jack_nframes_t;
    pub fn jack_cycle_wait(client: *mut jack_client_t) -> jack_nframes_t;
    pub fn jack_cycle_signal(client: *mut jack_client_t,
                             status: ::libc::c_int) -> ();
    pub fn jack_set_process_thread(client: *mut jack_client_t,
                                   thread_callback: JackThreadCallback,
                                   arg: *mut ::libc::c_void) -> ::libc::c_int;
    pub fn jack_set_thread_init_callback(client: *mut jack_client_t,
                                         thread_init_callback:
                                             JackThreadInitCallback,
                                         arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_on_shutdown(client: *mut jack_client_t,
                            shutdown_callback: JackShutdownCallback,
                            arg: *mut ::libc::c_void) -> ();
    pub fn jack_on_info_shutdown(client: *mut jack_client_t,
                                 shutdown_callback: JackInfoShutdownCallback,
                                 arg: *mut ::libc::c_void) -> ();
    pub fn jack_set_process_callback(client: *mut jack_client_t,
                                     process_callback: JackProcessCallback,
                                     arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_set_freewheel_callback(client: *mut jack_client_t,
                                       freewheel_callback:
                                           JackFreewheelCallback,
                                       arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_set_buffer_size_callback(client: *mut jack_client_t,
                                         bufsize_callback:
                                             JackBufferSizeCallback,
                                         arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_set_sample_rate_callback(client: *mut jack_client_t,
                                         srate_callback:
                                             JackSampleRateCallback,
                                         arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_set_client_registration_callback(client: *mut jack_client_t,
                                                 registration_callback:
                                                     JackClientRegistrationCallback,
                                                 arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_set_port_registration_callback(client: *mut jack_client_t,
                                               registration_callback:
                                                   JackPortRegistrationCallback,
                                               arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_set_port_connect_callback(client: *mut jack_client_t,
                                          connect_callback:
                                              JackPortConnectCallback,
                                          arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_set_port_rename_callback(client: *mut jack_client_t,
                                         rename_callback:
                                             JackPortRenameCallback,
                                         arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_set_graph_order_callback(client: *mut jack_client_t,
                                         graph_callback:
                                             JackGraphOrderCallback,
                                         arg1: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_set_xrun_callback(client: *mut jack_client_t,
                                  xrun_callback: JackXRunCallback,
                                  arg: *mut ::libc::c_void) -> ::libc::c_int;
    pub fn jack_set_latency_callback(client: *mut jack_client_t,
                                     latency_callback: JackLatencyCallback,
                                     arg1: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_set_freewheel(client: *mut jack_client_t,
                              onoff: ::libc::c_int) -> ::libc::c_int;
    pub fn jack_set_buffer_size(client: *mut jack_client_t,
                                nframes: jack_nframes_t) -> ::libc::c_int;
    pub fn jack_get_sample_rate(arg1: *mut jack_client_t) -> jack_nframes_t;
    pub fn jack_get_buffer_size(arg1: *mut jack_client_t) -> jack_nframes_t;
    pub fn jack_engine_takeover_timebase(arg1: *mut jack_client_t)
     -> ::libc::c_int;
    pub fn jack_cpu_load(client: *mut jack_client_t) -> ::libc::c_float;
    pub fn jack_port_register(client: *mut jack_client_t,
                              port_name: *const ::libc::c_char,
                              port_type: *const ::libc::c_char,
                              flags: ::libc::c_ulong,
                              buffer_size: ::libc::c_ulong)
     -> *mut jack_port_t;
    pub fn jack_port_unregister(client: *mut jack_client_t,
                                port: *mut jack_port_t) -> ::libc::c_int;
    pub fn jack_port_get_buffer(port: *mut jack_port_t, arg1: jack_nframes_t)
     -> *mut ::libc::c_void;
    pub fn jack_port_uuid(port: *const jack_port_t) -> jack_uuid_t;
    pub fn jack_port_name(port: *const jack_port_t) -> *const ::libc::c_char;
    pub fn jack_port_short_name(port: *const jack_port_t)
     -> *const ::libc::c_char;
    pub fn jack_port_flags(port: *const jack_port_t) -> ::libc::c_int;
    pub fn jack_port_type(port: *const jack_port_t) -> *const ::libc::c_char;
    pub fn jack_port_type_id(port: *const jack_port_t) -> jack_port_type_id_t;
    pub fn jack_port_is_mine(client: *const jack_client_t,
                             port: *const jack_port_t) -> ::libc::c_int;
    pub fn jack_port_connected(port: *const jack_port_t) -> ::libc::c_int;
    pub fn jack_port_connected_to(port: *const jack_port_t,
                                  port_name: *const ::libc::c_char)
     -> ::libc::c_int;
    pub fn jack_port_get_connections(port: *const jack_port_t)
     -> *mut *const ::libc::c_char;
    pub fn jack_port_get_all_connections(client: *const jack_client_t,
                                         port: *const jack_port_t)
     -> *mut *const ::libc::c_char;
    pub fn jack_port_tie(src: *mut jack_port_t, dst: *mut jack_port_t)
     -> ::libc::c_int;
    pub fn jack_port_untie(port: *mut jack_port_t) -> ::libc::c_int;
    pub fn jack_port_set_name(port: *mut jack_port_t,
                              port_name: *const ::libc::c_char)
     -> ::libc::c_int;
    pub fn jack_port_set_alias(port: *mut jack_port_t,
                               alias: *const ::libc::c_char) -> ::libc::c_int;
    pub fn jack_port_unset_alias(port: *mut jack_port_t,
                                 alias: *const ::libc::c_char)
     -> ::libc::c_int;
    pub fn jack_port_get_aliases(port: *const jack_port_t,
                                 aliases: *mut *mut ::libc::c_char)
     -> ::libc::c_int;
    pub fn jack_port_request_monitor(port: *mut jack_port_t,
                                     onoff: ::libc::c_int) -> ::libc::c_int;
    pub fn jack_port_request_monitor_by_name(client: *mut jack_client_t,
                                             port_name: *const ::libc::c_char,
                                             onoff: ::libc::c_int)
     -> ::libc::c_int;
    pub fn jack_port_ensure_monitor(port: *mut jack_port_t,
                                    onoff: ::libc::c_int) -> ::libc::c_int;
    pub fn jack_port_monitoring_input(port: *mut jack_port_t)
     -> ::libc::c_int;
    pub fn jack_connect(client: *mut jack_client_t,
                        source_port: *const ::libc::c_char,
                        destination_port: *const ::libc::c_char)
     -> ::libc::c_int;
    pub fn jack_disconnect(client: *mut jack_client_t,
                           source_port: *const ::libc::c_char,
                           destination_port: *const ::libc::c_char)
     -> ::libc::c_int;
    pub fn jack_port_disconnect(client: *mut jack_client_t,
                                port: *mut jack_port_t) -> ::libc::c_int;
    pub fn jack_port_name_size() -> ::libc::c_int;
    pub fn jack_port_type_size() -> ::libc::c_int;
    pub fn jack_port_type_get_buffer_size(client: *mut jack_client_t,
                                          port_type: *const ::libc::c_char)
     -> ::libc::size_t;
    pub fn jack_port_set_latency(port: *mut jack_port_t, arg1: jack_nframes_t)
     -> ();
    pub fn jack_port_get_latency_range(port: *mut jack_port_t,
                                       mode: jack_latency_callback_mode_t,
                                       range: *mut jack_latency_range_t)
     -> ();
    pub fn jack_port_set_latency_range(port: *mut jack_port_t,
                                       mode: jack_latency_callback_mode_t,
                                       range: *mut jack_latency_range_t)
     -> ();
    pub fn jack_recompute_total_latencies(client: *mut jack_client_t)
     -> ::libc::c_int;
    pub fn jack_port_get_latency(port: *mut jack_port_t) -> jack_nframes_t;
    pub fn jack_port_get_total_latency(client: *mut jack_client_t,
                                       port: *mut jack_port_t)
     -> jack_nframes_t;
    pub fn jack_recompute_total_latency(arg1: *mut jack_client_t,
                                        port: *mut jack_port_t)
     -> ::libc::c_int;
    pub fn jack_get_ports(client: *mut jack_client_t,
                          port_name_pattern: *const ::libc::c_char,
                          type_name_pattern: *const ::libc::c_char,
                          flags: ::libc::c_ulong)
     -> *mut *const ::libc::c_char;
    pub fn jack_port_by_name(client: *mut jack_client_t,
                             port_name: *const ::libc::c_char)
     -> *mut jack_port_t;
    pub fn jack_port_by_id(client: *mut jack_client_t,
                           port_id: jack_port_id_t) -> *mut jack_port_t;
    pub fn jack_frames_since_cycle_start(arg1: *const jack_client_t)
     -> jack_nframes_t;
    pub fn jack_frame_time(arg1: *const jack_client_t) -> jack_nframes_t;
    pub fn jack_last_frame_time(client: *const jack_client_t)
     -> jack_nframes_t;
    
    
    pub fn jack_frames_to_time(client: *const jack_client_t,
                               arg1: jack_nframes_t) -> jack_time_t;
    pub fn jack_time_to_frames(client: *const jack_client_t,
                               arg1: jack_time_t) -> jack_nframes_t;
    pub fn jack_get_time() -> jack_time_t;
    pub fn jack_set_error_function(func:
                                       ::std::option::Option<unsafe extern "C" fn(arg1:
                                                                               *const ::libc::c_char)
                                                                 -> ()>)
     -> ();
    pub fn jack_set_info_function(func:
                                      ::std::option::Option<unsafe extern "C" fn(arg1:
                                                                              *const ::libc::c_char)
                                                                -> ()>) -> ();
    pub fn jack_free(ptr: *mut ::libc::c_void) -> ();
    pub fn jack_client_real_time_priority(arg1: *mut jack_client_t)
     -> ::libc::c_int;
    pub fn jack_client_max_real_time_priority(arg1: *mut jack_client_t)
     -> ::libc::c_int;
    pub fn jack_acquire_real_time_scheduling(thread: jack_native_thread_t,
                                             priority: ::libc::c_int)
     -> ::libc::c_int;
    pub fn jack_client_create_thread(client: *mut jack_client_t,
                                     thread: *mut jack_native_thread_t,
                                     priority: ::libc::c_int,
                                     realtime: ::libc::c_int,
                                     start_routine:
                                         ::std::option::Option<unsafe extern "C" fn(arg1:
                                                                                 *mut ::libc::c_void)
                                                                   ->
                                                                       *mut ::libc::c_void>,
                                     arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_drop_real_time_scheduling(thread: jack_native_thread_t)
     -> ::libc::c_int;
    pub fn jack_client_stop_thread(client: *mut jack_client_t,
                                   thread: jack_native_thread_t)
     -> ::libc::c_int;
    pub fn jack_client_kill_thread(client: *mut jack_client_t,
                                   thread: jack_native_thread_t)
     -> ::libc::c_int;
    pub fn jack_set_thread_creator(creator: jack_thread_creator_t) -> ();
    pub fn jack_set_session_callback(client: *mut jack_client_t,
                                     session_callback: JackSessionCallback,
                                     arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_session_reply(client: *mut jack_client_t,
                              event: *mut jack_session_event_t)
     -> ::libc::c_int;
    pub fn jack_session_event_free(event: *mut jack_session_event_t) -> ();
    pub fn jack_client_get_uuid(client: *mut jack_client_t)
     -> *mut ::libc::c_char;
    pub fn jack_session_notify(client: *mut jack_client_t,
                               target: *const ::libc::c_char,
                               _type: jack_session_event_type_t,
                               path: *const ::libc::c_char)
     -> *mut jack_session_command_t;
    pub fn jack_session_commands_free(cmds: *mut jack_session_command_t)
     -> ();
    pub fn jack_reserve_client_name(client: *mut jack_client_t,
                                    name: *const ::libc::c_char,
                                    uuid: *const ::libc::c_char)
     -> ::libc::c_int;
    pub fn jack_client_has_session_callback(client: *mut jack_client_t,
                                            client_name:
                                                *const ::libc::c_char)
     -> ::libc::c_int;
    pub fn jackctl_setup_signals(flags: ::libc::c_uint)
     -> *mut jackctl_sigmask_t;
    pub fn jackctl_wait_signals(signals: *mut jackctl_sigmask_t) -> ();
    pub fn jackctl_server_create(on_device_acquire:
                                     ::std::option::Option<unsafe extern "C" fn(device_name:
                                                                             *const ::libc::c_char)
                                                               -> u8>,
                                 on_device_release:
                                     ::std::option::Option<unsafe extern "C" fn(device_name:
                                                                             *const ::libc::c_char)
                                                               -> ()>)
     -> *mut jackctl_server_t;
    pub fn jackctl_server_destroy(server: *mut jackctl_server_t) -> ();
    pub fn jackctl_server_open(server: *mut jackctl_server_t,
                               driver: *mut jackctl_driver_t) -> u8;
    pub fn jackctl_server_start(server: *mut jackctl_server_t) -> u8;
    pub fn jackctl_server_stop(server: *mut jackctl_server_t) -> u8;
    pub fn jackctl_server_close(server: *mut jackctl_server_t) -> u8;
    pub fn jackctl_server_get_drivers_list(server: *mut jackctl_server_t)
     -> *const JSList;
    pub fn jackctl_server_get_parameters(server: *mut jackctl_server_t)
     -> *const JSList;
    pub fn jackctl_server_get_internals_list(server: *mut jackctl_server_t)
     -> *const JSList;
    pub fn jackctl_server_load_internal(server: *mut jackctl_server_t,
                                        internal: *mut jackctl_internal_t)
     -> u8;
    pub fn jackctl_server_unload_internal(server: *mut jackctl_server_t,
                                          internal: *mut jackctl_internal_t)
     -> u8;
    pub fn jackctl_server_add_slave(server: *mut jackctl_server_t,
                                    driver: *mut jackctl_driver_t) -> u8;
    pub fn jackctl_server_remove_slave(server: *mut jackctl_server_t,
                                       driver: *mut jackctl_driver_t) -> u8;
    pub fn jackctl_server_switch_master(server: *mut jackctl_server_t,
                                        driver: *mut jackctl_driver_t) -> u8;
    pub fn jackctl_driver_get_name(driver: *mut jackctl_driver_t)
     -> *const ::libc::c_char;
    pub fn jackctl_driver_get_type(driver: *mut jackctl_driver_t)
     -> jackctl_driver_type_t;
    pub fn jackctl_driver_get_parameters(driver: *mut jackctl_driver_t)
     -> *const JSList;
    pub fn jackctl_driver_params_parse(driver: *mut jackctl_driver_t,
                                       argc: ::libc::c_int,
                                       argv: *mut *mut ::libc::c_char)
     -> ::libc::c_int;
    pub fn jackctl_internal_get_name(internal: *mut jackctl_internal_t)
     -> *const ::libc::c_char;
    pub fn jackctl_internal_get_parameters(internal: *mut jackctl_internal_t)
     -> *const JSList;
    pub fn jackctl_parameter_get_name(parameter: *mut jackctl_parameter_t)
     -> *const ::libc::c_char;
    pub fn jackctl_parameter_get_short_description(parameter:
                                                       *mut jackctl_parameter_t)
     -> *const ::libc::c_char;
    pub fn jackctl_parameter_get_long_description(parameter:
                                                      *mut jackctl_parameter_t)
     -> *const ::libc::c_char;
    pub fn jackctl_parameter_get_type(parameter: *mut jackctl_parameter_t)
     -> jackctl_param_type_t;
    pub fn jackctl_parameter_get_id(parameter: *mut jackctl_parameter_t)
     -> ::libc::c_char;
    pub fn jackctl_parameter_is_set(parameter: *mut jackctl_parameter_t)
     -> u8;
    pub fn jackctl_parameter_reset(parameter: *mut jackctl_parameter_t) -> u8;
    pub fn jackctl_parameter_get_value(parameter: *mut jackctl_parameter_t)
     -> Union_jackctl_parameter_value;
    pub fn jackctl_parameter_set_value(parameter: *mut jackctl_parameter_t,
                                       value_ptr:
                                           *const Union_jackctl_parameter_value)
     -> u8;
    pub fn jackctl_parameter_get_default_value(parameter:
                                                   *mut jackctl_parameter_t)
     -> Union_jackctl_parameter_value;
    pub fn jackctl_parameter_has_range_constraint(parameter:
                                                      *mut jackctl_parameter_t)
     -> u8;
    pub fn jackctl_parameter_has_enum_constraint(parameter:
                                                     *mut jackctl_parameter_t)
     -> u8;
    pub fn jackctl_parameter_get_enum_constraints_count(parameter:
                                                            *mut jackctl_parameter_t)
     -> ::libc::uint32_t;
    pub fn jackctl_parameter_get_enum_constraint_value(parameter:
                                                           *mut jackctl_parameter_t,
                                                       index: ::libc::uint32_t)
     -> Union_jackctl_parameter_value;
    pub fn jackctl_parameter_get_enum_constraint_description(parameter:
                                                                 *mut jackctl_parameter_t,
                                                             index: ::libc::uint32_t)
     -> *const ::libc::c_char;
    pub fn jackctl_parameter_get_range_constraint(parameter:
                                                      *mut jackctl_parameter_t,
                                                  min_ptr:
                                                      *mut Union_jackctl_parameter_value,
                                                  max_ptr:
                                                      *mut Union_jackctl_parameter_value)
     -> ();
    pub fn jackctl_parameter_constraint_is_strict(parameter:
                                                      *mut jackctl_parameter_t)
     -> u8;
    pub fn jackctl_parameter_constraint_is_fake_value(parameter:
                                                          *mut jackctl_parameter_t)
     -> u8;
    pub fn jack_error(format: *const ::libc::c_char, ...) -> ();
    pub fn jack_info(format: *const ::libc::c_char, ...) -> ();
    pub fn jack_log(format: *const ::libc::c_char, ...) -> ();
    pub fn jack_set_property(arg1: *mut jack_client_t, subject: jack_uuid_t,
                             key: *const ::libc::c_char,
                             value: *const ::libc::c_char,
                             _type: *const ::libc::c_char) -> ::libc::c_int;
    pub fn jack_get_property(subject: jack_uuid_t, key: *const ::libc::c_char,
                             value: *mut *mut ::libc::c_char,
                             _type: *mut *mut ::libc::c_char)
     -> ::libc::c_int;
    pub fn jack_free_description(desc: *mut jack_description_t,
                                 free_description_itself: ::libc::c_int)
     -> ();
    pub fn jack_get_properties(subject: jack_uuid_t,
                               desc: *mut jack_description_t)
     -> ::libc::c_int;
    pub fn jack_get_all_properties(descs: *mut *mut jack_description_t)
     -> ::libc::c_int;
    pub fn jack_remove_property(client: *mut jack_client_t,
                                subject: jack_uuid_t,
                                key: *const ::libc::c_char) -> ::libc::c_int;
    pub fn jack_remove_properties(client: *mut jack_client_t,
                                  subject: jack_uuid_t) -> ::libc::c_int;
    pub fn jack_remove_all_properties(client: *mut jack_client_t)
     -> ::libc::c_int;
    pub fn jack_set_property_change_callback(client: *mut jack_client_t,
                                             callback:
                                                 JackPropertyChangeCallback,
                                             arg: *mut ::libc::c_void)
     -> ::libc::c_int;
    pub fn jack_get_internal_client_name(client: *mut jack_client_t,
                                         intclient: jack_intclient_t)
     -> *mut ::libc::c_char;
    pub fn jack_internal_client_handle(client: *mut jack_client_t,
                                       client_name: *const ::libc::c_char,
                                       status: *mut jack_status_t)
     -> jack_intclient_t;
    pub fn jack_internal_client_load(client: *mut jack_client_t,
                                     client_name: *const ::libc::c_char,
                                     options: jack_options_t,
                                     status: *mut jack_status_t, ...)
     -> jack_intclient_t;
    pub fn jack_internal_client_unload(client: *mut jack_client_t,
                                       intclient: jack_intclient_t)
     -> jack_status_t;
    pub fn jack_get_max_delayed_usecs(client: *mut jack_client_t)
     -> ::libc::c_float;
    pub fn jack_get_xrun_delayed_usecs(client: *mut jack_client_t)
     -> ::libc::c_float;
    pub fn jack_reset_max_delayed_usecs(client: *mut jack_client_t) -> ();
    pub fn jack_midi_get_event_count(port_buffer: *mut ::libc::c_void)
     -> ::libc::uint32_t;
    pub fn jack_midi_event_get(event: *mut jack_midi_event_t,
                               port_buffer: *mut ::libc::c_void,
                               event_index: ::libc::uint32_t) -> ::libc::c_int;
    pub fn jack_midi_clear_buffer(port_buffer: *mut ::libc::c_void) -> ();
    pub fn jack_midi_reset_buffer(port_buffer: *mut ::libc::c_void) -> ();
    pub fn jack_midi_max_event_size(port_buffer: *mut ::libc::c_void)
     -> ::libc::size_t;
    pub fn jack_midi_event_reserve(port_buffer: *mut ::libc::c_void,
                                   time: jack_nframes_t, data_size: ::libc::size_t)
     -> *mut jack_midi_data_t;
    pub fn jack_midi_event_write(port_buffer: *mut ::libc::c_void,
                                 time: jack_nframes_t,
                                 data: *const jack_midi_data_t,
                                 data_size: ::libc::size_t) -> ::libc::c_int;
    pub fn jack_midi_get_lost_event_count(port_buffer: *mut ::libc::c_void)
     -> ::libc::uint32_t;
    pub fn jack_ringbuffer_create(sz: ::libc::size_t) -> *mut jack_ringbuffer_t;
    pub fn jack_ringbuffer_free(rb: *mut jack_ringbuffer_t) -> ();
    pub fn jack_ringbuffer_get_read_vector(rb: *const jack_ringbuffer_t,
                                           vec: *mut jack_ringbuffer_data_t)
     -> ();
    pub fn jack_ringbuffer_get_write_vector(rb: *const jack_ringbuffer_t,
                                            vec: *mut jack_ringbuffer_data_t)
     -> ();
    pub fn jack_ringbuffer_read(rb: *mut jack_ringbuffer_t,
                                dest: *mut ::libc::c_char, cnt: ::libc::size_t)
     -> ::libc::size_t;
    pub fn jack_ringbuffer_peek(rb: *mut jack_ringbuffer_t,
                                dest: *mut ::libc::c_char, cnt: ::libc::size_t)
     -> ::libc::size_t;
    pub fn jack_ringbuffer_read_advance(rb: *mut jack_ringbuffer_t,
                                        cnt: ::libc::size_t) -> ();
    pub fn jack_ringbuffer_read_space(rb: *const jack_ringbuffer_t) -> ::libc::size_t;
    pub fn jack_ringbuffer_mlock(rb: *mut jack_ringbuffer_t) -> ::libc::c_int;
    pub fn jack_ringbuffer_reset(rb: *mut jack_ringbuffer_t) -> ();
    pub fn jack_ringbuffer_reset_size(rb: *mut jack_ringbuffer_t, sz: ::libc::size_t)
     -> ();
    pub fn jack_ringbuffer_write(rb: *mut jack_ringbuffer_t,
                                 src: *const ::libc::c_char, cnt: ::libc::size_t)
     -> ::libc::size_t;
    pub fn jack_ringbuffer_write_advance(rb: *mut jack_ringbuffer_t,
                                         cnt: ::libc::size_t) -> ();
    pub fn jack_ringbuffer_write_space(rb: *const jack_ringbuffer_t)
     -> ::libc::size_t;
}

// Load optional functions:

#[cfg(windows)]
const jack_lib : &'static str = "libjack.dll";

#[cfg(unix)]
const jack_lib : &'static str = "libjack.so";

    
type jack_get_cycle_times_t = unsafe extern "C" fn(client: *const jack_client_t,
                                current_frames: *mut jack_nframes_t,
                                current_usecs: *mut jack_time_t,
                                next_usecs: *mut jack_time_t,
                                period_usecs: *mut ::libc::c_float) -> ::libc::c_int;

lazy_static! {
pub static ref jack_get_cycle_times : Option<jack_get_cycle_times_t> = {
        if let Ok(lib) = libloading::Library::new(jack_lib) {
            unsafe {
                if let Ok(sym) = lib.get::<jack_get_cycle_times_t>(b"jack_get_cycle_times\0") {
                    let sym = sym.into_raw();
                    Some(*sym.deref() as jack_get_cycle_times_t)
                } else {
                    None
                }
            }
        } else {
            None
        }
    };
}