Skip to content

Commit 898e0ef

Browse files
committed
WIP: add some AEIC annotations
1 parent 5eec031 commit 898e0ef

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

Sources/System/Sockets/SocketAddress+IPv4.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ extension SocketAddress {
1212
@frozen
1313
/// An IPv4 address and port number.
1414
public struct IPv4: RawRepresentable {
15+
@_alwaysEmitIntoClient
1516
public var rawValue: CInterop.SockAddrIn
1617

1718
@_alwaysEmitIntoClient
@@ -99,6 +100,7 @@ extension SocketAddress.IPv4 {
99100
/// A 32-bit IPv4 address.
100101
public struct Address: RawRepresentable, Hashable {
101102
/// The raw internet address value, in host byte order.
103+
@_alwaysEmitIntoClient
102104
public var rawValue: CInterop.InAddrT
103105

104106
@_alwaysEmitIntoClient

Sources/System/Sockets/SocketAddress+IPv6.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ extension SocketAddress {
1212
/// An IPv6 address and port number.
1313
@frozen
1414
public struct IPv6: RawRepresentable {
15+
@_alwaysEmitIntoClient
1516
public var rawValue: CInterop.SockAddrIn6
1617

1718
@_alwaysEmitIntoClient
@@ -117,6 +118,7 @@ extension SocketAddress.IPv6 {
117118
@frozen
118119
public struct Address: RawRepresentable {
119120
/// The raw internet address value, in host byte order.
121+
@_alwaysEmitIntoClient
120122
public var rawValue: CInterop.In6Addr
121123

122124
@_alwaysEmitIntoClient

Sources/System/Sockets/SocketAddress.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ extension SocketAddress {
287287
/// The port number on which the socket is listening.
288288
public struct Port: RawRepresentable, ExpressibleByIntegerLiteral, Hashable {
289289
/// The port number, in host byte order.
290+
@_alwaysEmitIntoClient
290291
public var rawValue: CInterop.InPort
291292

292293
@_alwaysEmitIntoClient

Sources/System/Sockets/SocketDescriptor.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,59 +60,59 @@ extension SocketDescriptor {
6060
public init(rawValue: CInt) { self.rawValue = rawValue }
6161

6262
@_alwaysEmitIntoClient
63-
public init(_ rawValue: CInt) { self.rawValue = rawValue }
63+
internal init(_ rawValue: CInt) { self.rawValue = rawValue }
6464

6565
/// Unspecified protocol.
6666
///
6767
/// The corresponding C constant is `PF_UNSPEC`
6868
@_alwaysEmitIntoClient
69-
public static var unspecified: Domain { Domain(rawValue: _PF_UNSPEC) }
69+
public static var unspecified: Domain { Domain(_PF_UNSPEC) }
7070

7171
/// Host-internal protocols, formerly called PF_UNIX,
7272
///
7373
/// The corresponding C constant is `PF_LOCAL`
7474
@_alwaysEmitIntoClient
75-
public static var local: Domain { Domain(rawValue: _PF_LOCAL) }
75+
public static var local: Domain { Domain(_PF_LOCAL) }
7676

7777
@_alwaysEmitIntoClient
7878
@available(*, unavailable, renamed: "local")
79-
public static var unix: Domain { Domain(rawValue: _PF_UNIX) }
79+
public static var unix: Domain { Domain(_PF_UNIX) }
8080

8181
/// Internet version 4 protocols,
8282
///
8383
/// The corresponding C constant is `PF_INET`
8484
@_alwaysEmitIntoClient
85-
public static var ipv4: Domain { Domain(rawValue: _PF_INET) }
85+
public static var ipv4: Domain { Domain(_PF_INET) }
8686

8787
/// Internal Routing protocol,
8888
///
8989
/// The corresponding C constant is `PF_ROUTE`
9090
@_alwaysEmitIntoClient
91-
public static var routing: Domain { Domain(rawValue: _PF_ROUTE) }
91+
public static var routing: Domain { Domain(_PF_ROUTE) }
9292

9393
/// Internal key-management function,
9494
///
9595
/// The corresponding C constant is `PF_KEY`
9696
@_alwaysEmitIntoClient
97-
public static var keyManagement: Domain { Domain(rawValue: _PF_KEY) }
97+
public static var keyManagement: Domain { Domain(_PF_KEY) }
9898

9999
/// Internet version 6 protocols,
100100
///
101101
/// The corresponding C constant is `PF_INET6`
102102
@_alwaysEmitIntoClient
103-
public static var ipv6: Domain { Domain(rawValue: _PF_INET6) }
103+
public static var ipv6: Domain { Domain(_PF_INET6) }
104104

105105
/// System domain,
106106
///
107107
/// The corresponding C constant is `PF_SYSTEM`
108108
@_alwaysEmitIntoClient
109-
public static var system: Domain { Domain(rawValue: _PF_SYSTEM) }
109+
public static var system: Domain { Domain(_PF_SYSTEM) }
110110

111111
/// Raw access to network device
112112
///
113113
/// The corresponding C constant is `PF_NDRV`
114114
@_alwaysEmitIntoClient
115-
public static var networkDevice: Domain { Domain(rawValue: _PF_NDRV) }
115+
public static var networkDevice: Domain { Domain(_PF_NDRV) }
116116

117117
public var description: String {
118118
switch self {
@@ -139,40 +139,40 @@ extension SocketDescriptor {
139139
public init(rawValue: CInt) { self.rawValue = rawValue }
140140

141141
@_alwaysEmitIntoClient
142-
public init(_ rawValue: CInt) { self.rawValue = rawValue }
142+
internal init(_ rawValue: CInt) { self.rawValue = rawValue }
143143

144144
/// Sequenced, reliable, two-way connection based byte streams.
145145
///
146146
/// The corresponding C constant is `SOCK_STREAM`
147147
@_alwaysEmitIntoClient
148-
public static var stream: ConnectionType { ConnectionType(rawValue: _SOCK_STREAM) }
148+
public static var stream: ConnectionType { ConnectionType(_SOCK_STREAM) }
149149

150150
/// Datagrams (connectionless, unreliable messages of a fixed (typically small) maximum length)
151151
///
152152
/// The corresponding C constant is `SOCK_DGRAM`
153153
@_alwaysEmitIntoClient
154-
public static var datagram: ConnectionType { ConnectionType(rawValue: _SOCK_DGRAM) }
154+
public static var datagram: ConnectionType { ConnectionType(_SOCK_DGRAM) }
155155

156156
/// Raw protocol interface. Only available to the super user
157157
///
158158
/// The corresponding C constant is `SOCK_RAW`
159159
@_alwaysEmitIntoClient
160-
public static var raw: ConnectionType { ConnectionType(rawValue: _SOCK_RAW) }
160+
public static var raw: ConnectionType { ConnectionType(_SOCK_RAW) }
161161

162162
/// Reliably delivered message.
163163
///
164164
/// The corresponding C constant is `SOCK_RDM`
165165
@_alwaysEmitIntoClient
166166
public static var reliablyDeliveredMessage: ConnectionType {
167-
ConnectionType(rawValue: _SOCK_RDM)
167+
ConnectionType(_SOCK_RDM)
168168
}
169169

170170
/// Sequenced packet stream.
171171
///
172172
/// The corresponding C constant is `SOCK_SEQPACKET`
173173
@_alwaysEmitIntoClient
174174
public static var sequencedPacketStream: ConnectionType {
175-
ConnectionType(rawValue: _SOCK_SEQPACKET)
175+
ConnectionType(_SOCK_SEQPACKET)
176176
}
177177

178178
public var description: String {
@@ -202,7 +202,7 @@ extension SocketDescriptor {
202202
public init(rawValue: CInt) { self.rawValue = rawValue }
203203

204204
@_alwaysEmitIntoClient
205-
public init(_ rawValue: CInt) { self.rawValue = rawValue }
205+
internal init(_ rawValue: CInt) { self.rawValue = rawValue }
206206

207207
/// The default protocol for the domain and connection type combination.
208208
@_alwaysEmitIntoClient

0 commit comments

Comments
 (0)