Changes in uspace/srv/net/socket/socket_messages.h [6092b56e:3db8889] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/socket/socket_messages.h
r6092b56e r3db8889 115 115 * @param[out] answer The message answer structure. 116 116 */ 117 #define SOCKET_SET_SOCKET_ID(answer) &IPC_GET_ARG1(answer) 117 #define SOCKET_SET_SOCKET_ID(answer, value) \ 118 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG1(answer, argument);} 118 119 119 120 /** Returns the socket identifier message parameter. 120 121 * @param[in] call The message call structure. 121 122 */ 122 #define SOCKET_GET_SOCKET_ID(call) (int) IPC_GET_ARG1(call) 123 #define SOCKET_GET_SOCKET_ID(call) \ 124 ({int socket_id = (int) IPC_GET_ARG1(call); socket_id;}) 123 125 124 126 /** Sets the read data length in the message answer. 125 127 * @param[out] answer The message answer structure. 126 128 */ 127 #define SOCKET_SET_READ_DATA_LENGTH(answer) &IPC_GET_ARG1(answer) 129 #define SOCKET_SET_READ_DATA_LENGTH(answer, value) \ 130 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG1(answer, argument);} 128 131 129 132 /** Returns the read data length message parameter. 130 133 * @param[in] call The message call structure. 131 134 */ 132 #define SOCKET_GET_READ_DATA_LENGTH(call) (int) IPC_GET_ARG1(call) 135 #define SOCKET_GET_READ_DATA_LENGTH(call) \ 136 ({int data_length = (int) IPC_GET_ARG1(call); data_length;}) 133 137 134 138 /** Returns the backlog message parameter. 135 139 * @param[in] call The message call structure. 136 140 */ 137 #define SOCKET_GET_BACKLOG(call) (int) IPC_GET_ARG2(call) 141 #define SOCKET_GET_BACKLOG(call) \ 142 ({int backlog = (int) IPC_GET_ARG2(call); backlog;}) 138 143 139 144 /** Returns the option level message parameter. 140 145 * @param[in] call The message call structure. 141 146 */ 142 #define SOCKET_GET_OPT_LEVEL(call) (int) IPC_GET_ARG2(call) 147 #define SOCKET_GET_OPT_LEVEL(call) \ 148 ({int opt_level = (int) IPC_GET_ARG2(call); opt_level;}) 143 149 144 150 /** Returns the data fragment size message parameter. 145 151 * @param[in] call The message call structure. 146 152 */ 147 #define SOCKET_GET_DATA_FRAGMENT_SIZE(call) (size_t) IPC_GET_ARG2(call) 153 #define SOCKET_GET_DATA_FRAGMENT_SIZE(call) \ 154 ({size_t size = (size_t) IPC_GET_ARG2(call); size;}) 148 155 149 156 /** Sets the data fragment size in the message answer. 150 157 * @param[out] answer The message answer structure. 151 158 */ 152 #define SOCKET_SET_DATA_FRAGMENT_SIZE(answer) &IPC_GET_ARG2(answer) 159 #define SOCKET_SET_DATA_FRAGMENT_SIZE(answer, value) \ 160 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG2(answer, argument);} 153 161 154 162 /** Sets the address length in the message answer. 155 163 * @param[out] answer The message answer structure. 156 164 */ 157 #define SOCKET_SET_ADDRESS_LENGTH(answer) &IPC_GET_ARG3(answer) 165 #define SOCKET_SET_ADDRESS_LENGTH(answer, value) \ 166 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG3(answer, argument);} 158 167 159 168 /** Returns the address length message parameter. 160 169 * @param[in] call The message call structure. 161 170 */ 162 #define SOCKET_GET_ADDRESS_LENGTH(call) (socklen_t) IPC_GET_ARG3(call) 171 #define SOCKET_GET_ADDRESS_LENGTH(call) \ 172 ({socklen_t address_length = (socklen_t) IPC_GET_ARG3(call); address_length;}) 163 173 164 174 /** Sets the header size in the message answer. 165 175 * @param[out] answer The message answer structure. 166 176 */ 167 #define SOCKET_SET_HEADER_SIZE(answer) &IPC_GET_ARG3(answer) 177 #define SOCKET_SET_HEADER_SIZE(answer, value) \ 178 \ 179 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG3(answer, argument);} 168 180 169 181 /** Returns the header size message parameter. 170 182 * @param[in] call The message call structure. 171 183 */ 172 #define SOCKET_GET_HEADER_SIZE(call) (size_t) IPC_GET_ARG3(call) 184 #define SOCKET_GET_HEADER_SIZE(call) \ 185 ({size_t size = (size_t) IPC_GET_ARG3(call); size;}) 173 186 174 187 /** Returns the flags message parameter. 175 188 * @param[in] call The message call structure. 176 189 */ 177 #define SOCKET_GET_FLAGS(call) (int) IPC_GET_ARG4(call) 190 #define SOCKET_GET_FLAGS(call) \ 191 ({int flags = (int) IPC_GET_ARG4(call); flags;}) 178 192 179 193 /** Returns the option name message parameter. 180 194 * @param[in] call The message call structure. 181 195 */ 182 #define SOCKET_GET_OPT_NAME(call) (int) IPC_GET_ARG4(call) 196 #define SOCKET_GET_OPT_NAME(call) \ 197 ({int opt_name = (int) IPC_GET_ARG4(call); opt_name;}) 183 198 184 199 /** Returns the data fragments message parameter. 185 200 * @param[in] call The message call structure. 186 201 */ 187 #define SOCKET_GET_DATA_FRAGMENTS(call) (int) IPC_GET_ARG5(call) 202 #define SOCKET_GET_DATA_FRAGMENTS(call) \ 203 ({int fragments = (int) IPC_GET_ARG5(call); fragments;}) 188 204 189 205 /** Returns the new socket identifier message parameter. 190 206 * @param[in] call The message call structure. 191 207 */ 192 #define SOCKET_GET_NEW_SOCKET_ID(call) (int) IPC_GET_ARG5(call) 208 #define SOCKET_GET_NEW_SOCKET_ID(call) \ 209 ({int socket_id = (int) IPC_GET_ARG5(call); socket_id;}) 193 210 194 211 /*@}*/
Note:
See TracChangeset
for help on using the changeset viewer.