1 /** 2 * @file 3 * NeoMutt connections 4 * 5 * @authors 6 * Copyright (C) 2000-2007 Brendan Cully <brendan@kublai.com> 7 * 8 * @copyright 9 * This program is free software: you can redistribute it and/or modify it under 10 * the terms of the GNU General Public License as published by the Free Software 11 * Foundation, either version 2 of the License, or (at your option) any later 12 * version. 13 * 14 * This program is distributed in the hope that it will be useful, but WITHOUT 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 * details. 18 * 19 * You should have received a copy of the GNU General Public License along with 20 * this program. If not, see <http://www.gnu.org/licenses/>. 21 */ 22 23 #ifndef MUTT_MUTT_SOCKET_H 24 #define MUTT_MUTT_SOCKET_H 25 26 struct ConnAccount; 27 28 /* logging levels */ 29 #define MUTT_SOCK_LOG_CMD 2 30 #define MUTT_SOCK_LOG_HDR 3 31 #define MUTT_SOCK_LOG_FULL 5 32 33 struct Connection *mutt_conn_find(const struct ConnAccount *account); 34 struct Connection *mutt_conn_new(const struct ConnAccount *account); 35 36 #define mutt_socket_readln(buf, buflen, conn) mutt_socket_readln_d(buf, buflen, conn, MUTT_SOCK_LOG_CMD) 37 #define mutt_socket_send(conn, buf) mutt_socket_send_d(conn, buf, MUTT_SOCK_LOG_CMD) 38 #define mutt_socket_send_d(conn, buf, dbg) mutt_socket_write_d(conn, buf, mutt_str_len(buf), dbg) 39 #define mutt_socket_write_n(conn, buf, len) mutt_socket_write_d(conn, buf, len, MUTT_SOCK_LOG_CMD) 40 41 #endif /* MUTT_MUTT_SOCKET_H */ 42