/*
    cssh - cluster secure shell
    Copyright (C) 2015-2026  Andreas Baumann

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _SFTP_ENGINE_HEADER_INCLUDED
#define _SFTP_ENGINE_HEADER_INCLUDED

#include <libssh/libssh.h>

#include "options.h"

// modern sftp_* engine (not version-gated in libssh, but the non-deprecated
// replacement for ssh_scp_* since libssh 0.10.0). Both directions honor
// args_info->recursive_given/progress_bar_given/verbose_given. Each function
// owns its whole copy phase, including calling cssh_finalize() and exiting
// on any fatal error, matching the rest of cssh's error-handling style.

void run_sftp_download( ssh_session *session, char **host, unsigned int *port, unsigned int nof_sessions,
	const char *remote_directory, struct gengetopt_args_info *args_info );

void run_sftp_upload( ssh_session *session, char **host, unsigned int *port, unsigned int nof_sessions,
	const char *local_directory, const char *remote_directory, struct gengetopt_args_info *args_info );

#endif
