-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphysfs_bindings.rs
1187 lines (1186 loc) · 36.2 KB
/
physfs_bindings.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 PHYSFS_VER_MAJOR: u32 = 3;
pub const PHYSFS_VER_MINOR: u32 = 0;
pub const PHYSFS_VER_PATCH: u32 = 2;
pub type PHYSFS_uint8 = ::std::os::raw::c_uchar;
pub type PHYSFS_sint8 = ::std::os::raw::c_schar;
pub type PHYSFS_uint16 = ::std::os::raw::c_ushort;
pub type PHYSFS_sint16 = ::std::os::raw::c_short;
pub type PHYSFS_uint32 = ::std::os::raw::c_uint;
pub type PHYSFS_sint32 = ::std::os::raw::c_int;
pub type PHYSFS_uint64 = ::std::os::raw::c_ulonglong;
pub type PHYSFS_sint64 = ::std::os::raw::c_longlong;
pub type PHYSFS_compile_time_assert_uint8IsOneByte = [::std::os::raw::c_int; 1usize];
pub type PHYSFS_compile_time_assert_sint8IsOneByte = [::std::os::raw::c_int; 1usize];
pub type PHYSFS_compile_time_assert_uint16IsTwoBytes = [::std::os::raw::c_int; 1usize];
pub type PHYSFS_compile_time_assert_sint16IsTwoBytes = [::std::os::raw::c_int; 1usize];
pub type PHYSFS_compile_time_assert_uint32IsFourBytes = [::std::os::raw::c_int; 1usize];
pub type PHYSFS_compile_time_assert_sint32IsFourBytes = [::std::os::raw::c_int; 1usize];
pub type PHYSFS_compile_time_assert_uint64IsEightBytes = [::std::os::raw::c_int; 1usize];
pub type PHYSFS_compile_time_assert_sint64IsEightBytes = [::std::os::raw::c_int; 1usize];
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PHYSFS_File {
pub opaque: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout_PHYSFS_File() {
assert_eq!(
::std::mem::size_of::<PHYSFS_File>(),
8usize,
concat!("Size of: ", stringify!(PHYSFS_File))
);
assert_eq!(
::std::mem::align_of::<PHYSFS_File>(),
8usize,
concat!("Alignment of ", stringify!(PHYSFS_File))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_File>())).opaque as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_File),
"::",
stringify!(opaque)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PHYSFS_ArchiveInfo {
pub extension: *const ::std::os::raw::c_char,
pub description: *const ::std::os::raw::c_char,
pub author: *const ::std::os::raw::c_char,
pub url: *const ::std::os::raw::c_char,
pub supportsSymlinks: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_PHYSFS_ArchiveInfo() {
assert_eq!(
::std::mem::size_of::<PHYSFS_ArchiveInfo>(),
40usize,
concat!("Size of: ", stringify!(PHYSFS_ArchiveInfo))
);
assert_eq!(
::std::mem::align_of::<PHYSFS_ArchiveInfo>(),
8usize,
concat!("Alignment of ", stringify!(PHYSFS_ArchiveInfo))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_ArchiveInfo>())).extension as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_ArchiveInfo),
"::",
stringify!(extension)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_ArchiveInfo>())).description as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_ArchiveInfo),
"::",
stringify!(description)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_ArchiveInfo>())).author as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_ArchiveInfo),
"::",
stringify!(author)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_ArchiveInfo>())).url as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_ArchiveInfo),
"::",
stringify!(url)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<PHYSFS_ArchiveInfo>())).supportsSymlinks as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_ArchiveInfo),
"::",
stringify!(supportsSymlinks)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PHYSFS_Version {
pub major: PHYSFS_uint8,
pub minor: PHYSFS_uint8,
pub patch: PHYSFS_uint8,
}
#[test]
fn bindgen_test_layout_PHYSFS_Version() {
assert_eq!(
::std::mem::size_of::<PHYSFS_Version>(),
3usize,
concat!("Size of: ", stringify!(PHYSFS_Version))
);
assert_eq!(
::std::mem::align_of::<PHYSFS_Version>(),
1usize,
concat!("Alignment of ", stringify!(PHYSFS_Version))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Version>())).major as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Version),
"::",
stringify!(major)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Version>())).minor as *const _ as usize },
1usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Version),
"::",
stringify!(minor)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Version>())).patch as *const _ as usize },
2usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Version),
"::",
stringify!(patch)
)
);
}
extern "C" {
pub fn PHYSFS_getLinkedVersion(ver: *mut PHYSFS_Version);
}
extern "C" {
pub fn PHYSFS_init(argv0: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_deinit() -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_supportedArchiveTypes() -> *mut *const PHYSFS_ArchiveInfo;
}
extern "C" {
pub fn PHYSFS_freeList(listVar: *mut ::std::os::raw::c_void);
}
extern "C" {
pub fn PHYSFS_getLastError() -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn PHYSFS_getDirSeparator() -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn PHYSFS_permitSymbolicLinks(allow: ::std::os::raw::c_int);
}
extern "C" {
pub fn PHYSFS_getCdRomDirs() -> *mut *mut ::std::os::raw::c_char;
}
extern "C" {
pub fn PHYSFS_getBaseDir() -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn PHYSFS_getUserDir() -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn PHYSFS_getWriteDir() -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn PHYSFS_setWriteDir(newDir: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_addToSearchPath(
newDir: *const ::std::os::raw::c_char,
appendToPath: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_removeFromSearchPath(
oldDir: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_getSearchPath() -> *mut *mut ::std::os::raw::c_char;
}
extern "C" {
pub fn PHYSFS_setSaneConfig(
organization: *const ::std::os::raw::c_char,
appName: *const ::std::os::raw::c_char,
archiveExt: *const ::std::os::raw::c_char,
includeCdRoms: ::std::os::raw::c_int,
archivesFirst: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_mkdir(dirName: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_delete(filename: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_getRealDir(
filename: *const ::std::os::raw::c_char,
) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn PHYSFS_enumerateFiles(
dir: *const ::std::os::raw::c_char,
) -> *mut *mut ::std::os::raw::c_char;
}
extern "C" {
pub fn PHYSFS_exists(fname: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_isDirectory(fname: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_isSymbolicLink(fname: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_getLastModTime(filename: *const ::std::os::raw::c_char) -> PHYSFS_sint64;
}
extern "C" {
pub fn PHYSFS_openWrite(filename: *const ::std::os::raw::c_char) -> *mut PHYSFS_File;
}
extern "C" {
pub fn PHYSFS_openAppend(filename: *const ::std::os::raw::c_char) -> *mut PHYSFS_File;
}
extern "C" {
pub fn PHYSFS_openRead(filename: *const ::std::os::raw::c_char) -> *mut PHYSFS_File;
}
extern "C" {
pub fn PHYSFS_close(handle: *mut PHYSFS_File) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_read(
handle: *mut PHYSFS_File,
buffer: *mut ::std::os::raw::c_void,
objSize: PHYSFS_uint32,
objCount: PHYSFS_uint32,
) -> PHYSFS_sint64;
}
extern "C" {
pub fn PHYSFS_write(
handle: *mut PHYSFS_File,
buffer: *const ::std::os::raw::c_void,
objSize: PHYSFS_uint32,
objCount: PHYSFS_uint32,
) -> PHYSFS_sint64;
}
extern "C" {
pub fn PHYSFS_eof(handle: *mut PHYSFS_File) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_tell(handle: *mut PHYSFS_File) -> PHYSFS_sint64;
}
extern "C" {
pub fn PHYSFS_seek(handle: *mut PHYSFS_File, pos: PHYSFS_uint64) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_fileLength(handle: *mut PHYSFS_File) -> PHYSFS_sint64;
}
extern "C" {
pub fn PHYSFS_setBuffer(
handle: *mut PHYSFS_File,
bufsize: PHYSFS_uint64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_flush(handle: *mut PHYSFS_File) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_swapSLE16(val: PHYSFS_sint16) -> PHYSFS_sint16;
}
extern "C" {
pub fn PHYSFS_swapULE16(val: PHYSFS_uint16) -> PHYSFS_uint16;
}
extern "C" {
pub fn PHYSFS_swapSLE32(val: PHYSFS_sint32) -> PHYSFS_sint32;
}
extern "C" {
pub fn PHYSFS_swapULE32(val: PHYSFS_uint32) -> PHYSFS_uint32;
}
extern "C" {
pub fn PHYSFS_swapSLE64(val: PHYSFS_sint64) -> PHYSFS_sint64;
}
extern "C" {
pub fn PHYSFS_swapULE64(val: PHYSFS_uint64) -> PHYSFS_uint64;
}
extern "C" {
pub fn PHYSFS_swapSBE16(val: PHYSFS_sint16) -> PHYSFS_sint16;
}
extern "C" {
pub fn PHYSFS_swapUBE16(val: PHYSFS_uint16) -> PHYSFS_uint16;
}
extern "C" {
pub fn PHYSFS_swapSBE32(val: PHYSFS_sint32) -> PHYSFS_sint32;
}
extern "C" {
pub fn PHYSFS_swapUBE32(val: PHYSFS_uint32) -> PHYSFS_uint32;
}
extern "C" {
pub fn PHYSFS_swapSBE64(val: PHYSFS_sint64) -> PHYSFS_sint64;
}
extern "C" {
pub fn PHYSFS_swapUBE64(val: PHYSFS_uint64) -> PHYSFS_uint64;
}
extern "C" {
pub fn PHYSFS_readSLE16(
file: *mut PHYSFS_File,
val: *mut PHYSFS_sint16,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_readULE16(
file: *mut PHYSFS_File,
val: *mut PHYSFS_uint16,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_readSBE16(
file: *mut PHYSFS_File,
val: *mut PHYSFS_sint16,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_readUBE16(
file: *mut PHYSFS_File,
val: *mut PHYSFS_uint16,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_readSLE32(
file: *mut PHYSFS_File,
val: *mut PHYSFS_sint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_readULE32(
file: *mut PHYSFS_File,
val: *mut PHYSFS_uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_readSBE32(
file: *mut PHYSFS_File,
val: *mut PHYSFS_sint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_readUBE32(
file: *mut PHYSFS_File,
val: *mut PHYSFS_uint32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_readSLE64(
file: *mut PHYSFS_File,
val: *mut PHYSFS_sint64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_readULE64(
file: *mut PHYSFS_File,
val: *mut PHYSFS_uint64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_readSBE64(
file: *mut PHYSFS_File,
val: *mut PHYSFS_sint64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_readUBE64(
file: *mut PHYSFS_File,
val: *mut PHYSFS_uint64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeSLE16(file: *mut PHYSFS_File, val: PHYSFS_sint16) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeULE16(file: *mut PHYSFS_File, val: PHYSFS_uint16) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeSBE16(file: *mut PHYSFS_File, val: PHYSFS_sint16) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeUBE16(file: *mut PHYSFS_File, val: PHYSFS_uint16) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeSLE32(file: *mut PHYSFS_File, val: PHYSFS_sint32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeULE32(file: *mut PHYSFS_File, val: PHYSFS_uint32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeSBE32(file: *mut PHYSFS_File, val: PHYSFS_sint32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeUBE32(file: *mut PHYSFS_File, val: PHYSFS_uint32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeSLE64(file: *mut PHYSFS_File, val: PHYSFS_sint64) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeULE64(file: *mut PHYSFS_File, val: PHYSFS_uint64) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeSBE64(file: *mut PHYSFS_File, val: PHYSFS_sint64) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_writeUBE64(file: *mut PHYSFS_File, val: PHYSFS_uint64) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_isInit() -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_symbolicLinksPermitted() -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PHYSFS_Allocator {
pub Init: ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int>,
pub Deinit: ::std::option::Option<unsafe extern "C" fn()>,
pub Malloc: ::std::option::Option<
unsafe extern "C" fn(arg1: PHYSFS_uint64) -> *mut ::std::os::raw::c_void,
>,
pub Realloc: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ::std::os::raw::c_void,
arg2: PHYSFS_uint64,
) -> *mut ::std::os::raw::c_void,
>,
pub Free: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
}
#[test]
fn bindgen_test_layout_PHYSFS_Allocator() {
assert_eq!(
::std::mem::size_of::<PHYSFS_Allocator>(),
40usize,
concat!("Size of: ", stringify!(PHYSFS_Allocator))
);
assert_eq!(
::std::mem::align_of::<PHYSFS_Allocator>(),
8usize,
concat!("Alignment of ", stringify!(PHYSFS_Allocator))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Allocator>())).Init as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Allocator),
"::",
stringify!(Init)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Allocator>())).Deinit as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Allocator),
"::",
stringify!(Deinit)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Allocator>())).Malloc as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Allocator),
"::",
stringify!(Malloc)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Allocator>())).Realloc as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Allocator),
"::",
stringify!(Realloc)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Allocator>())).Free as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Allocator),
"::",
stringify!(Free)
)
);
}
extern "C" {
pub fn PHYSFS_setAllocator(allocator: *const PHYSFS_Allocator) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_mount(
newDir: *const ::std::os::raw::c_char,
mountPoint: *const ::std::os::raw::c_char,
appendToPath: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_getMountPoint(
dir: *const ::std::os::raw::c_char,
) -> *const ::std::os::raw::c_char;
}
pub type PHYSFS_StringCallback = ::std::option::Option<
unsafe extern "C" fn(data: *mut ::std::os::raw::c_void, str_: *const ::std::os::raw::c_char),
>;
pub type PHYSFS_EnumFilesCallback = ::std::option::Option<
unsafe extern "C" fn(
data: *mut ::std::os::raw::c_void,
origdir: *const ::std::os::raw::c_char,
fname: *const ::std::os::raw::c_char,
),
>;
extern "C" {
pub fn PHYSFS_getCdRomDirsCallback(c: PHYSFS_StringCallback, d: *mut ::std::os::raw::c_void);
}
extern "C" {
pub fn PHYSFS_getSearchPathCallback(c: PHYSFS_StringCallback, d: *mut ::std::os::raw::c_void);
}
extern "C" {
pub fn PHYSFS_enumerateFilesCallback(
dir: *const ::std::os::raw::c_char,
c: PHYSFS_EnumFilesCallback,
d: *mut ::std::os::raw::c_void,
);
}
extern "C" {
pub fn PHYSFS_utf8FromUcs4(
src: *const PHYSFS_uint32,
dst: *mut ::std::os::raw::c_char,
len: PHYSFS_uint64,
);
}
extern "C" {
pub fn PHYSFS_utf8ToUcs4(
src: *const ::std::os::raw::c_char,
dst: *mut PHYSFS_uint32,
len: PHYSFS_uint64,
);
}
extern "C" {
pub fn PHYSFS_utf8FromUcs2(
src: *const PHYSFS_uint16,
dst: *mut ::std::os::raw::c_char,
len: PHYSFS_uint64,
);
}
extern "C" {
pub fn PHYSFS_utf8ToUcs2(
src: *const ::std::os::raw::c_char,
dst: *mut PHYSFS_uint16,
len: PHYSFS_uint64,
);
}
extern "C" {
pub fn PHYSFS_utf8FromLatin1(
src: *const ::std::os::raw::c_char,
dst: *mut ::std::os::raw::c_char,
len: PHYSFS_uint64,
);
}
extern "C" {
pub fn PHYSFS_caseFold(from: PHYSFS_uint32, to: *mut PHYSFS_uint32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_utf8stricmp(
str1: *const ::std::os::raw::c_char,
str2: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_utf16stricmp(
str1: *const PHYSFS_uint16,
str2: *const PHYSFS_uint16,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_ucs4stricmp(
str1: *const PHYSFS_uint32,
str2: *const PHYSFS_uint32,
) -> ::std::os::raw::c_int;
}
pub const PHYSFS_EnumerateCallbackResult_PHYSFS_ENUM_ERROR: PHYSFS_EnumerateCallbackResult = -1;
pub const PHYSFS_EnumerateCallbackResult_PHYSFS_ENUM_STOP: PHYSFS_EnumerateCallbackResult = 0;
pub const PHYSFS_EnumerateCallbackResult_PHYSFS_ENUM_OK: PHYSFS_EnumerateCallbackResult = 1;
pub type PHYSFS_EnumerateCallbackResult = ::std::os::raw::c_int;
pub type PHYSFS_EnumerateCallback = ::std::option::Option<
unsafe extern "C" fn(
data: *mut ::std::os::raw::c_void,
origdir: *const ::std::os::raw::c_char,
fname: *const ::std::os::raw::c_char,
) -> PHYSFS_EnumerateCallbackResult,
>;
extern "C" {
pub fn PHYSFS_enumerate(
dir: *const ::std::os::raw::c_char,
c: PHYSFS_EnumerateCallback,
d: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_unmount(oldDir: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_getAllocator() -> *const PHYSFS_Allocator;
}
pub const PHYSFS_FileType_PHYSFS_FILETYPE_REGULAR: PHYSFS_FileType = 0;
pub const PHYSFS_FileType_PHYSFS_FILETYPE_DIRECTORY: PHYSFS_FileType = 1;
pub const PHYSFS_FileType_PHYSFS_FILETYPE_SYMLINK: PHYSFS_FileType = 2;
pub const PHYSFS_FileType_PHYSFS_FILETYPE_OTHER: PHYSFS_FileType = 3;
pub type PHYSFS_FileType = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PHYSFS_Stat {
pub filesize: PHYSFS_sint64,
pub modtime: PHYSFS_sint64,
pub createtime: PHYSFS_sint64,
pub accesstime: PHYSFS_sint64,
pub filetype: PHYSFS_FileType,
pub readonly: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_PHYSFS_Stat() {
assert_eq!(
::std::mem::size_of::<PHYSFS_Stat>(),
40usize,
concat!("Size of: ", stringify!(PHYSFS_Stat))
);
assert_eq!(
::std::mem::align_of::<PHYSFS_Stat>(),
8usize,
concat!("Alignment of ", stringify!(PHYSFS_Stat))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Stat>())).filesize as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Stat),
"::",
stringify!(filesize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Stat>())).modtime as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Stat),
"::",
stringify!(modtime)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Stat>())).createtime as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Stat),
"::",
stringify!(createtime)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Stat>())).accesstime as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Stat),
"::",
stringify!(accesstime)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Stat>())).filetype as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Stat),
"::",
stringify!(filetype)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Stat>())).readonly as *const _ as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Stat),
"::",
stringify!(readonly)
)
);
}
extern "C" {
pub fn PHYSFS_stat(
fname: *const ::std::os::raw::c_char,
stat: *mut PHYSFS_Stat,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_utf8FromUtf16(
src: *const PHYSFS_uint16,
dst: *mut ::std::os::raw::c_char,
len: PHYSFS_uint64,
);
}
extern "C" {
pub fn PHYSFS_utf8ToUtf16(
src: *const ::std::os::raw::c_char,
dst: *mut PHYSFS_uint16,
len: PHYSFS_uint64,
);
}
extern "C" {
pub fn PHYSFS_readBytes(
handle: *mut PHYSFS_File,
buffer: *mut ::std::os::raw::c_void,
len: PHYSFS_uint64,
) -> PHYSFS_sint64;
}
extern "C" {
pub fn PHYSFS_writeBytes(
handle: *mut PHYSFS_File,
buffer: *const ::std::os::raw::c_void,
len: PHYSFS_uint64,
) -> PHYSFS_sint64;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PHYSFS_Io {
pub version: PHYSFS_uint32,
pub opaque: *mut ::std::os::raw::c_void,
pub read: ::std::option::Option<
unsafe extern "C" fn(
io: *mut PHYSFS_Io,
buf: *mut ::std::os::raw::c_void,
len: PHYSFS_uint64,
) -> PHYSFS_sint64,
>,
pub write: ::std::option::Option<
unsafe extern "C" fn(
io: *mut PHYSFS_Io,
buffer: *const ::std::os::raw::c_void,
len: PHYSFS_uint64,
) -> PHYSFS_sint64,
>,
pub seek: ::std::option::Option<
unsafe extern "C" fn(io: *mut PHYSFS_Io, offset: PHYSFS_uint64) -> ::std::os::raw::c_int,
>,
pub tell: ::std::option::Option<unsafe extern "C" fn(io: *mut PHYSFS_Io) -> PHYSFS_sint64>,
pub length: ::std::option::Option<unsafe extern "C" fn(io: *mut PHYSFS_Io) -> PHYSFS_sint64>,
pub duplicate:
::std::option::Option<unsafe extern "C" fn(io: *mut PHYSFS_Io) -> *mut PHYSFS_Io>,
pub flush:
::std::option::Option<unsafe extern "C" fn(io: *mut PHYSFS_Io) -> ::std::os::raw::c_int>,
pub destroy: ::std::option::Option<unsafe extern "C" fn(io: *mut PHYSFS_Io)>,
}
#[test]
fn bindgen_test_layout_PHYSFS_Io() {
assert_eq!(
::std::mem::size_of::<PHYSFS_Io>(),
80usize,
concat!("Size of: ", stringify!(PHYSFS_Io))
);
assert_eq!(
::std::mem::align_of::<PHYSFS_Io>(),
8usize,
concat!("Alignment of ", stringify!(PHYSFS_Io))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Io>())).version as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Io),
"::",
stringify!(version)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Io>())).opaque as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Io),
"::",
stringify!(opaque)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Io>())).read as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Io),
"::",
stringify!(read)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Io>())).write as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Io),
"::",
stringify!(write)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Io>())).seek as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Io),
"::",
stringify!(seek)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Io>())).tell as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Io),
"::",
stringify!(tell)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Io>())).length as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Io),
"::",
stringify!(length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Io>())).duplicate as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Io),
"::",
stringify!(duplicate)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Io>())).flush as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Io),
"::",
stringify!(flush)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<PHYSFS_Io>())).destroy as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(PHYSFS_Io),
"::",
stringify!(destroy)
)
);
}
extern "C" {
pub fn PHYSFS_mountIo(
io: *mut PHYSFS_Io,
newDir: *const ::std::os::raw::c_char,
mountPoint: *const ::std::os::raw::c_char,
appendToPath: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_mountMemory(
buf: *const ::std::os::raw::c_void,
len: PHYSFS_uint64,
del: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
newDir: *const ::std::os::raw::c_char,
mountPoint: *const ::std::os::raw::c_char,
appendToPath: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn PHYSFS_mountHandle(
file: *mut PHYSFS_File,
newDir: *const ::std::os::raw::c_char,
mountPoint: *const ::std::os::raw::c_char,
appendToPath: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
pub const PHYSFS_ErrorCode_PHYSFS_ERR_OK: PHYSFS_ErrorCode = 0;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_OTHER_ERROR: PHYSFS_ErrorCode = 1;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_OUT_OF_MEMORY: PHYSFS_ErrorCode = 2;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_NOT_INITIALIZED: PHYSFS_ErrorCode = 3;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_IS_INITIALIZED: PHYSFS_ErrorCode = 4;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_ARGV0_IS_NULL: PHYSFS_ErrorCode = 5;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_UNSUPPORTED: PHYSFS_ErrorCode = 6;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_PAST_EOF: PHYSFS_ErrorCode = 7;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_FILES_STILL_OPEN: PHYSFS_ErrorCode = 8;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_INVALID_ARGUMENT: PHYSFS_ErrorCode = 9;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_NOT_MOUNTED: PHYSFS_ErrorCode = 10;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_NOT_FOUND: PHYSFS_ErrorCode = 11;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_SYMLINK_FORBIDDEN: PHYSFS_ErrorCode = 12;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_NO_WRITE_DIR: PHYSFS_ErrorCode = 13;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_OPEN_FOR_READING: PHYSFS_ErrorCode = 14;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_OPEN_FOR_WRITING: PHYSFS_ErrorCode = 15;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_NOT_A_FILE: PHYSFS_ErrorCode = 16;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_READ_ONLY: PHYSFS_ErrorCode = 17;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_CORRUPT: PHYSFS_ErrorCode = 18;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_SYMLINK_LOOP: PHYSFS_ErrorCode = 19;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_IO: PHYSFS_ErrorCode = 20;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_PERMISSION: PHYSFS_ErrorCode = 21;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_NO_SPACE: PHYSFS_ErrorCode = 22;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_BAD_FILENAME: PHYSFS_ErrorCode = 23;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_BUSY: PHYSFS_ErrorCode = 24;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_DIR_NOT_EMPTY: PHYSFS_ErrorCode = 25;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_OS_ERROR: PHYSFS_ErrorCode = 26;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_DUPLICATE: PHYSFS_ErrorCode = 27;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_BAD_PASSWORD: PHYSFS_ErrorCode = 28;
pub const PHYSFS_ErrorCode_PHYSFS_ERR_APP_CALLBACK: PHYSFS_ErrorCode = 29;
pub type PHYSFS_ErrorCode = ::std::os::raw::c_uint;
extern "C" {
pub fn PHYSFS_getLastErrorCode() -> PHYSFS_ErrorCode;
}
extern "C" {
pub fn PHYSFS_getErrorByCode(code: PHYSFS_ErrorCode) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn PHYSFS_setErrorCode(code: PHYSFS_ErrorCode);
}
extern "C" {
pub fn PHYSFS_getPrefDir(
org: *const ::std::os::raw::c_char,
app: *const ::std::os::raw::c_char,
) -> *const ::std::os::raw::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PHYSFS_Archiver {
pub version: PHYSFS_uint32,