Commit bdb9aa2c bdb9aa2c94f6593ac43da0b6452c90b09aca0cdf by Sam Roberts

Finished split of forward declarations into <mailutils/types.h>. Now you

have to include the header for the functions you want to use, but you can
change a header without causing a recompile of everything. Also added some
missing LGPL file headers.
1 parent 2de90f2c
Showing 70 changed files with 454 additions and 242 deletions
......@@ -46,15 +46,16 @@
# include <strings.h>
#endif
#include <mailutils/body.h>
#include <mailutils/errno.h>
#include <mailutils/error.h>
#include <mailutils/header.h>
#include <mailutils/list.h>
#include <mailutils/mailbox.h>
#include <mailutils/message.h>
#include <mailutils/header.h>
#include <mailutils/body.h>
#include <mailutils/mutil.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#include <mailutils/mutil.h>
#include <mailutils/error.h>
#include <mailutils/errno.h>
#include <argcv.h>
#include <mu_argp.h>
......
......@@ -27,11 +27,17 @@
#include "getopt.h"
#include <mu_argp.h>
#include <mailutils/mailbox.h>
#include <mailutils/address.h>
#include <mailutils/attribute.h>
#include <mailutils/debug.h>
#include <mailutils/header.h>
#include <mailutils/registrar.h>
#include <mailutils/list.h>
#include <mailutils/mailbox.h>
#include <mailutils/message.h>
#include <mailutils/observer.h>
#include <mailutils/address.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
static char* show_field;
static int show_to;
......
......@@ -35,8 +35,12 @@
#include <mailutils/address.h>
#include <mailutils/errno.h>
#include <mailutils/header.h>
#include <mailutils/list.h>
#include <mailutils/mailbox.h>
#include <mailutils/message.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
int
main(int argc, char **argv)
......
......@@ -70,18 +70,21 @@
#endif
#include <mailutils/address.h>
#include <mailutils/attribute.h>
#include <mailutils/body.h>
#include <mailutils/envelope.h>
#include <mailutils/errno.h>
#include <mailutils/error.h>
#include <mailutils/filter.h>
#include <mailutils/folder.h>
#include <mailutils/header.h>
#include <mailutils/list.h>
#include <mailutils/mailbox.h>
#include <mailutils/message.h>
#include <mailutils/mutil.h>
#include <mailutils/parse822.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#include <mailutils/mutil.h>
#include <mu_argp.h>
......
......@@ -18,9 +18,6 @@
#ifndef _MAILUTILS_ADDRESS_H
#define _MAILUTILS_ADDRESS_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/types.h>
#ifdef __cplusplus
......
......@@ -18,16 +18,12 @@
#ifndef _MAILUTILS_ATTRIBUTE_H
#define _MAILUTILS_ATTRIBUTE_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _attribute;
typedef struct _attribute * attribute_t;
#define MU_ATTRIBUTE_ANSWERED 0x01
#define MU_ATTRIBUTE_FLAGGED 0x02
#define MU_ATTRIBUTE_DELETED 0x04
......
......@@ -18,18 +18,12 @@
#ifndef _MAILUTILS_AUTH_H
#define _MAILUTILS_AUTH_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/url.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* forward declaration */
struct _ticket;
typedef struct _ticket *ticket_t;
extern int ticket_create __P ((ticket_t *, void *owner));
extern void ticket_destroy __P ((ticket_t *, void *owner));
extern int ticket_set_destroy __P ((ticket_t, void (*)
......@@ -42,9 +36,6 @@ extern int ticket_pop __P ((ticket_t, url_t, const char *, char **)
extern int ticket_set_data __P ((ticket_t, void *, void *owner));
extern int ticket_get_data __P ((ticket_t, void **));
struct _authority;
typedef struct _authority *authority_t;
extern int authority_create __P ((authority_t *, ticket_t, void *));
extern void authority_destroy __P ((authority_t *, void *));
extern void *authority_get_owner __P ((authority_t));
......@@ -55,9 +46,6 @@ extern int authority_set_authenticate __P ((authority_t, int (*_authenticate) __
extern int authority_create_null __P ((authority_t *pauthority, void *owner));
struct _wicket;
typedef struct _wicket *wicket_t;
extern int wicket_create __P ((wicket_t *, const char *));
extern void wicket_destroy __P ((wicket_t *));
extern int wicket_set_filename __P ((wicket_t, const char *));
......
......@@ -18,18 +18,12 @@
#ifndef _MAILUTILS_BODY_H
#define _MAILUTILS_BODY_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/stream.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* forward declaration */
struct _body;
typedef struct _body *body_t;
extern int body_create __P ((body_t *, void *owner));
extern void body_destroy __P ((body_t *, void *owner));
extern void * body_get_owner __P ((body_t));
......
......@@ -18,17 +18,14 @@
#ifndef _MAILUTILS_DEBUG_H
#define _MAILUTILS_DEBUG_H
#include <sys/types.h>
#include <stdarg.h>
#include <mailutils/mu_features.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _debug;
typedef struct _debug* mu_debug_t;
#define MU_DEBUG_ERROR 0x0001
#define MU_DEBUG_TRACE 0x0002
#define MU_DEBUG_PROT 0x0004
......
......@@ -18,16 +18,12 @@
#ifndef _MAILUTILS_ENVELOPE_H
# define _MAILUTILS_ENVELOPE_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" { /*}*/
#endif
struct _envelope;
typedef struct _envelope *envelope_t;
int envelope_create (envelope_t *, void *);
void envelope_destroy (envelope_t *, void *);
void * envelope_get_owner (envelope_t);
......
......@@ -18,9 +18,7 @@
#ifndef _MAILUTILS_ERRNO_H
#define _MAILUTILS_ERRNO_H 1
#include <sys/types.h>
#include <errno.h>
#include <mailutils/mu_features.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
......@@ -44,6 +42,12 @@ extern "C" {
#define MU_ERR_LOCK_BAD_LOCK (MU_ERR_BASE | 0x00a)
#define MU_ERR_LOCK_BAD_FILE (MU_ERR_BASE | 0x00b)
#define MU_ERR_LOCK_NOT_HELD (MU_ERR_BASE | 0x00c)
#define MU_ERR_LOCK_EXT_FAIL (MU_ERR_BASE | 0x00d)
/* external program not found, or lack of system resources */
#define MU_ERR_LOCK_EXT_ERR (MU_ERR_BASE | 0x00e)
/* external program failed, specific reason unknown */
#define MU_ERR_LOCK_EXT_KILLED (MU_ERR_BASE | 0x00f)
/* external program was interrupted */
const char* mu_errname __P((int e));
const char* mu_errstring __P((int e));
......
......@@ -19,7 +19,8 @@
#define _MAILUTILS_ERROR_H
#include <stdarg.h>
#include <mailutils/mu_features.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
......
......@@ -15,18 +15,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Notes:
*/
#ifndef _MAILUTILS_FILTER_H
#define _MAILUTILS_FILTER_H
#include <stdlib.h>
#include <mailutils/mu_features.h>
#include <mailutils/list.h>
#include <mailutils/property.h>
#include <mailutils/stream.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
......@@ -41,12 +33,6 @@ extern "C" {
#define MU_FILTER_WRITE MU_STREAM_WRITE
#define MU_FILTER_RDWR MU_STREAM_RDWR
struct _filter;
typedef struct _filter * filter_t;
struct _filter_record;
typedef struct _filter_record * filter_record_t;
struct _filter_record
{
const char *name;
......
......@@ -18,25 +18,12 @@
#ifndef _MAILUTILS_FOLDER_H
# define _MAILUTILS_FOLDER_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/url.h>
#include <mailutils/observer.h>
#include <mailutils/debug.h>
#include <mailutils/stream.h>
#include <mailutils/auth.h>
#include <mailutils/stream.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declaration. */
struct _folder;
typedef struct _folder *folder_t;
#define MU_FOLDER_ATTRIBUTE_DIRECTORY 0x001
#define MU_FOLDER_ATTRIBUTE_FILE 0x002
struct list_response
......
......@@ -18,9 +18,7 @@
#ifndef _MAILUTILS_HEADER_H
#define _MAILUTILS_HEADER_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/stream.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
......@@ -66,10 +64,6 @@ extern "C" {
/* Mime support header attribute */
/* forward declaration */
struct _header;
typedef struct _header * header_t;
extern int header_create __P ((header_t *, const char *,
size_t, void *));
extern void header_destroy __P ((header_t *, void *));
......
......@@ -18,17 +18,12 @@
#ifndef _MAILUTILS_ITERATOR_H
#define _MAILUTILS_ITERATOR_H
#include <mailutils/mu_features.h>
#include <mailutils/list.h>
#include <sys/types.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _iterator;
typedef struct _iterator *iterator_t;
extern int iterator_create __P ((iterator_t *, list_t));
extern void iterator_destroy __P ((iterator_t *));
extern int iterator_first __P ((iterator_t));
......
......@@ -18,16 +18,12 @@
#ifndef _MAILUTILS_LIST_H
#define _MAILUTILS_LIST_H
#include <mailutils/mu_features.h>
#include <sys/types.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _list;
typedef struct _list *list_t;
extern int list_create __P ((list_t *));
extern void list_destroy __P ((list_t *));
extern int list_append __P ((list_t, void *item));
......
......@@ -20,16 +20,7 @@
#include <sys/types.h>
#include <mailutils/debug.h>
#include <mailutils/folder.h>
#include <mailutils/locker.h>
#include <mailutils/message.h>
#include <mailutils/mu_features.h>
#include <mailutils/observer.h>
#include <mailutils/property.h>
#include <mailutils/stream.h>
#include <mailutils/types.h>
#include <mailutils/url.h>
#ifdef __cplusplus
extern "C" {
......
......@@ -18,25 +18,12 @@
#ifndef _MAILUTILS_MAILER_H
#define _MAILUTILS_MAILER_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/address.h>
#include <mailutils/debug.h>
#include <mailutils/message.h>
#include <mailutils/observer.h>
#include <mailutils/property.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* forward declaration */
struct _mailer;
typedef struct _mailer *mailer_t;
extern int mailer_create __P ((mailer_t *, const char *));
extern void mailer_destroy __P ((mailer_t *));
......
......@@ -21,6 +21,7 @@
#include <mailutils/body.h>
#include <mailutils/debug.h>
#include <mailutils/envelope.h>
#include <mailutils/errno.h>
#include <mailutils/error.h>
#include <mailutils/filter.h>
#include <mailutils/folder.h>
......@@ -40,3 +41,4 @@
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
......
......@@ -18,17 +18,7 @@
#ifndef _MAILUTILS_MESSAGE_H
#define _MAILUTILS_MESSAGE_H
#include <sys/types.h>
#include <mailutils/attribute.h>
#include <mailutils/auth.h>
#include <mailutils/body.h>
#include <mailutils/envelope.h>
#include <mailutils/header.h>
#include <mailutils/mailbox.h>
#include <mailutils/mu_features.h>
#include <mailutils/observer.h>
#include <mailutils/stream.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
......
......@@ -18,10 +18,7 @@
#ifndef _MAILUTILS_MIME_H
#define _MAILUTILS_MIME_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/header.h>
#include <mailutils/stream.h>
#include <mailutils/types.h>
/* mime flags */
#define MIME_INCREAMENTAL_PARSER 0x1
......@@ -33,10 +30,6 @@
extern "C" {
#endif
/* forward declaration */
struct _mime;
typedef struct _mime *mime_t;
int mime_create __P ((mime_t *pmime, message_t msg, int flags));
void mime_destroy __P ((mime_t *pmime));
int mime_is_multipart __P ((mime_t mime));
......
......@@ -18,8 +18,7 @@
#ifndef _MAILUTILS_MONITOR_H
#define _MAILUTILS_MONITOR_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
......
......@@ -24,6 +24,7 @@
*/
#include <time.h>
#include <mailutils/mu_features.h>
#ifdef __cplusplus
......@@ -76,9 +77,11 @@ extern int mu_tempfile __P((const char *tmpdir, char **namep));
extern char * mu_get_full_path __P((const char *file));
extern char * mu_getcwd __P((void));
extern int mu_spawnvp(const char* prog, const char* const av[], int* stat);
#ifdef __cplusplus
}
#endif
#endif /* _MAILUTILS_MUTIL_H */
#endif
......
......@@ -18,18 +18,12 @@
#ifndef _MAILUTILS_OBSERVER_H
#define _MAILUTILS_OBSERVER_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _observer;
struct _observable;
typedef struct _observer* observer_t;
typedef struct _observable* observable_t;
#define MU_EVT_MAILBOX_DESTROY 0x001
#define MU_EVT_FOLDER_DESTROY 0x002
#define MU_EVT_MAILER_DESTROY 0x004
......
......@@ -22,8 +22,7 @@
#ifndef _MAILUTILS_PARSE822_H
#define _MAILUTILS_PARSE822_H
#include <mailutils/mu_features.h>
#include <mailutils/address.h>
#include <mailutils/types.h>
#include <mailutils/mutil.h>
#ifdef __cplusplus
......
......@@ -19,15 +19,13 @@
#define _MAILUTILS_PROPERTY_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _property;
typedef struct _property *property_t;
extern int property_create __P ((property_t *, void *));
extern void property_destroy __P ((property_t *, void *));
extern void *property_get_owner __P ((property_t));
......
......@@ -18,23 +18,12 @@
#ifndef _MAILUTILS_REGISTRAR_H
#define _MAILUTILS_REGISTRAR_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/url.h>
#include <mailutils/mailbox.h>
#include <mailutils/mailer.h>
#include <mailutils/folder.h>
#include <mailutils/list.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Record. */
struct _record;
typedef struct _record* record_t;
/* Public Interface, to allow static initialization. */
struct _record
{
......
......@@ -19,18 +19,13 @@
# define _MAILUTILS_STREAM_H
#include <stdio.h>
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/property.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" { /*}*/
#endif
struct _stream;
typedef struct _stream *stream_t;
#define MU_STREAM_READ 0x00000001
#define MU_STREAM_WRITE 0x00000002
#define MU_STREAM_RDWR 0x00000004
......
......@@ -18,21 +18,65 @@
#ifndef _MAILUTILS_TYPES_H
#define _MAILUTILS_TYPES_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _address;
struct _attribute;
struct _authority;
struct _body;
struct _debug;
struct _envelope;
struct _filter;
struct _filter_record;
struct _folder;
struct _header;
struct _iterator;
struct _list;
struct _locker;
struct _mailbox;
struct _mailer;
struct _message;
struct _address;
struct _mime;
struct _observable;
struct _observer;
struct _property;
struct _record;
struct _stream;
struct _ticket;
struct _url;
struct _wicket;
typedef struct _address *address_t;
typedef struct _attribute *attribute_t;
typedef struct _authority *authority_t;
typedef struct _body *body_t;
typedef struct _debug *mu_debug_t;
typedef struct _envelope *envelope_t;
typedef struct _filter *filter_t;
typedef struct _filter_record *filter_record_t;
typedef struct _folder *folder_t;
typedef struct _header * header_t;
typedef struct _iterator *iterator_t;
typedef struct _list *list_t;
typedef struct _locker *locker_t;
typedef struct _mailbox *mailbox_t;
typedef struct _mailer *mailer_t;
typedef struct _message *message_t;
typedef struct _address *address_t;
typedef struct _mime *mime_t;
typedef struct _observable *observable_t;
typedef struct _observer *observer_t;
typedef struct _property *property_t;
typedef struct _record* record_t;
typedef struct _stream *stream_t;
typedef struct _ticket *ticket_t;
typedef struct _url *url_t;
typedef struct _wicket *wicket_t;
#ifdef __cplusplus
}
......
......@@ -18,17 +18,12 @@
#ifndef _MAILUTILS_URL_H
#define _MAILUTILS_URL_H 1
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* forward declaration */
struct _url;
typedef struct _url * url_t;
extern int url_create __P ((url_t *, const char *name));
extern void url_destroy __P ((url_t *));
extern int url_parse __P ((url_t));
......
......@@ -18,20 +18,23 @@
#if defined(HAVE_CONFIG_H)
# include <config.h>
#endif
#include <errno.h>
#include <grp.h>
#include <netdb.h>
#include <pwd.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <syslog.h>
#include <pwd.h>
#include <grp.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include "getopt.h"
#ifdef HAVE_STRINGS_H
......@@ -65,14 +68,18 @@
# define INADDR_LOOPBAK 0x7f000001
#endif
#include <mailutils/attribute.h>
#include <mailutils/errno.h>
#include <mailutils/error.h>
#include <mailutils/list.h>
#include <mailutils/locker.h>
#include <mailutils/mailbox.h>
#include <mailutils/message.h>
#include <mailutils/mutil.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <mu_dbm.h>
#include <mu_argp.h>
......
......@@ -59,17 +59,23 @@
#include <readline/history.h>
#endif
#include <mailutils/address.h>
#include <mailutils/attribute.h>
#include <mailutils/body.h>
#include <mailutils/debug.h>
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/message.h>
#include <mailutils/envelope.h>
#include <mailutils/filter.h>
#include <mailutils/header.h>
#include <mailutils/body.h>
#include <mailutils/registrar.h>
#include <mailutils/list.h>
#include <mailutils/iterator.h>
#include <mailutils/address.h>
#include <mailutils/list.h>
#include <mailutils/mailbox.h>
#include <mailutils/mailer.h>
#include <mailutils/message.h>
#include <mailutils/mutil.h>
#include <mailutils/filter.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <argcv.h>
#include <getline.h>
......
......@@ -38,8 +38,10 @@
# include <strings.h>
#endif
#include <mailutils/message.h>
#include <mailutils/body.h>
#include <mailutils/filter.h>
#include <mailutils/header.h>
#include <mailutils/message.h>
#include <mailutils/stream.h>
#define MAX_HDR_LEN 256
......
......@@ -33,7 +33,9 @@ First draft: Alain Magloire.
#endif
#include <filter0.h>
#include <mailutils/iterator.h>
#include <mailutils/stream.h>
static void
filter_destroy (stream_t stream)
......
......@@ -25,6 +25,8 @@
#include <errno.h>
#include <mailutils/property.h>
#include <mailutils/stream.h>
#include <filter0.h>
static int rfc822_init __P ((filter_t));
......
......@@ -28,6 +28,8 @@ First Draft: Dave Inglis.
#include <stdlib.h>
#include <string.h>
#include <mailutils/stream.h>
#include <filter0.h>
#define MU_TRANS_DECODE 1
......
......@@ -23,10 +23,15 @@
#include <stdlib.h>
#include <string.h>
#include <mailutils/registrar.h>
#include <mailutils/auth.h>
#include <mailutils/debug.h>
#include <mailutils/iterator.h>
#include <mailutils/list.h>
#include <mailutils/monitor.h>
#include <mailutils/observer.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <folder0.h>
......
......@@ -37,7 +37,14 @@
#include <imap0.h>
#include <url0.h>
#include <mailutils/auth.h>
#include <mailutils/attribute.h>
#include <mailutils/debug.h>
#include <mailutils/error.h>
#include <mailutils/header.h>
#include <mailutils/observer.h>
#include <mailutils/stream.h>
/* For dbg purposes set to one to see different level of traffic. */
/* Print to stderr the command sent to the IMAP server. */
......
......@@ -34,6 +34,10 @@
#include <folder0.h>
#include <registrar0.h>
#include <mailutils/auth.h>
#include <mailutils/url.h>
#include <mailutils/stream.h>
/* We export url parsing and the initialisation of
the mailbox, via the register entry/record. */
......
......@@ -27,9 +27,12 @@
# include <strings.h>
#endif
#include <mailutils/auth.h>
#include <mailutils/mailbox.h>
#include <folder0.h>
#include <url0.h>
#include <registrar0.h>
#include <url0.h>
/* We export url parsing and the initialisation of
the mailbox, via the register entry/record. */
......
......@@ -22,6 +22,8 @@
#include <errno.h>
#include <stdlib.h>
#include <mailutils/list.h>
#include <iterator0.h>
int
......
......@@ -22,11 +22,18 @@
#include <stdlib.h>
#include <errno.h>
#include <mailutils/debug.h>
#include <mailutils/errno.h>
#include <mailutils/error.h>
#include <mailutils/folder.h>
#include <mailutils/iterator.h>
#include <mailutils/locker.h>
#include <mailutils/observer.h>
#include <mailutils/property.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <mailbox0.h>
/* The Mailbox Factory.
......
......@@ -25,12 +25,17 @@
#include <stdarg.h>
#include <errno.h>
#include <mailutils/registrar.h>
#include <mailutils/address.h>
#include <mailutils/debug.h>
#include <mailutils/iterator.h>
#include <mailutils/observer.h>
#include <mailutils/property.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <mailer0.h>
/*
*/
int
mailer_create (mailer_t *pmailer, const char *name)
{
......
......@@ -176,7 +176,7 @@ plus_expand (const char *file, char **buf)
return 0;
}
/* Do ~ , if necessary. We do not use $HOME. */
/* Do ~ , if necessary. */
static int
tilde_expand (const char *file, char **buf)
{
......
......@@ -24,6 +24,8 @@
#include <stdlib.h>
#include <sys/stat.h>
#include <mailutils/url.h>
#include <mailbox0.h>
#include <registrar0.h>
......
......@@ -29,11 +29,21 @@
#include <time.h>
#include <mailutils/address.h>
#include <mailutils/attribute.h>
#include <mailutils/body.h>
#include <mailutils/debug.h>
#include <mailutils/envelope.h>
#include <mailutils/error.h>
#include <mailutils/header.h>
#include <mailutils/message.h>
#include <mailutils/mutil.h>
#include <mailutils/observer.h>
#include <mailutils/property.h>
#include <mailutils/stream.h>
#include <imap0.h>
#include <mailbox0.h>
#include <registrar0.h>
#include <imap0.h>
#include <url0.h>
#undef min
......
......@@ -52,14 +52,21 @@
#include <mailbox0.h>
#include <registrar0.h>
#include <mailutils/address.h>
#include <mailutils/attribute.h>
#include <mailutils/body.h>
#include <mailutils/debug.h>
#include <mailutils/envelope.h>
#include <mailutils/errno.h>
#include <mailutils/error.h>
#include <mailutils/header.h>
#include <mailutils/locker.h>
#include <mailutils/message.h>
#include <mailutils/mutil.h>
#include <mailutils/observer.h>
#include <mailutils/property.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#define ATTRIBUTE_IS_DELETED(flag) (flag & MU_ATTRIBUTE_DELETED)
#define ATTRIBUTE_IS_EQUAL(flag1, flag2) (flag1 == flag2)
......
......@@ -44,15 +44,21 @@
# include <strings.h>
#endif
#include <mailutils/message.h>
#include <mailutils/stream.h>
#include <mailutils/body.h>
#include <mailutils/header.h>
#include <mailutils/attribute.h>
#include <mailutils/body.h>
#include <mailutils/debug.h>
#include <mailutils/envelope.h>
#include <mailutils/error.h>
#include <mailutils/header.h>
#include <mailutils/locker.h>
#include <mailutils/message.h>
#include <mailutils/mutil.h>
#include <registrar0.h>
#include <mailutils/property.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <mailbox0.h>
#include <registrar0.h>
#define MAX_OPEN_STREAMS 16
......
......@@ -40,17 +40,21 @@
#include <md5-rsa.h>
#include <mailutils/errno.h>
#include <mailutils/stream.h>
#include <mailutils/body.h>
#include <mailutils/message.h>
#include <mailutils/header.h>
#include <mailutils/attribute.h>
#include <mailutils/url.h>
#include <mailutils/auth.h>
#include <mailutils/body.h>
#include <mailutils/debug.h>
#include <mailutils/errno.h>
#include <mailutils/error.h>
#include <mailbox0.h>
#include <mailutils/header.h>
#include <mailutils/message.h>
#include <mailutils/observer.h>
#include <mailutils/property.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <folder0.h>
#include <mailbox0.h>
#include <registrar0.h>
#include <url0.h>
......
......@@ -35,8 +35,18 @@
#include <message0.h>
#include <mailutils/address.h>
#include <mailutils/attribute.h>
#include <mailutils/auth.h>
#include <mailutils/body.h>
#include <mailutils/debug.h>
#include <mailutils/envelope.h>
#include <mailutils/errno.h>
#include <mailutils/folder.h>
#include <mailutils/header.h>
#include <mailutils/mailbox.h>
#include <mailutils/mutil.h>
#include <mailutils/observer.h>
#include <mailutils/stream.h>
#define MESSAGE_MODIFIED 0x10000;
......
......@@ -61,6 +61,9 @@ mu_errname (int e)
EN(MU_ERR_LOCK_BAD_LOCK)
EN(MU_ERR_LOCK_BAD_FILE)
EN(MU_ERR_LOCK_NOT_HELD)
EN(MU_ERR_LOCK_EXT_FAIL)
EN(MU_ERR_LOCK_EXT_ERR)
EN(MU_ERR_LOCK_EXT_KILLED)
}
return "SYSTEM ERROR";
......@@ -89,6 +92,9 @@ const char* mu_errstring (int e)
ES(MU_ERR_LOCK_BAD_LOCK, "Lock file check failed")
ES(MU_ERR_LOCK_BAD_FILE, "File check failed")
ES(MU_ERR_LOCK_NOT_HELD, "Lock not held on file")
ES(MU_ERR_LOCK_EXT_FAIL, "Failed to exec external locker")
ES(MU_ERR_LOCK_EXT_ERR, "External locker failed")
ES(MU_ERR_LOCK_EXT_KILLED, "External locker killed")
}
return strerror(e);
......
......@@ -21,7 +21,10 @@
#include <errno.h>
#include <stdlib.h>
#include <mailutils/list.h>
#include <mailutils/iterator.h>
#include <observer0.h>
int
......
......@@ -27,7 +27,9 @@
#endif
#include <mailutils/iterator.h>
#include <mailutils/list.h>
#include <mailutils/monitor.h>
#include <registrar0.h>
/* NOTE: We will leak here since the monitor and the registrar will never
......
......@@ -30,7 +30,13 @@
#include <sys/wait.h>
#include <mailutils/address.h>
#include <mailutils/debug.h>
#include <mailutils/message.h>
#include <mailutils/observer.h>
#include <mailutils/property.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <mailer0.h>
#include <registrar0.h>
......
......@@ -19,18 +19,24 @@
# include <config.h>
#endif
#include <sys/types.h>
#include <stdio.h>
#include <pwd.h>
#include <unistd.h>
#include <errno.h>
#include <netdb.h>
#include <pwd.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
#include <unistd.h>
#include <mailutils/address.h>
#include <mailutils/stream.h>
#include <mailutils/debug.h>
#include <mailutils/header.h>
#include <mailutils/message.h>
#include <mailutils/mutil.h>
#include <mailutils/observer.h>
#include <mailutils/property.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <mailer0.h>
#include <registrar0.h>
......
......@@ -34,6 +34,8 @@
#include <stdio.h>
#include <string.h>
#include <mailutils/property.h>
#include <stream0.h>
static int refill (stream_t, off_t);
......
......@@ -21,6 +21,7 @@
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
......
......@@ -18,18 +18,12 @@
#ifndef _MAILUTILS_AUTHORITY_H
#define _MAILUTILS_AUTHORITY_H
#include <sys/types.h>
#include <mailutils/mu_features.h>
#include <mailutils/ticket.h>
#include <mailutils/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* forward declaration */
struct _authority;
typedef struct _authority *authority_t;
extern int authority_ref __P ((authority_t));
extern void authority_destroy __P ((authority_t *));
extern int authority_set_ticket __P ((authority_t, ticket_t));
......
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, 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 Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#include <mailutils/mailutils.h>
#include <stdio.h>
#include <malloc.h>
#include <mu_argp.h>
static int messages_count (const char *);
......
......@@ -109,14 +109,18 @@
# include <strings.h>
#endif
#include <mailutils/attribute.h>
#include <mailutils/body.h>
#include <mailutils/errno.h>
#include <mailutils/error.h>
#include <mailutils/header.h>
#include <mailutils/list.h>
#include <mailutils/locker.h>
#include <mailutils/mailbox.h>
#include <mailutils/message.h>
#include <mailutils/header.h>
#include <mailutils/body.h>
#include <mailutils/registrar.h>
#include <mailutils/error.h>
#include <mailutils/mutil.h>
#include <mailutils/registrar.h>
#include <mailutils/url.h>
#include <mu_argp.h>
......
......@@ -28,12 +28,19 @@
#include <errno.h>
#include <getopt.h>
#include <mailutils/body.h>
#include <mailutils/debug.h>
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/header.h>
#include <mailutils/list.h>
#include <mailutils/message.h>
#include <mailutils/mime.h>
#include <mailutils/filter.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
int msglist __P ((mailbox_t mbox, int show_all, int argc, char **argv, int **set, int *n));
#endif
......
/*
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
sieve script interpreter.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, 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 Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
sieve script interpreter.
*/
#ifdef HAVE_CONFIG_H
......@@ -26,10 +41,14 @@ sieve script interpreter.
#include "mu_argp.h"
#include <mailutils/auth.h>
#include <mailutils/errno.h>
#include <mailutils/folder.h>
#include <mailutils/list.h>
#include <mailutils/mailbox.h>
#include <mailutils/mutil.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
void mutil_register_all_mbox_formats(void);
......@@ -231,7 +250,7 @@ main (int argc, char *argv[])
mailbox_t mbox = 0;
struct options opts = { 0 };
const char* capa[] = { 0 };
/*const char* capa[] = { 0 };*/
size_t count = 0;
int msgno = 0;
......
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, 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 Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/** mailutils' sieve implementation */
/*
Configuration:
......
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, 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 Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef SV_H
#define SV_H
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/address.h>
#include <mailutils/registrar.h>
#include <mailutils/types.h>
#include "sieve_interface.h"
......
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, 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 Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* sieve callback implementations */
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <mailutils/errno.h>
#include <mailutils/address.h>
#include <mailutils/envelope.h>
#include <mailutils/errno.h>
#include <mailutils/header.h>
#include "sv.h"
......
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, 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 Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "sv.h"
#include <mailutils/attribute.h>
#include <mailutils/errno.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
......
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, 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 Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
* sieve header field cache.
*/
......
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, 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 Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
* sieve field cache.
*/
......
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, 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 Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/** utility wrappers around mailutils functionality **/
#include <assert.h>
......@@ -6,6 +23,9 @@
#include "sv.h"
#include <mailutils/attribute.h>
#include <mailutils/message.h>
#if 0
int
sv_mu_copy_debug_level (const mailbox_t from, mailbox_t to)
......