コード例 #1
0
ファイル: server.c プロジェクト: Lucups/Skyray
zend_object * skyray_http_server_object_new(zend_class_entry *ce)
{
    skyray_http_server_t *intern;
    intern = ecalloc(1, sizeof(skyray_http_server_t) + zend_object_properties_size(ce));

    skyray_stream_server_object_init(&intern->base, ce);
    intern->base.std.handlers = &skyray_handler_HttpServer;

    return &intern->base.std;
}
コード例 #2
0
ファイル: yrmcds.c プロジェクト: cybozu/php-yrmcds
static zend_object* yrmcds_client_new(zend_class_entry *ce) {
    yrmcds_client_object* o;

    o = ecalloc(1, sizeof(yrmcds_client_object) + zend_object_properties_size(ce));
    zend_object_std_init(&o->std, ce);  // upcall the default
    object_properties_init(&o->std, ce);
    o->std.handlers = &oh_yrmcds_client;

    return &o->std;
}
コード例 #3
0
ファイル: zwlog.c プロジェクト: krakjoe/zway
static inline zend_object* php_zwlog_create(zend_class_entry *ce) {
	php_zwlog_t *pz = (php_zwlog_t*) ecalloc(1, sizeof(php_zwlog_t) + zend_object_properties_size(ce));

	zend_object_std_init(&pz->std, ce);
	object_properties_init(&pz->std, ce);

	pz->std.handlers = &ZWLog_handlers;
	
	return &pz->std;
}
コード例 #4
0
ファイル: promise.c プロジェクト: Lucups/Skyray
zend_object * skyray_promise_object_new(zend_class_entry *ce)
{
    skyray_promise_t *intern;
    intern = ecalloc(1, sizeof(skyray_promise_t) + zend_object_properties_size(ce));

    skyray_promise_object_init(intern, ce);

    intern->std.handlers = &skyray_handler_Promise;
    return &intern->std;
}
コード例 #5
0
ファイル: lua_closure.c プロジェクト: laruence/php-lua
zend_object *php_lua_closure_create_object(zend_class_entry *ce) /* {{{ */
{
	lua_closure_object *objval = ecalloc(1, sizeof(lua_closure_object) + zend_object_properties_size(ce));
	zend_object *zobj = &(objval->std);

	zend_object_std_init(zobj, ce);
	zobj->handlers = &lua_closure_handlers;
	
	return zobj;
} /* }}} */
コード例 #6
0
/* Initializes an instace of wrapped_grpc_server_credentials to be associated
 * with an object of a class specified by class_type */
zend_object *create_wrapped_grpc_server_credentials(zend_class_entry
                                                    *class_type) {
  wrapped_grpc_server_credentials *intern;
  intern = ecalloc(1, sizeof(wrapped_grpc_server_credentials) +
                   zend_object_properties_size(class_type));
  zend_object_std_init(&intern->std, class_type);
  object_properties_init(&intern->std, class_type);
  intern->std.handlers = &server_credentials_ce_handlers;
  return &intern->std;
}
コード例 #7
0
static zend_object * krisp_object_new (zend_class_entry *class_type) {
	KROBJ * intern;

	PRINT_CALL_API_NAME;

	intern = ecalloc (1, sizeof (KROBJ) + zend_object_properties_size (class_type));
	zend_object_std_init (&intern->std,class_type TSRMLS_CC);
	intern->std.handlers = &krisp_object_handlers;

	return &intern->std;
}
コード例 #8
0
ファイル: simd.c プロジェクト: krakjoe/SIMD
static inline zend_object* php_float32x4_create(zend_class_entry *ce) {
	php_float32x4_t *p = 
		(php_float32x4_t*) ecalloc(1, sizeof(php_float32x4_t) + zend_object_properties_size(ce));
	
	zend_object_std_init(&p->std, ce);
	object_properties_init(&p->std, ce);

	p->std.handlers = &php_float32x4_handlers;
	
	return &p->std;
}
コード例 #9
0
zend_object *gearman_job_obj_new(zend_class_entry *ce) {
        gearman_job_obj *intern = ecalloc(1,
                sizeof(gearman_job_obj) +
                zend_object_properties_size(ce));

        zend_object_std_init(&(intern->std), ce); 
        object_properties_init(&intern->std, ce); 

        intern->std.handlers = &gearman_job_obj_handlers;
        return &intern->std;
}
コード例 #10
0
ファイル: client.c プロジェクト: Lucups/Skyray
zend_object * skyray_stream_client_object_new(zend_class_entry *ce)
{
    skyray_stream_client_t *intern;
    intern = ecalloc(1, sizeof(skyray_stream_client_t) + zend_object_properties_size(ce));

    zend_object_std_init(&intern->std, ce);
    object_properties_init(&intern->std, ce);

    intern->std.handlers = &skyray_handler_StreamClient;
    return &intern->std;
}
コード例 #11
0
ファイル: struct.c プロジェクト: krakjoe/jitfu
static inline zend_object* php_jit_struct_create(zend_class_entry *ce) {
	php_jit_struct_t *pstruct = 
		(php_jit_struct_t*) ecalloc(1, sizeof(php_jit_struct_t) + zend_object_properties_size(ce));
	
	zend_object_std_init(&pstruct->std, ce);
	object_properties_init(&pstruct->std, ce);
	
	pstruct->std.handlers = &php_jit_struct_handlers;
	
	return &pstruct->std;
}
コード例 #12
0
ファイル: process_watcher.c プロジェクト: Lucups/Skyray
static zend_object * skyray_process_watcher_object_new(zend_class_entry *ce)
{
    skyray_process_watcher_t *intern;
    intern = ecalloc(1, sizeof(skyray_process_watcher_t) + zend_object_properties_size(ce));

    zend_object_std_init(&intern->std, ce);
    object_properties_init(&intern->std, ce);

    intern->std.handlers = &skyray_handler_ProcessWatcher;
    return &intern->std;
}
コード例 #13
0
ファイル: php_xmlreader.c プロジェクト: LTD-Beget/php-src
/* {{{ xmlreader_objects_new */
zend_object *xmlreader_objects_new(zend_class_entry *class_type)
{
	xmlreader_object *intern;

	intern = ecalloc(1, sizeof(xmlreader_object) + zend_object_properties_size(class_type));
	zend_object_std_init(&intern->std, class_type);
	object_properties_init(&intern->std, class_type);
	intern->prop_handler = &xmlreader_prop_handlers;
	intern->std.handlers = &xmlreader_object_handlers;

	return &intern->std;
}
コード例 #14
0
ファイル: operand.c プロジェクト: krakjoe/inspector
static zend_object* php_inspector_operand_create(zend_class_entry *ce) {
	php_inspector_operand_t *operand = 
		ecalloc(1, sizeof(php_inspector_operand_t) + zend_object_properties_size(ce));

	zend_object_std_init(&operand->std, ce);
	object_properties_init(&operand->std, ce);

	operand->std.handlers = &php_inspector_operand_handlers;	
	ZVAL_UNDEF(&operand->opline);
	
	return &operand->std;
} /* }}} */
コード例 #15
0
static zend_object* oauth_provider_new(zend_class_entry *ce) /* {{{ */
{
	php_oauth_provider *nos;
	nos = ecalloc(1, sizeof(php_oauth_provider) + zend_object_properties_size(ce));

	zend_object_std_init(&nos->zo, ce);
	object_properties_init(&nos->zo, ce);

	nos->zo.handlers = &oauth_provider_obj_hndlrs;

	return &nos->zo;
}
コード例 #16
0
ファイル: yaf_closure.c プロジェクト: ruolinn/yaf
static zend_object *pimple_closure_object_create(zend_class_entry *ce)
{
	pimple_closure_object *pimple_closure_obj = NULL;

	pimple_closure_obj = ecalloc(1, sizeof(pimple_closure_object) + zend_object_properties_size(ce));
	zend_object_std_init(&pimple_closure_obj->zobj, ce);
	object_properties_init(&pimple_closure_obj->zobj, ce);

	pimple_closure_obj->zobj.handlers = &pimple_closure_object_handlers;

	return &pimple_closure_obj->zobj;
}
コード例 #17
0
ファイル: fileinfo.c プロジェクト: CooCoooo/php-src
/* {{{ finfo_objects_new
 */
PHP_FILEINFO_API zend_object *finfo_objects_new(zend_class_entry *class_type)
{
	finfo_object *intern;

	intern = ecalloc(1, sizeof(finfo_object) + zend_object_properties_size(class_type));

	zend_object_std_init(&intern->zo, class_type);
	object_properties_init(&intern->zo, class_type);
	intern->zo.handlers = &finfo_object_handlers;

	return &intern->zo;
}
コード例 #18
0
ファイル: call.c プロジェクト: sunzhijie/grpc-php7
/* Initializes an instance of wrapped_grpc_call to be associated with an object
 * of a class specified by class_type */
zend_object *create_wrapped_grpc_call(zend_class_entry *class_type) {
  wrapped_grpc_call *intern;
  intern = ecalloc(1, sizeof(wrapped_grpc_call) +
                   zend_object_properties_size(class_type));

  zend_object_std_init(&intern->std, class_type);
  object_properties_init(&intern->std, class_type);
  
  intern->std.handlers = &call_object_handlers_call;
  
  return &intern->std;
}
コード例 #19
0
ファイル: php_http_object.c プロジェクト: m6w6/ext-http
php_http_object_t *php_http_object_new_ex(zend_class_entry *ce, void *intern)
{
	php_http_object_t *o;

	o = ecalloc(1, sizeof(*o) + zend_object_properties_size(ce));
	zend_object_std_init(&o->zo, ce);
	object_properties_init(&o->zo, ce);

	o->intern = intern;
	o->zo.handlers = &php_http_object_handlers;

	return o;
}
コード例 #20
0
ファイル: deferred.c プロジェクト: Lucups/Skyray
zend_object * skyray_deferred_object_new(zend_class_entry *ce)
{
    skyray_deferred_t *intern;
    intern = ecalloc(1, 100 + zend_object_properties_size(ce));

    zend_object_std_init(&intern->std, ce);
    object_properties_init(&intern->std, ce);

    intern->promise = NULL;

    intern->std.handlers = &skyray_handler_Deferred;
    return &intern->std;
}
コード例 #21
0
ファイル: source.c プロジェクト: gtkforphp/glib
/* Custom object creation - calls g_source_new() */
static zend_object* glib_source_create_object(zend_class_entry *ce)
{
	glib_source_object *intern = NULL;

	intern = ecalloc(1, sizeof(glib_source_object) + zend_object_properties_size(ce));

	intern->is_php_source = FALSE;
	intern->source = NULL;

	zend_object_std_init(&(intern->std), ce);
	object_properties_init(&(intern->std), ce);
	intern->std.handlers = &glib_source_object_handlers;
	return &(intern->std);
}
コード例 #22
0
/* {{{ Spoofchecker_object_create */
zend_object *Spoofchecker_object_create(
	zend_class_entry *ce)
{
	Spoofchecker_object*     intern;

	intern = ecalloc(1, sizeof(Spoofchecker_object) + zend_object_properties_size(ce));
	intl_error_init(SPOOFCHECKER_ERROR_P(intern));
	zend_object_std_init(&intern->zo, ce);
	object_properties_init(&intern->zo, ce);

	intern->zo.handlers = &Spoofchecker_handlers;

	return &intern->zo;
}
コード例 #23
0
/* {{{ apc_iterator_create */
zend_object* apc_iterator_create(zend_class_entry *ce) {
    apc_iterator_t *iterator = 
		(apc_iterator_t*) emalloc(sizeof(apc_iterator_t) + zend_object_properties_size(ce));

    zend_object_std_init(&iterator->obj, ce);
    object_properties_init(&iterator->obj, ce);

    iterator->initialized = 0;
    iterator->stack = NULL;
	iterator->regex = NULL;
    iterator->search_hash = NULL;
	iterator->obj.handlers = &apc_iterator_object_handlers;

    return &iterator->obj;
}
コード例 #24
0
ファイル: label.c プロジェクト: krakjoe/jitfu
static inline zend_object* php_jit_label_create(zend_class_entry *ce) {
	php_jit_label_t *plabel = 
		(php_jit_label_t*) ecalloc(1, sizeof(php_jit_label_t) + zend_object_properties_size(ce));
	
	zend_object_std_init(&plabel->std, ce);
	object_properties_init(&plabel->std, ce);

	plabel->label = jit_label_undefined;
	
	ZVAL_NULL(&plabel->zfunc);
	
	plabel->std.handlers = &php_jit_label_handlers;
	
	return &plabel->std;
}
コード例 #25
0
ファイル: php_xsl.c プロジェクト: DragonBe/php-src
/* {{{ xsl_objects_new */
zend_object *xsl_objects_new(zend_class_entry *class_type)
{
	xsl_object *intern;

	intern = ecalloc(1, sizeof(xsl_object) + zend_object_properties_size(class_type));
	intern->securityPrefs = XSL_SECPREF_DEFAULT;

	zend_object_std_init(&intern->std, class_type);
	object_properties_init(&intern->std, class_type);
	intern->parameter = zend_new_array(0);
	intern->registered_phpfunctions = zend_new_array(0);

	intern->std.handlers = &xsl_object_handlers;
	return &intern->std;
}
コード例 #26
0
ファイル: request.c プロジェクト: Lucups/Skyray
zend_object * skyray_http_request_object_new(zend_class_entry *ce)
{
    skyray_http_request_t *intern;
    intern = ecalloc(1, sizeof(skyray_http_request_t) + zend_object_properties_size(ce));

    skyray_http_message_init((skyray_http_message_t *)intern, ce);

    intern->method = SR_HTTP_GET;
    ZVAL_NULL(&intern->cookie_params);
    ZVAL_NULL(&intern->query_params);
    ZVAL_NULL(&intern->uri);

    intern->message.std.handlers = &skyray_handler_HttpRequest;
    return &intern->message.std;
}
コード例 #27
0
ファイル: resourcebundle_class.c プロジェクト: Jille/php-src
/* {{{ ResourceBundle_object_create */
static zend_object *ResourceBundle_object_create( zend_class_entry *ce )
{
	ResourceBundle_object *rb;

	rb = ecalloc( 1, sizeof(ResourceBundle_object) + zend_object_properties_size(ce));

	zend_object_std_init( &rb->zend, ce );
	object_properties_init( &rb->zend, ce);

	intl_error_init( INTL_DATA_ERROR_P(rb) );
	rb->me = NULL;
	rb->child = NULL;

	rb->zend.handlers = &ResourceBundle_object_handlers;

	return &rb->zend;
}
コード例 #28
0
php_http_message_parser_object_t *php_http_message_parser_object_new_ex(zend_class_entry *ce, php_http_message_parser_t *parser)
{
	php_http_message_parser_object_t *o;

	o = ecalloc(1, sizeof(*o) + zend_object_properties_size(ce));
	zend_object_std_init(&o->zo, ce);
	object_properties_init(&o->zo, ce);

	if (parser) {
		o->parser = parser;
	} else {
		o->parser = php_http_message_parser_init(NULL);
	}
	php_http_buffer_init(&o->buffer);
	o->zo.handlers = &php_http_message_parser_object_handlers;

	return o;
}
コード例 #29
0
ファイル: dateformat_class.c プロジェクト: Jille/php-src
/* {{{ IntlDateFormatter_object_create */
zend_object *IntlDateFormatter_object_create(zend_class_entry *ce)
{
	IntlDateFormatter_object*     intern;

	intern = ecalloc( 1, sizeof(IntlDateFormatter_object) + zend_object_properties_size(ce));
	dateformat_data_init( &intern->datef_data );
	zend_object_std_init( &intern->zo, ce );
	object_properties_init(&intern->zo, ce);
	intern->date_type			= 0;
	intern->time_type			= 0;
	intern->calendar			= -1;
	intern->requested_locale	= NULL;


	intern->zo.handlers = &IntlDateFormatter_handlers;

	return &intern->zo;
}
コード例 #30
0
ファイル: protocol.c プロジェクト: Lucups/Skyray
zend_object * skyray_http_protocol_object_new(zend_class_entry *ce)
{
    skyray_http_protocol_t *intern;
    intern = ecalloc(1, sizeof(skyray_http_protocol_t) + zend_object_properties_size(ce));

    zend_object_std_init(&intern->std, ce);
    object_properties_init(&intern->std, ce);

    http_parser_init(&intern->parser, HTTP_REQUEST);

    skyray_buffer_reset(&intern->header_name);
    skyray_buffer_reset(&intern->header_value);

    intern->close = 0;
    intern->stream = NULL;

    intern->std.handlers = &skyray_handler_HttpProtocol;
    return &intern->std;
}