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

C++ devwalk函数代码示例

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

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



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

示例1: devwalk

static struct walkqid *pipewalk(struct chan *c, struct chan *nc, char **name,
								int nname)
{
	struct walkqid *wq;
	Pipe *p;

	p = c->aux;
	wq = devwalk(c, nc, name, nname, p->pipedir, ARRAY_SIZE(pipedir), pipegen);
	if (wq != NULL && wq->clone != NULL && wq->clone != c) {
		qlock(&p->qlock);
		kref_get(&p->ref, 1);
		if (c->flag & COPEN) {
			switch (NETTYPE(c->qid.path)) {
				case Qdata0:
					p->qref[0]++;
					break;
				case Qdata1:
					p->qref[1]++;
					break;
			}
		}
		qunlock(&p->qlock);
	}
	return wq;
}
开发者ID:GanShun,项目名称:akaros,代码行数:25,代码来源:pipe.c


示例2: devlogfswalk

static Walkqid*
devlogfswalk(Chan *c, Chan *nc, char **name, int nname)
{
	int instance, qid, qt, clone;
	Walkqid *wq;

#ifdef CALLTRACE
	print("devlogfswalk(c = 0x%.8lux, nc = 0x%.8lux, name = 0x%.8lux, nname = %d) - start\n",
		(ulong)c, (ulong)nc, (ulong)name, nname);
#endif
	clone = 0;
	if(nc == nil){
		nc = devclone(c);
		nc->type = 0;
		SPLITPATH(c->qid.path, c->qid.type, instance, qid, qt);
		if(DATAQID(qid, qt))
			nc->aux = devlogfsget(instance);
		clone = 1;
	}
	wq = devwalk(c, nc, name, nname, 0, 0, devlogfsgen);
	if (wq == nil || wq->nqid < nname) {
		if(clone)
			cclose(nc);
	}
	else if (clone) {
		wq->clone = nc;
		nc->type = c->type;
	}
#ifdef CALLTRACE
	print("devlogfswalk(c = 0x%.8lux, nc = 0x%.8lux, name = 0x%.8lux, nname = %d) - return\n",
		(ulong)c, (ulong)nc, (ulong)name, nname);
#endif
	return wq;
}
开发者ID:8l,项目名称:inferno,代码行数:34,代码来源:devlogfs.c


示例3: pipewalk

static Walkqid*
pipewalk(Chan *c, Chan *nc, char **name, int nname)
{
	Walkqid *wq;
	Pipe *p;

	wq = devwalk(c, nc, name, nname, pipedir, NPIPEDIR, pipegen);
	if(wq != nil && wq->clone != nil && wq->clone != c){
		p = c->aux;
		qlock(p);
		p->ref++;
		if(c->flag & COPEN){
			print("channel open in pipewalk\n");
			switch(NETTYPE(c->qid.path)){
			case Qdata0:
				p->qref[0]++;
				break;
			case Qdata1:
				p->qref[1]++;
				break;
			}
		}
		qunlock(p);
	}
	return wq;
}
开发者ID:Nurb432,项目名称:plan9front,代码行数:26,代码来源:devpipe.c


示例4: srvwalk

static Walkqid*
srvwalk(Chan *c, Chan *nc, char **name, int nname)
{
	SrvFile *d, *pd;
	Walkqid *w;

	pd = c->aux;
	qlock(&dev.l);
	if(waserror()){
		qunlock(&dev.l);
		nexterror();
	}

	w = devwalk(c, nc, name, nname, nil, 0, srvgen);
	if(w != nil && w->clone != nil){
		if(nname != 0){
			for(d = pd->entry; d != nil; d = d->entry)
				if(d->qid.path == w->clone->qid.path)
					break;
			if(d == nil)
				panic("srvwalk");
			if(w->clone == c)
				pd->ref--;
		}else
			d = pd;
		w->clone->aux = d;
		d->ref++;
	}

	poperror();
	qunlock(&dev.l);
	return w;
}
开发者ID:8l,项目名称:inferno,代码行数:33,代码来源:devsrv.c


示例5: pipewalk

static Walkqid*
pipewalk(Chan *c, Chan *nc, char **name, int nname)
{
	Walkqid *wq;
	Pipe *p;

	p = c->aux;
	wq = devwalk(c, nc, name, nname, p->pipedir, nelem(pipedir), pipegen);
	if(wq != nil && wq->clone != nil && wq->clone != c){
		qlock(&p->l);
		p->ref++;
		if(c->flag & COPEN){
			switch(NETTYPE(c->qid.path)){
			case Qdata0:
				p->qref[0]++;
				break;
			case Qdata1:
				p->qref[1]++;
				break;
			}
		}
		qunlock(&p->l);
	}
	return wq;
}
开发者ID:AndreasBriese,项目名称:node9,代码行数:25,代码来源:devpipe.c


示例6: corebootwalk

static Walkqid*
corebootwalk(Chan *c, Chan *nc, char **name, int nname)
{
	Walkqid *wq;

	wq = devwalk(c, nc, name, nname, corebootdir, nelem(corebootdir), devgen);
	/* todo: cover any cases that need locking. There are none yet. */
	return wq;
}
开发者ID:dancrossnyc,项目名称:harvey,代码行数:9,代码来源:devcoreboot.c


示例7: rootwalk

static Walkqid*
rootwalk(Chan *c, Chan *nc, char **name, int nname)
{
	ulong p;

	p = c->qid.path;
	if(nname == 0)
		p = rootdata[p].dotdot;
	return devwalk(c, nc, name, nname, rootdata[p].ptr, rootdata[p].size, rootgen);
}
开发者ID:8l,项目名称:inferno,代码行数:10,代码来源:devroot.c


示例8: srvwalk

static Walkqid*
srvwalk(Chan *c, Chan *nc, char **name, int nname)
{
	Walkqid *wqid;

	qlock(&srvlk);
	wqid = devwalk(c, nc, name, nname, 0, 0, srvgen);
	qunlock(&srvlk);
	return wqid;
}
开发者ID:qioixiy,项目名称:harvey,代码行数:10,代码来源:devsrv.c


示例9: pointerwalk

static Walkqid*
pointerwalk(Chan *c, Chan *nc, char **name, int nname)
{
	Walkqid *wq;

	wq = devwalk(c, nc, name, nname, pointertab, nelem(pointertab), devgen);
	if(wq != nil && wq->clone != c && wq->clone != nil && (ulong)c->qid.path == Qpointer)
		incref(&mouse.ref);	/* can this happen? */
	return wq;
}
开发者ID:8l,项目名称:inferno,代码行数:10,代码来源:devpointer.c


示例10: ipwalk

static Walkqid*
ipwalk(Chan* c, Chan *nc, char **name, int nname)
{
	IPaux *a = c->aux;
	Walkqid* w;

	w = devwalk(c, nc, name, nname, nil, 0, ipgen);
	if(w != nil && w->clone != nil)
		w->clone->aux = newipaux(a->owner, a->tag);
	return w;
}
开发者ID:99years,项目名称:plan9,代码行数:11,代码来源:devip.c


示例11: mousewalk

static Walkqid*
mousewalk(Chan *c, Chan *nc, char **name, int nname)
{
	Walkqid *wq;

	/*
	 * We use devgen() and not mousedevgen() here
	 * see "Ugly problem" in dev.c/devwalk()
	 */
	wq = devwalk(c, nc, name, nname, mousedir, nelem(mousedir), devgen);
	if(wq != nil && wq->clone != c && wq->clone != nil && (wq->clone->qid.type&QTDIR)==0)
		incref(&mouse.ref);
	return wq;
}
开发者ID:0intro,项目名称:vx32,代码行数:14,代码来源:devmouse.c


示例12: printk

static struct walkqid *rootwalk(struct chan *c, struct chan *nc, char **name,
								int nname)
{
	uint32_t p;
	if (0){
		printk("rootwalk: c %p. :", c);
		if (nname){
			int i;
			for (i = 0; i < nname - 1; i++)
				printk("%s/", name[i]);
			printk("%s:\n", name[i]);
		}
	}
	p = c->qid.path;
	printd("Start from #%d at %p\n", p, &roottab[p]);
	return devwalk(c, nc, name, nname, &roottab[p], rootdata[p].size, rootgen);
}
开发者ID:anandab,项目名称:akaros,代码行数:17,代码来源:root.c


示例13: loopbackwalk

static Walkqid*
loopbackwalk(Chan *c, Chan *nc, char **name, int nname)
{
	Walkqid *wq;
	Loop *lb;

	wq = devwalk(c, nc, name, nname, nil, 0, loopbackgen);
	if(wq != nil && wq->clone != nil && wq->clone != c){
		lb = c->aux;
		qlock(lb);
		lb->ref++;
		if((c->flag & COPEN) && TYPE(c->qid.path) == Qdata)
			lb->link[ID(c->qid.path)].ref++;
		qunlock(lb);
	}
	return wq;
}
开发者ID:Nurb432,项目名称:plan9front,代码行数:17,代码来源:devloopback.c


示例14: audiowalk

static Walkqid*
audiowalk(Chan *c, Chan *nc, char **name, int nname)
{
	Audiochan *ac;
	Audio *adev;
	Walkqid *wq;

	ac = c->aux;
	adev = ac->adev;
	wq = devwalk(c, nc, name, nname, audiodir, nelem(audiodir), devgen);
	if(wq && wq->clone){
		if(audioclone(wq->clone, adev) == nil){
			free(wq);
			wq = nil;
		}
	}
	return wq;
}
开发者ID:vrthra,项目名称:9front-tmp,代码行数:18,代码来源:devaudio.c


示例15: cerfwalk

static Walkqid*
cerfwalk(Chan *c, Chan *nc, char **name, int nname)
{
	return devwalk(c, nc, name, nname, cerftab, nelem(cerftab), devgen);
}
开发者ID:8l,项目名称:inferno,代码行数:5,代码来源:devcerf.c


示例16: envwalk

static Walkqid*
envwalk(Chan *c, Chan *nc, char **name, int nname)
{
	return devwalk(c, nc, name, nname, 0, 0, envgen);
}
开发者ID:Requaos,项目名称:harvey,代码行数:5,代码来源:devenv.c


示例17: gpiowalk

Walkqid*
gpiowalk(Chan *c, Chan *nc, char** name, int nname)
{
	return devwalk(c, nc, name, nname, 0, 0, gpiogen);
}
开发者ID:sirnewton01,项目名称:rpi-9front,代码行数:5,代码来源:gpio.c


示例18: uartwalk

static Walkqid*
uartwalk(Chan *c, Chan *nc, char **name, int nname)
{
	return devwalk(c, nc, name, nname, uartdir, uartndir, devgen);
}
开发者ID:dancrossnyc,项目名称:harvey,代码行数:5,代码来源:devuart.c


示例19: archwalk

Walkqid*
archwalk(Chan* c, Chan *nc, char** name, int nname)
{
	return devwalk(c, nc, name, nname, archdir, narchdir, devgen);
}
开发者ID:enockseth,项目名称:Plan-9,代码行数:5,代码来源:devarch.c


示例20: vconwalk

Walkqid*
vconwalk(Chan* c, Chan *nc, char** name, int nname)
{
	return devwalk(c, nc, name, nname, (Dirtab *)0, 0, vcongen);
}
开发者ID:dancrossnyc,项目名称:harvey,代码行数:5,代码来源:devvcon.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ df函数代码示例发布时间:2022-05-30
下一篇:
C++ devtag_get_device函数代码示例发布时间: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