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

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

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

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

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

示例1: execute_script

/****************************************************************************** *                                                                            * * Function: execute_script                                                   * *                                                                            * * Purpose: executing command                                                 * *                                                                            * * Parameters:                                                                * *                                                                            * * Return value:  SUCCEED - processed successfully                            * *                FAIL - an error occurred                                    * *                                                                            * * Author: Alexander Vladishev                                                * *                                                                            * * Comments:                                                                  * *                                                                            * ******************************************************************************/static int	execute_script(zbx_uint64_t scriptid, zbx_uint64_t hostid, char **result){	const char	*__function_name = "execute_script";	char		error[MAX_STRING_LEN];	int		ret = FAIL, rc;	DC_HOST		host;	DB_RESULT	db_result;	DB_ROW		db_row;	zbx_script_t	script;	zabbix_log(LOG_LEVEL_DEBUG, "In %s() scriptid:" ZBX_FS_UI64 " hostid:" ZBX_FS_UI64,			__function_name, scriptid, hostid);	*error = '/0';	if (SUCCEED != (rc = DCget_host_by_hostid(&host, hostid)))	{		/* let's try to get a host from a database (the host can be disabled) */		db_result = DBselect("select host,name from hosts where hostid=" ZBX_FS_UI64, hostid);		if (NULL != (db_row = DBfetch(db_result)))		{			memset(&host, 0, sizeof(host));			host.hostid = hostid;			strscpy(host.host, db_row[0]);			strscpy(host.name, db_row[1]);			rc = SUCCEED;		}		DBfree_result(db_result);	}	if (SUCCEED != rc)	{		zbx_snprintf(error, sizeof(error), "Unknown Host ID [" ZBX_FS_UI64 "]", hostid);		goto fail;	}	zbx_script_init(&script);	script.type = ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT;	script.scriptid = scriptid;	ret = zbx_execute_script(&host, &script, result, error, sizeof(error));	zbx_script_clean(&script);fail:	if (SUCCEED != ret)	{		if (0 != CONFIG_NODEID)			*result = zbx_dsprintf(*result, "NODE %d: %s", CONFIG_NODEID, error);		else			*result = zbx_strdup(*result, error);	}	zabbix_log(LOG_LEVEL_DEBUG, "End of %s():%s", __function_name, zbx_result_string(ret));	return ret;}
开发者ID:aries4,项目名称:MIRACLE-ZBX-2.0.3-NoSQL,代码行数:75,


示例2: CHECK_DNS

int	CHECK_DNS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result){#ifdef HAVE_RES_QUERY#if !defined(PACKETSZ)#	define PACKETSZ 512#endif /* PACKETSZ */#if !defined(C_IN)#	define C_IN	ns_c_in#endif /* C_IN */#if !defined(T_ANY)#	define T_ANY	ns_t_any#endif /* T_ANY */	int		res;	char		ip[MAX_STRING_LEN];	char		zone[MAX_STRING_LEN];#ifdef	PACKETSZ	unsigned char	respbuf[PACKETSZ];#else	unsigned char	respbuf[NS_PACKETSZ];#endif	assert(result);	init_result(result);	if (num_param(param) > 2)		return SYSINFO_RET_FAIL;	if (0 != get_param(param, 1, ip, MAX_STRING_LEN))               *ip = '/0';	/* default parameter */	if (*ip == '/0')		strscpy(ip, "127.0.0.1");	if (0 != get_param(param, 2, zone, MAX_STRING_LEN))		*zone = '/0';	/* default parameter */	if (*zone == '/0')		strscpy(zone, "localhost");	if (!(_res.options & RES_INIT))		res_init();	res = res_query(zone, C_IN, T_ANY, respbuf, sizeof(respbuf));	SET_UI64_RESULT(result, res != -1 ? 1 : 0);	return SYSINFO_RET_OK;#endif /* HAVE_RES_QUERY */	return SYSINFO_RET_FAIL;}
开发者ID:phedders,项目名称:zabbix,代码行数:58,


示例3: vidioc_venc_querycap

static int vidioc_venc_querycap(struct file *file, void *priv,				struct v4l2_capability *cap){	strscpy(cap->driver, MTK_VCODEC_ENC_NAME, sizeof(cap->driver));	strscpy(cap->bus_info, MTK_PLATFORM_STR, sizeof(cap->bus_info));	strscpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card));	return 0;}
开发者ID:avagin,项目名称:linux,代码行数:9,


示例4: topic_replace_prepend

int topic_replace_prepend(User * u, Channel *c, char *newtopic) {	char topic[1024], buf[1024], *mtopic;	ChannelInfo *ci = c->ci;	if (ci->flags & CI_VERBOTEN) {		notice_lang(ci->bi->nick, u, CHAN_X_FORBIDDEN, ci->name);		return MOD_STOP;	}	if (!my_check_access(u, ci, CA_TOPIC) && ((ci->flags & CI_TOPICLOCK) || !my_check_access(u, ci, CA_OPDEOPME))) {		notice_lang(ci->bi->nick, u, PERMISSION_DENIED);		return MOD_STOP;	}	memset(topic, 0, 1024);	if (ci->last_topic) {		/* Copy topic starting after the first delimiter.. */		mtopic = strstr(ci->last_topic, (AppendToTopicDel ? AppendToTopicDel : "||"));		if (mtopic) {			memset(buf, 0, 1024);			strcat(buf, mtopic + strlen((AppendToTopicDel ? AppendToTopicDel : "||")));			if (newtopic)				snprintf(topic, sizeof(topic), "%s %s%s", newtopic,						(AppendToTopicDel ? AppendToTopicDel : "||"), buf);			else				snprintf(topic, sizeof(topic), "%s", buf);		} else			snprintf(topic, sizeof(topic), "%s %s %s", newtopic,					(AppendToTopicDel ? AppendToTopicDel : "||"), ci->last_topic);	} else if (newtopic)		strcpy(topic, newtopic);	ci->last_topic = *topic ? sstrdup(topic) : NULL;	strscpy(ci->last_topic_setter, u->nick, NICKMAX);	ci->last_topic_time = time(NULL);	if (c->topic) free(c->topic);	c->topic = *topic ? sstrdup(topic) : NULL;	strscpy(c->topic_setter, u->nick, NICKMAX);	if (ircd->topictsbackward) {		c->topic_time = c->topic_time - 1;	} else {		c->topic_time = ci->last_topic_time;	}	if (is_services_admin(u) && !check_access(u, ci, CA_TOPIC) &&			((ci->flags & CI_TOPICLOCK) || !check_access(u, ci, CA_OPDEOPME)))		alog("%s: %s!%[email
C++ strsep函数代码示例
C++ strsave函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。