php-src/ext/standard/php_dir_int.h
Christoph M. Becker 50b3a0d011
Add comments about internal headers (GH-15689)
A common convention is to name internal C header files as `*_int.h`.
Since a couple of these are actually installed, we add comments that
this is not supposed to happen, (a) to avoid installing further
internal headers, and (b) to pave the way to fix this in the next major
PHP version.

Somewhat special is php_gmp_int.h, where "int" is meant as abbreviation
for "interface".

Another common convention is appending `_priv` or `_private`, but since
there have not been any issues regarding these headers so far, we
refrain from adding respective comments to these headers.

Anyhow, it might be a good idea to introduce some common naming
convention for such internal/private headers.
2024-09-08 16:11:25 +02:00

69 lines
1.8 KiB
C

/*
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| https://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
/* internal header; not supposed to be installed; FIXME but unfortunately is */
#ifndef PHP_DIR_INT_H
#define PHP_DIR_INT_H
#ifdef HAVE_GLOB
#ifndef PHP_WIN32
#include <glob.h>
#else
#include "win32/glob.h"
#endif
#endif
#ifdef HAVE_GLOB
#ifndef GLOB_BRACE
#define GLOB_BRACE 0
#endif
#ifndef GLOB_ERR
#define GLOB_ERR 0
#endif
#ifndef GLOB_MARK
#define GLOB_MARK 0
#endif
#ifndef GLOB_NOCHECK
#define GLOB_NOCHECK 0
#endif
#ifndef GLOB_NOESCAPE
#define GLOB_NOESCAPE 0
#endif
#ifndef GLOB_NOSORT
#define GLOB_NOSORT 0
#endif
#ifndef GLOB_ONLYDIR
#define GLOB_ONLYDIR (1<<30)
#define GLOB_EMULATE_ONLYDIR
#define GLOB_FLAGMASK (~GLOB_ONLYDIR)
#else
#define GLOB_FLAGMASK (~0)
#endif
/* This is used for checking validity of passed flags (passing invalid flags causes segfault in glob()!! */
#define GLOB_AVAILABLE_FLAGS (0 | GLOB_BRACE | GLOB_MARK | GLOB_NOSORT | GLOB_NOCHECK | GLOB_NOESCAPE | GLOB_ERR | GLOB_ONLYDIR)
#endif /* HAVE_GLOB */
char dirsep_str[2], pathsep_str[2];
#endif /* PHP_DIR_INT_H */