diff options
73 files changed, 324 insertions, 485 deletions
diff --git a/configure.ac b/configure.ac index 4a359a029..eb11d2069 100644 --- a/configure.ac +++ b/configure.ac @@ -69,7 +69,7 @@ AC_SUBST(MU_APP_LIBRARIES,'../libmu_argp/libmu_argp.a ../libmu_cfg/libmu_cfg.la # header files. There are two exceptions, though. See NOTE before the # AC_CONFIG_LINKS statements, below. -AC_SUBST(MU_LIB_COMMON_INCLUDES,'-I${top_builddir} -I${top_srcdir}/include -I${top_builddir}/include -I${top_srcdir}/mailbox -I${top_srcdir}/libproto/include') +AC_SUBST(MU_LIB_COMMON_INCLUDES,'-I${top_builddir} -I${top_srcdir}/include -I${top_builddir}/include -I${top_srcdir}/mailbox') AC_SUBST(MU_APP_COMMON_INCLUDES,'-I${srcdir} -I${top_srcdir}/include -I${top_srcdir}/lib -I${top_builddir}/lib -I${top_builddir} -I${top_builddir}/include -I${top_srcdir}/mailbox -I${top_srcdir}/libmu_argp -I${top_srcdir}/libmu_cfg') @@ -1350,7 +1350,6 @@ AC_CONFIG_FILES([ libproto/pop/Makefile libproto/nntp/Makefile libproto/imap/Makefile - libproto/include/Makefile maidag/Makefile mail/Makefile mail/testsuite/Makefile diff --git a/include/mailutils/sys/Makefile.am b/include/mailutils/sys/Makefile.am index bc813e9f1..e8f073ccf 100644 --- a/include/mailutils/sys/Makefile.am +++ b/include/mailutils/sys/Makefile.am @@ -19,25 +19,42 @@ sysincludedir=$(pkgincludedir)/sys sysinclude_HEADERS = \ + amd.h\ + attribute.h\ + auth.h\ + body.h\ dbgstream.h\ + debug.h\ + envelope.h\ file_stream.h\ filter.h\ + folder.h\ gsasl-stream.h\ header_stream.h\ header.h\ + imap.h\ + iterator.h\ iostream.h\ + list.h\ + mailbox.h\ + mailer.h\ mapfile_stream.h\ memory_stream.h\ message_stream.h\ message.h\ mime.h\ + monitor.h\ + nntp.h\ + observer.h\ + pop3.h\ prog_stream.h\ + property.h\ + registrar.h\ socket_stream.h\ stdio_stream.h\ streamref.h\ streamtrans.h\ stream.h\ tls-stream.h\ - pop3.h\ - nntp.h\ + url.h\ xscript-stream.h diff --git a/libproto/include/amd.h b/include/mailutils/sys/amd.h index f6434531c..b72c3c1ec 100644 --- a/libproto/include/amd.h +++ b/include/mailutils/sys/amd.h @@ -17,10 +17,12 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define MAX_OPEN_STREAMS 16 +#ifndef _MAILUTILS_SYS_AMD_H +# define _MAILUTILS_SYS_AMD_H +# define MAX_OPEN_STREAMS 16 /* Notifications ADD_MESG. */ -#define DISPATCH_ADD_MSG(mbox,mhd,n) \ +# define DISPATCH_ADD_MSG(mbox,mhd,n) \ do \ { \ int bailing = 0; \ @@ -42,7 +44,7 @@ mu_monitor_wrlock (mbox->monitor); \ } while (0); -#define MU_AMD_SIZE_FILE_NAME ".mu-size" +# define MU_AMD_SIZE_FILE_NAME ".mu-size" struct _amd_data; struct _amd_message @@ -110,3 +112,5 @@ void amd_cleanup (void *arg); struct _amd_message *_amd_get_message (struct _amd_data *amd, size_t msgno); int amd_msg_lookup (struct _amd_data *amd, struct _amd_message *msg, size_t *pret); + +#endif diff --git a/libproto/include/attribute0.h b/include/mailutils/sys/attribute.h index f379f7fef..83e1f112f 100644 --- a/libproto/include/attribute0.h +++ b/include/mailutils/sys/attribute.h @@ -17,12 +17,8 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _ATTRIBUTE0_H -# define _ATTRIBUTE0_H - -#ifdef DMALLOC -# include <dmalloc.h> -#endif +#ifndef _MAILUTILS_SYS_ATTRIBUTE_H +# define _MAILUTILS_SYS_ATTRIBUTE_H #include <mailutils/attribute.h> @@ -46,4 +42,4 @@ struct _mu_attribute } #endif -#endif /* _ATTRIBUTE0_H */ +#endif /* _MAILUTILS_SYS_ATTRIBUTE_H */ diff --git a/libproto/include/auth0.h b/include/mailutils/sys/auth.h index 7868bad89..0a4308d3c 100644 --- a/libproto/include/auth0.h +++ b/include/mailutils/sys/auth.h @@ -17,16 +17,12 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _AUTH0_H -#define _AUTH0_H - -#ifdef DMALLOC -# include <dmalloc.h> -#endif +#ifndef _MAILUTILS_SYS_AUTH_H +# define _MAILUTILS_SYS_AUTH_H +#include <sys/types.h> #include <mailutils/auth.h> #include <mailutils/list.h> -#include <sys/types.h> #ifdef __cplusplus extern "C" { @@ -67,4 +63,4 @@ struct _mu_wicket } #endif -#endif /* _AUTH0_H */ +#endif /* _MAILUTILS_SYS_AUTH_H */ diff --git a/libproto/include/body0.h b/include/mailutils/sys/body.h index 156793cfd..9c82a2a50 100644 --- a/libproto/include/body0.h +++ b/include/mailutils/sys/body.h @@ -17,12 +17,8 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _BODY0_H -#define _BODY0_H - -#ifdef DMALLOC -# include <dmalloc.h> -#endif +#ifndef _MAILUTILS_SYS_BODY_H +# define _MAILUTILS_SYS_BODY_H #include <mailutils/stream.h> #include <mailutils/body.h> @@ -50,4 +46,4 @@ struct _mu_body } #endif -#endif /* _BODY0_H */ +#endif /* _MAILUTILS_SYS_BODY_H */ diff --git a/libproto/include/debug0.h b/include/mailutils/sys/debug.h index 1b4fc4608..30ac95925 100644 --- a/libproto/include/debug0.h +++ b/include/mailutils/sys/debug.h @@ -17,12 +17,8 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _DEBUG0_H -#define _DEBUG0_H - -#ifdef DMALLOC -# include <dmalloc.h> -#endif +#ifndef _MAILUTILS_SYS_DEBUG_H +# define _MAILUTILS_SYS_DEBUG_H #include <mailutils/debug.h> #include <mailutils/stream.h> @@ -47,4 +43,4 @@ struct _mu_debug } #endif -#endif /* _DEBUG0_H */ +#endif /* _MAILUTILS_SYS_DEBUG_H */ diff --git a/libproto/include/envelope0.h b/include/mailutils/sys/envelope.h index 5e1cae40d..fe4689a38 100644 --- a/libproto/include/envelope0.h +++ b/include/mailutils/sys/envelope.h @@ -17,12 +17,8 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _ENVELOPE0_H -#define _ENVELOPE0_H - -#ifdef DMALLOC -#include <dmalloc.h> -#endif +#ifndef _MAILUTILS_SYS_ENVELOPE_H +# define _MAILUTILS_SYS_ENVELOPE_H #include <mailutils/envelope.h> @@ -44,4 +40,4 @@ struct _mu_envelope } #endif -#endif /* _ENVELOPE0_H */ +#endif /* _MAILUTILS_SYS_ENVELOPE_H */ diff --git a/libproto/include/folder0.h b/include/mailutils/sys/folder.h index 060e6a365..912fb87fc 100644 --- a/libproto/include/folder0.h +++ b/include/mailutils/sys/folder.h @@ -17,25 +17,21 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _FOLDER0_H -#define _FOLDER0_H +#ifndef _MAILUTILS_SYS_FOLDER_H +# define _MAILUTILS_SYS_FOLDER_H -#ifdef DMALLOC -# include <dmalloc.h> -#endif +# include <sys/types.h> +# include <stdio.h> -#include <sys/types.h> -#include <stdio.h> +# include <mailutils/monitor.h> +# include <mailutils/folder.h> -#include <mailutils/monitor.h> -#include <mailutils/folder.h> - -#ifdef __cplusplus +# ifdef __cplusplus extern "C" { -#endif +# endif -#define MU_FOLDER_LIST 0 -#define MU_FOLDER_ENUM 1 +# define MU_FOLDER_LIST 0 +# define MU_FOLDER_ENUM 1 struct _mu_folder { @@ -70,8 +66,8 @@ struct _mu_folder int (*_unsubscribe) (mu_folder_t, const char *); }; -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif -#endif /* _FOLDER0_H */ +#endif /* _MAILUTILS_SYS_FOLDER_H */ diff --git a/libproto/include/imap0.h b/include/mailutils/sys/imap.h index 0b4ff3338..bbad6e573 100644 --- a/libproto/include/imap0.h +++ b/include/mailutils/sys/imap.h @@ -17,65 +17,60 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _IMAP0_H -#define _IMAP0_H +#ifndef _MAILUTILS_SYS_IMAP_H +# define _MAILUTILS_SYS_IMAP_H -#ifdef DMALLOC -# include <dmalloc.h> -#endif +# include <mailutils/sys/folder.h> +# include <mailutils/sys/mailbox.h> +# include <mailutils/sys/registrar.h> +# include <mailutils/sys/auth.h> -#include <folder0.h> -#include <mailbox0.h> -#include <registrar0.h> -#include <auth0.h> - -#ifdef __cplusplus +# ifdef __cplusplus extern "C" { -#endif +# endif -#define CLEAR_STATE(f_imap) \ +# define CLEAR_STATE(f_imap) \ f_imap->selected = NULL, f_imap->state = IMAP_NO_STATE /* Clear the state and close the stream. */ -#define CHECK_ERROR_CLOSE(folder, f_imap, status) \ -do \ - { \ - if (status != 0) \ - { \ - mu_stream_close (folder->stream); \ - CLEAR_STATE (f_imap); \ - return status; \ - } \ - } \ -while (0) +# define CHECK_ERROR_CLOSE(folder, f_imap, status) \ + do \ + { \ + if (status != 0) \ + { \ + mu_stream_close (folder->stream); \ + CLEAR_STATE (f_imap); \ + return status; \ + } \ + } \ + while (0) /* Clear the state. */ -#define CHECK_ERROR(f_imap, status) \ -do \ - { \ - if (status != 0) \ - { \ - CLEAR_STATE (f_imap); \ - return status; \ - } \ - } \ +# define CHECK_ERROR(f_imap, status) \ + do \ + { \ + if (status != 0) \ + { \ + CLEAR_STATE (f_imap); \ + return status; \ + } \ + } \ while (0) /* Clear the state for non recoverable error. */ -#define CHECK_EAGAIN(f_imap, status) \ -do \ - { \ - if (status != 0) \ - { \ - if (status != EAGAIN && status != EINPROGRESS && status != EINTR) \ - { \ - CLEAR_STATE (f_imap); \ - } \ - return status; \ - } \ - } \ -while (0) - +# define CHECK_EAGAIN(f_imap, status) \ + do \ + { \ + if (status != 0) \ + { \ + if (status != EAGAIN && status != EINPROGRESS && status != EINTR) \ + { \ + CLEAR_STATE (f_imap); \ + } \ + return status; \ + } \ + } \ + while (0) struct _f_imap; struct _m_imap; @@ -234,8 +229,8 @@ int imap_parse (f_imap_t); int imap_readline (f_imap_t); char *section_name (msg_imap_t); -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif -#endif /* _IMAP0_H */ +#endif /* _MAILUTILS_SYS_IMAP_H */ diff --git a/libproto/include/iterator0.h b/include/mailutils/sys/iterator.h index 8abbb8019..5b5475f31 100644 --- a/libproto/include/iterator0.h +++ b/include/mailutils/sys/iterator.h @@ -17,18 +17,14 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _ITERATOR0_H -#define _ITERATOR0_H +#ifndef _MAILUTILS_SYS_ITERATOR_H +# define _MAILUTILS_SYS_ITERATOR_H -#ifdef DMALLOC -# include <dmalloc.h> -#endif +# include <mailutils/iterator.h> -#include <mailutils/iterator.h> - -#ifdef __cplusplus +# ifdef __cplusplus extern "C" { -#endif +# endif struct _mu_iterator { @@ -46,8 +42,8 @@ struct _mu_iterator int (*itrctl) (void *owner, enum mu_itrctl_req req, void *arg); }; -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif -#endif /* _ITERATOR0_H */ +#endif /* _MAILUTILS_SYS_ITERATOR_H */ diff --git a/libproto/include/list0.h b/include/mailutils/sys/list.h index 3ac00fbaa..2e9f83a18 100644 --- a/libproto/include/list0.h +++ b/include/mailutils/sys/list.h @@ -17,22 +17,18 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _LIST0_H -#define _LIST0_H +#ifndef _MAILUTILS_SYS_LIST_H +# define _MAILUTILS_SYS_LIST_H -#ifdef DMALLOC -# include <dmalloc.h> -#endif +# include <sys/types.h> -#include <sys/types.h> +# include <mailutils/list.h> +# include <mailutils/monitor.h> +# include <mailutils/iterator.h> -#include <mailutils/list.h> -#include <mailutils/monitor.h> -#include <mailutils/iterator.h> - -#ifdef __cplusplus +# ifdef __cplusplus extern "C" { -#endif +# endif struct list_data { @@ -59,8 +55,8 @@ extern void _mu_list_insert_sublist (mu_list_t list, size_t count, int insert_before); -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif -#endif /* _LIST0_H */ +#endif /* _MAILUTILS_SYS_LIST_H */ diff --git a/libproto/include/mailbox0.h b/include/mailutils/sys/mailbox.h index a052e43ab..12af8fe48 100644 --- a/libproto/include/mailbox0.h +++ b/include/mailutils/sys/mailbox.h @@ -17,23 +17,19 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _MAILBOX0_H -#define _MAILBOX0_H +#ifndef _MAILUTILS_SYS_MAILBOX_H +# define _MAILUTILS_SYS_MAILBOX_H -#ifdef DMALLOC -# include <dmalloc.h> -#endif +# include <sys/types.h> +# include <stdio.h> -#include <sys/types.h> -#include <stdio.h> +# include <mailutils/monitor.h> +# include <mailutils/mailbox.h> +# include <mailutils/iterator.h> -#include <mailutils/monitor.h> -#include <mailutils/mailbox.h> -#include <mailutils/iterator.h> - -#ifdef __cplusplus +# ifdef __cplusplus extern "C" { -#endif +# endif struct _mu_mailbox { @@ -80,8 +76,8 @@ struct _mu_mailbox int (*_get_uidls) (mu_mailbox_t, mu_list_t); }; -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif -#endif /* _MAILBOX0_H */ +#endif /* _MAILUTILS_SYS_MAILBOX_H */ diff --git a/libproto/include/mailer0.h b/include/mailutils/sys/mailer.h index 949bb1511..b9413a380 100644 --- a/libproto/include/mailer0.h +++ b/include/mailutils/sys/mailer.h @@ -17,26 +17,22 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ |