⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 urlbox.c

📁 一个内存数据库的源代码这是服务器端还有客户端
💻 C
📖 第 1 页 / 共 2 页
字号:
		rethrow("urlBox.release", tmp, AUTHrequireAdmin());	}#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	box= findBox("urlbox");	if( box ==0) 	throw(MAL, "urlbox.release","box is not open");#line 396 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	name = (str) getArgValue(stk, pci, 1);	if (releaseBox(box, name))		throw(MAL, "urlbox.release", "failed to release object from box");	return MAL_SUCCEED;}strURLBOXreleaseAll(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	Box box;	(void) mb;	(void) stk;	(void) pci;		/* fool compiler */	#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	#line 134 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	{		str tmp = NULL;		rethrow("urlBox.release", tmp, AUTHrequireAdmin());	}#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	box= findBox("urlbox");	if( box ==0) 	throw(MAL, "urlbox.release","box is not open");#line 411 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	releaseAllBox(box);	return MAL_SUCCEED;}strURLBOXdiscard(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	str name;	Box box;	(void) mb;		/* fool compiler */	#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	#line 134 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	{		str tmp = NULL;		rethrow("urlBox.discard", tmp, AUTHrequireAdmin());	}#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	box= findBox("urlbox");	if( box ==0) 	throw(MAL, "urlbox.discard","box is not open");#line 423 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	name = (str) getArgValue(stk, pci, 1);	if (discardBox(box, name) == 0)		throw(MAL, "urlbox.discard", "failed to discard object from box");	return MAL_SUCCEED;}strURLBOXdiscardOid(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	str name;	Box box;	(void) mb;		/* fool compiler */	#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	#line 134 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	{		str tmp = NULL;		rethrow("urlBox.discard", tmp, AUTHrequireAdmin());	}#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	box= findBox("urlbox");	if( box ==0) 	throw(MAL, "urlbox.discard","box is not open");#line 436 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	name = (str) getArgValue(stk, pci, 1);	if (discardBox(box, name) == 0)		throw(MAL, "urlbox.discard", "failed to discard object from box");	return MAL_SUCCEED;}strURLBOXdiscardAll(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	str name;	Box box;	(void) mb;		/* fool compiler */	#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	#line 134 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	{		str tmp = NULL;		rethrow("urlBox.discard", tmp, AUTHrequireAdmin());	}#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	box= findBox("urlbox");	if( box ==0) 	throw(MAL, "urlbox.discard","box is not open");#line 449 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	name = (str) getArgValue(stk, pci, 1);	if (discardBox(box, name) == 0)		throw(MAL, "urlbox.discard", "failed to discard object from box");	return MAL_SUCCEED;}strURLBOXtoString(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	Box box;	int i, len = 0;	ValPtr v;	str nme, s = 0;	(void) mb;		/* fool compiler */	#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	#line 134 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	{		str tmp = NULL;		rethrow("urlBox.toString", tmp, AUTHrequireAdmin());	}#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	box= findBox("urlbox");	if( box ==0) 	throw(MAL, "urlbox.toString","box is not open");#line 465 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	nme = (str) getArgValue(stk, pci, 1);	i = findVariable(box->sym, nme);	if (i < 0)		throw(MAL, "urlbox.toString", "failed to take object from box");	v = &box->val->stk[i];	if (v->vtype == TYPE_str)		s = v->val.sval;	else		(*BATatoms[v->vtype].atomToStr) (&s, &len, v);	if (s == NULL)		throw(MAL, "urlbox.toString", "illegal value");	VALset(&stk->stk[getArg(pci, 0)], TYPE_str, s);	return MAL_SUCCEED;}strURLBOXnewIterator(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	Box box;	lng *cursor;	ValPtr v;	(void) mb;		/* fool compiler */	#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	#line 134 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	{		str tmp = NULL;		rethrow("urlBox.iterator", tmp, AUTHrequireAdmin());	}#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	box= findBox("urlbox");	if( box ==0) 	throw(MAL, "urlbox.iterator","box is not open");#line 490 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	cursor = (lng *) getArgValue(stk, pci, 0);	v = &stk->stk[getArg(pci, 1)];	nextBoxElement(box, cursor, v);	return MAL_SUCCEED;}strURLBOXhasMoreElements(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	Box box;	lng *cursor;	ValPtr v;	(void) mb;		/* fool compiler */	#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	#line 134 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	{		str tmp = NULL;		rethrow("urlBox.iterator", tmp, AUTHrequireAdmin());	}#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	box= findBox("urlbox");	if( box ==0) 	throw(MAL, "urlbox.iterator","box is not open");#line 505 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"	cursor = (lng *) getArgValue(stk, pci, 0);	v = &stk->stk[getArg(pci, 1)];	nextBoxElement(box, cursor, v);	return MAL_SUCCEED;}strURLBOXgetLevel(int *r, int *level){	if( *level < 0 || *level >= urlDepth)		throw(MAL, "urlbox.getLevel","Illegal level");	*r = urlBAT[*level]->batCacheid;	BBPincref(*r,TRUE);	return MAL_SUCCEED;}strURLBOXgetNames(int *r){	BAT *b;	int i;	b= BATnew(TYPE_int,TYPE_str, urlDepth+1);	if( b== NULL)		throw(MAL, "urlbox.getNames","Could not create table");	for(i=0; i<urlDepth; i++){		BUNins(b,&i, BBPname(urlBAT[i]->batCacheid), FALSE);	}	*r = b->batCacheid;	BBPkeepref(*r);	return MAL_SUCCEED;}strURLBOXgetCount(int *r){	BAT *b;	int i;	lng cnt;	b= BATnew(TYPE_int,TYPE_lng, urlDepth+1);	if( b== NULL)		throw(MAL, "urlbox.getNames","Could not create table");	for(i=0; i<urlDepth; i++){		cnt = (lng) BATcount(urlBAT[i]);		BUNins(b,&i, &cnt, FALSE);	}	*r = b->batCacheid;	BBPkeepref(*r);	return MAL_SUCCEED;}strURLBOXgetCardinality(int *r){	BAT *b, *bn;	int i;	lng cnt;	b= BATnew(TYPE_int,TYPE_lng, urlDepth+1);	if( b== NULL)		throw(MAL, "urlbox.getNames","Could not create table");	for(i=0; i<urlDepth; i++){		bn = (BAT *) BATkunique(BATmirror(urlBAT[i]));		cnt = (lng) BATcount(bn);		BBPunfix(bn->batCacheid);		BUNins(b,&i, &cnt, FALSE);	}	*r = b->batCacheid;	BBPkeepref(*r);	return MAL_SUCCEED;}/* #define ROUND_UP(x,y) ((y)*(((x)+(y)-1)/(y)))*/#define ROUND_UP(x,y) (x)strURLBOXgetSize(int *r){	BAT *b, *bn;	int i;	lng tot;	size_t size;	b= BATnew(TYPE_int,TYPE_lng, urlDepth+1);	if( b== NULL)		throw(MAL, "urlbox.getNames","Could not create table");	for(i=0; i<urlDepth; i++){		bn= urlBAT[i];		size = ROUND_UP(sizeof(BATstore), blksize);		if (!VIEWparent(bn)) {			size_t cnt = BATcapacity(bn);			size += ROUND_UP(bn->batBuns->size, blksize);			if (b->hheap)				size += ROUND_UP(bn->hheap->size, blksize);			if (b->theap)				size += ROUND_UP(bn->theap->size, blksize);			if (bn->hhash)				size += ROUND_UP(sizeof(hash_t) * cnt, blksize);			if (bn->thash)				size += ROUND_UP(sizeof(hash_t) * cnt, blksize);		}		tot = size;		BBPunfix(bn->batCacheid);		BUNins(b,&i, &tot, FALSE);	}	*r = b->batCacheid;	BBPkeepref(*r);	return MAL_SUCCEED;}#line 610 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/urlbox.mx"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -