252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
static void fn_ovalue(sqlite3_context*cxt,int argc,sqlite3_value**argv) {
Uint32 a;
if(sqlite3_value_type(*argv)==SQLITE_NULL) {
sqlite3_result_int(cxt,0);
return;
}
a=sqlite3_value_int64(*argv)&0xFFFFFFFF;
if(a>=nobjects || !objects[a] || (objects[a]->dir&IOF_DEAD)) return; // result is null if object does not exist
sqlite3_result_int64(cxt,a|((sqlite3_int64)objects[a]->generation<<32));
}
static void fn_pfsize(sqlite3_context*cxt,int argc,sqlite3_value**argv) {
sqlite3_result_int(cxt,*(Uint8*)sqlite3_user_data(cxt));
}
|
|
|
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
static void fn_ovalue(sqlite3_context*cxt,int argc,sqlite3_value**argv) {
Uint32 a;
if(sqlite3_value_type(*argv)==SQLITE_NULL) {
sqlite3_result_int(cxt,0);
return;
}
a=sqlite3_value_int64(*argv)&0xFFFFFFFF;
if(a>=nobjects || !objects[a] || !objects[a]->generation) return; // result is null if object does not exist
sqlite3_result_int64(cxt,a|((sqlite3_int64)objects[a]->generation<<32));
}
static void fn_pfsize(sqlite3_context*cxt,int argc,sqlite3_value**argv) {
sqlite3_result_int(cxt,*(Uint8*)sqlite3_user_data(cxt));
}
|
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
|
}
goto atxy;
}
} else {
// This shouldn't happen
return SQLITE_INTERNAL;
}
if(!cur->eof && (objects[cur->rowid]->dir&IOF_DEAD)) goto again;
return SQLITE_OK;
}
static int vt1_objects_filter(sqlite3_vtab_cursor*pcur,int idxNum,const char*idxStr,int argc,sqlite3_value**argv) {
Cursor*cur=(void*)pcur;
int i;
Uint32 t;
|
|
|
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
|
}
goto atxy;
}
} else {
// This shouldn't happen
return SQLITE_INTERNAL;
}
if(!cur->eof && !objects[cur->rowid]->generation) goto again;
return SQLITE_OK;
}
static int vt1_objects_filter(sqlite3_vtab_cursor*pcur,int idxNum,const char*idxStr,int argc,sqlite3_value**argv) {
Cursor*cur=(void*)pcur;
int i;
Uint32 t;
|