rohrpost

A commandline mail client to change the world as we see it.
git clone git://r-36.net/rohrpost
Log | Files | Refs | LICENSE

commit 4d41a183153231751d5a0a9c67b11b3be3ea8e5e
parent c779a83255a27a926355a28443ed5a87c50b770a
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sat, 21 Apr 2012 15:05:14 +0200

Intermediate changes #1.

Diffstat:
Makefile | 2+-
mime.c | 70----------------------------------------------------------------------
mime.h | 2--
rohrpost.c | 3++-
view.c | 4++--
5 files changed, 5 insertions(+), 76 deletions(-)

diff --git a/Makefile b/Makefile @@ -7,7 +7,7 @@ SRC = ${NAME}.c ind.c llist.c cfg.c txtdb.c mark.c cur.c \ select.c sieve.c net.c base64.c strio.c parser.c pager.c \ mime.c folder.c imap.c inc.c stats.c capability.c pick.c \ flag.c copy.c remove.c scan.c quote.c view.c \ - param.c part.c add.c ids.c + param.c part.c add.c ids.c util.c OBJ = ${SRC:.c=.o} diff --git a/mime.c b/mime.c @@ -14,8 +14,6 @@ #include <time.h> #include "ind.h" -#include "arg.h" -#include "cfg.h" #include "llist.h" #include "mime.h" #include "parser.h" @@ -1212,71 +1210,3 @@ mime_mkboundary(void) return smprintf("=--= _TUlNRSBTdWNrcyEK/%x_ =--=", rand()); } -void -mimeusage(void) -{ - die("usage: %s [-adhflrs] [-m folder] [[-b|-q] [string]] " - "[-e header] [-p part] " - "[-c contenttype] [msgs]\n", argv0); -} - -int -mimemain(int argc, char *argv[]) -{ - config_t *cfg; - int status, filelen; - char *user, *pass, *netspec, *selected, *filename, *type, - *parts, *filec, *header; - llist_t *ids, *msgs, *partl; - llistelem_t *elem, *msg, *ide; - mime_t *mime; - - enum { - BEQUIET = 0x01, - ALLPARTS = 0x02, - LISTPARTS = 0x04, - GETFILENAME = 0x08, - TOSTDOUT = 0x10, - DECODE = 0x20, - QUOTEDPRINTABLE = 0x40, - BASE64 = 0x80, - ISHEADER = 0x100, - - NOARGS = 0x200, - }; - - status = 0; - parts = NULL; - type = NULL; - selected = NULL; - - ARGBEGIN { - case 'a': - status |= ALLPARTS; - break; - case 'b': - status |= BASE64; - break; - case 'd': - status |= DECODE; - break; - case 'f': - status |= GETFILENAME; - break; - case 'l': - status |= LISTPARTS; - break; - case 'q': - status |= QUOTEDPRINTABLE; - break; - case 'r': - status |= ISHEADER; - break; - case 's': - status |= TOSTDOUT; - break; - } ARGEND; - - return 0; -} - diff --git a/mime.h b/mime.h @@ -52,7 +52,5 @@ char *mime_filename(mime_t *mime); char *mime_mkfilename(char *id, mime_t *mime); char *mime_mkboundary(void); -int mimemain(int argc, char *argv[]); - #endif diff --git a/rohrpost.c b/rohrpost.c @@ -30,6 +30,7 @@ #include "add.h" #include "ids.h" #include "mime.h" +#include "util.h" char *argv0; @@ -52,13 +53,13 @@ struct command cmds[] = { {"rpflag", flagmain}, {"rpfold", foldermain}, {"rpids", idsmain}, - //{"rpmime", mimemain}, {"rpmv", movemain}, {"rppart", partmain}, {"rppick", pickmain}, {"rpscan", scanmain}, {"rpsieve", sievemain}, {"rpstats", statsmain}, + {"rputil", utilmain}, {"rpcur", curmain}, {"rpinc", incmain}, {"rpmark", markmain}, diff --git a/view.c b/view.c @@ -49,7 +49,7 @@ view_printtextplain(mime_t *mime) plen = 0; hvalue = mime_decodepart(mime, &plen); if (hvalue != NULL) { - printf("%s", hvalue); + printf("%s\n", hvalue); free(hvalue); } } @@ -88,7 +88,7 @@ view_printtexthtml(mime_t *mime) goto killlynx; } - printf("%s", decbuf); + printf("%s\n", decbuf); free(decbuf); free(hvalue);