@@ -11,7 +11,9 @@ import chronos/osdefs
1111import zlib
1212import boringssl
1313
14- type ptrdiff_t* {.importc : " ptrdiff_t" , header : " <stddef.h>" .} = int
14+ type
15+ ptrdiff_t* {.importc : " ptrdiff_t" , header : " <stddef.h>" .} = int
16+ uint_fast8_t* {.importc : " uint_fast8_t" , header : " <stdint.h>" .} = uint8
1517
1618# enums are generated manually to avoid issue described in
1719# https://github.com/PMunch/futhark/issues/152
@@ -43,6 +45,9 @@ borrowCEnumOps(enum_lsquic_conn_param)
4345borrowCEnumOps (enum_LSQUIC_CONN_STATUS)
4446
4547const
48+ MAX_CID_LEN * = 20
49+ GQUIC_CID_LEN * = 8
50+
4651 LSQVER_043 * = enum_lsquic_version (0 )
4752 LSQVER_046 * = enum_lsquic_version (1 )
4853 LSQVER_050 * = enum_lsquic_version (2 )
@@ -107,6 +112,16 @@ when defined(windows):
107112{.passc : " -I" & lshpack.}
108113{.passc : " -I" & xxhash.}
109114
115+ type
116+ struct_lsquic_cid* {.
117+ importc : " struct lsquic_cid" , header : " lsquic_types.h" , bycopy , completeStruct
118+ .} = object
119+ buf* {.importc : " buf" .}: array [MAX_CID_LEN , uint8 ]
120+ len* {.importc : " len" .}: uint_fast8_t
121+ padding: array [3 , uint8 ]
122+
123+ lsquic_cid_t* = struct_lsquic_cid
124+
110125const HAVE_BORINGSSL = " -DHAVE_BORINGSSL"
111126const XXH_HEADER_NAME = " -DXXH_HEADER_NAME=\" <lsquic_xxhash.h>\" "
112127
@@ -357,14 +372,7 @@ else:
357372 " Declaration of " & " LSQUIC_DF_CFCW_CLIENT" & " already exists, not redeclaring"
358373 )
359374type
360- struct_lsquic_cid_570425834 {.pure , inheritable , bycopy .} = object
361- buf* {.align (8 'i64 ).}: array [20 'i64 , uint8 ]
362- # # Generated based on /home/r/vacp2p/nim-lsquic/libs/lsquic/include/lsquic_types.h:27:28
363- len* {.align (8 'i64 ).}: uint_fast8_t_570425837
364-
365375 uint_fast8_t_570425836 = uint8 # # Generated based on /usr/include/stdint.h:60:24
366- lsquic_cid_t_570425838 = struct_lsquic_cid_570425835
367- # # Generated based on /home/r/vacp2p/nim-lsquic/libs/lsquic/include/lsquic_types.h:32:3
368376 lsquic_stream_id_t_570425840 = uint64
369377 # # Generated based on /home/r/vacp2p/nim-lsquic/libs/lsquic/include/lsquic_types.h:40:18
370378 lsquic_engine_t_570425842 = struct_lsquic_engine
553561 proc (a0: pointer , a1: pointer , a2: pointer , a3: cschar ): void {.cdecl .}
554562 pmi_return* : proc (a0: pointer , a1: pointer , a2: pointer , a3: cschar ): void {.cdecl .}
555563
556- lsquic_cids_update_f_570425876 = proc (
557- a0: pointer , a1: ptr pointer , a2: ptr lsquic_cid_t_570425839, a3: cuint
558- ): void {.cdecl .}
564+ lsquic_cids_update_f_570425876 =
565+ proc (a0: pointer , a1: ptr pointer , a2: ptr lsquic_cid_t, a3: cuint ): void {.cdecl .}
559566 # # Generated based on /home/r/vacp2p/nim-lsquic/libs/lsquic/include/lsquic.h:1307:16
560567 struct_lsquic_hset_if_570425878 {.pure , inheritable , bycopy .} = object
561568 hsi_create_header_set* :
@@ -733,17 +740,6 @@ type
733740 else :
734741 struct_lsquic_conn_info_570425895
735742 )
736- struct_lsquic_cid_570425835 = (
737- when declared (struct_lsquic_cid):
738- when ownSizeof (struct_lsquic_cid) != ownSizeof (struct_lsquic_cid_570425834):
739- static :
740- warning (
741- " Declaration of " & " struct_lsquic_cid" & " exists but with different size"
742- )
743- struct_lsquic_cid
744- else :
745- struct_lsquic_cid_570425834
746- )
747743 lsquic_stream_id_t_570425841 = (
748744 when declared (lsquic_stream_id_t):
749745 when ownSizeof (lsquic_stream_id_t) != ownSizeof (lsquic_stream_id_t_570425840):
@@ -910,17 +906,6 @@ type
910906 else :
911907 lsquic_stream_ctx_t_570425850
912908 )
913- lsquic_cid_t_570425839 = (
914- when declared (lsquic_cid_t):
915- when ownSizeof (lsquic_cid_t) != ownSizeof (lsquic_cid_t_570425838):
916- static :
917- warning (
918- " Declaration of " & " lsquic_cid_t" & " exists but with different size"
919- )
920- lsquic_cid_t
921- else :
922- lsquic_cid_t_570425838
923- )
924909 uint_fast8_t_570425837 = (
925910 when declared (uint_fast8_t):
926911 when ownSizeof (uint_fast8_t) != ownSizeof (uint_fast8_t_570425836):
@@ -1046,11 +1031,6 @@ else:
10461031 hint (
10471032 " Declaration of " & " struct_lsquic_conn_info" & " already exists, not redeclaring"
10481033 )
1049- when not declared (struct_lsquic_cid):
1050- type struct_lsquic_cid* = struct_lsquic_cid_570425834
1051- else :
1052- static :
1053- hint (" Declaration of " & " struct_lsquic_cid" & " already exists, not redeclaring" )
10541034when not declared (lsquic_stream_id_t):
10551035 type lsquic_stream_id_t* = lsquic_stream_id_t_570425840
10561036else :
@@ -1138,11 +1118,6 @@ when not declared(lsquic_stream_ctx_t):
11381118else :
11391119 static :
11401120 hint (" Declaration of " & " lsquic_stream_ctx_t" & " already exists, not redeclaring" )
1141- when not declared (lsquic_cid_t):
1142- type lsquic_cid_t* = lsquic_cid_t_570425838
1143- else :
1144- static :
1145- hint (" Declaration of " & " lsquic_cid_t" & " already exists, not redeclaring" )
11461121when not declared (uint_fast8_t):
11471122 type uint_fast8_t* = uint_fast8_t_570425836
11481123else :
@@ -2670,7 +2645,7 @@ else:
26702645when not declared (lsquic_conn_id):
26712646 proc lsquic_conn_id * (
26722647 c: ptr lsquic_conn_t_570425845
2673- ): ptr lsquic_cid_t_570425839 {.cdecl , importc : " lsquic_conn_id" .}
2648+ ): ptr lsquic_cid_t {.cdecl , importc : " lsquic_conn_id" .}
26742649
26752650else :
26762651 static :
@@ -2968,7 +2943,7 @@ else:
29682943 )
29692944when not declared (lsquic_cid_from_packet):
29702945 proc lsquic_cid_from_packet * (
2971- a0: ptr uint8 , bufsz: csize_t , cid: ptr lsquic_cid_t_570425839
2946+ a0: ptr uint8 , bufsz: csize_t , cid: ptr lsquic_cid_t
29722947 ): cint {.cdecl , importc : " lsquic_cid_from_packet" .}
29732948
29742949else :
0 commit comments