当前位置: 首页>>代码示例>>C++>>正文


C++ xmlStrncmp函数代码示例

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


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

示例1: xmlconfig_load_timer

static int
xmlconfig_load_timer( xmlTextReaderPtr reader )
{
	int ret;
	const xmlChar *name;
        
	ret = xmlTextReaderRead( reader );
	while ( ret == 1 ) {
		name = xmlTextReaderConstName( reader );
		if ( name &&
                    (XML_READER_TYPE_END_ELEMENT != xmlTextReaderNodeType( reader )) &&
                    ( 0 == xmlStrncmp( name, (const xmlChar *)"Timer", 7 ) ) )
		{
			const xmlChar *nodeid = xmlTextReaderGetAttribute( reader, (const xmlChar*)"node" );
			const xmlChar *tname = xmlTextReaderGetAttribute( reader, (const xmlChar*)"name" );
			const xmlChar *on = xmlTextReaderGetAttribute( reader, (const xmlChar*)"on" );
			const xmlChar *off = xmlTextReaderGetAttribute( reader, (const xmlChar*)"off" );
                        
			SYSLOG_DEBUG( "xmlconfig_load_timer: Name=%s Id=%s ON=%s, OFF=%s",
                                     tname, nodeid, on, off );
                }
		if ( (XML_READER_TYPE_END_ELEMENT == xmlTextReaderNodeType( reader )) &&
			(0 == xmlStrncmp(name, (const xmlChar *)"TimerConfig", 11)))
			break;

		ret = xmlTextReaderRead( reader );
	}
	return ret;
}
开发者ID:pmnair,项目名称:zwave-remote,代码行数:29,代码来源:xmlconfig.c

示例2: get_xml_type

MANSCDP_xml_type get_xml_type(char* xml_type_string)
{
    if(NULL == xml_type_string)
    {
        return MANSCDP_xml_Unknown;
    }

    if(0 == xmlStrncmp(xml_type_string, "Control", xmlStrlen("Control")))
    {
        return MANSCDP_xml_Control;
    }
    if(0 == xmlStrncmp(xml_type_string, "Query", xmlStrlen("Query")))
    {
        return MANSCDP_xml_Query;
    }
    if(0 == xmlStrncmp(xml_type_string, "Notify", xmlStrlen("Notify")))
    {
        return MANSCDP_xml_Notify;
    }
    if(0 == xmlStrncmp(xml_type_string, "Response", xmlStrlen("Response")))
    {
        return MANSCDP_xml_Response;
    }

    return MANSCDP_xml_Unknown;
}
开发者ID:qwerty258,项目名称:libGBT28181,代码行数:26,代码来源:XMLUtility.c

示例3: xmlconfig_load_node

static int
xmlconfig_load_node( xmlTextReaderPtr reader )
{
	int ret;
	const xmlChar *name;
        
	ret = xmlTextReaderRead( reader );
	while ( ret == 1 ) {
		name = xmlTextReaderConstName( reader );
		if ( name &&
                    (XML_READER_TYPE_END_ELEMENT != xmlTextReaderNodeType( reader )) &&
                    ( 0 == xmlStrncmp( name, (const xmlChar *)"Node", 7 ) ) )
		{
			const xmlChar *id = xmlTextReaderGetAttribute( reader, (const xmlChar*)"id" );
			const xmlChar *nname = xmlTextReaderGetAttribute( reader, (const xmlChar*)"name" );
			const xmlChar *type = xmlTextReaderGetAttribute( reader, (const xmlChar*)"type" );
                        
			SYSLOG_DEBUG( "xmlconfig_load_node: Name=%s Id=%s Type=%s",
                                     	nname, id, type );
                        
                        ret = zw_node_set_label( atoi((const char*)id), (char *)nname );
                        if ( ret )
                                SYSLOG_DEBUG( "xmlconfig_load_node: set label for node(%d) failed %d", atoi((const char*)id), ret );
		}
		if ( (XML_READER_TYPE_END_ELEMENT == xmlTextReaderNodeType( reader )) &&
			(0 == xmlStrncmp(name, (const xmlChar *)"NodeConfig", 10)))
			break;
                
		ret = xmlTextReaderRead( reader );
	}
	return ret;
}
开发者ID:pmnair,项目名称:zwave-remote,代码行数:32,代码来源:xmlconfig.c

示例4: get_MANSCDP_statues

MANSCDP_result_type get_MANSCDP_statues(char* MANSCDP_string)
{
    if(0 == xmlStrncmp(MANSCDP_string, "OK", xmlStrlen("OK")))
    {
        return MANSCDP_OK;
    }
    if(0 == xmlStrncmp(MANSCDP_string, "ERROR", xmlStrlen("ERROR")))
    {
        return MANSCDP_ERROR;
    }

    return MANSCDP_UNKNOWN_RESULT_TYPE;
}
开发者ID:qwerty258,项目名称:libGBT28181,代码行数:13,代码来源:XMLUtility.c

示例5: get_MANSCDP_online

MANSCDP_on_off_line get_MANSCDP_online(char* MANSCDP_string)
{
    if(0 == xmlStrncmp(MANSCDP_string, "ONLINE", xmlStrlen("ONLINE")))
    {
        return MANSCDP_ONLINE;
    }
    if(0 == xmlStrncmp(MANSCDP_string, "OFFLINE", xmlStrlen("OFFLINE")))
    {
        return MANSCDP_OFFLINE;
    }

    return MANSCDP_UNKNOWN_ON_OFF_LINE;
}
开发者ID:qwerty258,项目名称:libGBT28181,代码行数:13,代码来源:XMLUtility.c

示例6: ags_count_beats_audio_run_read

void
ags_count_beats_audio_run_read(AgsFile *file, xmlNode *node, AgsPlugin *plugin)
{
  AgsCountBeatsAudioRun *count_beats_audio_run;
  AgsFileLookup *file_lookup;
  xmlNode *iter;

  /* read parent */
  ags_count_beats_audio_run_parent_plugin_interface->read(file, node, plugin);

  count_beats_audio_run = AGS_COUNT_BEATS_AUDIO_RUN(plugin);

  /* read depenendency */
  iter = node->children;

  while(iter != NULL){
    if(iter->type == XML_ELEMENT_NODE){
      if(!xmlStrncmp(iter->name,
		     "ags-dependency-list\0",
		     19)){
	xmlNode *dependency_node;

	dependency_node = iter->children;

	while(dependency_node != NULL){
	  if(dependency_node->type == XML_ELEMENT_NODE){
	    if(!xmlStrncmp(dependency_node->name,
			   "ags-dependency\0",
			   15)){
	      file_lookup = (AgsFileLookup *) g_object_new(AGS_TYPE_FILE_LOOKUP,
							   "file\0", file,
							   "node\0", dependency_node,
							   "reference\0", count_beats_audio_run,
							   NULL);
	      ags_file_add_lookup(file, (GObject *) file_lookup);
	      g_signal_connect(G_OBJECT(file_lookup), "resolve\0",
			       G_CALLBACK(ags_count_beats_audio_run_read_resolve_dependency), count_beats_audio_run);
	    }
	  }
	  
	  dependency_node = dependency_node->next;
	}
      }
    }

    iter = iter->next;
  }
}
开发者ID:joelkraehemann,项目名称:gsequencer,代码行数:48,代码来源:ags_count_beats_audio_run.c

示例7: xmlUTF8Strloc

/**
 * xmlUTF8Strloc:
 * @utf:  the input UTF8 *
 * @utfchar:  the UTF8 character to be found
 *
 * a function to provide the relative location of a UTF8 char
 *
 * Returns the relative character position of the desired char
 * or -1 if not found
 */
int
xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar)
{
  int i, size;
  xmlChar ch;

  if (utf==NULL || utfchar==NULL) return -1;
  size = xmlUTF8Strsize(utfchar, 1);
  for (i=0; (ch=*utf) != 0; i++)
  {
    if (xmlStrncmp(utf, utfchar, size)==0)
      return(i);
    utf++;
    if ( ch & 0x80 )
    {
      /* if not simple ascii, verify proper format */
      if ( (ch & 0xc0) != 0xc0 )
        return(-1);
      /* then skip over remaining bytes for this char */
      while ( (ch <<= 1) & 0x80 )
        if ( (*utf++ & 0xc0) != 0x80 )
          return(-1);
    }
  }

  return(-1);
}
开发者ID:vgurev,项目名称:freesurfer,代码行数:37,代码来源:xmlstring.c

示例8: handle_start_sync

static void
handle_start_sync (GstSamiContext * sctx, const xmlChar ** atts)
{
  int i;

  sami_context_pop_state (sctx, CLEAR_TAG);
  if (atts != NULL) {
    for (i = 0; (atts[i] != NULL); i += 2) {
      const xmlChar *key, *value;

      key = atts[i];
      value = atts[i + 1];

      if (!value)
        continue;
      if (!xmlStrncmp ((const xmlChar *) "start", key, 5)) {
        /* Only set a new start time if we don't have text pending */
        if (sctx->resultbuf->len == 0)
          sctx->time1 = sctx->time2;

        sctx->time2 = atoi ((const char *) value) * GST_MSECOND;
        g_string_append (sctx->resultbuf, sctx->buf->str);
        sctx->has_result = (sctx->resultbuf->len != 0) ? TRUE : FALSE;
        g_string_truncate (sctx->buf, 0);
      }
    }
  }
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:28,代码来源:samiparse.c

示例9: ags_script_object_read_index

guint*
ags_script_object_read_index(gchar *xpath, guint *index_length)
{
  guint *index;
  gchar *offset;
  guint i;

  index = NULL;
  offset = xpath;
  i = 0;

  while((offset = strchr(offset, '[')) != NULL && offset[0] != '\0'){
    if(i == 0){
      index = (guint *) malloc(sizeof(guint));
    }else{
      index = (guint *) realloc(index, (i + 1) * sizeof(guint));
    }

    if(!xmlStrncmp(offset, "last()\0", 7)){
      index[i] = AGS_SCRIPT_OBJECT_XPATH_NaN;
    }else{
      sscanf(xpath, "%d\0", &(index[i]));
    }

    offset = &(offset[1]);
    i++;
  }

  *index_length = i;

  return(index);
}
开发者ID:joelkraehemann,项目名称:gsequencer,代码行数:32,代码来源:ags_script_object.c

示例10: remove_supported

/**
 * \brief Remove input plugin from supportedCollectors tag
 * 
 * \param info tool configuration
 * \return 0 on success
 */
int remove_supported(conf_info_t *info)
{
	int i;
	xmlNodePtr children1;
	xmlXPathObjectPtr xpath_obj_file = eval_xpath(info, TAG_SUPPORTED);
	if (!xpath_obj_file) {
		return 1;
	}
	
	for (i = 0; i < xpath_obj_file->nodesetval->nodeNr; i++) {
		children1 = xpath_obj_file->nodesetval->nodeTab[i]->children;
		while (children1) {
			if ((!strncmp ((char*) children1->name, "name", strlen ("name") + 1))
			        && (!xmlStrncmp (children1->children->content, (xmlChar *) info->name, xmlStrlen ((xmlChar *)info->name) + 1))) {
				/* element found*/
				xmlUnlinkNode(children1);
				xmlFreeNode(children1);
				return 0;
			}
			children1 = children1->next;
		}
	}
	
	return 0;
}
开发者ID:VisBlank,项目名称:ipfixcol,代码行数:31,代码来源:remover.c

示例11: mate_da_xml_get_bool

static gboolean
mate_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;
}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:31,代码来源:mate-da-xml.c

示例12: start_sami_element

static void
start_sami_element (void *ctx, const xmlChar * name, const xmlChar ** atts)
{
  GstSamiContext *sctx = (GstSamiContext *) ctx;

  GST_LOG ("name:%s", name);

  if (!xmlStrncmp ((const xmlChar *) "sync", name, 4)) {
    handle_start_sync (sctx, atts);
    sctx->in_sync = TRUE;
  } else if (!xmlStrncmp ((const xmlChar *) "font", name, 4)) {
    handle_start_font (sctx, atts);
  } else if (!xmlStrncmp ((const xmlChar *) "ruby", name, 4)) {
    sami_context_push_state (sctx, RUBY_TAG);
  } else if (!xmlStrncmp ((const xmlChar *) "br", name, 2)) {
    g_string_append_c (sctx->buf, '\n');
    /* FIXME: support for furigana/ruby once implemented in pango */
  } else if (!xmlStrncmp ((const xmlChar *) "rt", name, 2)) {
    if (has_tag (sctx->state, ITALIC_TAG)) {
      g_string_append (sctx->rubybuf, "<i>");
    }
    g_string_append (sctx->rubybuf, "<span size='xx-small' rise='-100'>");
    sami_context_push_state (sctx, RT_TAG);
  } else if (!xmlStrncmp ((const xmlChar *) "p", name, 1)) {
  } else if (!xmlStrncmp ((const xmlChar *) "i", name, 1)) {
    g_string_append (sctx->buf, "<i>");
    sami_context_push_state (sctx, ITALIC_TAG);
  }
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:29,代码来源:samiparse.c

示例13: xmlUTF8Charcmp

/**
 * xmlUTF8Charcmp:
 * @utf1: pointer to first UTF8 char
 * @utf2: pointer to second UTF8 char
 *
 * compares the two UCS4 values
 *
 * returns result of the compare as with xmlStrncmp
 */
int
xmlUTF8Charcmp(const xmlChar *utf1, const xmlChar *utf2) {

    if (utf1 == NULL ) {
        if (utf2 == NULL)
            return 0;
        return -1;
    }
    return xmlStrncmp(utf1, utf2, xmlUTF8Size(utf1));
}
开发者ID:Cyril2004,项目名称:proto-quic,代码行数:19,代码来源:xmlstring.c

示例14: end_sami_element

static void
end_sami_element (void *ctx, const xmlChar * name)
{
  GstSamiContext *sctx = (GstSamiContext *) ctx;

  GST_LOG ("name:%s", name);

  if (!xmlStrncmp ((const xmlChar *) "sync", name, 4)) {
    sctx->in_sync = FALSE;
  } else if ((!xmlStrncmp ((const xmlChar *) "body", name, 4)) ||
      (!xmlStrncmp ((const xmlChar *) "sami", name, 4))) {
    /* We will usually have one buffer left when the body is closed
     * as we need the next sync to actually send it */
    if (sctx->buf->len != 0) {
      /* Only set a new start time if we don't have text pending */
      if (sctx->resultbuf->len == 0)
        sctx->time1 = sctx->time2;

      sctx->time2 = GST_CLOCK_TIME_NONE;
      g_string_append (sctx->resultbuf, sctx->buf->str);
      sctx->has_result = (sctx->resultbuf->len != 0) ? TRUE : FALSE;
      g_string_truncate (sctx->buf, 0);
    }
  } else if (!xmlStrncmp ((const xmlChar *) "font", name, 4)) {
    sami_context_pop_state (sctx, SPAN_TAG);
  } else if (!xmlStrncmp ((const xmlChar *) "ruby", name, 4)) {
    sami_context_pop_state (sctx, RUBY_TAG);
  } else if (!xmlStrncmp ((const xmlChar *) "i", name, 1)) {
    sami_context_pop_state (sctx, ITALIC_TAG);
  }
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:31,代码来源:samiparse.c

示例15: xsltUTF8Charcmp

/**
 * xsltUTF8Charcmp
 * @utf1: pointer to first UTF8 char
 * @utf2: pointer to second UTF8 char
 *
 * returns result of comparing the two UCS4 values
 * as with xmlStrncmp
 */
static int
xsltUTF8Charcmp(xmlChar *utf1, xmlChar *utf2) {
    int len = xmlUTF8Strsize(utf1, 1);

    if (len < 1)
        return -1;
    if (utf1 == NULL ) {
        if (utf2 == NULL)
            return 0;
        return -1;
    }
    return xmlStrncmp(utf1, utf2, len);
}
开发者ID:amaneureka,项目名称:reactos,代码行数:21,代码来源:numbers.c


注:本文中的xmlStrncmp函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。