Skip to content

Commit cf842f1

Browse files
committedFeb 18, 2016
Remove TSRMLS_* from docs as it's not used anymore
1 parent 491925b commit cf842f1

7 files changed

+68
-68
lines changed
 

‎CODING_STANDARDS

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Internal Function Naming Convensions
178178
Unexposed module function should be static and should not be defined in
179179
'php_modulename.h'.
180180

181-
static int php_session_destroy(TSRMLS_D)
181+
static int php_session_destroy()
182182

183183
2. Main module source file must be named 'modulename.c'.
184184

‎README.EXT_SKEL

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ PHP_FUNCTION(module_name_drawtext)
172172
zval *image = NULL;
173173
zval *font = NULL;
174174

175-
if (zend_parse_parameters(argc TSRMLS_CC, "rsrll|l", &image, &text, &text_len, &font, &x, &y, &color) == FAILURE)
175+
if (zend_parse_parameters(argc, "rsrll|l", &image, &text, &text_len, &font, &x, &y, &color) == FAILURE)
176176
return;
177177

178178
if (image) {

‎README.NEW-OUTPUT-API

+37-37
Original file line numberDiff line numberDiff line change
@@ -8,98 +8,98 @@ API adjustment to the old output control code:
88

99
Checking output control layers status:
1010
// Using OG()
11-
php_output_get_status(TSRMLS_C);
11+
php_output_get_status();
1212

1313
Starting the default output handler:
14-
// php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC);
15-
php_output_start_default(TSRMLS_C);
14+
// php_start_ob_buffer(NULL, 0, 1);
15+
php_output_start_default();
1616

1717
Starting an user handler by zval:
18-
// php_start_ob_buffer(zhandler, chunk_size, erase TSRMLS_CC);
19-
php_output_start_user(zhandler, chunk_size, flags TSRMLS_CC);
18+
// php_start_ob_buffer(zhandler, chunk_size, erase);
19+
php_output_start_user(zhandler, chunk_size, flags);
2020

2121
Starting an internal handler whithout context:
22-
// php_ob_set_internal_handler(my_php_output_handler_func_t, buffer_size, "output handler name", erase TSRMLS_CC);
23-
php_output_start_internal(handler_name, handler_name_len, my_php_output_handler_func_t, chunk_size, flags TSRMLS_CC);
22+
// php_ob_set_internal_handler(my_php_output_handler_func_t, buffer_size, "output handler name", erase);
23+
php_output_start_internal(handler_name, handler_name_len, my_php_output_handler_func_t, chunk_size, flags);
2424

2525
Starting an internal handler with context:
2626
// not possible with old API
2727
php_output_handler *h;
28-
h = php_output_handler_create_internal(handler_name, handler_name_len, my_php_output_handler_context_func_t, chunk_size, flags TSRMLS_CC);
28+
h = php_output_handler_create_internal(handler_name, handler_name_len, my_php_output_handler_context_func_t, chunk_size, flags);
2929
php_output_handler_set_context(h, my_context, my_context_dtor);
30-
php_output_handler_start(h TSRMLS_CC);
30+
php_output_handler_start(h);
3131

3232
Testing whether a certain output handler has already been started:
33-
// php_ob_handler_used("output handler name" TSRMLS_CC);
34-
php_output_handler_started(handler_name, handler_name_len TSRMLS_CC);
33+
// php_ob_handler_used("output handler name");
34+
php_output_handler_started(handler_name, handler_name_len);
3535

3636
Flushing one output buffer:
37-
// php_end_ob_buffer(1, 1 TSRMLS_CC);
38-
php_output_flush(TSRMLS_C);
37+
// php_end_ob_buffer(1, 1);
38+
php_output_flush();
3939

4040
Flushing all output buffers:
4141
// not possible with old API
42-
php_output_flush_all(TSRMLS_C);
42+
php_output_flush_all();
4343

4444
Cleaning one output buffer:
45-
// php_ob_end_buffer(0, 1 TSRMLS_CC);
46-
php_output_clean(TSRMLS_C);
45+
// php_ob_end_buffer(0, 1);
46+
php_output_clean();
4747

4848
Cleaning all output buffers:
4949
// not possible with old API
50-
php_output_clean_all(TSRMLS_C);
50+
php_output_clean_all();
5151

5252
Discarding one output buffer:
53-
// php_ob_end_buffer(0, 0 TSRMLS_CC);
54-
php_output_discard(TSRMLS_C);
53+
// php_ob_end_buffer(0, 0);
54+
php_output_discard();
5555

5656
Discarding all output buffers:
57-
// php_ob_end_buffers(0 TSRMLS_CC);
58-
php_output_discard_all(TSRMLS_C);
57+
// php_ob_end_buffers(0);
58+
php_output_discard_all();
5959

6060
Stopping (and dropping) one output buffer:
61-
// php_ob_end_buffer(1, 0 TSRMLS_CC)
62-
php_output_end(TSRMLS_C);
61+
// php_ob_end_buffer(1, 0)
62+
php_output_end();
6363

6464
Stopping (and dropping) all output buffers:
65-
// php_ob_end_buffers(1, 0 TSRMLS_CC);
66-
php_output_end_all(TSRMLS_C);
65+
// php_ob_end_buffers(1, 0);
66+
php_output_end_all();
6767

6868
Retrieving output buffers contents:
69-
// php_ob_get_buffer(zstring TSRMLS_CC);
70-
php_output_get_contents(zstring TSRMLS_CC);
69+
// php_ob_get_buffer(zstring);
70+
php_output_get_contents(zstring);
7171

7272
Retrieving output buffers length:
73-
// php_ob_get_length(zlength TSRMLS_CC);
74-
php_output_get_length(zlength TSRMLS_CC);
73+
// php_ob_get_length(zlength);
74+
php_output_get_length(zlength);
7575

7676
Retrieving output buffering level:
7777
// OG(nesting_level);
78-
php_output_get_level(TSRMLS_C);
78+
php_output_get_level();
7979

8080
Issue a warning because of an output handler conflict:
81-
// php_ob_init_conflict("to be started handler name", "to be tested if already started handler name" TSRMLS_CC);
82-
php_output_handler_conflict(new_handler_name, new_handler_name_len, set_handler_name, set_handler_name_len TSRMLS_CC);
81+
// php_ob_init_conflict("to be started handler name", "to be tested if already started handler name");
82+
php_output_handler_conflict(new_handler_name, new_handler_name_len, set_handler_name, set_handler_name_len);
8383

8484
Registering a conflict checking function, which will be checked prior starting the handler:
8585
// not possible with old API, unless hardcoding into output.c
86-
php_output_handler_conflict_register(handler_name, handler_name_len, my_php_output_handler_conflict_check_t TSRMLS_CC);
86+
php_output_handler_conflict_register(handler_name, handler_name_len, my_php_output_handler_conflict_check_t);
8787

8888
Registering a reverse conflict checking function, which will be checked prior starting the specified foreign handler:
8989
// not possible with old API
90-
php_output_handler_reverse_conflict_register(foreign_handler_name, foreign_handler_name_len, my_php_output_handler_conflict_check_t TSRMLS_CC);
90+
php_output_handler_reverse_conflict_register(foreign_handler_name, foreign_handler_name_len, my_php_output_handler_conflict_check_t);
9191

9292
Facilitating a context from within an output handler callable with ob_start():
9393
// not possible with old API
94-
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ, (void *) &custom_ctx_ptr_ptr TSRMLS_CC);
94+
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ, (void *) &custom_ctx_ptr_ptr);
9595

9696
Disabling of the output handler by itself:
9797
//not possible with old API
98-
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_DISABLE, NULL TSRMLS_CC);
98+
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_DISABLE, NULL);
9999

100100
Marking an output handler immutable by itself because of irreversibility of its operation:
101101
// not possible with old API
102-
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
102+
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL);
103103

104104
Restarting the output handler because of a CLEAN operation:
105105
// not possible with old API

‎README.PARAMETER_PARSING_API

+14-14
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ meaningful error messages.
1313
Prototypes
1414
----------
1515
/* Implemented. */
16-
int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...);
17-
int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...);
16+
int zend_parse_parameters(int num_args, char *type_spec, ...);
17+
int zend_parse_parameters_ex(int flags, int num_args, char *type_spec, ...);
1818

1919
The zend_parse_parameters() function takes the number of parameters
2020
passed to the extension function, the type specifier string, and the
@@ -30,7 +30,7 @@ resources cannot be auto-converted.
3030

3131
PHP 5.5 includes a new function:
3232

33-
int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval **arg, const char *spec, ...);
33+
int zend_parse_parameter(int flags, int arg_num, zval **arg, const char *spec, ...);
3434

3535
This function behaves like zend_parse_parameters_ex() except that instead of
3636
reading the arguments from the stack, it receives a single zval to convert
@@ -97,11 +97,11 @@ Both mistakes might cause memory corruptions and segfaults:
9797
1)
9898
char *str;
9999
long str_len; /* XXX THIS IS WRONG!! Use size_t instead. */
100-
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len)
100+
zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len)
101101

102102
2)
103103
int num; /* XXX THIS IS WRONG!! Use zend_long instead. */
104-
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num)
104+
zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num)
105105

106106
If you're in doubt, use check_parameters.php script to the parameters
107107
and their types (it can be found in ./scripts/dev/ directory of PHP sources):
@@ -116,7 +116,7 @@ zend_long l;
116116
char *s;
117117
size_t s_len;
118118
zval *param;
119-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz",
119+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lsz",
120120
&l, &s, &s_len, &param) == FAILURE) {
121121
return;
122122
}
@@ -126,7 +126,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz",
126126
zval *obj;
127127
double d = 0.5;
128128
zend_class_entry *my_ce;
129-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d",
129+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|d",
130130
&obj, my_ce, &d) == FAILURE) {
131131
return;
132132
}
@@ -136,15 +136,15 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d",
136136
If null is passed for object, obj will be set to NULL. */
137137
zval *obj;
138138
zval *arr;
139-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a",
139+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o!a",
140140
&obj, &arr) == FAILURE) {
141141
return;
142142
}
143143

144144

145145
/* Gets a separated array which can also be null. */
146146
zval *arr;
147-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!",
147+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/!",
148148
&arr) == FAILURE) {
149149
return;
150150
}
@@ -161,10 +161,10 @@ char *s;
161161
*/
162162
size_t length;
163163

164-
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
164+
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
165165
"lll", &l1, &l2, &l3) == SUCCESS) {
166166
/* manipulate longs */
167-
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
167+
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
168168
"s", &s, &length) == SUCCESS) {
169169
/* manipulate string */
170170
} else {
@@ -180,7 +180,7 @@ int i, num_varargs;
180180
zval *varargs = NULL;
181181

182182

183-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &varargs, &num_varargs) == FAILURE) {
183+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "*", &varargs, &num_varargs) == FAILURE) {
184184
return;
185185
}
186186

@@ -200,7 +200,7 @@ size_t str_len;
200200
int i, num_varargs;
201201
zval *varargs = NULL;
202202

203-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) {
203+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) {
204204
return;
205205
}
206206

@@ -214,7 +214,7 @@ zval *array;
214214
int i, num_varargs;
215215
zval *varargs = NULL;
216216

217-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) {
217+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) {
218218
return;
219219
}
220220

‎README.STREAMS

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The main functions are:
2828
PHPAPI size_t php_stream_read(php_stream * stream, char * buf, size_t count);
2929
PHPAPI size_t php_stream_write(php_stream * stream, const char * buf, size_t
3030
count);
31-
PHPAPI size_t php_stream_printf(php_stream * stream TSRMLS_DC,
31+
PHPAPI size_t php_stream_printf(php_stream * stream,
3232
const char * fmt, ...);
3333
PHPAPI int php_stream_eof(php_stream * stream);
3434
PHPAPI int php_stream_getc(php_stream * stream);
@@ -47,7 +47,7 @@ Opening Streams
4747
In most cases, you should use this API:
4848

4949
PHPAPI php_stream *php_stream_open_wrapper(const char *path, const char *mode,
50-
int options, char **opened_path TSRMLS_DC);
50+
int options, char **opened_path);
5151

5252
Where:
5353
path is the file or resource to open.
@@ -80,7 +80,7 @@ PHPAPI php_stream *php_stream_fopen_tmpfile(void);
8080
Open a FILE * with tmpfile() and convert into a stream.
8181

8282
PHPAPI php_stream *php_stream_fopen_temporary_file(const char *dir,
83-
const char *pfx, char **opened_path TSRMLS_DC);
83+
const char *pfx, char **opened_path);
8484
Generate a temporary file name and open it.
8585

8686
There are some network enabled relatives in php_network.h:

‎README.input_filter

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ SAPI_INPUT_FILTER_FUNC(my_sapi_input_filter)
138138
strcpy(raw_var, "RAW_");
139139
strlcat(raw_var,var,var_len+5);
140140

141-
php_register_variable_ex(raw_var, &new_var, array_ptr TSRMLS_DC);
141+
php_register_variable_ex(raw_var, &new_var, array_ptr);
142142

143143
php_strip_tags(*val, val_len, NULL, NULL, 0);
144144

@@ -154,7 +154,7 @@ PHP_FUNCTION(my_get_raw)
154154
zval **tmp;
155155
zval *array_ptr = NULL;
156156

157-
if(zend_parse_parameters(2 TSRMLS_CC, "ls", &arg, &var, &var_len) == FAILURE) {
157+
if(zend_parse_parameters(2, "ls", &arg, &var, &var_len) == FAILURE) {
158158
return;
159159
}
160160

‎ext/intl/ERROR.CONVENTIONS

+10-10
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ intl.use_exceptions you get more fine-grained information about where the
2121
error occurred).
2222

2323
The internal PHP code can set the global last error with:
24-
void intl_error_set_code(intl_error* err, UErrorCode err_code TSRMLS_DC);
25-
void intl_error_set_custom_msg(intl_error* err, char* msg, int copyMsg TSRMLS_DC);
26-
void intl_error_set(intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC);
24+
void intl_error_set_code(intl_error* err, UErrorCode err_code);
25+
void intl_error_set_custom_msg(intl_error* err, char* msg, int copyMsg);
26+
void intl_error_set(intl_error* err, UErrorCode code, char* msg, int copyMsg);
2727

2828
and by passing NULL as the first parameter. The last function is a combination
2929
of the first two. If the message is not a static buffer, copyMsg should be 1.
@@ -44,9 +44,9 @@ typedef struct {
4444

4545
The global error and the object error can be SIMULTANEOUSLY set with these
4646
functions:
47-
void intl_errors_set_custom_msg(intl_error* err, char* msg, int copyMsg TSRMLS_DC);
48-
void intl_errors_set_code(intl_error* err, UErrorCode err_code TSRMLS_DC);
49-
void intl_errors_set(intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC);
47+
void intl_errors_set_custom_msg(intl_error* err, char* msg, int copyMsg);
48+
void intl_errors_set_code(intl_error* err, UErrorCode err_code);
49+
void intl_errors_set(intl_error* err, UErrorCode code, char* msg, int copyMsg);
5050

5151
by passing a pointer to the object's intl_error structed as the first parameter.
5252
Node the extra 's' in the functions' names ('errors', not 'error').
@@ -79,8 +79,8 @@ Errors should be lost after a function call. This is different from the way
7979
ICU operates, where functions return immediately if an error is set.
8080

8181
Error resetting can be done with:
82-
void intl_error_reset(NULL TSRMLS_DC); /* reset global error */
83-
void intl_errors_reset(intl_error* err TSRMLS_DC ); /* reset global and object error */
82+
void intl_error_reset(NULL); /* reset global error */
83+
void intl_errors_reset(intl_error* err ); /* reset global and object error */
8484

8585
In practice, intl_errors_reset() is not used because most classes have also
8686
plain functions mapped to the same internal functions as their instance methods.
@@ -97,10 +97,10 @@ U_CFUNC PHP_FUNCTION(breakiter_set_text)
9797
BREAKITER_METHOD_INIT_VARS; /* macro also resets global error */
9898
object = getThis();
9999

100-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
100+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
101101
&text, &text_len) == FAILURE) {
102102
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
103-
"breakiter_set_text: bad arguments", 0 TSRMLS_CC);
103+
"breakiter_set_text: bad arguments", 0);
104104
RETURN_FALSE;
105105
}
106106

0 commit comments

Comments
 (0)
Please sign in to comment.