Files
libssh/examples/examples_common.h
Mingyuan Li 6fc95e8d43 examples: Enable libssh_scp and scp_download on Windows
Both examples only depend on getopt, which is now provided by the
bundled fallback. Include the getopt wrapper header and move them
out of the UNIX-only build guard.

Signed-off-by: Mingyuan Li <2560359315@qq.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2026-03-24 15:11:55 +01:00

34 lines
1.1 KiB
C

/*
Copyright 2009 Aris Adamantiadis
This file is part of the SSH Library
You are free to copy this file, modify it in any way, consider it being public
domain. This does not apply to the rest of the library though, but it is
allowed to cut-and-paste working code from this file to any license of
program.
The goal is to show the API in action. It's not a reference on how terminal
clients must be made or how a client should react.
*/
#ifndef EXAMPLES_COMMON_H_
#define EXAMPLES_COMMON_H_
#include <libssh/libssh.h>
/* On platforms without getopt (e.g. MSVC), the bundled compatibility layer
* from libssh is used. When building outside of the libssh source tree,
* a getopt implementation must be provided separately. */
#ifndef HAVE_GETOPT_H
#include "libssh/getopt.h"
#endif
/** Zero a structure */
#define ZERO_STRUCT(x) memset(&(x), 0, sizeof(x))
int authenticate_console(ssh_session session);
int authenticate_kbdint(ssh_session session, const char *password);
int verify_knownhost(ssh_session session);
ssh_session connect_ssh(const char *hostname, const char *port, const char *user, int verbosity);
#endif /* EXAMPLES_COMMON_H_ */