[PECL-CVS] [pecl-file_system-xattr] master: function entry and constants in stub

[email protected] (Remi Collet)
Newsgroups php.pecl.cvs
Message-ID <[email protected]>
Author: Remi Collet (remicollet)
Date: 2022-07-20T14:57:36+02:00

Commit: https://github.com/php/pecl-file_system-xattr/commit/55f4404ff667914b78ae4b5b65d6f08b78410008
Raw diff: https://github.com/php/pecl-file_system-xattr/commit/55f4404ff667914b78ae4b5b65d6f08b78410008.diff

function entry and constants in stub

Changed paths:
  M  xattr.c
  M  xattr.stub.php
  M  xattr_arginfo.h


Diff:

diff --git a/xattr.c b/xattr.c
index ec6797f..1a5737e 100644
--- a/xattr.c
+++ b/xattr.c
@@ -57,26 +57,12 @@
 /* file generated with PHP 8+ used on PHP 7 thanks to above compatibility layer */
 #include "xattr_arginfo.h"
 
-/* {{{ xattr_functions[]
- *
- * Every user visible function must have an entry in xattr_functions[].
- */
-zend_function_entry xattr_functions[] = {
-	PHP_FE(xattr_set,       arginfo_xattr_set)
-	PHP_FE(xattr_get,       arginfo_xattr_get)
-	PHP_FE(xattr_remove,    arginfo_xattr_remove)
-	PHP_FE(xattr_list,      arginfo_xattr_list)
-	PHP_FE(xattr_supported,	arginfo_xattr_supported)
-	PHP_FE_END
-};
-/* }}} */
-
 /* {{{ xattr_module_entry
  */
 zend_module_entry xattr_module_entry = {
 	STANDARD_MODULE_HEADER,
 	"xattr",
-	xattr_functions,
+	ext_functions,
 	PHP_MINIT(xattr),
 	NULL,
 	NULL,
@@ -95,17 +81,7 @@ ZEND_GET_MODULE(xattr)
  */
 PHP_MINIT_FUNCTION(xattr)
 {
-	REGISTER_LONG_CONSTANT("XATTR_CREATE",     XATTR_CREATE,     CONST_CS | CONST_PERSISTENT);
-	REGISTER_LONG_CONSTANT("XATTR_REPLACE",    XATTR_REPLACE,    CONST_CS | CONST_PERSISTENT);
-
-	REGISTER_LONG_CONSTANT("XATTR_DONTFOLLOW", XATTR_DONTFOLLOW, CONST_CS | CONST_PERSISTENT);
-
-	REGISTER_LONG_CONSTANT("XATTR_USER",       XATTR_USER,       CONST_CS | CONST_PERSISTENT);
-	REGISTER_LONG_CONSTANT("XATTR_ROOT",       XATTR_ROOT,       CONST_CS | CONST_PERSISTENT);
-	REGISTER_LONG_CONSTANT("XATTR_TRUSTED",    XATTR_TRUSTED,    CONST_CS | CONST_PERSISTENT);
-	REGISTER_LONG_CONSTANT("XATTR_SYSTEM",     XATTR_SYSTEM,     CONST_CS | CONST_PERSISTENT);
-	REGISTER_LONG_CONSTANT("XATTR_SECURITY",   XATTR_SECURITY,   CONST_CS | CONST_PERSISTENT);
-	REGISTER_LONG_CONSTANT("XATTR_ALL",        XATTR_ALL,        CONST_CS | CONST_PERSISTENT);
+	register_xattr_symbols(module_number);
 
 	return SUCCESS;
 }
diff --git a/xattr.stub.php b/xattr.stub.php
index 04d6422..7515cf9 100644
--- a/xattr.stub.php
+++ b/xattr.stub.php
@@ -1,5 +1,65 @@
 <?php
 
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
+
+/**
+ * @var int
+ * @cvalue XATTR_CREATE
+ */
+const XATTR_CREATE = UNKNOWN;
+
+/**
+ * @var int
+ * @cvalue XATTR_REPLACE
+ */
+const XATTR_REPLACE = UNKNOWN;
+
+/**
+ * @var int
+ * @cvalue XATTR_DONTFOLLOW
+ */
+const XATTR_DONTFOLLOW = UNKNOWN;
+
+/**
+ * @var int
+ * @cvalue XATTR_USER
+ */
+const XATTR_USER = UNKNOWN;
+
+/**
+ * @var int
+ * @cvalue XATTR_ROOT
+ */
+const XATTR_ROOT = UNKNOWN;
+
+/**
+ * @var int
+ * @cvalue XATTR_TRUSTED
+ */
+const XATTR_TRUSTED = UNKNOWN;
+
+/**
+ * @var int
+ * @cvalue XATTR_SYSTEM
+ */
+const XATTR_SYSTEM = UNKNOWN;
+
+/**
+ * @var int
+ * @cvalue XATTR_SECURITY
+ */
+const XATTR_SECURITY = UNKNOWN;
+
+/**
+ * @var int
+ * @cvalue XATTR_ALL
+ */
+const XATTR_ALL = UNKNOWN;
+
+
 function xattr_set(string $path, string $name, string $value, int $flag = 0): bool {}
 
 #if PHP_MAJOR_VERSION < 8
diff --git a/xattr_arginfo.h b/xattr_arginfo.h
index 309a41d..50e9aed 100644
--- a/xattr_arginfo.h
+++ b/xattr_arginfo.h
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a7f022885d01d53913bae459d614cc2ae44a3a07 */
+ * Stub hash: db4d314e2ba7f19a7f82b6d903a94336137fe46a */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xattr_set, 0, 3, _IS_BOOL, 0)
 	ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0)
@@ -48,3 +48,53 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_xattr_list, 0, 1, MAY_BE_ARRAY|M
 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
 ZEND_END_ARG_INFO()
 #endif
+
+
+ZEND_FUNCTION(xattr_set);
+#if PHP_MAJOR_VERSION < 8
+ZEND_FUNCTION(xattr_get);
+#endif
+#if !(PHP_MAJOR_VERSION < 8)
+ZEND_FUNCTION(xattr_get);
+#endif
+ZEND_FUNCTION(xattr_supported);
+ZEND_FUNCTION(xattr_remove);
+#if PHP_MAJOR_VERSION < 8
+ZEND_FUNCTION(xattr_list);
+#endif
+#if !(PHP_MAJOR_VERSION < 8)
+ZEND_FUNCTION(xattr_list);
+#endif
+
+
+static const zend_function_entry ext_functions[] = {
+	ZEND_FE(xattr_set, arginfo_xattr_set)
+#if PHP_MAJOR_VERSION < 8
+	ZEND_FE(xattr_get, arginfo_xattr_get)
+#endif
+#if !(PHP_MAJOR_VERSION < 8)
+	ZEND_FE(xattr_get, arginfo_xattr_get)
+#endif
+	ZEND_FE(xattr_supported, arginfo_xattr_supported)
+	ZEND_FE(xattr_remove, arginfo_xattr_remove)
+#if PHP_MAJOR_VERSION < 8
+	ZEND_FE(xattr_list, arginfo_xattr_list)
+#endif
+#if !(PHP_MAJOR_VERSION < 8)
+	ZEND_FE(xattr_list, arginfo_xattr_list)
+#endif
+	ZEND_FE_END
+};
+
+static void register_xattr_symbols(int module_number)
+{
+	REGISTER_LONG_CONSTANT("XATTR_CREATE", XATTR_CREATE, CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("XATTR_REPLACE", XATTR_REPLACE, CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("XATTR_DONTFOLLOW", XATTR_DONTFOLLOW, CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("XATTR_USER", XATTR_USER, CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("XATTR_ROOT", XATTR_ROOT, CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("XATTR_TRUSTED", XATTR_TRUSTED, CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("XATTR_SYSTEM", XATTR_SYSTEM, CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("XATTR_SECURITY", XATTR_SECURITY, CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("XATTR_ALL", XATTR_ALL, CONST_CS | CONST_PERSISTENT);
+}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.