这篇教程C++ zstr函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中zstr函数的典型用法代码示例。如果您正苦于以下问题:C++ zstr函数的具体用法?C++ zstr怎么用?C++ zstr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了zstr函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: opus_load_configstatic switch_status_t opus_load_config(switch_bool_t reload){ char *cf = "opus.conf"; switch_xml_t cfg, xml = NULL, param, settings; switch_status_t status = SWITCH_STATUS_SUCCESS; if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Opening of %s failed/n", cf); return status; } if ((settings = switch_xml_child(cfg, "settings"))) { for (param = switch_xml_child(settings, "param"); param; param = param->next) { char *key = (char *) switch_xml_attr_soft(param, "name"); char *val = (char *) switch_xml_attr_soft(param, "value"); if (!strcasecmp(key, "use-vbr") && !zstr(val)) { opus_prefs.use_vbr = atoi(val); } else if (!strcasecmp(key, "complexity")) { opus_prefs.complexity = atoi(val); } else if (!strcasecmp(key, "maxaveragebitrate")) { opus_prefs.maxaveragebitrate = atoi(val); if ( opus_prefs.maxaveragebitrate < 6000 || opus_prefs.maxaveragebitrate > 510000 ) { opus_prefs.maxaveragebitrate = 0; /* values outside the range between 6000 and 510000 SHOULD be ignored */ } } else if (!strcasecmp(key, "maxplaybackrate")) { opus_prefs.maxplaybackrate = atoi(val); if ( opus_prefs.maxplaybackrate != 8000 && opus_prefs.maxplaybackrate != 12000 && opus_prefs.maxplaybackrate != 16000 && opus_prefs.maxplaybackrate != 24000 && opus_prefs.maxplaybackrate != 48000) { opus_prefs.maxplaybackrate = 0; /* value not supported */ } } } } if (xml) { switch_xml_free(xml); } return status;}
开发者ID:utkarsh301994,项目名称:localhost,代码行数:41,
示例2: initialise_eiswitch_status_t initialise_ei(struct ei_cnode_s *ec){ char thisnodename[MAXNODELEN + 1]; char thisalivename[MAXNODELEN + 1]; char *atsign; if (zstr(listen_list.hostname) || !strncasecmp(prefs.ip, "0.0.0.0", 7) || !strncasecmp(prefs.ip, "::", 2)) { listen_list.hostname=(char *) switch_core_get_hostname(); } if (strlen(listen_list.hostname) > EI_MAXHOSTNAMELEN) { *(listen_list.hostname+EI_MAXHOSTNAMELEN) = '/0'; } /* copy the prefs.nodename into something we can modify */ strncpy(thisalivename, prefs.nodename, MAXNODELEN); if ((atsign = strchr(thisalivename, '@'))) { /* we got a qualified node name, don't guess the host/domain */ snprintf(thisnodename, MAXNODELEN + 1, "%s", prefs.nodename); /* truncate the alivename at the @ */ *atsign = '/0'; } else { if (prefs.shortname) { char *off; if ((off = strchr(listen_list.hostname, '.'))) { *off = '/0'; } } snprintf(thisnodename, MAXNODELEN + 1, "%[email C++ zstr_send函数代码示例 C++ zsocket_new函数代码示例
|