Skip to content

Commit

Permalink
create libpop
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed Jul 16, 2018
1 parent 4e588d2 commit 62b8051
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 14 deletions.
17 changes: 16 additions & 1 deletion Makefile.autosetup
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ NEOMUTTOBJS= addrbook.o alias.o bcache.o browser.o buffy.o \
hdrline.o help.o history.o hook.o init.o keymap.o \
main.o mbox.o menu.o mh.o muttlib.o mutt_account.o mutt_attach.o mutt_body.o mutt_header.o \
mutt_logging.o mutt_signal.o mutt_socket.o mutt_thread.o mutt_window.o mx.o newsrc.o \
nntp.o pager.o parse.o pattern.o pop.o pop_auth.o pop_lib.o \
nntp.o pager.o parse.o pattern.o \
postpone.o progress.o query.o recvattach.o recvcmd.o resize.o rfc1524.o \
rfc2047.o rfc2231.o rfc3676.o safe_asprintf.o score.o send.o \
sendlib.o sidebar.o smtp.o sort.o state.o status.o system.o \
Expand Down Expand Up @@ -98,6 +98,14 @@ CLEANFILES+= $(LIBEMAIL) $(LIBEMAILOBJS)
MUTTLIBS+= $(LIBEMAIL)
ALLOBJS+= $(LIBEMAILOBJS)

###############################################################################
# libpop
LIBPOP= libpop.a
LIBPOPOBJS= pop/pop_auth.o pop/pop.o pop/pop_lib.o
CLEANFILES+= $(LIBPOP) $(LIBPOPOBJS)
MUTTLIBS+= $(LIBPOP)
ALLOBJS+= $(LIBPOPOBJS)

###############################################################################
# libmutt
LIBMUTT= libmutt.a
Expand Down Expand Up @@ -235,6 +243,13 @@ $(LIBEMAIL): $(PWD)/email $(LIBEMAILOBJS)
$(PWD)/email:
$(MKDIR_P) $(PWD)/email

# libpop
$(LIBPOP): $(PWD)/pop $(LIBPOPOBJS)
$(AR) cr $@ $(LIBPOPOBJS)
$(RANLIB) $@
$(PWD)/pop:
$(MKDIR_P) $(PWD)/pop

# libncrypt
$(LIBNCRYPT): $(PWD)/ncrypt $(LIBNCRYPTOBJS)
$(AR) cr $@ $(LIBNCRYPTOBJS)
Expand Down
2 changes: 1 addition & 1 deletion curs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#include "sidebar.h"
#endif
#ifdef USE_POP
#include "pop.h"
#include "pop/pop.h"
#endif
#ifdef USE_IMAP
#include "imap/imap.h"
Expand Down
2 changes: 1 addition & 1 deletion mx.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#include "imap/imap.h"
#endif
#ifdef USE_POP
#include "pop.h"
#include "pop/pop.h"
#endif
#ifdef USE_NNTP
#include "nntp.h"
Expand Down
6 changes: 3 additions & 3 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ pager.c
parse.c
pattern.c
pgpewrap.c
pop.c
pop_auth.c
pop_lib.c
pop/pop.c
pop/pop_auth.c
pop/pop_lib.c
postpone.c
progress.c
query.c
Expand Down
1 change: 1 addition & 0 deletions pop.c → pop/pop.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "pop_private.h"
#include "mutt/mutt.h"
#include "email/email.h"
#include "conn/conn.h"
Expand Down
32 changes: 32 additions & 0 deletions pop/pop.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @file
* POP network mailbox
*
* @authors
* Copyright (C) 2000-2003 Vsevolod Volkov <[email protected]>
*
* @copyright
* 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, see <http://www.gnu.org/licenses/>.
*/

#ifndef _POP_POP_H
#define _POP_POP_H

#include "mx.h"

void pop_fetch_mail(void);

extern struct MxOps mx_pop_ops;

#endif /* _POP_POP_H */
1 change: 1 addition & 0 deletions pop_auth.c → pop/pop_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include "pop_private.h"
#include "mutt/mutt.h"
#include "email/email.h"
#include "conn/conn.h"
Expand Down
1 change: 1 addition & 0 deletions pop_lib.c → pop/pop_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pop_private.h"
#include "mutt/mutt.h"
#include "email/email.h"
#include "conn/conn.h"
Expand Down
11 changes: 3 additions & 8 deletions pop.h → pop/pop_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _MUTT_POP_H
#define _MUTT_POP_H
#ifndef _POP_PRIVATE_H
#define _POP_PRIVATE_H

#include <stdbool.h>
#include <time.h>
#include "mx.h"

struct Account;
struct Context;
Expand Down Expand Up @@ -125,9 +124,5 @@ int pop_fetch_data(struct PopData *pop_data, char *query, struct Progress *progr
int pop_reconnect(struct Context *ctx);
void pop_logout(struct Context *ctx);

/* pop.c */
void pop_fetch_mail(void);

extern struct MxOps mx_pop_ops;

#endif /* _MUTT_POP_H */
#endif /* _POP_PRIVATE_H */

0 comments on commit 62b8051

Please sign in to comment.