16 #include "heap_priv.h"
19 #include <drizzled/error_t.h>
26 int heap_rprev(
HP_INFO *info,
unsigned char *record)
31 if (info->lastinx < 0)
32 return(errno=HA_ERR_WRONG_INDEX);
34 if (info->current_ptr || (info->update & HA_STATE_NEXT_FOUND))
36 if ((info->update & HA_STATE_DELETED))
37 pos= hp_search(info, share->keydef + info->lastinx, &info->lastkey[0], 3);
39 pos= hp_search(info, share->keydef + info->lastinx, &info->lastkey[0], 2);
44 errno=HA_ERR_KEY_NOT_FOUND;
49 info->update=HA_STATE_PREV_FOUND;
50 if (errno == HA_ERR_KEY_NOT_FOUND)
51 errno=HA_ERR_END_OF_FILE;
54 hp_extract_record(share, record, pos);
55 info->update=HA_STATE_AKTIV | HA_STATE_PREV_FOUND;
TODO: Rename this file - func.h is stupid.