本文整理汇总了C++中STRCASEEQ函数的典型用法代码示例。如果您正苦于以下问题:C++ STRCASEEQ函数的具体用法?C++ STRCASEEQ怎么用?C++ STRCASEEQ使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了STRCASEEQ函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_edit
int
run_edit (const char *cmd, size_t argc, char *argv[])
{
const char *editor;
CLEANUP_FREE char *remotefilename = NULL;
int r;
if (argc != 1) {
fprintf (stderr, _("use '%s filename' to edit a file\n"), cmd);
return -1;
}
/* Choose an editor. */
if (STRCASEEQ (cmd, "vi"))
editor = "vi";
else if (STRCASEEQ (cmd, "emacs"))
editor = "emacs -nw";
else
editor = NULL; /* use $EDITOR */
/* Handle 'win:...' prefix. */
remotefilename = win_prefix (argv[0]);
if (remotefilename == NULL)
return -1;
r = edit_file_editor (g, remotefilename, editor, NULL, 0 /* not verbose */);
return r == -1 ? -1 : 0;
}
示例2: _iodbcdm_env_settracing
static void
_iodbcdm_env_settracing (GENV_t *genv)
{
char buf[1024];
genv = genv; /*UNUSED*/
/*
* Check TraceFile keyword
*/
SQLSetConfigMode (ODBC_BOTH_DSN);
if( SQLGetPrivateProfileString ("ODBC", "TraceFile", "", buf, sizeof(buf) / sizeof(SQLTCHAR), "odbc.ini") == 0 || !buf[0])
STRCPY (buf, SQL_OPT_TRACE_FILE_DEFAULT);
trace_set_filename (buf);
/*
* Check Trace keyword
*/
SQLSetConfigMode (ODBC_BOTH_DSN);
if ( SQLGetPrivateProfileString ("ODBC", "Trace", "", buf, sizeof(buf) / sizeof(SQLTCHAR), "odbc.ini") &&
(STRCASEEQ (buf, "on") || STRCASEEQ (buf, "yes")
|| STRCASEEQ (buf, "1")))
trace_start ();
return;
}
示例3: s_set_user_agent_data
/**
* <user_agent>
*/
static void
s_set_user_agent_data(Doc *doc, apr_pool_t *p, mod_chxj_config *conf, Node *node)
{
Node *child;
device_table_list *t;
for (child = qs_get_child_node(doc,node);
child ;
child = qs_get_next_node(doc,child)) {
char *name = qs_get_node_name(doc,child);
if (STRCASEEQ('u','U',"user_agent",name)) {
Attr *attr;
device_table_list *dtl;
if (! conf->devices) {
conf->devices = apr_pcalloc(p, sizeof(device_table_list));
conf->devices->next = NULL;
conf->devices->pattern = NULL;
conf->devices->table = NULL;
conf->devices->tail = NULL;
dtl = conf->devices;
}
else {
for (t = conf->devices; t ; t = t->next) {
if (! t->next)
break;
}
t->next = apr_pcalloc(p, sizeof(device_table_list));
t->next->next = NULL;
t->next->pattern = NULL;
t->next->table = NULL;
t->next->tail = NULL;
dtl = t->next;
}
for (attr = qs_get_attr(doc,child);
attr ;
attr = qs_get_next_attr(doc,attr)) {
char *attr_name = qs_get_attr_name(doc,attr);
if (STRCASEEQ('p','P',"pattern",attr_name)) {
dtl->pattern = apr_pstrdup(p, qs_get_attr_value(doc,attr));
dtl->regexp = ap_pregcomp(p, (const char *)dtl->pattern, AP_REG_EXTENDED|AP_REG_ICASE);
}
}
s_set_device_data(doc, p, dtl, child);
}
}
}
示例4: xenapiUtil_ParseQuery
int
xenapiUtil_ParseQuery(virConnectPtr conn, virURIPtr uri, int *noVerify)
{
int result = 0;
size_t i;
for (i = 0; i < uri->paramsCount; i++) {
virURIParamPtr queryParam = &uri->params[i];
if (STRCASEEQ(queryParam->name, "no_verify")) {
if (noVerify == NULL) {
continue;
}
if (virStrToLong_i(queryParam->value, NULL, 10, noVerify) < 0 ||
(*noVerify != 0 && *noVerify != 1)) {
xenapiSessionErrorHandler(conn, VIR_ERR_INVALID_ARG,
_("Query parameter 'no_verify' has unexpected value (should be 0 or 1)"));
goto failure;
}
}
}
cleanup:
return result;
failure:
result = -1;
goto cleanup;
}
示例5: is_utf8_encoding
int
is_utf8_encoding (const char *encoding)
{
if (STRCASEEQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
return 1;
return 0;
}
示例6: hivex_node_get_value
/* Very inefficient, but at least having a separate API call
* allows us to make it more efficient in future.
*/
hive_value_h
hivex_node_get_value (hive_h *h, hive_node_h node, const char *key)
{
hive_value_h *values = NULL;
char *name = NULL;
hive_value_h ret = 0;
values = hivex_node_values (h, node);
if (!values) goto error;
size_t i;
for (i = 0; values[i] != 0; ++i) {
name = hivex_value_key (h, values[i]);
if (!name) goto error;
if (STRCASEEQ (name, key)) {
ret = values[i];
break;
}
free (name); name = NULL;
}
error:
free (values);
free (name);
return ret;
}
示例7: openvzGetMaxVCPUs
static int openvzGetMaxVCPUs(virConnectPtr conn ATTRIBUTE_UNUSED,
const char *type)
{
if (type == NULL || STRCASEEQ(type, "openvz"))
return 1028; /* OpenVZ has no limitation */
openvzError(VIR_ERR_INVALID_ARG,
_("unknown type '%s'"), type);
return -1;
}
示例8: hypervConnectIsSecure
static int
hypervConnectIsSecure(virConnectPtr conn)
{
hypervPrivate *priv = conn->privateData;
if (STRCASEEQ(priv->parsedUri->transport, "https")) {
return 1;
} else {
return 0;
}
}
示例9: guestfs_int_is_true
/* Similar to Tcl_GetBoolean. */
int
guestfs_int_is_true (const char *str)
{
if (STREQ (str, "1") ||
STRCASEEQ (str, "true") ||
STRCASEEQ (str, "t") ||
STRCASEEQ (str, "yes") ||
STRCASEEQ (str, "y") ||
STRCASEEQ (str, "on"))
return 1;
if (STREQ (str, "0") ||
STRCASEEQ (str, "false") ||
STRCASEEQ (str, "f") ||
STRCASEEQ (str, "no") ||
STRCASEEQ (str, "n") ||
STRCASEEQ (str, "off"))
return 0;
return -1;
}
示例10: s_get_tag_and_class_and_id
static void
s_get_tag_and_class_and_id(Doc *doc, Node *node, char **tag_name, char **class_name, char **id)
{
Attr *attr;
*tag_name = node->name;
for (attr = qs_get_attr(doc, node); attr; attr = qs_get_next_attr(doc,attr)) {
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
if (STRCASEEQ('c','C', "class", name)) {
if (*value != 0) {
*class_name = value;
}
}
else
if (STRCASEEQ('i','I', "id", name)) {
if (*value != 0) {
*id = value;
}
}
if (*id && *class_name) break;
}
}
示例11: s_set_devices_data
/**
* <devices>
*/
static void
s_set_devices_data(Doc *doc, apr_pool_t *p, mod_chxj_config *conf, Node *node)
{
Node *child;
for (child = qs_get_child_node(doc,node);
child ;
child = qs_get_next_node(doc,child)) {
char *name = qs_get_node_name(doc,child);
if (STRCASEEQ('d','D',"devices",name)) {
s_set_user_agent_data(doc, p, conf, child);
}
}
}
示例12: hypervParseUri
int
hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri)
{
int result = -1;
size_t i;
if (parsedUri == NULL || *parsedUri != NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
if (VIR_ALLOC(*parsedUri) < 0)
return -1;
for (i = 0; i < uri->paramsCount; i++) {
virURIParamPtr queryParam = &uri->params[i];
if (STRCASEEQ(queryParam->name, "transport")) {
VIR_FREE((*parsedUri)->transport);
if (VIR_STRDUP((*parsedUri)->transport, queryParam->value) < 0)
goto cleanup;
if (STRNEQ((*parsedUri)->transport, "http") &&
STRNEQ((*parsedUri)->transport, "https")) {
virReportError(VIR_ERR_INVALID_ARG,
_("Query parameter 'transport' has unexpected value "
"'%s' (should be http|https)"),
(*parsedUri)->transport);
goto cleanup;
}
} else {
VIR_WARN("Ignoring unexpected query parameter '%s'",
queryParam->name);
}
}
if (!(*parsedUri)->transport &&
VIR_STRDUP((*parsedUri)->transport, "https") < 0)
goto cleanup;
result = 0;
cleanup:
if (result < 0)
hypervFreeParsedUri(parsedUri);
return result;
}
示例13: u8_strconv_to_encoding
char *
u8_strconv_to_encoding (const uint8_t *string,
const char *tocode,
enum iconv_ilseq_handler handler)
{
char *result;
size_t length;
if (STRCASEEQ (tocode, "UTF-8", 'U','T','F','-','8',0,0,0,0))
{
/* Conversion from UTF-8 to UTF-8. No need to go through iconv(). */
length = u8_strlen (string) + 1;
#if CONFIG_UNICODE_SAFETY
if (u8_check (string, length))
{
errno = EILSEQ;
return NULL;
}
#endif
result = (char *) malloc (length);
if (result == NULL)
{
errno = ENOMEM;
return NULL;
}
memcpy (result, (const char *) string, length);
return result;
}
else
{
result = NULL;
length = 0;
if (mem_iconveha ((const char *) string, u8_strlen (string) + 1,
"UTF-8", tocode,
handler == iconveh_question_mark, handler,
NULL, &result, &length) < 0)
return NULL;
/* Verify the result has exactly one NUL byte, at the end. */
if (!(length > 0 && result[length-1] == '\0'
&& strlen (result) == length-1))
{
free (result);
errno = EILSEQ;
return NULL;
}
return result;
}
}
示例14: do_debug
char *
do_debug (const char *subcmd, char *const *argv)
{
size_t argc, i;
for (i = argc = 0; argv[i] != NULL; ++i)
argc++;
for (i = 0; cmds[i].cmd != NULL; ++i) {
if (STRCASEEQ (subcmd, cmds[i].cmd))
return cmds[i].f (subcmd, argc, argv);
}
reply_with_error ("use 'debug help 0' to list the supported commands");
return NULL;
}
示例15: virDomainCapsCPUModelsGet
virDomainCapsCPUModelPtr
virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels,
const char *name)
{
size_t i;
if (!cpuModels)
return NULL;
for (i = 0; i < cpuModels->nmodels; i++) {
if (STRCASEEQ(cpuModels->models[i].name, name))
return cpuModels->models + i;
}
return NULL;
}