![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
i can't seem to make stat work for me. i can use stat_print and it gives me the correct number of records in the db, and after inspecting the source for stat_print i can't work out what's going wrong. .... #define DC(ex) do{I RV=(ex);if((RV))printf("DC:%d, %s\n",RV,db_strerror(RV));\ assert(!(RV));}while(0) #define DCL(fn,args...) DC(db->fn(db,##args)) .... stat() {DCL(sync,0); DCL(stat_print,0); DB_BTREE_STAT sp; DCL(stat,0,&sp,0); printf("\nnkeys: %lu\n\n",(u_long)sp.bt_nkeys); } main() {create(); I i;for(i=0;i<4;i++)add(&i,sizeof(I)); stat(); } |
![]() |
| Thread Tools | |
| Display Modes | |
| |