-
Notifications
You must be signed in to change notification settings - Fork 30
/
yara-4.1.1-unix.rs
3890 lines (3889 loc) · 108 KB
/
yara-4.1.1-unix.rs
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
990
991
992
993
994
995
996
997
998
999
1000
/* automatically generated by rust-bindgen 0.58.1 */
pub const STRING_FLAGS_LAST_IN_RULE: u32 = 4096;
pub const META_TYPE_INTEGER: u32 = 1;
pub const META_TYPE_STRING: u32 = 2;
pub const META_TYPE_BOOLEAN: u32 = 3;
pub const META_FLAGS_LAST_IN_RULE: u32 = 1;
pub const YARA_ERROR_LEVEL_ERROR: u32 = 0;
pub const YARA_ERROR_LEVEL_WARNING: u32 = 1;
pub const ERROR_SUCCESS: u32 = 0;
pub const ERROR_INSUFICIENT_MEMORY: u32 = 1;
pub const ERROR_INSUFFICIENT_MEMORY: u32 = 1;
pub const ERROR_COULD_NOT_ATTACH_TO_PROCESS: u32 = 2;
pub const ERROR_COULD_NOT_OPEN_FILE: u32 = 3;
pub const ERROR_COULD_NOT_MAP_FILE: u32 = 4;
pub const ERROR_INVALID_FILE: u32 = 6;
pub const ERROR_CORRUPT_FILE: u32 = 7;
pub const ERROR_UNSUPPORTED_FILE_VERSION: u32 = 8;
pub const ERROR_INVALID_REGULAR_EXPRESSION: u32 = 9;
pub const ERROR_INVALID_HEX_STRING: u32 = 10;
pub const ERROR_SYNTAX_ERROR: u32 = 11;
pub const ERROR_LOOP_NESTING_LIMIT_EXCEEDED: u32 = 12;
pub const ERROR_DUPLICATED_LOOP_IDENTIFIER: u32 = 13;
pub const ERROR_DUPLICATED_IDENTIFIER: u32 = 14;
pub const ERROR_DUPLICATED_TAG_IDENTIFIER: u32 = 15;
pub const ERROR_DUPLICATED_META_IDENTIFIER: u32 = 16;
pub const ERROR_DUPLICATED_STRING_IDENTIFIER: u32 = 17;
pub const ERROR_UNREFERENCED_STRING: u32 = 18;
pub const ERROR_UNDEFINED_STRING: u32 = 19;
pub const ERROR_UNDEFINED_IDENTIFIER: u32 = 20;
pub const ERROR_MISPLACED_ANONYMOUS_STRING: u32 = 21;
pub const ERROR_INCLUDES_CIRCULAR_REFERENCE: u32 = 22;
pub const ERROR_INCLUDE_DEPTH_EXCEEDED: u32 = 23;
pub const ERROR_WRONG_TYPE: u32 = 24;
pub const ERROR_EXEC_STACK_OVERFLOW: u32 = 25;
pub const ERROR_SCAN_TIMEOUT: u32 = 26;
pub const ERROR_TOO_MANY_SCAN_THREADS: u32 = 27;
pub const ERROR_CALLBACK_ERROR: u32 = 28;
pub const ERROR_INVALID_ARGUMENT: u32 = 29;
pub const ERROR_TOO_MANY_MATCHES: u32 = 30;
pub const ERROR_INTERNAL_FATAL_ERROR: u32 = 31;
pub const ERROR_NESTED_FOR_OF_LOOP: u32 = 32;
pub const ERROR_INVALID_FIELD_NAME: u32 = 33;
pub const ERROR_UNKNOWN_MODULE: u32 = 34;
pub const ERROR_NOT_A_STRUCTURE: u32 = 35;
pub const ERROR_NOT_INDEXABLE: u32 = 36;
pub const ERROR_NOT_A_FUNCTION: u32 = 37;
pub const ERROR_INVALID_FORMAT: u32 = 38;
pub const ERROR_TOO_MANY_ARGUMENTS: u32 = 39;
pub const ERROR_WRONG_ARGUMENTS: u32 = 40;
pub const ERROR_WRONG_RETURN_TYPE: u32 = 41;
pub const ERROR_DUPLICATED_STRUCTURE_MEMBER: u32 = 42;
pub const ERROR_EMPTY_STRING: u32 = 43;
pub const ERROR_DIVISION_BY_ZERO: u32 = 44;
pub const ERROR_REGULAR_EXPRESSION_TOO_LARGE: u32 = 45;
pub const ERROR_TOO_MANY_RE_FIBERS: u32 = 46;
pub const ERROR_COULD_NOT_READ_PROCESS_MEMORY: u32 = 47;
pub const ERROR_INVALID_EXTERNAL_VARIABLE_TYPE: u32 = 48;
pub const ERROR_REGULAR_EXPRESSION_TOO_COMPLEX: u32 = 49;
pub const ERROR_INVALID_MODULE_NAME: u32 = 50;
pub const ERROR_TOO_MANY_STRINGS: u32 = 51;
pub const ERROR_INTEGER_OVERFLOW: u32 = 52;
pub const ERROR_CALLBACK_REQUIRED: u32 = 53;
pub const ERROR_INVALID_OPERAND: u32 = 54;
pub const ERROR_COULD_NOT_READ_FILE: u32 = 55;
pub const ERROR_DUPLICATED_EXTERNAL_VARIABLE: u32 = 56;
pub const ERROR_INVALID_MODULE_DATA: u32 = 57;
pub const ERROR_WRITING_FILE: u32 = 58;
pub const ERROR_INVALID_MODIFIER: u32 = 59;
pub const ERROR_DUPLICATED_MODIFIER: u32 = 60;
pub const ERROR_BLOCK_NOT_READY: u32 = 61;
pub const CALLBACK_MSG_RULE_MATCHING: u32 = 1;
pub const CALLBACK_MSG_RULE_NOT_MATCHING: u32 = 2;
pub const CALLBACK_MSG_SCAN_FINISHED: u32 = 3;
pub const CALLBACK_MSG_IMPORT_MODULE: u32 = 4;
pub const CALLBACK_MSG_MODULE_IMPORTED: u32 = 5;
pub const CALLBACK_MSG_TOO_MANY_MATCHES: u32 = 6;
pub const CALLBACK_CONTINUE: u32 = 0;
pub const CALLBACK_ABORT: u32 = 1;
pub const CALLBACK_ERROR: u32 = 2;
pub const SCAN_FLAGS_FAST_MODE: u32 = 1;
pub const SCAN_FLAGS_PROCESS_MEMORY: u32 = 2;
pub const SCAN_FLAGS_NO_TRYCATCH: u32 = 4;
pub const SCAN_FLAGS_REPORT_RULES_MATCHING: u32 = 8;
pub const SCAN_FLAGS_REPORT_RULES_NOT_MATCHING: u32 = 16;
pub type size_t = ::std::os::raw::c_ulong;
pub type __uint8_t = ::std::os::raw::c_uchar;
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_long;
pub type __uint64_t = ::std::os::raw::c_ulong;
pub type __off_t = ::std::os::raw::c_long;
pub type __off64_t = ::std::os::raw::c_long;
pub type __time_t = ::std::os::raw::c_long;
pub type __suseconds_t = ::std::os::raw::c_long;
pub type __syscall_slong_t = ::std::os::raw::c_long;
pub type FILE = _IO_FILE;
pub type _IO_lock_t = ::std::os::raw::c_void;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_marker {
pub _next: *mut _IO_marker,
pub _sbuf: *mut _IO_FILE,
pub _pos: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout__IO_marker() {
assert_eq!(
::std::mem::size_of::<_IO_marker>(),
24usize,
concat!("Size of: ", stringify!(_IO_marker))
);
assert_eq!(
::std::mem::align_of::<_IO_marker>(),
8usize,
concat!("Alignment of ", stringify!(_IO_marker))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_marker>()))._next as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_IO_marker),
"::",
stringify!(_next)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_marker>()))._sbuf as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_IO_marker),
"::",
stringify!(_sbuf)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_marker>()))._pos as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_IO_marker),
"::",
stringify!(_pos)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_FILE {
pub _flags: ::std::os::raw::c_int,
pub _IO_read_ptr: *mut ::std::os::raw::c_char,
pub _IO_read_end: *mut ::std::os::raw::c_char,
pub _IO_read_base: *mut ::std::os::raw::c_char,
pub _IO_write_base: *mut ::std::os::raw::c_char,
pub _IO_write_ptr: *mut ::std::os::raw::c_char,
pub _IO_write_end: *mut ::std::os::raw::c_char,
pub _IO_buf_base: *mut ::std::os::raw::c_char,
pub _IO_buf_end: *mut ::std::os::raw::c_char,
pub _IO_save_base: *mut ::std::os::raw::c_char,
pub _IO_backup_base: *mut ::std::os::raw::c_char,
pub _IO_save_end: *mut ::std::os::raw::c_char,
pub _markers: *mut _IO_marker,
pub _chain: *mut _IO_FILE,
pub _fileno: ::std::os::raw::c_int,
pub _flags2: ::std::os::raw::c_int,
pub _old_offset: __off_t,
pub _cur_column: ::std::os::raw::c_ushort,
pub _vtable_offset: ::std::os::raw::c_schar,
pub _shortbuf: [::std::os::raw::c_char; 1usize],
pub _lock: *mut _IO_lock_t,
pub _offset: __off64_t,
pub __pad1: *mut ::std::os::raw::c_void,
pub __pad2: *mut ::std::os::raw::c_void,
pub __pad3: *mut ::std::os::raw::c_void,
pub __pad4: *mut ::std::os::raw::c_void,
pub __pad5: size_t,
pub _mode: ::std::os::raw::c_int,
pub _unused2: [::std::os::raw::c_char; 20usize],
}
#[test]
fn bindgen_test_layout__IO_FILE() {
assert_eq!(
::std::mem::size_of::<_IO_FILE>(),
216usize,
concat!("Size of: ", stringify!(_IO_FILE))
);
assert_eq!(
::std::mem::align_of::<_IO_FILE>(),
8usize,
concat!("Alignment of ", stringify!(_IO_FILE))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._flags as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_ptr as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_ptr)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_end as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_end)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_base as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_base)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_base as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_base)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_ptr as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_ptr)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_end as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_end)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_base as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_buf_base)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_end as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_buf_end)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_base as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_save_base)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_backup_base as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_backup_base)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_end as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_save_end)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._markers as *const _ as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_markers)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._chain as *const _ as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_chain)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._fileno as *const _ as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_fileno)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._flags2 as *const _ as usize },
116usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_flags2)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._old_offset as *const _ as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_old_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._cur_column as *const _ as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_cur_column)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._vtable_offset as *const _ as usize },
130usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_vtable_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._shortbuf as *const _ as usize },
131usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_shortbuf)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._lock as *const _ as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_lock)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._offset as *const _ as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad1 as *const _ as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(__pad1)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad2 as *const _ as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(__pad2)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad3 as *const _ as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(__pad3)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad4 as *const _ as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(__pad4)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad5 as *const _ as usize },
184usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(__pad5)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._mode as *const _ as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_mode)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._unused2 as *const _ as usize },
196usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_unused2)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct timeval {
pub tv_sec: __time_t,
pub tv_usec: __suseconds_t,
}
#[test]
fn bindgen_test_layout_timeval() {
assert_eq!(
::std::mem::size_of::<timeval>(),
16usize,
concat!("Size of: ", stringify!(timeval))
);
assert_eq!(
::std::mem::align_of::<timeval>(),
8usize,
concat!("Alignment of ", stringify!(timeval))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<timeval>())).tv_sec as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(timeval),
"::",
stringify!(tv_sec)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<timeval>())).tv_usec as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(timeval),
"::",
stringify!(tv_usec)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct timespec {
pub tv_sec: __time_t,
pub tv_nsec: __syscall_slong_t,
}
#[test]
fn bindgen_test_layout_timespec() {
assert_eq!(
::std::mem::size_of::<timespec>(),
16usize,
concat!("Size of: ", stringify!(timespec))
);
assert_eq!(
::std::mem::align_of::<timespec>(),
8usize,
concat!("Alignment of ", stringify!(timespec))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<timespec>())).tv_sec as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(timespec),
"::",
stringify!(tv_sec)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<timespec>())).tv_nsec as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(timespec),
"::",
stringify!(tv_nsec)
)
);
}
pub type YR_STREAM_READ_FUNC = ::std::option::Option<
unsafe extern "C" fn(
ptr: *mut ::std::os::raw::c_void,
size: size_t,
count: size_t,
user_data: *mut ::std::os::raw::c_void,
) -> size_t,
>;
pub type YR_STREAM_WRITE_FUNC = ::std::option::Option<
unsafe extern "C" fn(
ptr: *const ::std::os::raw::c_void,
size: size_t,
count: size_t,
user_data: *mut ::std::os::raw::c_void,
) -> size_t,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _YR_STREAM {
pub user_data: *mut ::std::os::raw::c_void,
pub read: YR_STREAM_READ_FUNC,
pub write: YR_STREAM_WRITE_FUNC,
}
#[test]
fn bindgen_test_layout__YR_STREAM() {
assert_eq!(
::std::mem::size_of::<_YR_STREAM>(),
24usize,
concat!("Size of: ", stringify!(_YR_STREAM))
);
assert_eq!(
::std::mem::align_of::<_YR_STREAM>(),
8usize,
concat!("Alignment of ", stringify!(_YR_STREAM))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_YR_STREAM>())).user_data as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_YR_STREAM),
"::",
stringify!(user_data)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_YR_STREAM>())).read as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_YR_STREAM),
"::",
stringify!(read)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_YR_STREAM>())).write as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_YR_STREAM),
"::",
stringify!(write)
)
);
}
pub type YR_STREAM = _YR_STREAM;
pub type yr_arena_off_t = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct YR_ARENA_REF {
pub buffer_id: u32,
pub offset: yr_arena_off_t,
}
#[test]
fn bindgen_test_layout_YR_ARENA_REF() {
assert_eq!(
::std::mem::size_of::<YR_ARENA_REF>(),
8usize,
concat!("Size of: ", stringify!(YR_ARENA_REF))
);
assert_eq!(
::std::mem::align_of::<YR_ARENA_REF>(),
4usize,
concat!("Alignment of ", stringify!(YR_ARENA_REF))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_ARENA_REF>())).buffer_id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(YR_ARENA_REF),
"::",
stringify!(buffer_id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_ARENA_REF>())).offset as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(YR_ARENA_REF),
"::",
stringify!(offset)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct YR_ARENA_BUFFER {
pub data: *mut u8,
pub size: size_t,
pub used: size_t,
}
#[test]
fn bindgen_test_layout_YR_ARENA_BUFFER() {
assert_eq!(
::std::mem::size_of::<YR_ARENA_BUFFER>(),
24usize,
concat!("Size of: ", stringify!(YR_ARENA_BUFFER))
);
assert_eq!(
::std::mem::align_of::<YR_ARENA_BUFFER>(),
8usize,
concat!("Alignment of ", stringify!(YR_ARENA_BUFFER))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_ARENA_BUFFER>())).data as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(YR_ARENA_BUFFER),
"::",
stringify!(data)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_ARENA_BUFFER>())).size as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(YR_ARENA_BUFFER),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_ARENA_BUFFER>())).used as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(YR_ARENA_BUFFER),
"::",
stringify!(used)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct YR_RELOC {
pub buffer_id: u32,
pub offset: yr_arena_off_t,
pub next: *mut YR_RELOC,
}
#[test]
fn bindgen_test_layout_YR_RELOC() {
assert_eq!(
::std::mem::size_of::<YR_RELOC>(),
16usize,
concat!("Size of: ", stringify!(YR_RELOC))
);
assert_eq!(
::std::mem::align_of::<YR_RELOC>(),
8usize,
concat!("Alignment of ", stringify!(YR_RELOC))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_RELOC>())).buffer_id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(YR_RELOC),
"::",
stringify!(buffer_id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_RELOC>())).offset as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(YR_RELOC),
"::",
stringify!(offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_RELOC>())).next as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(YR_RELOC),
"::",
stringify!(next)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct YR_ARENA {
pub xrefs: u32,
pub num_buffers: u32,
pub buffers: [YR_ARENA_BUFFER; 16usize],
pub initial_buffer_size: size_t,
pub reloc_list_head: *mut YR_RELOC,
pub reloc_list_tail: *mut YR_RELOC,
}
#[test]
fn bindgen_test_layout_YR_ARENA() {
assert_eq!(
::std::mem::size_of::<YR_ARENA>(),
416usize,
concat!("Size of: ", stringify!(YR_ARENA))
);
assert_eq!(
::std::mem::align_of::<YR_ARENA>(),
8usize,
concat!("Alignment of ", stringify!(YR_ARENA))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_ARENA>())).xrefs as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(YR_ARENA),
"::",
stringify!(xrefs)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_ARENA>())).num_buffers as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(YR_ARENA),
"::",
stringify!(num_buffers)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_ARENA>())).buffers as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(YR_ARENA),
"::",
stringify!(buffers)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_ARENA>())).initial_buffer_size as *const _ as usize },
392usize,
concat!(
"Offset of field: ",
stringify!(YR_ARENA),
"::",
stringify!(initial_buffer_size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_ARENA>())).reloc_list_head as *const _ as usize },
400usize,
concat!(
"Offset of field: ",
stringify!(YR_ARENA),
"::",
stringify!(reloc_list_head)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<YR_ARENA>())).reloc_list_tail as *const _ as usize },
408usize,
concat!(
"Offset of field: ",
stringify!(YR_ARENA),
"::",
stringify!(reloc_list_tail)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _YR_HASH_TABLE_ENTRY {
pub key: *mut ::std::os::raw::c_void,
pub key_length: size_t,
pub ns: *mut ::std::os::raw::c_char,
pub value: *mut ::std::os::raw::c_void,
pub next: *mut _YR_HASH_TABLE_ENTRY,
}
#[test]
fn bindgen_test_layout__YR_HASH_TABLE_ENTRY() {
assert_eq!(
::std::mem::size_of::<_YR_HASH_TABLE_ENTRY>(),
40usize,
concat!("Size of: ", stringify!(_YR_HASH_TABLE_ENTRY))
);
assert_eq!(
::std::mem::align_of::<_YR_HASH_TABLE_ENTRY>(),
8usize,
concat!("Alignment of ", stringify!(_YR_HASH_TABLE_ENTRY))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_YR_HASH_TABLE_ENTRY>())).key as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_YR_HASH_TABLE_ENTRY),
"::",
stringify!(key)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_YR_HASH_TABLE_ENTRY>())).key_length as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_YR_HASH_TABLE_ENTRY),
"::",
stringify!(key_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_YR_HASH_TABLE_ENTRY>())).ns as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_YR_HASH_TABLE_ENTRY),
"::",
stringify!(ns)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_YR_HASH_TABLE_ENTRY>())).value as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(_YR_HASH_TABLE_ENTRY),
"::",
stringify!(value)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_YR_HASH_TABLE_ENTRY>())).next as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(_YR_HASH_TABLE_ENTRY),
"::",
stringify!(next)
)
);
}
pub type YR_HASH_TABLE_ENTRY = _YR_HASH_TABLE_ENTRY;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _YR_HASH_TABLE {
pub size: ::std::os::raw::c_int,
pub buckets: [*mut YR_HASH_TABLE_ENTRY; 1usize],
}
#[test]
fn bindgen_test_layout__YR_HASH_TABLE() {
assert_eq!(
::std::mem::size_of::<_YR_HASH_TABLE>(),
16usize,
concat!("Size of: ", stringify!(_YR_HASH_TABLE))
);
assert_eq!(
::std::mem::align_of::<_YR_HASH_TABLE>(),
8usize,
concat!("Alignment of ", stringify!(_YR_HASH_TABLE))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_YR_HASH_TABLE>())).size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_YR_HASH_TABLE),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_YR_HASH_TABLE>())).buckets as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_YR_HASH_TABLE),
"::",
stringify!(buckets)
)
);
}
pub type YR_HASH_TABLE = _YR_HASH_TABLE;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _YR_STOPWATCH {
pub __bindgen_anon_1: _YR_STOPWATCH__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union _YR_STOPWATCH__bindgen_ty_1 {
pub tv_start: timeval,
pub ts_start: timespec,
}
#[test]
fn bindgen_test_layout__YR_STOPWATCH__bindgen_ty_1() {
assert_eq!(
::std::mem::size_of::<_YR_STOPWATCH__bindgen_ty_1>(),
16usize,
concat!("Size of: ", stringify!(_YR_STOPWATCH__bindgen_ty_1))
);
assert_eq!(
::std::mem::align_of::<_YR_STOPWATCH__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(_YR_STOPWATCH__bindgen_ty_1))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_YR_STOPWATCH__bindgen_ty_1>())).tv_start as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(_YR_STOPWATCH__bindgen_ty_1),
"::",
stringify!(tv_start)
)