/* * converts the within buffer(LARD_PTR) pointer to a system wide pointer */ void * conv_to_ptr(const lardbuffer *b, LARD_PTR ptr) { return (char *)b+HEADER_SIZE+ptr*b->size; } /* * converts a systemwide pointer to somewhere inside the buffer into an LARD_PTR which points locally */ LARD_PTR conv_to_short(const lardbuffer *b, const void * ptr) { return ((char *)ptr-(char *)b-HEADER_SIZE)/b->size; }