1use std::os::raw::{c_char, c_int, c_void};
6
7#[repr(C)]
9pub struct CtpLogConfig {
10 pub enable_debug: c_int, pub log_file_path: *const c_char, pub max_file_size_mb: c_int, pub max_backup_files: c_int, }
15
16#[repr(C)]
18pub struct MdSpiCallbacks {
19 pub user_data: *mut c_void,
20 pub on_front_connected: Option<extern "C" fn(*mut c_void)>,
21 pub on_front_disconnected: Option<extern "C" fn(*mut c_void, c_int)>,
22 pub on_heart_beat_warning: Option<extern "C" fn(*mut c_void, c_int)>,
23 pub on_rsp_user_login:
24 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
25 pub on_rsp_user_logout:
26 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
27 pub on_rsp_error: Option<extern "C" fn(*mut c_void, *mut c_void, c_int, c_int)>,
28 pub on_rsp_sub_market_data:
29 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
30 pub on_rsp_unsub_market_data:
31 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
32 pub on_rtn_depth_market_data: Option<extern "C" fn(*mut c_void, *mut c_void)>,
33 pub on_rtn_for_quote_rsp: Option<extern "C" fn(*mut c_void, *mut c_void)>,
34}
35
36#[repr(C)]
38pub struct TraderSpiCallbacks {
39 pub user_data: *mut c_void,
40 pub on_front_connected: Option<extern "C" fn(*mut c_void)>,
41 pub on_front_disconnected: Option<extern "C" fn(*mut c_void, c_int)>,
42 pub on_heart_beat_warning: Option<extern "C" fn(*mut c_void, c_int)>,
43 pub on_rsp_authenticate:
44 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
45 pub on_rsp_user_login:
46 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
47 pub on_rsp_user_logout:
48 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
49 pub on_rsp_error: Option<extern "C" fn(*mut c_void, *mut c_void, c_int, c_int)>,
50 pub on_rsp_order_insert:
51 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
52 pub on_rsp_order_action:
53 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
54 pub on_rtn_order: Option<extern "C" fn(*mut c_void, *mut c_void)>,
55 pub on_rtn_trade: Option<extern "C" fn(*mut c_void, *mut c_void)>,
56 pub on_rsp_qry_trading_account:
57 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
58 pub on_rsp_qry_investor_position:
59 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
60
61 pub on_err_rtn_order_insert: Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void)>,
63 pub on_err_rtn_order_action: Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void)>,
64 pub on_rsp_qry_order:
65 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
66 pub on_rsp_qry_trade:
67 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
68 pub on_rsp_qry_instrument:
69 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
70
71 pub on_rsp_qry_instrument_margin_rate:
73 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
74 pub on_rsp_qry_instrument_commission_rate:
75 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
76 pub on_rsp_qry_exchange:
77 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
78 pub on_rsp_qry_product:
79 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
80 pub on_rsp_settlement_info_confirm:
81 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
82 pub on_rsp_parked_order_insert:
83 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
84 pub on_rsp_parked_order_action:
85 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
86
87 pub on_rsp_exec_order_insert:
89 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
90 pub on_rsp_exec_order_action:
91 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
92 pub on_rsp_for_quote_insert:
93 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
94 pub on_rsp_quote_insert:
95 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
96 pub on_rsp_quote_action:
97 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
98 pub on_rsp_batch_order_action:
99 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
100 pub on_rsp_remove_parked_order:
101 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
102 pub on_rsp_remove_parked_order_action:
103 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
104 pub on_rsp_qry_max_order_volume:
105 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
106 pub on_rsp_qry_depth_market_data:
107 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
108 pub on_rsp_qry_settlement_info:
109 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
110 pub on_rsp_qry_transfer_bank:
111 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
112 pub on_rsp_qry_investor_position_detail:
113 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
114 pub on_rsp_qry_notice:
115 Option<extern "C" fn(*mut c_void, *mut c_void, *mut c_void, c_int, c_int)>,
116}
117
118#[link(name = "ctp_wrapper")]
120extern "C" {
121 pub fn CreateMdSpiBridge(callbacks: *const MdSpiCallbacks) -> *mut c_void;
122 pub fn DestroyMdSpiBridge(spi_bridge: *mut c_void);
123 pub fn CreateTraderSpiBridge(callbacks: *const TraderSpiCallbacks) -> *mut c_void;
124 pub fn DestroyTraderSpiBridge(spi_bridge: *mut c_void);
125
126 pub fn CTP_InitializeDebugLogging(config: *const CtpLogConfig);
128 pub fn CTP_CleanupDebugLogging();
129}
130
131pub mod md_api {
133 use super::*;
134
135 #[link(name = "ctp_wrapper")]
145 extern "C" {
146 pub fn CThostFtdcMdApi_CreateFtdcMdApi(
147 flow_path: *const c_char,
148 is_using_udp: bool,
149 is_multicast: bool,
150 is_production_mode: bool,
151 ) -> *mut c_void;
152 }
153
154 #[link(name = "ctp_wrapper")]
159 extern "C" {
160 pub fn CThostFtdcMdApi_GetApiVersion() -> *const c_char;
161 }
162
163 #[link(name = "ctp_wrapper")]
168 extern "C" {
169 pub fn CThostFtdcMdApi_Release(api: *mut c_void);
170 }
171
172 #[link(name = "ctp_wrapper")]
177 extern "C" {
178 pub fn CThostFtdcMdApi_Init(api: *mut c_void);
179 }
180
181 #[link(name = "ctp_wrapper")]
189 extern "C" {
190 pub fn CThostFtdcMdApi_Join(api: *mut c_void) -> c_int;
191 }
192
193 #[link(name = "ctp_wrapper")]
201 extern "C" {
202 pub fn CThostFtdcMdApi_GetTradingDay(api: *mut c_void) -> *const c_char;
203 }
204
205 #[link(name = "ctp_wrapper")]
212 extern "C" {
213 pub fn CThostFtdcMdApi_RegisterFront(api: *mut c_void, front_address: *const c_char);
214 }
215
216 #[link(name = "ctp_wrapper")]
222 extern "C" {
223 pub fn CThostFtdcMdApi_RegisterNameServer(api: *mut c_void, ns_address: *const c_char);
224 }
225
226 #[link(name = "ctp_wrapper")]
232 extern "C" {
233 pub fn CThostFtdcMdApi_RegisterFensUserInfo(api: *mut c_void, user_info: *const c_void);
234 }
235
236 #[link(name = "ctp_wrapper")]
242 extern "C" {
243 pub fn CThostFtdcMdApi_RegisterSpi(api: *mut c_void, spi: *mut c_void);
244 }
245
246 #[link(name = "ctp_wrapper")]
256 extern "C" {
257 pub fn CThostFtdcMdApi_ReqUserLogin(
258 api: *mut c_void,
259 req: *const c_void,
260 request_id: c_int,
261 ) -> c_int;
262 }
263
264 #[link(name = "ctp_wrapper")]
274 extern "C" {
275 pub fn CThostFtdcMdApi_ReqUserLogout(
276 api: *mut c_void,
277 req: *const c_void,
278 request_id: c_int,
279 ) -> c_int;
280 }
281
282 #[link(name = "ctp_wrapper")]
292 extern "C" {
293 pub fn CThostFtdcMdApi_SubscribeMarketData(
294 api: *mut c_void,
295 instrument_ids: *const *const c_char,
296 count: c_int,
297 ) -> c_int;
298 }
299
300 #[link(name = "ctp_wrapper")]
310 extern "C" {
311 pub fn CThostFtdcMdApi_UnSubscribeMarketData(
312 api: *mut c_void,
313 instrument_ids: *const *const c_char,
314 count: c_int,
315 ) -> c_int;
316 }
317
318 #[link(name = "ctp_wrapper")]
328 extern "C" {
329 pub fn CThostFtdcMdApi_SubscribeForQuoteRsp(
330 api: *mut c_void,
331 instrument_ids: *const *const c_char,
332 count: c_int,
333 ) -> c_int;
334 }
335
336 #[link(name = "ctp_wrapper")]
346 extern "C" {
347 pub fn CThostFtdcMdApi_UnSubscribeForQuoteRsp(
348 api: *mut c_void,
349 instrument_ids: *const *const c_char,
350 count: c_int,
351 ) -> c_int;
352 }
353}
354
355pub mod trader_api {
357 use super::*;
358
359 #[link(name = "ctp_wrapper")]
367 extern "C" {
368 pub fn CThostFtdcTraderApi_CreateFtdcTraderApi(
369 flow_path: *const c_char,
370 is_production_mode: bool,
371 ) -> *mut c_void;
372 }
373
374 #[link(name = "ctp_wrapper")]
379 extern "C" {
380 pub fn CThostFtdcTraderApi_GetApiVersion() -> *const c_char;
381 }
382
383 #[link(name = "ctp_wrapper")]
388 extern "C" {
389 pub fn CThostFtdcTraderApi_Release(api: *mut c_void);
390 }
391
392 #[link(name = "ctp_wrapper")]
397 extern "C" {
398 pub fn CThostFtdcTraderApi_Init(api: *mut c_void);
399 }
400
401 #[link(name = "ctp_wrapper")]
409 extern "C" {
410 pub fn CThostFtdcTraderApi_Join(api: *mut c_void) -> c_int;
411 }
412
413 #[link(name = "ctp_wrapper")]
421 extern "C" {
422 pub fn CThostFtdcTraderApi_GetTradingDay(api: *mut c_void) -> *const c_char;
423 }
424
425 #[link(name = "ctp_wrapper")]
431 extern "C" {
432 pub fn CThostFtdcTraderApi_RegisterFront(api: *mut c_void, front_address: *const c_char);
433 }
434
435 #[link(name = "ctp_wrapper")]
441 extern "C" {
442 pub fn CThostFtdcTraderApi_RegisterNameServer(api: *mut c_void, ns_address: *const c_char);
443 }
444
445 #[link(name = "ctp_wrapper")]
451 extern "C" {
452 pub fn CThostFtdcTraderApi_RegisterFensUserInfo(api: *mut c_void, user_info: *const c_void);
453 }
454
455 #[link(name = "ctp_wrapper")]
461 extern "C" {
462 pub fn CThostFtdcTraderApi_RegisterSpi(api: *mut c_void, spi: *mut c_void);
463 }
464
465 #[link(name = "ctp_wrapper")]
471 extern "C" {
472 pub fn CThostFtdcTraderApi_GetFrontInfo(api: *mut c_void, front_info: *mut c_void);
473 }
474
475 #[link(name = "ctp_wrapper")]
484 extern "C" {
485 pub fn CThostFtdcTraderApi_RegisterWechatUserSystemInfo(
486 api: *mut c_void,
487 user_system_info: *mut c_void,
488 ) -> c_int;
489 }
490
491 #[link(name = "ctp_wrapper")]
500 extern "C" {
501 pub fn CThostFtdcTraderApi_SubmitWechatUserSystemInfo(
502 api: *mut c_void,
503 user_system_info: *mut c_void,
504 ) -> c_int;
505 }
506
507 #[link(name = "ctp_wrapper")]
517 extern "C" {
518 pub fn CThostFtdcTraderApi_ReqAuthenticate(
519 api: *mut c_void,
520 req: *const c_void,
521 request_id: c_int,
522 ) -> c_int;
523 }
524
525 #[link(name = "ctp_wrapper")]
534 extern "C" {
535 pub fn CThostFtdcTraderApi_RegisterUserSystemInfo(
536 api: *mut c_void,
537 user_info: *const c_void,
538 ) -> c_int;
539 }
540
541 #[link(name = "ctp_wrapper")]
550 extern "C" {
551 pub fn CThostFtdcTraderApi_SubmitUserSystemInfo(
552 api: *mut c_void,
553 user_info: *const c_void,
554 ) -> c_int;
555 }
556
557 #[link(name = "ctp_wrapper")]
567 extern "C" {
568 pub fn CThostFtdcTraderApi_ReqUserLogin(
569 api: *mut c_void,
570 req: *const c_void,
571 request_id: c_int,
572 ) -> c_int;
573 }
574
575 #[link(name = "ctp_wrapper")]
585 extern "C" {
586 pub fn CThostFtdcTraderApi_ReqUserLogout(
587 api: *mut c_void,
588 req: *const c_void,
589 request_id: c_int,
590 ) -> c_int;
591 }
592
593 #[link(name = "ctp_wrapper")]
603 extern "C" {
604 pub fn CThostFtdcTraderApi_ReqQryTradingAccount(
605 api: *mut c_void,
606 req: *const c_void,
607 request_id: c_int,
608 ) -> c_int;
609 }
610
611 #[link(name = "ctp_wrapper")]
621 extern "C" {
622 pub fn CThostFtdcTraderApi_ReqQryInvestorPosition(
623 api: *mut c_void,
624 req: *const c_void,
625 request_id: c_int,
626 ) -> c_int;
627 }
628
629 #[link(name = "ctp_wrapper")]
641 extern "C" {
642 pub fn CThostFtdcTraderApi_ReqOrderInsert(
643 api: *mut c_void,
644 req: *const c_void,
645 request_id: c_int,
646 ) -> c_int;
647 }
648
649 #[link(name = "ctp_wrapper")]
659 extern "C" {
660 pub fn CThostFtdcTraderApi_ReqOrderAction(
661 api: *mut c_void,
662 req: *const c_void,
663 request_id: c_int,
664 ) -> c_int;
665 }
666
667 #[link(name = "ctp_wrapper")]
677 extern "C" {
678 pub fn CThostFtdcTraderApi_ReqQryOrder(
679 api: *mut c_void,
680 req: *const c_void,
681 request_id: c_int,
682 ) -> c_int;
683 }
684
685 #[link(name = "ctp_wrapper")]
695 extern "C" {
696 pub fn CThostFtdcTraderApi_ReqQryTrade(
697 api: *mut c_void,
698 req: *const c_void,
699 request_id: c_int,
700 ) -> c_int;
701 }
702
703 #[link(name = "ctp_wrapper")]
713 extern "C" {
714 pub fn CThostFtdcTraderApi_ReqQryInstrument(
715 api: *mut c_void,
716 req: *const c_void,
717 request_id: c_int,
718 ) -> c_int;
719 }
720
721 #[link(name = "ctp_wrapper")]
733 extern "C" {
734 pub fn CThostFtdcTraderApi_ReqQryInstrumentMarginRate(
735 api: *mut c_void,
736 req: *const c_void,
737 request_id: c_int,
738 ) -> c_int;
739 }
740
741 #[link(name = "ctp_wrapper")]
751 extern "C" {
752 pub fn CThostFtdcTraderApi_ReqQryInstrumentCommissionRate(
753 api: *mut c_void,
754 req: *const c_void,
755 request_id: c_int,
756 ) -> c_int;
757 }
758
759 #[link(name = "ctp_wrapper")]
769 extern "C" {
770 pub fn CThostFtdcTraderApi_ReqQryExchange(
771 api: *mut c_void,
772 req: *const c_void,
773 request_id: c_int,
774 ) -> c_int;
775 }
776
777 #[link(name = "ctp_wrapper")]
787 extern "C" {
788 pub fn CThostFtdcTraderApi_ReqQryProduct(
789 api: *mut c_void,
790 req: *const c_void,
791 request_id: c_int,
792 ) -> c_int;
793 }
794
795 #[link(name = "ctp_wrapper")]
805 extern "C" {
806 pub fn CThostFtdcTraderApi_ReqSettlementInfoConfirm(
807 api: *mut c_void,
808 req: *const c_void,
809 request_id: c_int,
810 ) -> c_int;
811 }
812
813 #[link(name = "ctp_wrapper")]
823 extern "C" {
824 pub fn CThostFtdcTraderApi_ReqParkedOrderInsert(
825 api: *mut c_void,
826 req: *const c_void,
827 request_id: c_int,
828 ) -> c_int;
829 }
830
831 #[link(name = "ctp_wrapper")]
841 extern "C" {
842 pub fn CThostFtdcTraderApi_ReqParkedOrderAction(
843 api: *mut c_void,
844 req: *const c_void,
845 request_id: c_int,
846 ) -> c_int;
847 }
848
849 #[link(name = "ctp_wrapper")]
861 extern "C" {
862 pub fn CThostFtdcTraderApi_ReqExecOrderInsert(
863 api: *mut c_void,
864 req: *const c_void,
865 request_id: c_int,
866 ) -> c_int;
867 }
868
869 #[link(name = "ctp_wrapper")]
879 extern "C" {
880 pub fn CThostFtdcTraderApi_ReqExecOrderAction(
881 api: *mut c_void,
882 req: *const c_void,
883 request_id: c_int,
884 ) -> c_int;
885 }
886
887 #[link(name = "ctp_wrapper")]
897 extern "C" {
898 pub fn CThostFtdcTraderApi_ReqForQuoteInsert(
899 api: *mut c_void,
900 req: *const c_void,
901 request_id: c_int,
902 ) -> c_int;
903 }
904
905 #[link(name = "ctp_wrapper")]
915 extern "C" {
916 pub fn CThostFtdcTraderApi_ReqQuoteInsert(
917 api: *mut c_void,
918 req: *const c_void,
919 request_id: c_int,
920 ) -> c_int;
921 }
922
923 #[link(name = "ctp_wrapper")]
933 extern "C" {
934 pub fn CThostFtdcTraderApi_ReqQuoteAction(
935 api: *mut c_void,
936 req: *const c_void,
937 request_id: c_int,
938 ) -> c_int;
939 }
940
941 #[link(name = "ctp_wrapper")]
951 extern "C" {
952 pub fn CThostFtdcTraderApi_ReqBatchOrderAction(
953 api: *mut c_void,
954 req: *const c_void,
955 request_id: c_int,
956 ) -> c_int;
957 }
958
959 #[link(name = "ctp_wrapper")]
969 extern "C" {
970 pub fn CThostFtdcTraderApi_ReqRemoveParkedOrder(
971 api: *mut c_void,
972 req: *const c_void,
973 request_id: c_int,
974 ) -> c_int;
975 }
976
977 #[link(name = "ctp_wrapper")]
987 extern "C" {
988 pub fn CThostFtdcTraderApi_ReqRemoveParkedOrderAction(
989 api: *mut c_void,
990 req: *const c_void,
991 request_id: c_int,
992 ) -> c_int;
993 }
994
995 #[link(name = "ctp_wrapper")]
1005 extern "C" {
1006 pub fn CThostFtdcTraderApi_ReqQryMaxOrderVolume(
1007 api: *mut c_void,
1008 req: *const c_void,
1009 request_id: c_int,
1010 ) -> c_int;
1011 }
1012
1013 #[link(name = "ctp_wrapper")]
1023 extern "C" {
1024 pub fn CThostFtdcTraderApi_ReqQryDepthMarketData(
1025 api: *mut c_void,
1026 req: *const c_void,
1027 request_id: c_int,
1028 ) -> c_int;
1029 }
1030
1031 #[link(name = "ctp_wrapper")]
1041 extern "C" {
1042 pub fn CThostFtdcTraderApi_ReqQrySettlementInfo(
1043 api: *mut c_void,
1044 req: *const c_void,
1045 request_id: c_int,
1046 ) -> c_int;
1047 }
1048
1049 #[link(name = "ctp_wrapper")]
1059 extern "C" {
1060 pub fn CThostFtdcTraderApi_ReqQryTransferBank(
1061 api: *mut c_void,
1062 req: *const c_void,
1063 request_id: c_int,
1064 ) -> c_int;
1065 }
1066
1067 #[link(name = "ctp_wrapper")]
1077 extern "C" {
1078 pub fn CThostFtdcTraderApi_ReqQryInvestorPositionDetail(
1079 api: *mut c_void,
1080 req: *const c_void,
1081 request_id: c_int,
1082 ) -> c_int;
1083 }
1084
1085 #[link(name = "ctp_wrapper")]
1095 extern "C" {
1096 pub fn CThostFtdcTraderApi_ReqQryNotice(
1097 api: *mut c_void,
1098 req: *const c_void,
1099 request_id: c_int,
1100 ) -> c_int;
1101 }
1102}
1103
1104pub mod callbacks {
1106 use super::*;
1107
1108 pub type OnFrontConnectedCallback = extern "C" fn();
1110
1111 pub type OnFrontDisconnectedCallback = extern "C" fn(reason: c_int);
1113
1114 pub type OnHeartBeatWarningCallback = extern "C" fn(time_lapse: c_int);
1116
1117 pub type OnRspUserLoginCallback = extern "C" fn(
1119 user_login: *const c_void,
1120 rsp_info: *const c_void,
1121 request_id: c_int,
1122 is_last: bool,
1123 );
1124
1125 pub type OnRspUserLogoutCallback = extern "C" fn(
1127 user_logout: *const c_void,
1128 rsp_info: *const c_void,
1129 request_id: c_int,
1130 is_last: bool,
1131 );
1132
1133 pub type OnRtnDepthMarketDataCallback = extern "C" fn(depth_market_data: *const c_void);
1135
1136 pub type OnRspSubMarketDataCallback = extern "C" fn(
1138 specific_instrument: *const c_void,
1139 rsp_info: *const c_void,
1140 request_id: c_int,
1141 is_last: bool,
1142 );
1143
1144 pub type OnRspUnSubMarketDataCallback = extern "C" fn(
1146 specific_instrument: *const c_void,
1147 rsp_info: *const c_void,
1148 request_id: c_int,
1149 is_last: bool,
1150 );
1151
1152 pub type OnRspAuthenticateCallback = extern "C" fn(
1154 rsp_authenticate: *const c_void,
1155 rsp_info: *const c_void,
1156 request_id: c_int,
1157 is_last: bool,
1158 );
1159
1160 pub type OnRspErrorCallback =
1162 extern "C" fn(rsp_info: *const c_void, request_id: c_int, is_last: bool);
1163}
1164
1165#[cfg(test)]
1167mod tests {
1168 use std::ptr;
1169
1170 #[test]
1171 fn test_ffi_declarations_compile() {
1172 let _api_ptr: *mut std::os::raw::c_void = ptr::null_mut();
1175 assert!(true, "FFI声明编译成功");
1176 }
1177}