Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / OS_NS_stropts.h
blobdfcd6a9b30f7cdad833fdeac62dbb970486b0347
1 // -*- C++ -*-
3 //=============================================================================
4 /**
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)
21 # pragma once
22 # endif /* ACE_LACKS_PRAGMA_ONCE */
24 # ifndef ACE_IOCTL_TYPE_ARG2
25 # define ACE_IOCTL_TYPE_ARG2 int
26 # endif
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
34 #endif
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>
43 // method.
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;
50 int iAddressFamily;
51 int iProtocol;
52 char szProtocol[255+1];
55 // Callback function that's used by the QoS-enabled <ACE_OS::ioctl>
56 // method.
57 typedef void (*ACE_OVERLAPPED_COMPLETION_FUNC) (unsigned long error,
58 unsigned long bytes_transferred,
59 ACE_OVERLAPPED *overlapped,
60 unsigned long flags);
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
66 /**
67 * @class ACE_Str_Buf
69 * @brief Simple wrapper for STREAM pipes strbuf.
71 class ACE_Export ACE_Str_Buf : public strbuf
73 public:
74 /// Constructor.
75 ACE_Str_Buf (void *b = 0, int l = 0, int max = 0);
77 /// Constructor.
78 ACE_Str_Buf (strbuf &);
81 class ACE_QoS;
83 namespace ACE_OS {
84 ACE_NAMESPACE_INLINE_FUNCTION
85 int getmsg (ACE_HANDLE handle,
86 struct strbuf *ctl,
87 struct strbuf
88 *data, int *flags);
90 ACE_NAMESPACE_INLINE_FUNCTION
91 int getpmsg (ACE_HANDLE handle,
92 struct strbuf *ctl,
93 struct strbuf
94 *data,
95 int *band,
96 int *flags);
98 ACE_NAMESPACE_INLINE_FUNCTION
99 int fattach (int handle,
100 const char *path);
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,
109 void * = 0);
111 /// QoS-enabled @c ioctl
112 extern ACE_Export
113 int ioctl (ACE_HANDLE socket,
114 unsigned long io_control_code,
115 void *in_buffer_p,
116 unsigned long in_buffer,
117 void *out_buffer_p,
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.
125 extern ACE_Export
126 int ioctl (ACE_HANDLE socket,
127 unsigned long io_control_code,
128 ACE_QoS &ace_qos,
129 unsigned long *bytes_returned,
130 void *buffer_p = 0,
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,
142 int flags);
144 ACE_NAMESPACE_INLINE_FUNCTION
145 int putpmsg (ACE_HANDLE handle,
146 const struct strbuf *ctl,
147 const struct strbuf *data,
148 int band,
149 int flags);
150 } /* namespace ACE_OS */
152 ACE_END_VERSIONED_NAMESPACE_DECL
154 # if defined (ACE_HAS_INLINED_OSCALLS)
155 # if defined (ACE_INLINE)
156 # undef 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 */