• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ RB_REMOVE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: mib_fetch_route

int
mib_fetch_route(void)
{
	u_char *rtab, *next;
	size_t len;
	struct sroute *r, *r1;
	struct rt_msghdr *rtm;
	struct sockaddr *addrs[RTAX_MAX];

	if (route_tick != 0 && route_tick + ROUTE_UPDATE_INTERVAL > this_tick)
		return (0);

	/*
	 * Remove all routes
	 */
	r = RB_MIN(sroutes, &sroutes);
	while (r != NULL) {
		r1 = RB_NEXT(sroutes, &sroutes, r);
		RB_REMOVE(sroutes, &sroutes, r);
		free(r);
		r = r1;
	}
	route_total = 0;

	if ((rtab = mib_fetch_rtab(AF_INET, NET_RT_DUMP, 0, &len)) == NULL)
		return (-1);

	next = rtab;
	for (next = rtab; next < rtab + len; next += rtm->rtm_msglen) {
		rtm = (struct rt_msghdr *)(void *)next;
		if (rtm->rtm_type != RTM_GET ||
		    !(rtm->rtm_flags & RTF_UP))
			continue;
		mib_extract_addrs(rtm->rtm_addrs, (u_char *)(rtm + 1), addrs);


		mib_sroute_process(rtm, addrs[RTAX_GATEWAY], addrs[RTAX_DST],
		    addrs[RTAX_NETMASK]);
	}

#if 0
	u_int n = 0;
	r = RB_MIN(sroutes, &sroutes);
	while (r != NULL) {
		printf("%u: ", n++);
		sroute_print(r);
		printf("\n");
		r = RB_NEXT(sroutes, &sroutes, r);
	}
#endif
	free(rtab);
	route_tick = get_ticks();

	return (0);
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:55,代码来源:mibII_route.c


示例2: environ_free

/* Free an environment. */
void
environ_free(struct environ *env)
{
	struct environ_entry	*envent, *envent1;

	RB_FOREACH_SAFE(envent, environ, env, envent1) {
		RB_REMOVE(environ, env, envent);
		free(envent->name);
		free(envent->value);
		free(envent);
	}
开发者ID:alexdavid,项目名称:tmux,代码行数:12,代码来源:environ.c


示例3: lang_code_free

static void lang_code_free( lang_code_lookup_t *l )
{
  lang_code_lookup_element_t *element;
  if (l == NULL)
    return;
  while ((element = RB_FIRST(l)) != NULL) {
    RB_REMOVE(l, element, link);
    free(element);
  }
  free(l);
}
开发者ID:Leyorus,项目名称:tvheadend,代码行数:11,代码来源:lang_codes.c


示例4: vm_map_store_entry_unlink_rb

void	vm_map_store_entry_unlink_rb( struct vm_map_header *mapHdr, vm_map_entry_t entry)
{
	struct rb_head *rbh = &(mapHdr->rb_head_store);
	struct vm_map_store *rb_entry;
	struct vm_map_store *store = &(entry->store);
	
	rb_entry = RB_FIND( rb_head, rbh, store);	
	if(rb_entry == NULL)
		panic("NO ENTRY TO DELETE");
	RB_REMOVE( rb_head, rbh, store );
}
开发者ID:CptFrazz,项目名称:xnu,代码行数:11,代码来源:vm_map_store_rb.c


示例5: ct_rb_unwind

void
ct_rb_unwind(struct ct_match_tree *head)
{
	struct ct_match_node	*n;

	while ((n = RB_ROOT(head)) != NULL) {
		RB_REMOVE(ct_match_tree, head, n);
		e_free(&n->cmn_string);
		e_free(&n);
	}
}
开发者ID:finid,项目名称:cyphertite,代码行数:11,代码来源:ct_match.c


示例6: job_tree_free

/* Destroy a job tree. */
void
job_tree_free(struct jobs *jobs)
{
	struct job	*job;

	while (!RB_EMPTY(jobs)) {
		job = RB_ROOT(jobs);
		RB_REMOVE(jobs, jobs, job);
		job_free(job);
	}
}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:12,代码来源:job.c


示例7: lang_str_destroy

/* Destroy (free memory) */
void lang_str_destroy ( lang_str_t *ls )
{ 
  lang_str_ele_t *e;
  if (ls == NULL)
    return;
  while ((e = RB_FIRST(ls))) {
    if (e->str)  free(e->str);
    RB_REMOVE(ls, e, link);
    free(e);
  }
  free(ls);
}
开发者ID:1stsetup,项目名称:tvheadend,代码行数:13,代码来源:lang_str.c


示例8: idnode_done

void
idnode_done(void)
{
  idclass_link_t *il;

  pthread_cond_signal(&idnode_cond);
  pthread_join(idnode_tid, NULL);
  pthread_mutex_lock(&idnode_mutex);
  htsmsg_destroy(idnode_queue);
  idnode_queue = NULL;
  pthread_mutex_unlock(&idnode_mutex);  
  while ((il = RB_FIRST(&idclasses)) != NULL) {
    RB_REMOVE(&idclasses, il, link);
    free(il);
  }
  while ((il = RB_FIRST(&idrootclasses)) != NULL) {
    RB_REMOVE(&idrootclasses, il, link);
    free(il);
  }
  SKEL_FREE(idclasses_skel);
}
开发者ID:Jalle19,项目名称:tvheadend,代码行数:21,代码来源:idnode.c


示例9: environ_unset

/* Unset an environment variable. */
void
environ_unset(struct environ *env, const char *name)
{
	struct environ_entry	*envent;

	if ((envent = environ_find(env, name)) == NULL)
		return;
	RB_REMOVE(environ, env, envent);
	free(envent->name);
	free(envent->value);
	free(envent);
}
开发者ID:Darkoe,项目名称:tmux,代码行数:13,代码来源:environ.c


示例10: environ_free

/* Free an environment. */
void
environ_free(struct environ *env)
{
	struct environ_entry	*envent;

	while (!RB_EMPTY(env)) {
		envent = RB_ROOT(env);
		RB_REMOVE(environ, env, envent);
		free(envent->name);
		free(envent->value);
		free(envent);
	}
}
开发者ID:Darkoe,项目名称:tmux,代码行数:14,代码来源:environ.c


示例11: RB_FIND

void *tato_tree_int_remove(TatoTreeInt *thiss, unsigned int key) {
	TatoTreeIntNode node_scanned;
	node_scanned.key = key;

	TatoTreeIntNode *node = RB_FIND(TatoTreeInt_, thiss, &node_scanned);
	if (!node)
		return NULL;

	RB_REMOVE(TatoTreeInt_, thiss, node);
	void *result = node->value;
	free(node);
	return result;
}
开发者ID:Akirato,项目名称:tatodb,代码行数:13,代码来源:tree_int.c


示例12: mpls_tree_remove

mpls_return_enum mpls_tree_remove(mpls_tree_handle tree, uint32_t key, int length, void **info)
{
	struct mpls_tree_node *node;

	node = mpls_tree_find(tree, key, length);
	if(!node)
		return MPLS_FAILURE;
	*info = node->info;
	RB_REMOVE(mpls_tree, tree, node);
	mpls_free(node);
	
	return MPLS_SUCCESS;
}
开发者ID:antonrogov,项目名称:freebsd-ldpd,代码行数:13,代码来源:mpls_tree_impl.c


示例13: intlconv_done

void
intlconv_done( void )
{
  intlconv_cache_t *ic;

  pthread_mutex_lock(&intlconv_lock);
  intlconv_last_ic = NULL;
  while ((ic = RB_FIRST(&intlconv_all)) != NULL) {
    iconv_close(ic->ic_handle);
    free(ic->ic_charset_id);
    RB_REMOVE(&intlconv_all, ic, ic_link);
    free(ic);
  }
  intlconv_last_src_ic = NULL;
  while ((ic = RB_FIRST(&intlconv_src_all)) != NULL) {
    iconv_close(ic->ic_handle);
    free(ic->ic_charset_id);
    RB_REMOVE(&intlconv_src_all, ic, ic_link);
    free(ic);
  }
  pthread_mutex_unlock(&intlconv_lock);
}
开发者ID:InuSasha,项目名称:tvheadend,代码行数:22,代码来源:intlconv.c


示例14: unloadtags

/*
 * Free tags tree.
 */
void
unloadtags(void)
{
	struct ctag *var, *nxt;
	
	for (var = RB_MIN(tagtree, &tags); var != NULL; var = nxt) {
		nxt = RB_NEXT(tagtree, &tags, var);
		RB_REMOVE(tagtree, &tags, var);
		/* line parsed with fparseln needs to be freed */
		free(var->tag);
		free(var);
	}
}
开发者ID:hackalog,项目名称:mg,代码行数:16,代码来源:tags.c


示例15: msdosfs_fileno_free

/* Free 32-bit file number generation structures. */
void
msdosfs_fileno_free(struct mount *mp)
{
	struct msdosfsmount *pmp = VFSTOMSDOSFS(mp);
	struct msdosfs_fileno *mf, *next;

	for (mf = RB_MIN(msdosfs_filenotree, &pmp->pm_filenos); mf != NULL;
	    mf = next) {
		next = RB_NEXT(msdosfs_filenotree, &pmp->pm_filenos, mf);
		RB_REMOVE(msdosfs_filenotree, &pmp->pm_filenos, mf);
		free(mf, M_MSDOSFSFILENO);
	}
}
开发者ID:2asoft,项目名称:freebsd,代码行数:14,代码来源:msdosfs_fileno.c


示例16: ct_extract_free_entry

void
ct_extract_free_entry(struct ct_pending_files *head,
    struct ct_pending_file *file)
{
	struct fnode	*fnode;

	RB_REMOVE(ct_pending_files, head, file);
	while ((fnode = TAILQ_FIRST(&file->cpf_links)) != NULL) {
		TAILQ_REMOVE(&file->cpf_links, fnode, fn_list);
		ct_free_fnode(fnode);
	}
	e_free(&file->cpf_name);
	e_free(&file);
}
开发者ID:Bluerise,项目名称:cyphertite,代码行数:14,代码来源:ct_ops.c


示例17: Remove_Node

void Remove_Node(struct FlowNode *node) {

#ifdef DEVEL
	if ( NumFlows == 0 ) {
		LogError("Remove_Node() Fatal Tried to remove a Node from empty tree");
		return;
	}
#endif

	RB_REMOVE(FlowTree, FlowTree, node);
	Free_Node(node);
	NumFlows--;

} // End of Lookup_FlowTree
开发者ID:ETredgo,项目名称:NetflowDB,代码行数:14,代码来源:flowtree.c


示例18: kqueue_free

/* Must hold the kqtree_mtx when calling this */
static void
kqueue_free(struct kqueue *kq)
{
    RB_REMOVE(kqt, &kqtree, kq);
    filter_unregister_all(kq);
#if defined(__sun__)
    port_event_t *pe = (port_event_t *) pthread_getspecific(kq->kq_port_event);

    if (kq->kq_port > 0) 
        close(kq->kq_port);
    free(pe);
#endif
    free(kq);
}
开发者ID:hajuuk,项目名称:R7000,代码行数:15,代码来源:kqueue.c


示例19: options_remove

void
options_remove(struct options *oo, const char *name)
{
	struct options_entry	*o;

	if ((o = options_find1(oo, name)) == NULL)
		return;

	RB_REMOVE(options_tree, &oo->tree, o);
	free(o->name);
	if (o->type == OPTIONS_STRING)
		free(o->str);
	free(o);
}
开发者ID:FauxFaux,项目名称:tmux,代码行数:14,代码来源:options.c


示例20: expand_free

void
expand_free(struct expand *expand)
{
	struct expandnode *xn;

	if (expand->queue)
		while ((xn = TAILQ_FIRST(expand->queue)))
			TAILQ_REMOVE(expand->queue, xn, tq_entry);

	while ((xn = RB_ROOT(&expand->tree)) != NULL) {
		RB_REMOVE(expandtree, &expand->tree, xn);
		free(xn);
	}
}
开发者ID:clongeau,项目名称:opensmtpd,代码行数:14,代码来源:expand.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ RB_ReadPixels函数代码示例发布时间:2022-05-30
下一篇:
C++ RB_INSERT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap