Skip to content

Commit 0fcfd74

Browse files
gio/win32: Add a type for GNetworkMonitorBase and drop duplicated manual ones
1 parent 654d642 commit 0fcfd74

File tree

1 file changed

+2
-124
lines changed

1 file changed

+2
-124
lines changed

gio-win32/sys/src/manual.rs

Lines changed: 2 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
use libc::c_void;
2-
31
pub type GSocketFamily = libc::c_int;
42
pub type GSocketMsgFlags = libc::c_int;
53

6-
use gio_sys::{GInputStream, GInputStreamClass, GOutputStream, GOutputStreamClass};
7-
use glib_sys::{gboolean, GType};
8-
94
pub const G_SOCKET_MSG_NONE: super::GSocketMsgFlags = 0;
105
pub const G_SOCKET_MSG_OOB: super::GSocketMsgFlags =
116
windows_sys::Win32::Networking::WinSock::MSG_OOB;
@@ -14,122 +9,5 @@ pub const G_SOCKET_MSG_PEEK: super::GSocketMsgFlags =
149
pub const G_SOCKET_MSG_DONTROUTE: super::GSocketMsgFlags =
1510
windows_sys::Win32::Networking::WinSock::MSG_DONTROUTE;
1611

17-
extern "C" {
18-
//=========================================================================
19-
// GWin32InputStream
20-
//=========================================================================
21-
pub fn g_win32_input_stream_get_type() -> GType;
22-
pub fn g_win32_input_stream_new(
23-
handle: *mut c_void,
24-
close_handle: gboolean,
25-
) -> *mut GInputStream;
26-
pub fn g_win32_input_stream_get_close_handle(stream: *mut GWin32InputStream) -> gboolean;
27-
pub fn g_win32_input_stream_get_handle(stream: *mut GWin32InputStream) -> *mut c_void;
28-
pub fn g_win32_input_stream_set_close_handle(
29-
stream: *mut GWin32InputStream,
30-
close_handle: gboolean,
31-
);
32-
33-
//=========================================================================
34-
// GWin32OutputStream
35-
//=========================================================================
36-
pub fn g_win32_output_stream_get_type() -> GType;
37-
pub fn g_win32_output_stream_new(
38-
handle: *mut c_void,
39-
close_handle: gboolean,
40-
) -> *mut GOutputStream;
41-
pub fn g_win32_output_stream_get_close_handle(stream: *mut GWin32OutputStream) -> gboolean;
42-
pub fn g_win32_output_stream_get_handle(stream: *mut GWin32OutputStream) -> *mut c_void;
43-
pub fn g_win32_output_stream_set_close_handle(
44-
stream: *mut GWin32OutputStream,
45-
close_handle: gboolean,
46-
);
47-
}
48-
49-
#[repr(C)]
50-
#[derive(Copy, Clone)]
51-
pub struct GWin32InputStreamClass {
52-
pub parent_class: GInputStreamClass,
53-
pub _g_reserved1: Option<unsafe extern "C" fn()>,
54-
pub _g_reserved2: Option<unsafe extern "C" fn()>,
55-
pub _g_reserved3: Option<unsafe extern "C" fn()>,
56-
pub _g_reserved4: Option<unsafe extern "C" fn()>,
57-
pub _g_reserved5: Option<unsafe extern "C" fn()>,
58-
}
59-
60-
impl ::std::fmt::Debug for GWin32InputStreamClass {
61-
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
62-
f.debug_struct(&format!("GWin32InputStreamClass @ {:?}", self as *const _))
63-
.field("parent_class", &self.parent_class)
64-
.field("_g_reserved1", &self._g_reserved1)
65-
.field("_g_reserved2", &self._g_reserved2)
66-
.field("_g_reserved3", &self._g_reserved3)
67-
.field("_g_reserved4", &self._g_reserved4)
68-
.field("_g_reserved5", &self._g_reserved5)
69-
.finish()
70-
}
71-
}
72-
73-
#[repr(C)]
74-
pub struct _GWin32InputStreamPrivate(c_void);
75-
76-
pub type GWin32InputStreamPrivate = *mut _GWin32InputStreamPrivate;
77-
78-
#[repr(C)]
79-
#[derive(Copy, Clone)]
80-
pub struct GWin32InputStream {
81-
pub parent_instance: GInputStream,
82-
pub priv_: *mut GWin32InputStreamPrivate,
83-
}
84-
85-
impl ::std::fmt::Debug for GWin32InputStream {
86-
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
87-
f.debug_struct(&format!("GWin32InputStream @ {:?}", self as *const _))
88-
.field("parent_instance", &self.parent_instance)
89-
.finish()
90-
}
91-
}
92-
93-
#[repr(C)]
94-
#[derive(Copy, Clone)]
95-
pub struct GWin32OutputStreamClass {
96-
pub parent_class: GOutputStreamClass,
97-
pub _g_reserved1: Option<unsafe extern "C" fn()>,
98-
pub _g_reserved2: Option<unsafe extern "C" fn()>,
99-
pub _g_reserved3: Option<unsafe extern "C" fn()>,
100-
pub _g_reserved4: Option<unsafe extern "C" fn()>,
101-
pub _g_reserved5: Option<unsafe extern "C" fn()>,
102-
}
103-
104-
impl ::std::fmt::Debug for GWin32OutputStreamClass {
105-
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
106-
f.debug_struct(&format!("GWin32OutputStreamClass @ {:?}", self as *const _))
107-
.field("parent_class", &self.parent_class)
108-
.field("_g_reserved1", &self._g_reserved1)
109-
.field("_g_reserved2", &self._g_reserved2)
110-
.field("_g_reserved3", &self._g_reserved3)
111-
.field("_g_reserved4", &self._g_reserved4)
112-
.field("_g_reserved5", &self._g_reserved5)
113-
.finish()
114-
}
115-
}
116-
117-
#[repr(C)]
118-
pub struct _GWin32OutputStreamPrivate(c_void);
119-
120-
pub type GWin32OutputStreamPrivate = *mut _GWin32OutputStreamPrivate;
121-
122-
#[repr(C)]
123-
#[derive(Copy, Clone)]
124-
pub struct GWin32OutputStream {
125-
pub parent_instance: GOutputStream,
126-
pub priv_: *mut GWin32OutputStreamPrivate,
127-
}
128-
129-
impl ::std::fmt::Debug for GWin32OutputStream {
130-
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
131-
f.debug_struct(&format!("GWin32OutputStream @ {:?}", self as *const _))
132-
.field("parent_instance", &self.parent_instance)
133-
.finish()
134-
}
135-
}
12+
pub type GNetworkMonitorBase = glib_sys::gpointer;
13+
pub type GNetworkMonitorBaseClass = glib_sys::gpointer;

0 commit comments

Comments
 (0)