xref: /PHP-7.4/win32/ioutil.h (revision 27bb0d91)
13d3f11edSAnatol Belski /*
23d3f11edSAnatol Belski    +----------------------------------------------------------------------+
33d3f11edSAnatol Belski    | PHP Version 7                                                        |
43d3f11edSAnatol Belski    +----------------------------------------------------------------------+
50cf7de1cSZeev Suraski    | Copyright (c) The PHP Group                                          |
63d3f11edSAnatol Belski    +----------------------------------------------------------------------+
73d3f11edSAnatol Belski    | This source file is subject to version 3.01 of the PHP license,      |
83d3f11edSAnatol Belski    | that is bundled with this package in the file LICENSE, and is        |
93d3f11edSAnatol Belski    | available through the world-wide-web at the following url:           |
103d3f11edSAnatol Belski    | http://www.php.net/license/3_01.txt                                  |
113d3f11edSAnatol Belski    | If you did not receive a copy of the PHP license and are unable to   |
123d3f11edSAnatol Belski    | obtain it through the world-wide-web, please send a note to          |
133d3f11edSAnatol Belski    | license@php.net so we can mail you a copy immediately.               |
143d3f11edSAnatol Belski    +----------------------------------------------------------------------+
153d3f11edSAnatol Belski    | Author: Anatol Belski <ab@php.net>                                   |
163d3f11edSAnatol Belski    +----------------------------------------------------------------------+
173d3f11edSAnatol Belski */
183d3f11edSAnatol Belski 
193d3f11edSAnatol Belski /* This file integrates several modified parts from the libuv project, which
203d3f11edSAnatol Belski  * is copyrighted to
213d3f11edSAnatol Belski  *
223d3f11edSAnatol Belski  * Copyright Joyent, Inc. and other Node contributors. All rights reserved.
233d3f11edSAnatol Belski  *
243d3f11edSAnatol Belski  * Permission is hereby granted, free of charge, to any person obtaining a copy
253d3f11edSAnatol Belski  * of this software and associated documentation files (the "Software"), to
263d3f11edSAnatol Belski  * deal in the Software without restriction, including without limitation the
273d3f11edSAnatol Belski  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
283d3f11edSAnatol Belski  * sell copies of the Software, and to permit persons to whom the Software is
293d3f11edSAnatol Belski  * furnished to do so, subject to the following conditions:
303d3f11edSAnatol Belski  *
313d3f11edSAnatol Belski  * The above copyright notice and this permission notice shall be included in
323d3f11edSAnatol Belski  * all copies or substantial portions of the Software.
333d3f11edSAnatol Belski  *
343d3f11edSAnatol Belski  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
353d3f11edSAnatol Belski  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
363d3f11edSAnatol Belski  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
373d3f11edSAnatol Belski  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
383d3f11edSAnatol Belski  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
393d3f11edSAnatol Belski  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
403d3f11edSAnatol Belski  * IN THE SOFTWARE.
41c215b8d1SGabriel Caruso  */
423d3f11edSAnatol Belski 
433d3f11edSAnatol Belski #ifndef PHP_WIN32_IOUTIL_H
443d3f11edSAnatol Belski #define PHP_WIN32_IOUTIL_H
453d3f11edSAnatol Belski 
463d3f11edSAnatol Belski #include <fcntl.h>
473d3f11edSAnatol Belski #include <sys/types.h>
483d3f11edSAnatol Belski #include <sys/stat.h>
493d3f11edSAnatol Belski #include <io.h>
503d3f11edSAnatol Belski #include <stdio.h>
513d3f11edSAnatol Belski #include <stdlib.h>
523d3f11edSAnatol Belski 
533d3f11edSAnatol Belski #include "win32/winutil.h"
543d3f11edSAnatol Belski #include "win32/codepage.h"
553d3f11edSAnatol Belski 
563d3f11edSAnatol Belski #ifdef __cplusplus
573d3f11edSAnatol Belski extern "C" {
583d3f11edSAnatol Belski #endif
593d3f11edSAnatol Belski 
603d3f11edSAnatol Belski #ifdef PHP_EXPORTS
613d3f11edSAnatol Belski # define PW32IO __declspec(dllexport)
623d3f11edSAnatol Belski #else
633d3f11edSAnatol Belski # define PW32IO __declspec(dllimport)
643d3f11edSAnatol Belski #endif
653d3f11edSAnatol Belski 
663d3f11edSAnatol Belski #define PHP_WIN32_IOUTIL_MAXPATHLEN 2048
673d3f11edSAnatol Belski 
683d3f11edSAnatol Belski #if !defined(MAXPATHLEN) || MAXPATHLEN < PHP_WIN32_IOUTIL_MAXPATHLEN
693d3f11edSAnatol Belski # undef MAXPATHLEN
703d3f11edSAnatol Belski # define MAXPATHLEN PHP_WIN32_IOUTIL_MAXPATHLEN
713d3f11edSAnatol Belski #endif
723d3f11edSAnatol Belski 
733d3f11edSAnatol Belski #ifndef mode_t
743d3f11edSAnatol Belski typedef unsigned short mode_t;
753d3f11edSAnatol Belski #endif
763d3f11edSAnatol Belski 
77c9274a4cSAnatol Belski /* these are not defined in win32 headers */
78c9274a4cSAnatol Belski #ifndef W_OK
79c9274a4cSAnatol Belski #define W_OK 0x02
80c9274a4cSAnatol Belski #endif
81c9274a4cSAnatol Belski #ifndef R_OK
82c9274a4cSAnatol Belski #define R_OK 0x04
83c9274a4cSAnatol Belski #endif
84c9274a4cSAnatol Belski #ifndef X_OK
85c9274a4cSAnatol Belski #define X_OK 0x01
86c9274a4cSAnatol Belski #endif
87c9274a4cSAnatol Belski #ifndef F_OK
88c9274a4cSAnatol Belski #define F_OK 0x00
89c9274a4cSAnatol Belski #endif
90c9274a4cSAnatol Belski 
91b37a6aafSjohnstevenson /* from ntifs.h */
92b37a6aafSjohnstevenson #ifndef SYMLINK_FLAG_RELATIVE
93b37a6aafSjohnstevenson #define SYMLINK_FLAG_RELATIVE 0x01
94b37a6aafSjohnstevenson #endif
95b37a6aafSjohnstevenson 
96