libcasio/src/stream/builtin/windows/close.c

38 lines
1.3 KiB
C

/* ****************************************************************************
* stream/builtin/windows/close.c -- close a Windows API stream.
* Copyright (C) 2016-2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
*
* This file is part of libcasio.
* libcasio is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3.0 of the License,
* or (at your option) any later version.
*
* libcasio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libcasio; if not, see <http://www.gnu.org/licenses/>.
* ************************************************************************* */
#include "windows.h"
#ifndef LIBCASIO_DISABLED_WINDOWS
/**
* casio_windows_close:
* Close a MS-Windows stream.
*
* @arg cookie the cookie.
* @return the error code (0 if ok).
*/
int CASIO_EXPORT casio_windows_close(win_cookie_t *cookie)
{
CloseHandle(cookie->_handle);
casio_free(cookie);
return (0);
}
#endif