您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ts_resource函数代码示例

51自学网 2021-06-03 08:59:22
  C++
这篇教程C++ ts_resource函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ts_resource函数的典型用法代码示例。如果您正苦于以下问题:C++ ts_resource函数的具体用法?C++ ts_resource怎么用?C++ ts_resource使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ts_resource函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: zend_post_startup

/* Unlink the global (r/o) copies of the class, function and constant tables, * and use a fresh r/w copy for the startup thread */void zend_post_startup(void) /* {{{ */{#ifdef ZTS	zend_encoding **script_encoding_list;	zend_compiler_globals *compiler_globals = ts_resource(compiler_globals_id);	zend_executor_globals *executor_globals = ts_resource(executor_globals_id);	*GLOBAL_FUNCTION_TABLE = *compiler_globals->function_table;	*GLOBAL_CLASS_TABLE = *compiler_globals->class_table;	*GLOBAL_CONSTANTS_TABLE = *executor_globals->zend_constants;	short_tags_default = CG(short_tags);	compiler_options_default = CG(compiler_options);	zend_destroy_rsrc_list(&EG(persistent_list));	free(compiler_globals->function_table);	free(compiler_globals->class_table);	if ((script_encoding_list = (zend_encoding **)compiler_globals->script_encoding_list)) {		compiler_globals_ctor(compiler_globals);		compiler_globals->script_encoding_list = (const zend_encoding **)script_encoding_list;	} else {		compiler_globals_ctor(compiler_globals);	}	free(EG(zend_constants));	virtual_cwd_deactivate();	executor_globals_ctor(executor_globals);	global_persistent_list = &EG(persistent_list);	zend_copy_ini_directives();#else	virtual_cwd_deactivate();#endif}
开发者ID:LuthandoE,项目名称:php-src,代码行数:38,


示例2: tsrm_startup

int MaPhp4HandlerService::start(){	char					*serverRoot;	void 					***tsrm_ls;	php_core_globals 		*core_globals;	sapi_globals_struct 	*sapi_globals;	zend_llist				global_vars;	zend_compiler_globals 	*compiler_globals;	zend_executor_globals 	*executor_globals;	tsrm_startup(128, 1, 0, 0);	compiler_globals = (zend_compiler_globals*) 		ts_resource(compiler_globals_id);	executor_globals = (zend_executor_globals*) 		ts_resource(executor_globals_id);	core_globals = (php_core_globals*) ts_resource(core_globals_id);	sapi_globals = (sapi_globals_struct*) ts_resource(sapi_globals_id);	tsrm_ls = (void***) ts_resource(0);	//	//	Define the php.ini location to be the ServerRoot	//	serverRoot = MaServer::getDefaultServer()->getServerRoot();	php4SapiBlock.php_ini_path_override = serverRoot;	sapi_startup(&php4SapiBlock);	if (php_module_startup(&php4SapiBlock, 0, 0) == FAILURE) {		mprLog(0, log, "Can't startup PHP/n");		return -1;	}	zend_llist_init(&global_vars, sizeof(char *), 0, 0);  	//	//	Set PHP defaults. As AppWeb buffers output, we don't want PHP	//	to call flush.	//	SG(options) |= SAPI_OPTION_NO_CHDIR;	zend_alter_ini_entry("register_argc_argv", 19, "0", 1, PHP_INI_SYSTEM, 		PHP_INI_STAGE_ACTIVATE);	zend_alter_ini_entry("html_errors", 12, "0", 1, PHP_INI_SYSTEM, 		PHP_INI_STAGE_ACTIVATE);	zend_alter_ini_entry("implicit_flush", 15, "0", 1, PHP_INI_SYSTEM, 		PHP_INI_STAGE_ACTIVATE);	zend_alter_ini_entry("max_execution_time", 19, "0", 1, PHP_INI_SYSTEM, 		PHP_INI_STAGE_ACTIVATE);	return 0;}
开发者ID:OPSF,项目名称:uClinux,代码行数:49,


示例3: ZEND_INI_MH

static ZEND_INI_MH(OnUpdateMemoryConsumption){	zend_long *p;	zend_long memsize;#ifndef ZTS	char *base = (char *) mh_arg2;#else	char *base = (char *) ts_resource(*((int *) mh_arg2));#endif	/* keep the compiler happy */	(void)entry; (void)mh_arg2; (void)mh_arg3; (void)stage;	p = (zend_long *) (base + (size_t)mh_arg1);	memsize = atoi(new_value->val);	/* sanity check we must use at least 8 MB */	if (memsize < 8) {		const char *new_new_value = "8";		zend_ini_entry *ini_entry;		memsize = 8;		zend_accel_error(ACCEL_LOG_WARNING, "opcache.memory_consumption is set below the required 8MB./n");		zend_accel_error(ACCEL_LOG_WARNING, ACCELERATOR_PRODUCT_NAME " will use the minimal 8MB configuration./n");		if ((ini_entry = zend_hash_str_find_ptr(EG(ini_directives),					"opcache.memory_consumption",					sizeof("opcache.memory_consumption")-1)) == NULL) {			return FAILURE;		}		ini_entry->value = zend_string_init(new_new_value, 1, 1);	}	*p = memsize * (1024 * 1024);	return SUCCESS;}
开发者ID:0x1111,项目名称:php-src,代码行数:35,


示例4: ZEND_INI_MH

static ZEND_INI_MH(OnUpdateAssertions) /* {{{ */{	zend_long *p, val;#ifndef ZTS	char *base = (char *) mh_arg2;#else	char *base;	base = (char *) ts_resource(*((int *) mh_arg2));#endif	p = (zend_long *) (base+(size_t) mh_arg1);	val = zend_atol(ZSTR_VAL(new_value), (int)ZSTR_LEN(new_value));	if (stage != ZEND_INI_STAGE_STARTUP &&	    stage != ZEND_INI_STAGE_SHUTDOWN &&	    *p != val &&	    (*p < 0 || val < 0)) {		zend_error(E_WARNING, "zend.assertions may be completely enabled or disabled only in php.ini");		return FAILURE;	}	*p = val;	return SUCCESS;}
开发者ID:LuthandoE,项目名称:php-src,代码行数:26,


示例5: ZEND_INI_MH

/* Standard message handlers */ZEND_API ZEND_INI_MH(OnUpdateBool) /* {{{ */{  zend_bool *p;#ifndef ZTS  char *base = (char *) mh_arg2;#else  char *base;  base = (char *) ts_resource(*((int *) mh_arg2));#endif  p = (zend_bool *) (base+(size_t) mh_arg1);  if (new_value_length == 2 && strcasecmp("on", new_value) == 0) {    *p = (zend_bool) 1;  }  else if (new_value_length == 3 && strcasecmp("yes", new_value) == 0) {    *p = (zend_bool) 1;  }  else if (new_value_length == 4 && strcasecmp("true", new_value) == 0) {    *p = (zend_bool) 1;  }  else {    *p = (zend_bool) atoi(new_value);  }  return SUCCESS;}
开发者ID:292388900,项目名称:hhvm,代码行数:28,


示例6: php_apache_server_startup

static intphp_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s){	void *data = NULL;	const char *userdata_key = "apache2hook_post_config";	/* Apache will load, unload and then reload a DSO module. This	 * prevents us from starting PHP until the second load. */	apr_pool_userdata_get(&data, userdata_key, s->process->pool);	if (data == NULL) {		/* We must use set() here and *not* setn(), otherwise the		 * static string pointed to by userdata_key will be mapped		 * to a different location when the DSO is reloaded and the		 * pointers won't match, causing get() to return NULL when		 * we expected it to return non-NULL. */		apr_pool_userdata_set((const void *)1, userdata_key, apr_pool_cleanup_null, s->process->pool);		return OK;	}	/* Set up our overridden path. */	if (apache2_php_ini_path_override) {		apache2_sapi_module.php_ini_path_override = apache2_php_ini_path_override;	}#ifdef ZTS	tsrm_startup(1, 1, 0, NULL);	(void)ts_resource(0);	ZEND_TSRMLS_CACHE_UPDATE;#endif	sapi_startup(&apache2_sapi_module);	apache2_sapi_module.startup(&apache2_sapi_module);	apr_pool_cleanup_register(pconf, NULL, php_apache_server_shutdown, apr_pool_cleanup_null);	php_apache_add_version(pconf);	return OK;}
开发者ID:AmesianX,项目名称:php-src,代码行数:35,


示例7: ZEND_INI_MH

static ZEND_INI_MH(OnUpdateMaxWastedPercentage){	double *p;	long percentage;#ifndef ZTS	char *base = (char *) mh_arg2;#else	char *base = (char *) ts_resource(*((int *) mh_arg2));#endif	/* keep the compiler happy */	(void)entry; (void)new_value_length; (void)mh_arg2; (void)mh_arg3; (void)stage;	p = (double *) (base + (size_t)mh_arg1);	percentage = atoi(new_value);	if (percentage <= 0 || percentage > 50) {		const char *new_new_value = "5";		zend_ini_entry *ini_entry;		percentage = 5;		zend_accel_error(ACCEL_LOG_WARNING, "opcache.max_wasted_percentage must be set between 1 and 50./n");		zend_accel_error(ACCEL_LOG_WARNING, ACCELERATOR_PRODUCT_NAME " will use 5%./n");		if (zend_hash_find(EG(ini_directives),					"opcache.max_wasted_percentage",					sizeof("opcache.max_wasted_percentage"),					(void *) &ini_entry) == FAILURE) {			return FAILURE;		}		ini_entry->value = strdup(new_new_value);		ini_entry->value_length = strlen(new_new_value);	}	*p = (double)percentage / 100.0;	return SUCCESS;}
开发者ID:alokmenghrajani,项目名称:php-src,代码行数:35,


示例8: zend_post_startup

/* Unlink the global (r/o) copies of the class, function and constant tables, * and use a fresh r/w copy for the startup thread */int zend_post_startup(void) /* {{{ */{#ifdef ZTS	zend_encoding **script_encoding_list;	zend_compiler_globals *compiler_globals = ts_resource(compiler_globals_id);	zend_executor_globals *executor_globals = ts_resource(executor_globals_id);	*GLOBAL_FUNCTION_TABLE = *compiler_globals->function_table;	*GLOBAL_CLASS_TABLE = *compiler_globals->class_table;	*GLOBAL_CONSTANTS_TABLE = *executor_globals->zend_constants;	short_tags_default = CG(short_tags);	compiler_options_default = CG(compiler_options);	zend_destroy_rsrc_list(&EG(persistent_list));	free(compiler_globals->function_table);	free(compiler_globals->class_table);	if ((script_encoding_list = (zend_encoding **)compiler_globals->script_encoding_list)) {		compiler_globals_ctor(compiler_globals);		compiler_globals->script_encoding_list = (const zend_encoding **)script_encoding_list;	} else {		compiler_globals_ctor(compiler_globals);	}	free(EG(zend_constants));	executor_globals_ctor(executor_globals);	global_persistent_list = &EG(persistent_list);	zend_copy_ini_directives();#endif	if (zend_post_startup_cb) {		int (*cb)(void) = zend_post_startup_cb;		zend_post_startup_cb = NULL;		if (cb() != SUCCESS) {			return FAILURE;		}	}	return SUCCESS;}
开发者ID:eaglewu,项目名称:php-src,代码行数:45,


示例9: ZEND_INI_MH

/* {{{ OnUpdateBaseDirAllows any change to open_basedir setting in during Startup and Shutdown events,or a tightening during activation/runtime/deactivation */PHPAPI ZEND_INI_MH(OnUpdateBaseDir){	char **p, *pathbuf, *ptr, *end;#ifndef ZTS	char *base = (char *) mh_arg2;#else	char *base = (char *) ts_resource(*((int *) mh_arg2));#endif	p = (char **) (base + (size_t) mh_arg1);	if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN || stage == PHP_INI_STAGE_ACTIVATE || stage == PHP_INI_STAGE_DEACTIVATE) {		/* We're in a PHP_INI_SYSTEM context, no restrictions */		*p = new_value ? new_value->val : NULL;		return SUCCESS;	}	/* Otherwise we're in runtime */	if (!*p || !**p) {		/* open_basedir not set yet, go ahead and give it a value */		*p = new_value->val;		return SUCCESS;	}	/* Shortcut: When we have a open_basedir and someone tries to unset, we know it'll fail */	if (!new_value || !*new_value->val) {		return FAILURE;	}	/* Is the proposed open_basedir at least as restrictive as the current setting? */	ptr = pathbuf = estrdup(new_value->val);	while (ptr && *ptr) {		end = strchr(ptr, DEFAULT_DIR_SEPARATOR);		if (end != NULL) {			*end = '/0';			end++;		}		if (php_check_open_basedir_ex(ptr, 0) != 0) {			/* At least one portion of this open_basedir is less restrictive than the prior one, FAIL */			efree(pathbuf);			return FAILURE;		}		ptr = end;	}	efree(pathbuf);	/* Everything checks out, set it */	*p = new_value->val;	return SUCCESS;}
开发者ID:erikjwaxx,项目名称:php-src,代码行数:54,


示例10: PHP_INI_MH

/* {{{ OnUpdate_zlib_output_compression */static PHP_INI_MH(OnUpdate_zlib_output_compression){	int int_value;	char *ini_value;	zend_long *p;#ifndef ZTS	char *base = (char *) mh_arg2;#else	char *base;	base = (char *) ts_resource(*((int *) mh_arg2));#endif	if (new_value == NULL) {		return FAILURE;	}	if (!strncasecmp(new_value->val, "off", sizeof("off"))) {		int_value = 0;	} else if (!strncasecmp(new_value->val, "on", sizeof("on"))) {		int_value = 1;	} else {		int_value = zend_atoi(new_value->val, new_value->len);	}	ini_value = zend_ini_string("output_handler", sizeof("output_handler"), 0);	if (ini_value && *ini_value && int_value) {		php_error_docref("ref.outcontrol", E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!");		return FAILURE;	}	if (stage == PHP_INI_STAGE_RUNTIME) {		int status = php_output_get_status();		if (status & PHP_OUTPUT_SENT) {			php_error_docref("ref.outcontrol", E_WARNING, "Cannot change zlib.output_compression - headers already sent");			return FAILURE;		}	}	p = (zend_long *) (base+(size_t) mh_arg1);	*p = int_value;	ZLIBG(output_compression) = ZLIBG(output_compression_default);	if (stage == PHP_INI_STAGE_RUNTIME && int_value) {		if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME))) {			php_zlib_output_compression_start();		}	}	return SUCCESS;}
开发者ID:PeakLee,项目名称:php-src,代码行数:51,


示例11: phpFinit

int phpFinit(lstTset * opt){    php_core_globals *core_globals;    tsrm_startup(128, 1, 0, NULL);    core_globals = ts_resource(core_globals_id);    logFmsg(0, "mod/php: PHP Interface v3 (module)");    logFmsg(0, "mod/php: Copyright (c) 1999-2014 The PHP Group. All rights reserved.");    sapi_startup(&capi_sapi_module);    capi_sapi_module.startup(&capi_sapi_module);    return STATUS_PROCEED;}
开发者ID:slusarz,项目名称:php-src,代码行数:15,


示例12: PHP_INI_MH

static PHP_INI_MH(OnUpdateHandler){	long *p;#ifndef ZTS	char *base = (char *) mh_arg2;#else	char *base;	base = (char *) ts_resource(*((int *) mh_arg2));#endif	p = (long *) (base+(size_t) mh_arg1);	if(!new_value) {		*p = 0;	}	while(new_value) {		char *next = strchr(new_value, ',');		int len;		if(next) {			len = next-new_value;		} else {			len = strlen(new_value);		}		if(strncmp(new_value, "stop", len) == 0) {			*p |= CATCH_STOP;		} else 	if(strncmp(new_value, "trace", len) == 0) {			*p |= CATCH_STACK;		} else if(strncmp(new_value, "phptrace", len) == 0) {			*p |= CATCH_PHP_STACK;		} else if(strncmp(new_value, "throw", len) == 0) {			*p |= CATCH_THROW;		}		if(next) {			new_value = next+1;		} else {			break;		}	}}
开发者ID:smalyshev,项目名称:catch,代码行数:38,


示例13: ZEND_INI_MH

static ZEND_INI_MH(OnUpdateMemoryConsumption){	long *p;	long memsize;#ifndef ZTS	char *base = (char *) mh_arg2;#else	char *base = (char *) ts_resource(*((int *) mh_arg2));#endif	/* keep the compiler happy */	(void)entry; (void)new_value_length; (void)mh_arg2; (void)mh_arg3; (void)stage;	p = (long *) (base+(size_t) mh_arg1);	memsize = atoi(new_value);	/* sanity check we must use at least 8 MB */	if (memsize < 8) {		const char *new_new_value = "8";		zend_ini_entry *ini_entry;		memsize = 8;		zend_accel_error(ACCEL_LOG_WARNING,"zend_optimizerplus.memory_consumption is set below the required 8MB./n" );		zend_accel_error(ACCEL_LOG_WARNING, ACCELERATOR_PRODUCT_NAME " will use the minimal 8MB cofiguration./n" );		if (zend_hash_find(EG(ini_directives),					"zend_optimizerplus.memory_consumption",					sizeof("zend_optimizerplus.memory_consumption"),					(void *) &ini_entry)==FAILURE) {			return FAILURE;		}		ini_entry->value = strdup(new_new_value);		ini_entry->value_length = strlen(new_new_value);	}	*p = memsize * (1024 * 1024);	return SUCCESS;}
开发者ID:gitlisted,项目名称:ZendOptimizerPlus,代码行数:37,


示例14: main

/* {{{ main*/int main(int argc, char *argv[]){    char *sock = NULL;	int dofork = 0;	int exit_status = SUCCESS;	int c;/* temporary locals */	int orig_optind=ap_php_optind;	char *orig_optarg=ap_php_optarg;	int interactive=0;	char *param_error=NULL;/* end of temporary locals */	void ***tsrm_ls;#ifdef HAVE_SIGNAL_H#if defined(SIGPIPE) && defined(SIG_IGN)	signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so								that sockets created via fsockopen()								don't kill PHP if the remote site								closes it.  in apache|apxs mode apache								does that for us!  [email
C++ tsadd函数代码示例
C++ ts_lua_get_http_ctx函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。