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

📄 const.c

📁 一个内存数据库的源代码这是服务器端还有客户端
💻 C
字号:
#line 136 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"#include "mal_config.h"#include "const.h"strCSTprelude(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	Box box;	(void) mb;	(void) stk;	(void) pci;		/* fool compiler */	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.prelude", tmp, AUTHrequireAdmin());	}#line 148 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	box = openBox("const");	if (box == 0)		throw(MAL, "const.prelude", "failed to open box");	/* if the box was already filled we can skip initialization */	if (box->sym->vtop == 0) {		char u[24 + 1];		snprintf(u, 24, OIDFMT, MCgetClient()->user);		u[24] = '\0';		insertToBox(box, "user", u);		insertToBox(box, "dbname", GDKgetenv("gdk_dbname"));		insertToBox(box, "dbfarm", GDKgetenv("gdk_dbfarm"));		insertToBox(box, "version", GDKgetenv("gdk_version"));		insertToBox(box, "config", GDKgetenv("gdk_config"));		/* old bat.mx and algebra.mx constants */	}	return MAL_SUCCEED;}strCSTepilogue(int *ret){	(void)ret;	closeBox("const", 0);	return MAL_SUCCEED;}#line 177 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"strCSTopen(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	(void) mb;	(void) stk;	(void) pci;		/* fool compiler */	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.open", tmp, AUTHrequireAdmin());	}#line 183 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	if (openBox("const") != 0)		return MAL_SUCCEED;	throw(MAL, "const.open", "failed to open box");}strCSTclose(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	(void) mb;	(void) stk;	(void) pci;		/* fool compiler */	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.close", tmp, AUTHrequireAdmin());	}#line 195 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	if (closeBox("const", TRUE) == 0)		return MAL_SUCCEED;	throw(MAL, "const.close", "failed to close box");}strCSTdestroy(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	Box box;	(void) mb;	(void) stk;	(void) pci;		/* fool compiler */	#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.destroy", tmp, AUTHrequireAdmin());	}#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	box= findBox("const");	if( box ==0) 	throw(MAL, "const.destroy","box is not open");#line 209 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	destroyBox("const");	return MAL_SUCCEED;}#line 224 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"strCSTdeposit(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	str name;	ValPtr v;	Box box;	#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.deposit", tmp, AUTHrequireAdmin());	}#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	box= findBox("const");	if( box ==0) 	throw(MAL, "const.deposit","box is not open");#line 231 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	name = (str) getArgValue(stk, pci, 1);	v = &stk->stk[getArg(pci, 2)];	if (depositBox(box, name, v))		throw(MAL, "const.deposit", "failed to deposit into box");	(void) mb;	return MAL_SUCCEED;}strCSTtake(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	str name;	Box box;	ValPtr v;	#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.take", tmp, AUTHrequireAdmin());	}#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	box= findBox("const");	if( box ==0) 	throw(MAL, "const.take","box is not open");#line 247 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	name = (str) getArgValue(stk, pci, 1);	v = &stk->stk[getArg(pci, 0)];	if (takeBox(box, name, v, (int) getArgType(mb, pci, 0)))		throw(MAL, "const.take", "failed to take object from box");	(void) mb;	return MAL_SUCCEED;}strCSTrelease(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	str name;	Box box;	(void) mb;		/* fool compiler */	#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.release", tmp, AUTHrequireAdmin());	}#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	box= findBox("const");	if( box ==0) 	throw(MAL, "const.release","box is not open");#line 264 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	name = (str) getArgValue(stk, pci, 1);	if (releaseBox(box, name))		throw(MAL, "const.release", "failed to release object from box");	return MAL_SUCCEED;}strCSTreleaseAll(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	Box box;	(void) mb;	(void) stk;	(void) pci;		/* fool compiler */	#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.release", tmp, AUTHrequireAdmin());	}#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	box= findBox("const");	if( box ==0) 	throw(MAL, "const.release","box is not open");#line 279 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	releaseAllBox(box);	return MAL_SUCCEED;}strCSTdiscard(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	str name;	Box box;	(void) mb;		/* fool compiler */	#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.discard", tmp, AUTHrequireAdmin());	}#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	box= findBox("const");	if( box ==0) 	throw(MAL, "const.discard","box is not open");#line 291 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	name = (str) getArgValue(stk, pci, 1);	if (discardBox(box, name) == 0)		throw(MAL, "const.discard", "failed to discard object from box");	return MAL_SUCCEED;}strCSTtoString(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	Box box;	int i, len = 0;	ValPtr v;	str nme, s = 0;	(void) mb;		/* fool compiler */	#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.toString", tmp, AUTHrequireAdmin());	}#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	box= findBox("const");	if( box ==0) 	throw(MAL, "const.toString","box is not open");#line 307 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	nme = (str) getArgValue(stk, pci, 1);	i = findVariable(box->sym, nme);	if (i < 0)		throw(MAL, "const.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, "const.toString", "illegal value");	VALset(&stk->stk[getArg(pci, 0)], TYPE_str, s);	return MAL_SUCCEED;}strCSTnewIterator(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	Box box;	lng *cursor;	ValPtr v;	(void) mb;		/* fool compiler */	#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.iterator", tmp, AUTHrequireAdmin());	}#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	box= findBox("const");	if( box ==0) 	throw(MAL, "const.iterator","box is not open");#line 332 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	cursor = (lng *) getArgValue(stk, pci, 0);	v = &stk->stk[getArg(pci, 1)];	nextBoxElement(box, cursor, v);	return MAL_SUCCEED;}strCSThasMoreElements(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){	Box box;	lng *cursor;	ValPtr v;	(void) mb;		/* fool compiler */	#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	{		str tmp = NULL;		rethrow("const.iterator", tmp, AUTHrequireAdmin());	}#line 218 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	box= findBox("const");	if( box ==0) 	throw(MAL, "const.iterator","box is not open");#line 347 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"	cursor = (lng *) getArgValue(stk, pci, 0);	v = &stk->stk[getArg(pci, 1)];	nextBoxElement(box, cursor, v);	return MAL_SUCCEED;}#line 355 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/const.mx"

⌨️ 快捷键说明

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