Functions | Variables
timeval.c File Reference
#include "timeval.h"
#include <ext/spl/spl_exceptions.h>
#include <zend_exceptions.h>
Include dependency graph for timeval.c:

Go to the source code of this file.

Functions

php_grpc_zend_object create_wrapped_grpc_timeval (zend_class_entry *class_type TSRMLS_DC)
 
void grpc_init_timeval (TSRMLS_D)
 
zval * grpc_php_wrap_timeval (gpr_timespec wrapped TSRMLS_DC)
 
void grpc_shutdown_timeval (TSRMLS_D)
 
 PHP_METHOD (Timeval, __construct)
 
 PHP_METHOD (Timeval, add)
 
 PHP_METHOD (Timeval, compare)
 
 PHP_METHOD (Timeval, infFuture)
 
 PHP_METHOD (Timeval, infPast)
 
 PHP_METHOD (Timeval, now)
 
 PHP_METHOD (Timeval, similar)
 
 PHP_METHOD (Timeval, sleepUntil)
 
 PHP_METHOD (Timeval, subtract)
 
 PHP_METHOD (Timeval, zero)
 

Variables

zend_class_entry * grpc_ce_timeval
 
static zend_function_entry timeval_methods []
 

Function Documentation

◆ create_wrapped_grpc_timeval()

php_grpc_zend_object create_wrapped_grpc_timeval ( zend_class_entry *class_type  TSRMLS_DC)

Definition at line 38 of file timeval.c.

◆ grpc_init_timeval()

void grpc_init_timeval ( TSRMLS_D  )

Definition at line 304 of file timeval.c.

◆ grpc_php_wrap_timeval()

zval* grpc_php_wrap_timeval ( gpr_timespec wrapped  TSRMLS_DC)

Definition at line 46 of file timeval.c.

◆ grpc_shutdown_timeval()

void grpc_shutdown_timeval ( TSRMLS_D  )

Definition at line 312 of file timeval.c.

◆ PHP_METHOD() [1/10]

PHP_METHOD ( Timeval  ,
__construct   
)

Constructs a new instance of the Timeval class

Parameters
number$microsecondsThe number of microseconds in the interval

Definition at line 60 of file timeval.c.

◆ PHP_METHOD() [2/10]

PHP_METHOD ( Timeval  ,
add   
)

Adds another Timeval to this one and returns the sum. Calculations saturate at infinities.

Parameters
Timeval$other_objThe other Timeval object to add
Returns
Timeval A new Timeval object containing the sum

Definition at line 90 of file timeval.c.

◆ PHP_METHOD() [3/10]

PHP_METHOD ( Timeval  ,
compare   
)

Return negative, 0, or positive according to whether a < b, a == b, or a > b respectively.

Parameters
Timeval$a_objThe first time to compare
Timeval$b_objThe second time to compare
Returns
long

Definition at line 143 of file timeval.c.

◆ PHP_METHOD() [4/10]

PHP_METHOD ( Timeval  ,
infFuture   
)

Returns the infinite future time value as a timeval object

Returns
Timeval Infinite future time value

Definition at line 216 of file timeval.c.

◆ PHP_METHOD() [5/10]

PHP_METHOD ( Timeval  ,
infPast   
)

Returns the infinite past time value as a timeval object

Returns
Timeval Infinite past time value

Definition at line 226 of file timeval.c.

◆ PHP_METHOD() [6/10]

PHP_METHOD ( Timeval  ,
now   
)

Returns the current time as a timeval object

Returns
Timeval The current time

Definition at line 197 of file timeval.c.

◆ PHP_METHOD() [7/10]

PHP_METHOD ( Timeval  ,
similar   
)

Checks whether the two times are within $threshold of each other

Parameters
Timeval$a_objThe first time to compare
Timeval$b_objThe second time to compare
Timeval$thresh_objThe threshold to check against
Returns
bool True if $a and $b are within $threshold, False otherwise

Definition at line 170 of file timeval.c.

◆ PHP_METHOD() [8/10]

PHP_METHOD ( Timeval  ,
sleepUntil   
)

Sleep until this time, interpreted as an absolute timeout

Returns
void

Definition at line 236 of file timeval.c.

◆ PHP_METHOD() [9/10]

PHP_METHOD ( Timeval  ,
subtract   
)

Subtracts another Timeval from this one and returns the difference. Calculations saturate at infinities.

Parameters
Timeval$other_objThe other Timeval object to subtract
Returns
Timeval A new Timeval object containing the diff

Definition at line 116 of file timeval.c.

◆ PHP_METHOD() [10/10]

PHP_METHOD ( Timeval  ,
zero   
)

Returns the zero time interval as a timeval object

Returns
Timeval Zero length time interval

Definition at line 206 of file timeval.c.

Variable Documentation

◆ grpc_ce_timeval

zend_class_entry* grpc_ce_timeval

class Timeval

See also
https://github.com/grpc/grpc/tree/master/src/php/ext/grpc/timeval.c

Definition at line 29 of file timeval.c.

◆ timeval_methods

zend_function_entry timeval_methods[]
static
Initial value:
= {
PHP_ME(Timeval, __construct, arginfo_construct,
ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
PHP_ME(Timeval, add, arginfo_add,
ZEND_ACC_PUBLIC)
PHP_ME(Timeval, compare, arginfo_compare,
ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME(Timeval, infFuture, arginfo_infFuture,
ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME(Timeval, infPast, arginfo_infPast,
ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME(Timeval, now, arginfo_now,
ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME(Timeval, similar, arginfo_similar,
ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME(Timeval, sleepUntil, arginfo_sleepUntil,
ZEND_ACC_PUBLIC)
PHP_ME(Timeval, subtract, arginfo_subtract,
ZEND_ACC_PUBLIC)
PHP_ME(Timeval, zero, arginfo_zero,
ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_FE_END
}

Definition at line 280 of file timeval.c.

now
static double now(void)
Definition: test/core/fling/client.cc:130
add
static void add(const char *beg, const char *end, char ***ss, size_t *ns)
Definition: debug/trace.cc:96
compare
Definition: benchmark/tools/compare.py:1


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:35