move rfc822.c as well
authorPierre Habouzit <madcoder@debian.org>
Thu, 2 Nov 2006 20:41:22 +0000 (21:41 +0100)
committerPierre Habouzit <madcoder@debian.org>
Thu, 2 Nov 2006 20:41:22 +0000 (21:41 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
12 files changed:
Makefile.am
alias.h
lib-mime/Makefile.am
lib-mime/mime.h
lib-mime/rfc822.c [moved from rfc822.c with 95% similarity]
mutt.h
mutt_idna.h
nntp/newsrc.c
pgpinvoke.c
rfc2047.c
rfc822.h [deleted file]
sendlib.c

index 4710973..0ba9066 100644 (file)
@@ -37,7 +37,7 @@ muttng_SOURCES = $(BUILT_SOURCES) \
        main.c mbox.c mbyte.c menu.c mh.c muttlib.c mutt_idna.c mx.c \
        pager.c parse.c pattern.c postpone.c \
        query.c \
        main.c mbox.c mbyte.c menu.c mh.c muttlib.c mutt_idna.c mx.c \
        pager.c parse.c pattern.c postpone.c \
        query.c \
-       recvattach.c recvcmd.c rfc822.c rfc1524.c rfc2047.c rfc3676.c \
+       recvattach.c recvcmd.c rfc1524.c rfc2047.c rfc3676.c \
        score.c send.c sendlib.c sidebar.c signal.c sort.c state.c status.c system.c \
        thread.c \
        url.c utf8.c \
        score.c send.c sendlib.c sidebar.c signal.c sort.c state.c status.c system.c \
        thread.c \
        url.c utf8.c \
@@ -87,7 +87,7 @@ EXTRA_DIST = config.rpath  COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
        mime.h mutt.h mutt_curses.h mutt_menu.h \
        mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
        mbox.h mh.h mx.h pager.h pgp.h protos.h rfc1524.h rfc2047.h \
        mime.h mutt.h mutt_curses.h mutt_menu.h \
        mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
        mbox.h mh.h mx.h pager.h pgp.h protos.h rfc1524.h rfc2047.h \
-       rfc822.h rfc3676.h \
+       rfc3676.h \
        sort.h mime.types autogen.sh \
        _regex.h OPS.MIX remailer.c remailer.h browser.h state.h \
        mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttngrc.head Muttngrc \
        sort.h mime.types autogen.sh \
        _regex.h OPS.MIX remailer.c remailer.h browser.h state.h \
        mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttngrc.head Muttngrc \
diff --git a/alias.h b/alias.h
index 32fa20c..f20e8af 100644 (file)
--- a/alias.h
+++ b/alias.h
@@ -9,7 +9,7 @@
 #ifndef _MUTT_ALIAS_H
 #define _MUTT_ALIAS_H
 
 #ifndef _MUTT_ALIAS_H
 #define _MUTT_ALIAS_H
 
-#include "rfc822.h"
+#include <lib-mime/mime.h>
 
 typedef struct alias {
   struct alias *self;           /* XXX - ugly hack */
 
 typedef struct alias {
   struct alias *self;           /* XXX - ugly hack */
index 4cb982c..b7835fa 100644 (file)
@@ -1,6 +1,6 @@
 noinst_LIBRARIES = libmime.a
 
 noinst_LIBRARIES = libmime.a
 
-libmime_a_SOURCES = mime.h mime.c rfc2231.c
+libmime_a_SOURCES = mime.h mime.c rfc822.c rfc2231.c
 
 noinst_HEADERS    = mime.h
 
 
 noinst_HEADERS    = mime.h
 
index 03acd98..1cf264a 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef MUTT_LIB_MIME_MIME_H
 #define MUTT_LIB_MIME_MIME_H
 
 #ifndef MUTT_LIB_MIME_MIME_H
 #define MUTT_LIB_MIME_MIME_H
 
+#include <stdlib.h>
+
 /* Content-Type */
 enum {
     TYPEOTHER,
 /* Content-Type */
 enum {
     TYPEOTHER,
@@ -80,6 +82,45 @@ extern const char *BodyEncodings[];
 #define TYPE(X) ((X->type == TYPEOTHER) && (X->xtype != NULL) ? X->xtype : BodyTypes[(X->type)])
 #define ENCODING(X) BodyEncodings[(X)]
 
 #define TYPE(X) ((X->type == TYPEOTHER) && (X->xtype != NULL) ? X->xtype : BodyTypes[(X->type)])
 #define ENCODING(X) BodyEncodings[(X)]
 
+/****************************************************************************/
+/* RFC 822                                                                  */
+/*                Standard for ARPA Internet Text Messages                  */
+/****************************************************************************/
+
+/* possible values for RFC822Error */
+enum {
+    ERR_MEMORY = 1,
+    ERR_MISMATCH_PAREN,
+    ERR_MISMATCH_QUOTE,
+    ERR_BAD_ROUTE,
+    ERR_BAD_ROUTE_ADDR,
+    ERR_BAD_ADDR_SPEC
+};
+
+typedef struct address_t {
+    char *personal;               /* real name of address */
+    char *mailbox;                /* mailbox and host address */
+    int group;                    /* group mailbox? */
+    struct address_t *next;
+} ADDRESS;
+
+void rfc822_free_address(ADDRESS **);
+void rfc822_qualify(ADDRESS *, const char *);
+ADDRESS *rfc822_parse_adrlist(ADDRESS *, const char *s);
+ADDRESS *rfc822_cpy_adr(ADDRESS * addr);
+ADDRESS *rfc822_cpy_adr_real(ADDRESS * addr);
+ADDRESS *rfc822_append(ADDRESS ** a, ADDRESS * b);
+void rfc822_write_address(char *, size_t, ADDRESS *, int);
+void rfc822_write_address_single(char *, size_t, ADDRESS *, int);
+void rfc822_cat(char *, size_t, const char *, const char *);
+
+extern int RFC822Error;
+extern const char *RFC822Errors[];
+extern const char RFC822Specials[];
+
+#define rfc822_error(x) RFC822Errors[x]
+#define rfc822_new_address() calloc(1,sizeof(ADDRESS))
+
 /****************************************************************************/
 /* RFC 2231                                                                 */
 /*             MIME Parameter Value and Encoded Word Extensions:            */
 /****************************************************************************/
 /* RFC 2231                                                                 */
 /*             MIME Parameter Value and Encoded Word Extensions:            */
similarity index 95%
rename from rfc822.c
rename to lib-mime/rfc822.c
index 30f1379..82c3e7c 100644 (file)
--- a/rfc822.c
@@ -1,3 +1,22 @@
+/*
+ *  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., 51 Franklin Street, Fifth Floor, Boston,
+ *  MA 02110-1301, USA.
+ *
+ *  Copyright © 2006 Pierre Habouzit
+ */
+
 /*
  * Copyright notice from original mutt:
  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
 /*
  * Copyright notice from original mutt:
  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
@@ -7,10 +26,6 @@
  * please see the file GPL in the top level source directory.
  */
 
  * please see the file GPL in the top level source directory.
  */
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
 #include <string.h>
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
 #include <stdlib.h>
@@ -20,7 +35,6 @@
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
 
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
 
-#include "mutt.h"
 #include "mutt_idna.h"
 
 
 #include "mutt_idna.h"
 
 
diff --git a/mutt.h b/mutt.h
index 75b6796..2ef4a1b 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -47,7 +47,6 @@
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
-#include "rfc822.h"
 #include "charset.h"
 #include "lib/rx.h"
 
 #include "charset.h"
 #include "lib/rx.h"
 
index 508f200..1149283 100644 (file)
 #ifndef _MUTT_IDNA_H
 # define _MUTT_IDNA_H
 
 #ifndef _MUTT_IDNA_H
 # define _MUTT_IDNA_H
 
-#include "rfc822.h"
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <lib-mime/mime.h>
 #include "charset.h"
 
 #ifdef HAVE_LIBIDN
 #include "charset.h"
 
 #ifdef HAVE_LIBIDN
index 1af28c2..6f3d867 100644 (file)
@@ -25,7 +25,6 @@
 #include "sort.h"
 #include "mx.h"
 #include "nntp.h"
 #include "sort.h"
 #include "mx.h"
 #include "nntp.h"
-#include "rfc822.h"
 #include "rfc1524.h"
 #include "rfc2047.h"
 
 #include "rfc1524.h"
 #include "rfc2047.h"
 
index 2fb8917..b24687f 100644 (file)
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
 
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
 
+#include <lib-mime/mime.h>
+
 #include "mutt.h"
 #include "mutt_curses.h"
 #include "mutt_idna.h"
 #include "pgp.h"
 #include "mutt.h"
 #include "mutt_curses.h"
 #include "mutt_idna.h"
 #include "pgp.h"
-#include "rfc822.h"
 
 #include "lib/debug.h"
 
 
 #include "lib/debug.h"
 
index 23fffd4..a181e9d 100644 (file)
--- a/rfc2047.c
+++ b/rfc2047.c
@@ -46,8 +46,6 @@
 
 #define CONTINUATION_BYTE(c) (((c) & 0xc0) == 0x80)
 
 
 #define CONTINUATION_BYTE(c) (((c) & 0xc0) == 0x80)
 
-extern char RFC822Specials[];
-
 typedef size_t (*encoder_t) (char *, const char *, size_t,
                              const char *);
 
 typedef size_t (*encoder_t) (char *, const char *, size_t,
                              const char *);
 
diff --git a/rfc822.h b/rfc822.h
deleted file mode 100644 (file)
index 0c55020..0000000
--- a/rfc822.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright notice from original mutt:
- * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
- *
- * 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 rfc822_h
-#define rfc822_h
-
-/* possible values for RFC822Error */
-enum {
-  ERR_MEMORY = 1,
-  ERR_MISMATCH_PAREN,
-  ERR_MISMATCH_QUOTE,
-  ERR_BAD_ROUTE,
-  ERR_BAD_ROUTE_ADDR,
-  ERR_BAD_ADDR_SPEC
-};
-
-typedef struct address_t {
-  char *personal;               /* real name of address */
-  char *mailbox;                /* mailbox and host address */
-  int group;                    /* group mailbox? */
-  struct address_t *next;
-} ADDRESS;
-
-void rfc822_free_address (ADDRESS **);
-void rfc822_qualify (ADDRESS *, const char *);
-ADDRESS *rfc822_parse_adrlist (ADDRESS *, const char *s);
-ADDRESS *rfc822_cpy_adr (ADDRESS * addr);
-ADDRESS *rfc822_cpy_adr_real (ADDRESS * addr);
-ADDRESS *rfc822_append (ADDRESS ** a, ADDRESS * b);
-void rfc822_write_address (char *, size_t, ADDRESS *, int);
-void rfc822_write_address_single (char *, size_t, ADDRESS *, int);
-void rfc822_cat (char *, size_t, const char *, const char *);
-
-extern int RFC822Error;
-extern const char *RFC822Errors[];
-
-#define rfc822_error(x) RFC822Errors[x]
-#define rfc822_new_address() calloc(1,sizeof(ADDRESS))
-
-#endif /* rfc822_h */
index 91490fe..208b434 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -69,8 +69,6 @@
 #include <assert.h>
 #endif
 
 #include <assert.h>
 #endif
 
-extern char RFC822Specials[];
-
 #define DISPOSITION(X) X==DISPATTACH?"attachment":"inline"
 
 static char MsgIdPfx = 'A';
 #define DISPOSITION(X) X==DISPATTACH?"attachment":"inline"
 
 static char MsgIdPfx = 'A';