11cb0ef41Sopenharmony_ci/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
21cb0ef41Sopenharmony_ci *
31cb0ef41Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy
41cb0ef41Sopenharmony_ci * of this software and associated documentation files (the "Software"), to
51cb0ef41Sopenharmony_ci * deal in the Software without restriction, including without limitation the
61cb0ef41Sopenharmony_ci * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
71cb0ef41Sopenharmony_ci * sell copies of the Software, and to permit persons to whom the Software is
81cb0ef41Sopenharmony_ci * furnished to do so, subject to the following conditions:
91cb0ef41Sopenharmony_ci *
101cb0ef41Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
111cb0ef41Sopenharmony_ci * all copies or substantial portions of the Software.
121cb0ef41Sopenharmony_ci *
131cb0ef41Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
141cb0ef41Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
151cb0ef41Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
161cb0ef41Sopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
171cb0ef41Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
181cb0ef41Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
191cb0ef41Sopenharmony_ci * IN THE SOFTWARE.
201cb0ef41Sopenharmony_ci */
211cb0ef41Sopenharmony_ci
221cb0ef41Sopenharmony_ci#ifndef UV_WIN_STREAM_INL_H_
231cb0ef41Sopenharmony_ci#define UV_WIN_STREAM_INL_H_
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_ci#include <assert.h>
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_ci#include "uv.h"
281cb0ef41Sopenharmony_ci#include "internal.h"
291cb0ef41Sopenharmony_ci#include "handle-inl.h"
301cb0ef41Sopenharmony_ci#include "req-inl.h"
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ci
331cb0ef41Sopenharmony_ciINLINE static void uv__stream_init(uv_loop_t* loop,
341cb0ef41Sopenharmony_ci                                   uv_stream_t* handle,
351cb0ef41Sopenharmony_ci                                   uv_handle_type type) {
361cb0ef41Sopenharmony_ci  uv__handle_init(loop, (uv_handle_t*) handle, type);
371cb0ef41Sopenharmony_ci  handle->write_queue_size = 0;
381cb0ef41Sopenharmony_ci  handle->activecnt = 0;
391cb0ef41Sopenharmony_ci  handle->stream.conn.shutdown_req = NULL;
401cb0ef41Sopenharmony_ci  handle->stream.conn.write_reqs_pending = 0;
411cb0ef41Sopenharmony_ci
421cb0ef41Sopenharmony_ci  UV_REQ_INIT(&handle->read_req, UV_READ);
431cb0ef41Sopenharmony_ci  handle->read_req.event_handle = NULL;
441cb0ef41Sopenharmony_ci  handle->read_req.wait_handle = INVALID_HANDLE_VALUE;
451cb0ef41Sopenharmony_ci  handle->read_req.data = handle;
461cb0ef41Sopenharmony_ci}
471cb0ef41Sopenharmony_ci
481cb0ef41Sopenharmony_ci
491cb0ef41Sopenharmony_ciINLINE static void uv__connection_init(uv_stream_t* handle) {
501cb0ef41Sopenharmony_ci  handle->flags |= UV_HANDLE_CONNECTION;
511cb0ef41Sopenharmony_ci}
521cb0ef41Sopenharmony_ci
531cb0ef41Sopenharmony_ci
541cb0ef41Sopenharmony_ci#endif /* UV_WIN_STREAM_INL_H_ */
55