3 //=============================================================================
5 * @file OS_NS_stropts.h
7 * $Id: OS_NS_stropts.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
10 * @author Jesper S. M|ller<stophph@diku.dk>
11 * @author and a cast of thousands...
15 //=============================================================================
17 #ifndef ACE_OS_NS_STROPTS_H
18 #define ACE_OS_NS_STROPTS_H
20 # include /**/ "ace/pre.h"
22 # include "ace/config-all.h"
24 # if !defined (ACE_LACKS_PRAGMA_ONCE)
26 # endif /* ACE_LACKS_PRAGMA_ONCE */
28 # ifndef ACE_IOCTL_TYPE_ARG2
29 # define ACE_IOCTL_TYPE_ARG2 int
32 #include "ace/os_include/os_stropts.h"
33 #include "ace/os_include/os_stdio.h"
34 #include /**/ "ace/ACE_export.h"
36 #if defined (ACE_EXPORT_MACRO)
37 # undef ACE_EXPORT_MACRO
39 #define ACE_EXPORT_MACRO ACE_Export
41 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
43 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
44 typedef WSAPROTOCOL_INFO ACE_Protocol_Info
;
46 // Callback function that's used by the QoS-enabled <ACE_OS::ioctl>
48 typedef LPWSAOVERLAPPED_COMPLETION_ROUTINE ACE_OVERLAPPED_COMPLETION_FUNC
;
49 typedef GROUP ACE_SOCK_GROUP
;
50 #else /* (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) */
51 struct ACE_Protocol_Info
53 unsigned long dwServiceFlags1
;
56 char szProtocol
[255+1];
59 // Callback function that's used by the QoS-enabled <ACE_OS::ioctl>
61 typedef void (*ACE_OVERLAPPED_COMPLETION_FUNC
) (unsigned long error
,
62 unsigned long bytes_transferred
,
63 ACE_OVERLAPPED
*overlapped
,
65 typedef unsigned long ACE_SOCK_GROUP
;
67 #endif /* (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) */
69 // @todo: move this to it's own file... dhinton
73 * @brief Simple wrapper for STREAM pipes strbuf.
75 class ACE_Export ACE_Str_Buf
: public strbuf
78 // = Initialization method
80 ACE_Str_Buf (void *b
= 0, int l
= 0, int max
= 0);
83 ACE_Str_Buf (strbuf
&);
90 ACE_NAMESPACE_INLINE_FUNCTION
91 int getmsg (ACE_HANDLE handle
,
96 ACE_NAMESPACE_INLINE_FUNCTION
97 int getpmsg (ACE_HANDLE handle
,
104 ACE_NAMESPACE_INLINE_FUNCTION
105 int fattach (int handle
,
108 ACE_NAMESPACE_INLINE_FUNCTION
109 int fdetach (const char *file
);
111 /// UNIX-style <ioctl>.
112 ACE_NAMESPACE_INLINE_FUNCTION
113 int ioctl (ACE_HANDLE handle
,
114 ACE_IOCTL_TYPE_ARG2 cmd
,
117 /// QoS-enabled <ioctl>.
119 int ioctl (ACE_HANDLE socket
,
120 unsigned long io_control_code
,
122 unsigned long in_buffer
,
124 unsigned long out_buffer
,
125 unsigned long *bytes_returned
,
126 ACE_OVERLAPPED
*overlapped
,
127 ACE_OVERLAPPED_COMPLETION_FUNC func
);
129 #if !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500))
130 /// QoS-enabled <ioctl> when the I/O control code is either
131 /// SIO_SET_QOS or SIO_GET_QOS.
133 int ioctl (ACE_HANDLE socket
,
134 unsigned long io_control_code
,
136 unsigned long *bytes_returned
,
138 unsigned long buffer
= 0,
139 ACE_OVERLAPPED
*overlapped
= 0,
140 ACE_OVERLAPPED_COMPLETION_FUNC func
= 0);
141 #endif /* !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) */
143 ACE_NAMESPACE_INLINE_FUNCTION
144 int isastream (ACE_HANDLE handle
);
146 ACE_NAMESPACE_INLINE_FUNCTION
147 int putmsg (ACE_HANDLE handle
,
148 const struct strbuf
*ctl
,
149 const struct strbuf
*data
,
152 ACE_NAMESPACE_INLINE_FUNCTION
153 int putpmsg (ACE_HANDLE handle
,
154 const struct strbuf
*ctl
,
155 const struct strbuf
*data
,
159 } /* namespace ACE_OS */
161 ACE_END_VERSIONED_NAMESPACE_DECL
163 # if defined (ACE_HAS_INLINED_OSCALLS)
164 # if defined (ACE_INLINE)
166 # endif /* ACE_INLINE */
167 # define ACE_INLINE inline
168 # include "ace/OS_NS_stropts.inl"
169 # endif /* ACE_HAS_INLINED_OSCALLS */
171 # include /**/ "ace/post.h"
172 #endif /* ACE_OS_NS_STROPTS_H */