/* -*- c -*- muttzilla.h, part of muttzilla v0.40 Copyright (C) 1999-2000 Brian D. Winters This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef MUTTZILLA_H #define MUTTZILLA_H #include /* #define CONFIG_GLOBAL can be commented out to disable use of config files. This is not recommended, and will probably cease to be optional in a future release. In general settings in the user config file override those in the global config file override those which are compiled in using the #defines below. Please note, however, that there are limits to what can be configured at run time. Disabling functionality by commenting out the #define will prevent use of that option at runtime: SUPPORT_MAIL, SUPPORT_NEWS. There are additional restrictions created by defining SUPPORT_MAIL or SUPPORT_NEWS. Netscape Communicator determines whether or not to use the Third Party API or its internal clients when the library is loaded by checking for the presence of the appropriate support functions. I have not confirmed this, but my expectation is that this check is performed before any library functions are called, so there is probably no way to perform any magic at run time to control whether it detects a the presence of mail or news support in the library. Even if such magic is possible, I don't know enough to implement it, so I guess that makes it a moot point unless some really enterprising person wants to work it all out for me. In case the previous paragraph didn't mean a lot to you, to paraphrase: If you define SUPPORT_MAIL below, Netscape Communicator will expect mail functions to be handled by muttzilla, and there is no way to decide at runtime to use Communicator's built in mail support instead. Also, reread the previous sentence replacing instances of "mail" and "MAIL" with, respectively, "news" and "NEWS". This is only an issue with Communicator since Navigator contains no built in functionality to disable. */ /******** CONFIGURATION SECTION ********/ /* expect everything in this section except CONFIG_GLOBAL, SUPPORT_MAIL and SUPPORT_NEWS to go away RSN */ #define CONFIG_GLOBAL "/usr/local/etc/muttzilla.conf" #define CONFIG_USER ".muttzillarc" #define CONFIG_REREAD 1 /* reread config files every time? */ /*#define DEBUG*/ /* use fprintf(stderr) to give debug info */ #define SUPPORT_MAIL /* see above for details */ /*#define SUPPORT_NEWS*/ /* see above for details */ #define TEMPDIR "/tmp" /* a valid directory must be defined here */ #define MAILPROG "mzmail.sh" /* mail reader script */ #define NEWSPROG "mznews.sh" /* news reader script */ /******** END OF CONFIGURATION ********/ /* data structures for passing information from our handlers for Netscape's API into the basic spawn_{mail,news} functions */ typedef struct { char *to; char *cc; char *bcc; char *subject; char *body; char *org; } mailparms; typedef struct { char *host; char *group; } newsparms; /* between creating tempfiles safely and making sure we clean up after ourselves, a lot of info needs to be tracked for each tempfile */ typedef struct tfile_info_s { struct tfile_info_s *next; char *filename; FILE *fp; int fd; } tempfile_info; extern tempfile_info *head; tempfile_info *open_tempfile(); int mzspawn(char *const argv[]); int mzspawn_mail(mailparms *parms); int mzspawn_news(newsparms *parms); /* runtime configuration support */ extern unsigned char mz_debug; extern char *mz_mailprog; extern char *mz_newsprog; void config_init(); void config_update(); void config_cleanup(); #endif /* #ifndef MUTTZILLA_H */