📄 batcast.c
字号:
#line 260 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"#include "mal_config.h"#include "batcast.h"int oidToStr(char **dst, int *len, oid *src ){ return OIDtoStr(dst,len, src);} #line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"batcast_export str CMDconvert_bit(int *ret, int *bid);str CMDconvert_bit(int *ret, int *bid){ BAT *b, *bn; #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if( ( b= BATdescriptor(*bid)) == NULL ){ ; throw(MAL, "batcalc.bit", "cannot access descriptor"); }#line 123 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" bn= BATcopy(b, b->htype, b->ttype, 2); #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"if( bn== NULL) {*ret= 0; throw(MAL, "batcalc.bit", "can not create bat");}#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" *ret= bn->batCacheid; BBPkeepref(*ret); BBPreleaseref(b->batCacheid); return MAL_SUCCEED;}#line 266 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" #line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"batcast_export str CMDconvert_chr(int *ret, int *bid);str CMDconvert_chr(int *ret, int *bid){ BAT *b, *bn; #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if( ( b= BATdescriptor(*bid)) == NULL ){ ; throw(MAL, "batcalc.chr", "cannot access descriptor"); }#line 123 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" bn= BATcopy(b, b->htype, b->ttype, 2); #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"if( bn== NULL) {*ret= 0; throw(MAL, "batcalc.chr", "can not create bat");}#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" *ret= bn->batCacheid; BBPkeepref(*ret); BBPreleaseref(b->batCacheid); return MAL_SUCCEED;}#line 267 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" #line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"batcast_export str CMDconvert_sht(int *ret, int *bid);str CMDconvert_sht(int *ret, int *bid){ BAT *b, *bn; #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if( ( b= BATdescriptor(*bid)) == NULL ){ ; throw(MAL, "batcalc.sht", "cannot access descriptor"); }#line 123 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" bn= BATcopy(b, b->htype, b->ttype, 2); #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"if( bn== NULL) {*ret= 0; throw(MAL, "batcalc.sht", "can not create bat");}#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" *ret= bn->batCacheid; BBPkeepref(*ret); BBPreleaseref(b->batCacheid); return MAL_SUCCEED;}#line 268 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" #line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"batcast_export str CMDconvert_int(int *ret, int *bid);str CMDconvert_int(int *ret, int *bid){ BAT *b, *bn; #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if( ( b= BATdescriptor(*bid)) == NULL ){ ; throw(MAL, "batcalc.int", "cannot access descriptor"); }#line 123 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" bn= BATcopy(b, b->htype, b->ttype, 2); #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"if( bn== NULL) {*ret= 0; throw(MAL, "batcalc.int", "can not create bat");}#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" *ret= bn->batCacheid; BBPkeepref(*ret); BBPreleaseref(b->batCacheid); return MAL_SUCCEED;}#line 269 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" #line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"batcast_export str CMDconvert_oid(int *ret, int *bid);str CMDconvert_oid(int *ret, int *bid){ BAT *b, *bn; #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if( ( b= BATdescriptor(*bid)) == NULL ){ ; throw(MAL, "batcalc.oid", "cannot access descriptor"); }#line 123 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" bn= BATcopy(b, b->htype, b->ttype, 2); #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"if( bn== NULL) {*ret= 0; throw(MAL, "batcalc.oid", "can not create bat");}#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" *ret= bn->batCacheid; BBPkeepref(*ret); BBPreleaseref(b->batCacheid); return MAL_SUCCEED;}#line 270 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" #line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"batcast_export str CMDconvert_lng(int *ret, int *bid);str CMDconvert_lng(int *ret, int *bid){ BAT *b, *bn; #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if( ( b= BATdescriptor(*bid)) == NULL ){ ; throw(MAL, "batcalc.lng", "cannot access descriptor"); }#line 123 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" bn= BATcopy(b, b->htype, b->ttype, 2); #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"if( bn== NULL) {*ret= 0; throw(MAL, "batcalc.lng", "can not create bat");}#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" *ret= bn->batCacheid; BBPkeepref(*ret); BBPreleaseref(b->batCacheid); return MAL_SUCCEED;}#line 271 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" #line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"batcast_export str CMDconvert_flt(int *ret, int *bid);str CMDconvert_flt(int *ret, int *bid){ BAT *b, *bn; #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if( ( b= BATdescriptor(*bid)) == NULL ){ ; throw(MAL, "batcalc.flt", "cannot access descriptor"); }#line 123 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" bn= BATcopy(b, b->htype, b->ttype, 2); #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"if( bn== NULL) {*ret= 0; throw(MAL, "batcalc.flt", "can not create bat");}#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" *ret= bn->batCacheid; BBPkeepref(*ret); BBPreleaseref(b->batCacheid); return MAL_SUCCEED;}#line 272 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" #line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"batcast_export str CMDconvert_dbl(int *ret, int *bid);str CMDconvert_dbl(int *ret, int *bid){ BAT *b, *bn; #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if( ( b= BATdescriptor(*bid)) == NULL ){ ; throw(MAL, "batcalc.dbl", "cannot access descriptor"); }#line 123 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" bn= BATcopy(b, b->htype, b->ttype, 2); #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"if( bn== NULL) {*ret= 0; throw(MAL, "batcalc.dbl", "can not create bat");}#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" *ret= bn->batCacheid; BBPkeepref(*ret); BBPreleaseref(b->batCacheid); return MAL_SUCCEED;}#line 273 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" #line 120 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"batcast_export str CMDconvert_str(int *ret, int *bid);str CMDconvert_str(int *ret, int *bid){ BAT *b, *bn; #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if( ( b= BATdescriptor(*bid)) == NULL ){ ; throw(MAL, "batcalc.str", "cannot access descriptor"); }#line 123 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" bn= BATcopy(b, b->htype, b->ttype, 2); #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"if( bn== NULL) {*ret= 0; throw(MAL, "batcalc.str", "can not create bat");}#line 126 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" *ret= bn->batCacheid; BBPkeepref(*ret); BBPreleaseref(b->batCacheid); return MAL_SUCCEED;}#line 274 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" #line 203 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"batcast_export str CMDconvert_bit_str(int *ret, int *bid);str CMDconvert_bit_str(int *ret, int *bid){ BAT *b,*bn; size_t xx; char *p,*q,*h; str dst=0; int len=0; #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if( ( b= BATdescriptor(*bid)) == NULL ){ ; throw(MAL, "batcalc.", "cannot access descriptor"); }#line 211 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if (BAThvoid(b)) { bn = BATnew(TYPE_void, TYPE_str, BATcount(b)); BATseqbase(bn, b->hseqbase); } else bn = BATnew(b->htype, TYPE_str, BATcount(b)); if( bn== NULL) { throw(MAL, "batcalc.", "can not create bat"); } bn->hsorted = b->hsorted; bn->tsorted = b->tsorted;#line 212 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" h= (char*) BUNhead(b,BUNfirst(b)); p= (char*) BUNfirst(b); q= (char*) BUNlast(b); xx= BUNsize(b); while(p<q){ bit *r = (bit*)BUNtail(b,p); #line 193 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" bitToStr(&dst,&len, (ptr) r); bunfastins(bn, h, (ptr)dst); if( dst) GDKfree(dst);#line 220 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" p+=xx; h+= xx; }bunins_failed: #line 133 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ); *ret= bn->batCacheid; BATkey(BATmirror(bn), FALSE); bn->tsorted = 0; BBPkeepref(*ret); BBPreleaseref(b->batCacheid); return MAL_SUCCEED;#line 224 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"}batcast_export str CMDconvert_void_bit_str(int *ret, int *bid);str CMDconvert_void_bit_str(int *ret, int *bid){ return CMDconvert_bit_str(ret,bid);}batcast_export str CMDconvert_str_bit(int *ret, int *bid);str CMDconvert_str_bit(int *ret, int *bid){ BAT *b,*bn; int xx; char *p,*q,*h; ptr v; int len; #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if( ( b= BATdescriptor(*bid)) == NULL ){ ; throw(MAL, "batcalc.bit", "cannot access descriptor"); }#line 239 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" #line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if (BAThvoid(b)) { bn = BATnew(TYPE_void, TYPE_bit, BATcount(b)); BATseqbase(bn, b->hseqbase); } else bn = BATnew(b->htype, TYPE_bit, BATcount(b)); if( bn== NULL) { throw(MAL, "batcalc.bit", "can not create bat"); } bn->hsorted = b->hsorted; bn->tsorted = b->tsorted;#line 240 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" h= (char *) BUNhead(b,BUNfirst(b)); p= (ptr) BUNtloc(b,BUNfirst(b)); q= (char *) BUNtloc(b,BUNlast(b)); xx= BUNsize(b); while(p<q){ #line 197 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" v= NULL; len=0; ATOMfromstr( TYPE_bit, &v, &len, (char*)Tbase(b)+*(var_t*)p); bunfastins(bn, h, v); if(ATOMextern(TYPE_bit) ) GDKfree(v);#line 247 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" p+=xx; h+= xx; }bunins_failed: #line 133 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx" if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ); *ret= bn->batCacheid; BATkey(BATmirror(bn), FALSE); bn->tsorted = 0; BBPkeepref(*ret); BBPreleaseref(b->batCacheid); return MAL_SUCCEED;#line 251 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batcast.mx"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -