anchor.diff:      % send request to the gen_server
       Output = rpc(<<"add-piqi">>, BinInput),
       decode_add_piqi_output(Output).
  -
  -
  -add_piqi_local(BinPiqiList, RealCall, State) ->
  -    BinInput = encode_add_piqi_input(BinPiqiList),
  -    % send add_piqi RPC request to the Port putting the continuation function in
  -    % the queue instead of the caller's Pid
  -    Continuation =
  -        fun (Response, State0) ->
  -            % XXX: don't handle errors, assuming that this call is safe since
  -            % we've added these Piqi modules before without a problem
  -            ok = decode_add_piqi_output(Response),
  -            % execute the original request
  -            RealCall(State0)
  -        end,
  -    _NewState = do_rpc_call(<<"add-piqi">>, BinInput, Continuation, State).
   
   
   encode_add_piqi_input(BinPiqiList) ->
  
positive.code: 
  -define(PIQI_TOOLS_ERROR, 'piqi_tools_error').
  
  
  % gen_server state
  -record(state, {
      % Erlang port id
      port :: port(),
  
      % data remaining from the previous packet received from the port
      prev_data = <<>> :: binary(),
  
      % queue of gen_server Clients or request continuations
      queue = queue:new() :: any(),
  
      % queue length
      queue_len = 0 :: non_neg_integer()
  }).
  
  
  
negative.code:          handle_info/2,
           terminate/2,
           code_change/3]).
  % entry point of the port receiver process
  -export([port_receiver/2]).
  
  
  -include("piqirun.hrl").
  