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
/* automatically generated by rust-bindgen 0.61.0 */

use crate::{ca_access_rights, epicsThreadOSD};

pub const MAX_STRING_SIZE: i32 = 40;
pub const CA_K_INFO: i32 = 3;
pub const CA_K_ERROR: i32 = 2;
pub const CA_K_SUCCESS: i32 = 1;
pub const CA_K_WARNING: i32 = 0;
pub const CA_K_SEVERE: i32 = 4;
pub const CA_K_FATAL: i32 = 6;
pub const CA_M_MSG_NO: i32 = 65528;
pub const CA_M_SEVERITY: i32 = 7;
pub const CA_M_LEVEL: i32 = 3;
pub const CA_M_SUCCESS: i32 = 1;
pub const CA_M_ERROR: i32 = 2;
pub const CA_M_SEVERE: i32 = 4;
pub const CA_S_MSG_NO: i32 = 13;
pub const CA_S_SEVERITY: i32 = 3;
pub const CA_V_MSG_NO: i32 = 3;
pub const CA_V_SEVERITY: i32 = 0;
pub const CA_V_SUCCESS: i32 = 0;
pub const MAX_UNITS_SIZE: i32 = 8;
pub const MAX_ENUM_STRING_SIZE: i32 = 26;
pub const MAX_ENUM_STATES: i32 = 16;
pub const DBF_STRING: i32 = 0;
pub const DBF_INT: i32 = 1;
pub const DBF_SHORT: i32 = 1;
pub const DBF_FLOAT: i32 = 2;
pub const DBF_ENUM: i32 = 3;
pub const DBF_CHAR: i32 = 4;
pub const DBF_LONG: i32 = 5;
pub const DBF_DOUBLE: i32 = 6;
pub const DBF_NO_ACCESS: i32 = 7;
pub const LAST_TYPE: i32 = 6;
pub const DBR_STRING: i32 = 0;
pub const DBR_INT: i32 = 1;
pub const DBR_SHORT: i32 = 1;
pub const DBR_FLOAT: i32 = 2;
pub const DBR_ENUM: i32 = 3;
pub const DBR_CHAR: i32 = 4;
pub const DBR_LONG: i32 = 5;
pub const DBR_DOUBLE: i32 = 6;
pub const DBR_STS_STRING: i32 = 7;
pub const DBR_STS_SHORT: i32 = 8;
pub const DBR_STS_INT: i32 = 8;
pub const DBR_STS_FLOAT: i32 = 9;
pub const DBR_STS_ENUM: i32 = 10;
pub const DBR_STS_CHAR: i32 = 11;
pub const DBR_STS_LONG: i32 = 12;
pub const DBR_STS_DOUBLE: i32 = 13;
pub const DBR_TIME_STRING: i32 = 14;
pub const DBR_TIME_INT: i32 = 15;
pub const DBR_TIME_SHORT: i32 = 15;
pub const DBR_TIME_FLOAT: i32 = 16;
pub const DBR_TIME_ENUM: i32 = 17;
pub const DBR_TIME_CHAR: i32 = 18;
pub const DBR_TIME_LONG: i32 = 19;
pub const DBR_TIME_DOUBLE: i32 = 20;
pub const DBR_GR_STRING: i32 = 21;
pub const DBR_GR_SHORT: i32 = 22;
pub const DBR_GR_INT: i32 = 22;
pub const DBR_GR_FLOAT: i32 = 23;
pub const DBR_GR_ENUM: i32 = 24;
pub const DBR_GR_CHAR: i32 = 25;
pub const DBR_GR_LONG: i32 = 26;
pub const DBR_GR_DOUBLE: i32 = 27;
pub const DBR_CTRL_STRING: i32 = 28;
pub const DBR_CTRL_SHORT: i32 = 29;
pub const DBR_CTRL_INT: i32 = 29;
pub const DBR_CTRL_FLOAT: i32 = 30;
pub const DBR_CTRL_ENUM: i32 = 31;
pub const DBR_CTRL_CHAR: i32 = 32;
pub const DBR_CTRL_LONG: i32 = 33;
pub const DBR_CTRL_DOUBLE: i32 = 34;
pub const DBR_PUT_ACKT: i32 = 35;
pub const DBR_PUT_ACKS: i32 = 36;
pub const DBR_STSACK_STRING: i32 = 37;
pub const DBR_CLASS_NAME: i32 = 38;
pub const LAST_BUFFER_TYPE: i32 = 38;
pub const db_strval_dim: i32 = 40;
pub const db_units_dim: i32 = 8;
pub const db_desc_dim: i32 = 24;
pub const db_name_dim: i32 = 36;
pub const db_state_dim: i32 = 16;
pub const db_state_text_dim: i32 = 26;
pub const DBE_VALUE: i32 = 1;
pub const DBE_ARCHIVE: i32 = 2;
pub const DBE_LOG: i32 = 2;
pub const DBE_ALARM: i32 = 4;
pub const DBE_PROPERTY: i32 = 8;
pub const CA_OP_GET: i32 = 0;
pub const CA_OP_PUT: i32 = 1;
pub const CA_OP_CREATE_CHANNEL: i32 = 2;
pub const CA_OP_ADD_EVENT: i32 = 3;
pub const CA_OP_CLEAR_EVENT: i32 = 4;
pub const CA_OP_OTHER: i32 = 5;
pub const CA_OP_CONN_UP: i32 = 6;
pub const CA_OP_CONN_DOWN: i32 = 7;
pub const CA_OP_SEARCH: i32 = 2;
pub const TYPENOTCONN: i32 = -1;
pub const CA_PRIORITY_MAX: i32 = 99;
pub const CA_PRIORITY_MIN: i32 = 0;
pub const CA_PRIORITY_DEFAULT: i32 = 0;
pub const CA_PRIORITY_DB_LINKS: i32 = 80;
pub const CA_PRIORITY_ARCHIVE: i32 = 20;
pub const CA_PRIORITY_OPI: i32 = 0;
pub const NO_ALARM: i32 = 0;
pub type epicsThreadId = *mut epicsThreadOSD;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum epicsBoolean {
    epicsFalse = 0,
    epicsTrue = 1,
}
pub type epicsInt8 = libc::c_schar;
pub type epicsUInt8 = libc::c_uchar;
pub type epicsInt16 = libc::c_short;
pub type epicsUInt16 = libc::c_ushort;
pub type epicsInt32 = libc::c_int;
pub type epicsUInt32 = libc::c_uint;
pub type epicsInt64 = libc::c_longlong;
pub type epicsUInt64 = libc::c_ulonglong;
pub type epicsEnum16 = epicsUInt16;
pub type epicsFloat32 = f32;
pub type epicsFloat64 = f64;
pub type epicsStatus = epicsInt32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct epicsString {
    pub length: libc::c_uint,
    pub pString: *mut libc::c_char,
}
pub type epicsOldString = [libc::c_char; 40usize];
#[repr(C)]
#[derive(Copy, Clone)]
pub union epics_any {
    pub int8: epicsInt8,
    pub uInt8: epicsUInt8,
    pub int16: epicsInt16,
    pub uInt16: epicsUInt16,
    pub enum16: epicsEnum16,
    pub int32: epicsInt32,
    pub uInt32: epicsUInt32,
    pub int64: epicsInt64,
    pub uInt64: epicsUInt64,
    pub float32: epicsFloat32,
    pub float64: epicsFloat64,
    pub string: epicsString,
}
pub type epicsAny = epics_any;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum epicsType {
    epicsInt8T = 0,
    epicsUInt8T = 1,
    epicsInt16T = 2,
    epicsUInt16T = 3,
    epicsEnum16T = 4,
    epicsInt32T = 5,
    epicsUInt32T = 6,
    epicsFloat32T = 7,
    epicsFloat64T = 8,
    epicsStringT = 9,
    epicsOldStringT = 10,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum epicsTypeClass {
    epicsIntC = 0,
    epicsUIntC = 1,
    epicsEnumC = 2,
    epicsFloatC = 3,
    epicsStringC = 4,
    epicsOldStringC = 5,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct epicsTimeStamp {
    pub secPastEpoch: epicsUInt32,
    pub nsec: epicsUInt32,
}
pub type dbr_string_t = epicsOldString;
pub type dbr_char_t = epicsUInt8;
pub type dbr_short_t = epicsInt16;
pub type dbr_ushort_t = epicsUInt16;
pub type dbr_int_t = epicsInt16;
pub type dbr_enum_t = epicsUInt16;
pub type dbr_long_t = epicsInt32;
pub type dbr_ulong_t = epicsUInt32;
pub type dbr_float_t = epicsFloat32;
pub type dbr_double_t = epicsFloat64;
pub type dbr_put_ackt_t = epicsUInt16;
pub type dbr_put_acks_t = epicsUInt16;
pub type dbr_stsack_string_t = epicsOldString;
pub type dbr_class_name_t = epicsOldString;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_sts_string {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub value: dbr_string_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_stsack_string {
    pub status: dbr_ushort_t,
    pub severity: dbr_ushort_t,
    pub ackt: dbr_ushort_t,
    pub acks: dbr_ushort_t,
    pub value: dbr_string_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_sts_int {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub value: dbr_short_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_sts_short {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub value: dbr_short_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_sts_float {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub value: dbr_float_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_sts_enum {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub value: dbr_enum_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_sts_char {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub RISC_pad: dbr_char_t,
    pub value: dbr_char_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_sts_long {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub value: dbr_long_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_sts_double {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub RISC_pad: dbr_long_t,
    pub value: dbr_double_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_time_string {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub stamp: epicsTimeStamp,
    pub value: dbr_string_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_time_short {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub stamp: epicsTimeStamp,
    pub RISC_pad: dbr_short_t,
    pub value: dbr_short_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_time_float {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub stamp: epicsTimeStamp,
    pub value: dbr_float_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_time_enum {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub stamp: epicsTimeStamp,
    pub RISC_pad: dbr_short_t,
    pub value: dbr_enum_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_time_char {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub stamp: epicsTimeStamp,
    pub RISC_pad0: dbr_short_t,
    pub RISC_pad1: dbr_char_t,
    pub value: dbr_char_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_time_long {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub stamp: epicsTimeStamp,
    pub value: dbr_long_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_time_double {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub stamp: epicsTimeStamp,
    pub RISC_pad: dbr_long_t,
    pub value: dbr_double_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_gr_int {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_short_t,
    pub lower_disp_limit: dbr_short_t,
    pub upper_alarm_limit: dbr_short_t,
    pub upper_warning_limit: dbr_short_t,
    pub lower_warning_limit: dbr_short_t,
    pub lower_alarm_limit: dbr_short_t,
    pub value: dbr_short_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_gr_short {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_short_t,
    pub lower_disp_limit: dbr_short_t,
    pub upper_alarm_limit: dbr_short_t,
    pub upper_warning_limit: dbr_short_t,
    pub lower_warning_limit: dbr_short_t,
    pub lower_alarm_limit: dbr_short_t,
    pub value: dbr_short_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_gr_float {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub precision: dbr_short_t,
    pub RISC_pad0: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_float_t,
    pub lower_disp_limit: dbr_float_t,
    pub upper_alarm_limit: dbr_float_t,
    pub upper_warning_limit: dbr_float_t,
    pub lower_warning_limit: dbr_float_t,
    pub lower_alarm_limit: dbr_float_t,
    pub value: dbr_float_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_gr_enum {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub no_str: dbr_short_t,
    pub strs: [[libc::c_char; 26usize]; 16usize],
    pub value: dbr_enum_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_gr_char {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_char_t,
    pub lower_disp_limit: dbr_char_t,
    pub upper_alarm_limit: dbr_char_t,
    pub upper_warning_limit: dbr_char_t,
    pub lower_warning_limit: dbr_char_t,
    pub lower_alarm_limit: dbr_char_t,
    pub RISC_pad: dbr_char_t,
    pub value: dbr_char_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_gr_long {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_long_t,
    pub lower_disp_limit: dbr_long_t,
    pub upper_alarm_limit: dbr_long_t,
    pub upper_warning_limit: dbr_long_t,
    pub lower_warning_limit: dbr_long_t,
    pub lower_alarm_limit: dbr_long_t,
    pub value: dbr_long_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_gr_double {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub precision: dbr_short_t,
    pub RISC_pad0: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_double_t,
    pub lower_disp_limit: dbr_double_t,
    pub upper_alarm_limit: dbr_double_t,
    pub upper_warning_limit: dbr_double_t,
    pub lower_warning_limit: dbr_double_t,
    pub lower_alarm_limit: dbr_double_t,
    pub value: dbr_double_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_ctrl_int {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_short_t,
    pub lower_disp_limit: dbr_short_t,
    pub upper_alarm_limit: dbr_short_t,
    pub upper_warning_limit: dbr_short_t,
    pub lower_warning_limit: dbr_short_t,
    pub lower_alarm_limit: dbr_short_t,
    pub upper_ctrl_limit: dbr_short_t,
    pub lower_ctrl_limit: dbr_short_t,
    pub value: dbr_short_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_ctrl_short {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_short_t,
    pub lower_disp_limit: dbr_short_t,
    pub upper_alarm_limit: dbr_short_t,
    pub upper_warning_limit: dbr_short_t,
    pub lower_warning_limit: dbr_short_t,
    pub lower_alarm_limit: dbr_short_t,
    pub upper_ctrl_limit: dbr_short_t,
    pub lower_ctrl_limit: dbr_short_t,
    pub value: dbr_short_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_ctrl_float {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub precision: dbr_short_t,
    pub RISC_pad: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_float_t,
    pub lower_disp_limit: dbr_float_t,
    pub upper_alarm_limit: dbr_float_t,
    pub upper_warning_limit: dbr_float_t,
    pub lower_warning_limit: dbr_float_t,
    pub lower_alarm_limit: dbr_float_t,
    pub upper_ctrl_limit: dbr_float_t,
    pub lower_ctrl_limit: dbr_float_t,
    pub value: dbr_float_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_ctrl_enum {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub no_str: dbr_short_t,
    pub strs: [[libc::c_char; 26usize]; 16usize],
    pub value: dbr_enum_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_ctrl_char {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_char_t,
    pub lower_disp_limit: dbr_char_t,
    pub upper_alarm_limit: dbr_char_t,
    pub upper_warning_limit: dbr_char_t,
    pub lower_warning_limit: dbr_char_t,
    pub lower_alarm_limit: dbr_char_t,
    pub upper_ctrl_limit: dbr_char_t,
    pub lower_ctrl_limit: dbr_char_t,
    pub RISC_pad: dbr_char_t,
    pub value: dbr_char_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_ctrl_long {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_long_t,
    pub lower_disp_limit: dbr_long_t,
    pub upper_alarm_limit: dbr_long_t,
    pub upper_warning_limit: dbr_long_t,
    pub lower_warning_limit: dbr_long_t,
    pub lower_alarm_limit: dbr_long_t,
    pub upper_ctrl_limit: dbr_long_t,
    pub lower_ctrl_limit: dbr_long_t,
    pub value: dbr_long_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dbr_ctrl_double {
    pub status: dbr_short_t,
    pub severity: dbr_short_t,
    pub precision: dbr_short_t,
    pub RISC_pad0: dbr_short_t,
    pub units: [libc::c_char; 8usize],
    pub upper_disp_limit: dbr_double_t,
    pub lower_disp_limit: dbr_double_t,
    pub upper_alarm_limit: dbr_double_t,
    pub upper_warning_limit: dbr_double_t,
    pub lower_warning_limit: dbr_double_t,
    pub lower_alarm_limit: dbr_double_t,
    pub upper_ctrl_limit: dbr_double_t,
    pub lower_ctrl_limit: dbr_double_t,
    pub value: dbr_double_t,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum dbr_value_class {
    dbr_class_int = 0,
    dbr_class_float = 1,
    dbr_class_string = 2,
    dbr_class_max = 3,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union db_access_val {
    pub strval: dbr_string_t,
    pub shrtval: dbr_short_t,
    pub intval: dbr_short_t,
    pub fltval: dbr_float_t,
    pub enmval: dbr_enum_t,
    pub charval: dbr_char_t,
    pub longval: dbr_long_t,
    pub doubleval: dbr_double_t,
    pub sstrval: dbr_sts_string,
    pub sshrtval: dbr_sts_short,
    pub sfltval: dbr_sts_float,
    pub senmval: dbr_sts_enum,
    pub schrval: dbr_sts_char,
    pub slngval: dbr_sts_long,
    pub sdblval: dbr_sts_double,
    pub tstrval: dbr_time_string,
    pub tshrtval: dbr_time_short,
    pub tfltval: dbr_time_float,
    pub tenmval: dbr_time_enum,
    pub tchrval: dbr_time_char,
    pub tlngval: dbr_time_long,
    pub tdblval: dbr_time_double,
    pub gstrval: dbr_sts_string,
    pub gshrtval: dbr_gr_short,
    pub gfltval: dbr_gr_float,
    pub genmval: dbr_gr_enum,
    pub gchrval: dbr_gr_char,
    pub glngval: dbr_gr_long,
    pub gdblval: dbr_gr_double,
    pub cstrval: dbr_sts_string,
    pub cshrtval: dbr_ctrl_short,
    pub cfltval: dbr_ctrl_float,
    pub cenmval: dbr_ctrl_enum,
    pub cchrval: dbr_ctrl_char,
    pub clngval: dbr_ctrl_long,
    pub cdblval: dbr_ctrl_double,
    pub putackt: dbr_put_ackt_t,
    pub putacks: dbr_put_acks_t,
    pub sastrval: dbr_sts_string,
    pub classname: dbr_string_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct oldChannelNotify {
    _unused: [u8; 0],
}
pub type chid = *mut oldChannelNotify;
pub type chanId = chid;
pub type chtype = libc::c_long;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct oldSubscription {
    _unused: [u8; 0],
}
pub type evid = *mut oldSubscription;
pub type ca_real = f64;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct connection_handler_args {
    pub chid: chanId,
    pub op: libc::c_long,
}
pub type caCh = ::core::option::Option<unsafe extern "C" fn(args: connection_handler_args)>;
pub type caar = ca_access_rights;
#[repr(C)]
pub struct access_rights_handler_args {
    pub chid: chanId,
    pub ar: caar,
}
pub type caArh = ::core::option::Option<unsafe extern "C" fn(args: access_rights_handler_args)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct event_handler_args {
    pub usr: *mut libc::c_void,
    pub chid: chanId,
    pub type_: libc::c_long,
    pub count: libc::c_long,
    pub dbr: *const libc::c_void,
    pub status: libc::c_int,
}
pub type evargs = event_handler_args;
pub type caEventCallBackFunc =
    ::core::option::Option<unsafe extern "C" fn(arg1: event_handler_args)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct exception_handler_args {
    pub usr: *mut libc::c_void,
    pub chid: chanId,
    pub type_: libc::c_long,
    pub count: libc::c_long,
    pub addr: *mut libc::c_void,
    pub stat: libc::c_long,
    pub op: libc::c_long,
    pub ctx: *const libc::c_char,
    pub pFile: *const libc::c_char,
    pub lineNo: libc::c_uint,
}
pub type CA_SYNC_GID = libc::c_uint;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum channel_state {
    cs_never_conn = 0,
    cs_prev_conn = 1,
    cs_conn = 2,
    cs_closed = 3,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ca_preemptive_callback_select {
    ca_disable_preemptive_callback = 0,
    ca_enable_preemptive_callback = 1,
}
pub type capri = libc::c_uint;
pub type caExceptionHandler =
    ::core::option::Option<unsafe extern "C" fn(arg1: exception_handler_args)>;
pub type CAFDHANDLER = ::core::option::Option<
    unsafe extern "C" fn(parg: *mut libc::c_void, fd: libc::c_int, opened: libc::c_int),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ca_client_context {
    _unused: [u8; 0],
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum epicsAlarmSeverity {
    epicsSevNone = 0,
    epicsSevMinor = 1,
    epicsSevMajor = 2,
    epicsSevInvalid = 3,
    ALARM_NSEV = 4,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum epicsAlarmCondition {
    epicsAlarmNone = 0,
    epicsAlarmRead = 1,
    epicsAlarmWrite = 2,
    epicsAlarmHiHi = 3,
    epicsAlarmHigh = 4,
    epicsAlarmLoLo = 5,
    epicsAlarmLow = 6,
    epicsAlarmState = 7,
    epicsAlarmCos = 8,
    epicsAlarmComm = 9,
    epicsAlarmTimeout = 10,
    epicsAlarmHwLimit = 11,
    epicsAlarmCalc = 12,
    epicsAlarmScan = 13,
    epicsAlarmLink = 14,
    epicsAlarmSoft = 15,
    epicsAlarmBadSub = 16,
    epicsAlarmUDF = 17,
    epicsAlarmDisable = 18,
    epicsAlarmSimm = 19,
    epicsAlarmReadAccess = 20,
    epicsAlarmWriteAccess = 21,
    ALARM_NSTATUS = 22,
}
extern "C" {
    pub static mut epicsTypeNames: [*const libc::c_char; 11usize];
    pub static mut epicsTypeCodeNames: [*const libc::c_char; 11usize];
    pub static epicsTypeSizes: [libc::c_uint; 11usize];
    pub static epicsTypeClasses: [epicsTypeClass; 11usize];
    pub static mut epicsTypeAnyFieldName: [*const libc::c_char; 11usize];
    pub fn ca_message(ca_status: libc::c_long) -> *const libc::c_char;
    pub static mut ca_message_text: [*const libc::c_char; 0usize];
    pub static epicsTypeToDBR_XXXX: [libc::c_int; 11usize];
    pub static DBR_XXXXToEpicsType: [epicsType; 39usize];
    pub static dbr_size: [libc::c_ushort; 0usize];
    pub static dbr_value_size: [libc::c_ushort; 0usize];
    pub static dbr_value_class: [dbr_value_class; 39usize];
    pub static dbr_value_offset: [libc::c_ushort; 39usize];
    pub static mut dbf_text: [*const libc::c_char; 9usize];
    pub static dbf_text_dim: libc::c_short;
    pub static mut dbf_text_invalid: *const libc::c_char;
    pub static mut dbr_text: [*const libc::c_char; 39usize];
    pub static dbr_text_dim: libc::c_short;
    pub static mut dbr_text_invalid: *const libc::c_char;
    pub fn ca_test_event(arg1: event_handler_args);
    pub fn ca_field_type(chan: chid) -> libc::c_short;
    pub fn ca_element_count(chan: chid) -> libc::c_ulong;
    pub fn ca_name(chan: chid) -> *const libc::c_char;
    pub fn ca_set_puser(chan: chid, puser: *mut libc::c_void);
    pub fn ca_puser(chan: chid) -> *mut libc::c_void;
    pub fn ca_read_access(chan: chid) -> libc::c_uint;
    pub fn ca_write_access(chan: chid) -> libc::c_uint;
    pub fn ca_state(chan: chid) -> channel_state;
    pub fn ca_task_initialize() -> libc::c_int;
    pub fn ca_context_create(select: ca_preemptive_callback_select) -> libc::c_int;
    pub fn ca_detach_context();
    pub fn ca_task_exit() -> libc::c_int;
    pub fn ca_context_destroy();
    pub fn ca_create_channel(
        pChanName: *const libc::c_char,
        pConnStateCallback: caCh,
        pUserPrivate: *mut libc::c_void,
        priority: capri,
        pChanID: *mut chid,
    ) -> libc::c_int;
    pub fn ca_change_connection_event(chan: chid, pfunc: caCh) -> libc::c_int;
    pub fn ca_replace_access_rights_event(chan: chid, pfunc: caArh) -> libc::c_int;
    pub fn ca_add_exception_event(
        pfunc: caExceptionHandler,
        pArg: *mut libc::c_void,
    ) -> libc::c_int;
    pub fn ca_clear_channel(chanId: chid) -> libc::c_int;
    pub fn ca_array_put(
        type_: chtype,
        count: libc::c_ulong,
        chanId: chid,
        pValue: *const libc::c_void,
    ) -> libc::c_int;
    pub fn ca_array_put_callback(
        type_: chtype,
        count: libc::c_ulong,
        chanId: chid,
        pValue: *const libc::c_void,
        pFunc: caEventCallBackFunc,
        pArg: *mut libc::c_void,
    ) -> libc::c_int;
    pub fn ca_array_get(
        type_: chtype,
        count: libc::c_ulong,
        chanId: chid,
        pValue: *mut libc::c_void,
    ) -> libc::c_int;
    pub fn ca_array_get_callback(
        type_: chtype,
        count: libc::c_ulong,
        chanId: chid,
        pFunc: caEventCallBackFunc,
        pArg: *mut libc::c_void,
    ) -> libc::c_int;
    pub fn ca_create_subscription(
        type_: chtype,
        count: libc::c_ulong,
        chanId: chid,
        mask: libc::c_long,
        pFunc: caEventCallBackFunc,
        pArg: *mut libc::c_void,
        pEventID: *mut evid,
    ) -> libc::c_int;
    pub fn ca_clear_subscription(eventID: evid) -> libc::c_int;
    pub fn ca_evid_to_chid(id: evid) -> chid;
    pub fn ca_pend_event(timeout: ca_real) -> libc::c_int;
    pub fn ca_pend_io(timeout: ca_real) -> libc::c_int;
    pub fn ca_pend(timeout: ca_real, early: libc::c_int) -> libc::c_int;
    pub fn ca_test_io() -> libc::c_int;
    pub fn ca_flush_io() -> libc::c_int;
    pub fn ca_signal(errorCode: libc::c_long, pCtxStr: *const libc::c_char);
    pub fn ca_signal_with_file_and_lineno(
        errorCode: libc::c_long,
        pCtxStr: *const libc::c_char,
        pFileStr: *const libc::c_char,
        lineNo: libc::c_int,
    );
    pub fn ca_signal_formated(
        ca_status: libc::c_long,
        pfilenm: *const libc::c_char,
        lineno: libc::c_int,
        pFormat: *const libc::c_char,
        ...
    );
    pub fn ca_host_name(channel: chid) -> *const libc::c_char;
    pub fn ca_get_host_name(
        pChan: chid,
        pBuf: *mut libc::c_char,
        bufLength: libc::c_uint,
    ) -> libc::c_uint;
    pub fn ca_add_fd_registration(pHandler: CAFDHANDLER, pArg: *mut libc::c_void) -> libc::c_int;
    pub fn ca_sg_create(pgid: *mut CA_SYNC_GID) -> libc::c_int;
    pub fn ca_sg_delete(gid: CA_SYNC_GID) -> libc::c_int;
    pub fn ca_sg_block(gid: CA_SYNC_GID, timeout: ca_real) -> libc::c_int;
    pub fn ca_sg_test(gid: CA_SYNC_GID) -> libc::c_int;
    pub fn ca_sg_reset(gid: CA_SYNC_GID) -> libc::c_int;
    pub fn ca_sg_array_get(
        gid: CA_SYNC_GID,
        type_: chtype,
        count: libc::c_ulong,
        chan: chid,
        pValue: *mut libc::c_void,
    ) -> libc::c_int;
    pub fn ca_sg_array_put(
        gid: CA_SYNC_GID,
        type_: chtype,
        count: libc::c_ulong,
        chan: chid,
        pValue: *const libc::c_void,
    ) -> libc::c_int;
    pub fn ca_sg_stat(gid: CA_SYNC_GID) -> libc::c_int;
    pub fn ca_dump_dbr(type_: chtype, count: libc::c_uint, pbuffer: *const libc::c_void);
    pub fn ca_v42_ok(chan: chid) -> libc::c_int;
    pub fn ca_version() -> *const libc::c_char;
    pub fn ca_get_ioc_connection_count() -> libc::c_uint;
    pub fn ca_preemtive_callback_is_enabled() -> libc::c_int;
    pub fn ca_self_test();
    pub fn ca_beacon_anomaly_count() -> libc::c_uint;
    pub fn ca_search_attempts(chan: chid) -> libc::c_uint;
    pub fn ca_beacon_period(chan: chid) -> f64;
    pub fn ca_receive_watchdog_delay(chan: chid) -> f64;
    pub fn ca_current_context() -> *mut ca_client_context;
    pub fn ca_attach_context(context: *mut ca_client_context) -> libc::c_int;
    pub fn ca_client_status(level: libc::c_uint) -> libc::c_int;
    pub fn ca_context_status(arg1: *mut ca_client_context, level: libc::c_uint) -> libc::c_int;
    pub fn ca_build_and_connect(
        pChanName: *const libc::c_char,
        arg1: chtype,
        arg2: libc::c_ulong,
        pChanID: *mut chid,
        arg3: *mut libc::c_void,
        pFunc: caCh,
        pArg: *mut libc::c_void,
    ) -> libc::c_int;
    pub fn ca_search_and_connect(
        pChanName: *const libc::c_char,
        pChanID: *mut chid,
        pFunc: caCh,
        pArg: *mut libc::c_void,
    ) -> libc::c_int;
    pub fn ca_channel_status(tid: epicsThreadId) -> libc::c_int;
    pub fn ca_clear_event(eventID: evid) -> libc::c_int;
    pub fn ca_add_masked_array_event(
        type_: chtype,
        count: libc::c_ulong,
        chanId: chid,
        pFunc: caEventCallBackFunc,
        pArg: *mut libc::c_void,
        p_delta: ca_real,
        n_delta: ca_real,
        timeout: ca_real,
        pEventID: *mut evid,
        mask: libc::c_long,
    ) -> libc::c_int;
    pub fn ca_modify_user_name(pUserName: *const libc::c_char) -> libc::c_int;
    pub fn ca_modify_host_name(pHostName: *const libc::c_char) -> libc::c_int;
    pub static mut epicsAlarmSeverityStrings: [*const libc::c_char; 4usize];
    pub static mut epicsAlarmConditionStrings: [*const libc::c_char; 22usize];
}