本文整理汇总了C++中xmlStrcasecmp函数的典型用法代码示例。如果您正苦于以下问题:C++ xmlStrcasecmp函数的具体用法?C++ xmlStrcasecmp怎么用?C++ xmlStrcasecmp使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xmlStrcasecmp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xmlNodeGetContent
void
Opal::Presentity::rename_group (const std::string old_name,
const std::string new_name)
{
bool old_name_present = false;
bool already_in_new_name = false;
std::set<xmlNodePtr> nodes_to_remove;
/* remove the old name's node
* and check if we aren't already in the new name's group
*/
for (xmlNodePtr child = node->children ;
child != NULL ;
child = child->next) {
if (child->type == XML_ELEMENT_NODE
&& child->name != NULL) {
if (xmlStrEqual (BAD_CAST ("group"), child->name)) {
xmlChar* xml_str = xmlNodeGetContent (child);
if (xml_str != NULL) {
if (!xmlStrcasecmp ((const xmlChar*)old_name.c_str (), xml_str)) {
nodes_to_remove.insert (child); // don't free what we loop on!
old_name_present = true;
}
if (!xmlStrcasecmp ((const xmlChar*)new_name.c_str (), xml_str)) {
already_in_new_name = true;
}
xmlFree (xml_str);
}
}
}
}
// ok, now we can clean up!
for (std::set<xmlNodePtr>::iterator iter = nodes_to_remove.begin ();
iter != nodes_to_remove.end ();
++iter) {
xmlUnlinkNode (*iter);
xmlFreeNode (*iter);
}
if (old_name_present && !already_in_new_name) {
xmlNewChild (node, NULL,
BAD_CAST "group",
BAD_CAST robust_xmlEscape (node->doc,
new_name).c_str ());
}
updated ();
trigger_saving ();
}
示例2: cdf_parse
/* reads a CDF feed URL and returns a new channel structure (even if
the feed could not be read) */
static void cdf_parse(feedParserCtxtPtr ctxt, xmlNodePtr cur) {
CDFChannelPtr cp;
cp = g_new0(struct CDFChannel, 1);
do {
/* note: we support only one flavour of CDF channels! We will only
support the outer channel of the CDF feed. */
/* find outer channel tag */
while(cur) {
if(cur->type == XML_ELEMENT_NODE && (!xmlStrcasecmp(cur->name, BAD_CAST"channel"))) {
cur = cur->xmlChildrenNode;
break;
}
cur = cur->next;
}
time(&(cp->time));
/* find first "real" channel tag */
while(cur) {
if((!xmlStrcasecmp(cur->name, BAD_CAST"channel"))) {
parseCDFChannel(ctxt, cur, cp);
break;
}
cur = cur->next;
}
/* after parsing we fill in the infos into the subscription structure */
subscription_set_default_update_interval(ctxt->subscription, -1);
g_free(cp);
} while (FALSE);
}
示例3: gnome_da_xml_get_bool
static gboolean
gnome_da_xml_get_bool (const xmlNode *parent, const gchar *val_name)
{
xmlNode *element;
gboolean ret_val = FALSE;
xmlChar *xml_val_name;
gint len;
g_return_val_if_fail (parent != NULL, FALSE);
g_return_val_if_fail (parent->children != NULL, ret_val);
g_return_val_if_fail (val_name != NULL, FALSE);
xml_val_name = xmlCharStrdup (val_name);
len = xmlStrlen (xml_val_name);
for (element = parent->children; element != NULL; element = element->next) {
if (!xmlStrncmp (element->name, xml_val_name, len)) {
xmlChar *cont = xmlNodeGetContent (element);
if (!xmlStrcasecmp (cont, "true") || !xmlStrcasecmp (cont, "1"))
ret_val = TRUE;
else
ret_val = FALSE;
xmlFree (cont);
}
}
xmlFree (xml_val_name);
return ret_val;
}
示例4: atoi
int
Snes9xConfig::parse_calibration (xmlNodePtr node)
{
xmlAttrPtr attr;
int joynum = -1;
int num_joysticks = 0;
int retval = 0;
for (num_joysticks = 0; joystick[num_joysticks]; num_joysticks++)
{
}
for (attr = node->properties; attr; attr = attr->next)
{
if (!xmlStrcasecmp (attr->name, BAD_CAST "joystick"))
{
joynum = atoi ((char *) attr->children->content);
if (joynum < 0 || joynum >= num_joysticks)
return 0;
}
}
for (xmlNodePtr i = node->children; i; i = i->next)
{
if (!xmlStrcasecmp (i->name, BAD_CAST "axis"))
{
retval = parse_axis (i, joynum) | retval;
}
}
return retval;
}
示例5: set_option
int
Snes9xConfig::parse_option (xmlNodePtr node)
{
xmlAttrPtr attr = NULL;
char *name, *value;
/* Find name string */
for (attr = node->properties; attr; attr = attr->next)
{
if (!xmlStrcasecmp (attr->name, BAD_CAST "name"))
{
name = (char *) attr->children->content;
break;
}
}
if (!attr)
return 1;
/* Find value string */
for (attr = node->properties; attr; attr = attr->next)
{
if (!xmlStrcasecmp (attr->name, BAD_CAST "value"))
{
value = (char *) attr->children->content;
break;
}
}
if (!attr)
return 1;
return set_option (name, value);
}
示例6: while
/**
* Looks up the xmltv user display name of a channel given its xmltv id.
*/
const char *xmltv_lookup_channel_name( xmltv_t *xmltv, const char *id )
{
xmlNodePtr cur = xmltv->root->xmlChildrenNode;
if( xmltv->display_chan ) xmlFree( xmltv->display_chan );
xmltv->display_chan = 0;
while( cur ) {
if( !xmlStrcasecmp( cur->name, BAD_CAST "channel" ) ) {
xmlChar *curid = xmlGetProp( cur, BAD_CAST "id" );
if ( curid ) {
if ( !xmlStrcasecmp( curid, BAD_CAST id ) ) {
xmlNodePtr sub = cur->xmlChildrenNode;
while( sub && xmlStrcasecmp( sub->name, BAD_CAST "display-name" ) ) {
sub = sub->next;
}
if ( sub ) {
xmltv->display_chan = xmlNodeGetContent( sub );
xmlFree( curid );
if( xmltv->is_tv_grab_na ) {
return tv_grab_na_skip( (char *) xmltv->display_chan );
} else {
return (char *) xmltv->display_chan;
}
}
}
xmlFree( curid );
}
}
cur = cur->next;
}
return 0;
}
示例7: parse_actor_shirt
int parse_actor_shirt (actor_types *act, xmlNode *cfg) {
xmlNode *item;
char errmsg[120];
int ok, col_idx;
shirt_part *shirt;
if (cfg == NULL || cfg->children == NULL) return 0;
col_idx = get_property (cfg, "color", "shirt color", shirt_color_dict);
if (col_idx < 0) return 0;
shirt = &(act->shirt[col_idx]);
ok = 1;
for (item = cfg->children; item; item = item->next) {
if (item->type == XML_ELEMENT_NODE) {
if (xmlStrcasecmp (item->name, "arms") == 0) {
get_string_value (shirt->arms_name, sizeof (shirt->arms_name), item);
} else if (xmlStrcasecmp (item->name, "model") == 0) {
get_string_value (shirt->model_name, sizeof (shirt->model_name), item);
} else if (xmlStrcasecmp (item->name, "torso") == 0) {
get_string_value (shirt->torso_name, sizeof (shirt->torso_name), item);
} else {
snprintf (errmsg, sizeof (errmsg), "unknown shirt property \"%s\"", item->name);
LogError (errmsg);
ok = 0;
}
}
}
return ok;
}
示例8: fprintf
int
Snes9xConfig::parse_snes9x (xmlNodePtr node)
{
xmlNodePtr i = NULL;
int retval = 0;
if (xmlStrcasecmp (node->name, BAD_CAST "snes9x"))
{
fprintf (stderr, _("failure to read snes9x node"));
return 1;
}
for (i = node->children; i; i = i->next)
{
if (!xmlStrcasecmp (i->name, BAD_CAST "preferences"))
{
retval = parse_preferences (i) || retval;
}
else if (!xmlStrcasecmp (i->name, BAD_CAST "controls"))
{
retval = parse_controls (i) || retval;
}
}
return 0;
}
示例9: parse_actor_boots
int parse_actor_boots (actor_types *act, xmlNode *cfg) {
xmlNode *item;
char errmsg[120];
int ok, col_idx;
boots_part *boots;
if (cfg == NULL || cfg->children == NULL) return 0;
col_idx = get_property (cfg, "color", "boots color", boots_color_dict);
if (col_idx < 0) return 0;
boots = &(act->boots[col_idx]);
ok = 1;
for (item = cfg->children; item; item = item->next) {
if (item->type == XML_ELEMENT_NODE) {
if (xmlStrcasecmp (item->name, "skin") == 0) {
get_string_value (boots->boots_name, sizeof (boots->boots_name), item);
} else if (xmlStrcasecmp (item->name, "glow") == 0) {
int mode = find_description_index (glow_mode_dict, item->children->content, "glow mode");
if (mode < 0) mode = GLOW_NONE;
boots->glow = mode;
} else {
snprintf (errmsg, sizeof (errmsg), "unknown legs property \"%s\"", item->name);
LogError (errmsg);
ok = 0;
}
}
}
return ok;
}
示例10: parse_actor_body_part
int parse_actor_body_part (body_part *part, xmlNode *cfg, const char *part_name) {
xmlNode *item;
char errmsg[120];
int ok = 1;
if (cfg == NULL) return 0;
for (item = cfg; item; item = item->next) {
if (item->type == XML_ELEMENT_NODE) {
if (xmlStrcasecmp (item->name, "model") == 0) {
get_string_value (part->model_name, sizeof (part->model_name), item);
} else if (xmlStrcasecmp (item->name, "skin") == 0) {
get_string_value (part->skin_name, sizeof (part->skin_name), item);
} else if (xmlStrcasecmp (item->name, "glow") == 0) {
int mode = find_description_index (glow_mode_dict, item->children->content, "glow mode");
if (mode < 0) mode = GLOW_NONE;
part->glow = mode;
} else {
snprintf (errmsg, sizeof (errmsg), "unknown %s property \"%s\"", part_name, item->name);
LogError (errmsg);
ok = 0;
}
}
}
return ok;
}
示例11: parse_actor_skin
int parse_actor_skin (actor_types *act, xmlNode *cfg) {
xmlNode *item;
char errmsg[120];
int ok, col_idx;
skin_part *skin;
if (cfg == NULL || cfg->children == NULL) return 0;
col_idx = get_property (cfg, "color", "skin color", skin_color_dict);
if (col_idx < 0) return 0;
skin = &(act->skin[col_idx]);
ok = 1;
for (item = cfg->children; item; item = item->next) {
if (item->type == XML_ELEMENT_NODE) {
if (xmlStrcasecmp (item->name, "hands") == 0) {
get_string_value (skin->hands_name, sizeof (skin->hands_name), item);
} else if (xmlStrcasecmp (item->name, "head") == 0) {
get_string_value (skin->head_name, sizeof (skin->head_name), item);
} else {
snprintf (errmsg, sizeof (errmsg), "unknown skin property \"%s\"", item->name);
LogError (errmsg);
ok = 0;
}
}
}
return ok;
}
示例12: ParseSimage
void ParseSimage(xmlAttr *a_node)
{
xmlAttr *cur_attr=NULL;
for (cur_attr = a_node; cur_attr; cur_attr = cur_attr->next) {
if (cur_attr->type==XML_ATTRIBUTE_NODE){
//name=""
if(!xmlStrcasecmp(cur_attr->name,(xmlChar*)"name")){
#ifdef NEW_TEXTURES
id = load_texture_cached((char*)cur_attr->children->content, tt_gui);
#else /* NEW_TEXTURES */
id=load_texture_cache_deferred((char*)cur_attr->children->content,0);
#endif /* NEW_TEXTURES */
}
//isize=""
if(!xmlStrcasecmp(cur_attr->name,(xmlChar*)"isize")){
isize=atoi((char*)cur_attr->children->content);
}
//tsize=""
if(!xmlStrcasecmp(cur_attr->name,(xmlChar*)"tsize")){
tsize=atoi((char*)cur_attr->children->content);
}
//tid=""
if(!xmlStrcasecmp(cur_attr->name,(xmlChar*)"tid")){
tid=atoi((char*)cur_attr->children->content);
}
//size=""
if(!xmlStrcasecmp(cur_attr->name,(xmlChar*)"size")){
ssize=atoi((char*)cur_attr->children->content);
}
//x=""
if(!xmlStrcasecmp(cur_attr->name,(xmlChar*)"x")){
x=atoi((char*)cur_attr->children->content);
}
//y=""
if(!xmlStrcasecmp(cur_attr->name,(xmlChar*)"y")){
y=atoi((char*)cur_attr->children->content);
}
//mouseover=""
if(!xmlStrcasecmp(cur_attr->name,(xmlChar*)"mouseover")){
mouseover=atoi((char*)cur_attr->children->content);
}
//xposupdate=""
if(!xmlStrcasecmp(cur_attr->name,(xmlChar*)"xposupdate")){
xposupdate=atoi((char*)cur_attr->children->content);
}
//yposupdate=""
if(!xmlStrcasecmp(cur_attr->name,(xmlChar*)"yposupdate")){
yposupdate=atoi((char*)cur_attr->children->content);
}
}
}
}
示例13: bla_same_dialog
int bla_same_dialog(unsigned char* n_callid, unsigned char* n_fromtag, unsigned char* n_totag,
unsigned char* o_callid, unsigned char* o_fromtag, unsigned char* o_totag)
{
if(n_callid && o_callid && xmlStrcasecmp(n_callid, o_callid))
return 0;
if(n_fromtag && o_fromtag && xmlStrcasecmp(n_fromtag, o_fromtag))
return 0;
if(n_totag && o_totag && xmlStrcasecmp(n_totag, o_totag))
return 0;
return 1;
}
示例14: xmlstr_to_gboolean
static gboolean xmlstr_to_gboolean(xmlChar* str)
{
if (xmlStrcasecmp(str, BAD_CAST "true") == 0
|| xmlStrcasecmp(str, BAD_CAST "on") == 0
|| xmlStrcasecmp(str, BAD_CAST "yes") == 0)
{
return TRUE;
}
return FALSE;
}
示例15: if
int
Snes9xConfig::parse_binding (xmlNodePtr node, int joypad_number)
{
char *name = NULL;
char *type = NULL;
Binding b;
for (xmlAttrPtr attr = node->properties; attr; attr = attr->next)
{
if (!xmlStrcasecmp (attr->name, BAD_CAST "name"))
name = (char *) attr->children->content;
else if (!xmlStrcasecmp (attr->name, BAD_CAST "binding"))
type = (char *) attr->children->content;
}
b = Binding ((unsigned int) strtoul (type, NULL, 10));
if (joypad_number > -1 && joypad_number < NUM_JOYPAD_LINKS)
{
for (int i = 0; i < NUM_JOYPAD_LINKS; i++)
{
if (!strcasecmp (b_links[i].snes9x_name, name))
{
Binding *buttons = (Binding *) &pad[joypad_number];
if (b.is_key () || b.is_joy ())
buttons[i] = b;
else
buttons[i].clear ();
}
}
}
else
{
for (int i = NUM_JOYPAD_LINKS; b_links[i].snes9x_name; i++)
{
if (!strcasecmp (b_links[i].snes9x_name, name))
{
if (b.is_key () || b.is_joy ())
shortcut[i - NUM_JOYPAD_LINKS] = b;
else
shortcut[i - NUM_JOYPAD_LINKS].clear ();
}
}
}
return 0;
}