-# Makefile.in generated by automake 1.7.6 from Makefile.am.
-# @configure_input@
+# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-@SET_MAKE@
+
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+
top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+host_alias = @host_alias@
host_triplet = @host@
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_IMAP_FALSE = @BUILD_IMAP_FALSE@
-BUILD_IMAP_TRUE = @BUILD_IMAP_TRUE@
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-
-
-# $(makedoc_OBJECTS): $(makedoc_SOURCES)
-# $(HOST_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) -c $<
-
-# makedoc: $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES)
-# @rm -rf makedoc
-# $(HOST_CC) $(AM_CFLAGS) $(LDFLAGS) $(makedoc_LDFLAGS) $(makedoc_OBJECTS) $(makedoc_LDADD) -o makedoc
-CPP = @CPP@
-
-CPPFLAGS = @CPPFLAGS@ -I$(includedir)
-CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DBX = @DBX@
DEBUGGER = @DEBUGGER@
-
-DEFS = -DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \
- -DHAVE_CONFIG_H=1
-
-DEPDIR = @DEPDIR@
DOTLOCK_GROUP = @DOTLOCK_GROUP@
DOTLOCK_PERMISSION = @DOTLOCK_PERMISSION@
DOTLOCK_TARGET = @DOTLOCK_TARGET@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
GDB = @GDB@
GENCAT = @GENCAT@
GLIBC21 = @GLIBC21@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GPGME_CONFIG = @GPGME_CONFIG@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+HAVE_LIB = @HAVE_LIB@
INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
ISPELL = @ISPELL@
KRB5CFGPATH = @KRB5CFGPATH@
-LDFLAGS = @LDFLAGS@
+LIB = @LIB@
LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@
LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
LIBICONV = @LIBICONV@
LIBIMAP = @LIBIMAP@
LIBIMAPDEPS = @LIBIMAPDEPS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
+LTLIB = @LTLIB@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MUTTLIBS = @MUTTLIBS@
MUTT_LIB_OBJECTS = @MUTT_LIB_OBJECTS@
-OBJEXT = @OBJEXT@
-
-OPS = @OPS@
PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
PGPAUX_TARGET = @PGPAUX_TARGET@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
SDB = @SDB@
SENDMAIL = @SENDMAIL@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
+SGML2HTML_CMD = @SGML2HTML_CMD@
+SGML2PS_CMD = @SGML2PS_CMD@
+SGML2TXT_CMD = @SGML2TXT_CMD@
SMIMEAUX_TARGET = @SMIMEAUX_TARGET@
-STRIP = @STRIP@
SUBVERSION = @SUBVERSION@
U = @U@
-USE_GSS_FALSE = @USE_GSS_FALSE@
-USE_GSS_TRUE = @USE_GSS_TRUE@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
-USE_SASL_FALSE = @USE_SASL_FALSE@
-USE_SASL_TRUE = @USE_SASL_TRUE@
-USE_SSL_FALSE = @USE_SSL_FALSE@
-USE_SSL_TRUE = @USE_SSL_TRUE@
VERSION = @VERSION@
-XGETTEXT = @XGETTEXT@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
docdir = @docdir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
mutt_libesmtp_config_path = @mutt_libesmtp_config_path@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign
EXTRA_PROGRAMS = muttng_dotlock pgpringng pgpewrapng makedoc
BUILT_SOURCES = keymap_defs.h patchlist.c
bin_PROGRAMS = muttng @DOTLOCK_TARGET@ @PGPAUX_TARGET@ @SMIMEAUX_TARGET@
-muttng_SOURCES = $(BUILT_SOURCES) \
- addrbook.c alias.c attach.c base64.c browser.c buffy.c color.c \
- compress.c crypt.c cryptglue.c \
- commands.c complete.c compose.c copy.c curs_lib.c curs_main.c date.c \
- edit.c enter.c flags.c init.c filter.c from.c getdomain.c \
- handler.c hash.c hdrline.c headers.c help.c hook.c keymap.c \
- main.c mbox.c menu.c mh.c mx.c pager.c parse.c pattern.c \
- postpone.c query.c recvattach.c recvcmd.c \
- rfc822.c rfc1524.c rfc2047.c rfc2231.c \
- score.c send.c sendlib.c signal.c sort.c \
- status.c system.c thread.c charset.c history.c lib.c \
- muttlib.c editmsg.c utf8.c mbyte.c wcwidth.c md5c.c \
- url.c ascii.c mutt_idna.c sidebar.c hcache.c crypt-mod.c crypt-mod.h
+muttng_SOURCES = $(BUILT_SOURCES) addrbook.c alias.c attach.c base64.c browser.c buffy.c color.c compress.c crypt.c cryptglue.c commands.c complete.c compose.c copy.c curs_lib.c curs_main.c date.c edit.c enter.c flags.c init.c filter.c from.c getdomain.c handler.c hash.c hdrline.c headers.c help.c hook.c keymap.c main.c mbox.c menu.c mh.c mx.c pager.c parse.c pattern.c postpone.c query.c recvattach.c recvcmd.c rfc822.c rfc1524.c rfc2047.c rfc2231.c score.c send.c sendlib.c signal.c sort.c status.c system.c thread.c charset.c history.c lib.c muttlib.c editmsg.c utf8.c mbyte.c wcwidth.c md5c.c url.c ascii.c mutt_idna.c sidebar.c hcache.c crypt-mod.c crypt-mod.h
-muttng_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
- $(INTLLIBS) $(LIBICONV)
+muttng_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) $(INTLLIBS) $(LIBICONV)
-muttng_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAPDEPS) \
- $(INTLDEPS)
+muttng_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAPDEPS) $(INTLDEPS)
makedoc_SOURCES = makedoc.c
makedoc_LDADD =
makedoc_DEPENDENCIES =
+# $(makedoc_OBJECTS): $(makedoc_SOURCES)
+# $(HOST_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) -c $<
+
+# makedoc: $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES)
+# @rm -rf makedoc
+# $(HOST_CC) $(AM_CFLAGS) $(LDFLAGS) $(makedoc_LDFLAGS) $(makedoc_OBJECTS) $(makedoc_LDADD) -o makedoc
+
+CPP = @CPP@
+
+DEFS = -DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" -DHAVE_CONFIG_H=1
+
+
INCLUDES = -I. -I$(top_srcdir) $(IMAP_INCLUDES) $(LIBGPGME_CFLAGS) -Iintl
-EXTRA_muttng_SOURCES = account.c md5c.c mutt_sasl.c mutt_socket.c mutt_ssl.c \
- mutt_tunnel.c pop.c pop_auth.c pop_lib.c smime.c pgp.c pgpinvoke.c pgpkey.c \
- pgplib.c sha1.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c \
- browser.h mbyte.h remailer.h url.h mutt_ssl_nss.c \
- pgppacket.c mutt_idna.h nntp.c newsrc.c mutt_libesmtp.c \
- sidebar.h crypt-mod-pgp-classic.c crypt-mod-smime-classic.c
-
-
-EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
- configure acconfig.h account.h \
- compress.h \
- attach.h buffy.h charset.h copy.h crypthash.h dotlock.h functions.h gen_defs \
- globals.h hash.h history.h init.h keymap.h mutt_crypt.h \
- mailbox.h mapping.h md5.h mime.h mutt.h mutt_curses.h mutt_menu.h \
- mutt_regex.h mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
- mx.h pager.h pgp.h pop.h protos.h reldate.h rfc1524.h rfc2047.h \
- rfc2231.h rfc822.h sha1.h sort.h mime.types VERSION prepare \
- nntp.h ChangeLog.nntp \
- _regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h \
- mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttngrc.head Muttngrc \
- makedoc.c stamp-doc-rc README.SSL smime.h\
- muttngbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
- ChangeLog.old mkchangelog.sh cvslog2changelog.pl mutt_idna.h \
- snprintf.c regex.c mutt_libesmtp.h crypt-gpgme.h
+CPPFLAGS = @CPPFLAGS@ -I$(includedir)
+
+EXTRA_muttng_SOURCES = account.c md5c.c mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_tunnel.c pop.c pop_auth.c pop_lib.c smime.c pgp.c pgpinvoke.c pgpkey.c pgplib.c sha1.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c browser.h mbyte.h remailer.h url.h mutt_ssl_nss.c pgppacket.c mutt_idna.h nntp.c newsrc.c mutt_libesmtp.c sidebar.h crypt-mod-pgp-classic.c crypt-mod-smime-classic.c
+
+
+EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO configure acconfig.h account.h compress.h attach.h buffy.h charset.h copy.h crypthash.h dotlock.h functions.h gen_defs globals.h hash.h history.h init.h keymap.h mutt_crypt.h mailbox.h mapping.h md5.h mime.h mutt.h mutt_curses.h mutt_menu.h mutt_regex.h mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h mx.h pager.h pgp.h pop.h protos.h reldate.h rfc1524.h rfc2047.h rfc2231.h rfc822.h sha1.h sort.h mime.types VERSION prepare nntp.h ChangeLog.nntp _regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttngrc.head Muttngrc makedoc.c stamp-doc-rc README.SSL smime.h muttngbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh ChangeLog.old mkchangelog.sh cvslog2changelog.pl mutt_idna.h snprintf.c regex.c mutt_libesmtp.h crypt-gpgme.h
muttng_dotlock_SOURCES = mutt_dotlock.c
pgpewrapng_LDADD =
pgpewrapng_DEPENDENCIES =
-CLEANFILES = mutt_dotlock.c stamp-doc-rc makedoc \
- keymap_alldefs.h keymap_defs.h patchlist.c
+CLEANFILES = mutt_dotlock.c stamp-doc-rc makedoc keymap_alldefs.h keymap_defs.h patchlist.c
ACLOCAL_AMFLAGS = -I m4
LDADD = @LIBOBJS@ @INTLLIBS@
-subdir = .
+
+OPS = @OPS@
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = intl/Makefile doc/Makefile contrib/Makefile \
- muttbug.sh Muttngrc.head doc/instdoc.sh
-EXTRA_PROGRAMS = muttng_dotlock$(EXEEXT) pgpringng$(EXEEXT) \
- pgpewrapng$(EXEEXT) makedoc$(EXEEXT)
-bin_PROGRAMS = muttng$(EXEEXT) @DOTLOCK_TARGET@ @PGPAUX_TARGET@ \
- @SMIMEAUX_TARGET@
-PROGRAMS = $(bin_PROGRAMS)
-
-am_makedoc_OBJECTS = makedoc.$(OBJEXT)
-makedoc_OBJECTS = $(am_makedoc_OBJECTS)
-makedoc_LDFLAGS =
-am__objects_1 = patchlist.$(OBJEXT)
-am_muttng_OBJECTS = $(am__objects_1) addrbook.$(OBJEXT) alias.$(OBJEXT) \
- attach.$(OBJEXT) base64.$(OBJEXT) browser.$(OBJEXT) \
- buffy.$(OBJEXT) color.$(OBJEXT) compress.$(OBJEXT) \
- crypt.$(OBJEXT) cryptglue.$(OBJEXT) commands.$(OBJEXT) \
- complete.$(OBJEXT) compose.$(OBJEXT) copy.$(OBJEXT) \
- curs_lib.$(OBJEXT) curs_main.$(OBJEXT) date.$(OBJEXT) \
- edit.$(OBJEXT) enter.$(OBJEXT) flags.$(OBJEXT) init.$(OBJEXT) \
- filter.$(OBJEXT) from.$(OBJEXT) getdomain.$(OBJEXT) \
- handler.$(OBJEXT) hash.$(OBJEXT) hdrline.$(OBJEXT) \
- headers.$(OBJEXT) help.$(OBJEXT) hook.$(OBJEXT) \
- keymap.$(OBJEXT) main.$(OBJEXT) mbox.$(OBJEXT) menu.$(OBJEXT) \
- mh.$(OBJEXT) mx.$(OBJEXT) pager.$(OBJEXT) parse.$(OBJEXT) \
- pattern.$(OBJEXT) postpone.$(OBJEXT) query.$(OBJEXT) \
- recvattach.$(OBJEXT) recvcmd.$(OBJEXT) rfc822.$(OBJEXT) \
- rfc1524.$(OBJEXT) rfc2047.$(OBJEXT) rfc2231.$(OBJEXT) \
- score.$(OBJEXT) send.$(OBJEXT) sendlib.$(OBJEXT) \
- signal.$(OBJEXT) sort.$(OBJEXT) status.$(OBJEXT) \
- system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \
- history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
- editmsg.$(OBJEXT) utf8.$(OBJEXT) mbyte.$(OBJEXT) \
- wcwidth.$(OBJEXT) md5c.$(OBJEXT) url.$(OBJEXT) ascii.$(OBJEXT) \
- mutt_idna.$(OBJEXT) sidebar.$(OBJEXT) hcache.$(OBJEXT) \
- crypt-mod.$(OBJEXT)
-muttng_OBJECTS = $(am_muttng_OBJECTS)
-muttng_LDFLAGS =
-am_muttng_dotlock_OBJECTS = mutt_dotlock.$(OBJEXT)
-muttng_dotlock_OBJECTS = $(am_muttng_dotlock_OBJECTS)
-muttng_dotlock_LDFLAGS =
-am_pgpewrapng_OBJECTS = pgpewrap.$(OBJEXT)
-pgpewrapng_OBJECTS = $(am_pgpewrapng_OBJECTS)
-pgpewrapng_LDFLAGS =
-am_pgpringng_OBJECTS = pgppubring.$(OBJEXT) pgplib.$(OBJEXT) \
- lib.$(OBJEXT) extlib.$(OBJEXT) sha1.$(OBJEXT) md5c.$(OBJEXT) \
- pgppacket.$(OBJEXT) ascii.$(OBJEXT)
-pgpringng_OBJECTS = $(am_pgpringng_OBJECTS)
-pgpringng_LDFLAGS =
-SCRIPTS = $(bin_SCRIPTS)
-
-
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CONFIG_CLEAN_FILES = muttbug.sh Muttngrc.head
+PROGRAMS = $(bin_PROGRAMS)
+
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+muttng_dotlock_OBJECTS = mutt_dotlock.o
+muttng_dotlock_LDFLAGS =
+pgpringng_OBJECTS = pgppubring.o pgplib.o lib.o extlib.o sha1.o md5c.o \
+pgppacket.o ascii.o
+pgpringng_LDFLAGS =
+pgpewrapng_OBJECTS = pgpewrap.o
+pgpewrapng_LDFLAGS =
+makedoc_OBJECTS = makedoc.o
+makedoc_LDFLAGS =
+muttng_OBJECTS = patchlist.o addrbook.o alias.o attach.o base64.o \
+browser.o buffy.o color.o compress.o crypt.o cryptglue.o commands.o \
+complete.o compose.o copy.o curs_lib.o curs_main.o date.o edit.o \
+enter.o flags.o init.o filter.o from.o getdomain.o handler.o hash.o \
+hdrline.o headers.o help.o hook.o keymap.o main.o mbox.o menu.o mh.o \
+mx.o pager.o parse.o pattern.o postpone.o query.o recvattach.o \
+recvcmd.o rfc822.o rfc1524.o rfc2047.o rfc2231.o score.o send.o \
+sendlib.o signal.o sort.o status.o system.o thread.o charset.o \
+history.o lib.o muttlib.o editmsg.o utf8.o mbyte.o wcwidth.o md5c.o \
+url.o ascii.o mutt_idna.o sidebar.o hcache.o crypt-mod.o
+muttng_LDFLAGS =
+SCRIPTS = $(bin_SCRIPTS)
+
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-DIST_SOURCES = $(makedoc_SOURCES) $(muttng_SOURCES) \
- $(EXTRA_muttng_SOURCES) $(muttng_dotlock_SOURCES) \
- $(pgpewrapng_SOURCES) $(pgpringng_SOURCES)
-
-RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
- ps-recursive install-info-recursive uninstall-info-recursive \
- all-recursive install-data-recursive install-exec-recursive \
- installdirs-recursive install-recursive uninstall-recursive \
- check-recursive installcheck-recursive
-DIST_COMMON = README ABOUT-NLS ChangeLog INSTALL Makefile.am \
- Makefile.in Muttngrc.head.in NEWS TODO acconfig.h aclocal.m4 \
- config.guess config.h.in config.sub configure configure.in \
- depcomp install-sh missing mkinstalldirs muttbug.sh.in regex.c \
- snprintf.c strcasecmp.c strdup.c
-DIST_SUBDIRS = m4 po intl doc contrib imap
-SOURCES = $(makedoc_SOURCES) $(muttng_SOURCES) $(EXTRA_muttng_SOURCES) $(muttng_dotlock_SOURCES) $(pgpewrapng_SOURCES) $(pgpringng_SOURCES)
-
-all: $(BUILT_SOURCES) config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = README ./stamp-h.in ABOUT-NLS ChangeLog INSTALL \
+Makefile.am Makefile.in Muttngrc.head.in NEWS TODO acconfig.h \
+aclocal.m4 config.guess config.h.in config.sub configure configure.in \
+install-sh missing mkinstalldirs muttbug.sh.in strcasecmp.c strdup.c
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign --ignore-deps Makefile
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
- cd $(srcdir) && $(AUTOCONF)
+TAR = tar
+GZIP_ENV = --best
+DIST_SUBDIRS = m4 po intl doc contrib imap
+SOURCES = $(muttng_dotlock_SOURCES) $(pgpringng_SOURCES) $(pgpewrapng_SOURCES) $(makedoc_SOURCES) $(muttng_SOURCES) $(EXTRA_muttng_SOURCES)
+OBJECTS = $(muttng_dotlock_OBJECTS) $(pgpringng_OBJECTS) $(pgpewrapng_OBJECTS) $(makedoc_OBJECTS) $(muttng_OBJECTS)
-$(ACLOCAL_M4): configure.in m4/codeset.m4 m4/curslib.m4 m4/funcdecl.m4 m4/gettext.m4 m4/glibc21.m4 m4/gssapi.m4 m4/iconv.m4 m4/lcmessage.m4 m4/libesmtp.m4 m4/libgnutls.m4 m4/progtest.m4 m4/types.m4
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .o .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): configure.in m4/codeset.m4 m4/curslib.m4 m4/funcdecl.m4 \
+ m4/gettext.m4 m4/glibc21.m4 m4/gssapi.m4 m4/iconv.m4 \
+ m4/lcmessage.m4 m4/libesmtp.m4 m4/libgnutls.m4 \
+ m4/progtest.m4 m4/types.m4
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-config.h: stamp-h1
+config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+config.h: stamp-h
+ @if test ! -f $@; then \
+ rm -f stamp-h; \
+ $(MAKE) stamp-h; \
+ else :; fi
+stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=config.h \
+ $(SHELL) ./config.status
+ @echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
@if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) stamp-h1; \
+ rm -f $(srcdir)/stamp-h.in; \
+ $(MAKE) $(srcdir)/stamp-h.in; \
else :; fi
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
-stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
+mostlyclean-hdr:
-$(srcdir)/config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h
- cd $(top_srcdir) && $(AUTOHEADER)
- touch $(srcdir)/config.h.in
+clean-hdr:
distclean-hdr:
- -rm -f config.h stamp-h1
-intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-doc/Makefile: $(top_builddir)/config.status $(top_srcdir)/doc/Makefile.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-contrib/Makefile: $(top_builddir)/config.status $(top_srcdir)/contrib/Makefile.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
+ -rm -f config.h
+
+maintainer-clean-hdr:
muttbug.sh: $(top_builddir)/config.status muttbug.sh.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
Muttngrc.head: $(top_builddir)/config.status Muttngrc.head.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-doc/instdoc.sh: $(top_builddir)/config.status $(top_srcdir)/doc/instdoc.sh.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+mostlyclean-binPROGRAMS:
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+distclean-binPROGRAMS:
+
+maintainer-clean-binPROGRAMS:
+
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
- $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
+ if test -f $$p; then \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
+ list='$(bin_PROGRAMS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
done
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-makedoc$(EXEEXT): $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES)
- @rm -f makedoc$(EXEEXT)
- $(LINK) $(makedoc_LDFLAGS) $(makedoc_OBJECTS) $(makedoc_LDADD) $(LIBS)
-muttng$(EXEEXT): $(muttng_OBJECTS) $(muttng_DEPENDENCIES)
- @rm -f muttng$(EXEEXT)
- $(LINK) $(muttng_LDFLAGS) $(muttng_OBJECTS) $(muttng_LDADD) $(LIBS)
-muttng_dotlock$(EXEEXT): $(muttng_dotlock_OBJECTS) $(muttng_dotlock_DEPENDENCIES)
- @rm -f muttng_dotlock$(EXEEXT)
+.c.o:
+ $(COMPILE) -c $<
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+muttng_dotlock: $(muttng_dotlock_OBJECTS) $(muttng_dotlock_DEPENDENCIES)
+ @rm -f muttng_dotlock
$(LINK) $(muttng_dotlock_LDFLAGS) $(muttng_dotlock_OBJECTS) $(muttng_dotlock_LDADD) $(LIBS)
-pgpewrapng$(EXEEXT): $(pgpewrapng_OBJECTS) $(pgpewrapng_DEPENDENCIES)
- @rm -f pgpewrapng$(EXEEXT)
- $(LINK) $(pgpewrapng_LDFLAGS) $(pgpewrapng_OBJECTS) $(pgpewrapng_LDADD) $(LIBS)
-pgpringng$(EXEEXT): $(pgpringng_OBJECTS) $(pgpringng_DEPENDENCIES)
- @rm -f pgpringng$(EXEEXT)
+
+pgpringng: $(pgpringng_OBJECTS) $(pgpringng_DEPENDENCIES)
+ @rm -f pgpringng
$(LINK) $(pgpringng_LDFLAGS) $(pgpringng_OBJECTS) $(pgpringng_LDADD) $(LIBS)
-binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+
+pgpewrapng: $(pgpewrapng_OBJECTS) $(pgpewrapng_DEPENDENCIES)
+ @rm -f pgpewrapng
+ $(LINK) $(pgpewrapng_LDFLAGS) $(pgpewrapng_OBJECTS) $(pgpewrapng_LDADD) $(LIBS)
+
+makedoc: $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES)
+ @rm -f makedoc
+ $(LINK) $(makedoc_LDFLAGS) $(makedoc_OBJECTS) $(makedoc_LDADD) $(LIBS)
+
+muttng: $(muttng_OBJECTS) $(muttng_DEPENDENCIES)
+ @rm -f muttng
+ $(LINK) $(muttng_LDFLAGS) $(muttng_OBJECTS) $(muttng_LDADD) $(LIBS)
+
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f $$d$$p; then \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \
- $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \
- else :; fi; \
+ if test -f $$p; then \
+ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+ $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+ else if test -f $(srcdir)/$$p; then \
+ echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+ $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+ else :; fi; fi; \
done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
- @list='$(bin_SCRIPTS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
+ list='$(bin_SCRIPTS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
done
-mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
-
-.c.obj:
- $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
-uninstall-info-am:
-
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @set fnord $$MAKEFLAGS; amf=$$2; \
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
- @set fnord $$MAKEFLAGS; amf=$$2; \
+ @set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
done; \
- rev="$$rev ."; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- mkid -fID $$unique
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
- if (etags --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- else \
- include_option=--include; \
- fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test -f $$subdir/TAGS && \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
done; \
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
+ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+mostlyclean-tags:
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+clean-tags:
distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = .
-distdir = $(PACKAGE)-$(VERSION)
+ -rm -f TAGS ID
-am__remove_distdir = \
- { test ! -d $(distdir) \
- || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -fr $(distdir); }; }
+maintainer-clean-tags:
-GZIP_ENV = --best
-distuninstallcheck_listfiles = find . -type f -print
-distcleancheck_listfiles = find . -type f -print
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
+ -rm -rf $(distdir)
+ @banner="$(distdir).tar.gz is ready for distribution"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
distdir: $(DISTFILES)
- $(am__remove_distdir)
+ -rm -rf $(distdir)
mkdir $(distdir)
- $(mkinstalldirs) $(distdir)/. $(distdir)/contrib $(distdir)/doc $(distdir)/intl $(distdir)/po
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
+ -chmod 777 $(distdir)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ for subdir in $(DIST_SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
- (cd $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$(top_distdir)" \
- distdir=../$(distdir)/$$subdir \
- distdir) \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$(top_distdir)" distdir="$(distdir)" \
- dist-hook
- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r $(distdir)
-dist-gzip: distdir
- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-dist dist-all: distdir
- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- $(am__remove_distdir)
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
- chmod -R a-w $(distdir); chmod a+w $(distdir)
- mkdir $(distdir)/_build
- mkdir $(distdir)/_inst
- chmod a-w $(distdir)
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && cd $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
- && rm -f $(distdir).tar.gz \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
- $(am__remove_distdir)
- @echo "$(distdir).tar.gz is ready for distribution" | \
- sed 'h;s/./=/g;p;x;p;x'
-distuninstallcheck:
- @cd $(distuninstallcheck_dir) \
- && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
+ $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
check-am: all-am
-check: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) check-recursive
-all-am: Makefile $(PROGRAMS) $(SCRIPTS) config.h
-installdirs: installdirs-recursive
-installdirs-am:
- $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+all-recursive-am: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
-install: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec-am: install-binPROGRAMS install-binSCRIPTS \
+ install-exec-local
install-exec: install-exec-recursive
+
+install-data-am: install-data-local
install-data: install-data-recursive
-uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
+install: install-recursive
+uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS
+uninstall: uninstall-recursive
+all-am: Makefile $(PROGRAMS) $(SCRIPTS) config.h
+all-redirect: all-recursive-am
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)
+
+
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-recursive
-
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-distclean-am: clean-am distclean-compile distclean-generic distclean-hdr \
- distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am: install-data-local
-
-install-exec-am: install-binPROGRAMS install-binSCRIPTS \
- install-exec-local
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
-maintainer-clean-am: distclean-am maintainer-clean-generic
+mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \
+ mostlyclean-compile mostlyclean-tags \
+ mostlyclean-generic
mostlyclean: mostlyclean-recursive
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \
+ clean-generic mostlyclean-am
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
+clean: clean-recursive
-ps-am:
+distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \
+ distclean-tags distclean-generic clean-am
-uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
- uninstall-info-am
+distclean: distclean-recursive
+ -rm -f config.status
-uninstall-info: uninstall-info-recursive
+maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
+ maintainer-clean-compile maintainer-clean-tags \
+ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
- clean-binPROGRAMS clean-generic clean-recursive ctags \
- ctags-recursive dist dist-all dist-gzip distcheck distclean \
- distclean-compile distclean-generic distclean-hdr \
- distclean-recursive distclean-tags distcleancheck distdir \
- distuninstallcheck dvi dvi-am dvi-recursive info info-am \
- info-recursive install install-am install-binPROGRAMS \
- install-binSCRIPTS install-data install-data-am \
- install-data-local install-data-recursive install-exec \
- install-exec-am install-exec-local install-exec-recursive \
- install-info install-info-am install-info-recursive install-man \
- install-recursive install-strip installcheck installcheck-am \
- installdirs installdirs-am installdirs-recursive \
- maintainer-clean maintainer-clean-generic \
- maintainer-clean-recursive mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-recursive pdf pdf-am \
- pdf-recursive ps ps-am ps-recursive tags tags-recursive \
- uninstall uninstall-am uninstall-binPROGRAMS \
- uninstall-binSCRIPTS uninstall-info-am uninstall-info-recursive \
- uninstall-recursive
+maintainer-clean: maintainer-clean-recursive
+ -rm -f config.status
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile uninstall-binSCRIPTS install-binSCRIPTS \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
+install-exec-local install-exec-am install-exec install-data-local \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
mutt_dotlock.c: dotlock.c
elif [ ! -f $(DESTDIR)$(sysconfdir)/Muttngrc ] ; then \
$(INSTALL) -m 644 $(srcdir)/Muttngrc $(DESTDIR)$(sysconfdir) ; \
fi
- -if [ ! -f $(DESTDIR)$(sysconfdir)/mime.types ]; then \
+ -if [ ! -f $(DESTDIR)$(sysconfdir)/muttng-mime.types ]; then \
$(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir)/muttng-mime.types; \
fi
.PHONY: commit pclean check-security commit-real commit-changelog
.PHONY: changelog ChangeLog
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
wide enough to hold a value of a pointer. For most ANSI compilers
ptrdiff_t and size_t should be likely OK. Still size of these two
types is 2 for Microsoft C. Ugh... */
-typedef long int s_reg_t;
-typedef unsigned long int active_reg_t;
+ typedef long int s_reg_t;
+ typedef unsigned long int active_reg_t;
/* The following bits are used to determine the regexp syntax we
recognize. The set/not-set meanings are chosen so that Emacs syntax
remains the value 0. The bits are given in alphabetical order, and
the definitions shifted by one from the previous bit; thus, when we
add or remove a bit, only one other definition need change. */
-typedef unsigned long int reg_syntax_t;
+ typedef unsigned long int reg_syntax_t;
/* If this bit is not set, then \ inside a bracket expression is literal.
If set, then such a \ quotes the following character. */
some interfaces). When a regexp is compiled, the syntax used is
stored in the pattern buffer, so changing this does not affect
already-compiled regexps. */
-extern reg_syntax_t re_syntax_options;
+ extern reg_syntax_t re_syntax_options;
\f
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
/* If any error codes are removed, changed, or added, update the
`re_error_msg' table in regex.c. */
-typedef enum
-{
- REG_NOERROR = 0, /* Success. */
- REG_NOMATCH, /* Didn't find a match (for regexec). */
-
- /* POSIX regcomp return error codes. (In the order listed in the
- standard.) */
- REG_BADPAT, /* Invalid pattern. */
- REG_ECOLLATE, /* Not implemented. */
- REG_ECTYPE, /* Invalid character class name. */
- REG_EESCAPE, /* Trailing backslash. */
- REG_ESUBREG, /* Invalid back reference. */
- REG_EBRACK, /* Unmatched left bracket. */
- REG_EPAREN, /* Parenthesis imbalance. */
- REG_EBRACE, /* Unmatched \{. */
- REG_BADBR, /* Invalid contents of \{\}. */
- REG_ERANGE, /* Invalid range end. */
- REG_ESPACE, /* Ran out of memory. */
- REG_BADRPT, /* No preceding re for repetition op. */
-
- /* Error codes we've added. */
- REG_EEND, /* Premature end. */
- REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
- REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
-} reg_errcode_t;
+ typedef enum {
+ REG_NOERROR = 0, /* Success. */
+ REG_NOMATCH, /* Didn't find a match (for regexec). */
+
+ /* POSIX regcomp return error codes. (In the order listed in the
+ standard.) */
+ REG_BADPAT, /* Invalid pattern. */
+ REG_ECOLLATE, /* Not implemented. */
+ REG_ECTYPE, /* Invalid character class name. */
+ REG_EESCAPE, /* Trailing backslash. */
+ REG_ESUBREG, /* Invalid back reference. */
+ REG_EBRACK, /* Unmatched left bracket. */
+ REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EBRACE, /* Unmatched \{. */
+ REG_BADBR, /* Invalid contents of \{\}. */
+ REG_ERANGE, /* Invalid range end. */
+ REG_ESPACE, /* Ran out of memory. */
+ REG_BADRPT, /* No preceding re for repetition op. */
+
+ /* Error codes we've added. */
+ REG_EEND, /* Premature end. */
+ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
+ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
+ } reg_errcode_t;
\f
/* This data structure represents a compiled pattern. Before calling
the pattern compiler, the fields `buffer', `allocated', `fastmap',
#define RE_TRANSLATE_TYPE char *
#endif
-struct re_pattern_buffer
-{
+ struct re_pattern_buffer {
/* [[[begin pattern_buffer]]] */
- /* Space that holds the compiled pattern. It is declared as
- `unsigned char *' because its elements are
- sometimes used as array indexes. */
- unsigned char *buffer;
-
- /* Number of bytes to which `buffer' points. */
- unsigned long int allocated;
-
- /* Number of bytes actually used in `buffer'. */
- unsigned long int used;
-
- /* Syntax setting with which the pattern was compiled. */
- reg_syntax_t syntax;
-
- /* Pointer to a fastmap, if any, otherwise zero. re_search uses
- the fastmap, if there is one, to skip over impossible
- starting points for matches. */
- char *fastmap;
-
- /* Either a translate table to apply to all characters before
- comparing them, or zero for no translation. The translation
- is applied to a pattern when it is compiled and to a string
- when it is matched. */
- RE_TRANSLATE_TYPE translate;
-
- /* Number of subexpressions found by the compiler. */
- size_t re_nsub;
-
- /* Zero if this pattern cannot match the empty string, one else.
- Well, in truth it's used only in `re_search_2', to see
- whether or not we should use the fastmap, so we don't set
- this absolutely perfectly; see `re_compile_fastmap' (the
- `duplicate' case). */
- unsigned can_be_null : 1;
-
- /* If REGS_UNALLOCATED, allocate space in the `regs' structure
- for `max (RE_NREGS, re_nsub + 1)' groups.
- If REGS_REALLOCATE, reallocate space if necessary.
- If REGS_FIXED, use what's there. */
+ /* Space that holds the compiled pattern. It is declared as
+ `unsigned char *' because its elements are
+ sometimes used as array indexes. */
+ unsigned char *buffer;
+
+ /* Number of bytes to which `buffer' points. */
+ unsigned long int allocated;
+
+ /* Number of bytes actually used in `buffer'. */
+ unsigned long int used;
+
+ /* Syntax setting with which the pattern was compiled. */
+ reg_syntax_t syntax;
+
+ /* Pointer to a fastmap, if any, otherwise zero. re_search uses
+ the fastmap, if there is one, to skip over impossible
+ starting points for matches. */
+ char *fastmap;
+
+ /* Either a translate table to apply to all characters before
+ comparing them, or zero for no translation. The translation
+ is applied to a pattern when it is compiled and to a string
+ when it is matched. */
+ RE_TRANSLATE_TYPE translate;
+
+ /* Number of subexpressions found by the compiler. */
+ size_t re_nsub;
+
+ /* Zero if this pattern cannot match the empty string, one else.
+ Well, in truth it's used only in `re_search_2', to see
+ whether or not we should use the fastmap, so we don't set
+ this absolutely perfectly; see `re_compile_fastmap' (the
+ `duplicate' case). */
+ unsigned can_be_null:1;
+
+ /* If REGS_UNALLOCATED, allocate space in the `regs' structure
+ for `max (RE_NREGS, re_nsub + 1)' groups.
+ If REGS_REALLOCATE, reallocate space if necessary.
+ If REGS_FIXED, use what's there. */
#define REGS_UNALLOCATED 0
#define REGS_REALLOCATE 1
#define REGS_FIXED 2
- unsigned regs_allocated : 2;
+ unsigned regs_allocated:2;
- /* Set to zero when `regex_compile' compiles a pattern; set to one
- by `re_compile_fastmap' if it updates the fastmap. */
- unsigned fastmap_accurate : 1;
+ /* Set to zero when `regex_compile' compiles a pattern; set to one
+ by `re_compile_fastmap' if it updates the fastmap. */
+ unsigned fastmap_accurate:1;
- /* If set, `re_match_2' does not return information about
- subexpressions. */
- unsigned no_sub : 1;
+ /* If set, `re_match_2' does not return information about
+ subexpressions. */
+ unsigned no_sub:1;
- /* If set, a beginning-of-line anchor doesn't match at the
- beginning of the string. */
- unsigned not_bol : 1;
+ /* If set, a beginning-of-line anchor doesn't match at the
+ beginning of the string. */
+ unsigned not_bol:1;
- /* Similarly for an end-of-line anchor. */
- unsigned not_eol : 1;
+ /* Similarly for an end-of-line anchor. */
+ unsigned not_eol:1;
- /* If true, an anchor at a newline matches. */
- unsigned newline_anchor : 1;
+ /* If true, an anchor at a newline matches. */
+ unsigned newline_anchor:1;
/* [[[end pattern_buffer]]] */
-};
+ };
-typedef struct re_pattern_buffer regex_t;
+ typedef struct re_pattern_buffer regex_t;
\f
/* Type for byte offsets within the string. POSIX mandates this. */
-typedef int regoff_t;
+ typedef int regoff_t;
/* This is the structure we store register match data in. See
regex.texinfo for a full description of what registers match. */
-struct re_registers
-{
- unsigned num_regs;
- regoff_t *start;
- regoff_t *end;
-};
+ struct re_registers {
+ unsigned num_regs;
+ regoff_t *start;
+ regoff_t *end;
+ };
/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
/* POSIX specification for registers. Aside from the different names than
`re_registers', POSIX uses an array of structures, instead of a
structure of arrays. */
-typedef struct
-{
- regoff_t rm_so; /* Byte offset from string's start to substring's start. */
- regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
-} regmatch_t;
+ typedef struct {
+ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
+ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
+ } regmatch_t;
\f
/* Declarations for routines. */
#define _RE_ARGS(args) args
-#else /* not __STDC__ */
+#else /* not __STDC__ */
#define _RE_ARGS(args) ()
-#endif /* not __STDC__ */
+#endif /* not __STDC__ */
/* Sets the current default syntax to SYNTAX, and return the old syntax.
You can also simply assign to the `re_syntax_options' variable. */
-extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
+ extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
/* Compile the regular expression PATTERN, with length LENGTH
and syntax given by the global `re_syntax_options', into the buffer
BUFFER. Return NULL if successful, and an error string if not. */
-extern const char *re_compile_pattern
- _RE_ARGS ((const char *pattern, size_t length,
- struct re_pattern_buffer *buffer));
+ extern const char *re_compile_pattern
+ _RE_ARGS ((const char *pattern, size_t length,
+ struct re_pattern_buffer * buffer));
/* Compile a fastmap for the compiled pattern in BUFFER; used to
accelerate searches. Return 0 if successful and -2 if was an
internal error. */
-extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
+ extern int re_compile_fastmap
+ _RE_ARGS ((struct re_pattern_buffer * buffer));
/* Search in the string STRING (with length LENGTH) for the pattern
characters. Return the starting position of the match, -1 for no
match, or -2 for an internal error. Also return register
information in REGS (if REGS and BUFFER->no_sub are nonzero). */
-extern int re_search
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
- int length, int start, int range, struct re_registers *regs));
+ extern int re_search
+ _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string,
+ int length, int start, int range, struct re_registers * regs));
/* Like `re_search', but search in the concatenation of STRING1 and
STRING2. Also, stop searching at index START + STOP. */
-extern int re_search_2
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
- int length1, const char *string2, int length2,
- int start, int range, struct re_registers *regs, int stop));
+ extern int re_search_2
+ _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, int range, struct re_registers * regs, int stop));
/* Like `re_search', but return how many characters in STRING the regexp
in BUFFER matched, starting at position START. */
-extern int re_match
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
- int length, int start, struct re_registers *regs));
+ extern int re_match
+ _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string,
+ int length, int start, struct re_registers * regs));
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
-extern int re_match_2
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
- int length1, const char *string2, int length2,
- int start, struct re_registers *regs, int stop));
+ extern int re_match_2
+ _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, struct re_registers * regs, int stop));
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
Unless this function is called, the first search or match using
PATTERN_BUFFER will allocate its own register data, without
freeing the old data. */
-extern void re_set_registers
- _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
- unsigned num_regs, regoff_t *starts, regoff_t *ends));
+ extern void re_set_registers
+ _RE_ARGS ((struct re_pattern_buffer * buffer, struct re_registers * regs,
+ unsigned num_regs, regoff_t * starts, regoff_t * ends));
#ifdef _REGEX_RE_COMP
#ifndef _CRAY
/* 4.2 bsd compatibility. */
-extern char *re_comp _RE_ARGS ((const char *));
-extern int re_exec _RE_ARGS ((const char *));
+ extern char *re_comp _RE_ARGS ((const char *));
+ extern int re_exec _RE_ARGS ((const char *));
#endif
#endif
/* POSIX compatibility. */
-extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
-extern int regexec
- _RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch,
- regmatch_t pmatch[], int eflags));
-extern size_t regerror
- _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
- size_t errbuf_size));
-extern void regfree _RE_ARGS ((regex_t *preg));
+ extern int regcomp
+ _RE_ARGS ((regex_t * preg, const char *pattern, int cflags));
+ extern int regexec
+ _RE_ARGS ((const regex_t * preg, const char *string, size_t nmatch,
+ regmatch_t pmatch[], int eflags));
+ extern size_t regerror
+ _RE_ARGS ((int errcode, const regex_t * preg, char *errbuf,
+ size_t errbuf_size));
+ extern void regfree _RE_ARGS ((regex_t * preg));
#ifdef __cplusplus
}
-#endif /* C++ */
-
-#endif /* not __REGEXP_LIBRARY_H__ */
-\f
-/*
+#endif /* C++ */
+#endif /* not __REGEXP_LIBRARY_H__ */
+\f/*
Local variables:
make-backup-files: t
version-control: t
#undef USE_NNTP
/* The compressed mailboxes support */
#undef USE_COMPRESSED
-
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- */
+ */
/* remote host account manipulation (POP/IMAP) */
#include "url.h"
/* mutt_account_match: compare account info (host/port/user) */
-int mutt_account_match (const ACCOUNT* a1, const ACCOUNT* a2)
+int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * a2)
{
- const char* user = NONULL (Username);
+ const char *user = NONULL (Username);
if (a1->type != a2->type)
return 0;
if (a1->type == M_ACCT_TYPE_POP && PopUser)
user = PopUser;
#endif
-
+
#ifdef USE_NNTP
if (a1->type == M_ACCT_TYPE_NNTP && NntpUser)
user = NntpUser;
}
/* mutt_account_fromurl: fill account with information from url. */
-int mutt_account_fromurl (ACCOUNT* account, ciss_url_t* url)
+int mutt_account_fromurl (ACCOUNT * account, ciss_url_t * url)
{
/* must be present */
if (url->host)
else
return -1;
- if (url->user)
- {
+ if (url->user) {
strfcpy (account->user, url->user, sizeof (account->user));
account->flags |= M_ACCT_USER;
}
- if (url->pass)
- {
+ if (url->pass) {
strfcpy (account->pass, url->pass, sizeof (account->pass));
account->flags |= M_ACCT_PASS;
}
- if (url->port)
- {
+ if (url->port) {
account->port = url->port;
account->flags |= M_ACCT_PORT;
}
* is a set of pointers into account - don't free or edit account until
* you've finished with url (make a copy of account if you need it for
* a while). */
-void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url)
+void mutt_account_tourl (ACCOUNT * account, ciss_url_t * url)
{
url->scheme = U_UNKNOWN;
url->user = NULL;
url->port = 0;
#ifdef USE_IMAP
- if (account->type == M_ACCT_TYPE_IMAP)
- {
+ if (account->type == M_ACCT_TYPE_IMAP) {
if (account->flags & M_ACCT_SSL)
url->scheme = U_IMAPS;
else
#endif
#ifdef USE_POP
- if (account->type == M_ACCT_TYPE_POP)
- {
+ if (account->type == M_ACCT_TYPE_POP) {
if (account->flags & M_ACCT_SSL)
url->scheme = U_POPS;
else
#endif
#ifdef USE_NNTP
- if (account->type == M_ACCT_TYPE_NNTP)
- {
+ if (account->type == M_ACCT_TYPE_NNTP) {
if (account->flags & M_ACCT_SSL)
url->scheme = U_NNTPS;
else
}
/* mutt_account_getuser: retrieve username into ACCOUNT, if neccessary */
-int mutt_account_getuser (ACCOUNT* account)
+int mutt_account_getuser (ACCOUNT * account)
{
char prompt[SHORT_STRING];
strfcpy (account->user, NntpUser, sizeof (account->user));
#endif
/* prompt (defaults to unix username), copy into account->user */
- else
- {
+ else {
snprintf (prompt, sizeof (prompt), _("Username at %s: "), account->host);
strfcpy (account->user, NONULL (Username), sizeof (account->user));
if (mutt_get_field (prompt, account->user, sizeof (account->user), 0))
}
/* mutt_account_getpass: fetch password into ACCOUNT, if neccessary */
-int mutt_account_getpass (ACCOUNT* account)
+int mutt_account_getpass (ACCOUNT * account)
{
char prompt[SHORT_STRING];
else if ((account->type == M_ACCT_TYPE_NNTP) && NntpPass)
strfcpy (account->pass, NntpPass, sizeof (account->pass));
#endif
- else
- {
+ else {
snprintf (prompt, sizeof (prompt), _("Password for %s@%s: "),
- account->user, account->host);
+ account->user, account->host);
account->pass[0] = '\0';
if (mutt_get_password (prompt, account->pass, sizeof (account->pass)))
return -1;
return 0;
}
-void mutt_account_unsetpass (ACCOUNT* account)
+void mutt_account_unsetpass (ACCOUNT * account)
{
account->flags &= !M_ACCT_PASS;
}
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- */
+ */
/* remote host account manipulation (POP/IMAP) */
#include "url.h"
/* account types */
-enum
-{
+enum {
M_ACCT_TYPE_NONE = 0,
M_ACCT_TYPE_IMAP,
M_ACCT_TYPE_NNTP,
#define M_ACCT_PASS (1<<2)
#define M_ACCT_SSL (1<<3)
-typedef struct
-{
+typedef struct {
char user[64];
char pass[64];
char host[128];
unsigned char flags;
} ACCOUNT;
-int mutt_account_match (const ACCOUNT* a1, const ACCOUNT* m2);
-int mutt_account_fromurl (ACCOUNT* account, ciss_url_t* url);
-void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url);
-int mutt_account_getuser (ACCOUNT* account);
-int mutt_account_getpass (ACCOUNT* account);
-void mutt_account_unsetpass (ACCOUNT* account);
+int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * m2);
+int mutt_account_fromurl (ACCOUNT * account, ciss_url_t * url);
+void mutt_account_tourl (ACCOUNT * account, ciss_url_t * url);
+int mutt_account_getuser (ACCOUNT * account);
+int mutt_account_getpass (ACCOUNT * account);
+void mutt_account_unsetpass (ACCOUNT * account);
#endif /* _MUTT_ACCOUNT_H_ */
-# generated automatically by aclocal 1.7.6 -*- Autoconf -*-
+dnl aclocal.m4 generated automatically by aclocal 1.4-p4
+
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+# lib-prefix.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
-
-# Copyright 1996, 1997, 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 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 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+dnl From Bruno Haible.
-AC_PREREQ([2.52])
+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+ AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_LIB_ARG_WITH([lib-prefix],
+[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+ --without-lib-prefix don't search for libraries in includedir and libdir],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/lib"
+ fi
+ fi
+])
+ if test $use_additional = yes; then
+ dnl Potentially add $additional_includedir to $CPPFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's already present in $CPPFLAGS,
+ dnl 3. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ for x in $CPPFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $CPPFLAGS.
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ dnl Potentially add $additional_libdir to $LDFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's already present in $LDFLAGS,
+ dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/lib"; then
+ haveit=
+ for x in $LDFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LDFLAGS.
+ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ fi
+])
-# serial 6
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+ dnl Unfortunately, prefix and exec_prefix get only finally determined
+ dnl at the end of configure.
+ if test "X$prefix" = "XNONE"; then
+ acl_final_prefix="$ac_default_prefix"
+ else
+ acl_final_prefix="$prefix"
+ fi
+ if test "X$exec_prefix" = "XNONE"; then
+ acl_final_exec_prefix='${prefix}'
+ else
+ acl_final_exec_prefix="$exec_prefix"
+ fi
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+ prefix="$acl_save_prefix"
+])
-# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ $1
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+])
-# Do all the work for Automake. -*- Autoconf -*-
+# lib-link.m4 serial 4 (gettext-0.12)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
-# This macro actually does too much some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
+dnl From Bruno Haible.
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ define([Name],[translit([$1],[./-], [___])])
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+ ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+ ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+ ])
+ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+ dnl results of this search when this library appears as a dependency.
+ HAVE_LIB[]NAME=yes
+ undefine([Name])
+ undefine([NAME])
+])
-# 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, or (at your option)
-# any later version.
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. If found, it
+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ define([Name],[translit([$1],[./-], [___])])
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+
+ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed lib[]Name and not disabled its use
+ dnl via --without-lib[]Name-prefix, he wants to use it.
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIB[]NAME"
+ AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+ LIBS="$ac_save_LIBS"
+ ])
+ if test "$ac_cv_lib[]Name" = yes; then
+ HAVE_LIB[]NAME=yes
+ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+ AC_MSG_CHECKING([how to link with lib[]$1])
+ AC_MSG_RESULT([$LIB[]NAME])
+ else
+ HAVE_LIB[]NAME=no
+ dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+ dnl $INC[]NAME either.
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIB[]NAME=
+ LTLIB[]NAME=
+ fi
+ AC_SUBST([HAVE_LIB]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ undefine([Name])
+ undefine([NAME])
+])
-# 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.
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
+dnl hardcode_direct, hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
+ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
+ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+ AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+ ])
+ wl="$acl_cv_wl"
+ libext="$acl_cv_libext"
+ shlibext="$acl_cv_shlibext"
+ hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ hardcode_direct="$acl_cv_hardcode_direct"
+ hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ dnl Determine whether the user wants rpath handling at all.
+ AC_ARG_ENABLE(rpath,
+ [ --disable-rpath do not hardcode runtime library paths],
+ :, enable_rpath=yes)
+])
-# 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_LIB_ARG_WITH([lib$1-prefix],
+[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
+ --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/lib"
+ fi
+ fi
+])
+ dnl Search the library and its dependencies in $additional_libdir and
+ dnl $LDFLAGS. Using breadth-first-seach.
+ LIB[]NAME=
+ LTLIB[]NAME=
+ INC[]NAME=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='$1 $2'
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+ dnl or AC_LIB_HAVE_LINKFLAGS call.
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+ else
+ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+ dnl that this library doesn't exist. So just drop it.
+ :
+ fi
+ else
+ dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+ dnl and the already constructed $LIBNAME/$LTLIBNAME.
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ if test $use_additional = yes; then
+ if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+ found_dir="$additional_libdir"
+ found_so="$additional_libdir/lib$name.$shlibext"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ else
+ if test -f "$additional_libdir/lib$name.$libext"; then
+ found_dir="$additional_libdir"
+ found_a="$additional_libdir/lib$name.$libext"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+ found_dir="$dir"
+ found_so="$dir/lib$name.$shlibext"
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ else
+ if test -f "$dir/lib$name.$libext"; then
+ found_dir="$dir"
+ found_a="$dir/lib$name.$libext"
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ dnl Found the library.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ dnl Linking with a shared library. We attempt to hardcode its
+ dnl directory into the executable's runpath, unless it's the
+ dnl standard /usr/lib.
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+ dnl No hardcoding is needed.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ dnl The hardcoding into $LIBNAME is system dependent.
+ if test "$hardcode_direct" = yes; then
+ dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+ dnl resulting binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ dnl Rely on "-L$found_dir".
+ dnl But don't add it if it's already contained in the LDFLAGS
+ dnl or the already constructed $LIBNAME
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+ fi
+ if test "$hardcode_minus_L" != no; then
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
+ dnl here, because this doesn't fit in flags passed to the
+ dnl compiler. So give up. No hardcoding. This affects only
+ dnl very old systems.
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ dnl Linking with a static library.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+ else
+ dnl We shouldn't come here, but anyway it's good to have a
+ dnl fallback.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+ fi
+ fi
+ dnl Assume the include files are nearby.
+ additional_includedir=
+ case "$found_dir" in
+ */lib | */lib/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ dnl Potentially add $additional_includedir to $INCNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 3. if it's already present in $CPPFLAGS or the already
+ dnl constructed $INCNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INC[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $INCNAME.
+ INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ dnl Look for dependencies.
+ if test -n "$found_la"; then
+ dnl Read the .la file. It defines the variables
+ dnl dlname, library_names, old_library, dependency_libs, current,
+ dnl age, revision, installed, dlopen, dlpreopen, libdir.
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ dnl We use only dependency_libs.
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 3. if it's already present in $LDFLAGS or the already
+ dnl constructed $LIBNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/lib"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LIBNAME.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LTLIBNAME.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ dnl Handle this in the next round.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ dnl Handle this in the next round. Throw away the .la's
+ dnl directory; it is already contained in a preceding -L
+ dnl option.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ dnl Most likely an immediate library name.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ dnl Didn't find the library; assume it is in the system directories
+ dnl known to the linker and runtime loader. (All the system
+ dnl directories known to the linker should also be known to the
+ dnl runtime loader, otherwise the system is severely misconfigured.)
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user must
+ dnl pass all path elements in one option. We can arrange that for a
+ dnl single library, but not when more than one $LIBNAMEs are used.
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+ done
+ dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ dnl When using libtool, the option that works for both libraries and
+ dnl executables is -R. The -R options are cumulative.
+ for found_dir in $ltrpathdirs; do
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+ done
+ fi
+])
-# serial 10
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+ for element in [$2]; do
+ haveit=
+ for x in $[$1]; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ [$1]="${[$1]}${[$1]:+ }$element"
+ fi
+ done
+])
-AC_PREREQ([2.54])
-
-# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
-# the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
- AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-fi
+# lib-ld.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
+dnl with libtool.m4.
+
+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes ;;
+*)
+ acl_cv_prog_gnu_ld=no ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
+dnl From libtool-1.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
else
- CYGPATH_W=echo
+ PATH_SEPARATOR=:
fi
+ rm -f conf$$.sh
fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_MISSING_PROG(AMTAR, tar)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-])
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]* | [A-Za-z]:[\\/]*)]
+ [re_direlt='/[^/][^/]*/\.\./']
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(acl_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break ;;
+ *)
+ test "$with_gnu_ld" != yes && break ;;
+ esac
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
])
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $1 | $1:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated. We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+ case " <<$>>CONFIG_HEADERS " in
+ *" <<$>>am_file "*<<)>>
+ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+ ;;
esac
-done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-
-# Copyright 2002 Free Software Foundation, Inc.
-
-# 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, 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., 59 Temple Place - Suite 330, Boston, MA
+ am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.7.6])])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright 2001, 2002 Free Software Foundation, Inc.
-
-# 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, 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 2
+# serial 1
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
#
# Check to make sure that the build environment is sane.
#
-# Copyright 1996, 1997, 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 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 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 3
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
+AC_DEFUN(AM_SANITY_CHECK,
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
-echo timestamp > conftest.file
+echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
+ set X `ls -t $srcdir/configure conftestfile`
fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
alias in your environment])
fi
- test "$[2]" = conftest.file
+ test "[$]2" = conftestfile
)
then
# Ok.
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
+rm -f conftest*
AC_MSG_RESULT(yes)])
-# -*- Autoconf -*-
-
-
-# Copyright 1997, 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 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 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 3
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# AM_AUX_DIR_EXPAND
-
-# Copyright 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 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 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-# Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])
-
-AC_DEFUN([AM_AUX_DIR_EXPAND], [
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-
-# Copyright 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 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 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-
-# AM_PROG_INSTALL_STRIP
-
-# Copyright 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 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 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# -*- Autoconf -*-
-# Copyright (C) 2003 Free Software Foundation, Inc.
-
-# 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, 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 1
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# serial 5 -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-# 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, 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- : > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # (even with -Werror). So we grep stderr for any message
- # that says an option was ignored.
- if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking Speeds up one-time builds
- --enable-dependency-tracking Do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-
-# 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, 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-#serial 2
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
- # Extract the definition of DEP_FILES from the Makefile without
- # running `make'.
- DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
- test -z "$DEPDIR" && continue
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n -e '/^U = / s///p' < "$mf"`
- test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
- # We invoke sed twice because it is the simplest approach to
- # changing $(DEPDIR) to its actual value in the expansion.
- for file in `sed -n -e '
- /^DEP_FILES = .*\\\\$/ {
- s/^DEP_FILES = //
- :loop
- s/\\\\$//
- p
- n
- /\\\\$/ b loop
- p
- }
- /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-
-# 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, 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 2
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright 1997, 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 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 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 5
+AC_SUBST($1)])
-AC_PREREQ(2.52)
+# isc-posix.m4 serial 2 (gettext-0.11.2)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.])
-fi])])
+# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
-#serial 1
# This test replaces the one in autoconf.
# Currently this macro should have the same name as the autoconf macro
# because gettext's gettext.m4 (distributed in the automake package)
)
-# Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
-
-# 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, 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 2
+# serial 1
-AC_DEFUN([AM_C_PROTOTYPES],
+AC_DEFUN(AM_C_PROTOTYPES,
[AC_REQUIRE([AM_PROG_CC_STDC])
AC_REQUIRE([AC_PROG_CPP])
AC_MSG_CHECKING([for function prototypes])
else
AC_MSG_RESULT(no)
U=_ ANSI2KNR=./ansi2knr
+ # Ensure some checks needed by ansi2knr itself.
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS(string.h)
fi
-# Ensure some checks needed by ansi2knr itself.
-AC_HEADER_STDC
-AC_CHECK_HEADERS(string.h)
AC_SUBST(U)dnl
AC_SUBST(ANSI2KNR)dnl
])
-AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
-
-# Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-
-# 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, 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 2
+# serial 1
# @defmac AC_PROG_CC_STDC
# @maindex PROG_CC_STDC
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
-AC_DEFUN([AM_PROG_CC_STDC],
+AC_DEFUN(AM_PROG_CC_STDC,
[AC_REQUIRE([AC_PROG_CC])
AC_BEFORE([$0], [AC_C_INLINE])
AC_BEFORE([$0], [AC_C_CONST])
dnl FIXME: can't do this because then AC_AIX won't work due to a
dnl circular dependency.
dnl AC_BEFORE([$0], [AC_PROG_CPP])
-AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
+AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
AC_CACHE_VAL(am_cv_prog_cc_stdc,
[am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
+# HP-UX -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
if test -z "$am_cv_prog_cc_stdc"; then
AC_MSG_RESULT([none needed])
else
- AC_MSG_RESULT([$am_cv_prog_cc_stdc])
+ AC_MSG_RESULT($am_cv_prog_cc_stdc)
fi
case "x$am_cv_prog_cc_stdc" in
x|xno) ;;
esac
])
-AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
-
dnl types.m4
dnl macros for type checks not covered by autoconf
])dnl
dnl ---------------------------------------------------------------------------
+# Define a conditional.
+
+AC_DEFUN(AM_CONDITIONAL,
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
+
# gssapi.m4: Find GSSAPI libraries in either Heimdal or MIT implementations
# Brendan Cully <brendan@kublai.com> 20010529
AC_SUBST($1)dnl
])
-#serial 2
+# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
# Test for the GNU C Library, version 2.1 or newer.
# From Bruno Haible.
-AC_DEFUN([MUTT_jm_GLIBC21],
+AC_DEFUN([jm_GLIBC21],
[
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
ac_cv_gnu_library_2_1,
fi
fi])
+#serial 2
+
+# Test for the GNU C Library, version 2.1 or newer.
+# From Bruno Haible.
+
+AC_DEFUN([MUTT_jm_GLIBC21],
+ [
+ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
+ ac_cv_gnu_library_2_1,
+ [AC_EGREP_CPP([Lucky GNU user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ ac_cv_gnu_library_2_1=yes,
+ ac_cv_gnu_library_2_1=no)
+ ]
+ )
+ AC_SUBST(GLIBC21)
+ GLIBC21="$ac_cv_gnu_library_2_1"
+ ]
+)
+
dnl vim:ft=config:
dnl Search for libesmtp, by Steven Engelhardt <sengelha@yahoo.com>
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- */
+ */
#if HAVE_CONFIG_H
# include "config.h"
#define RSORT(x) (SortAlias & SORT_REVERSE) ? -x : x
static struct mapping_t AliasHelp[] = {
- { N_("Exit"), OP_EXIT },
- { N_("Del"), OP_DELETE },
- { N_("Undel"), OP_UNDELETE },
- { N_("Select"), OP_GENERIC_SELECT_ENTRY },
- { N_("Help"), OP_HELP },
- { NULL }
+ {N_("Exit"), OP_EXIT},
+ {N_("Del"), OP_DELETE},
+ {N_("Undel"), OP_UNDELETE},
+ {N_("Select"), OP_GENERIC_SELECT_ENTRY},
+ {N_("Help"), OP_HELP},
+ {NULL}
};
-static const char *
-alias_format_str (char *dest, size_t destlen, char op, const char *src,
- const char *fmt, const char *ifstring, const char *elsestring,
- unsigned long data, format_flag flags)
+static const char *alias_format_str (char *dest, size_t destlen, char op,
+ const char *src, const char *fmt,
+ const char *ifstring,
+ const char *elsestring,
+ unsigned long data, format_flag flags)
{
char tmp[SHORT_STRING], adr[SHORT_STRING];
ALIAS *alias = (ALIAS *) data;
- switch (op)
- {
- case 'f':
- snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
- snprintf (dest, destlen, tmp, alias->del ? "D" : " ");
- break;
- case 'a':
- mutt_format_s (dest, destlen, fmt, alias->name);
- break;
- case 'r':
- adr[0] = 0;
- rfc822_write_address (adr, sizeof (adr), alias->addr, 1);
- snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
- snprintf (dest, destlen, tmp, adr);
- break;
- case 'n':
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, alias->num + 1);
- break;
- case 't':
- dest[0] = alias->tagged ? '*' : ' ';
- dest[1] = 0;
- break;
+ switch (op) {
+ case 'f':
+ snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
+ snprintf (dest, destlen, tmp, alias->del ? "D" : " ");
+ break;
+ case 'a':
+ mutt_format_s (dest, destlen, fmt, alias->name);
+ break;
+ case 'r':
+ adr[0] = 0;
+ rfc822_write_address (adr, sizeof (adr), alias->addr, 1);
+ snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
+ snprintf (dest, destlen, tmp, adr);
+ break;
+ case 'n':
+ snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+ snprintf (dest, destlen, tmp, alias->num + 1);
+ break;
+ case 't':
+ dest[0] = alias->tagged ? '*' : ' ';
+ dest[1] = 0;
+ break;
}
return (src);
}
-static void alias_entry (char *s, size_t slen, MUTTMENU *m, int num)
+static void alias_entry (char *s, size_t slen, MUTTMENU * m, int num)
{
- mutt_FormatString (s, slen, NONULL (AliasFmt), alias_format_str, (unsigned long) ((ALIAS **) m->data)[num], M_FORMAT_ARROWCURSOR);
+ mutt_FormatString (s, slen, NONULL (AliasFmt), alias_format_str,
+ (unsigned long) ((ALIAS **) m->data)[num],
+ M_FORMAT_ARROWCURSOR);
}
-static int alias_tag (MUTTMENU *menu, int n, int m)
+static int alias_tag (MUTTMENU * menu, int n, int m)
{
ALIAS *cur = ((ALIAS **) menu->data)[n];
int ot = cur->tagged;
-
+
cur->tagged = (m >= 0 ? m : !cur->tagged);
-
+
return cur->tagged - ot;
}
r = -1;
else if (pb == NULL)
r = 1;
- else if (pa->personal)
- {
+ else if (pa->personal) {
if (pb->personal)
r = mutt_strcasecmp (pa->personal, pb->personal);
else
return (RSORT (r));
}
-void mutt_alias_menu (char *buf, size_t buflen, ALIAS *aliases)
+void mutt_alias_menu (char *buf, size_t buflen, ALIAS * aliases)
{
ALIAS *aliasp;
MUTTMENU *menu;
char helpstr[SHORT_STRING];
int omax;
-
- if (!aliases)
- {
+
+ if (!aliases) {
mutt_error _("You have no aliases!");
+
return;
}
-
+
/* tell whoever called me to redraw the screen when I return */
set_option (OPTNEEDREDRAW);
-
+
menu = mutt_new_menu ();
menu->make_entry = alias_entry;
menu->tag = alias_tag;
menu->menu = MENU_ALIAS;
menu->title = _("Aliases");
- menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_ALIAS, AliasHelp);
+ menu->help =
+ mutt_compile_help (helpstr, sizeof (helpstr), MENU_ALIAS, AliasHelp);
new_aliases:
omax = menu->max;
-
+
/* count the number of aliases */
- for (aliasp = aliases; aliasp; aliasp = aliasp->next)
- {
- aliasp->self->del = 0;
+ for (aliasp = aliases; aliasp; aliasp = aliasp->next) {
+ aliasp->self->del = 0;
aliasp->self->tagged = 0;
menu->max++;
}
safe_realloc (&AliasTable, menu->max * sizeof (ALIAS *));
menu->data = AliasTable;
- for (i = omax, aliasp = aliases; aliasp; aliasp = aliasp->next, i++)
- {
+ for (i = omax, aliasp = aliases; aliasp; aliasp = aliasp->next, i++) {
AliasTable[i] = aliasp->self;
- aliases = aliasp;
+ aliases = aliasp;
}
- if ((SortAlias & SORT_MASK) != SORT_ORDER)
- {
+ if ((SortAlias & SORT_MASK) != SORT_ORDER) {
qsort (AliasTable, i, sizeof (ALIAS *),
- (SortAlias & SORT_MASK) == SORT_ADDRESS ? alias_SortAddress : alias_SortAlias);
+ (SortAlias & SORT_MASK) ==
+ SORT_ADDRESS ? alias_SortAddress : alias_SortAlias);
}
- for (i=0; i<menu->max; i++) AliasTable[i]->num = i;
+ for (i = 0; i < menu->max; i++)
+ AliasTable[i]->num = i;
- while (!done)
- {
- if (aliases->next)
- {
+ while (!done) {
+ if (aliases->next) {
menu->redraw |= REDRAW_FULL;
- aliases = aliases->next;
+ aliases = aliases->next;
goto new_aliases;
}
-
- switch ((op = mutt_menuLoop (menu)))
- {
- case OP_DELETE:
- case OP_UNDELETE:
- if (menu->tagprefix)
- {
- for (i = 0; i < menu->max; i++)
- if (AliasTable[i]->tagged)
- AliasTable[i]->del = (op == OP_DELETE) ? 1 : 0;
- menu->redraw |= REDRAW_INDEX;
- }
- else
- {
- AliasTable[menu->current]->self->del = (op == OP_DELETE) ? 1 : 0;
- menu->redraw |= REDRAW_CURRENT;
- if (option (OPTRESOLVE) && menu->current < menu->max - 1)
- {
- menu->current++;
- menu->redraw |= REDRAW_INDEX;
- }
- }
- break;
- case OP_GENERIC_SELECT_ENTRY:
- t = menu->current;
- case OP_EXIT:
- done = 1;
- break;
+
+ switch ((op = mutt_menuLoop (menu))) {
+ case OP_DELETE:
+ case OP_UNDELETE:
+ if (menu->tagprefix) {
+ for (i = 0; i < menu->max; i++)
+ if (AliasTable[i]->tagged)
+ AliasTable[i]->del = (op == OP_DELETE) ? 1 : 0;
+ menu->redraw |= REDRAW_INDEX;
+ }
+ else {
+ AliasTable[menu->current]->self->del = (op == OP_DELETE) ? 1 : 0;
+ menu->redraw |= REDRAW_CURRENT;
+ if (option (OPTRESOLVE) && menu->current < menu->max - 1) {
+ menu->current++;
+ menu->redraw |= REDRAW_INDEX;
+ }
+ }
+ break;
+ case OP_GENERIC_SELECT_ENTRY:
+ t = menu->current;
+ case OP_EXIT:
+ done = 1;
+ break;
}
}
- for (i = 0; i < menu->max; i++)
- {
- if (AliasTable[i]->tagged)
- {
+ for (i = 0; i < menu->max; i++) {
+ if (AliasTable[i]->tagged) {
mutt_addrlist_to_local (AliasTable[i]->addr);
rfc822_write_address (buf, buflen, AliasTable[i]->addr, 0);
t = -1;
}
}
- if(t != -1)
- {
- mutt_addrlist_to_local (AliasTable[t]->addr);
+ if (t != -1) {
+ mutt_addrlist_to_local (AliasTable[t]->addr);
rfc822_write_address (buf, buflen, AliasTable[t]->addr, 0);
}
mutt_menuDestroy (&menu);
FREE (&AliasTable);
-
+
}
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- */
+ */
#if HAVE_CONFIG_H
# include "config.h"
for (; t; t = t->next)
if (!mutt_strcasecmp (s, t->name))
return (t->addr);
- return (NULL); /* no such alias */
+ return (NULL); /* no such alias */
}
-static ADDRESS *mutt_expand_aliases_r (ADDRESS *a, LIST **expn)
+static ADDRESS *mutt_expand_aliases_r (ADDRESS * a, LIST ** expn)
{
ADDRESS *head = NULL, *last = NULL, *t, *w;
LIST *u;
char i;
const char *fqdn;
-
- while (a)
- {
- if (!a->group && !a->personal && a->mailbox && strchr (a->mailbox, '@') == NULL)
- {
+
+ while (a) {
+ if (!a->group && !a->personal && a->mailbox
+ && strchr (a->mailbox, '@') == NULL) {
t = mutt_lookup_alias (a->mailbox);
- if (t)
- {
+ if (t) {
i = 0;
- for (u = *expn; u; u = u->next)
- {
- if (mutt_strcmp (a->mailbox, u->data) == 0) /* alias already found */
- {
- dprint (1, (debugfile, "mutt_expand_aliases_r(): loop in alias found for '%s'\n", a->mailbox));
- i = 1;
- break;
- }
- }
-
- if (!i)
- {
+ for (u = *expn; u; u = u->next) {
+ if (mutt_strcmp (a->mailbox, u->data) == 0) { /* alias already found */
+ dprint (1,
+ (debugfile,
+ "mutt_expand_aliases_r(): loop in alias found for '%s'\n",
+ a->mailbox));
+ i = 1;
+ break;
+ }
+ }
+
+ if (!i) {
u = safe_malloc (sizeof (LIST));
u->data = safe_strdup (a->mailbox);
u->next = *expn;
*expn = u;
- w = rfc822_cpy_adr (t);
- w = mutt_expand_aliases_r (w, expn);
- if (head)
- last->next = w;
- else
- head = last = w;
- while (last && last->next)
- last = last->next;
+ w = rfc822_cpy_adr (t);
+ w = mutt_expand_aliases_r (w, expn);
+ if (head)
+ last->next = w;
+ else
+ head = last = w;
+ while (last && last->next)
+ last = last->next;
}
- t = a;
- a = a->next;
- t->next = NULL;
- rfc822_free_address (&t);
- continue;
+ t = a;
+ a = a->next;
+ t->next = NULL;
+ rfc822_free_address (&t);
+ continue;
}
- else
- {
- struct passwd *pw = getpwnam (a->mailbox);
-
- if (pw)
- {
- char namebuf[STRING];
-
- mutt_gecos_name (namebuf, sizeof (namebuf), pw);
- mutt_str_replace (&a->personal, namebuf);
-
+ else {
+ struct passwd *pw = getpwnam (a->mailbox);
+
+ if (pw) {
+ char namebuf[STRING];
+
+ mutt_gecos_name (namebuf, sizeof (namebuf), pw);
+ mutt_str_replace (&a->personal, namebuf);
+
#ifdef EXACT_ADDRESS
- FREE (&a->val);
+ FREE (&a->val);
#endif
- }
+ }
}
}
- if (head)
- {
+ if (head) {
last->next = a;
last = last->next;
}
last->next = NULL;
}
- if (option (OPTUSEDOMAIN) && (fqdn = mutt_fqdn(1)))
- {
+ if (option (OPTUSEDOMAIN) && (fqdn = mutt_fqdn (1))) {
/* now qualify all local addresses */
rfc822_qualify (head, fqdn);
}
return (head);
}
-ADDRESS *mutt_expand_aliases (ADDRESS *a)
+ADDRESS *mutt_expand_aliases (ADDRESS * a)
{
ADDRESS *t;
- LIST *expn = NULL; /* previously expanded aliases to avoid loops */
+ LIST *expn = NULL; /* previously expanded aliases to avoid loops */
t = mutt_expand_aliases_r (a, &expn);
mutt_free_list (&expn);
return (mutt_remove_duplicates (t));
}
-void mutt_expand_aliases_env (ENVELOPE *env)
+void mutt_expand_aliases_env (ENVELOPE * env)
{
env->from = mutt_expand_aliases (env->from);
env->to = mutt_expand_aliases (env->to);
* variable.
*/
-static void write_safe_address (FILE *fp, char *s)
+static void write_safe_address (FILE * fp, char *s)
{
- while (*s)
- {
- if (*s == '\\' || *s == '`' || *s == '\'' || *s == '"'
- || *s == '$')
+ while (*s) {
+ if (*s == '\\' || *s == '`' || *s == '\'' || *s == '"' || *s == '$')
fputc ('\\', fp);
fputc (*s, fp);
s++;
}
}
-ADDRESS *mutt_get_address (ENVELOPE *env, char **pfxp)
+ADDRESS *mutt_get_address (ENVELOPE * env, char **pfxp)
{
ADDRESS *adr;
char *pfx = NULL;
- if (mutt_addr_is_user (env->from))
- {
- if (env->to && !mutt_is_mail_list (env->to))
- {
+ if (mutt_addr_is_user (env->from)) {
+ if (env->to && !mutt_is_mail_list (env->to)) {
pfx = "To";
adr = env->to;
}
- else
- {
+ else {
pfx = "Cc";
adr = env->cc;
}
}
- else if (env->reply_to && !mutt_is_mail_list (env->reply_to))
- {
+ else if (env->reply_to && !mutt_is_mail_list (env->reply_to)) {
pfx = "Reply-To";
adr = env->reply_to;
}
- else
- {
+ else {
adr = env->from;
pfx = "From";
}
- if (pfxp) *pfxp = pfx;
+ if (pfxp)
+ *pfxp = pfx;
return adr;
}
-void mutt_create_alias (ENVELOPE *cur, ADDRESS *iadr)
+void mutt_create_alias (ENVELOPE * cur, ADDRESS * iadr)
{
ALIAS *new, *t;
char buf[LONG_STRING], prompt[SHORT_STRING], *pc;
FILE *rc;
ADDRESS *adr = NULL;
- if (cur)
- {
+ if (cur) {
adr = mutt_get_address (cur, NULL);
}
- else if (iadr)
- {
+ else if (iadr) {
adr = iadr;
}
- if (adr && adr->mailbox)
- {
+ if (adr && adr->mailbox) {
strfcpy (buf, adr->mailbox, sizeof (buf));
if ((pc = strchr (buf, '@')))
*pc = 0;
/* Don't suggest a bad alias name in the event of a strange local part. */
mutt_check_alias_name (buf, buf);
-
+
retry_name:
/* add a new alias */
if (mutt_get_field (_("Alias as: "), buf, sizeof (buf), 0) != 0 || !buf[0])
return;
/* check to see if the user already has an alias defined */
- if (mutt_lookup_alias (buf))
- {
+ if (mutt_lookup_alias (buf)) {
mutt_error _("You already have an alias defined with that name!");
+
return;
}
-
- if (mutt_check_alias_name (buf, fixed))
- {
- switch (mutt_yesorno (_("Warning: This alias name may not work. Fix it?"), M_YES))
- {
- case M_YES:
- strfcpy (buf, fixed, sizeof (buf));
- goto retry_name;
- case -1:
- return;
+
+ if (mutt_check_alias_name (buf, fixed)) {
+ switch (mutt_yesorno
+ (_("Warning: This alias name may not work. Fix it?"), M_YES)) {
+ case M_YES:
+ strfcpy (buf, fixed, sizeof (buf));
+ goto retry_name;
+ case -1:
+ return;
}
}
-
- new = safe_calloc (1, sizeof (ALIAS));
+
+ new = safe_calloc (1, sizeof (ALIAS));
new->self = new;
new->name = safe_strdup (buf);
mutt_addrlist_to_local (adr);
-
+
if (adr)
strfcpy (buf, adr->mailbox, sizeof (buf));
else
buf[0] = 0;
mutt_addrlist_to_idna (adr, NULL);
-
- do
- {
- if (mutt_get_field (_("Address: "), buf, sizeof (buf), 0) != 0 || !buf[0])
- {
+
+ do {
+ if (mutt_get_field (_("Address: "), buf, sizeof (buf), 0) != 0 || !buf[0]) {
mutt_free_alias (&new);
return;
}
-
- if((new->addr = rfc822_parse_adrlist (new->addr, buf)) == NULL)
+
+ if ((new->addr = rfc822_parse_adrlist (new->addr, buf)) == NULL)
BEEP ();
- if (mutt_addrlist_to_idna (new->addr, &err))
- {
+ if (mutt_addrlist_to_idna (new->addr, &err)) {
mutt_error (_("Error: '%s' is a bad IDN."), err);
mutt_sleep (2);
continue;
}
}
- while(new->addr == NULL);
-
+ while (new->addr == NULL);
+
if (adr && adr->personal && !mutt_is_mail_list (adr))
strfcpy (buf, adr->personal, sizeof (buf));
else
buf[0] = 0;
- if (mutt_get_field (_("Personal name: "), buf, sizeof (buf), 0) != 0)
- {
+ if (mutt_get_field (_("Personal name: "), buf, sizeof (buf), 0) != 0) {
mutt_free_alias (&new);
return;
}
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), new->addr, 1);
snprintf (prompt, sizeof (prompt), _("[%s = %s] Accept?"), new->name, buf);
- if (mutt_yesorno (prompt, M_YES) != M_YES)
- {
+ if (mutt_yesorno (prompt, M_YES) != M_YES) {
mutt_free_alias (&new);
return;
}
- if ((t = Aliases))
- {
+ if ((t = Aliases)) {
while (t->next)
t = t->next;
t->next = new;
if (mutt_get_field (_("Save to file: "), buf, sizeof (buf), M_FILE) != 0)
return;
mutt_expand_path (buf, sizeof (buf));
- if ((rc = safe_fopen (buf, "a")))
- {
+ if ((rc = safe_fopen (buf, "a"))) {
if (mutt_check_alias_name (new->name, NULL))
mutt_quote_filename (buf, sizeof (buf), new->name);
else
static int check_alias_name_char (char c)
{
return (c == '-' || c == '_' || c == '+' || c == '=' || c == '.' ||
- isalnum ((unsigned char) c));
+ isalnum ((unsigned char) c));
}
int mutt_check_alias_name (const char *s, char *d)
{
int rv = 0;
- for (; *s; s++)
- {
- if (!check_alias_name_char (*s))
- {
+
+ for (; *s; s++) {
+ if (!check_alias_name_char (*s)) {
if (!d)
- return -1;
- else
- {
- *d++ = '_';
- rv = -1;
+ return -1;
+ else {
+ *d++ = '_';
+ rv = -1;
}
}
else if (d)
* This routine looks to see if the user has an alias defined for the given
* address.
*/
-ADDRESS *alias_reverse_lookup (ADDRESS *a)
+ADDRESS *alias_reverse_lookup (ADDRESS * a)
{
ALIAS *t = Aliases;
ADDRESS *ap;
if (!a || !a->mailbox)
return NULL;
- for (; t; t = t->next)
- {
+ for (; t; t = t->next) {
/* cycle through all addresses if this is a group alias */
- for (ap = t->addr; ap; ap = ap->next)
- {
+ for (ap = t->addr; ap; ap = ap->next) {
if (!ap->group && ap->mailbox &&
- ascii_strcasecmp (ap->mailbox, a->mailbox) == 0)
- return ap;
+ ascii_strcasecmp (ap->mailbox, a->mailbox) == 0)
+ return ap;
}
}
return 0;
#define min(a,b) ((a<b)?a:b)
- if (s[0] != 0) /* avoid empty string as strstr argument */
- {
+ if (s[0] != 0) { /* avoid empty string as strstr argument */
memset (bestname, 0, sizeof (bestname));
- while (a)
- {
- if (a->name && strstr (a->name, s) == a->name)
- {
- if (!bestname[0]) /* init */
- strfcpy (bestname, a->name,
- min (mutt_strlen (a->name) + 1, sizeof (bestname)));
- else
- {
- for (i = 0 ; a->name[i] && a->name[i] == bestname[i] ; i++)
- ;
- bestname[i] = 0;
- }
+ while (a) {
+ if (a->name && strstr (a->name, s) == a->name) {
+ if (!bestname[0]) /* init */
+ strfcpy (bestname, a->name,
+ min (mutt_strlen (a->name) + 1, sizeof (bestname)));
+ else {
+ for (i = 0; a->name[i] && a->name[i] == bestname[i]; i++);
+ bestname[i] = 0;
+ }
}
a = a->next;
}
- if (bestname[0] != 0)
- {
- if (mutt_strcmp (bestname, s) != 0)
- {
- /* we are adding something to the completion */
- strfcpy (s, bestname, mutt_strlen (bestname) + 1);
- return 1;
+ if (bestname[0] != 0) {
+ if (mutt_strcmp (bestname, s) != 0) {
+ /* we are adding something to the completion */
+ strfcpy (s, bestname, mutt_strlen (bestname) + 1);
+ return 1;
}
/* build alias list and show it */
a = Aliases;
- while (a)
- {
- if (a->name && (strstr (a->name, s) == a->name))
- {
- if (!a_list) /* init */
- a_cur = a_list = (ALIAS *) safe_malloc (sizeof (ALIAS));
- else
- {
- a_cur->next = (ALIAS *) safe_malloc (sizeof (ALIAS));
- a_cur = a_cur->next;
- }
- memcpy (a_cur, a, sizeof (ALIAS));
- a_cur->next = NULL;
- }
- a = a->next;
+ while (a) {
+ if (a->name && (strstr (a->name, s) == a->name)) {
+ if (!a_list) /* init */
+ a_cur = a_list = (ALIAS *) safe_malloc (sizeof (ALIAS));
+ else {
+ a_cur->next = (ALIAS *) safe_malloc (sizeof (ALIAS));
+ a_cur = a_cur->next;
+ }
+ memcpy (a_cur, a, sizeof (ALIAS));
+ a_cur->next = NULL;
+ }
+ a = a->next;
}
}
}
bestname[0] = 0;
- mutt_alias_menu (bestname, sizeof(bestname), a_list ? a_list : Aliases);
+ mutt_alias_menu (bestname, sizeof (bestname), a_list ? a_list : Aliases);
if (bestname[0] != 0)
strfcpy (s, bestname, buflen);
/* free the alias list */
- while (a_list)
- {
+ while (a_list) {
a_cur = a_list;
a_list = a_list->next;
FREE (&a_cur);
/* remove any aliases marked for deletion */
a_list = NULL;
- for (a_cur = Aliases; a_cur;)
- {
- if (a_cur->del)
- {
+ for (a_cur = Aliases; a_cur;) {
+ if (a_cur->del) {
if (a_list)
- a_list->next = a_cur->next;
+ a_list->next = a_cur->next;
else
- Aliases = a_cur->next;
-
+ Aliases = a_cur->next;
+
a_cur->next = NULL;
mutt_free_alias (&a_cur);
-
+
if (a_list)
- a_cur = a_list;
+ a_cur = a_list;
else
- a_cur = Aliases;
+ a_cur = Aliases;
}
- else
- {
+ else {
a_list = a_cur;
- a_cur = a_cur->next;
+ a_cur = a_cur->next;
}
}
-
+
return 0;
}
-static int string_is_address(const char *str, const char *u, const char *d)
+static int string_is_address (const char *str, const char *u, const char *d)
{
char buf[LONG_STRING];
-
- snprintf(buf, sizeof(buf), "%s@%s", NONULL(u), NONULL(d));
- if (ascii_strcasecmp(str, buf) == 0)
+
+ snprintf (buf, sizeof (buf), "%s@%s", NONULL (u), NONULL (d));
+ if (ascii_strcasecmp (str, buf) == 0)
return 1;
-
+
return 0;
}
/* returns TRUE if the given address belongs to the user. */
-int mutt_addr_is_user (ADDRESS *addr)
+int mutt_addr_is_user (ADDRESS * addr)
{
/* NULL address is assumed to be the user. */
- if (!addr)
- {
+ if (!addr) {
dprint (5, (debugfile, "mail_addr_is_user: yes, NULL address\n"));
return 1;
}
- if (!addr->mailbox)
- {
+ if (!addr->mailbox) {
dprint (5, (debugfile, "mail_addr_is_user: no, no mailbox\n"));
return 0;
}
- if (ascii_strcasecmp (addr->mailbox, Username) == 0)
- {
- dprint (5, (debugfile, "mail_addr_is_user: yes, %s = %s\n", addr->mailbox, Username));
+ if (ascii_strcasecmp (addr->mailbox, Username) == 0) {
+ dprint (5,
+ (debugfile, "mail_addr_is_user: yes, %s = %s\n", addr->mailbox,
+ Username));
return 1;
}
- if (string_is_address(addr->mailbox, Username, Hostname))
- {
- dprint (5, (debugfile, "mail_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, Hostname));
+ if (string_is_address (addr->mailbox, Username, Hostname)) {
+ dprint (5,
+ (debugfile, "mail_addr_is_user: yes, %s = %s @ %s \n",
+ addr->mailbox, Username, Hostname));
return 1;
}
- if (string_is_address(addr->mailbox, Username, mutt_fqdn(0)))
- {
- dprint (5, (debugfile, "mail_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, mutt_fqdn (0)));
+ if (string_is_address (addr->mailbox, Username, mutt_fqdn (0))) {
+ dprint (5,
+ (debugfile, "mail_addr_is_user: yes, %s = %s @ %s \n",
+ addr->mailbox, Username, mutt_fqdn (0)));
return 1;
}
- if (string_is_address(addr->mailbox, Username, mutt_fqdn(1)))
- {
- dprint (5, (debugfile, "mail_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, mutt_fqdn (1)));
+ if (string_is_address (addr->mailbox, Username, mutt_fqdn (1))) {
+ dprint (5,
+ (debugfile, "mail_addr_is_user: yes, %s = %s @ %s \n",
+ addr->mailbox, Username, mutt_fqdn (1)));
return 1;
}
- if (From && !ascii_strcasecmp (From->mailbox, addr->mailbox))
- {
- dprint (5, (debugfile, "mail_addr_is_user: yes, %s = %s\n", addr->mailbox, From->mailbox));
+ if (From && !ascii_strcasecmp (From->mailbox, addr->mailbox)) {
+ dprint (5,
+ (debugfile, "mail_addr_is_user: yes, %s = %s\n", addr->mailbox,
+ From->mailbox));
return 1;
}
- if (mutt_match_rx_list (addr->mailbox, Alternates))
- {
- dprint (5, (debugfile, "mail_addr_is_user: yes, %s matched by alternates.\n", addr->mailbox));
+ if (mutt_match_rx_list (addr->mailbox, Alternates)) {
+ dprint (5,
+ (debugfile, "mail_addr_is_user: yes, %s matched by alternates.\n",
+ addr->mailbox));
if (mutt_match_rx_list (addr->mailbox, UnAlternates))
- dprint (5, (debugfile, "mail_addr_is_user: but, %s matched by unalternates.\n", addr->mailbox));
+ dprint (5,
+ (debugfile,
+ "mail_addr_is_user: but, %s matched by unalternates.\n",
+ addr->mailbox));
else
return 1;
}
-
+
dprint (5, (debugfile, "mail_addr_is_user: no, all failed.\n"));
return 0;
}
{
if (ascii_islower (c))
return c & ~32;
-
+
return c;
}
{
if (ascii_isupper (c))
return c | 32;
-
+
return c;
}
int ascii_strcasecmp (const char *a, const char *b)
{
int i;
-
+
if (a == b)
return 0;
if (a == NULL && b)
return -1;
if (b == NULL && a)
return 1;
-
- for (; *a || *b; a++, b++)
- {
+
+ for (; *a || *b; a++, b++) {
if ((i = ascii_tolower (*a) - ascii_tolower (*b)))
return i;
}
-
+
return 0;
}
int ascii_strncasecmp (const char *a, const char *b, int n)
{
int i, j;
-
+
if (a == b)
return 0;
if (a == NULL && b)
return -1;
if (b == NULL && a)
return 1;
-
- for (j = 0; (*a || *b) && j < n; a++, b++, j++)
- {
+
+ for (j = 0; (*a || *b) && j < n; a++, b++, j++) {
if ((i = ascii_tolower (*a) - ascii_tolower (*b)))
return i;
}
-
+
return 0;
}
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- */
+ */
#if HAVE_CONFIG_H
# include "config.h"
#include <string.h>
#include <errno.h>
-int mutt_get_tmp_attachment (BODY *a)
+int mutt_get_tmp_attachment (BODY * a)
{
char type[STRING];
char tempfile[_POSIX_PATH_MAX];
- rfc1524_entry *entry = rfc1524_new_entry();
+ rfc1524_entry *entry = rfc1524_new_entry ();
FILE *fpin = NULL, *fpout = NULL;
struct stat st;
-
- if(a->unlink)
+
+ if (a->unlink)
return 0;
- snprintf(type, sizeof(type), "%s/%s", TYPE(a), a->subtype);
- rfc1524_mailcap_lookup(a, type, entry, 0);
- rfc1524_expand_filename(entry->nametemplate, a->filename,
- tempfile, sizeof(tempfile));
-
- rfc1524_free_entry(&entry);
+ snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
+ rfc1524_mailcap_lookup (a, type, entry, 0);
+ rfc1524_expand_filename (entry->nametemplate, a->filename,
+ tempfile, sizeof (tempfile));
+
+ rfc1524_free_entry (&entry);
- if(stat(a->filename, &st) == -1)
+ if (stat (a->filename, &st) == -1)
return -1;
- if((fpin = fopen(a->filename, "r")) && (fpout = safe_fopen(tempfile, "w"))) /* __FOPEN_CHECKED__ */
- {
+ if ((fpin = fopen (a->filename, "r")) && (fpout = safe_fopen (tempfile, "w"))) { /* __FOPEN_CHECKED__ */
mutt_copy_stream (fpin, fpout);
mutt_str_replace (&a->filename, tempfile);
a->unlink = 1;
- if(a->stamp >= st.st_mtime)
- mutt_stamp_attachment(a);
+ if (a->stamp >= st.st_mtime)
+ mutt_stamp_attachment (a);
}
else
- mutt_perror(fpin ? tempfile : a->filename);
-
- if(fpin) fclose(fpin);
- if(fpout) fclose(fpout);
-
+ mutt_perror (fpin ? tempfile : a->filename);
+
+ if (fpin)
+ fclose (fpin);
+ if (fpout)
+ fclose (fpout);
+
return a->unlink ? 0 : -1;
}
/* return 1 if require full screen redraw, 0 otherwise */
-int mutt_compose_attachment (BODY *a)
+int mutt_compose_attachment (BODY * a)
{
char type[STRING];
char command[STRING];
rfc1524_entry *entry = rfc1524_new_entry ();
short unlink_newfile = 0;
int rc = 0;
-
+
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
- if (rfc1524_mailcap_lookup (a, type, entry, M_COMPOSE))
- {
- if (entry->composecommand || entry->composetypecommand)
- {
+ if (rfc1524_mailcap_lookup (a, type, entry, M_COMPOSE)) {
+ if (entry->composecommand || entry->composetypecommand) {
if (entry->composetypecommand)
- strfcpy (command, entry->composetypecommand, sizeof (command));
- else
- strfcpy (command, entry->composecommand, sizeof (command));
+ strfcpy (command, entry->composetypecommand, sizeof (command));
+ else
+ strfcpy (command, entry->composecommand, sizeof (command));
if (rfc1524_expand_filename (entry->nametemplate,
- a->filename, newfile, sizeof (newfile)))
- {
- dprint(1, (debugfile, "oldfile: %s\t newfile: %s\n",
- a->filename, newfile));
- if (safe_symlink (a->filename, newfile) == -1)
- {
- if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
- goto bailout;
- }
- else
- unlink_newfile = 1;
+ a->filename, newfile, sizeof (newfile))) {
+ dprint (1, (debugfile, "oldfile: %s\t newfile: %s\n",
+ a->filename, newfile));
+ if (safe_symlink (a->filename, newfile) == -1) {
+ if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES)
+ != M_YES)
+ goto bailout;
+ }
+ else
+ unlink_newfile = 1;
}
else
- strfcpy(newfile, a->filename, sizeof(newfile));
-
+ strfcpy (newfile, a->filename, sizeof (newfile));
+
if (rfc1524_expand_command (a, newfile, type,
- command, sizeof (command)))
- {
- /* For now, editing requires a file, no piping */
- mutt_error _("Mailcap compose entry requires %%s");
+ command, sizeof (command))) {
+ /* For now, editing requires a file, no piping */
+ mutt_error _("Mailcap compose entry requires %%s");
}
- else
- {
- int r;
-
- mutt_endwin (NULL);
- if ((r = mutt_system (command)) == -1)
- mutt_error (_("Error running \"%s\"!"), command);
-
- if (r != -1 && entry->composetypecommand)
- {
- BODY *b;
- FILE *fp, *tfp;
- char tempfile[_POSIX_PATH_MAX];
-
- if ((fp = safe_fopen (a->filename, "r")) == NULL)
- {
- mutt_perror _("Failure to open file to parse headers.");
- goto bailout;
- }
-
- b = mutt_read_mime_header (fp, 0);
- if (b)
- {
- if (b->parameter)
- {
- mutt_free_parameter (&a->parameter);
- a->parameter = b->parameter;
- b->parameter = NULL;
- }
- if (b->description) {
- FREE (&a->description);
- a->description = b->description;
- b->description = NULL;
- }
- if (b->form_name)
- {
- FREE (&a->form_name);
- a->form_name = b->form_name;
- b->form_name = NULL;
- }
-
- /* Remove headers by copying out data to another file, then
- * copying the file back */
- fseek (fp, b->offset, 0);
- mutt_mktemp (tempfile);
- if ((tfp = safe_fopen (tempfile, "w")) == NULL)
- {
- mutt_perror _("Failure to open file to strip headers.");
- goto bailout;
- }
- mutt_copy_stream (fp, tfp);
- fclose (fp);
- fclose (tfp);
- mutt_unlink (a->filename);
- if (mutt_rename_file (tempfile, a->filename) != 0)
- {
- mutt_perror _("Failure to rename file.");
- goto bailout;
- }
-
- mutt_free_body (&b);
- }
- }
+ else {
+ int r;
+
+ mutt_endwin (NULL);
+ if ((r = mutt_system (command)) == -1)
+ mutt_error (_("Error running \"%s\"!"), command);
+
+ if (r != -1 && entry->composetypecommand) {
+ BODY *b;
+ FILE *fp, *tfp;
+ char tempfile[_POSIX_PATH_MAX];
+
+ if ((fp = safe_fopen (a->filename, "r")) == NULL) {
+ mutt_perror _("Failure to open file to parse headers.");
+
+ goto bailout;
+ }
+
+ b = mutt_read_mime_header (fp, 0);
+ if (b) {
+ if (b->parameter) {
+ mutt_free_parameter (&a->parameter);
+ a->parameter = b->parameter;
+ b->parameter = NULL;
+ }
+ if (b->description) {
+ FREE (&a->description);
+ a->description = b->description;
+ b->description = NULL;
+ }
+ if (b->form_name) {
+ FREE (&a->form_name);
+ a->form_name = b->form_name;
+ b->form_name = NULL;
+ }
+
+ /* Remove headers by copying out data to another file, then
+ * copying the file back */
+ fseek (fp, b->offset, 0);
+ mutt_mktemp (tempfile);
+ if ((tfp = safe_fopen (tempfile, "w")) == NULL) {
+ mutt_perror _("Failure to open file to strip headers.");
+
+ goto bailout;
+ }
+ mutt_copy_stream (fp, tfp);
+ fclose (fp);
+ fclose (tfp);
+ mutt_unlink (a->filename);
+ if (mutt_rename_file (tempfile, a->filename) != 0) {
+ mutt_perror _("Failure to rename file.");
+
+ goto bailout;
+ }
+
+ mutt_free_body (&b);
+ }
+ }
}
}
}
- else
- {
+ else {
rfc1524_free_entry (&entry);
mutt_message (_("No mailcap compose entry for %s, creating empty file."),
- type);
+ type);
return 1;
}
rc = 1;
-
- bailout:
-
- if(unlink_newfile)
- unlink(newfile);
+
+bailout:
+
+ if (unlink_newfile)
+ unlink (newfile);
rfc1524_free_entry (&entry);
return rc;
* Returns 1 if editor found, 0 if not (useful to tell calling menu to
* redraw)
*/
-int mutt_edit_attachment (BODY *a)
+int mutt_edit_attachment (BODY * a)
{
char type[STRING];
char command[STRING];
rfc1524_entry *entry = rfc1524_new_entry ();
short unlink_newfile = 0;
int rc = 0;
-
+
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
- if (rfc1524_mailcap_lookup (a, type, entry, M_EDIT))
- {
- if (entry->editcommand)
- {
+ if (rfc1524_mailcap_lookup (a, type, entry, M_EDIT)) {
+ if (entry->editcommand) {
strfcpy (command, entry->editcommand, sizeof (command));
if (rfc1524_expand_filename (entry->nametemplate,
- a->filename, newfile, sizeof (newfile)))
- {
- dprint(1, (debugfile, "oldfile: %s\t newfile: %s\n",
- a->filename, newfile));
- if (safe_symlink (a->filename, newfile) == -1)
- {
- if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
- goto bailout;
- }
- else
- unlink_newfile = 1;
+ a->filename, newfile, sizeof (newfile))) {
+ dprint (1, (debugfile, "oldfile: %s\t newfile: %s\n",
+ a->filename, newfile));
+ if (safe_symlink (a->filename, newfile) == -1) {
+ if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES)
+ != M_YES)
+ goto bailout;
+ }
+ else
+ unlink_newfile = 1;
}
else
- strfcpy(newfile, a->filename, sizeof(newfile));
+ strfcpy (newfile, a->filename, sizeof (newfile));
if (rfc1524_expand_command (a, newfile, type,
- command, sizeof (command)))
- {
- /* For now, editing requires a file, no piping */
- mutt_error _("Mailcap Edit entry requires %%s");
+ command, sizeof (command))) {
+ /* For now, editing requires a file, no piping */
+ mutt_error _("Mailcap Edit entry requires %%s");
}
- else
- {
- mutt_endwin (NULL);
- if (mutt_system (command) == -1)
- mutt_error (_("Error running \"%s\"!"), command);
+ else {
+ mutt_endwin (NULL);
+ if (mutt_system (command) == -1)
+ mutt_error (_("Error running \"%s\"!"), command);
}
}
}
- else if (a->type == TYPETEXT)
- {
+ else if (a->type == TYPETEXT) {
/* On text, default to editor */
mutt_edit_file (NONULL (Editor), newfile);
}
- else
- {
+ else {
rfc1524_free_entry (&entry);
- mutt_error (_("No mailcap edit entry for %s"),type);
+ mutt_error (_("No mailcap edit entry for %s"), type);
return 0;
}
rc = 1;
-
- bailout:
-
- if(unlink_newfile)
- unlink(newfile);
-
+
+bailout:
+
+ if (unlink_newfile)
+ unlink (newfile);
+
rfc1524_free_entry (&entry);
return rc;
}
char tmp[LONG_STRING], *p, *q;
int lng;
- if ((p = getenv ("MM_NOASK")) != NULL && *p)
- {
+ if ((p = getenv ("MM_NOASK")) != NULL && *p) {
if (mutt_strcmp (p, "1") == 0)
return (1);
strfcpy (tmp, p, sizeof (tmp));
p = tmp;
- while ((p = strtok (p, ",")) != NULL)
- {
- if ((q = strrchr (p, '/')) != NULL)
- {
- if (*(q+1) == '*')
- {
- if (ascii_strncasecmp (buf, p, q-p) == 0)
- return (1);
- }
- else
- {
- if (ascii_strcasecmp (buf, p) == 0)
- return (1);
- }
+ while ((p = strtok (p, ",")) != NULL) {
+ if ((q = strrchr (p, '/')) != NULL) {
+ if (*(q + 1) == '*') {
+ if (ascii_strncasecmp (buf, p, q - p) == 0)
+ return (1);
+ }
+ else {
+ if (ascii_strcasecmp (buf, p) == 0)
+ return (1);
+ }
}
- else
- {
- lng = mutt_strlen (p);
- if (buf[lng] == '/' && mutt_strncasecmp (buf, p, lng) == 0)
- return (1);
+ else {
+ lng = mutt_strlen (p);
+ if (buf[lng] == '/' && mutt_strncasecmp (buf, p, lng) == 0)
+ return (1);
}
p = NULL;
return (0);
}
-void mutt_check_lookup_list (BODY *b, char *type, int len)
+void mutt_check_lookup_list (BODY * b, char *type, int len)
{
LIST *t = MimeLookupList;
int i;
for (; t; t = t->next) {
i = mutt_strlen (t->data) - 1;
- if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' &&
- ascii_strncasecmp (type, t->data, i) == 0) ||
- ascii_strcasecmp (type, t->data) == 0) {
-
- BODY tmp = {0};
- int n;
- if ((n = mutt_lookup_mime_type (&tmp, b->filename)) != TYPEOTHER) {
- snprintf (type, len, "%s/%s",
- n == TYPEAUDIO ? "audio" :
- n == TYPEAPPLICATION ? "application" :
- n == TYPEIMAGE ? "image" :
- n == TYPEMESSAGE ? "message" :
- n == TYPEMODEL ? "model" :
- n == TYPEMULTIPART ? "multipart" :
- n == TYPETEXT ? "text" :
- n == TYPEVIDEO ? "video" : "other",
- tmp.subtype);
- dprint(1, (debugfile, "mutt_check_lookup_list: \"%s\" -> %s\n",
- b->filename, type));
- }
- if (tmp.subtype)
- FREE (&tmp.subtype);
- if (tmp.xtype)
- FREE (&tmp.xtype);
+ if ((i > 0 && t->data[i - 1] == '/' && t->data[i] == '*' &&
+ ascii_strncasecmp (type, t->data, i) == 0) ||
+ ascii_strcasecmp (type, t->data) == 0) {
+
+ BODY tmp = { 0 };
+ int n;
+
+ if ((n = mutt_lookup_mime_type (&tmp, b->filename)) != TYPEOTHER) {
+ snprintf (type, len, "%s/%s",
+ n == TYPEAUDIO ? "audio" :
+ n == TYPEAPPLICATION ? "application" :
+ n == TYPEIMAGE ? "image" :
+ n == TYPEMESSAGE ? "message" :
+ n == TYPEMODEL ? "model" :
+ n == TYPEMULTIPART ? "multipart" :
+ n == TYPETEXT ? "text" :
+ n == TYPEVIDEO ? "video" : "other", tmp.subtype);
+ dprint (1, (debugfile, "mutt_check_lookup_list: \"%s\" -> %s\n",
+ b->filename, type));
+ }
+ if (tmp.subtype)
+ FREE (&tmp.subtype);
+ if (tmp.xtype)
+ FREE (&tmp.xtype);
}
}
}
-int mutt_is_autoview (BODY *b, const char *type)
+int mutt_is_autoview (BODY * b, const char *type)
{
LIST *t = AutoViewList;
char _type[SHORT_STRING];
if (!type)
snprintf (_type, sizeof (_type), "%s/%s", TYPE (b), b->subtype);
else
- strncpy (_type, type, sizeof(_type));
+ strncpy (_type, type, sizeof (_type));
- mutt_check_lookup_list (b, _type, sizeof(_type));
+ mutt_check_lookup_list (b, _type, sizeof (_type));
type = _type;
- if (mutt_needs_mailcap (b))
- {
+ if (mutt_needs_mailcap (b)) {
if (option (OPTIMPLICITAUTOVIEW))
return 1;
-
+
if (is_mmnoask (type))
return 1;
}
for (; t; t = t->next) {
i = mutt_strlen (t->data) - 1;
- if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' &&
- ascii_strncasecmp (type, t->data, i) == 0) ||
- ascii_strcasecmp (type, t->data) == 0)
+ if ((i > 0 && t->data[i - 1] == '/' && t->data[i] == '*' &&
+ ascii_strncasecmp (type, t->data, i) == 0) ||
+ ascii_strcasecmp (type, t->data) == 0)
return 1;
}
}
/* returns -1 on error, 0 or the return code from mutt_do_pager() on success */
-int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
- ATTACHPTR **idx, short idxlen)
+int mutt_view_attachment (FILE * fp, BODY * a, int flag, HEADER * hdr,
+ ATTACHPTR ** idx, short idxlen)
{
char tempfile[_POSIX_PATH_MAX] = "";
char pagerfile[_POSIX_PATH_MAX] = "";
rfc1524_entry *entry = NULL;
int rc = -1;
int unlink_tempfile = 0;
-
- is_message = mutt_is_message_type(a->type, a->subtype);
+
+ is_message = mutt_is_message_type (a->type, a->subtype);
if (WithCrypto && is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
- !crypt_valid_passphrase(a->hdr->security))
+ !crypt_valid_passphrase (a->hdr->security))
return (rc);
use_mailcap = (flag == M_MAILCAP ||
- (flag == M_REGULAR && mutt_needs_mailcap (a)));
+ (flag == M_REGULAR && mutt_needs_mailcap (a)));
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
-
- if (use_mailcap)
- {
- entry = rfc1524_new_entry ();
- if (!rfc1524_mailcap_lookup (a, type, entry, 0))
- {
- if (flag == M_REGULAR)
- {
- /* fallback to view as text */
- rfc1524_free_entry (&entry);
- mutt_error _("No matching mailcap entry found. Viewing as text.");
- flag = M_AS_TEXT;
- use_mailcap = 0;
+
+ if (use_mailcap) {
+ entry = rfc1524_new_entry ();
+ if (!rfc1524_mailcap_lookup (a, type, entry, 0)) {
+ if (flag == M_REGULAR) {
+ /* fallback to view as text */
+ rfc1524_free_entry (&entry);
+ mutt_error _("No matching mailcap entry found. Viewing as text.");
+
+ flag = M_AS_TEXT;
+ use_mailcap = 0;
}
else
- goto return_error;
+ goto return_error;
}
}
-
- if (use_mailcap)
- {
- if (!entry->command)
- {
+
+ if (use_mailcap) {
+ if (!entry->command) {
mutt_error _("MIME type not defined. Cannot view attachment.");
+
goto return_error;
}
strfcpy (command, entry->command, sizeof (command));
-
- if (fp)
- {
+
+ if (fp) {
fname = safe_strdup (a->filename);
mutt_sanitize_filename (fname, 1);
}
fname = a->filename;
if (rfc1524_expand_filename (entry->nametemplate, fname,
- tempfile, sizeof (tempfile)))
- {
- if (fp == NULL && mutt_strcmp(tempfile, a->filename))
- {
- /* send case: the file is already there */
- if (safe_symlink (a->filename, tempfile) == -1)
- {
- if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) == M_YES)
- strfcpy (tempfile, a->filename, sizeof (tempfile));
- else
- goto return_error;
- }
- else
- unlink_tempfile = 1;
+ tempfile, sizeof (tempfile))) {
+ if (fp == NULL && mutt_strcmp (tempfile, a->filename)) {
+ /* send case: the file is already there */
+ if (safe_symlink (a->filename, tempfile) == -1) {
+ if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES)
+ == M_YES)
+ strfcpy (tempfile, a->filename, sizeof (tempfile));
+ else
+ goto return_error;
+ }
+ else
+ unlink_tempfile = 1;
}
}
- else if (fp == NULL) /* send case */
+ else if (fp == NULL) /* send case */
strfcpy (tempfile, a->filename, sizeof (tempfile));
-
- if (fp)
- {
+
+ if (fp) {
/* recv case: we need to save the attachment to a file */
FREE (&fname);
if (mutt_save_attachment (fp, a, tempfile, 0, NULL) == -1)
- goto return_error;
+ goto return_error;
}
use_pipe = rfc1524_expand_command (a, tempfile, type,
- command, sizeof (command));
+ command, sizeof (command));
use_pager = entry->copiousoutput;
}
-
- if (use_pager)
- {
- if (fp && !use_mailcap && a->filename)
- {
+
+ if (use_pager) {
+ if (fp && !use_mailcap && a->filename) {
/* recv case */
strfcpy (pagerfile, a->filename, sizeof (pagerfile));
- mutt_adv_mktemp (pagerfile, sizeof(pagerfile));
+ mutt_adv_mktemp (pagerfile, sizeof (pagerfile));
}
else
mutt_mktemp (pagerfile);
}
-
- if (use_mailcap)
- {
+
+ if (use_mailcap) {
pid_t thepid = 0;
int tempfd = -1, pagerfd = -1;
-
+
if (!use_pager)
mutt_endwin (NULL);
- if (use_pager || use_pipe)
- {
- if (use_pager && ((pagerfd = safe_open (pagerfile, O_CREAT | O_EXCL | O_WRONLY)) == -1))
- {
- mutt_perror ("open");
- goto return_error;
+ if (use_pager || use_pipe) {
+ if (use_pager
+ && ((pagerfd = safe_open (pagerfile, O_CREAT | O_EXCL | O_WRONLY))
+ == -1)) {
+ mutt_perror ("open");
+ goto return_error;
}
- if (use_pipe && ((tempfd = open (tempfile, 0)) == -1))
- {
- if(pagerfd != -1)
- close(pagerfd);
- mutt_perror ("open");
- goto return_error;
+ if (use_pipe && ((tempfd = open (tempfile, 0)) == -1)) {
+ if (pagerfd != -1)
+ close (pagerfd);
+ mutt_perror ("open");
+ goto return_error;
}
if ((thepid = mutt_create_filter_fd (command, NULL, NULL, NULL,
- use_pipe ? tempfd : -1, use_pager ? pagerfd : -1, -1)) == -1)
- {
- if(pagerfd != -1)
- close(pagerfd);
-
- if(tempfd != -1)
- close(tempfd);
-
- mutt_error _("Cannot create filter");
- goto return_error;
+ use_pipe ? tempfd : -1,
+ use_pager ? pagerfd : -1,
+ -1)) == -1) {
+ if (pagerfd != -1)
+ close (pagerfd);
+
+ if (tempfd != -1)
+ close (tempfd);
+
+ mutt_error _("Cannot create filter");
+
+ goto return_error;
}
- if (use_pager)
- {
- if (a->description)
- snprintf (descrip, sizeof (descrip),
- "---Command: %-20.20s Description: %s",
- command, a->description);
- else
- snprintf (descrip, sizeof (descrip),
- "---Command: %-30.30s Attachment: %s", command, type);
+ if (use_pager) {
+ if (a->description)
+ snprintf (descrip, sizeof (descrip),
+ "---Command: %-20.20s Description: %s",
+ command, a->description);
+ else
+ snprintf (descrip, sizeof (descrip),
+ "---Command: %-30.30s Attachment: %s", command, type);
}
if ((mutt_wait_filter (thepid) || (entry->needsterminal &&
- option (OPTWAITKEY))) && !use_pager)
- mutt_any_key_to_continue (NULL);
-
- close(tempfd);
- close(pagerfd);
-
+ option (OPTWAITKEY))) && !use_pager)
+ mutt_any_key_to_continue (NULL);
+
+ close (tempfd);
+ close (pagerfd);
+
}
- else
- {
+ else {
/* interactive command */
if (mutt_system (command) ||
- (entry->needsterminal && option (OPTWAITKEY)))
- mutt_any_key_to_continue (NULL);
+ (entry->needsterminal && option (OPTWAITKEY)))
+ mutt_any_key_to_continue (NULL);
}
}
- else
- {
+ else {
/* Don't use mailcap; the attachment is viewed in the pager */
- if (flag == M_AS_TEXT)
- {
+ if (flag == M_AS_TEXT) {
/* just let me see the raw data */
if (mutt_save_attachment (fp, a, pagerfile, 0, NULL))
- goto return_error;
+ goto return_error;
}
- else
- {
+ else {
/* Use built-in handler */
- set_option (OPTVIEWATTACH); /* disable the "use 'v' to view this part"
- * message in case of error */
- if (mutt_decode_save_attachment (fp, a, pagerfile, M_DISPLAY, 0))
- {
- unset_option (OPTVIEWATTACH);
- goto return_error;
+ set_option (OPTVIEWATTACH); /* disable the "use 'v' to view this part"
+ * message in case of error */
+ if (mutt_decode_save_attachment (fp, a, pagerfile, M_DISPLAY, 0)) {
+ unset_option (OPTVIEWATTACH);
+ goto return_error;
}
unset_option (OPTVIEWATTACH);
}
-
+
if (a->description)
strfcpy (descrip, a->description, sizeof (descrip));
else if (a->filename)
snprintf (descrip, sizeof (descrip), "---Attachment: %s : %s",
- a->filename, type);
+ a->filename, type);
else
snprintf (descrip, sizeof (descrip), "---Attachment: %s", type);
}
-
+
/* We only reach this point if there have been no errors */
- if (use_pager)
- {
+ if (use_pager) {
pager_t info;
-
+
memset (&info, 0, sizeof (info));
info.fp = fp;
info.bdy = a;
info.hdr = hdr;
rc = mutt_do_pager (descrip, pagerfile,
- M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE : 0), &info);
+ M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE :
+ 0), &info);
*pagerfile = '\0';
}
else
rc = 0;
- return_error:
-
+return_error:
+
if (entry)
rfc1524_free_entry (&entry);
if (fp && tempfile[0])
mutt_unlink (tempfile);
else if (unlink_tempfile)
- unlink(tempfile);
+ unlink (tempfile);
if (pagerfile[0])
mutt_unlink (pagerfile);
}
/* returns 1 on success, 0 on error */
-int mutt_pipe_attachment (FILE *fp, BODY *b, const char *path, char *outfile)
+int mutt_pipe_attachment (FILE * fp, BODY * b, const char *path,
+ char *outfile)
{
pid_t thepid;
int out = -1;
int rv = 0;
-
+
if (outfile && *outfile)
- if ((out = safe_open (outfile, O_CREAT | O_EXCL | O_WRONLY)) < 0)
- {
+ if ((out = safe_open (outfile, O_CREAT | O_EXCL | O_WRONLY)) < 0) {
mutt_perror ("open");
return 0;
}
mutt_endwin (NULL);
- if (fp)
- {
+ if (fp) {
/* recv case */
STATE s;
memset (&s, 0, sizeof (STATE));
if (outfile && *outfile)
- thepid = mutt_create_filter_fd (path, &s.fpout, NULL, NULL, -1, out, -1);
+ thepid =
+ mutt_create_filter_fd (path, &s.fpout, NULL, NULL, -1, out, -1);
else
thepid = mutt_create_filter (path, &s.fpout, NULL, NULL);
- if (thepid < 0)
- {
+ if (thepid < 0) {
mutt_perror _("Can't create filter");
+
goto bail;
}
-
+
s.fpin = fp;
mutt_decode_attachment (b, &s);
safe_fclose (&s.fpout);
}
- else
- {
+ else {
/* send case */
FILE *ifp, *ofp;
- if ((ifp = fopen (b->filename, "r")) == NULL)
- {
+ if ((ifp = fopen (b->filename, "r")) == NULL) {
mutt_perror ("fopen");
- if (outfile && *outfile)
- {
- close (out);
- unlink (outfile);
+ if (outfile && *outfile) {
+ close (out);
+ unlink (outfile);
}
return 0;
}
else
thepid = mutt_create_filter (path, &ofp, NULL, NULL);
- if (thepid < 0)
- {
+ if (thepid < 0) {
mutt_perror _("Can't create filter");
+
safe_fclose (&ifp);
goto bail;
}
-
+
mutt_copy_stream (ifp, ofp);
safe_fclose (&ofp);
safe_fclose (&ifp);
}
rv = 1;
-
+
bail:
-
+
if (outfile && *outfile)
close (out);
return rv;
}
-static FILE *
-mutt_save_attachment_open (char *path, int flags)
+static FILE *mutt_save_attachment_open (char *path, int flags)
{
if (flags == M_SAVE_APPEND)
return fopen (path, "a");
- /* be sure not to change the following fopen to safe_fopen
- * as safe_fopen returns w/ an error if path exists
- */
+ /* be sure not to change the following fopen to safe_fopen
+ * as safe_fopen returns w/ an error if path exists
+ */
if (flags == M_SAVE_OVERWRITE)
- return fopen (path, "w"); /* __FOPEN_CHECKED__ */
-
+ return fopen (path, "w"); /* __FOPEN_CHECKED__ */
+
return safe_fopen (path, "w");
}
/* returns 0 on success, -1 on error */
-int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr)
+int mutt_save_attachment (FILE * fp, BODY * m, char *path, int flags,
+ HEADER * hdr)
{
- if (fp)
- {
-
+ if (fp) {
+
/* recv mode */
- if(hdr &&
- m->hdr &&
- m->encoding != ENCBASE64 &&
- m->encoding != ENCQUOTEDPRINTABLE &&
- mutt_is_message_type(m->type, m->subtype))
- {
+ if (hdr &&
+ m->hdr &&
+ m->encoding != ENCBASE64 &&
+ m->encoding != ENCQUOTEDPRINTABLE &&
+ mutt_is_message_type (m->type, m->subtype)) {
/* message type attachments are written to mail folders. */
char buf[HUGE_STRING];
MESSAGE *msg;
int chflags = 0;
int r = -1;
-
+
hn = m->hdr;
- hn->msgno = hdr->msgno; /* required for MH/maildir */
+ hn->msgno = hdr->msgno; /* required for MH/maildir */
hn->read = 1;
fseek (fp, m->offset, 0);
if (fgets (buf, sizeof (buf), fp) == NULL)
- return -1;
- if (mx_open_mailbox(path, M_APPEND | M_QUIET, &ctx) == NULL)
- return -1;
- if ((msg = mx_open_new_message (&ctx, hn, is_from (buf, NULL, 0, NULL) ? 0 : M_ADD_FROM)) == NULL)
- {
- mx_close_mailbox(&ctx, NULL);
- return -1;
+ return -1;
+ if (mx_open_mailbox (path, M_APPEND | M_QUIET, &ctx) == NULL)
+ return -1;
+ if ((msg =
+ mx_open_new_message (&ctx, hn,
+ is_from (buf, NULL, 0,
+ NULL) ? 0 : M_ADD_FROM)) == NULL) {
+ mx_close_mailbox (&ctx, NULL);
+ return -1;
}
if (ctx.magic == M_MBOX || ctx.magic == M_MMDF)
- chflags = CH_FROM;
+ chflags = CH_FROM;
chflags |= (ctx.magic == M_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
- if (_mutt_copy_message (msg->fp, fp, hn, hn->content, 0, chflags) == 0
- && mx_commit_message (msg, &ctx) == 0)
- r = 0;
+ if (_mutt_copy_message (msg->fp, fp, hn, hn->content, 0, chflags) == 0
+ && mx_commit_message (msg, &ctx) == 0)
+ r = 0;
else
- r = -1;
+ r = -1;
mx_close_message (&msg);
mx_close_mailbox (&ctx, NULL);
return r;
}
- else
- {
+ else {
/* In recv mode, extract from folder and decode */
-
+
STATE s;
-
+
memset (&s, 0, sizeof (s));
- if ((s.fpout = mutt_save_attachment_open (path, flags)) == NULL)
- {
- mutt_perror ("fopen");
- return (-1);
+ if ((s.fpout = mutt_save_attachment_open (path, flags)) == NULL) {
+ mutt_perror ("fopen");
+ return (-1);
}
fseek ((s.fpin = fp), m->offset, 0);
mutt_decode_attachment (m, &s);
-
- if (fclose (s.fpout) != 0)
- {
- mutt_perror ("fclose");
- return (-1);
+
+ if (fclose (s.fpout) != 0) {
+ mutt_perror ("fclose");
+ return (-1);
}
}
}
- else
- {
+ else {
/* In send mode, just copy file */
FILE *ofp, *nfp;
- if ((ofp = fopen (m->filename, "r")) == NULL)
- {
+ if ((ofp = fopen (m->filename, "r")) == NULL) {
mutt_perror ("fopen");
return (-1);
}
-
- if ((nfp = mutt_save_attachment_open (path, flags)) == NULL)
- {
+
+ if ((nfp = mutt_save_attachment_open (path, flags)) == NULL) {
mutt_perror ("fopen");
safe_fclose (&ofp);
return (-1);
}
- if (mutt_copy_stream (ofp, nfp) == -1)
- {
+ if (mutt_copy_stream (ofp, nfp) == -1) {
mutt_error _("Write fault!");
+
safe_fclose (&ofp);
safe_fclose (&nfp);
return (-1);
}
/* returns 0 on success, -1 on error */
-int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path,
- int displaying, int flags)
+int mutt_decode_save_attachment (FILE * fp, BODY * m, char *path,
+ int displaying, int flags)
{
STATE s;
unsigned int saved_encoding = 0;
if (flags == M_SAVE_APPEND)
s.fpout = fopen (path, "a");
else if (flags == M_SAVE_OVERWRITE)
- s.fpout = safe_fopen (path, "w"); /* __FOPEN_CHECKED__ */
+ s.fpout = safe_fopen (path, "w"); /* __FOPEN_CHECKED__ */
else
s.fpout = safe_fopen (path, "w");
- if (s.fpout == NULL)
- {
+ if (s.fpout == NULL) {
mutt_perror ("fopen");
return (-1);
}
- if (fp == NULL)
- {
+ if (fp == NULL) {
/* When called from the compose menu, the attachment isn't parsed,
* so we need to do it here. */
struct stat st;
- if (stat (m->filename, &st) == -1)
- {
+ if (stat (m->filename, &st) == -1) {
mutt_perror ("stat");
fclose (s.fpout);
return (-1);
}
- if ((s.fpin = fopen (m->filename, "r")) == NULL)
- {
+ if ((s.fpin = fopen (m->filename, "r")) == NULL) {
mutt_perror ("fopen");
return (-1);
}
saved_encoding = m->encoding;
if (!is_multipart (m))
m->encoding = ENC8BIT;
-
+
m->length = st.st_size;
m->offset = 0;
saved_parts = m->parts;
if (m->noconv || is_multipart (m))
s.flags |= M_CHARCONV;
}
- else
- {
+ else {
s.fpin = fp;
s.flags |= M_CHARCONV;
}
mutt_body_handler (m, &s);
fclose (s.fpout);
- if (fp == NULL)
- {
+ if (fp == NULL) {
m->length = 0;
m->encoding = saved_encoding;
- if (saved_parts)
- {
+ if (saved_parts) {
mutt_free_header (&m->hdr);
m->parts = saved_parts;
m->hdr = saved_hdr;
* attachment
*/
-int mutt_print_attachment (FILE *fp, BODY *a)
+int mutt_print_attachment (FILE * fp, BODY * a)
{
char newfile[_POSIX_PATH_MAX] = "";
char type[STRING];
pid_t thepid;
FILE *ifp, *fpout;
short unlink_newfile = 0;
-
+
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
- if (rfc1524_mailcap_lookup (a, type, NULL, M_PRINT))
- {
- char command[_POSIX_PATH_MAX+STRING];
+ if (rfc1524_mailcap_lookup (a, type, NULL, M_PRINT)) {
+ char command[_POSIX_PATH_MAX + STRING];
rfc1524_entry *entry;
int piped = FALSE;
dprint (2, (debugfile, "Using mailcap...\n"));
-
+
entry = rfc1524_new_entry ();
rfc1524_mailcap_lookup (a, type, entry, M_PRINT);
if (rfc1524_expand_filename (entry->nametemplate, a->filename,
- newfile, sizeof (newfile)))
- {
- if (!fp)
- {
- if (safe_symlink(a->filename, newfile) == -1)
- {
- if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
- {
- rfc1524_free_entry (&entry);
- return 0;
- }
- strfcpy (newfile, a->filename, sizeof (newfile));
- }
- else
- unlink_newfile = 1;
+ newfile, sizeof (newfile))) {
+ if (!fp) {
+ if (safe_symlink (a->filename, newfile) == -1) {
+ if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES)
+ != M_YES) {
+ rfc1524_free_entry (&entry);
+ return 0;
+ }
+ strfcpy (newfile, a->filename, sizeof (newfile));
+ }
+ else
+ unlink_newfile = 1;
}
}
mutt_save_attachment (fp, a, newfile, 0, NULL);
strfcpy (command, entry->printcommand, sizeof (command));
- piped = rfc1524_expand_command (a, newfile, type, command, sizeof (command));
+ piped =
+ rfc1524_expand_command (a, newfile, type, command, sizeof (command));
mutt_endwin (NULL);
/* interactive program */
- if (piped)
- {
- if ((ifp = fopen (newfile, "r")) == NULL)
- {
- mutt_perror ("fopen");
- rfc1524_free_entry (&entry);
- return (0);
+ if (piped) {
+ if ((ifp = fopen (newfile, "r")) == NULL) {
+ mutt_perror ("fopen");
+ rfc1524_free_entry (&entry);
+ return (0);
}
- if ((thepid = mutt_create_filter (command, &fpout, NULL, NULL)) < 0)
- {
- mutt_perror _("Can't create filter");
- rfc1524_free_entry (&entry);
- safe_fclose (&ifp);
- return 0;
+ if ((thepid = mutt_create_filter (command, &fpout, NULL, NULL)) < 0) {
+ mutt_perror _("Can't create filter");
+
+ rfc1524_free_entry (&entry);
+ safe_fclose (&ifp);
+ return 0;
}
mutt_copy_stream (ifp, fpout);
safe_fclose (&fpout);
safe_fclose (&ifp);
if (mutt_wait_filter (thepid) || option (OPTWAITKEY))
- mutt_any_key_to_continue (NULL);
+ mutt_any_key_to_continue (NULL);
}
- else
- {
+ else {
if (mutt_system (command) || option (OPTWAITKEY))
- mutt_any_key_to_continue (NULL);
+ mutt_any_key_to_continue (NULL);
}
if (fp)
mutt_unlink (newfile);
else if (unlink_newfile)
- unlink(newfile);
+ unlink (newfile);
rfc1524_free_entry (&entry);
return (1);
}
if (!ascii_strcasecmp ("text/plain", type) ||
- !ascii_strcasecmp ("application/postscript", type))
- {
- return (mutt_pipe_attachment (fp, a, NONULL(PrintCmd), NULL));
+ !ascii_strcasecmp ("application/postscript", type)) {
+ return (mutt_pipe_attachment (fp, a, NONULL (PrintCmd), NULL));
}
- else if (mutt_can_decode (a))
- {
+ else if (mutt_can_decode (a)) {
/* decode and print */
int rc = 0;
-
+
ifp = NULL;
fpout = NULL;
-
+
mutt_mktemp (newfile);
- if (mutt_decode_save_attachment (fp, a, newfile, M_PRINTING, 0) == 0)
- {
-
- dprint (2, (debugfile, "successfully decoded %s type attachment to %s\n",
- type, newfile));
-
- if ((ifp = fopen (newfile, "r")) == NULL)
- {
- mutt_perror ("fopen");
- goto bail0;
+ if (mutt_decode_save_attachment (fp, a, newfile, M_PRINTING, 0) == 0) {
+
+ dprint (2,
+ (debugfile, "successfully decoded %s type attachment to %s\n",
+ type, newfile));
+
+ if ((ifp = fopen (newfile, "r")) == NULL) {
+ mutt_perror ("fopen");
+ goto bail0;
}
dprint (2, (debugfile, "successfully opened %s read-only\n", newfile));
-
+
mutt_endwin (NULL);
- if ((thepid = mutt_create_filter (NONULL(PrintCmd), &fpout, NULL, NULL)) < 0)
- {
- mutt_perror _("Can't create filter");
- goto bail0;
+ if ((thepid =
+ mutt_create_filter (NONULL (PrintCmd), &fpout, NULL, NULL)) < 0) {
+ mutt_perror _("Can't create filter");
+
+ goto bail0;
}
dprint (2, (debugfile, "Filter created.\n"));
-
+
mutt_copy_stream (ifp, fpout);
safe_fclose (&fpout);
safe_fclose (&ifp);
if (mutt_wait_filter (thepid) != 0 || option (OPTWAITKEY))
- mutt_any_key_to_continue (NULL);
+ mutt_any_key_to_continue (NULL);
rc = 1;
}
bail0:
mutt_unlink (newfile);
return rc;
}
- else
- {
+ else {
mutt_error _("I don't know how to print that!");
+
return 0;
}
}
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- */
+ */
/* common protos for compose / attach menus */
-int mutt_tag_attach (MUTTMENU *menu, int n, int m);
-int mutt_attach_display_loop (MUTTMENU *menu, int op, FILE *fp, HEADER *hdr,
- BODY *cur, ATTACHPTR ***idxp, short *idxlen, short *idxmax,
- int recv);
+int mutt_tag_attach (MUTTMENU * menu, int n, int m);
+int mutt_attach_display_loop (MUTTMENU * menu, int op, FILE * fp,
+ HEADER * hdr, BODY * cur, ATTACHPTR *** idxp,
+ short *idxlen, short *idxmax, int recv);
-void mutt_save_attachment_list (FILE *fp, int tag, BODY *top, HEADER *hdr, MUTTMENU *menu);
-void mutt_pipe_attachment_list (FILE *fp, int tag, BODY *top, int filter);
-void mutt_print_attachment_list (FILE *fp, int tag, BODY *top);
+void mutt_save_attachment_list (FILE * fp, int tag, BODY * top, HEADER * hdr,
+ MUTTMENU * menu);
+void mutt_pipe_attachment_list (FILE * fp, int tag, BODY * top, int filter);
+void mutt_print_attachment_list (FILE * fp, int tag, BODY * top);
void mutt_attach_bounce (FILE *, HEADER *, ATTACHPTR **, short, BODY *);
void mutt_attach_resend (FILE *, HEADER *, ATTACHPTR **, short, BODY *);
/* raw bytes to null-terminated base 64 string */
void mutt_to_base64 (unsigned char *out, const unsigned char *in, size_t len,
- size_t olen)
+ size_t olen)
{
- while (len >= 3 && olen > 10)
- {
+ while (len >= 3 && olen > 10) {
*out++ = B64Chars[in[0] >> 2];
*out++ = B64Chars[((in[0] << 4) & 0x30) | (in[1] >> 4)];
*out++ = B64Chars[((in[1] << 2) & 0x3c) | (in[2] >> 6)];
*out++ = B64Chars[in[2] & 0x3f];
- olen -= 4;
- len -= 3;
- in += 3;
+ olen -= 4;
+ len -= 3;
+ in += 3;
}
/* clean up remainder */
- if (len > 0 && olen > 4)
- {
+ if (len > 0 && olen > 4) {
unsigned char fragment;
*out++ = B64Chars[in[0] >> 2];
int len = 0;
register unsigned char digit1, digit2, digit3, digit4;
- do
- {
+ do {
digit1 = in[0];
if (digit1 > 127 || base64val (digit1) == BAD)
return -1;
in += 4;
/* digits are already sanity-checked */
- *out++ = (base64val(digit1) << 2) | (base64val(digit2) >> 4);
+ *out++ = (base64val (digit1) << 2) | (base64val (digit2) >> 4);
len++;
- if (digit3 != '=')
- {
- *out++ = ((base64val(digit2) << 4) & 0xf0) | (base64val(digit3) >> 2);
+ if (digit3 != '=') {
+ *out++ = ((base64val (digit2) << 4) & 0xf0) | (base64val (digit3) >> 2);
len++;
- if (digit4 != '=')
- {
- *out++ = ((base64val(digit3) << 6) & 0xc0) | base64val(digit4);
- len++;
+ if (digit4 != '=') {
+ *out++ = ((base64val (digit3) << 6) & 0xc0) | base64val (digit4);
+ len++;
}
}
}
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- */
+ */
#if HAVE_CONFIG_H
# include "config.h"
#include <errno.h>
static struct mapping_t FolderHelp[] = {
- { N_("Exit"), OP_EXIT },
- { N_("Chdir"), OP_CHANGE_DIRECTORY },
- { N_("Mask"), OP_ENTER_MASK },
- { N_("Help"), OP_HELP },
- { NULL }
+ {N_("Exit"), OP_EXIT},
+ {N_("Chdir"), OP_CHANGE_DIRECTORY},
+ {N_("Mask"), OP_ENTER_MASK},
+ {N_("Help"), OP_HELP},
+ {NULL}
};
#ifdef USE_NNTP
static struct mapping_t FolderNewsHelp[] = {
- { N_("Exit"), OP_EXIT },
- { N_("List"), OP_TOGGLE_MAILBOXES },
- { N_("Subscribe"), OP_BROWSER_SUBSCRIBE },
- { N_("Unsubscribe"), OP_BROWSER_UNSUBSCRIBE },
- { N_("Catchup"), OP_CATCHUP },
- { N_("Mask"), OP_ENTER_MASK },
- { N_("Help"), OP_HELP },
- { NULL }
+ {N_("Exit"), OP_EXIT},
+ {N_("List"), OP_TOGGLE_MAILBOXES},
+ {N_("Subscribe"), OP_BROWSER_SUBSCRIBE},
+ {N_("Unsubscribe"), OP_BROWSER_UNSUBSCRIBE},
+ {N_("Catchup"), OP_CATCHUP},
+ {N_("Mask"), OP_ENTER_MASK},
+ {N_("Help"), OP_HELP},
+ {NULL}
};
#endif
-typedef struct folder_t
-{
+typedef struct folder_t {
struct folder_file *ff;
int num;
} FOLDER;
{
int c;
- for (c = 0; c < state->entrylen; c++)
- {
+ for (c = 0; c < state->entrylen; c++) {
FREE (&((state->entry)[c].name));
FREE (&((state->entry)[c].desc));
FREE (&((state->entry)[c].st));
{
int (*f) (const void *, const void *);
- switch (BrowserSort & SORT_MASK)
- {
- case SORT_ORDER:
- return;
- case SORT_DATE:
+ switch (BrowserSort & SORT_MASK) {
+ case SORT_ORDER:
+ return;
+ case SORT_DATE:
#ifdef USE_NNTP
- if (option (OPTNEWS))
- return;
+ if (option (OPTNEWS))
+ return;
#endif
- f = browser_compare_date;
- break;
- case SORT_SIZE:
+ f = browser_compare_date;
+ break;
+ case SORT_SIZE:
#ifdef USE_NNTP
- if (option (OPTNEWS))
- return;
+ if (option (OPTNEWS))
+ return;
#endif
- f = browser_compare_size;
- break;
- case SORT_SUBJECT:
- default:
- f = browser_compare_subject;
- break;
+ f = browser_compare_size;
+ break;
+ case SORT_SUBJECT:
+ default:
+ f = browser_compare_subject;
+ break;
}
qsort (state->entry, state->entrylen, sizeof (struct folder_file), f);
}
{
struct stat st;
char fullpath[_POSIX_PATH_MAX];
-
+
mutt_concat_path (fullpath, folder, path, sizeof (fullpath));
-
+
if (stat (fullpath, &st) == 0)
return (S_ISDIR (st.st_mode));
else
return 0;
}
-static const char *
-folder_format_str (char *dest, size_t destlen, char op, const char *src,
- const char *fmt, const char *ifstring, const char *elsestring,
- unsigned long data, format_flag flags)
+static const char *folder_format_str (char *dest, size_t destlen, char op,
+ const char *src, const char *fmt,
+ const char *ifstring,
+ const char *elsestring,
+ unsigned long data, format_flag flags)
{
char fn[SHORT_STRING], tmp[SHORT_STRING], permission[11];
char date[16], *t_fmt;
struct group *gr;
int optional = (flags & M_FORMAT_OPTIONAL);
- switch (op)
- {
- case 'C':
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, folder->num + 1);
- break;
-
- case 'd':
- if (folder->ff->st != NULL)
- {
- tnow = time (NULL);
- t_fmt = tnow - folder->ff->st->st_mtime < 31536000 ? "%b %d %H:%M" : "%b %d %Y";
- strftime (date, sizeof (date), t_fmt, localtime (&folder->ff->st->st_mtime));
- mutt_format_s (dest, destlen, fmt, date);
- }
- else
- mutt_format_s (dest, destlen, fmt, "");
- break;
-
- case 'f':
+ switch (op) {
+ case 'C':
+ snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+ snprintf (dest, destlen, tmp, folder->num + 1);
+ break;
+
+ case 'd':
+ if (folder->ff->st != NULL) {
+ tnow = time (NULL);
+ t_fmt =
+ tnow - folder->ff->st->st_mtime <
+ 31536000 ? "%b %d %H:%M" : "%b %d %Y";
+ strftime (date, sizeof (date), t_fmt,
+ localtime (&folder->ff->st->st_mtime));
+ mutt_format_s (dest, destlen, fmt, date);
+ }
+ else
+ mutt_format_s (dest, destlen, fmt, "");
+ break;
+
+ case 'f':
{
char *s;
+
#ifdef USE_IMAP
if (folder->ff->imap)
- s = NONULL (folder->ff->desc);
+ s = NONULL (folder->ff->desc);
else
#endif
- s = NONULL (folder->ff->name);
+ s = NONULL (folder->ff->name);
snprintf (fn, sizeof (fn), "%s%s", s,
- folder->ff->st ? (S_ISLNK (folder->ff->st->st_mode) ? "@" :
- (S_ISDIR (folder->ff->st->st_mode) ? "/" :
- ((folder->ff->st->st_mode & S_IXUSR) != 0 ? "*" : ""))) : "");
-
+ folder->ff->st ? (S_ISLNK (folder->ff->st->st_mode) ? "@" :
+ (S_ISDIR (folder->ff->st->st_mode) ? "/" :
+ ((folder->ff->st->st_mode & S_IXUSR) !=
+ 0 ? "*" : ""))) : "");
+
mutt_format_s (dest, destlen, fmt, fn);
break;
}
- case 'F':
- if (folder->ff->st != NULL)
- {
- snprintf (permission, sizeof (permission), "%c%c%c%c%c%c%c%c%c%c",
- S_ISDIR(folder->ff->st->st_mode) ? 'd' : (S_ISLNK(folder->ff->st->st_mode) ? 'l' : '-'),
- (folder->ff->st->st_mode & S_IRUSR) != 0 ? 'r': '-',
- (folder->ff->st->st_mode & S_IWUSR) != 0 ? 'w' : '-',
- (folder->ff->st->st_mode & S_ISUID) != 0 ? 's' : (folder->ff->st->st_mode & S_IXUSR) != 0 ? 'x': '-',
- (folder->ff->st->st_mode & S_IRGRP) != 0 ? 'r' : '-',
- (folder->ff->st->st_mode & S_IWGRP) != 0 ? 'w' : '-',
- (folder->ff->st->st_mode & S_ISGID) != 0 ? 's' : (folder->ff->st->st_mode & S_IXGRP) != 0 ? 'x': '-',
- (folder->ff->st->st_mode & S_IROTH) != 0 ? 'r' : '-',
- (folder->ff->st->st_mode & S_IWOTH) != 0 ? 'w' : '-',
- (folder->ff->st->st_mode & S_ISVTX) != 0 ? 't' : (folder->ff->st->st_mode & S_IXOTH) != 0 ? 'x': '-');
- mutt_format_s (dest, destlen, fmt, permission);
- }
+ case 'F':
+ if (folder->ff->st != NULL) {
+ snprintf (permission, sizeof (permission), "%c%c%c%c%c%c%c%c%c%c",
+ S_ISDIR (folder->ff->st->
+ st_mode) ? 'd' : (S_ISLNK (folder->ff->st->
+ st_mode) ? 'l' : '-'),
+ (folder->ff->st->st_mode & S_IRUSR) != 0 ? 'r' : '-',
+ (folder->ff->st->st_mode & S_IWUSR) != 0 ? 'w' : '-',
+ (folder->ff->st->st_mode & S_ISUID) !=
+ 0 ? 's' : (folder->ff->st->st_mode & S_IXUSR) !=
+ 0 ? 'x' : '-',
+ (folder->ff->st->st_mode & S_IRGRP) != 0 ? 'r' : '-',
+ (folder->ff->st->st_mode & S_IWGRP) != 0 ? 'w' : '-',
+ (folder->ff->st->st_mode & S_ISGID) !=
+ 0 ? 's' : (folder->ff->st->st_mode & S_IXGRP) !=
+ 0 ? 'x' : '-',
+ (folder->ff->st->st_mode & S_IROTH) != 0 ? 'r' : '-',
+ (folder->ff->st->st_mode & S_IWOTH) != 0 ? 'w' : '-',
+ (folder->ff->st->st_mode & S_ISVTX) !=
+ 0 ? 't' : (folder->ff->st->st_mode & S_IXOTH) !=
+ 0 ? 'x' : '-');
+ mutt_format_s (dest, destlen, fmt, permission);
+ }
#ifdef USE_IMAP
- else if (folder->ff->imap)
- {
- /* mark folders with subfolders AND mail */
- snprintf (permission, sizeof (permission), "IMAP %c",
- (folder->ff->inferiors && folder->ff->selectable) ? '+' : ' ');
- mutt_format_s (dest, destlen, fmt, permission);
- }
+ else if (folder->ff->imap) {
+ /* mark folders with subfolders AND mail */
+ snprintf (permission, sizeof (permission), "IMAP %c",
+ (folder->ff->inferiors
+ && folder->ff->selectable) ? '+' : ' ');
+ mutt_format_s (dest, destlen, fmt, permission);
+ }
#endif
- else
- mutt_format_s (dest, destlen, fmt, "");
- break;
-
- case 'g':
- if (folder->ff->st != NULL)
- {
- if ((gr = getgrgid (folder->ff->st->st_gid)))
- mutt_format_s (dest, destlen, fmt, gr->gr_name);
- else
- {
- snprintf (tmp, sizeof (tmp), "%%%sld", fmt);
- snprintf (dest, destlen, tmp, folder->ff->st->st_gid);
- }
- }
- else
- mutt_format_s (dest, destlen, fmt, "");
- break;
-
- case 'l':
- if (folder->ff->st != NULL)
- {
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, folder->ff->st->st_nlink);
+ else
+ mutt_format_s (dest, destlen, fmt, "");
+ break;
+
+ case 'g':
+ if (folder->ff->st != NULL) {
+ if ((gr = getgrgid (folder->ff->st->st_gid)))
+ mutt_format_s (dest, destlen, fmt, gr->gr_name);
+ else {
+ snprintf (tmp, sizeof (tmp), "%%%sld", fmt);
+ snprintf (dest, destlen, tmp, folder->ff->st->st_gid);
}
- else
- mutt_format_s (dest, destlen, fmt, "");
- break;
-
- case 'N':
+ }
+ else
+ mutt_format_s (dest, destlen, fmt, "");
+ break;
+
+ case 'l':
+ if (folder->ff->st != NULL) {
+ snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+ snprintf (dest, destlen, tmp, folder->ff->st->st_nlink);
+ }
+ else
+ mutt_format_s (dest, destlen, fmt, "");
+ break;
+
+ case 'N':
#ifdef USE_IMAP
- if (mx_is_imap (folder->ff->desc))
- {
- if (!optional)
- {
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, folder->ff->new);
- }
- else if (!folder->ff->new)
- optional = 0;
- break;
- }
-#endif
- snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
- snprintf (dest, destlen, tmp, folder->ff->new ? 'N' : ' ');
- break;
-
- case 's':
- if (folder->ff->st != NULL)
- {
- snprintf (tmp, sizeof (tmp), "%%%sld", fmt);
- snprintf (dest, destlen, tmp, (long) folder->ff->st->st_size);
+ if (mx_is_imap (folder->ff->desc)) {
+ if (!optional) {
+ snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+ snprintf (dest, destlen, tmp, folder->ff->new);
}
- else
- mutt_format_s (dest, destlen, fmt, "");
- break;
-
- case 't':
- snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
- snprintf (dest, destlen, tmp, folder->ff->tagged ? '*' : ' ');
+ else if (!folder->ff->new)
+ optional = 0;
break;
-
- case 'u':
- if (folder->ff->st != NULL)
- {
- if ((pw = getpwuid (folder->ff->st->st_uid)))
- mutt_format_s (dest, destlen, fmt, pw->pw_name);
- else
- {
- snprintf (tmp, sizeof (tmp), "%%%sld", fmt);
- snprintf (dest, destlen, tmp, folder->ff->st->st_uid);
- }
+ }
+#endif
+ snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
+ snprintf (dest, destlen, tmp, folder->ff->new ? 'N' : ' ');
+ break;
+
+ case 's':
+ if (folder->ff->st != NULL) {
+ snprintf (tmp, sizeof (tmp), "%%%sld", fmt);
+ snprintf (dest, destlen, tmp, (long) folder->ff->st->st_size);
+ }
+ else
+ mutt_format_s (dest, destlen, fmt, "");
+ break;
+
+ case 't':
+ snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
+ snprintf (dest, destlen, tmp, folder->ff->tagged ? '*' : ' ');
+ break;
+
+ case 'u':
+ if (folder->ff->st != NULL) {
+ if ((pw = getpwuid (folder->ff->st->st_uid)))
+ mutt_format_s (dest, destlen, fmt, pw->pw_name);
+ else {
+ snprintf (tmp, sizeof (tmp), "%%%sld", fmt);
+ snprintf (dest, destlen, tmp, folder->ff->st->st_uid);
}
- else
- mutt_format_s (dest, destlen, fmt, "");
- break;
-
- default:
- snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
- snprintf (dest, destlen, tmp, op);
- break;
+ }
+ else
+ mutt_format_s (dest, destlen, fmt, "");
+ break;
+
+ default:
+ snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
+ snprintf (dest, destlen, tmp, op);
+ break;
}
if (optional)
}
#ifdef USE_NNTP
-static const char *
-newsgroup_format_str (char *dest, size_t destlen, char op, const char *src,
- const char *fmt, const char *ifstring, const char *elsestring,
- unsigned long data, format_flag flags)
+static const char *newsgroup_format_str (char *dest, size_t destlen, char op,
+ const char *src, const char *fmt,
+ const char *ifstring,
+ const char *elsestring,
+ unsigned long data,
+ format_flag flags)
{
char fn[SHORT_STRING], tmp[SHORT_STRING];
FOLDER *folder = (FOLDER *) data;
- switch (op)
- {
- case 'C':
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, folder->num + 1);
- break;
-
- case 'f':
- strncpy (fn, folder->ff->name, sizeof(fn) - 1);
- snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
- snprintf (dest, destlen, tmp, fn);
- break;
-
- case 'N':
- snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
- if (folder->ff->nd->subscribed)
- snprintf (dest, destlen, tmp, ' ');
- else
- snprintf (dest, destlen, tmp, folder->ff->new ? 'N' : 'u');
- break;
-
- case 'M':
- snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
- if (folder->ff->nd->deleted)
- snprintf (dest, destlen, tmp, 'D');
- else
- snprintf (dest, destlen, tmp, folder->ff->nd->allowed ? ' ' : '-');
- break;
+ switch (op) {
+ case 'C':
+ snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+ snprintf (dest, destlen, tmp, folder->num + 1);
+ break;
+
+ case 'f':
+ strncpy (fn, folder->ff->name, sizeof (fn) - 1);
+ snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
+ snprintf (dest, destlen, tmp, fn);
+ break;
+
+ case 'N':
+ snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
+ if (folder->ff->nd->subscribed)
+ snprintf (dest, destlen, tmp, ' ');
+ else
+ snprintf (dest, destlen, tmp, folder->ff->new ? 'N' : 'u');
+ break;
- case 's':
- if (flags & M_FORMAT_OPTIONAL)
- {
- if (folder->ff->nd->unread != 0)
- mutt_FormatString (dest, destlen, ifstring, newsgroup_format_str,
- data, flags);
- else
- mutt_FormatString (dest, destlen, elsestring, newsgroup_format_str,
- data, flags);
- }
- else if (Context && Context->data == folder->ff->nd)
- {
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, Context->unread);
- }
+ case 'M':
+ snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
+ if (folder->ff->nd->deleted)
+ snprintf (dest, destlen, tmp, 'D');
+ else
+ snprintf (dest, destlen, tmp, folder->ff->nd->allowed ? ' ' : '-');
+ break;
+
+ case 's':
+ if (flags & M_FORMAT_OPTIONAL) {
+ if (folder->ff->nd->unread != 0)
+ mutt_FormatString (dest, destlen, ifstring, newsgroup_format_str,
+ data, flags);
else
- {
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, folder->ff->nd->unread);
- }
- break;
+ mutt_FormatString (dest, destlen, elsestring, newsgroup_format_str,
+ data, flags);
+ }
+ else if (Context && Context->data == folder->ff->nd) {
+ snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+ snprintf (dest, destlen, tmp, Context->unread);
+ }
+ else {
+ snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+ snprintf (dest, destlen, tmp, folder->ff->nd->unread);
+ }
+ break;
- case 'n':
- if (Context && Context->data == folder->ff->nd)
- {
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, Context->new);
- }
- else if (option (OPTMARKOLD) &&
- folder->ff->nd->lastCached >= folder->ff->nd->firstMessage &&
- folder->ff->nd->lastCached <= folder->ff->nd->lastMessage)
- {
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, folder->ff->nd->lastMessage - folder->ff->nd->lastCached);
- }
- else
- {
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, folder->ff->nd->unread);
- }
- break;
+ case 'n':
+ if (Context && Context->data == folder->ff->nd) {
+ snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+ snprintf (dest, destlen, tmp, Context->new);
+ }
+ else if (option (OPTMARKOLD) &&
+ folder->ff->nd->lastCached >= folder->ff->nd->firstMessage &&
+ folder->ff->nd->lastCached <= folder->ff->nd->lastMessage) {
+ snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+ snprintf (dest, destlen, tmp,
+ folder->ff->nd->lastMessage - folder->ff->nd->lastCached);
+ }
+ else {
+ snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+ snprintf (dest, destlen, tmp, folder->ff->nd->unread);
+ }
+ break;
- case 'd':
- if (folder->ff->nd->desc != NULL)
- {
- snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
- snprintf (dest, destlen, tmp, folder->ff->nd->desc);
- }
- else
- {
- snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
- snprintf (dest, destlen, tmp, "");
- }
- break;
+ case 'd':
+ if (folder->ff->nd->desc != NULL) {
+ snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
+ snprintf (dest, destlen, tmp, folder->ff->nd->desc);
+ }
+ else {
+ snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
+ snprintf (dest, destlen, tmp, "");
+ }
+ break;
}
return (src);
}
#endif /* USE_NNTP */
-static void add_folder (MUTTMENU *m, struct browser_state *state,
- const char *name, const struct stat *s,
- void *data, int new)
+static void add_folder (MUTTMENU * m, struct browser_state *state,
+ const char *name, const struct stat *s,
+ void *data, int new)
{
- if (state->entrylen == state->entrymax)
- {
+ if (state->entrylen == state->entrymax) {
/* need to allocate more space */
safe_realloc (&state->entry,
- sizeof (struct folder_file) * (state->entrymax += 256));
+ sizeof (struct folder_file) * (state->entrymax += 256));
memset (&state->entry[state->entrylen], 0,
- sizeof (struct folder_file) * 256);
+ sizeof (struct folder_file) * 256);
if (m)
m->data = state->entry;
}
- if (s != NULL)
- {
+ if (s != NULL) {
(state->entry)[state->entrylen].mode = s->st_mode;
(state->entry)[state->entrylen].mtime = s->st_mtime;
(state->entry)[state->entrylen].size = s->st_size;
-
+
(state->entry)[state->entrylen].st = safe_malloc (sizeof (struct stat));
memcpy ((state->entry)[state->entrylen].st, s, sizeof (struct stat));
}
(state->entrylen)++;
}
-static void init_state (struct browser_state *state, MUTTMENU *menu)
+static void init_state (struct browser_state *state, MUTTMENU * menu)
{
state->entrylen = 0;
state->entrymax = 256;
- state->entry = (struct folder_file *) safe_calloc (state->entrymax, sizeof (struct folder_file));
+ state->entry =
+ (struct folder_file *) safe_calloc (state->entrymax,
+ sizeof (struct folder_file));
#ifdef USE_IMAP
state->imap_browse = 0;
#endif
}
/* get list of all files/newsgroups with mask */
-static int examine_directory (MUTTMENU *menu, struct browser_state *state,
- char *d, const char *prefix)
+static int examine_directory (MUTTMENU * menu, struct browser_state *state,
+ char *d, const char *prefix)
{
#ifdef USE_NNTP
- if (option (OPTNEWS))
- {
+ if (option (OPTNEWS)) {
LIST *tmp;
NNTP_DATA *data;
NNTP_SERVER *news = CurrentNewsSrv;
/* mutt_buffy_check (0); */
init_state (state, menu);
- for (tmp = news->list; tmp; tmp = tmp->next)
- {
- if (!(data = (NNTP_DATA *)tmp->data))
- continue;
+ for (tmp = news->list; tmp; tmp = tmp->next) {
+ if (!(data = (NNTP_DATA *) tmp->data))
+ continue;
if (prefix && *prefix && strncmp (prefix, data->group,
- strlen (prefix)) != 0)
- continue;
+ strlen (prefix)) != 0)
+ continue;
if (!((regexec (Mask.rx, data->group, 0, NULL, 0) == 0) ^ Mask.not))
- continue;
+ continue;
add_folder (menu, state, data->group, NULL, data, data->new);
}
}
else
#endif /* USE_NNTP */
{
- struct stat s;
- DIR *dp;
- struct dirent *de;
- char buffer[_POSIX_PATH_MAX + SHORT_STRING];
- BUFFY *tmp;
+ struct stat s;
+ DIR *dp;
+ struct dirent *de;
+ char buffer[_POSIX_PATH_MAX + SHORT_STRING];
+ BUFFY *tmp;
+
+ while (stat (d, &s) == -1) {
+ if (errno == ENOENT) {
+ /* The last used directory is deleted, try to use the parent dir. */
+ char *c = strrchr (d, '/');
+
+ if (c && (c > d)) {
+ *c = 0;
+ continue;
+ }
+ }
+ mutt_perror (d);
+ return (-1);
+ }
- while (stat (d, &s) == -1)
- {
- if (errno == ENOENT)
- {
- /* The last used directory is deleted, try to use the parent dir. */
- char *c = strrchr (d, '/');
+ if (!S_ISDIR (s.st_mode)) {
+ mutt_error (_("%s is not a directory."), d);
+ return (-1);
+ }
- if (c && (c > d))
- {
- *c = 0;
- continue;
- }
+ mutt_buffy_check (0);
+
+ if ((dp = opendir (d)) == NULL) {
+ mutt_perror (d);
+ return (-1);
}
- mutt_perror (d);
- return (-1);
- }
- if (!S_ISDIR (s.st_mode))
- {
- mutt_error (_("%s is not a directory."), d);
- return (-1);
- }
+ init_state (state, menu);
- mutt_buffy_check (0);
+ while ((de = readdir (dp)) != NULL) {
+ if (mutt_strcmp (de->d_name, ".") == 0)
+ continue; /* we don't need . */
- if ((dp = opendir (d)) == NULL)
- {
- mutt_perror (d);
- return (-1);
- }
+ if (prefix && *prefix
+ && mutt_strncmp (prefix, de->d_name, mutt_strlen (prefix)) != 0)
+ continue;
+ if (!((regexec (Mask.rx, de->d_name, 0, NULL, 0) == 0) ^ Mask.not))
+ continue;
- init_state (state, menu);
+ mutt_concat_path (buffer, d, de->d_name, sizeof (buffer));
+ if (lstat (buffer, &s) == -1)
+ continue;
- while ((de = readdir (dp)) != NULL)
- {
- if (mutt_strcmp (de->d_name, ".") == 0)
- continue; /* we don't need . */
-
- if (prefix && *prefix && mutt_strncmp (prefix, de->d_name, mutt_strlen (prefix)) != 0)
- continue;
- if (!((regexec (Mask.rx, de->d_name, 0, NULL, 0) == 0) ^ Mask.not))
- continue;
-
- mutt_concat_path (buffer, d, de->d_name, sizeof (buffer));
- if (lstat (buffer, &s) == -1)
- continue;
-
- if ((! S_ISREG (s.st_mode)) && (! S_ISDIR (s.st_mode)) &&
- (! S_ISLNK (s.st_mode)))
- continue;
-
- tmp = Incoming;
- while (tmp && mutt_strcmp (buffer, tmp->path))
- tmp = tmp->next;
- add_folder (menu, state, de->d_name, &s, NULL, (tmp) ? tmp->new : 0);
- }
- closedir (dp);
+ if ((!S_ISREG (s.st_mode)) && (!S_ISDIR (s.st_mode)) &&
+ (!S_ISLNK (s.st_mode)))
+ continue;
+
+ tmp = Incoming;
+ while (tmp && mutt_strcmp (buffer, tmp->path))
+ tmp = tmp->next;
+ add_folder (menu, state, de->d_name, &s, NULL, (tmp) ? tmp->new : 0);
+ }
+ closedir (dp);
}
draw_sidebar (CurrentMenu);
browser_sort (state);
}
/* get list of mailboxes/subscribed newsgroups */
-static int examine_mailboxes (MUTTMENU *menu, struct browser_state *state)
+static int examine_mailboxes (MUTTMENU * menu, struct browser_state *state)
{
struct stat s;
char buffer[LONG_STRING];
#ifdef USE_NNTP
- if (option (OPTNEWS))
- {
+ if (option (OPTNEWS)) {
LIST *tmp;
NNTP_DATA *data;
NNTP_SERVER *news = CurrentNewsSrv;
/* mutt_buffy_check (0); */
init_state (state, menu);
- for (tmp = news->list; tmp; tmp = tmp->next)
- {
+ for (tmp = news->list; tmp; tmp = tmp->next) {
if ((data = (NNTP_DATA *) tmp->data) != NULL && (data->new ||
- (data->subscribed && (!option (OPTSHOWONLYUNREAD) || data->unread))))
- add_folder (menu, state, data->group, NULL, data, data->new);
+ (data->subscribed
+ &&
+ (!option
+ (OPTSHOWONLYUNREAD)
+ || data->unread))))
+ add_folder (menu, state, data->group, NULL, data, data->new);
}
}
else
init_state (state, menu);
- do
- {
+ do {
#ifdef USE_IMAP
- if (mx_is_imap (tmp->path))
- {
- add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
- continue;
+ if (mx_is_imap (tmp->path)) {
+ add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
+ continue;
}
#endif
#ifdef USE_POP
- if (mx_is_pop (tmp->path))
- {
- add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
- continue;
+ if (mx_is_pop (tmp->path)) {
+ add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
+ continue;
}
#endif
#ifdef USE_NNTP
- if (mx_is_nntp (tmp->path))
- {
- add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
- continue;
+ if (mx_is_nntp (tmp->path)) {
+ add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
+ continue;
}
#endif
if (lstat (tmp->path, &s) == -1)
- continue;
+ continue;
- if ((! S_ISREG (s.st_mode)) && (! S_ISDIR (s.st_mode)) &&
- (! S_ISLNK (s.st_mode)))
- continue;
-
- strfcpy (buffer, NONULL(tmp->path), sizeof (buffer));
+ if ((!S_ISREG (s.st_mode)) && (!S_ISDIR (s.st_mode)) &&
+ (!S_ISLNK (s.st_mode)))
+ continue;
+
+ strfcpy (buffer, NONULL (tmp->path), sizeof (buffer));
mutt_pretty_mailbox (buffer);
add_folder (menu, state, buffer, &s, NULL, tmp->new);
return 0;
}
-static int select_file_search (MUTTMENU *menu, regex_t *re, int n)
+static int select_file_search (MUTTMENU * menu, regex_t * re, int n)
{
#ifdef USE_NNTP
if (option (OPTNEWS))
- return (regexec (re, ((struct folder_file *) menu->data)[n].desc, 0, NULL, 0));
+ return (regexec
+ (re, ((struct folder_file *) menu->data)[n].desc, 0, NULL, 0));
#endif
- return (regexec (re, ((struct folder_file *) menu->data)[n].name, 0, NULL, 0));
+ return (regexec
+ (re, ((struct folder_file *) menu->data)[n].name, 0, NULL, 0));
}
-static void folder_entry (char *s, size_t slen, MUTTMENU *menu, int num)
+static void folder_entry (char *s, size_t slen, MUTTMENU * menu, int num)
{
FOLDER folder;
folder.ff = &((struct folder_file *) menu->data)[num];
folder.num = num;
-
+
#ifdef USE_NNTP
if (option (OPTNEWS))
- mutt_FormatString (s, slen, NONULL(GroupFormat), newsgroup_format_str,
- (unsigned long) &folder, M_FORMAT_ARROWCURSOR);
+ mutt_FormatString (s, slen, NONULL (GroupFormat), newsgroup_format_str,
+ (unsigned long) &folder, M_FORMAT_ARROWCURSOR);
else
#endif
- mutt_FormatString (s, slen, NONULL(FolderFormat), folder_format_str,
- (unsigned long) &folder, M_FORMAT_ARROWCURSOR);
+ mutt_FormatString (s, slen, NONULL (FolderFormat), folder_format_str,
+ (unsigned long) &folder, M_FORMAT_ARROWCURSOR);
}
-static void init_menu (struct browser_state *state, MUTTMENU *menu, char *title,
- size_t titlelen, int buffy)
+static void init_menu (struct browser_state *state, MUTTMENU * menu,
+ char *title, size_t titlelen, int buffy)
{
char path[_POSIX_PATH_MAX];
menu->max = state->entrylen;
- if(menu->current >= menu->max)
+ if (menu->current >= menu->max)
menu->current = menu->max - 1;
if (menu->current < 0)
menu->current = 0;
menu->tagged = 0;
#ifdef USE_NNTP
- if (option (OPTNEWS))
- {
+ if (option (OPTNEWS)) {
if (buffy)
snprintf (title, titlelen, "%s", _("Subscribed newsgroups"));
else
snprintf (title, titlelen, _("Newsgroups on server [%s]"),
- CurrentNewsSrv->conn->account.host);
+ CurrentNewsSrv->conn->account.host);
}
else
#endif
if (buffy)
snprintf (title, titlelen, _("Mailboxes [%d]"), mutt_buffy_check (0));
- else
- {
+ else {
strfcpy (path, LastDir, sizeof (path));
mutt_pretty_mailbox (path);
#ifdef USE_IMAP
- if (state->imap_browse && option (OPTIMAPLSUB))
- snprintf (title, titlelen, _("Subscribed [%s], File mask: %s"),
- path, NONULL (Mask.pattern));
- else
+ if (state->imap_browse && option (OPTIMAPLSUB))
+ snprintf (title, titlelen, _("Subscribed [%s], File mask: %s"),
+ path, NONULL (Mask.pattern));
+ else
#endif
- snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
- path, NONULL(Mask.pattern));
+ snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
+ path, NONULL (Mask.pattern));
}
menu->redraw = REDRAW_FULL;
}
-static int file_tag (MUTTMENU *menu, int n, int m)
+static int file_tag (MUTTMENU * menu, int n, int m)
{
- struct folder_file *ff = &(((struct folder_file *)menu->data)[n]);
+ struct folder_file *ff = &(((struct folder_file *) menu->data)[n]);
int ot;
- if (S_ISDIR (ff->mode) || (S_ISLNK (ff->mode) && link_is_dir (LastDir, ff->name)))
- {
+
+ if (S_ISDIR (ff->mode)
+ || (S_ISLNK (ff->mode) && link_is_dir (LastDir, ff->name))) {
mutt_error _("Can't attach a directory!");
+
return 0;
}
-
+
ot = ff->tagged;
ff->tagged = (m >= 0 ? m : !ff->tagged);
-
+
return ff->tagged - ot;
}
-void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *numfiles)
+void _mutt_select_file (char *f, size_t flen, int flags, char ***files,
+ int *numfiles)
{
char buf[_POSIX_PATH_MAX];
char prefix[_POSIX_PATH_MAX] = "";
MUTTMENU *menu;
struct stat st;
int i, killPrefix = 0;
- int multiple = (flags & M_SEL_MULTI) ? 1 : 0;
- int folder = (flags & M_SEL_FOLDER) ? 1 : 0;
- int buffy = (flags & M_SEL_BUFFY) ? 1 : 0;
+ int multiple = (flags & M_SEL_MULTI) ? 1 : 0;
+ int folder = (flags & M_SEL_FOLDER) ? 1 : 0;
+ int buffy = (flags & M_SEL_BUFFY) ? 1 : 0;
buffy = buffy && folder;
-
+
memset (&state, 0, sizeof (struct browser_state));
if (!folder)
strfcpy (LastDirBackup, LastDir, sizeof (LastDirBackup));
#ifdef USE_NNTP
- if (option (OPTNEWS))
- {
+ if (option (OPTNEWS)) {
if (*f)
strfcpy (prefix, f, sizeof (prefix));
- else
- {
+ else {
LIST *list;
/* default state for news reader mode is browse subscribed newsgroups */
buffy = 0;
- for (list = CurrentNewsSrv->list; list; list = list->next)
- {
- NNTP_DATA *data = (NNTP_DATA *) list->data;
+ for (list = CurrentNewsSrv->list; list; list = list->next) {
+ NNTP_DATA *data = (NNTP_DATA *) list->data;
- if (data && data->subscribed)
- {
- buffy = 1;
- break;
- }
+ if (data && data->subscribed) {
+ buffy = 1;
+ break;
+ }
}
}
}
else
#endif
- if (*f)
- {
+ if (*f) {
mutt_expand_path (f, flen);
#ifdef USE_IMAP
- if (mx_is_imap (f))
- {
+ if (mx_is_imap (f)) {
init_state (&state, NULL);
state.imap_browse = 1;
imap_browse (f, &state);
strfcpy (LastDir, state.folder, sizeof (LastDir));
}
- else
- {
+ else {
#endif
- for (i = mutt_strlen (f) - 1; i > 0 && f[i] != '/' ; i--);
- if (i > 0)
- {
- if (f[0] == '/')
- {
- if (i > sizeof (LastDir) - 1) i = sizeof (LastDir) - 1;
- strncpy (LastDir, f, i);
- LastDir[i] = 0;
+ for (i = mutt_strlen (f) - 1; i > 0 && f[i] != '/'; i--);
+ if (i > 0) {
+ if (f[0] == '/') {
+ if (i > sizeof (LastDir) - 1)
+ i = sizeof (LastDir) - 1;
+ strncpy (LastDir, f, i);
+ LastDir[i] = 0;
+ }
+ else {
+ getcwd (LastDir, sizeof (LastDir));
+ safe_strcat (LastDir, sizeof (LastDir), "/");
+ safe_strncat (LastDir, sizeof (LastDir), f, i);
+ }
}
- else
- {
- getcwd (LastDir, sizeof (LastDir));
- safe_strcat (LastDir, sizeof (LastDir), "/");
- safe_strncat (LastDir, sizeof (LastDir), f, i);
+ else {
+ if (f[0] == '/')
+ strcpy (LastDir, "/"); /* __STRCPY_CHECKED__ */
+ else
+ getcwd (LastDir, sizeof (LastDir));
}
- }
- else
- {
- if (f[0] == '/')
- strcpy (LastDir, "/"); /* __STRCPY_CHECKED__ */
- else
- getcwd (LastDir, sizeof (LastDir));
- }
- if (i <= 0 && f[0] != '/')
- strfcpy (prefix, f, sizeof (prefix));
- else
- strfcpy (prefix, f + i + 1, sizeof (prefix));
- killPrefix = 1;
+ if (i <= 0 && f[0] != '/')
+ strfcpy (prefix, f, sizeof (prefix));
+ else
+ strfcpy (prefix, f + i + 1, sizeof (prefix));
+ killPrefix = 1;
#ifdef USE_IMAP
}
#endif
}
- else
- {
+ else {
if (!folder)
getcwd (LastDir, sizeof (LastDir));
else if (!LastDir[0])
- strfcpy (LastDir, NONULL(Maildir), sizeof (LastDir));
-
+ strfcpy (LastDir, NONULL (Maildir), sizeof (LastDir));
+
#ifdef USE_IMAP
- if (!buffy && mx_is_imap (LastDir))
- {
+ if (!buffy && mx_is_imap (LastDir)) {
init_state (&state, NULL);
state.imap_browse = 1;
imap_browse (LastDir, &state);
*f = 0;
- if (buffy)
- {
+ if (buffy) {
if (examine_mailboxes (NULL, &state) == -1)
goto bail;
}
#ifdef USE_IMAP
if (!state.imap_browse)
#endif
- if (examine_directory (NULL, &state, LastDir, prefix) == -1)
- goto bail;
+ if (examine_directory (NULL, &state, LastDir, prefix) == -1)
+ goto bail;
menu = mutt_new_menu ();
menu->menu = MENU_FOLDER;
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_FOLDER,
#ifdef USE_NNTP
- (option (OPTNEWS)) ? FolderNewsHelp :
+ (option (OPTNEWS)) ? FolderNewsHelp :
#endif
- FolderHelp);
+ FolderHelp);
init_menu (&state, menu, title, sizeof (title), buffy);
- FOREVER
- {
- switch (i = mutt_menuLoop (menu))
- {
- case OP_GENERIC_SELECT_ENTRY:
+ FOREVER {
+ switch (i = mutt_menuLoop (menu)) {
+ case OP_GENERIC_SELECT_ENTRY:
- if (!state.entrylen)
- {
- mutt_error _("No files match the file mask");
- break;
- }
+ if (!state.entrylen) {
+ mutt_error _("No files match the file mask");
+
+ break;
+ }
- if (S_ISDIR (state.entry[menu->current].mode) ||
- (S_ISLNK (state.entry[menu->current].mode) &&
- link_is_dir (LastDir, state.entry[menu->current].name))
+ if (S_ISDIR (state.entry[menu->current].mode) ||
+ (S_ISLNK (state.entry[menu->current].mode) &&
+ link_is_dir (LastDir, state.entry[menu->current].name))
#ifdef USE_IMAP
- || state.entry[menu->current].inferiors
+ || state.entry[menu->current].inferiors
#endif
- )
- {
- /* make sure this isn't a MH or maildir mailbox */
- if (buffy)
- {
- strfcpy (buf, state.entry[menu->current].name, sizeof (buf));
- mutt_expand_path (buf, sizeof (buf));
- }
+ ) {
+ /* make sure this isn't a MH or maildir mailbox */
+ if (buffy) {
+ strfcpy (buf, state.entry[menu->current].name, sizeof (buf));
+ mutt_expand_path (buf, sizeof (buf));
+ }
#ifdef USE_IMAP
- else if (state.imap_browse)
- {
- strfcpy (buf, state.entry[menu->current].name, sizeof (buf));
- }
+ else if (state.imap_browse) {
+ strfcpy (buf, state.entry[menu->current].name, sizeof (buf));
+ }
#endif
- else
- mutt_concat_path (buf, LastDir, state.entry[menu->current].name, sizeof (buf));
+ else
+ mutt_concat_path (buf, LastDir, state.entry[menu->current].name,
+ sizeof (buf));
- if ((mx_get_magic (buf) <= 0)
+ if ((mx_get_magic (buf) <= 0)
#ifdef USE_IMAP
- || state.entry[menu->current].inferiors
+ || state.entry[menu->current].inferiors
#endif
- )
- {
- char OldLastDir[_POSIX_PATH_MAX];
-
- /* save the old directory */
- strfcpy (OldLastDir, LastDir, sizeof (OldLastDir));
-
- if (mutt_strcmp (state.entry[menu->current].name, "..") == 0)
- {
- if (mutt_strcmp ("..", LastDir + mutt_strlen (LastDir) - 2) == 0)
- strcat (LastDir, "/.."); /* __STRCAT_CHECKED__ */
- else
- {
- char *p = strrchr (LastDir + 1, '/');
-
- if (p)
- *p = 0;
- else
- {
- if (LastDir[0] == '/')
- LastDir[1] = 0;
- else
- strcat (LastDir, "/.."); /* __STRCAT_CHECKED__ */
- }
- }
- }
- else if (buffy)
- {
- strfcpy (LastDir, state.entry[menu->current].name, sizeof (LastDir));
- mutt_expand_path (LastDir, sizeof (LastDir));
- }
+ ) {
+ char OldLastDir[_POSIX_PATH_MAX];
+
+ /* save the old directory */
+ strfcpy (OldLastDir, LastDir, sizeof (OldLastDir));
+
+ if (mutt_strcmp (state.entry[menu->current].name, "..") == 0) {
+ if (mutt_strcmp ("..", LastDir + mutt_strlen (LastDir) - 2) == 0)
+ strcat (LastDir, "/.."); /* __STRCAT_CHECKED__ */
+ else {
+ char *p = strrchr (LastDir + 1, '/');
+
+ if (p)
+ *p = 0;
+ else {
+ if (LastDir[0] == '/')
+ LastDir[1] = 0;
+ else
+ strcat (LastDir, "/.."); /* __STRCAT_CHECKED__ */
+ }
+ }
+ }
+ else if (buffy) {
+ strfcpy (LastDir, state.entry[menu->current].name,
+ sizeof (LastDir));
+ mutt_expand_path (LastDir, sizeof (LastDir));
+ }
#ifdef USE_IMAP
- else if (state.imap_browse)
- {
- int n;
- ciss_url_t url;
-
- strfcpy (LastDir, state.entry[menu->current].name,
- sizeof (LastDir));
- /* tack on delimiter here */
- n = strlen (LastDir)+1;
-
- /* special case "" needs no delimiter */
- url_parse_ciss (&url, state.entry[menu->current].name);
- if (url.path &&
- (state.entry[menu->current].delim != '\0') &&
- (n < sizeof (LastDir)))
- {
- LastDir[n] = '\0';
- LastDir[n-1] = state.entry[menu->current].delim;
- }
- }
+ else if (state.imap_browse) {
+ int n;
+ ciss_url_t url;
+
+ strfcpy (LastDir, state.entry[menu->current].name,
+ sizeof (LastDir));
+ /* tack on delimiter here */
+ n = strlen (LastDir) + 1;
+
+ /* special case "" needs no delimiter */
+ url_parse_ciss (&url, state.entry[menu->current].name);
+ if (url.path &&
+ (state.entry[menu->current].delim != '\0') &&
+ (n < sizeof (LastDir))) {
+ LastDir[n] = '\0';
+ LastDir[n - 1] = state.entry[menu->current].delim;
+ }
+ }
#endif
- else
- {
- char tmp[_POSIX_PATH_MAX];
- mutt_concat_path (tmp, LastDir, state.entry[menu->current].name, sizeof (tmp));
- strfcpy (LastDir, tmp, sizeof (LastDir));
- }
-
- destroy_state (&state);
- if (killPrefix)
- {
- prefix[0] = 0;
- killPrefix = 0;
- }
- buffy = 0;
+ else {
+ char tmp[_POSIX_PATH_MAX];
+
+ mutt_concat_path (tmp, LastDir, state.entry[menu->current].name,
+ sizeof (tmp));
+ strfcpy (LastDir, tmp, sizeof (LastDir));
+ }
+
+ destroy_state (&state);
+ if (killPrefix) {
+ prefix[0] = 0;
+ killPrefix = 0;
+ }
+ buffy = 0;
#ifdef USE_IMAP
- if (state.imap_browse)
- {
- init_state (&state, NULL);
- state.imap_browse = 1;
- imap_browse (LastDir, &state);
- menu->data = state.entry;
- }
- else
+ if (state.imap_browse) {
+ init_state (&state, NULL);
+ state.imap_browse = 1;
+ imap_browse (LastDir, &state);
+ menu->data = state.entry;
+ }
+ else
#endif
- if (examine_directory (menu, &state, LastDir, prefix) == -1)
- {
- /* try to restore the old values */
- strfcpy (LastDir, OldLastDir, sizeof (LastDir));
- if (examine_directory (menu, &state, LastDir, prefix) == -1)
- {
- strfcpy (LastDir, NONULL(Homedir), sizeof (LastDir));
- goto bail;
- }
- }
- menu->current = 0;
- menu->top = 0;
- init_menu (&state, menu, title, sizeof (title), buffy);
- break;
- }
- }
+ if (examine_directory (menu, &state, LastDir, prefix) == -1) {
+ /* try to restore the old values */
+ strfcpy (LastDir, OldLastDir, sizeof (LastDir));
+ if (examine_directory (menu, &state, LastDir, prefix) == -1) {
+ strfcpy (LastDir, NONULL (Homedir), sizeof (LastDir));
+ goto bail;
+ }
+ }
+ menu->current = 0;
+ menu->top = 0;
+ init_menu (&state, menu, title, sizeof (title), buffy);
+ break;
+ }
+ }
#ifdef USE_NNTP
- if (buffy || option (OPTNEWS)) /* news have not path */
+ if (buffy || option (OPTNEWS)) /* news have not path */
#else
- if (buffy)
+ if (buffy)
#endif
- {
- strfcpy (f, state.entry[menu->current].name, flen);
- mutt_expand_path (f, flen);
- }
+ {
+ strfcpy (f, state.entry[menu->current].name, flen);
+ mutt_expand_path (f, flen);
+ }
#ifdef USE_IMAP
- else if (state.imap_browse)
- strfcpy (f, state.entry[menu->current].name, flen);
+ else if (state.imap_browse)
+ strfcpy (f, state.entry[menu->current].name, flen);
#endif
- else
- mutt_concat_path (f, LastDir, state.entry[menu->current].name, flen);
-
- /* Fall through to OP_EXIT */
-
- case OP_EXIT:
-
- if (multiple)
- {
- char **tfiles;
- int i, j;
-
- if (menu->tagged)
- {
- *numfiles = menu->tagged;
- tfiles = safe_calloc (*numfiles, sizeof (char *));
- for (i = 0, j = 0; i < state.entrylen; i++)
- {
- struct folder_file ff = state.entry[i];
- char full[_POSIX_PATH_MAX];
- if (ff.tagged)
- {
- mutt_concat_path (full, LastDir, ff.name, sizeof (full));
- mutt_expand_path (full, sizeof (full));
- tfiles[j++] = safe_strdup (full);
- }
- }
- *files = tfiles;
- }
- else if (f[0]) /* no tagged entries. return selected entry */
- {
- *numfiles = 1;
- tfiles = safe_calloc (*numfiles, sizeof (char *));
- mutt_expand_path (f, flen);
- tfiles[0] = safe_strdup (f);
- *files = tfiles;
- }
- }
-
- destroy_state (&state);
- mutt_menuDestroy (&menu);
- goto bail;
-
- case OP_BROWSER_TELL:
- if(state.entrylen)
- mutt_message("%s", state.entry[menu->current].name);
- break;
+ else
+ mutt_concat_path (f, LastDir, state.entry[menu->current].name, flen);
+
+ /* Fall through to OP_EXIT */
+
+ case OP_EXIT:
+
+ if (multiple) {
+ char **tfiles;
+ int i, j;
+
+ if (menu->tagged) {
+ *numfiles = menu->tagged;
+ tfiles = safe_calloc (*numfiles, sizeof (char *));
+ for (i = 0, j = 0; i < state.entrylen; i++) {
+ struct folder_file ff = state.entry[i];
+ char full[_POSIX_PATH_MAX];
+
+ if (ff.tagged) {
+ mutt_concat_path (full, LastDir, ff.name, sizeof (full));
+ mutt_expand_path (full, sizeof (full));
+ tfiles[j++] = safe_strdup (full);
+ }
+ }
+ *files = tfiles;
+ }
+ else if (f[0]) { /* no tagged entries. return selected entry */
+ *numfiles = 1;
+ tfiles = safe_calloc (*numfiles, sizeof (char *));
+ mutt_expand_path (f, flen);
+ tfiles[0] = safe_strdup (f);
+ *files = tfiles;
+ }
+ }
+
+ destroy_state (&state);
+ mutt_menuDestroy (&menu);
+ goto bail;
+
+ case OP_BROWSER_TELL:
+ if (state.entrylen)
+ mutt_message ("%s", state.entry[menu->current].name);
+ break;
#ifdef USE_IMAP
- case OP_BROWSER_TOGGLE_LSUB:
- if (option (OPTIMAPLSUB))
- {
- unset_option (OPTIMAPLSUB);
- }
- else
- {
- set_option (OPTIMAPLSUB);
- }
- mutt_ungetch (0, OP_CHECK_NEW);
- break;
-
- case OP_CREATE_MAILBOX:
- if (!state.imap_browse)
- mutt_error (_("Create is only supported for IMAP mailboxes"));
- else
- {
- imap_mailbox_create (LastDir);
- /* TODO: find a way to detect if the new folder would appear in
- * this window, and insert it without starting over. */
- destroy_state (&state);
- init_state (&state, NULL);
- state.imap_browse = 1;
- imap_browse (LastDir, &state);
- menu->data = state.entry;
- menu->current = 0;
- menu->top = 0;
- init_menu (&state, menu, title, sizeof (title), buffy);
- MAYBE_REDRAW (menu->redraw);
- }
- break;
-
- case OP_RENAME_MAILBOX:
- if (!state.entry[menu->current].imap)
- mutt_error (_("Rename is only supported for IMAP mailboxes"));
- else
- {
- int nentry = menu->current;
-
- if (imap_mailbox_rename (state.entry[nentry].name) >= 0) {
- destroy_state (&state);
- init_state (&state, NULL);
- state.imap_browse = 1;
- imap_browse (LastDir, &state);
- menu->data = state.entry;
- menu->current = 0;
- menu->top = 0;
- init_menu (&state, menu, title, sizeof (title), buffy);
- MAYBE_REDRAW (menu->redraw);
- }
- }
- break;
+ case OP_BROWSER_TOGGLE_LSUB:
+ if (option (OPTIMAPLSUB)) {
+ unset_option (OPTIMAPLSUB);
+ }
+ else {
+ set_option (OPTIMAPLSUB);
+ }
+ mutt_ungetch (0, OP_CHECK_NEW);
+ break;
+
+ case OP_CREATE_MAILBOX:
+ if (!state.imap_browse)
+ mutt_error (_("Create is only supported for IMAP mailboxes"));
+ else {
+ imap_mailbox_create (LastDir);
+ /* TODO: find a way to detect if the new folder would appear in
+ * this window, and insert it without starting over. */
+ destroy_state (&state);
+ init_state (&state, NULL);
+ state.imap_browse = 1;
+ imap_browse (LastDir, &state);
+ menu->data = state.entry;
+ menu->current = 0;
+ menu->top = 0;
+ init_menu (&state, menu, title, sizeof (title), buffy);
+ MAYBE_REDRAW (menu->redraw);
+ }
+ break;
+
+ case OP_RENAME_MAILBOX:
+ if (!state.entry[menu->current].imap)
+ mutt_error (_("Rename is only supported for IMAP mailboxes"));
+ else {
+ int nentry = menu->current;
+
+ if (imap_mailbox_rename (state.entry[nentry].name) >= 0) {
+ destroy_state (&state);
+ init_state (&state, NULL);
+ state.imap_browse = 1;
+ imap_browse (LastDir, &state);
+ menu->data = state.entry;
+ menu->current = 0;
+ menu->top = 0;
+ init_menu (&state, menu, title, sizeof (title), buffy);
+ MAYBE_REDRAW (menu->redraw);
+ }
+ }
+ break;
case OP_DELETE_MAILBOX:
- if (!state.entry[menu->current].imap)
- mutt_error (_("Delete is only supported for IMAP mailboxes"));
- else
- {
- char msg[SHORT_STRING];
- IMAP_MBOX mx;
- int nentry = menu->current;
-
- imap_parse_path (state.entry[nentry].name, &mx);
- snprintf (msg, sizeof (msg), _("Really delete mailbox \"%s\"?"),
- mx.mbox);
- if (mutt_yesorno (msg, M_NO) == M_YES)
- {
- if (!imap_delete_mailbox (Context, mx))
- {
- /* free the mailbox from the browser */
- FREE (&((state.entry)[nentry].name));
- FREE (&((state.entry)[nentry].desc));
- /* and move all other entries up */
- if (nentry+1 < state.entrylen)
- memmove (state.entry + nentry, state.entry + nentry + 1,
- sizeof (struct folder_file) * (state.entrylen - (nentry+1)));
- state.entrylen--;
- mutt_message _("Mailbox deleted.");
- init_menu (&state, menu, title, sizeof (title), buffy);
- MAYBE_REDRAW (menu->redraw);
- }
- }
- else
- mutt_message _("Mailbox not deleted.");
- FREE (&mx.mbox);
+ if (!state.entry[menu->current].imap)
+ mutt_error (_("Delete is only supported for IMAP mailboxes"));
+ else {
+ char msg[SHORT_STRING];
+ IMAP_MBOX mx;
+ int nentry = menu->current;
+
+ imap_parse_path (state.entry[nentry].name, &mx);
+ snprintf (msg, sizeof (msg), _("Really delete mailbox \"%s\"?"),
+ mx.mbox);
+ if (mutt_yesorno (msg, M_NO) == M_YES) {
+ if (!imap_delete_mailbox (Context, mx)) {
+ /* free the mailbox from the browser */
+ FREE (&((state.entry)[nentry].name));
+ FREE (&((state.entry)[nentry].desc));
+ /* and move all other entries up */
+ if (nentry + 1 < state.entrylen)
+ memmove (state.entry + nentry, state.entry + nentry + 1,
+ sizeof (struct folder_file) * (state.entrylen -
+ (nentry + 1)));
+ state.entrylen--;
+ mutt_message _("Mailbox deleted.");
+
+ init_menu (&state, menu, title, sizeof (title), buffy);
+ MAYBE_REDRAW (menu->redraw);
+ }
}
- break;
+ else
+ mutt_message _("Mailbox not deleted.");
+ FREE (&mx.mbox);
+ }
+ break;
#endif
-
- case OP_CHANGE_DIRECTORY:
+
+ case OP_CHANGE_DIRECTORY:
#ifdef USE_NNTP
- if (option (OPTNEWS))
- break;
+ if (option (OPTNEWS))
+ break;
#endif
- strfcpy (buf, LastDir, sizeof (buf));
+ strfcpy (buf, LastDir, sizeof (buf));
#ifdef USE_IMAP
- if (!state.imap_browse)
+ if (!state.imap_browse)
#endif
- {
- /* add '/' at the end of the directory name if not already there */
- int len=mutt_strlen(LastDir);
- if (len && LastDir[len-1] != '/' && sizeof (buf) > len)
- buf[len]='/';
- }
-
- if (mutt_get_field (_("Chdir to: "), buf, sizeof (buf), M_FILE) == 0 &&
- buf[0])
- {
- buffy = 0;
- mutt_expand_path (buf, sizeof (buf));
+ {
+ /* add '/' at the end of the directory name if not already there */
+ int len = mutt_strlen (LastDir);
+
+ if (len && LastDir[len - 1] != '/' && sizeof (buf) > len)
+ buf[len] = '/';
+ }
+
+ if (mutt_get_field (_("Chdir to: "), buf, sizeof (buf), M_FILE) == 0 &&
+ buf[0]) {
+ buffy = 0;
+ mutt_expand_path (buf, sizeof (buf));
#ifdef USE_IMAP
- if (mx_is_imap (buf))
- {
- strfcpy (LastDir, buf, sizeof (LastDir));
- destroy_state (&state);
- init_state (&state, NULL);
- state.imap_browse = 1;
- imap_browse (LastDir, &state);
- menu->data = state.entry;
- menu->current = 0;
- menu->top = 0;
- init_menu (&state, menu, title, sizeof (title), buffy);
- }
- else
+ if (mx_is_imap (buf)) {
+ strfcpy (LastDir, buf, sizeof (LastDir));
+ destroy_state (&state);
+ init_state (&state, NULL);
+ state.imap_browse = 1;
+ imap_browse (LastDir, &state);
+ menu->data = state.entry;
+ menu->current = 0;
+ menu->top = 0;
+ init_menu (&state, menu, title, sizeof (title), buffy);
+ }
+ else
#endif
- if (stat (buf, &st) == 0)
- {
- if (S_ISDIR (st.st_mode))
- {
- destroy_state (&state);
- if (examine_directory (menu, &state, buf, prefix) == 0)
- strfcpy (LastDir, buf, sizeof (LastDir));
- else
- {
- mutt_error _("Error scanning directory.");
- if (examine_directory (menu, &state, LastDir, prefix) == -1)
- {
- mutt_menuDestroy (&menu);
- goto bail;
- }
- }
- menu->current = 0;
- menu->top = 0;
- init_menu (&state, menu, title, sizeof (title), buffy);
- }
- else
- mutt_error (_("%s is not a directory."), buf);
- }
- else
- mutt_perror (buf);
- }
- MAYBE_REDRAW (menu->redraw);
- break;
-
- case OP_ENTER_MASK:
-
- strfcpy (buf, NONULL(Mask.pattern), sizeof (buf));
- if (mutt_get_field (_("File Mask: "), buf, sizeof (buf), 0) == 0)
- {
- regex_t *rx = (regex_t *) safe_malloc (sizeof (regex_t));
- char *s = buf;
- int not = 0, err;
-
- buffy = 0;
- /* assume that the user wants to see everything */
- if (!buf[0])
- strfcpy (buf, ".", sizeof (buf));
- SKIPWS (s);
- if (*s == '!')
- {
- s++;
- SKIPWS (s);
- not = 1;
- }
-
- if ((err = REGCOMP (rx, s, REG_NOSUB)) != 0)
- {
- regerror (err, rx, buf, sizeof (buf));
- regfree (rx);
- FREE (&rx);
- mutt_error ("%s", buf);
- }
- else
- {
- mutt_str_replace (&Mask.pattern, buf);
- regfree (Mask.rx);
- FREE (&Mask.rx);
- Mask.rx = rx;
- Mask.not = not;
-
- destroy_state (&state);
+ if (stat (buf, &st) == 0) {
+ if (S_ISDIR (st.st_mode)) {
+ destroy_state (&state);
+ if (examine_directory (menu, &state, buf, prefix) == 0)
+ strfcpy (LastDir, buf, sizeof (LastDir));
+ else {
+ mutt_error _("Error scanning directory.");
+
+ if (examine_directory (menu, &state, LastDir, prefix) == -1) {
+ mutt_menuDestroy (&menu);
+ goto bail;
+ }
+ }
+ menu->current = 0;
+ menu->top = 0;
+ init_menu (&state, menu, title, sizeof (title), buffy);
+ }
+ else
+ mutt_error (_("%s is not a directory."), buf);
+ }
+ else
+ mutt_perror (buf);
+ }
+ MAYBE_REDRAW (menu->redraw);
+ break;
+
+ case OP_ENTER_MASK:
+
+ strfcpy (buf, NONULL (Mask.pattern), sizeof (buf));
+ if (mutt_get_field (_("File Mask: "), buf, sizeof (buf), 0) == 0) {
+ regex_t *rx = (regex_t *) safe_malloc (sizeof (regex_t));
+ char *s = buf;
+ int not = 0, err;
+
+ buffy = 0;
+ /* assume that the user wants to see everything */
+ if (!buf[0])
+ strfcpy (buf, ".", sizeof (buf));
+ SKIPWS (s);
+ if (*s == '!') {
+ s++;
+ SKIPWS (s);
+ not = 1;
+ }
+
+ if ((err = REGCOMP (rx, s, REG_NOSUB)) != 0) {
+ regerror (err, rx, buf, sizeof (buf));
+ regfree (rx);
+ FREE (&rx);
+ mutt_error ("%s", buf);
+ }
+ else {
+ mutt_str_replace (&Mask.pattern, buf);
+ regfree (Mask.rx);
+ FREE (&Mask.rx);
+ Mask.rx = rx;
+ Mask.not = not;
+
+ destroy_state (&state);
#ifdef USE_IMAP
- if (state.imap_browse)
- {
- init_state (&state, NULL);
- state.imap_browse = 1;
- imap_browse (LastDir, &state);
- menu->data = state.entry;
- init_menu (&state, menu, title, sizeof (title), buffy);
- }
- else
+ if (state.imap_browse) {
+ init_state (&state, NULL);
+ state.imap_browse = 1;
+ imap_browse (LastDir, &state);
+ menu->data = state.entry;
+ init_menu (&state, menu, title, sizeof (title), buffy);
+ }
+ else
#endif
- if (examine_directory (menu, &state, LastDir, NULL) == 0)
- init_menu (&state, menu, title, sizeof (title), buffy);
- else
- {
- mutt_error _("Error scanning directory.");
- mutt_menuDestroy (&menu);
- goto bail;
- }
- killPrefix = 0;
- if (!state.entrylen)
- {
- mutt_error _("No files match the file mask");
- break;
- }
- }
- }
- MAYBE_REDRAW (menu->redraw);
- break;
-
- case OP_SORT:
- case OP_SORT_REVERSE:
-
- {
- int resort = 1;
- int reverse = (i == OP_SORT_REVERSE);
-
- switch (mutt_multi_choice ((reverse) ?
- _("Reverse sort by (d)ate, (a)lpha, si(z)e or do(n)'t sort? ") :
- _("Sort by (d)ate, (a)lpha, si(z)e or do(n)'t sort? "),
- _("dazn")))
- {
- case -1: /* abort */
- resort = 0;
- break;
-
- case 1: /* (d)ate */
- BrowserSort = SORT_DATE;
-&nb