xref: /PHP-8.2/ext/fileinfo/fileinfo_arginfo.h (revision b4ec3e9b)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: 94697d59958fb55a431bfa4786158b5db3c1ae0e */
3 
4 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_finfo_open, 0, 0, finfo, MAY_BE_FALSE)
5 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE")
6 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 1, "null")
7 ZEND_END_ARG_INFO()
8 
9 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_finfo_close, 0, 1, _IS_BOOL, 0)
10 	ZEND_ARG_OBJ_INFO(0, finfo, finfo, 0)
11 ZEND_END_ARG_INFO()
12 
13 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_finfo_set_flags, 0, 2, _IS_BOOL, 0)
14 	ZEND_ARG_OBJ_INFO(0, finfo, finfo, 0)
15 	ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
16 ZEND_END_ARG_INFO()
17 
18 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_finfo_file, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
19 	ZEND_ARG_OBJ_INFO(0, finfo, finfo, 0)
20 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
21 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE")
22 	ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null")
23 ZEND_END_ARG_INFO()
24 
25 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_finfo_buffer, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
26 	ZEND_ARG_OBJ_INFO(0, finfo, finfo, 0)
27 	ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
28 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE")
29 	ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null")
30 ZEND_END_ARG_INFO()
31 
32 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mime_content_type, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
33 	ZEND_ARG_INFO(0, filename)
34 ZEND_END_ARG_INFO()
35 
36 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo___construct, 0, 0, 0)
37 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE")
38 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 1, "null")
39 ZEND_END_ARG_INFO()
40 
41 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_finfo_file, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
42 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
43 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE")
44 	ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null")
45 ZEND_END_ARG_INFO()
46 
47 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_finfo_buffer, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
48 	ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
49 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE")
50 	ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null")
51 ZEND_END_ARG_INFO()
52 
53 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_set_flags, 0, 0, 1)
54 	ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
55 ZEND_END_ARG_INFO()
56 
57 
58 ZEND_FUNCTION(finfo_open);
59 ZEND_FUNCTION(finfo_close);
60 ZEND_FUNCTION(finfo_set_flags);
61 ZEND_FUNCTION(finfo_file);
62 ZEND_FUNCTION(finfo_buffer);
63 ZEND_FUNCTION(mime_content_type);
64 
65 
66 static const zend_function_entry ext_functions[] = {
67 	ZEND_FE(finfo_open, arginfo_finfo_open)
68 	ZEND_FE(finfo_close, arginfo_finfo_close)
69 	ZEND_FE(finfo_set_flags, arginfo_finfo_set_flags)
70 	ZEND_FE(finfo_file, arginfo_finfo_file)
71 	ZEND_FE(finfo_buffer, arginfo_finfo_buffer)
72 	ZEND_FE(mime_content_type, arginfo_mime_content_type)
73 	ZEND_FE_END
74 };
75 
76 
77 static const zend_function_entry class_finfo_methods[] = {
78 	ZEND_ME_MAPPING(__construct, finfo_open, arginfo_class_finfo___construct, ZEND_ACC_PUBLIC)
79 	ZEND_ME_MAPPING(file, finfo_file, arginfo_class_finfo_file, ZEND_ACC_PUBLIC)
80 	ZEND_ME_MAPPING(buffer, finfo_buffer, arginfo_class_finfo_buffer, ZEND_ACC_PUBLIC)
81 	ZEND_ME_MAPPING(set_flags, finfo_set_flags, arginfo_class_finfo_set_flags, ZEND_ACC_PUBLIC)
82 	ZEND_FE_END
83 };
84 
register_fileinfo_symbols(int module_number)85 static void register_fileinfo_symbols(int module_number)
86 {
87 	REGISTER_LONG_CONSTANT("FILEINFO_NONE", MAGIC_NONE, CONST_PERSISTENT);
88 	REGISTER_LONG_CONSTANT("FILEINFO_SYMLINK", MAGIC_SYMLINK, CONST_PERSISTENT);
89 	REGISTER_LONG_CONSTANT("FILEINFO_MIME", MAGIC_MIME, CONST_PERSISTENT);
90 	REGISTER_LONG_CONSTANT("FILEINFO_MIME_TYPE", MAGIC_MIME_TYPE, CONST_PERSISTENT);
91 	REGISTER_LONG_CONSTANT("FILEINFO_MIME_ENCODING", MAGIC_MIME_ENCODING, CONST_PERSISTENT);
92 	REGISTER_LONG_CONSTANT("FILEINFO_DEVICES", MAGIC_DEVICES, CONST_PERSISTENT);
93 	REGISTER_LONG_CONSTANT("FILEINFO_CONTINUE", MAGIC_CONTINUE, CONST_PERSISTENT);
94 #if defined(MAGIC_PRESERVE_ATIME)
95 	REGISTER_LONG_CONSTANT("FILEINFO_PRESERVE_ATIME", MAGIC_PRESERVE_ATIME, CONST_PERSISTENT);
96 #endif
97 #if defined(MAGIC_RAW)
98 	REGISTER_LONG_CONSTANT("FILEINFO_RAW", MAGIC_RAW, CONST_PERSISTENT);
99 #endif
100 	REGISTER_LONG_CONSTANT("FILEINFO_APPLE", MAGIC_APPLE, CONST_PERSISTENT);
101 	REGISTER_LONG_CONSTANT("FILEINFO_EXTENSION", MAGIC_EXTENSION, CONST_PERSISTENT);
102 }
103 
register_class_finfo(void)104 static zend_class_entry *register_class_finfo(void)
105 {
106 	zend_class_entry ce, *class_entry;
107 
108 	INIT_CLASS_ENTRY(ce, "finfo", class_finfo_methods);
109 	class_entry = zend_register_internal_class_ex(&ce, NULL);
110 	class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE;
111 
112 	return class_entry;
113 }
114