3 //=============================================================================
5 * @file OS_NS_stropts.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 * @author Jesper S. M|ller<stophph@diku.dk>
9 * @author and a cast of thousands...
11 //=============================================================================
13 #ifndef ACE_OS_NS_STROPTS_H
14 #define ACE_OS_NS_STROPTS_H
16 # include /**/ "ace/pre.h"
18 # include "ace/config-all.h"
20 # if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # endif /* ACE_LACKS_PRAGMA_ONCE */
24 # ifndef ACE_IOCTL_TYPE_ARG2
25 # define ACE_IOCTL_TYPE_ARG2 int
28 #include "ace/os_include/os_stropts.h"
29 #include "ace/os_include/os_stdio.h"
30 #include /**/ "ace/ACE_export.h"
32 #if defined (ACE_EXPORT_MACRO)
33 # undef ACE_EXPORT_MACRO
35 #define ACE_EXPORT_MACRO ACE_Export
37 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
39 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
40 typedef WSAPROTOCOL_INFO ACE_Protocol_Info
;
42 // Callback function that's used by the QoS-enabled <ACE_OS::ioctl>
44 typedef LPWSAOVERLAPPED_COMPLETION_ROUTINE ACE_OVERLAPPED_COMPLETION_FUNC
;
45 typedef GROUP ACE_SOCK_GROUP
;
46 #else /* (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) */
47 struct ACE_Protocol_Info
49 unsigned long dwServiceFlags1
;
52 char szProtocol
[255+1];
55 // Callback function that's used by the QoS-enabled <ACE_OS::ioctl>
57 typedef void (*ACE_OVERLAPPED_COMPLETION_FUNC
) (unsigned long error
,
58 unsigned long bytes_transferred
,
59 ACE_OVERLAPPED
*overlapped
,
61 typedef unsigned long ACE_SOCK_GROUP
;
63 #endif /* (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) */
65 // @todo: move this to it's own file... dhinton
69 * @brief Simple wrapper for STREAM pipes strbuf.
71 class ACE_Export ACE_Str_Buf
: public strbuf
75 ACE_Str_Buf (void *b
= 0, int l
= 0, int max
= 0);
78 ACE_Str_Buf (strbuf
&);
84 ACE_NAMESPACE_INLINE_FUNCTION
85 int getmsg (ACE_HANDLE handle
,
90 ACE_NAMESPACE_INLINE_FUNCTION
91 int getpmsg (ACE_HANDLE handle
,
98 ACE_NAMESPACE_INLINE_FUNCTION
99 int fattach (int handle
,
102 ACE_NAMESPACE_INLINE_FUNCTION
103 int fdetach (const char *file
);
105 /// UNIX-style @c ioctl
106 ACE_NAMESPACE_INLINE_FUNCTION
107 int ioctl (ACE_HANDLE handle
,
108 ACE_IOCTL_TYPE_ARG2 cmd
,
111 /// QoS-enabled @c ioctl
113 int ioctl (ACE_HANDLE socket
,
114 unsigned long io_control_code
,
116 unsigned long in_buffer
,
118 unsigned long out_buffer
,
119 unsigned long *bytes_returned
,
120 ACE_OVERLAPPED
*overlapped
,
121 ACE_OVERLAPPED_COMPLETION_FUNC func
);
123 /// QoS-enabled @c ioctl when the I/O control code is either
124 /// SIO_SET_QOS or SIO_GET_QOS.
126 int ioctl (ACE_HANDLE socket
,
127 unsigned long io_control_code
,
129 unsigned long *bytes_returned
,
131 unsigned long buffer
= 0,
132 ACE_OVERLAPPED
*overlapped
= 0,
133 ACE_OVERLAPPED_COMPLETION_FUNC func
= 0);
135 ACE_NAMESPACE_INLINE_FUNCTION
136 int isastream (ACE_HANDLE handle
);
138 ACE_NAMESPACE_INLINE_FUNCTION
139 int putmsg (ACE_HANDLE handle
,
140 const struct strbuf
*ctl
,
141 const struct strbuf
*data
,
144 ACE_NAMESPACE_INLINE_FUNCTION
145 int putpmsg (ACE_HANDLE handle
,
146 const struct strbuf
*ctl
,
147 const struct strbuf
*data
,
150 } /* namespace ACE_OS */
152 ACE_END_VERSIONED_NAMESPACE_DECL
154 # if defined (ACE_HAS_INLINED_OSCALLS)
155 # if defined (ACE_INLINE)
157 # endif /* ACE_INLINE */
158 # define ACE_INLINE inline
159 # include "ace/OS_NS_stropts.inl"
160 # endif /* ACE_HAS_INLINED_OSCALLS */
162 # include /**/ "ace/post.h"
163 #endif /* ACE_OS_NS_STROPTS_H */