2004-10-06 06:08:09 +00:00
|
|
|
#include "../page.h"
|
|
|
|
|
2007-10-02 00:18:33 +00:00
|
|
|
#ifndef __FIXED_H
|
2004-10-06 06:08:09 +00:00
|
|
|
#define __FIXED_H
|
2007-10-02 00:18:33 +00:00
|
|
|
/**
|
|
|
|
@todo rename fixed.h macros turn them into static inline functions.
|
|
|
|
*/
|
|
|
|
#define recordsize_ptr(page) stasis_page_int16_ptr_from_end((page), 1)
|
|
|
|
#define recordsize_cptr(page) stasis_page_int16_cptr_from_end((page), 1)
|
|
|
|
#define recordcount_ptr(page) stasis_page_int16_ptr_from_end((page), 2)
|
|
|
|
#define fixed_record_ptr(page, n) stasis_page_byte_ptr_from_start((page), *recordsize_ptr((page)) * (n))
|
2004-10-06 06:08:09 +00:00
|
|
|
|
2007-08-20 16:53:16 +00:00
|
|
|
static inline recordid fixedNext(int xid, Page *p, recordid rid) {
|
|
|
|
short n = *recordcount_ptr(p);
|
|
|
|
rid.slot++;
|
|
|
|
rid.size = *recordsize_ptr(p);
|
|
|
|
if(rid.slot >= n) {
|
|
|
|
return NULLRID;
|
|
|
|
} else {
|
|
|
|
return rid;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static inline recordid fixedFirst(int xid, Page *p) {
|
|
|
|
recordid rid = { p->id, -1, 0 };
|
|
|
|
rid.size = *recordsize_ptr(p);
|
|
|
|
return fixedNext(xid, p, rid);
|
|
|
|
}
|
|
|
|
|
2007-06-07 21:53:09 +00:00
|
|
|
void fixedPageInit();
|
|
|
|
void fixedPageDeinit();
|
|
|
|
page_impl fixedImpl();
|
|
|
|
page_impl arrayListImpl();
|
2007-08-14 01:17:31 +00:00
|
|
|
// @todo move lsmTreeImpl() to lsmTree.h (but first, move page.h...)
|
|
|
|
page_impl lsmRootImpl();
|
2004-10-06 06:08:09 +00:00
|
|
|
#endif
|