enet_sys/
lib.rs

1#![allow(non_upper_case_globals)]
2#![allow(non_camel_case_types)]
3#![allow(non_snake_case)]
4#![allow(improper_ctypes)]
5#![allow(deref_nullptr)]
6
7include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
8
9/// enet size_t type alias for keeping compatible with previous
10/// versions of this crate.
11#[deprecated]
12pub type size_t = usize;
13
14// Items, that could not be generated with bindgen, because they involentarily create valid doctests in their comments.
15
16#[doc = " ENet packet structure."]
17#[doc = ""]
18#[doc = " An ENet data packet that may be sent to or received from a peer. The shown"]
19#[doc = " fields should only be read and never modified. The data field contains the"]
20#[doc = " allocated data for the packet. The dataLength fields specifies the length"]
21#[doc = " of the allocated data.  The flags field is either 0 (specifying no flags),"]
22#[doc = " or a bitwise-or of any combination of the following flags:"]
23#[doc = ""]
24#[doc = "  ENET_PACKET_FLAG_RELIABLE - packet must be received by the target peer"]
25#[doc = "  and resend attempts should be made until the packet is delivered"]
26#[doc = ""]
27#[doc = "  ENET_PACKET_FLAG_UNSEQUENCED - packet will not be sequenced with other packets"]
28#[doc = "  (not supported for reliable packets)"]
29#[doc = ""]
30#[doc = "  ENET_PACKET_FLAG_NO_ALLOCATE - packet will not allocate data, and user must supply it instead"]
31#[doc = ""]
32#[doc = "  ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT - packet will be fragmented using unreliable"]
33#[doc = "  (instead of reliable) sends if it exceeds the MTU"]
34#[doc = ""]
35#[doc = "  ENET_PACKET_FLAG_SENT - whether the packet has been sent from all queues it has been entered into"]
36#[doc = "@sa ENetPacketFlag"]
37#[repr(C)]
38#[derive(Copy, Clone)]
39pub struct _ENetPacket {
40    #[doc = "< internal use only"]
41    pub referenceCount: usize,
42    #[doc = "< bitwise-or of ENetPacketFlag constants"]
43    pub flags: enet_uint32,
44    #[doc = "< allocated data for packet"]
45    pub data: *mut enet_uint8,
46    #[doc = "< length of data"]
47    pub dataLength: usize,
48    #[doc = "< function to be called when the packet is no longer in use"]
49    pub freeCallback: ENetPacketFreeCallback,
50    #[doc = "< application private data, may be freely modified"]
51    pub userData: *mut ::std::os::raw::c_void,
52}
53
54pub type ENetPacket = _ENetPacket;