@@ -17,16 +17,6 @@ pub type pthread_rwlockattr_t = *mut ::c_void;
1717pub type caddr_t = * mut :: c_char ;
1818
1919s ! {
20- pub struct dirent {
21- pub d_fileno: :: ino_t,
22- pub d_off: :: off_t,
23- pub d_reclen: u16 ,
24- pub d_type: u8 ,
25- pub d_namlen: u8 ,
26- __d_padding: [ u8 ; 4 ] ,
27- pub d_name: [ :: c_char; 256 ] ,
28- }
29-
3020 pub struct glob_t {
3121 pub gl_pathc: :: c_int,
3222 pub gl_matchc: :: c_int,
9989 pub ai_next: * mut :: addrinfo,
10090 }
10191
102- pub struct sockaddr_storage {
103- pub ss_len: u8 ,
104- pub ss_family: :: sa_family_t,
105- __ss_pad1: [ u8 ; 6 ] ,
106- __ss_pad2: i64 ,
107- __ss_pad3: [ u8 ; 240 ] ,
108- }
109-
110- pub struct siginfo_t {
111- pub si_signo: :: c_int,
112- pub si_code: :: c_int,
113- pub si_errno: :: c_int,
114- pub si_addr: * mut :: c_char,
115- #[ cfg( target_pointer_width = "32" ) ]
116- __pad: [ u8 ; 112 ] ,
117- #[ cfg( target_pointer_width = "64" ) ]
118- __pad: [ u8 ; 108 ] ,
119- }
120-
12192 pub struct Dl_info {
12293 pub dli_fname: * const :: c_char,
12394 pub dli_fbase: * mut :: c_void,
12495 pub dli_sname: * const :: c_char,
12596 pub dli_saddr: * mut :: c_void,
12697 }
12798
128- pub struct lastlog {
129- ll_time: :: time_t,
130- ll_line: [ :: c_char; UT_LINESIZE ] ,
131- ll_host: [ :: c_char; UT_HOSTSIZE ] ,
132- }
133-
134- pub struct utmp {
135- pub ut_line: [ :: c_char; UT_LINESIZE ] ,
136- pub ut_name: [ :: c_char; UT_NAMESIZE ] ,
137- pub ut_host: [ :: c_char; UT_HOSTSIZE ] ,
138- pub ut_time: :: time_t,
139- }
140-
14199 pub struct if_data {
142100 pub ifi_type: :: c_uchar,
143101 pub ifi_addrlen: :: c_uchar,
@@ -204,6 +162,232 @@ s! {
204162 }
205163}
206164
165+ s_no_extra_traits ! {
166+ pub struct dirent {
167+ pub d_fileno: :: ino_t,
168+ pub d_off: :: off_t,
169+ pub d_reclen: u16 ,
170+ pub d_type: u8 ,
171+ pub d_namlen: u8 ,
172+ __d_padding: [ u8 ; 4 ] ,
173+ pub d_name: [ :: c_char; 256 ] ,
174+ }
175+
176+ pub struct sockaddr_storage {
177+ pub ss_len: u8 ,
178+ pub ss_family: :: sa_family_t,
179+ __ss_pad1: [ u8 ; 6 ] ,
180+ __ss_pad2: i64 ,
181+ __ss_pad3: [ u8 ; 240 ] ,
182+ }
183+
184+ pub struct siginfo_t {
185+ pub si_signo: :: c_int,
186+ pub si_code: :: c_int,
187+ pub si_errno: :: c_int,
188+ pub si_addr: * mut :: c_char,
189+ #[ cfg( target_pointer_width = "32" ) ]
190+ __pad: [ u8 ; 112 ] ,
191+ #[ cfg( target_pointer_width = "64" ) ]
192+ __pad: [ u8 ; 108 ] ,
193+ }
194+
195+ pub struct lastlog {
196+ ll_time: :: time_t,
197+ ll_line: [ :: c_char; UT_LINESIZE ] ,
198+ ll_host: [ :: c_char; UT_HOSTSIZE ] ,
199+ }
200+
201+ pub struct utmp {
202+ pub ut_line: [ :: c_char; UT_LINESIZE ] ,
203+ pub ut_name: [ :: c_char; UT_NAMESIZE ] ,
204+ pub ut_host: [ :: c_char; UT_HOSTSIZE ] ,
205+ pub ut_time: :: time_t,
206+ }
207+ }
208+
209+ #[ cfg( feature = "extra_traits" ) ]
210+ impl PartialEq for dirent {
211+ fn eq ( & self , other : & dirent ) -> bool {
212+ self . d_fileno == other. d_fileno
213+ && self . d_off == other. d_off
214+ && self . d_reclen == other. d_reclen
215+ && self . d_type == other. d_type
216+ && self . d_namlen == other. d_namlen
217+ && self
218+ . d_name
219+ . iter ( )
220+ . zip ( other. d_name . iter ( ) )
221+ . all ( |( a, b) | a == b)
222+ }
223+ }
224+ #[ cfg( feature = "extra_traits" ) ]
225+ impl Eq for dirent { }
226+ #[ cfg( feature = "extra_traits" ) ]
227+ impl std:: fmt:: Debug for dirent {
228+ fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
229+ f. debug_struct ( "dirent" )
230+ . field ( "d_fileno" , & self . d_fileno )
231+ . field ( "d_off" , & self . d_off )
232+ . field ( "d_reclen" , & self . d_reclen )
233+ . field ( "d_type" , & self . d_type )
234+ . field ( "d_namlen" , & self . d_namlen )
235+ // FIXME: .field("d_name", &self.d_name)
236+ . finish ( )
237+ }
238+ }
239+ #[ cfg( feature = "extra_traits" ) ]
240+ impl std:: hash:: Hash for dirent {
241+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
242+ self . d_fileno . hash ( state) ;
243+ self . d_off . hash ( state) ;
244+ self . d_reclen . hash ( state) ;
245+ self . d_type . hash ( state) ;
246+ self . d_namlen . hash ( state) ;
247+ self . d_name . hash ( state) ;
248+ }
249+ }
250+
251+ #[ cfg( feature = "extra_traits" ) ]
252+ impl PartialEq for sockaddr_storage {
253+ fn eq ( & self , other : & sockaddr_storage ) -> bool {
254+ self . ss_len == other. ss_len
255+ && self . ss_family == other. ss_family
256+ }
257+ }
258+ #[ cfg( feature = "extra_traits" ) ]
259+ impl Eq for sockaddr_storage { }
260+ #[ cfg( feature = "extra_traits" ) ]
261+ impl std:: fmt:: Debug for sockaddr_storage {
262+ fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
263+ f. debug_struct ( "sockaddr_storage" )
264+ . field ( "ss_len" , & self . ss_len )
265+ . field ( "ss_family" , & self . ss_family )
266+ . finish ( )
267+ }
268+ }
269+ #[ cfg( feature = "extra_traits" ) ]
270+ impl std:: hash:: Hash for sockaddr_storage {
271+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
272+ self . ss_len . hash ( state) ;
273+ self . ss_family . hash ( state) ;
274+ }
275+ }
276+
277+ #[ cfg( feature = "extra_traits" ) ]
278+ impl PartialEq for siginfo_t {
279+ fn eq ( & self , other : & siginfo_t ) -> bool {
280+ self . si_signo == other. si_signo
281+ && self . si_code == other. si_code
282+ && self . si_errno == other. si_errno
283+ && self . si_addr == other. si_addr
284+ }
285+ }
286+ #[ cfg( feature = "extra_traits" ) ]
287+ impl Eq for siginfo_t { }
288+ #[ cfg( feature = "extra_traits" ) ]
289+ impl std:: fmt:: Debug for siginfo_t {
290+ fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
291+ f. debug_struct ( "siginfo_t" )
292+ . field ( "si_signo" , & self . si_signo )
293+ . field ( "si_code" , & self . si_code )
294+ . field ( "si_errno" , & self . si_errno )
295+ . field ( "si_addr" , & self . si_addr )
296+ . finish ( )
297+ }
298+ }
299+ #[ cfg( feature = "extra_traits" ) ]
300+ impl std:: hash:: Hash for siginfo_t {
301+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
302+ self . si_signo . hash ( state) ;
303+ self . si_code . hash ( state) ;
304+ self . si_errno . hash ( state) ;
305+ self . si_addr . hash ( state) ;
306+ }
307+ }
308+
309+ #[ cfg( feature = "extra_traits" ) ]
310+ impl PartialEq for lastlog {
311+ fn eq ( & self , other : & lastlog ) -> bool {
312+ self . ll_time == other. ll_time
313+ && self
314+ . ll_line
315+ . iter ( )
316+ . zip ( other. ll_line . iter ( ) )
317+ . all ( |( a, b) | a == b)
318+ && self
319+ . ll_host
320+ . iter ( )
321+ . zip ( other. ll_host . iter ( ) )
322+ . all ( |( a, b) | a == b)
323+ }
324+ }
325+ #[ cfg( feature = "extra_traits" ) ]
326+ impl Eq for lastlog { }
327+ #[ cfg( feature = "extra_traits" ) ]
328+ impl std:: fmt:: Debug for lastlog {
329+ fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
330+ f. debug_struct ( "lastlog" )
331+ . field ( "ll_time" , & self . ll_time )
332+ // FIXME: .field("ll_line", &self.ll_line)
333+ // FIXME: .field("ll_host", &self.ll_host)
334+ . finish ( )
335+ }
336+ }
337+ #[ cfg( feature = "extra_traits" ) ]
338+ impl std:: hash:: Hash for lastlog {
339+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
340+ self . ll_time . hash ( state) ;
341+ self . ll_line . hash ( state) ;
342+ self . ll_host . hash ( state) ;
343+ }
344+ }
345+
346+ #[ cfg( feature = "extra_traits" ) ]
347+ impl PartialEq for utmp {
348+ fn eq ( & self , other : & utmp ) -> bool {
349+ self . ut_time == other. ut_time
350+ && self
351+ . ut_line
352+ . iter ( )
353+ . zip ( other. ut_line . iter ( ) )
354+ . all ( |( a, b) | a == b)
355+ && self
356+ . ut_name
357+ . iter ( )
358+ . zip ( other. ut_name . iter ( ) )
359+ . all ( |( a, b) | a == b)
360+ && self
361+ . ut_host
362+ . iter ( )
363+ . zip ( other. ut_host . iter ( ) )
364+ . all ( |( a, b) | a == b)
365+ }
366+ }
367+ #[ cfg( feature = "extra_traits" ) ]
368+ impl Eq for utmp { }
369+ #[ cfg( feature = "extra_traits" ) ]
370+ impl std:: fmt:: Debug for utmp {
371+ fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
372+ f. debug_struct ( "utmp" )
373+ // FIXME: .field("ut_line", &self.ut_line)
374+ // FIXME: .field("ut_name", &self.ut_name)
375+ // FIXME: .field("ut_host", &self.ut_host)
376+ . field ( "ut_time" , & self . ut_time )
377+ . finish ( )
378+ }
379+ }
380+ #[ cfg( feature = "extra_traits" ) ]
381+ impl std:: hash:: Hash for utmp {
382+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
383+ self . ut_line . hash ( state) ;
384+ self . ut_name . hash ( state) ;
385+ self . ut_host . hash ( state) ;
386+ self . ut_time . hash ( state) ;
387+ }
388+ }
389+
390+
207391pub const UT_NAMESIZE : usize = 32 ;
208392pub const UT_LINESIZE : usize = 8 ;
209393pub const UT_HOSTSIZE : usize = 256 ;
0 commit comments