anchor.diff:  %% Description: Remove a chunk in the endgame from its assignment to a
   %%   given pid
   %%--------------------------------------------------------------------
  +-spec endgame_remove_chunk(pid(), integer(), {integer(), integer(), integer()}) -> ok.
   endgame_remove_chunk(Pid, Id, {Index, Offset, Len}) ->
       gen_server:call(?SERVER, {endgame_remove_chunk, Pid, Id, {Index, Offset, Len}}).
   
  -%% Description: Return some chunks for downloading.
  -%%
  -%%   This function is relying on tail-calls to itself with different
  -%%   tags to return the needed data.
  -%%
  -%%--------------------------------------------------------------------
  +% @doc Return some chunks for downloading.
  +% @todo spec this beast.
   pick_chunks(_Pid, _Id, unknown, _N) ->
       none_eligible;
   pick_chunks(Pid, Id, Set, N) ->
  
positive.code: %%        IOL ::= {integer(), integer(), integer()} - {Index, Offs, Len}
  %% Description: Mark a given chunk as fetched.
  %%--------------------------------------------------------------------
  mark_fetched(Id, {Index, Offset, Len}) ->
      gen_server:call(?SERVER, {mark_fetched, Id, Index, Offset, Len}).
  
  %% Store the chunk in the chunk table. As a side-effect, check the piece if it
  %% is fully fetched.
  store_chunk(Id, {Index, D, Ops}, {Offset, Len}, FSPid) ->
      gen_server:call(?SERVER, {store_chunk, Id, {Index, D, Ops}, {Offset, Len}, FSPid},
                     timer:seconds(?STORE_CHUNK_TIMEOUT)).
  
negative.code: %% Function: start_link() -> {ok,Pid} | ignore | {error,Error}
  %% Description: Starts the server
  %%--------------------------------------------------------------------
  -spec start_link() -> ignore | {ok, pid()} | {error, any()}.
  start_link() ->
      gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
  
  