Skip to content

Commit 5166e10

Browse files
committed
Generate function entries for a couple of extensions
1 parent a43bc33 commit 5166e10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+570
-547
lines changed

ext/bcmath/bcmath.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,10 @@ ZEND_DECLARE_MODULE_GLOBALS(bcmath)
3333
static PHP_GINIT_FUNCTION(bcmath);
3434
static PHP_GSHUTDOWN_FUNCTION(bcmath);
3535

36-
static const zend_function_entry bcmath_functions[] = {
37-
PHP_FE(bcadd, arginfo_bcadd)
38-
PHP_FE(bcsub, arginfo_bcsub)
39-
PHP_FE(bcmul, arginfo_bcmul)
40-
PHP_FE(bcdiv, arginfo_bcdiv)
41-
PHP_FE(bcmod, arginfo_bcmod)
42-
PHP_FE(bcpow, arginfo_bcpow)
43-
PHP_FE(bcsqrt, arginfo_bcsqrt)
44-
PHP_FE(bcscale, arginfo_bcscale)
45-
PHP_FE(bccomp, arginfo_bccomp)
46-
PHP_FE(bcpowmod, arginfo_bcpowmod)
47-
PHP_FE_END
48-
};
49-
5036
zend_module_entry bcmath_module_entry = {
5137
STANDARD_MODULE_HEADER,
5238
"bcmath",
53-
bcmath_functions,
39+
ext_functions,
5440
PHP_MINIT(bcmath),
5541
PHP_MSHUTDOWN(bcmath),
5642
NULL,

ext/bcmath/bcmath.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
/** @generate-function-entries */
4+
35
function bcadd(string $left_operand, string $right_operand, int $scale = UNKNOWN): string {}
46

57
function bcsub(string $left_operand, string $right_operand, int $scale = UNKNOWN): string {}

ext/bcmath/bcmath_arginfo.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,30 @@ ZEND_END_ARG_INFO()
4545
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcscale, 0, 0, IS_LONG, 0)
4646
ZEND_ARG_TYPE_INFO(0, scale, IS_LONG, 0)
4747
ZEND_END_ARG_INFO()
48+
49+
50+
ZEND_FUNCTION(bcadd);
51+
ZEND_FUNCTION(bcsub);
52+
ZEND_FUNCTION(bcmul);
53+
ZEND_FUNCTION(bcdiv);
54+
ZEND_FUNCTION(bcmod);
55+
ZEND_FUNCTION(bcpowmod);
56+
ZEND_FUNCTION(bcpow);
57+
ZEND_FUNCTION(bcsqrt);
58+
ZEND_FUNCTION(bccomp);
59+
ZEND_FUNCTION(bcscale);
60+
61+
62+
static const zend_function_entry ext_functions[] = {
63+
ZEND_FE(bcadd, arginfo_bcadd)
64+
ZEND_FE(bcsub, arginfo_bcsub)
65+
ZEND_FE(bcmul, arginfo_bcmul)
66+
ZEND_FE(bcdiv, arginfo_bcdiv)
67+
ZEND_FE(bcmod, arginfo_bcmod)
68+
ZEND_FE(bcpowmod, arginfo_bcpowmod)
69+
ZEND_FE(bcpow, arginfo_bcpow)
70+
ZEND_FE(bcsqrt, arginfo_bcsqrt)
71+
ZEND_FE(bccomp, arginfo_bccomp)
72+
ZEND_FE(bcscale, arginfo_bcscale)
73+
ZEND_FE_END
74+
};

ext/bcmath/php_bcmath.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,6 @@ PHP_MINIT_FUNCTION(bcmath);
2929
PHP_MSHUTDOWN_FUNCTION(bcmath);
3030
PHP_MINFO_FUNCTION(bcmath);
3131

32-
PHP_FUNCTION(bcadd);
33-
PHP_FUNCTION(bcsub);
34-
PHP_FUNCTION(bcmul);
35-
PHP_FUNCTION(bcdiv);
36-
PHP_FUNCTION(bcmod);
37-
PHP_FUNCTION(bcpow);
38-
PHP_FUNCTION(bcsqrt);
39-
PHP_FUNCTION(bccomp);
40-
PHP_FUNCTION(bcscale);
41-
PHP_FUNCTION(bcpowmod);
42-
4332
ZEND_BEGIN_MODULE_GLOBALS(bcmath)
4433
bc_num _zero_;
4534
bc_num _one_;

ext/calendar/calendar.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,10 @@
3535
#undef CAL_GREGORIAN
3636
#endif
3737

38-
static const zend_function_entry calendar_functions[] = {
39-
PHP_FE(jdtogregorian, arginfo_jdtogregorian)
40-
PHP_FE(gregoriantojd, arginfo_gregoriantojd)
41-
PHP_FE(jdtojulian, arginfo_jdtojulian)
42-
PHP_FE(juliantojd, arginfo_juliantojd)
43-
PHP_FE(jdtojewish, arginfo_jdtojewish)
44-
PHP_FE(jewishtojd, arginfo_jewishtojd)
45-
PHP_FE(jdtofrench, arginfo_jdtofrench)
46-
PHP_FE(frenchtojd, arginfo_frenchtojd)
47-
PHP_FE(jddayofweek, arginfo_jddayofweek)
48-
PHP_FE(jdmonthname, arginfo_jdmonthname)
49-
PHP_FE(easter_date, arginfo_easter_date)
50-
PHP_FE(easter_days, arginfo_easter_days)
51-
PHP_FE(unixtojd, arginfo_unixtojd)
52-
PHP_FE(jdtounix, arginfo_jdtounix)
53-
PHP_FE(cal_to_jd, arginfo_cal_to_jd)
54-
PHP_FE(cal_from_jd, arginfo_cal_from_jd)
55-
PHP_FE(cal_days_in_month, arginfo_cal_days_in_month)
56-
PHP_FE(cal_info, arginfo_cal_info)
57-
PHP_FE_END
58-
};
59-
60-
6138
zend_module_entry calendar_module_entry = {
6239
STANDARD_MODULE_HEADER,
6340
"calendar",
64-
calendar_functions,
41+
ext_functions,
6542
PHP_MINIT(calendar),
6643
NULL,
6744
NULL,

ext/calendar/calendar.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
/** @generate-function-entries */
4+
35
function cal_days_in_month(int $calendar, int $month, int $year): int {}
46

57
function cal_from_jd(int $jd, int $calendar): array {}

ext/calendar/calendar_arginfo.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,46 @@ ZEND_END_ARG_INFO()
7272
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_unixtojd, 0, 0, MAY_BE_LONG|MAY_BE_FALSE)
7373
ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0)
7474
ZEND_END_ARG_INFO()
75+
76+
77+
ZEND_FUNCTION(cal_days_in_month);
78+
ZEND_FUNCTION(cal_from_jd);
79+
ZEND_FUNCTION(cal_info);
80+
ZEND_FUNCTION(cal_to_jd);
81+
ZEND_FUNCTION(easter_date);
82+
ZEND_FUNCTION(easter_days);
83+
ZEND_FUNCTION(frenchtojd);
84+
ZEND_FUNCTION(gregoriantojd);
85+
ZEND_FUNCTION(jddayofweek);
86+
ZEND_FUNCTION(jdmonthname);
87+
ZEND_FUNCTION(jdtofrench);
88+
ZEND_FUNCTION(jdtogregorian);
89+
ZEND_FUNCTION(jdtojewish);
90+
ZEND_FUNCTION(jdtojulian);
91+
ZEND_FUNCTION(jdtounix);
92+
ZEND_FUNCTION(jewishtojd);
93+
ZEND_FUNCTION(juliantojd);
94+
ZEND_FUNCTION(unixtojd);
95+
96+
97+
static const zend_function_entry ext_functions[] = {
98+
ZEND_FE(cal_days_in_month, arginfo_cal_days_in_month)
99+
ZEND_FE(cal_from_jd, arginfo_cal_from_jd)
100+
ZEND_FE(cal_info, arginfo_cal_info)
101+
ZEND_FE(cal_to_jd, arginfo_cal_to_jd)
102+
ZEND_FE(easter_date, arginfo_easter_date)
103+
ZEND_FE(easter_days, arginfo_easter_days)
104+
ZEND_FE(frenchtojd, arginfo_frenchtojd)
105+
ZEND_FE(gregoriantojd, arginfo_gregoriantojd)
106+
ZEND_FE(jddayofweek, arginfo_jddayofweek)
107+
ZEND_FE(jdmonthname, arginfo_jdmonthname)
108+
ZEND_FE(jdtofrench, arginfo_jdtofrench)
109+
ZEND_FE(jdtogregorian, arginfo_jdtogregorian)
110+
ZEND_FE(jdtojewish, arginfo_jdtojewish)
111+
ZEND_FE(jdtojulian, arginfo_jdtojulian)
112+
ZEND_FE(jdtounix, arginfo_jdtounix)
113+
ZEND_FE(jewishtojd, arginfo_jewishtojd)
114+
ZEND_FE(juliantojd, arginfo_juliantojd)
115+
ZEND_FE(unixtojd, arginfo_unixtojd)
116+
ZEND_FE_END
117+
};

ext/calendar/php_calendar.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,6 @@ extern zend_module_entry calendar_module_entry;
1212
PHP_MINIT_FUNCTION(calendar);
1313
PHP_MINFO_FUNCTION(calendar);
1414

15-
PHP_FUNCTION(jdtogregorian);
16-
PHP_FUNCTION(gregoriantojd);
17-
PHP_FUNCTION(jdtojulian);
18-
PHP_FUNCTION(juliantojd);
19-
PHP_FUNCTION(jdtojewish);
20-
PHP_FUNCTION(jewishtojd);
21-
PHP_FUNCTION(jdtofrench);
22-
PHP_FUNCTION(frenchtojd);
23-
PHP_FUNCTION(jddayofweek);
24-
PHP_FUNCTION(jdmonthname);
25-
PHP_FUNCTION(easter_days);
26-
PHP_FUNCTION(easter_date);
27-
PHP_FUNCTION(unixtojd);
28-
PHP_FUNCTION(jdtounix);
29-
PHP_FUNCTION(cal_from_jd);
30-
PHP_FUNCTION(cal_to_jd);
31-
PHP_FUNCTION(cal_days_in_month);
32-
PHP_FUNCTION(cal_info);
33-
3415
#define phpext_calendar_ptr calendar_module_ptr
3516

3617
/*

ext/com_dotnet/com_extension.c

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -37,49 +37,12 @@ zend_class_entry
3737
*php_com_exception_class_entry,
3838
*php_com_saproxy_class_entry;
3939

40-
static const zend_function_entry com_dotnet_functions[] = {
41-
PHP_FE(variant_set, arginfo_variant_set)
42-
PHP_FE(variant_add, arginfo_variant_add)
43-
PHP_FE(variant_cat, arginfo_variant_add)
44-
PHP_FE(variant_sub, arginfo_variant_add)
45-
PHP_FE(variant_mul, arginfo_variant_add)
46-
PHP_FE(variant_and, arginfo_variant_add)
47-
PHP_FE(variant_div, arginfo_variant_add)
48-
PHP_FE(variant_eqv, arginfo_variant_add)
49-
PHP_FE(variant_idiv, arginfo_variant_add)
50-
PHP_FE(variant_imp, arginfo_variant_add)
51-
PHP_FE(variant_mod, arginfo_variant_add)
52-
PHP_FE(variant_or, arginfo_variant_add)
53-
PHP_FE(variant_pow, arginfo_variant_add)
54-
PHP_FE(variant_xor, arginfo_variant_add)
55-
PHP_FE(variant_abs, arginfo_variant_abs)
56-
PHP_FE(variant_fix, arginfo_variant_fix)
57-
PHP_FE(variant_int, arginfo_variant_int)
58-
PHP_FE(variant_neg, arginfo_variant_neg)
59-
PHP_FE(variant_not, arginfo_variant_not)
60-
PHP_FE(variant_round, arginfo_variant_round)
61-
PHP_FE(variant_cmp, arginfo_variant_cmp)
62-
PHP_FE(variant_date_to_timestamp, arginfo_variant_date_to_timestamp)
63-
PHP_FE(variant_date_from_timestamp, arginfo_variant_date_from_timestamp)
64-
PHP_FE(variant_get_type, arginfo_variant_get_type)
65-
PHP_FE(variant_set_type, arginfo_variant_set_type)
66-
PHP_FE(variant_cast, arginfo_variant_cast)
67-
/* com_com.c */
68-
PHP_FE(com_create_guid, arginfo_com_create_guid)
69-
PHP_FE(com_event_sink, arginfo_com_event_sink)
70-
PHP_FE(com_print_typeinfo, arginfo_com_print_typeinfo)
71-
PHP_FE(com_message_pump, arginfo_com_message_pump)
72-
PHP_FE(com_load_typelib, arginfo_com_load_typelib)
73-
PHP_FE(com_get_active_object, arginfo_com_get_active_object)
74-
PHP_FE_END
75-
};
76-
7740
/* {{{ com_dotnet_module_entry
7841
*/
7942
zend_module_entry com_dotnet_module_entry = {
8043
STANDARD_MODULE_HEADER,
8144
"com_dotnet",
82-
com_dotnet_functions,
45+
ext_functions,
8346
PHP_MINIT(com_dotnet),
8447
PHP_MSHUTDOWN(com_dotnet),
8548
PHP_RINIT(com_dotnet),

ext/com_dotnet/com_extension.stub.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
/** @generate-function-entries */
4+
35
function variant_set(variant $variant, $value): void {}
46

57
function variant_add($left, $right): variant {}
@@ -53,6 +55,9 @@ function variant_set_type(variant $variant, int $type): void {}
5355

5456
function variant_cast(variant $variant, int $type): variant {}
5557

58+
/** @param string|array|null $server_name */
59+
function com_create_instance(string $module_name, $server = UNKNOWN, int $codepage = CP_ACP, $typelib = ""): variant {}
60+
5661
function com_get_active_object(string $progid, int $code_page = UNKNOWN): variant {}
5762

5863
function com_create_guid(): string|false {}

ext/com_dotnet/com_extension_arginfo.h

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_variant_cast, 0, 2, variant, 0)
8080
ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
8181
ZEND_END_ARG_INFO()
8282

83+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_com_create_instance, 0, 1, variant, 0)
84+
ZEND_ARG_TYPE_INFO(0, module_name, IS_STRING, 0)
85+
ZEND_ARG_INFO(0, server)
86+
ZEND_ARG_TYPE_INFO(0, codepage, IS_LONG, 0)
87+
ZEND_ARG_INFO(0, typelib)
88+
ZEND_END_ARG_INFO()
89+
8390
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_com_get_active_object, 0, 1, variant, 0)
8491
ZEND_ARG_TYPE_INFO(0, progid, IS_STRING, 0)
8592
ZEND_ARG_TYPE_INFO(0, code_page, IS_LONG, 0)
@@ -108,3 +115,76 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_com_load_typelib, 0, 1, _IS_BOOL
108115
ZEND_ARG_TYPE_INFO(0, typelib_name, IS_STRING, 0)
109116
ZEND_ARG_TYPE_INFO(0, case_insensitive, _IS_BOOL, 0)
110117
ZEND_END_ARG_INFO()
118+
119+
120+
ZEND_FUNCTION(variant_set);
121+
ZEND_FUNCTION(variant_add);
122+
ZEND_FUNCTION(variant_cat);
123+
ZEND_FUNCTION(variant_sub);
124+
ZEND_FUNCTION(variant_mul);
125+
ZEND_FUNCTION(variant_and);
126+
ZEND_FUNCTION(variant_div);
127+
ZEND_FUNCTION(variant_eqv);
128+
ZEND_FUNCTION(variant_idiv);
129+
ZEND_FUNCTION(variant_imp);
130+
ZEND_FUNCTION(variant_mod);
131+
ZEND_FUNCTION(variant_or);
132+
ZEND_FUNCTION(variant_pow);
133+
ZEND_FUNCTION(variant_xor);
134+
ZEND_FUNCTION(variant_abs);
135+
ZEND_FUNCTION(variant_fix);
136+
ZEND_FUNCTION(variant_int);
137+
ZEND_FUNCTION(variant_neg);
138+
ZEND_FUNCTION(variant_not);
139+
ZEND_FUNCTION(variant_round);
140+
ZEND_FUNCTION(variant_cmp);
141+
ZEND_FUNCTION(variant_date_to_timestamp);
142+
ZEND_FUNCTION(variant_date_from_timestamp);
143+
ZEND_FUNCTION(variant_get_type);
144+
ZEND_FUNCTION(variant_set_type);
145+
ZEND_FUNCTION(variant_cast);
146+
ZEND_FUNCTION(com_create_instance);
147+
ZEND_FUNCTION(com_get_active_object);
148+
ZEND_FUNCTION(com_create_guid);
149+
ZEND_FUNCTION(com_event_sink);
150+
ZEND_FUNCTION(com_print_typeinfo);
151+
ZEND_FUNCTION(com_message_pump);
152+
ZEND_FUNCTION(com_load_typelib);
153+
154+
155+
static const zend_function_entry ext_functions[] = {
156+
ZEND_FE(variant_set, arginfo_variant_set)
157+
ZEND_FE(variant_add, arginfo_variant_add)
158+
ZEND_FE(variant_cat, arginfo_variant_cat)
159+
ZEND_FE(variant_sub, arginfo_variant_sub)
160+
ZEND_FE(variant_mul, arginfo_variant_mul)
161+
ZEND_FE(variant_and, arginfo_variant_and)
162+
ZEND_FE(variant_div, arginfo_variant_div)
163+
ZEND_FE(variant_eqv, arginfo_variant_eqv)
164+
ZEND_FE(variant_idiv, arginfo_variant_idiv)
165+
ZEND_FE(variant_imp, arginfo_variant_imp)
166+
ZEND_FE(variant_mod, arginfo_variant_mod)
167+
ZEND_FE(variant_or, arginfo_variant_or)
168+
ZEND_FE(variant_pow, arginfo_variant_pow)
169+
ZEND_FE(variant_xor, arginfo_variant_xor)
170+
ZEND_FE(variant_abs, arginfo_variant_abs)
171+
ZEND_FE(variant_fix, arginfo_variant_fix)
172+
ZEND_FE(variant_int, arginfo_variant_int)
173+
ZEND_FE(variant_neg, arginfo_variant_neg)
174+
ZEND_FE(variant_not, arginfo_variant_not)
175+
ZEND_FE(variant_round, arginfo_variant_round)
176+
ZEND_FE(variant_cmp, arginfo_variant_cmp)
177+
ZEND_FE(variant_date_to_timestamp, arginfo_variant_date_to_timestamp)
178+
ZEND_FE(variant_date_from_timestamp, arginfo_variant_date_from_timestamp)
179+
ZEND_FE(variant_get_type, arginfo_variant_get_type)
180+
ZEND_FE(variant_set_type, arginfo_variant_set_type)
181+
ZEND_FE(variant_cast, arginfo_variant_cast)
182+
ZEND_FE(com_create_instance, arginfo_com_create_instance)
183+
ZEND_FE(com_get_active_object, arginfo_com_get_active_object)
184+
ZEND_FE(com_create_guid, arginfo_com_create_guid)
185+
ZEND_FE(com_event_sink, arginfo_com_event_sink)
186+
ZEND_FE(com_print_typeinfo, arginfo_com_print_typeinfo)
187+
ZEND_FE(com_message_pump, arginfo_com_message_pump)
188+
ZEND_FE(com_load_typelib, arginfo_com_load_typelib)
189+
ZEND_FE_END
190+
};

0 commit comments

Comments
 (0)