Add NetTiles, a new Tiles interface with online play support (v24)
[crawl/crawl-nettiles.git] / crawl-ref / source / nettiles / connection.h
blob6e488864950f0cc8503ca62b856a563ebc15c0d1
1 /*
2 * Copyright (C) 2010 Luca Barbieri
3 * Released under the terms of the Crawl General Public License.
4 */
6 #ifndef CONNECTION_H
7 #define CONNECTION_H
9 #include <fstream>
10 #include <string>
12 struct Connection {
13 virtual ~Connection() {}
15 virtual ptrdiff_t retrieve(void* buf, size_t size) = 0;
16 virtual ptrdiff_t transmit(const void* buf, size_t size) = 0;
19 #ifdef HAVE_LIBSSH
20 Connection* create_ssh_connection(const std::string& host, const char* host_hash, const char* username, const char* password, const char* privkey, unsigned rows, unsigned cols);
21 #endif
22 Connection* create_telnet_connection(const std::string& host, unsigned port, unsigned rows, unsigned cols);
23 #ifdef __unix__
24 Connection* create_local_connection(const std::string& command, unsigned rows, unsigned cols);
25 #define create_local_connection create_local_connection
26 #endif
27 Connection* create_ttyrec_connection(const std::string& filename);
29 #endif