anchor.diff:  %%      The key is expected to be the first element of Entry.
   -spec put(DB::db(), Entry::entry()) -> db().
   put({DB, _DBName} = State, Entry) ->
  -	ok = hanoidb:put(DB, ?IN(element(1, Entry)), ?IN(Entry)	),
  -	State.
  +    ok = hanoidb:put(DB, ?IN(element(1, Entry)), ?IN(Entry)    ),
  +    State.
   
   %% @doc Returns the entry that corresponds to Key or {} if no such tuple exists.
   -spec get(DB::db(), Key::key()) -> entry() | {}.
   get({DB, _DBName}, Key) ->
  -	case hanoidb:get(DB, ?IN(Key)) of
  -        not_found	-> {};
  -        {ok, Entry}	-> ?OUT(Entry)
  -	end.
  +    case hanoidb:get(DB, ?IN(Key)) of
  +        not_found    -> {};
  +        {ok, Entry}    -> ?OUT(Entry)
  +    end.
   
   %% @doc Deletes the tuple saved under Key and returns the new DB.
   %%      If such a tuple does not exists nothing is changed.
  
positive.code: 
  %% @author Pierre M.
  %% @author Jan Skrzypczak <skrzypczak@zib.de>
  %% @doc	DB back-end using HanoiDB.
  %%		HanoiDB is a memory-cached disk backend.
  %%		As disks are large (TB) HanoiDB can hold data much larger than RAM (GB).
  %%		As disks persist data HanoiDB can be stoped and restarted without data loss.
  %%		It is a pure Erlang implementation of Google's LevelDB disk-backed K/V store.
  %%		See http://code.google.com/p/leveldb/ for background about storage levels.
  %%		How to use scalaris with this hanoidb backend:
  %%		-download https://github.com/krestenkrab/hanoidb and compile HanoiDB
  %%		-make sure this db_hanoidb.erl file is in src/ (right with db_ets.erl)
  %%		-rerun scalaris' configure with --enable-hanoidb
  %%			./configure --enable-hanoidb=/path/to/hanoidb
  %%		-rerun make to rebuild scalaris and run tests
  %%			./make
  %%			./make test
  %%		-enjoy
  %%		Two keys K and L are considered equal if they match, i.e. K =:= L
  %%		Made after v0.6.1 svn rev 5666.
  %% @end
  -module(db_hanoidb).
  
  
negative.code: %% @private get_all_keys/3 retrieves all keys in DB that fall into Interval but
  %%          not more than MaxNum. If MaxNum == -1 all Keys are retrieved. If
  %%          MaxNum is positive it starts from the left in term order.
  -spec get_all_keys(pid(), db_backend_beh:interval(), -1 | non_neg_integer())
          -> [key()].
  get_all_keys(DB, Interval, MaxNum) ->
      % TODO evaluate converting scalaris:Intervals to hanoidb:ranges
      % in order to leverage hanoidb:fold rather than get_all_keys+lists:fold.
      
      Keys = hanoidb:fold(DB, fun(Key, _Entry, AccIn) -> [?OUT(Key) | AccIn] end, []),
      
      {_, In} = lists:foldl(fun 
                               (_, {0, _} = AccIn) ->
                                    AccIn;
                               (Key, {Max, KeyAcc} = AccIn) ->
                                    case is_in(Interval, Key) of
                                        true ->
                                            {Max - 1, [Key | KeyAcc]};
                                        _ ->
                                            AccIn
                                    end
                            end, {MaxNum, []}, lists:sort(Keys)),
      In.
  
  is_in({Key}, OtherKey) -> Key =:= OtherKey;
  