X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=pop.h;h=6adacc0f61e6b613da821ca8c0b33112f0287865;hb=b2f6783657f7f0cef2c4dc09966515f478030b0b;hp=027c20ddb5f3fba223f5b3160c7481bf5176e3d6;hpb=6833ce8bdca2d64e14485118f2a4417b7e1cb1b1;p=apps%2Fmadmutt.git diff --git a/pop.h b/pop.h index 027c20d..6adacc0 100644 --- a/pop.h +++ b/pop.h @@ -1,20 +1,11 @@ /* + * Copyright notice from original mutt: * Copyright (C) 2000-2003 Vsevolod Volkov - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - */ + * + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. + */ #ifndef _POP_H #define _POP_H 1 @@ -31,8 +22,7 @@ /* maximal length of the server response (RFC1939) */ #define POP_CMD_RESPONSE 512 -enum -{ +enum { /* Status */ POP_NONE = 0, POP_CONNECTED, @@ -40,50 +30,46 @@ enum POP_BYE }; -typedef enum -{ +typedef enum { POP_A_SUCCESS = 0, POP_A_SOCKET, POP_A_FAILURE, POP_A_UNAVAIL } pop_auth_res_t; -typedef struct -{ +typedef struct { unsigned int index; char *path; } POP_CACHE; -typedef struct -{ +typedef struct { CONNECTION *conn; - unsigned int status : 2; - unsigned int capabilities : 1; - unsigned int use_stls : 2; - unsigned int cmd_capa : 1; /* optional command CAPA */ - unsigned int cmd_stls : 1; /* optional command STLS */ - unsigned int cmd_user : 2; /* optional command USER */ - unsigned int cmd_uidl : 2; /* optional command UIDL */ - unsigned int cmd_top : 2; /* optional command TOP */ - unsigned int resp_codes : 1; /* server supports extended response codes */ - unsigned int expire : 1; /* expire is greater than 0 */ - unsigned int clear_cache : 1; + unsigned int status:2; + unsigned int capabilities:1; + unsigned int use_stls:2; + unsigned int cmd_capa:1; /* optional command CAPA */ + unsigned int cmd_stls:1; /* optional command STLS */ + unsigned int cmd_user:2; /* optional command USER */ + unsigned int cmd_uidl:2; /* optional command UIDL */ + unsigned int cmd_top:2; /* optional command TOP */ + unsigned int resp_codes:1; /* server supports extended response codes */ + unsigned int expire:1; /* expire is greater than 0 */ + unsigned int clear_cache:1; size_t size; time_t check_time; - time_t login_delay; /* minimal login delay capability */ - char *auth_list; /* list of auth mechanisms */ + time_t login_delay; /* minimal login delay capability */ + char *auth_list; /* list of auth mechanisms */ char *timestamp; char err_msg[POP_CMD_RESPONSE]; POP_CACHE cache[POP_CACHE_LEN]; } POP_DATA; -typedef struct -{ +typedef struct { /* do authentication, using named method or any available if method is NULL */ pop_auth_res_t (*authenticate) (POP_DATA *, const char *); /* name of authentication method supported, NULL means variable. If this * is not null, authenticate may ignore the second parameter. */ - const char* method; + const char *method; } pop_auth_t; /* pop_auth.c */ @@ -96,7 +82,8 @@ int pop_parse_path (const char *, ACCOUNT *); int pop_connect (POP_DATA *); int pop_open_connection (POP_DATA *); int pop_query_d (POP_DATA *, char *, size_t, char *); -int pop_fetch_data (POP_DATA *, char *, char *, int (*funct) (char *, void *), void *); +int pop_fetch_data (POP_DATA *, char *, char *, int (*funct) (char *, void *), + void *); int pop_reconnect (CONTEXT *); void pop_logout (CONTEXT *); void pop_error (POP_DATA *, char *);