23#ifndef MUTT_CONN_SOCKET_H
24#define MUTT_CONN_SOCKET_H
52#define MUTT_SOCK_LOG_CMD 2
53#define MUTT_SOCK_LOG_HDR 3
54#define MUTT_SOCK_LOG_FULL 5
56#define mutt_socket_readln(buf, buflen, conn) mutt_socket_readln_d(buf, buflen, conn, MUTT_SOCK_LOG_CMD)
57#define mutt_socket_send(conn, buf) mutt_socket_send_d(conn, buf, MUTT_SOCK_LOG_CMD)
58#define mutt_socket_send_d(conn, buf, dbg) mutt_socket_write_d(conn, buf, mutt_str_len(buf), dbg)
59#define mutt_socket_write_n(conn, buf, len) mutt_socket_write_d(conn, buf, len, MUTT_SOCK_LOG_CMD)
61#define mutt_socket_buffer_readln(buf, conn) mutt_socket_buffer_readln_d(buf, conn, MUTT_SOCK_LOG_CMD)
int mutt_socket_close(struct Connection *conn)
Close a socket.
int mutt_socket_poll(struct Connection *conn, time_t wait_secs)
Checks whether reads would block.
int mutt_socket_buffer_readln_d(struct Buffer *buf, struct Connection *conn, int dbg)
Read a line from a socket into a Buffer.
int mutt_socket_write_d(struct Connection *conn, const char *buf, int len, int dbg)
Write data to a socket.
struct Connection * mutt_socket_new(enum ConnectionType type)
Allocate and initialise a new connection.
int mutt_socket_readchar(struct Connection *conn, char *c)
Simple read buffering to speed things up.
void mutt_socket_empty(struct Connection *conn)
Clear out any queued data.
ConnectionType
Type of connection.
@ MUTT_CONNECTION_SSL
SSL/TLS-encrypted connection.
@ MUTT_CONNECTION_SIMPLE
Simple TCP socket connection.
@ MUTT_CONNECTION_TUNNEL
Tunnelled connection.
int mutt_socket_read(struct Connection *conn, char *buf, size_t len)
Read from a Connection.
int mutt_socket_open(struct Connection *conn)
Simple wrapper.
int mutt_socket_readln_d(char *buf, size_t buflen, struct Connection *conn, int dbg)
Read a line from a socket.
String manipulation buffer.