/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * Copyright © 2007 Pierre Habouzit */ #include #include #include #include #include "../mutt.h" @import "base.cpkg" static char *madmutt_init_shell(void) { struct passwd *pw = getpwuid(getuid()); return m_strdup(pw ? pw->pw_shell : (getenv("SHELL") ?: "/bin/sh")); } static char *madmutt_init_username(void) { struct passwd *pw = getpwuid(getuid()); return m_strdup(pw ? pw->pw_name : (getenv("USER") ?: "john_doe")); } static char *madmutt_init_homedir(void) { struct passwd *pw = getpwuid(getuid()); return m_strdup(pw ? pw->pw_dir : (getenv("HOME") ?: "/")); } #if defined(HAVE_QDBM) # define HCACHE_BACKEND "qdbm" #elif defined(HAVE_GDBM) # define HCACHE_BACKEND "gdbm" #elif defined(HAVE_DB4) # define HCACHE_BACKEND "db4" #else # define HCACHE_BACKEND NULL #endif @package MCore { const string_t version = VERSION; const string_t sysconfdir = SYSCONFDIR; const string_t bindir = BINDIR; const string_t docdir = PKGDOCDIR; const string_t hcache_backend = HCACHE_BACKEND; path_t dotlock = m_strdup(BINDIR "/mutt_dotlock"); path_t editor = m_strdup(getenv("VISUAL") ?: getenv("EDITOR") ?: "vi"); path_t shell = madmutt_init_shell(); path_t username = madmutt_init_username(); path_t homedir = madmutt_init_homedir(); path_t tmpdir = m_strdup(getenv("TMPDIR") ?: "/tmp"); rx_t gecos_mask = luaM_rxnew("^[^,]*"); quadopt_t quit = M_YES; bool beep = 1; bool beep_new = 0; const string_t pwd(void) { char path[_POSIX_PATH_MAX]; getcwd(path, sizeof(path)); RETURN(path); }; }; @package MTransport { path_t sendmail = m_strdup(SENDMAIL " -eom -oi"); /* TODO: check it's NULL, hdrs or full */ string_t dsn_notify = NULL; /* TODO: check it's never, delay, failure, success with ',' */ string_t dsn_return = NULL; }; /* vim:set ft=c: */