anchor.diff:  run_job () ->
     gen_server:call (drmaa, {run_job}).
   
  +join_files (Join) when (Join == true) or (Join == false) ->
  +  gen_server:call (drmaa, {join_files, Join}).
  +
   remote_command (Command) when is_list (Command) ->
     gen_server:call (drmaa, {remote_command, Command}).
   
  -v_argv (Argv) when is_list (Argv) ->
  -  gen_server:call (drmaa, {v_argv, Argv}).
  +args (Argv) when is_list (Argv) ->
  +  gen_server:call (drmaa, {args, Argv}).
  +
  +env (Env) when is_list (Env) ->
  +  gen_server:call (drmaa, {env, Env}).
   
   
   %% gen_server callbacks %%
  
positive.code: %% API
  -export ([allocate_job_template/0, delete_job_template/0]).
  -export ([run_job/0]).
  -export ([remote_command/1, v_argv/1]).
  
  %% Internal
  -export ([control/2, control/3]).
  
  -define ('CMD_ALLOCATE_JOB_TEMPLATE',   1).
  -define ('CMD_DELETE_JOB_TEMPLATE',     2).
  
negative.code: handle_call ({run_job}, _From, #state {port = Port} = State) ->
    {ok, JobID} = drmaa:control (Port, ?CMD_RUN_JOB),
    {reply, {ok, JobID}, State};
  handle_call ({join_files, Join}, _From, #state {port = Port} = State) ->
    Bin = erlang:list_to_binary (erlang:atom_to_list (Join)),
    Reply = drmaa:control (Port, ?CMD_JOIN_FILES, Bin),
    {reply, Reply, State};
  handle_call ({remote_command, Command}, _From, #state {port = Port} = State) ->
    Reply = drmaa:control (Port, ?CMD_REMOTE_COMMAND, erlang:list_to_binary (Command)),
    {reply, Reply, State};
  handle_call ({args, Argv}, _From, #state {port = Port} = State) ->
    Args = string:join ([erlang:integer_to_list (length (Argv)), Argv], ","),
    Reply = drmaa:control (Port, ?CMD_V_ARGV, erlang:list_to_binary (Args)),
    {reply, Reply, State};
  handle_call ({env, Env}, _From, #state {port = Port} = State) ->
    Buffer = pair_array_to_vector (Env),
    Args = string:join ([erlang:integer_to_list (length (Env)), Buffer], ","),
    Reply = drmaa:control (Port, ?CMD_V_ENV, erlang:list_to_binary (Args)),
    {reply, Reply, State};
  handle_call (Request, _From, State) ->
    {reply, {unknown, Request}, State}.
  