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

📄 batmtime.c

📁 一个内存数据库的源代码这是服务器端还有客户端
💻 C
📖 第 1 页 / 共 3 页
字号:
	bit *a;	size_t xx;	prepareOperand(left,l,"batcalc.>=");	prepareResult(bn,left,TYPE_bit,"batcalc.>=");	if( BUNsize(left) != sizeof(daytime))		throw(MAL, "batmtime.GE","Unexpected input type");	p = BUNtail(left,BUNfirst(left));	q = BUNtail(left,BUNlast(left));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	while(p<q) {		MTIMEdaytime_GE(a++, (daytime*)p, cst);		p+= xx;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}#line 189 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"#line 206 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"#line 184 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"#line 113 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"str MTIMEdatebat_EQ(int *ret, int *l, int *r){   BAT *bn, *left, *right;	BUN o,p,q;	bit *a;	size_t xx,yy;	prepareOperand2(left,l,right,r,"batcalc.==");	#line 105 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	if( BATcount(left) != BATcount(right) )	throw(MAL, "batcalc.CMDcomparedate", "requires bats of identical size");#line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	prepareResult2(bn,left,right,TYPE_bit,"batcalc.==");	if( BUNsize(left) != sizeof(date) || BUNsize(right)!= sizeof(date) ){		BBPreleaseref(right->batCacheid);		BBPreleaseref(left->batCacheid);		BBPreleaseref(bn->batCacheid);		throw(MAL, "batmtime.EQ","Unexpected input type");	}	o = BUNtail(left,BUNfirst(left));	p = BUNtail(right,BUNfirst(right));	q = BUNtail(right,BUNlast(right));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	yy= BUNsize(right);	while(p<q) {		MTIMEdate_EQ(a++, (date*)o, (date*)p);		o+= xx;		p+= yy;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	BBPreleaseref(right->batCacheid);	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}str MTIMEdatebat_EQcst(int *ret, int *l, date *cst){   BAT *bn, *left;	BUN p,q;	bit *a;	size_t xx;	prepareOperand(left,l,"batcalc.==");	prepareResult(bn,left,TYPE_bit,"batcalc.==");	if( BUNsize(left) != sizeof(date))		throw(MAL, "batmtime.EQ","Unexpected input type");	p = BUNtail(left,BUNfirst(left));	q = BUNtail(left,BUNlast(left));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	while(p<q) {		MTIMEdate_EQ(a++, (date*)p, cst);		p+= xx;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}#line 184 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"#line 113 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"str MTIMEdatebat_NEQ(int *ret, int *l, int *r){   BAT *bn, *left, *right;	BUN o,p,q;	bit *a;	size_t xx,yy;	prepareOperand2(left,l,right,r,"batcalc.!=");	#line 105 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	if( BATcount(left) != BATcount(right) )	throw(MAL, "batcalc.CMDcomparedate", "requires bats of identical size");#line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	prepareResult2(bn,left,right,TYPE_bit,"batcalc.!=");	if( BUNsize(left) != sizeof(date) || BUNsize(right)!= sizeof(date) ){		BBPreleaseref(right->batCacheid);		BBPreleaseref(left->batCacheid);		BBPreleaseref(bn->batCacheid);		throw(MAL, "batmtime.NEQ","Unexpected input type");	}	o = BUNtail(left,BUNfirst(left));	p = BUNtail(right,BUNfirst(right));	q = BUNtail(right,BUNlast(right));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	yy= BUNsize(right);	while(p<q) {		MTIMEdate_NEQ(a++, (date*)o, (date*)p);		o+= xx;		p+= yy;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	BBPreleaseref(right->batCacheid);	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}str MTIMEdatebat_NEQcst(int *ret, int *l, date *cst){   BAT *bn, *left;	BUN p,q;	bit *a;	size_t xx;	prepareOperand(left,l,"batcalc.!=");	prepareResult(bn,left,TYPE_bit,"batcalc.!=");	if( BUNsize(left) != sizeof(date))		throw(MAL, "batmtime.NEQ","Unexpected input type");	p = BUNtail(left,BUNfirst(left));	q = BUNtail(left,BUNlast(left));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	while(p<q) {		MTIMEdate_NEQ(a++, (date*)p, cst);		p+= xx;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}#line 185 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"#line 113 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"str MTIMEdatebat_LT(int *ret, int *l, int *r){   BAT *bn, *left, *right;	BUN o,p,q;	bit *a;	size_t xx,yy;	prepareOperand2(left,l,right,r,"batcalc.<");	#line 105 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	if( BATcount(left) != BATcount(right) )	throw(MAL, "batcalc.CMDcomparedate", "requires bats of identical size");#line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	prepareResult2(bn,left,right,TYPE_bit,"batcalc.<");	if( BUNsize(left) != sizeof(date) || BUNsize(right)!= sizeof(date) ){		BBPreleaseref(right->batCacheid);		BBPreleaseref(left->batCacheid);		BBPreleaseref(bn->batCacheid);		throw(MAL, "batmtime.LT","Unexpected input type");	}	o = BUNtail(left,BUNfirst(left));	p = BUNtail(right,BUNfirst(right));	q = BUNtail(right,BUNlast(right));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	yy= BUNsize(right);	while(p<q) {		MTIMEdate_LT(a++, (date*)o, (date*)p);		o+= xx;		p+= yy;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	BBPreleaseref(right->batCacheid);	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}str MTIMEdatebat_LTcst(int *ret, int *l, date *cst){   BAT *bn, *left;	BUN p,q;	bit *a;	size_t xx;	prepareOperand(left,l,"batcalc.<");	prepareResult(bn,left,TYPE_bit,"batcalc.<");	if( BUNsize(left) != sizeof(date))		throw(MAL, "batmtime.LT","Unexpected input type");	p = BUNtail(left,BUNfirst(left));	q = BUNtail(left,BUNlast(left));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	while(p<q) {		MTIMEdate_LT(a++, (date*)p, cst);		p+= xx;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}#line 186 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"#line 113 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"str MTIMEdatebat_LE(int *ret, int *l, int *r){   BAT *bn, *left, *right;	BUN o,p,q;	bit *a;	size_t xx,yy;	prepareOperand2(left,l,right,r,"batcalc.<=");	#line 105 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	if( BATcount(left) != BATcount(right) )	throw(MAL, "batcalc.CMDcomparedate", "requires bats of identical size");#line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	prepareResult2(bn,left,right,TYPE_bit,"batcalc.<=");	if( BUNsize(left) != sizeof(date) || BUNsize(right)!= sizeof(date) ){		BBPreleaseref(right->batCacheid);		BBPreleaseref(left->batCacheid);		BBPreleaseref(bn->batCacheid);		throw(MAL, "batmtime.LE","Unexpected input type");	}	o = BUNtail(left,BUNfirst(left));	p = BUNtail(right,BUNfirst(right));	q = BUNtail(right,BUNlast(right));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	yy= BUNsize(right);	while(p<q) {		MTIMEdate_LE(a++, (date*)o, (date*)p);		o+= xx;		p+= yy;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	BBPreleaseref(right->batCacheid);	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}str MTIMEdatebat_LEcst(int *ret, int *l, date *cst){   BAT *bn, *left;	BUN p,q;	bit *a;	size_t xx;	prepareOperand(left,l,"batcalc.<=");	prepareResult(bn,left,TYPE_bit,"batcalc.<=");	if( BUNsize(left) != sizeof(date))		throw(MAL, "batmtime.LE","Unexpected input type");	p = BUNtail(left,BUNfirst(left));	q = BUNtail(left,BUNlast(left));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	while(p<q) {		MTIMEdate_LE(a++, (date*)p, cst);		p+= xx;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}#line 187 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"#line 113 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"str MTIMEdatebat_GT(int *ret, int *l, int *r){   BAT *bn, *left, *right;	BUN o,p,q;	bit *a;	size_t xx,yy;	prepareOperand2(left,l,right,r,"batcalc.>");	#line 105 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	if( BATcount(left) != BATcount(right) )	throw(MAL, "batcalc.CMDcomparedate", "requires bats of identical size");#line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	prepareResult2(bn,left,right,TYPE_bit,"batcalc.>");	if( BUNsize(left) != sizeof(date) || BUNsize(right)!= sizeof(date) ){		BBPreleaseref(right->batCacheid);		BBPreleaseref(left->batCacheid);		BBPreleaseref(bn->batCacheid);		throw(MAL, "batmtime.GT","Unexpected input type");	}	o = BUNtail(left,BUNfirst(left));	p = BUNtail(right,BUNfirst(right));	q = BUNtail(right,BUNlast(right));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	yy= BUNsize(right);	while(p<q) {		MTIMEdate_GT(a++, (date*)o, (date*)p);		o+= xx;		p+= yy;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	BBPreleaseref(right->batCacheid);	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}str MTIMEdatebat_GTcst(int *ret, int *l, date *cst){   BAT *bn, *left;	BUN p,q;	bit *a;	size_t xx;	prepareOperand(left,l,"batcalc.>");	prepareResult(bn,left,TYPE_bit,"batcalc.>");	if( BUNsize(left) != sizeof(date))		throw(MAL, "batmtime.GT","Unexpected input type");	p = BUNtail(left,BUNfirst(left));	q = BUNtail(left,BUNlast(left));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	while(p<q) {		MTIMEdate_GT(a++, (date*)p, cst);		p+= xx;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}#line 188 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"#line 113 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"str MTIMEdatebat_GE(int *ret, int *l, int *r){   BAT *bn, *left, *right;	BUN o,p,q;	bit *a;	size_t xx,yy;	prepareOperand2(left,l,right,r,"batcalc.>=");	#line 105 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	if( BATcount(left) != BATcount(right) )	throw(MAL, "batcalc.CMDcomparedate", "requires bats of identical size");#line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmtime.mx"	prepareResult2(bn,left,right,TYPE_bit,"batcalc.>=");	if( BUNsize(left) != sizeof(date) || BUNsize(right)!= sizeof(date) ){		BBPreleaseref(right->batCacheid);		BBPreleaseref(left->batCacheid);		BBPreleaseref(bn->batCacheid);		throw(MAL, "batmtime.GE","Unexpected input type");	}	o = BUNtail(left,BUNfirst(left));	p = BUNtail(right,BUNfirst(right));	q = BUNtail(right,BUNlast(right));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	yy= BUNsize(right);	while(p<q) {		MTIMEdate_GE(a++, (date*)o, (date*)p);		o+= xx;		p+= yy;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;	BBPreleaseref(right->batCacheid);	finalizeResult(ret,bn,left);	return MAL_SUCCEED;}str MTIMEdatebat_GEcst(int *ret, int *l, date *cst){   BAT *bn, *left;	BUN p,q;	bit *a;	size_t xx;	prepareOperand(left,l,"batcalc.>=");	prepareResult(bn,left,TYPE_bit,"batcalc.>=");	if( BUNsize(left) != sizeof(date))		throw(MAL, "batmtime.GE","Unexpected input type");	p = BUNtail(left,BUNfirst(left));	q = BUNtail(left,BUNlast(left));	a = (bit*)BUNtail(bn, BUNfirst(bn));	xx= BUNsize(left);	while(p<q) {		MTIMEdate_GE(a++, (date*)p, cst);		p+= xx;	}	BATsetcount(bn, BATcount(left)); 	bn->batBuns->free = ((char *)a) - bn->batBuns->base;

⌨️ 快捷键说明

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